Skip to content

Commit

Permalink
call nfy_delmodule in freelibrary and don't call a getmessage hook fo…
Browse files Browse the repository at this point in the history
…r task messages (#1289)
  • Loading branch information
cracyc authored Apr 9, 2023
1 parent 56fa4cb commit e4a9621
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion krnl386/ne_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1645,8 +1645,11 @@ static BOOL16 NE_FreeModule( HMODULE16 hModule, BOOL call_wep, BOOL cleanup )

/* Free the objects owned by the DLL module */
if (cleanup)
{
if (pModule->ne_flags & NE_FFLAGS_LIBMODULE)
TOOLHELP_CallNotify(NFY_DELMODULE, hModule);
NE_CallUserSignalProc( hModule, USIG16_DLL_UNLOAD, 0, 0, 0 );

}

if (call_wep && !(pModule->ne_flags & NE_FFLAGS_WIN32))
{
Expand Down
2 changes: 2 additions & 0 deletions user/hook.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,8 @@ static LRESULT CALLBACK call_WH_GETMESSAGE( INT code, WPARAM wp, LPARAM lp, BOOL
LRESULT result;
CallNextHookEx(get_hhook(WH_GETMESSAGE, global), code, wp, lp);

if (global && !msg->hwnd) return 1; // XXX: a thread message can cause the hook to be called in the wrong context

params.time = msg->time;
params.pt.x = msg->pt.x;
params.pt.y = msg->pt.y;
Expand Down

0 comments on commit e4a9621

Please sign in to comment.