/********************************************************************** * RES_SizeofResource */ static DWORD RES_SizeofResource( HMODULE hModule, HRSRC hRsrc, BOOL bRet16 ) { if (!hRsrc) return 0; TRACE("(%08x, %08x, %s)\n", hModule, hRsrc, bRet16? "NE" : "PE" ); if (!HIWORD(hModule)) { HMODULE16 hMod16 = MapHModuleLS( hModule ); NE_MODULE *pModule = NE_GetPtr( hMod16 ); if (!pModule) return 0; if (!pModule->module32) /* 16-bit NE module */ { /* If we got a 32-bit hRsrc, we don't need to convert it */ return NE_SizeofResource( pModule, hRsrc ); } /* If we got a 16-bit hRsrc, convert it */ if (!HIWORD(hRsrc)) hRsrc = MapHRsrc16To32( pModule, hRsrc ); } /* 32-bit PE module */ return PE_SizeofResource( hRsrc ); }
/********************************************************************** * RES_SizeofResource */ static DWORD RES_SizeofResource( HMODULE hModule, HRSRC hRsrc) { DWORD size = 0; HRSRC hRsrc32; // HMODULE16 hMod16 = MapHModuleLS( hModule ); // NE_MODULE *pModule = NE_GetPtr( hMod16 ); // WINE_MODREF *wm = pModule && pModule->module32? // MODULE32_LookupHMODULE( pModule->module32 ) : NULL; WINE_MODREF *wm = MODULE32_LookupHMODULE( hModule ); if ( !hModule || !hRsrc ) return 0; /* 32-bit PE module */ /* If we got a 16-bit hRsrc, convert it */ // hRsrc32 = HIWORD(hRsrc)? hRsrc : MapHRsrc16To32( pModule, hRsrc ); if(!HIWORD(hRsrc)) { printf("16-bit hRsrcs not supported\n"); return 0; } size = PE_SizeofResource( hModule, hRsrc ); return size; }