Skip to content

Commit

Permalink
krnl386.exe16: Use WOW_TYPE_HANDLE for setting HICON parameters.
Browse files Browse the repository at this point in the history
HICON is not HGDIOBJ and may be destroyed when hgdi_clean_up is called.
  • Loading branch information
otya128 committed Aug 21, 2022
1 parent 8556b83 commit 448b8c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions krnl386/wowthunk.c
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ __declspec(dllexport) HGDIOBJ K32HGDIOBJ_32(HGDIOBJ16 handle)
__declspec(dllexport) HICON16 K32HICON_16(HICON handle)
{
#ifdef WOW64
return K32WOWHandle16HGDI(handle);
return K32WOWHandle16(handle, WOW_TYPE_HANDLE);
#else
if (HIWORD(handle))
ERR("handle %p of type %d has non-zero HIWORD\n", handle, type);
Expand All @@ -603,7 +603,7 @@ __declspec(dllexport) HICON16 K32HICON_16(HICON handle)
__declspec(dllexport) HICON K32HICON_32(HICON16 handle)
{
#ifdef WOW64
return K32WOWHandle32HGDI(handle);
return (HICON)K32WOWHandle32(handle, WOW_TYPE_HANDLE);
#else
return (HANDLE)(ULONG_PTR)handle;
#endif
Expand Down

0 comments on commit 448b8c8

Please sign in to comment.