user32: Fix hook_proc DLLs loading problem using LoadLibraryExW

Hongbo Ni hongbo at njstar.com
Fri Sep 5 03:09:50 CDT 2008


This patch fixes Bug 14784. http://bugs.winehq.org/show_bug.cgi?id=14784
A standalone test case has been attached in Bug 14784.

This patch has been regenerated against the latest git tree.
I am 100% sure that this is the correct fix for the bug. 
Please tell me if you do not think so.

Let me explain the one line diff:

- LoadLibraryW(module) searches imported DLL(s) in the directory of current 
process, which may not be the same process where the module is first 
loaded. That is why that LoadLibraryW(module) fails to hook to another 
process if the DLL containing the hook_proc links to another DLL(s) that
is not on PATH.

+ With LoadLibraryExW(module, NULL, LOAD_WITH_ALTERED_SEARCH_PATH), the 
Wine will search any imported DLL first in the same directory as module, 
then in the standard search path.


Regards
Hongbo Ni

---
 dlls/user32/hook.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-user32-Fix-hook_proc-DLLs-loading-problem-using-Loa.patch
Type: application/octet-stream
Size: 855 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20080905/fd3d6e77/attachment.obj 


More information about the wine-patches mailing list