From 596284413767fb1f6900ec3350377f651f23a7a9 Mon Sep 17 00:00:00 2001 From: Jason Green Date: Thu, 17 Jan 2008 15:47:55 -0500 Subject: [PATCH] Return TRUE in SymInitializeW if process is already initialized and add an ERR to SymCleanup() From: Eric van Beurden (ericvb@transgaming.com) --- dlls/dbghelp/dbghelp.c | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/dlls/dbghelp/dbghelp.c b/dlls/dbghelp/dbghelp.c index dc3b86a..13d81c1 100644 --- a/dlls/dbghelp/dbghelp.c +++ b/dlls/dbghelp/dbghelp.c @@ -85,7 +85,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) return TRUE; } -static struct process* process_first /* = NULL */; +static struct process* process_first = NULL; /****************************************************************** * process_find_by_handle @@ -268,8 +268,14 @@ BOOL WINAPI SymInitializeW(HANDLE hProcess, PCWSTR UserSearchPath, BOOL fInvadeP TRACE("(%p %s %u)\n", hProcess, debugstr_w(UserSearchPath), fInvadeProcess); - if (process_find_by_handle(hProcess)) - FIXME("what to do ??\n"); + if (process_find_by_handle(hProcess)){ + WARN("the symbols for this process have already been initialized!\n"); + + /* MSDN says to only call this function once unless SymCleanup() has been called since the last call. + It also says to call SymRefreshModuleList() instead if you just want the module list refreshed. + Native still returns TRUE even if the process has already been initialized. */ + return TRUE; + } pcs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*pcs)); if (!pcs) return FALSE; @@ -379,6 +385,8 @@ BOOL WINAPI SymCleanup(HANDLE hProcess) return TRUE; } } + + ERR("this process has not had SymInitialize() called for it!\n"); return FALSE; } -- 1.4.4.2