From 60f0439ba688cdebd626ff5a7a11ab8b54c1ed85 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 2 Aug 2004 22:25:01 +0000 Subject: [PATCH] Make relay and snooping work for LoadLibrary+GetProcAddress sequence (based on a patch by Dmitry Timoshkov). --- dlls/ntdll/loader.c | 12 ++++++------ dlls/ntdll/relay.c | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 692f4c25271..f4268b26ff4 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -305,15 +305,15 @@ static FARPROC find_ordinal_export( HMODULE module, const IMAGE_EXPORT_DIRECTORY ((const char *)proc < (const char *)exports + exp_size)) return find_forwarded_export( module, (const char *)proc ); - if (TRACE_ON(snoop) && current_modref) + if (TRACE_ON(snoop)) { - proc = SNOOP_GetProcAddress( module, exports, exp_size, proc, ordinal, - current_modref->ldr.BaseDllName.Buffer ); + const WCHAR *user = current_modref ? current_modref->ldr.BaseDllName.Buffer : NULL; + proc = SNOOP_GetProcAddress( module, exports, exp_size, proc, ordinal, user ); } - if (TRACE_ON(relay) && current_modref) + if (TRACE_ON(relay)) { - proc = RELAY_GetProcAddress( module, exports, exp_size, proc, - current_modref->ldr.BaseDllName.Buffer ); + const WCHAR *user = current_modref ? current_modref->ldr.BaseDllName.Buffer : NULL; + proc = RELAY_GetProcAddress( module, exports, exp_size, proc, user ); } return proc; } diff --git a/dlls/ntdll/relay.c b/dlls/ntdll/relay.c index 832a91b5e6f..30d234d2fef 100644 --- a/dlls/ntdll/relay.c +++ b/dlls/ntdll/relay.c @@ -332,6 +332,7 @@ static BOOL check_from_module( const WCHAR **includelist, const WCHAR **excludel const WCHAR **listitem; BOOL show; + if (!module) return TRUE; if (!includelist && !excludelist) return TRUE; if (excludelist) {