ntdll: Avoid crash with WINEDEBUG=+snoop

Detlef Riekenberg wine.dev at web.de
Tue Jul 10 15:01:42 CDT 2007


Some dlls export 0 Functions and wine crashed in SNOOP_GetProcAddress
("_ISRES.dll" from the Adobe PostScript Driver Installer as example)


Changelog:
ntdll: Avoid crash with WINEDEBUG=+snoop


-- 
 
By by ... Detlef

-------------- next part --------------
>From 138d4d02f28919e2624c7346f7478cc5f68bb6bd Mon Sep 17 00:00:00 2001
From: Detlef Riekenberg <wine.dev at web.de>
Date: Tue, 10 Jul 2007 21:52:42 +0200
Subject: [PATCH] ntdll: Avoid crash with WINEDEBUG=+snoop
---
 dlls/ntdll/relay.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/dlls/ntdll/relay.c b/dlls/ntdll/relay.c
index 0b592ce..7f92e70 100644
--- a/dlls/ntdll/relay.c
+++ b/dlls/ntdll/relay.c
@@ -650,7 +650,9 @@ void SNOOP_SetupDLL(HMODULE hmod)
     if (!init_done) init_debug_lists();
 
     exports = RtlImageDirectoryEntryToData( hmod, TRUE, IMAGE_DIRECTORY_ENTRY_EXPORT, &size32 );
-    if (!exports) return;
+    /* some dlls export 0 functions */
+    if ((!exports) || (exports->NumberOfFunctions == 0)) return;
+
     name = (char *)hmod + exports->Name;
     size = size32;
 
-- 
1.4.1



More information about the wine-patches mailing list