Commit 32936f0e authored by Alexandre Julliard's avatar Alexandre Julliard

Fixed resource functions to work with 32-bit modules that don't have a

16-bit counterpart (necessary for LOAD_LIBRARY_AS_DATAFILE support).
parent c2f37af6
...@@ -184,9 +184,6 @@ extern FARPROC16 WINAPI WIN32_GetProcAddress16( HMODULE hmodule, LPCSTR name ); ...@@ -184,9 +184,6 @@ extern FARPROC16 WINAPI WIN32_GetProcAddress16( HMODULE hmodule, LPCSTR name );
extern SEGPTR WINAPI HasGPHandler16( SEGPTR address ); extern SEGPTR WINAPI HasGPHandler16( SEGPTR address );
extern void MODULE_WalkModref( DWORD id ); extern void MODULE_WalkModref( DWORD id );
/* resource.c */
extern INT WINAPI AccessResource(HMODULE,HRSRC);
/* loader/ne/module.c */ /* loader/ne/module.c */
extern NE_MODULE *NE_GetPtr( HMODULE16 hModule ); extern NE_MODULE *NE_GetPtr( HMODULE16 hModule );
extern void NE_DumpModule( HMODULE16 hModule ); extern void NE_DumpModule( HMODULE16 hModule );
...@@ -202,7 +199,6 @@ extern HANDLE NE_OpenFile( NE_MODULE *pModule ); ...@@ -202,7 +199,6 @@ extern HANDLE NE_OpenFile( NE_MODULE *pModule );
extern HGLOBAL16 WINAPI NE_DefResourceHandler(HGLOBAL16,HMODULE16,HRSRC16); extern HGLOBAL16 WINAPI NE_DefResourceHandler(HGLOBAL16,HMODULE16,HRSRC16);
extern BOOL NE_InitResourceHandler( HMODULE16 hModule ); extern BOOL NE_InitResourceHandler( HMODULE16 hModule );
extern HRSRC16 NE_FindResource( NE_MODULE *pModule, LPCSTR name, LPCSTR type ); extern HRSRC16 NE_FindResource( NE_MODULE *pModule, LPCSTR name, LPCSTR type );
extern INT16 NE_AccessResource( NE_MODULE *pModule, HRSRC16 hRsrc );
extern DWORD NE_SizeofResource( NE_MODULE *pModule, HRSRC16 hRsrc ); extern DWORD NE_SizeofResource( NE_MODULE *pModule, HRSRC16 hRsrc );
extern HGLOBAL16 NE_LoadResource( NE_MODULE *pModule, HRSRC16 hRsrc ); extern HGLOBAL16 NE_LoadResource( NE_MODULE *pModule, HRSRC16 hRsrc );
extern BOOL16 NE_FreeResource( NE_MODULE *pModule, HGLOBAL16 handle ); extern BOOL16 NE_FreeResource( NE_MODULE *pModule, HGLOBAL16 handle );
...@@ -223,7 +219,7 @@ HGLOBAL16 NE_LoadPEResource( NE_MODULE *pModule, WORD type, LPVOID bits, DWORD s ...@@ -223,7 +219,7 @@ HGLOBAL16 NE_LoadPEResource( NE_MODULE *pModule, WORD type, LPVOID bits, DWORD s
/* loader/pe_resource.c */ /* loader/pe_resource.c */
extern HRSRC PE_FindResourceExW(HMODULE,LPCWSTR,LPCWSTR,WORD); extern HRSRC PE_FindResourceExW(HMODULE,LPCWSTR,LPCWSTR,WORD);
extern DWORD PE_SizeofResource(HMODULE,HRSRC); extern DWORD PE_SizeofResource(HRSRC);
extern HGLOBAL PE_LoadResource(HMODULE,HRSRC); extern HGLOBAL PE_LoadResource(HMODULE,HRSRC);
extern PIMAGE_RESOURCE_DIRECTORY GetResDirEntryA(PIMAGE_RESOURCE_DIRECTORY,LPCSTR,DWORD,BOOL); extern PIMAGE_RESOURCE_DIRECTORY GetResDirEntryA(PIMAGE_RESOURCE_DIRECTORY,LPCSTR,DWORD,BOOL);
extern PIMAGE_RESOURCE_DIRECTORY GetResDirEntryW(PIMAGE_RESOURCE_DIRECTORY,LPCWSTR,DWORD,BOOL); extern PIMAGE_RESOURCE_DIRECTORY GetResDirEntryW(PIMAGE_RESOURCE_DIRECTORY,LPCWSTR,DWORD,BOOL);
......
...@@ -400,11 +400,12 @@ HGLOBAL16 WINAPI DirectResAlloc16( HINSTANCE16 hInstance, WORD wType, ...@@ -400,11 +400,12 @@ HGLOBAL16 WINAPI DirectResAlloc16( HINSTANCE16 hInstance, WORD wType,
/********************************************************************** /**********************************************************************
* NE_AccessResource * AccessResource16 (KERNEL.64)
*/ */
INT16 NE_AccessResource( NE_MODULE *pModule, HRSRC16 hRsrc ) INT16 WINAPI AccessResource16( HINSTANCE16 hModule, HRSRC16 hRsrc )
{ {
HFILE16 fd; HFILE16 fd;
NE_MODULE *pModule = NE_GetPtr( hModule );
if (!pModule || !pModule->res_table || !hRsrc) return -1; if (!pModule || !pModule->res_table || !hRsrc) return -1;
......
...@@ -157,13 +157,11 @@ HANDLE PE_LoadResource( HMODULE hmod, HANDLE hRsrc ) ...@@ -157,13 +157,11 @@ HANDLE PE_LoadResource( HMODULE hmod, HANDLE hRsrc )
/********************************************************************** /**********************************************************************
* PE_SizeofResource32 * PE_SizeofResource
*/ */
DWORD PE_SizeofResource( HINSTANCE hModule, HANDLE hRsrc ) DWORD PE_SizeofResource( HANDLE hRsrc )
{ {
/* we don't need hModule */ if (!hRsrc) return 0;
if (!hRsrc)
return 0;
return ((PIMAGE_RESOURCE_DATA_ENTRY)hRsrc)->Size; return ((PIMAGE_RESOURCE_DATA_ENTRY)hRsrc)->Size;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment