kernel32: Load the DestroyIcon32 function from 16-bit user.exe.

This commit is contained in:
Alexandre Julliard 2009-12-22 13:48:03 +01:00
parent 0fbe20a254
commit ff04a5e830
1 changed files with 13 additions and 7 deletions

View File

@ -1105,15 +1105,13 @@ DWORD WINAPI SizeofResource16( HMODULE16 hModule, HRSRC16 hRsrc )
} }
typedef WORD (WINAPI *pDestroyIcon32Proc)( HGLOBAL16 handle, UINT16 flags );
/********************************************************************** /**********************************************************************
* FreeResource (KERNEL.63) * FreeResource (KERNEL.63)
*/ */
BOOL16 WINAPI FreeResource16( HGLOBAL16 handle ) BOOL16 WINAPI FreeResource16( HGLOBAL16 handle )
{ {
pDestroyIcon32Proc proc; FARPROC16 proc;
HMODULE user; HMODULE16 user;
NE_MODULE *pModule = NE_GetPtr( FarGetOwner16( handle ) ); NE_MODULE *pModule = NE_GetPtr( FarGetOwner16( handle ) );
TRACE("(%04x)\n", handle ); TRACE("(%04x)\n", handle );
@ -1149,9 +1147,17 @@ BOOL16 WINAPI FreeResource16( HGLOBAL16 handle )
/* If this failed, call USER.DestroyIcon32; this will check /* If this failed, call USER.DestroyIcon32; this will check
whether it is a shared cursor/icon; if not it will call whether it is a shared cursor/icon; if not it will call
GlobalFree16() */ GlobalFree16() */
user = GetModuleHandleA( "user32.dll" ); user = GetModuleHandle16( "user" );
if (user && (proc = (pDestroyIcon32Proc)GetProcAddress( user, "DestroyIcon32" ))) if (user && (proc = GetProcAddress16( user, "DestroyIcon32" )))
return proc( handle, 1 /*CID_RESOURCE*/ ); {
WORD args[2];
DWORD result;
args[1] = handle;
args[0] = 1; /* CID_RESOURCE */
WOWCallback16Ex( (SEGPTR)proc, WCB16_PASCAL, sizeof(args), args, &result );
return LOWORD(result);
}
else else
return GlobalFree16( handle ); return GlobalFree16( handle );
} }