[kernel/module.c] Return ERROR_PROC_NOT_FOUND for NULL hModule

Paul Vriens paul.vriens at xs4all.nl
Mon Jul 11 07:04:25 CDT 2005


Hi,

Process Explorer tries to load a dll with LoadLibraryA. This fails and
NULL is returned. PE is however still trying to do GetProcAddress on this
(not loaded) dll. Windows returns ERROR_PROC_NOT_FOUND, we get into an
exception.

I will send a test tonight that confirms the above.

Changelog
  Return ERROR_PROC_NOT_FOUND if hModule is NULL

--- ../wine-paul/dlls/kernel/module.c   2005-06-20 12:40:37.000000000 +0200
+++ dlls/kernel/module.c        2005-07-11 10:55:20.735319551 +0200
@@ -810,6 +810,12 @@ FARPROC WINAPI GetProcAddress( HMODULE h
     NTSTATUS    nts;
     FARPROC     fp;

+    if (!hModule)
+    {
+        SetLastError( ERROR_PROC_NOT_FOUND );
+        return NULL;
+    }
+
     if (HIWORD(function))
     {
         ANSI_STRING     str;





More information about the wine-patches mailing list