- fixes support for <mod>! syntax in source file enumeration - reduces memory usage for types (no longer having both a vector and a hash table as all types are now named) - some code refactoring
From: Eric Pouech epouech@codeweavers.com
Signed-off-by: Eric Pouech epouech@codeweavers.com --- dlls/dbghelp/source.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/dlls/dbghelp/source.c b/dlls/dbghelp/source.c index f2dc84d4769..2ef80deb1dc 100644 --- a/dlls/dbghelp/source.c +++ b/dlls/dbghelp/source.c @@ -157,10 +157,18 @@ BOOL WINAPI SymEnumSourceFilesW(HANDLE hProcess, ULONG64 ModBase, PCWSTR Mask, } else { - if (Mask[0] == '!') + WCHAR *bang = wcschr(Mask, '!'); + if (bang) { - pair.requested = module_find_by_nameW(pair.pcs, Mask + 1); + WCHAR *module_name; + + if (!(module_name = HeapAlloc(GetProcessHeap(), 0, (bang - Mask + 1) * sizeof(WCHAR)))) return FALSE; + memcpy(module_name, Mask, (bang - Mask) * sizeof(WCHAR)); + module_name[bang - Mask] = L'\0'; + pair.requested = module_find_by_nameW(pair.pcs, module_name); + HeapFree(GetProcessHeap(), 0, module_name); if (!module_get_debug(&pair)) return FALSE; + Mask = bang + 1; } else { @@ -183,10 +191,12 @@ BOOL WINAPI SymEnumSourceFilesW(HANDLE hProcess, ULONG64 ModBase, PCWSTR Mask,
MultiByteToWideChar(CP_ACP, 0, ptr, -1, conversion_buffer, len);
- /* FIXME: not using Mask */ - sf.ModBase = ModBase; - sf.FileName = conversion_buffer; - if (!cbSrcFiles(&sf, UserContext)) break; + if (!Mask || !*Mask || SymMatchStringW(conversion_buffer, Mask, FALSE)) + { + sf.ModBase = pair.requested->module.BaseOfImage; + sf.FileName = conversion_buffer; + if (!cbSrcFiles(&sf, UserContext)) break; + } }
HeapFree(GetProcessHeap(), 0, conversion_buffer);
From: Eric Pouech epouech@codeweavers.com
Signed-off-by: Eric Pouech epouech@codeweavers.com --- dlls/dbghelp/type.c | 94 +++++++++++++++++---------------------------- 1 file changed, 35 insertions(+), 59 deletions(-)
diff --git a/dlls/dbghelp/type.c b/dlls/dbghelp/type.c index 9a1482e73ab..9c85a7a613a 100644 --- a/dlls/dbghelp/type.c +++ b/dlls/dbghelp/type.c @@ -460,36 +460,29 @@ struct symt_typedef* symt_new_typedef(struct module* module, struct symt* ref, return sym; }
-/****************************************************************** - * SymEnumTypes (DBGHELP.@) - * - */ -BOOL WINAPI SymEnumTypes(HANDLE hProcess, ULONG64 BaseOfDll, - PSYM_ENUMERATESYMBOLS_CALLBACK EnumSymbolsCallback, - PVOID UserContext) +static BOOL sym_enum_types(struct module_pair *pair, const char *type_name, PSYM_ENUMERATESYMBOLS_CALLBACK cb, void *user) { - struct module_pair pair; char buffer[sizeof(SYMBOL_INFO) + 256]; - SYMBOL_INFO* sym_info = (SYMBOL_INFO*)buffer; - struct symt* type; + struct symt *type; + SYMBOL_INFO *sym_info = (SYMBOL_INFO*)buffer; DWORD64 size; unsigned int i; - - TRACE("(%p %I64x %p %p)\n", hProcess, BaseOfDll, EnumSymbolsCallback, UserContext); - - if (!module_init_pair(&pair, hProcess, BaseOfDll)) return FALSE; + const char *tname;
sym_info->SizeOfStruct = sizeof(SYMBOL_INFO); sym_info->MaxNameLen = sizeof(buffer) - sizeof(SYMBOL_INFO);
- for (i=0; i<vector_length(&pair.effective->vtypes); i++) + for (i = 0; i < vector_length(&pair->effective->vtypes); i++) { - type = *(struct symt**)vector_at(&pair.effective->vtypes, i); - sym_info->TypeIndex = symt_ptr2index(pair.effective, type); + type = *(struct symt**)vector_at(&pair->effective->vtypes, i); + tname = symt_get_name(type); + if (!tname || !*tname) continue; + if (type_name && !SymMatchStringA(tname, type_name, TRUE)) continue; + sym_info->TypeIndex = symt_ptr2index(pair->effective, type); sym_info->Index = 0; /* FIXME */ - symt_get_info(pair.effective, type, TI_GET_LENGTH, &size); + symt_get_info(pair->effective, type, TI_GET_LENGTH, &size); sym_info->Size = size; - sym_info->ModBase = pair.requested->module.BaseOfImage; + sym_info->ModBase = pair->requested->module.BaseOfImage; sym_info->Flags = 0; /* FIXME */ sym_info->Value = 0; /* FIXME */ sym_info->Address = 0; /* FIXME */ @@ -497,11 +490,29 @@ BOOL WINAPI SymEnumTypes(HANDLE hProcess, ULONG64 BaseOfDll, sym_info->Scope = 0; /* FIXME */ sym_info->Tag = type->tag; symbol_setname(sym_info, symt_get_name(type)); - if (!EnumSymbolsCallback(sym_info, sym_info->Size, UserContext)) break; + if (!cb(sym_info, sym_info->Size, user)) return FALSE; } return TRUE; }
+/****************************************************************** + * SymEnumTypes (DBGHELP.@) + * + */ +BOOL WINAPI SymEnumTypes(HANDLE hProcess, ULONG64 BaseOfDll, + PSYM_ENUMERATESYMBOLS_CALLBACK EnumSymbolsCallback, + PVOID UserContext) +{ + struct module_pair pair; + + TRACE("(%p %I64x %p %p)\n", hProcess, BaseOfDll, EnumSymbolsCallback, UserContext); + + if (!module_init_pair(&pair, hProcess, BaseOfDll)) return FALSE; + + sym_enum_types(&pair, NULL, EnumSymbolsCallback, UserContext); + return TRUE; +} + struct enum_types_AtoW { char buffer[sizeof(SYMBOL_INFOW) + 256 * sizeof(WCHAR)]; @@ -534,41 +545,6 @@ BOOL WINAPI SymEnumTypesW(HANDLE hProcess, ULONG64 BaseOfDll, return SymEnumTypes(hProcess, BaseOfDll, enum_types_AtoW, &et); }
-static void enum_types_of_module(struct module_pair* pair, const char* name, PSYM_ENUMERATESYMBOLS_CALLBACK cb, PVOID user) -{ - char buffer[sizeof(SYMBOL_INFO) + 256]; - SYMBOL_INFO* sym_info = (SYMBOL_INFO*)buffer; - struct symt* type; - DWORD64 size; - unsigned i; - const char* tname; - - sym_info->SizeOfStruct = sizeof(SYMBOL_INFO); - sym_info->MaxNameLen = sizeof(buffer) - sizeof(SYMBOL_INFO); - - for (i = 0; i < vector_length(&pair->effective->vtypes); i++) - { - type = *(struct symt**)vector_at(&pair->effective->vtypes, i); - tname = symt_get_name(type); - if (tname && SymMatchStringA(tname, name, TRUE)) - { - sym_info->TypeIndex = symt_ptr2index(pair->effective, type); - sym_info->Index = 0; /* FIXME */ - symt_get_info(pair->effective, type, TI_GET_LENGTH, &size); - sym_info->Size = size; - sym_info->ModBase = pair->requested->module.BaseOfImage; - sym_info->Flags = 0; /* FIXME */ - sym_info->Value = 0; /* FIXME */ - sym_info->Address = 0; /* FIXME */ - sym_info->Register = 0; /* FIXME */ - sym_info->Scope = 0; /* FIXME */ - sym_info->Tag = type->tag; - symbol_setname(sym_info, tname); - if (!cb(sym_info, sym_info->Size, user)) break; - } - } -} - static BOOL walk_modules(struct module_pair* pair) { /* first walk PE only modules */ @@ -597,8 +573,7 @@ BOOL WINAPI SymEnumTypesByName(HANDLE proc, ULONG64 base, PCSTR name, PSYM_ENUME
TRACE("(%p %I64x %s %p %p)\n", proc, base, debugstr_a(name), cb, user);
- if (!name) return SymEnumTypes(proc, base, cb, user); - bang = strchr(name, '!'); + bang = name ? strchr(name, '!') : NULL; if (bang) { DWORD sz; @@ -614,14 +589,15 @@ BOOL WINAPI SymEnumTypesByName(HANDLE proc, ULONG64 base, PCSTR name, PSYM_ENUME while (walk_modules(&pair)) { if (SymMatchStringW(pair.requested->modulename, modW, FALSE)) - enum_types_of_module(&pair, bang + 1, cb, user); + if (!sym_enum_types(&pair, bang + 1, cb, user)) + break; } free(modW); } else { if (!module_init_pair(&pair, proc, base) || !module_get_debug(&pair)) return FALSE; - enum_types_of_module(&pair, name, cb, user); + sym_enum_types(&pair, name, cb, user); } return TRUE; }
From: Eric Pouech epouech@codeweavers.com
Enumeration only report types with name, so we can get rid of module's vtype vector and only the use the types' hash table.
Signed-off-by: Eric Pouech epouech@codeweavers.com --- dlls/dbghelp/dbghelp_private.h | 1 - dlls/dbghelp/module.c | 2 -- dlls/dbghelp/type.c | 45 ++++++++++++---------------------- 3 files changed, 16 insertions(+), 32 deletions(-)
diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h index 63b2b8862de..27f869de4c6 100644 --- a/dlls/dbghelp/dbghelp_private.h +++ b/dlls/dbghelp/dbghelp_private.h @@ -470,7 +470,6 @@ struct module
/* types */ struct hash_table ht_types; - struct vector vtypes;
/* source files */ unsigned sources_used; diff --git a/dlls/dbghelp/module.c b/dlls/dbghelp/module.c index 80236d39ee3..ce49ef2744a 100644 --- a/dlls/dbghelp/module.c +++ b/dlls/dbghelp/module.c @@ -204,7 +204,6 @@ struct module* module_new(struct process* pcs, const WCHAR* name, */ hash_table_init(&module->pool, &module->ht_symbols, 4096); hash_table_init(&module->pool, &module->ht_types, 4096); - vector_init(&module->vtypes, sizeof(struct symt*), 0);
module->sources_used = 0; module->sources_alloc = 0; @@ -1566,7 +1565,6 @@ void module_reset_debug_info(struct module* module) hash_table_destroy(&module->ht_types); module->ht_types.num_buckets = 0; module->ht_types.buckets = NULL; - module->vtypes.num_elts = 0; hash_table_destroy(&module->ht_symbols); module->sources_used = module->sources_alloc = 0; module->sources = NULL; diff --git a/dlls/dbghelp/type.c b/dlls/dbghelp/type.c index 9c85a7a613a..7e9bb44e690 100644 --- a/dlls/dbghelp/type.c +++ b/dlls/dbghelp/type.c @@ -213,14 +213,6 @@ static struct symt* symt_find_type_by_name(const struct module* module, return NULL; }
-static void symt_add_type(struct module* module, struct symt* symt) -{ - struct symt** p; - p = vector_add(&module->vtypes, &module->pool); - assert(p); - *p = symt; -} - struct symt_basic* symt_get_basic(enum BasicType bt, unsigned size) { static struct symt_basic cache[32] = { { {SymTagBaseType}, btNoType, 0 } }; @@ -261,7 +253,6 @@ struct symt_udt* symt_new_udt(struct module* module, const char* typename, hash_table_add(&module->ht_types, &sym->hash_elt); } else sym->hash_elt.name = NULL; vector_init(&sym->vchildren, sizeof(struct symt*), 0); - symt_add_type(module, &sym->symt); } return sym; } @@ -346,7 +337,6 @@ struct symt_enum* symt_new_enum(struct module* module, const char* typename, } else sym->hash_elt.name = NULL; sym->base_type = basetype; vector_init(&sym->vchildren, sizeof(struct symt*), 0); - symt_add_type(module, &sym->symt); } return sym; } @@ -389,7 +379,6 @@ struct symt_array* symt_new_array(struct module* module, int min, DWORD cnt, sym->count = cnt; sym->base_type = base; sym->index_type = index; - symt_add_type(module, &sym->symt); } return sym; } @@ -406,7 +395,6 @@ struct symt_function_signature* symt_new_function_signature(struct module* modul sym->rettype = ret_type; vector_init(&sym->vchildren, sizeof(struct symt*), 0); sym->call_conv = call_conv; - symt_add_type(module, &sym->symt); } return sym; } @@ -439,13 +427,12 @@ struct symt_pointer* symt_new_pointer(struct module* module, struct symt* ref_ty sym->symt.tag = SymTagPointerType; sym->pointsto = ref_type; sym->size = size; - symt_add_type(module, &sym->symt); } return sym; }
-struct symt_typedef* symt_new_typedef(struct module* module, struct symt* ref, - const char* name) +struct symt_typedef* symt_new_typedef(struct module* module, struct symt* ref, + const char* typename) { struct symt_typedef* sym;
@@ -453,9 +440,8 @@ struct symt_typedef* symt_new_typedef(struct module* module, struct symt* ref, { sym->symt.tag = SymTagTypedef; sym->type = ref; - sym->hash_elt.name = pool_strdup(&module->pool, name); + sym->hash_elt.name = pool_strdup(&module->pool, typename); hash_table_add(&module->ht_types, &sym->hash_elt); - symt_add_type(module, &sym->symt); } return sym; } @@ -463,24 +449,25 @@ struct symt_typedef* symt_new_typedef(struct module* module, struct symt* ref, static BOOL sym_enum_types(struct module_pair *pair, const char *type_name, PSYM_ENUMERATESYMBOLS_CALLBACK cb, void *user) { char buffer[sizeof(SYMBOL_INFO) + 256]; - struct symt *type; SYMBOL_INFO *sym_info = (SYMBOL_INFO*)buffer; + struct hash_table_iter hti; + void* ptr; + struct symt_ht *type; DWORD64 size; - unsigned int i; - const char *tname;
sym_info->SizeOfStruct = sizeof(SYMBOL_INFO); sym_info->MaxNameLen = sizeof(buffer) - sizeof(SYMBOL_INFO);
- for (i = 0; i < vector_length(&pair->effective->vtypes); i++) + hash_table_iter_init(&pair->effective->ht_types, &hti, type_name); + while ((ptr = hash_table_iter_up(&hti))) { - type = *(struct symt**)vector_at(&pair->effective->vtypes, i); - tname = symt_get_name(type); - if (!tname || !*tname) continue; - if (type_name && !SymMatchStringA(tname, type_name, TRUE)) continue; - sym_info->TypeIndex = symt_ptr2index(pair->effective, type); + type = CONTAINING_RECORD(ptr, struct symt_ht, hash_elt); + + if (type_name && !SymMatchStringA(type->hash_elt.name, type_name, TRUE)) continue; + + sym_info->TypeIndex = symt_ptr2index(pair->effective, &type->symt); sym_info->Index = 0; /* FIXME */ - symt_get_info(pair->effective, type, TI_GET_LENGTH, &size); + symt_get_info(pair->effective, &type->symt, TI_GET_LENGTH, &size); sym_info->Size = size; sym_info->ModBase = pair->requested->module.BaseOfImage; sym_info->Flags = 0; /* FIXME */ @@ -488,8 +475,8 @@ static BOOL sym_enum_types(struct module_pair *pair, const char *type_name, PSYM sym_info->Address = 0; /* FIXME */ sym_info->Register = 0; /* FIXME */ sym_info->Scope = 0; /* FIXME */ - sym_info->Tag = type->tag; - symbol_setname(sym_info, symt_get_name(type)); + sym_info->Tag = type->symt.tag; + symbol_setname(sym_info, type->hash_elt.name); if (!cb(sym_info, sym_info->Size, user)) return FALSE; } return TRUE;
From: Eric Pouech epouech@codeweavers.com
Signed-off-by: Eric Pouech epouech@codeweavers.com --- dlls/dbghelp/dwarf.c | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-)
diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index 156f72343fe..10549a11579 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -2076,11 +2076,6 @@ static void dwarf2_parse_variable(dwarf2_subprogram_t* subpgm, WARN("dropping global variable %s which has been optimized away\n", debugstr_a(name.u.string)); } } - if (is_pmt && subpgm->current_func && symt_check_tag(subpgm->current_func->type, SymTagFunctionType)) - symt_add_function_signature_parameter(subpgm->ctx->module_ctx->module, - (struct symt_function_signature*)subpgm->current_func->type, - param_type); - if (dwarf2_get_di_children(di)) FIXME("Unsupported children\n"); }
@@ -2116,8 +2111,6 @@ static void dwarf2_parse_inlined_subroutine(dwarf2_subprogram_t* subpgm, dwarf2_debug_info_t* di) { struct attribute name; - struct symt* ret_type; - struct symt_function_signature* sig_type; struct symt_function* inlined; struct vector* children; dwarf2_debug_info_t*child; @@ -2136,16 +2129,12 @@ static void dwarf2_parse_inlined_subroutine(dwarf2_subprogram_t* subpgm, FIXME("No name for function... dropping function\n"); return; } - ret_type = dwarf2_lookup_type(di); - - /* FIXME: assuming C source code */ - sig_type = symt_new_function_signature(subpgm->ctx->module_ctx->module, ret_type, CV_CALL_FAR_C);
inlined = symt_new_inlinesite(subpgm->ctx->module_ctx->module, subpgm->top_func, subpgm->current_block ? &subpgm->current_block->symt : &subpgm->current_func->symt, dwarf2_get_cpp_name(di, name.u.string), - &sig_type->symt, num_ranges); + dwarf2_parse_subroutine_type(di), num_ranges); subpgm->current_func = inlined; subpgm->current_block = NULL;
@@ -2254,7 +2243,8 @@ static void dwarf2_parse_subprogram_block(dwarf2_subprogram_t* subpgm, dwarf2_parse_pointer_type(child); break; case DW_TAG_subroutine_type: - dwarf2_parse_subroutine_type(child); + if (!child->symt) + child->symt = dwarf2_parse_subroutine_type(child); break; case DW_TAG_const_type: dwarf2_parse_const_type(child); @@ -2304,8 +2294,6 @@ static struct symt* dwarf2_parse_subprogram(dwarf2_debug_info_t* di) unsigned num_addr_ranges; struct attribute is_decl; struct attribute inline_flags; - struct symt* ret_type; - struct symt_function_signature* sig_type; dwarf2_subprogram_t subpgm; struct vector* children; dwarf2_debug_info_t* child; @@ -2352,13 +2340,11 @@ static struct symt* dwarf2_parse_subprogram(dwarf2_debug_info_t* di) free(addr_ranges); return NULL; } - ret_type = dwarf2_lookup_type(di);
- /* FIXME: assuming C source code */ - sig_type = symt_new_function_signature(di->unit_ctx->module_ctx->module, ret_type, CV_CALL_FAR_C); subpgm.top_func = symt_new_function(di->unit_ctx->module_ctx->module, di->unit_ctx->compiland, dwarf2_get_cpp_name(di, name.u.string), - addr_ranges[0].low, addr_ranges[0].high - addr_ranges[0].low, &sig_type->symt); + addr_ranges[0].low, addr_ranges[0].high - addr_ranges[0].low, + dwarf2_parse_subroutine_type(di)); if (num_addr_ranges > 1) WARN("Function %s has multiple address ranges, only using the first one\n", debugstr_a(name.u.string)); free(addr_ranges); @@ -2446,8 +2432,6 @@ static struct symt* dwarf2_parse_subroutine_type(dwarf2_debug_info_t* di) dwarf2_debug_info_t* child; unsigned int i;
- if (di->symt) return di->symt; - TRACE("%s\n", dwarf2_debug_di(di));
ret_type = dwarf2_lookup_type(di); @@ -2472,7 +2456,7 @@ static struct symt* dwarf2_parse_subroutine_type(dwarf2_debug_info_t* di) } }
- return di->symt = &sig_type->symt; + return &sig_type->symt; }
static void dwarf2_parse_namespace(dwarf2_debug_info_t* di) @@ -2561,7 +2545,8 @@ static void dwarf2_load_one_entry(dwarf2_debug_info_t* di) dwarf2_parse_subprogram(di); break; case DW_TAG_subroutine_type: - dwarf2_parse_subroutine_type(di); + if (!di->symt) + di->symt = dwarf2_parse_subroutine_type(di); break; case DW_TAG_variable: {
From: Eric Pouech epouech@codeweavers.com
Signed-off-by: Eric Pouech epouech@codeweavers.com --- dlls/dbghelp/dbghelp_private.h | 1 + dlls/dbghelp/symbol.c | 45 +++++++++++++++++----------------- 2 files changed, 24 insertions(+), 22 deletions(-)
diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h index 27f869de4c6..2d7d84f017e 100644 --- a/dlls/dbghelp/dbghelp_private.h +++ b/dlls/dbghelp/dbghelp_private.h @@ -827,6 +827,7 @@ extern BOOL symt_get_address(const struct symt* type, ULONG64* addr); extern int __cdecl symt_cmp_addr(const void* p1, const void* p2); extern void copy_symbolW(SYMBOL_INFOW* siw, const SYMBOL_INFO* si); extern void symbol_setname(SYMBOL_INFO* si, const char* name); +extern BOOL symt_match_stringAW(const char *string, const WCHAR *re, BOOL _case); extern struct symt_ht* symt_find_nearest(struct module* module, DWORD_PTR addr); extern struct symt_ht* diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c index 961f77094b5..4fdd0a141be 100644 --- a/dlls/dbghelp/symbol.c +++ b/dlls/dbghelp/symbol.c @@ -2359,13 +2359,28 @@ found: return TRUE; }
+BOOL symt_match_stringAW(const char *string, const WCHAR *re, BOOL _case) +{ + WCHAR* strW; + BOOL ret = FALSE; + DWORD sz; + + sz = MultiByteToWideChar(CP_ACP, 0, string, -1, NULL, 0); + if ((strW = HeapAlloc(GetProcessHeap(), 0, sz * sizeof(WCHAR)))) + { + MultiByteToWideChar(CP_ACP, 0, string, -1, strW, sz); + ret = SymMatchStringW(strW, re, _case); + HeapFree(GetProcessHeap(), 0, strW); + } + return ret; +} + /****************************************************************** * SymMatchStringA (DBGHELP.@) * */ BOOL WINAPI SymMatchStringA(PCSTR string, PCSTR re, BOOL _case) { - WCHAR* strW; WCHAR* reW; BOOL ret = FALSE; DWORD sz; @@ -2377,17 +2392,13 @@ BOOL WINAPI SymMatchStringA(PCSTR string, PCSTR re, BOOL _case) } TRACE("%s %s %c\n", debugstr_a(string), debugstr_a(re), _case ? 'Y' : 'N');
- sz = MultiByteToWideChar(CP_ACP, 0, string, -1, NULL, 0); - if ((strW = HeapAlloc(GetProcessHeap(), 0, sz * sizeof(WCHAR)))) - MultiByteToWideChar(CP_ACP, 0, string, -1, strW, sz); sz = MultiByteToWideChar(CP_ACP, 0, re, -1, NULL, 0); if ((reW = HeapAlloc(GetProcessHeap(), 0, sz * sizeof(WCHAR)))) + { MultiByteToWideChar(CP_ACP, 0, re, -1, reW, sz); - - if (strW && reW) - ret = SymMatchStringW(strW, reW, _case); - HeapFree(GetProcessHeap(), 0, strW); - HeapFree(GetProcessHeap(), 0, reW); + ret = symt_match_stringAW(string, reW, _case); + HeapFree(GetProcessHeap(), 0, reW); + } return ret; }
@@ -2555,20 +2566,10 @@ BOOL WINAPI SymEnumLines(HANDLE hProcess, ULONG64 base, PCSTR compiland, if (dli->is_source_file) { file = source_get(pair.effective, dli->u.source_file); - if (!file) sci.FileName[0] = '\0'; + if (file && symt_match_stringAW(file, srcmask, FALSE)) + strcpy(sci.FileName, file); else - { - DWORD sz = MultiByteToWideChar(CP_ACP, 0, file, -1, NULL, 0); - WCHAR* fileW; - - if ((fileW = HeapAlloc(GetProcessHeap(), 0, sz * sizeof(WCHAR)))) - MultiByteToWideChar(CP_ACP, 0, file, -1, fileW, sz); - if (SymMatchStringW(fileW, srcmask, FALSE)) - strcpy(sci.FileName, file); - else - sci.FileName[0] = '\0'; - HeapFree(GetProcessHeap(), 0, fileW); - } + sci.FileName[0] = '\0'; } else if (sci.FileName[0]) {