Commit 1690cf18 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

dbghelp: Moved the internals for registered callback to Unicode.

parent 180127dd
......@@ -500,10 +500,10 @@ BOOL pcs_callback(const struct process* pcs, ULONG action, void* data)
TRACE("%p %u %p\n", pcs, action, data);
if (!pcs->reg_cb) return FALSE;
if (pcs->reg_is_unicode)
if (!pcs->reg_is_unicode)
{
IMAGEHLP_DEFERRED_SYMBOL_LOAD64* idsl;
IMAGEHLP_DEFERRED_SYMBOL_LOADW64 idslW;
IMAGEHLP_DEFERRED_SYMBOL_LOAD64 idsl;
IMAGEHLP_DEFERRED_SYMBOL_LOADW64* idslW;
switch (action)
{
......@@ -516,15 +516,15 @@ BOOL pcs_callback(const struct process* pcs, ULONG action, void* data)
case CBA_DEFERRED_SYMBOL_LOAD_FAILURE:
case CBA_DEFERRED_SYMBOL_LOAD_PARTIAL:
case CBA_DEFERRED_SYMBOL_LOAD_START:
idsl = (IMAGEHLP_DEFERRED_SYMBOL_LOAD64*)(DWORD)data;
idslW.SizeOfStruct = sizeof(idslW);
idslW.BaseOfImage = idsl->BaseOfImage;
idslW.CheckSum = idsl->CheckSum;
idslW.TimeDateStamp = idsl->TimeDateStamp;
MultiByteToWideChar(CP_ACP, 0, idsl->FileName, -1,
idslW.FileName, sizeof(idslW.FileName) / sizeof(WCHAR));
idslW.Reparse = idsl->Reparse;
data = &idslW;
idslW = (IMAGEHLP_DEFERRED_SYMBOL_LOADW64*)(DWORD)data;
idsl.SizeOfStruct = sizeof(idsl);
idsl.BaseOfImage = idslW->BaseOfImage;
idsl.CheckSum = idslW->CheckSum;
idsl.TimeDateStamp = idslW->TimeDateStamp;
WideCharToMultiByte(CP_ACP, 0, idslW->FileName, -1,
idsl.FileName, sizeof(idsl.FileName), NULL, NULL);
idsl.Reparse = idslW->Reparse;
data = &idsl;
break;
case CBA_DUPLICATE_SYMBOL:
case CBA_EVENT:
......
......@@ -275,7 +275,7 @@ struct module* module_get_containee(const struct process* pcs,
*/
BOOL module_get_debug(struct module_pair* pair)
{
IMAGEHLP_DEFERRED_SYMBOL_LOAD64 idsl64;
IMAGEHLP_DEFERRED_SYMBOL_LOADW64 idslW64;
if (!pair->requested) return FALSE;
/* for a PE builtin, always get info from container */
......@@ -293,20 +293,20 @@ BOOL module_get_debug(struct module_pair* pair)
ret = elf_load_debug_info(pair->effective, NULL);
break;
case DMT_PE:
idsl64.SizeOfStruct = sizeof(idsl64);
idsl64.BaseOfImage = pair->effective->module.BaseOfImage;
idsl64.CheckSum = pair->effective->module.CheckSum;
idsl64.TimeDateStamp = pair->effective->module.TimeDateStamp;
WideCharToMultiByte(CP_ACP, 0, pair->effective->module.ImageName, -1,
idsl64.FileName, sizeof(idsl64.FileName), NULL, NULL);
idsl64.Reparse = FALSE;
idsl64.hFile = INVALID_HANDLE_VALUE;
pcs_callback(pair->pcs, CBA_DEFERRED_SYMBOL_LOAD_START, &idsl64);
idslW64.SizeOfStruct = sizeof(idslW64);
idslW64.BaseOfImage = pair->effective->module.BaseOfImage;
idslW64.CheckSum = pair->effective->module.CheckSum;
idslW64.TimeDateStamp = pair->effective->module.TimeDateStamp;
memcpy(idslW64.FileName, pair->effective->module.ImageName,
sizeof(idslW64.FileName));
idslW64.Reparse = FALSE;
idslW64.hFile = INVALID_HANDLE_VALUE;
pcs_callback(pair->pcs, CBA_DEFERRED_SYMBOL_LOAD_START, &idslW64);
ret = pe_load_debug_info(pair->pcs, pair->effective);
pcs_callback(pair->pcs,
ret ? CBA_DEFERRED_SYMBOL_LOAD_COMPLETE : CBA_DEFERRED_SYMBOL_LOAD_FAILURE,
&idsl64);
&idslW64);
break;
default:
ret = FALSE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment