Eric Pouech : dbghelp: Added helper to define the module's name.
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Feb 22 05:56:40 CST 2007
Module: wine
Branch: master
Commit: 33c8ffc301eb251b65f4e444f26b8ba62d498b41
URL: http://source.winehq.org/git/wine.git/?a=commit;h=33c8ffc301eb251b65f4e444f26b8ba62d498b41
Author: Eric Pouech <eric.pouech at wanadoo.fr>
Date: Wed Feb 21 21:54:33 2007 +0100
dbghelp: Added helper to define the module's name.
---
dlls/dbghelp/dbghelp_private.h | 2 ++
dlls/dbghelp/module.c | 12 ++++++++----
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h
index 83c549d..be6b7e6 100644
--- a/dlls/dbghelp/dbghelp_private.h
+++ b/dlls/dbghelp/dbghelp_private.h
@@ -447,6 +447,8 @@ extern enum module_type
extern void module_reset_debug_info(struct module* module);
extern BOOL module_remove(struct process* pcs,
struct module* module);
+extern void module_set_module(struct module* module, const char* name);
+
/* msc.c */
extern BOOL pe_load_debug_directory(const struct process* pcs,
struct module* module,
diff --git a/dlls/dbghelp/module.c b/dlls/dbghelp/module.c
index e7214b3..e63b576 100644
--- a/dlls/dbghelp/module.c
+++ b/dlls/dbghelp/module.c
@@ -79,6 +79,11 @@ static void module_fill_module(const char* in, char* out, size_t size)
while ((*out = tolower(*out))) out++;
}
+void module_set_module(struct module* module, const char* name)
+{
+ module_fill_module(name, module->module.ModuleName, sizeof(module->module.ModuleName));
+}
+
static const char* get_module_type(enum module_type type, BOOL virtual)
{
switch (type)
@@ -116,8 +121,7 @@ struct module* module_new(struct process* pcs, const char* name,
module->module.SizeOfStruct = sizeof(module->module);
module->module.BaseOfImage = mod_addr;
module->module.ImageSize = size;
- module_fill_module(name, module->module.ModuleName,
- sizeof(module->module.ModuleName));
+ module_set_module(module, name);
module->module.ImageName[0] = '\0';
lstrcpynA(module->module.LoadedImageName, name, sizeof(module->module.LoadedImageName));
module->module.SymType = SymNone;
@@ -423,7 +427,7 @@ done:
* of ImageName. Overwrite it, if we have better information
*/
if (ModuleName)
- lstrcpynA(module->module.ModuleName, ModuleName, sizeof(module->module.ModuleName));
+ module_set_module(module, ModuleName);
lstrcpynA(module->module.ImageName, ImageName, sizeof(module->module.ImageName));
return module->module.BaseOfImage;
@@ -453,7 +457,7 @@ DWORD64 WINAPI SymLoadModuleEx(HANDLE hProcess, HANDLE hFile, PCSTR ImageName,
(DWORD)BaseOfDll, DllSize, 0, 0);
if (!module) return FALSE;
if (ModuleName)
- lstrcpynA(module->module.ModuleName, ModuleName, sizeof(module->module.ModuleName));
+ module_set_module(module, ModuleName);
module->module.SymType = SymVirtual;
return TRUE;
More information about the wine-cvs
mailing list