rundll32: Load the 16-bit kernel32 exports by ordinal.
This commit is contained in:
parent
584175bedf
commit
5e72f7b2a5
|
@ -88,7 +88,7 @@ static HINSTANCE16 load_dll16( LPCWSTR dll )
|
||||||
DWORD len = WideCharToMultiByte( CP_ACP, 0, dll, -1, NULL, 0, NULL, NULL );
|
DWORD len = WideCharToMultiByte( CP_ACP, 0, dll, -1, NULL, 0, NULL, NULL );
|
||||||
char *dllA = HeapAlloc( GetProcessHeap(), 0, len );
|
char *dllA = HeapAlloc( GetProcessHeap(), 0, len );
|
||||||
WideCharToMultiByte( CP_ACP, 0, dll, -1, dllA, len, NULL, NULL );
|
WideCharToMultiByte( CP_ACP, 0, dll, -1, dllA, len, NULL, NULL );
|
||||||
pLoadLibrary16 = (void *)GetProcAddress( GetModuleHandleA("kernel32.dll"), "LoadLibrary16" );
|
pLoadLibrary16 = (void *)GetProcAddress( GetModuleHandleA("kernel32.dll"), (LPCSTR)35 );
|
||||||
if (pLoadLibrary16) ret = pLoadLibrary16( dllA );
|
if (pLoadLibrary16) ret = pLoadLibrary16( dllA );
|
||||||
HeapFree( GetProcessHeap(), 0, dllA );
|
HeapFree( GetProcessHeap(), 0, dllA );
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -100,7 +100,7 @@ static FARPROC16 get_entry_point16( HINSTANCE16 inst, LPCWSTR entry )
|
||||||
DWORD len = WideCharToMultiByte( CP_ACP, 0, entry, -1, NULL, 0, NULL, NULL );
|
DWORD len = WideCharToMultiByte( CP_ACP, 0, entry, -1, NULL, 0, NULL, NULL );
|
||||||
char *entryA = HeapAlloc( GetProcessHeap(), 0, len );
|
char *entryA = HeapAlloc( GetProcessHeap(), 0, len );
|
||||||
WideCharToMultiByte( CP_ACP, 0, entry, -1, entryA, len, NULL, NULL );
|
WideCharToMultiByte( CP_ACP, 0, entry, -1, entryA, len, NULL, NULL );
|
||||||
pGetProcAddress16 = (void *)GetProcAddress( GetModuleHandleA("kernel32.dll"), "GetProcAddress16" );
|
pGetProcAddress16 = (void *)GetProcAddress( GetModuleHandleA("kernel32.dll"), (LPCSTR)37 );
|
||||||
if (pGetProcAddress16) ret = pGetProcAddress16( inst, entryA );
|
if (pGetProcAddress16) ret = pGetProcAddress16( inst, entryA );
|
||||||
HeapFree( GetProcessHeap(), 0, entryA );
|
HeapFree( GetProcessHeap(), 0, entryA );
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in New Issue