From 09fed7567b7b94aa648faae2b4d0804835a88dc3 Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Mon, 24 May 2004 19:06:32 +0000 Subject: [PATCH] Some fixes to module browsing. --- dlls/kernel/toolhelp.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/dlls/kernel/toolhelp.c b/dlls/kernel/toolhelp.c index d37f0a80c9d..7b4cd80b9fa 100644 --- a/dlls/kernel/toolhelp.c +++ b/dlls/kernel/toolhelp.c @@ -379,17 +379,20 @@ static BOOL TOOLHELP_Module32Next( HANDLE handle, LPMODULEENTRY32 lpme, BOOL fir wine_server_set_reply( req, exe, sizeof(exe) ); if ((ret = !wine_server_call_err( req ))) { - lpme->th32ModuleID = 0; /* toolhelp internal id, never used */ + const char* ptr; + lpme->th32ModuleID = 1; /* toolhelp internal id, never used */ lpme->th32ProcessID = reply->pid; - lpme->GlblcntUsage = 0; /* FIXME */ - lpme->ProccntUsage = 0; /* FIXME */ + lpme->GlblcntUsage = 0xFFFF; /* FIXME */ + lpme->ProccntUsage = 0xFFFF; /* FIXME */ lpme->modBaseAddr = reply->base; lpme->modBaseSize = reply->size; lpme->hModule = reply->base; - lpme->szModule[0] = 0; /* FIXME */ len = WideCharToMultiByte( CP_ACP, 0, exe, wine_server_reply_size(reply) / sizeof(WCHAR), - lpme->szExePath, sizeof(lpme->szExePath), NULL, NULL ); + lpme->szExePath, sizeof(lpme->szExePath) - 1, NULL, NULL ); lpme->szExePath[len] = 0; + if ((ptr = strrchr(lpme->szExePath, '\\'))) ptr++; + else ptr = lpme->szExePath; + lstrcpynA( lpme->szModule, ptr, sizeof(lpme->szModule) ); } } SERVER_END_REQ;