This MR is a subset of MR 6715 [1]. It mainly contains fixes and improvements in dbghelp handling of DEBUG directories in PE header.
Since 6715 may take some time to be finished (may take some more time to have an approved solution), it seems preferable to land these fixes/improvements in Wine before code freeze.
The changes in this MR: - fixes loading dwarf info from PE files compiled by gcc/mingw with --build-id option, - several improvements for SymSrvGetFileIndexInfo (esp. native fails with ERROR_BAD_EXE_FORMAT error code when there is no DEBUG directory; yet, does it fill most of the information out of the PE image... Note that images compiled with gcc/mingw compilation (dwarf debug info, no buildid don't have DEBUG directories) So mimic native's behavior, and fix some code paths accordingly, - some fixes for .dbg handling (not much of an use today anyway).
[1] https://gitlab.winehq.org/wine/wine/-/merge_requests/6715
From: Eric Pouech epouech@codeweavers.com
Signed-off-by: Eric Pouech epouech@codeweavers.com --- dlls/dbghelp/msc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c index d9b37509a9b..e2e91e1abd2 100644 --- a/dlls/dbghelp/msc.c +++ b/dlls/dbghelp/msc.c @@ -4379,7 +4379,13 @@ static BOOL codeview_process_info(const struct process *pcs,
TRACE("Got RSDS type of PDB file: guid=%s age=%08x name=%s\n", wine_dbgstr_guid(&rsds->guid), rsds->age, debugstr_a(rsds->name)); - ret = pdb_process_file(pcs, msc_dbg, rsds->name, &rsds->guid, 0, rsds->age); + /* gcc/mingw and clang can emit build-id information, but with an empty PDB filename. + * Don't search for the .pdb file in that case. + */ + if (rsds->name[0]) + ret = pdb_process_file(pcs, msc_dbg, rsds->name, &rsds->guid, 0, rsds->age); + else + ret = TRUE; break; } default: @@ -4487,7 +4493,7 @@ typedef struct _FPO_DATA __ENDTRY
/* we haven't found yet any debug information, fallback to unmatched pdb */ - if (module->module.SymType == SymDeferred) + if (!ret && module->module.SymType == SymDeferred) { SYMSRV_INDEX_INFOW info = {.sizeofstruct = sizeof(info)}; char buffer[MAX_PATH];
From: Eric Pouech epouech@codeweavers.com
When stripping, binutils' objcopy also sets the flag, yet without stripping into a .DBG file.
Signed-off-by: Eric Pouech epouech@codeweavers.com --- dlls/dbghelp/pe_module.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/dbghelp/pe_module.c b/dlls/dbghelp/pe_module.c index 8071b8987e3..74f5b08e613 100644 --- a/dlls/dbghelp/pe_module.c +++ b/dlls/dbghelp/pe_module.c @@ -656,8 +656,8 @@ static BOOL pe_load_msc_debug_info(const struct process* pcs, struct module* mod if (nDbg != 1 || dbg->Type != IMAGE_DEBUG_TYPE_MISC || misc->DataType != IMAGE_DEBUG_MISC_EXENAME) { - ERR("-Debug info stripped, but no .DBG file in module %s\n", - debugstr_w(module->modulename)); + WARN("-Debug info stripped, but no .DBG file in module %s\n", + debugstr_w(module->modulename)); } else {
From: Eric Pouech epouech@codeweavers.com
Esp. the failures with ERROR_BAD_EXE_FORMAT still fill all the fields in the returned structure.
Add more flexibility to .dbg file creation (optional DEBUG_DIRECTORY).
Signed-off-by: Eric Pouech epouech@codeweavers.com --- dlls/dbghelp/tests/path.c | 121 ++++++++++++++++++++++++++------------ 1 file changed, 85 insertions(+), 36 deletions(-)
diff --git a/dlls/dbghelp/tests/path.c b/dlls/dbghelp/tests/path.c index 804d6885ec3..83d43008983 100644 --- a/dlls/dbghelp/tests/path.c +++ b/dlls/dbghelp/tests/path.c @@ -671,20 +671,22 @@ static BOOL create_test_pdb_ds(const WCHAR* pdb_name, const GUID* guid, DWORD ag return TRUE; }
-static BOOL create_test_dbg(const WCHAR* dbg_name, WORD machine, DWORD timestamp, DWORD size) +static BOOL create_test_dbg(const WCHAR* dbg_name, WORD machine, DWORD charac, DWORD timestamp, DWORD size, struct debug_directory_blob *blob) { HANDLE hfile;
/* minimalistic .dbg made of a header and a DEBUG_DIRECTORY without any data */ - const IMAGE_SEPARATE_DEBUG_HEADER header = {.Signature = 0x4944 /* DI */, - .Flags = 0, .Machine = machine, .Characteristics = 0x010E, .TimeDateStamp = timestamp, + IMAGE_SEPARATE_DEBUG_HEADER header = + { + .Signature = 0x4944 /* DI */, + .Flags = 0, .Machine = machine, .Characteristics = charac, .TimeDateStamp = timestamp, .CheckSum = 0, .ImageBase = 0x00040000, .SizeOfImage = size, .NumberOfSections = 0, - .ExportedNamesSize = 0, .DebugDirectorySize = sizeof(IMAGE_DEBUG_DIRECTORY)}; - const IMAGE_DEBUG_DIRECTORY debug_dir = {.Characteristics = 0, .TimeDateStamp = timestamp + 1, - .MajorVersion = 0, .MinorVersion = 0, .Type = IMAGE_DEBUG_TYPE_CODEVIEW, - .SizeOfData = 0, .AddressOfRawData = 0, - .PointerToRawData = sizeof(header) + header.NumberOfSections * sizeof(IMAGE_SECTION_HEADER) + - header.DebugDirectorySize}; + .ExportedNamesSize = 0, .DebugDirectorySize = 0 + }; + DWORD where, expected_size;; + + if (blob) + header.DebugDirectorySize = sizeof(IMAGE_DEBUG_DIRECTORY);
hfile = CreateFileW(dbg_name, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, 0, 0); ok(hfile != INVALID_HANDLE_VALUE, "failed to create %ls err %lu\n", dbg_name, GetLastError()); @@ -692,8 +694,18 @@ static BOOL create_test_dbg(const WCHAR* dbg_name, WORD machine, DWORD timestamp
check_write_file(hfile, &header, sizeof(header)); /* FIXME: 0 sections... as header.NumberOfSections */ - check_write_file(hfile, &debug_dir, sizeof(debug_dir)); - ok(SetFilePointer(hfile, 0, NULL, FILE_CURRENT) == debug_dir.PointerToRawData, "mismatch\n"); + if (blob) + { + where = SetFilePointer(hfile, 0, NULL, FILE_CURRENT); + blob->debug_directory.PointerToRawData = (blob->debug_directory.SizeOfData) ? + where + sizeof(IMAGE_DEBUG_DIRECTORY) : 0; + check_write_file(hfile, &blob->debug_directory, sizeof(IMAGE_DEBUG_DIRECTORY)); + check_write_file(hfile, blob->content, blob->debug_directory.SizeOfData); + } + expected_size = sizeof(header) + header.NumberOfSections * sizeof(IMAGE_SECTION_HEADER); + if (blob) + expected_size += sizeof(IMAGE_DEBUG_DIRECTORY) + blob->debug_directory.SizeOfData; + ok(SetFilePointer(hfile, 0, NULL, FILE_CURRENT) == expected_size, "Incorrect file length\n");
CloseHandle(hfile); return TRUE; @@ -725,16 +737,16 @@ static void test_srvgetindexes_pe(void) DWORD sig; WCHAR pdb_name[16]; WCHAR dbg_name[16]; - BOOL in_error; + DWORD last_error; } indexes[] = { /* error cases */ -/* 0 */{0, {-1, -1, -1}, .in_error = TRUE}, - {IMAGE_FILE_DEBUG_STRIPPED, { 0, -1, -1}, .in_error = TRUE}, - {IMAGE_FILE_DEBUG_STRIPPED, { 1, -1, -1}, .in_error = TRUE}, - {IMAGE_FILE_DEBUG_STRIPPED, { 2, -1, -1}, .in_error = TRUE}, - {IMAGE_FILE_DEBUG_STRIPPED, {-1, -1, -1}, .in_error = TRUE}, /* not 100% logical ! */ +/* 0 */{0, {-1, -1, -1}, 0, &null_guid, 0, .last_error = ERROR_BAD_EXE_FORMAT}, + {IMAGE_FILE_DEBUG_STRIPPED, { 0, -1, -1}, 0, &null_guid, 0, .last_error = ERROR_BAD_EXE_FORMAT}, + {IMAGE_FILE_DEBUG_STRIPPED, { 1, -1, -1}, 123, &null_guid, 0xaaaabbbb, .pdb_name = L"pdbjg.pdb", .last_error = ERROR_BAD_EXE_FORMAT}, + {IMAGE_FILE_DEBUG_STRIPPED, { 2, -1, -1}, 124, &guid1, 0, .pdb_name = L"pdbds.pdb", .last_error = ERROR_BAD_EXE_FORMAT}, + {IMAGE_FILE_DEBUG_STRIPPED, {-1, -1, -1}, 0, &null_guid, 0, .last_error = ERROR_BAD_EXE_FORMAT}, /* not 100% logical ! */ /* success */ /* 5 */{0, { 0, -1, -1}, 0, &null_guid, 0 }, {0, { 1, -1, -1}, 123, &null_guid, 0xaaaabbbb, .pdb_name = L"pdbjg.pdb"}, @@ -796,16 +808,18 @@ static void test_srvgetindexes_pe(void) memset(&ssii, 0xa5, sizeof(ssii)); ssii.sizeofstruct = sizeof(ssii); ret = SymSrvGetFileIndexInfoW(filename, &ssii, 0); - if (indexes[i].in_error) + if (indexes[i].last_error) { ok(!ret, "SymSrvGetFileIndexInfo should have failed\n"); - ok(GetLastError() == ERROR_BAD_EXE_FORMAT, "Mismatch in GetLastError: %lu\n", GetLastError()); + ok(GetLastError() == indexes[i].last_error, "Mismatch in GetLastError: %lu\n", GetLastError()); } else - { ok(ret, "SymSrvGetFileIndexInfo failed: %lu\n", GetLastError()); - - ok(ssii.age == indexes[i].age, "Mismatch in age: %lx\n", ssii.age); + if (ret || indexes[i].last_error == ERROR_BAD_EXE_FORMAT) + { + todo_wine_if(i==0||i==4) + { + ok(ssii.age == indexes[i].age, "Mismatch in age: %lu\n", ssii.age); ok(IsEqualGUID(&ssii.guid, indexes[i].guid), "Mismatch in guid: guid=%s\n", wine_dbgstr_guid(&ssii.guid));
@@ -815,9 +829,13 @@ static void test_srvgetindexes_pe(void) (!ssii.stripped) == ((indexes[i].charac & IMAGE_FILE_DEBUG_STRIPPED) == 0), "Mismatch in stripped: %x\n", ssii.stripped); ok(ssii.timestamp == 0x67890000 + i, "Mismatch in timestamp: %lx\n", ssii.timestamp); + } + if (i > 4) + { ok(!wcscmp(ssii.file, filename + 2), "Mismatch in file: '%ls'\n", ssii.file); ok(!wcscmp(ssii.dbgfile, indexes[i].dbg_name), "Mismatch in dbgfile: '%ls'\n", ssii.dbgfile); ok(!wcscmp(ssii.pdbfile, indexes[i].pdb_name), "Mismatch in pdbfile: '%ls'\n", ssii.pdbfile); + } } ret = DeleteFileW(filename); ok(ret, "Couldn't delete test DLL file\n"); @@ -882,48 +900,78 @@ static void test_srvgetindexes_dbg(void) WCHAR filename[128]; SYMSRV_INDEX_INFOW ssii; BOOL ret; + struct debug_directory_blob *blob_refs[1];
static struct { /* input parameters */ - WORD machine; - DWORD timestamp; - DWORD imagesize; + WORD machine; + DWORD characteristics; + DWORD timestamp; + DWORD imagesize; + int blob; + /* output parameters */ + DWORD age; + const GUID *guid; + WCHAR pdbname[16]; + WCHAR dbgname[16]; + DWORD last_error; } indexes[] = { - {IMAGE_FILE_MACHINE_I386, 0x1234, 0x00560000}, - {IMAGE_FILE_MACHINE_AMD64, 0x1235, 0x00570000}, + {IMAGE_FILE_MACHINE_I386, 0, 0x1234, 0x00560000, -1, 0, &null_guid, .last_error = ERROR_BAD_EXE_FORMAT}, + {IMAGE_FILE_MACHINE_AMD64, 0, 0x1235, 0x00570000, -1, 0, &null_guid, .last_error = ERROR_BAD_EXE_FORMAT}, + {IMAGE_FILE_MACHINE_I386, 0, 0x1234, 0x00560000, 0, 123, &guid1, .pdbname=L"foo.pdb"}, + {IMAGE_FILE_MACHINE_AMD64, 0, 0x1235, 0x00570000, 0, 123, &guid1, .pdbname=L"foo.pdb"}, }; + + blob_refs[0] = make_pdb_ds_blob(0x1226, &guid1, 123, "foo.pdb"); for (i = 0; i < ARRAY_SIZE(indexes); i++) { winetest_push_context("dbg#%02u", i);
/* create dll */ swprintf(filename, ARRAY_SIZE(filename), L"winetest%02u.dbg", i); - ret = create_test_dbg(filename, indexes[i].machine, indexes[i].timestamp, indexes[i].imagesize); + ret = create_test_dbg(filename, indexes[i].machine, indexes[i].characteristics, + indexes[i].timestamp, indexes[i].imagesize, + indexes[i].blob == -1 ? NULL : blob_refs[indexes[i].blob]); ok(ret, "Couldn't create dbg file %ls\n", filename);
memset(&ssii, 0x45, sizeof(ssii)); ssii.sizeofstruct = sizeof(ssii); ret = SymSrvGetFileIndexInfoW(filename, &ssii, 0); - ok(ret, "SymSrvGetFileIndexInfo failed: %lu\n", GetLastError()); + if (indexes[i].last_error) + { + ok(!ret, "SymSrvGetFileIndexInfo should have\n"); + ok(GetLastError() == ERROR_BAD_EXE_FORMAT, "Unexpected last error: %lu\n", GetLastError()); + } + else + ok(ret, "SymSrvGetFileIndexInfo failed: %lu\n", GetLastError());
- ok(ssii.age == 0, "Mismatch in age: %lx\n", ssii.age); - ok(!memcmp(&ssii.guid, &null_guid, sizeof(GUID)), + todo_wine + { + ok(ssii.age == indexes[i].age, "Mismatch in age: %lx\n", ssii.age); + ok(IsEqualGUID(&ssii.guid, indexes[i].guid), "Mismatch in guid: guid=%s\n", wine_dbgstr_guid(&ssii.guid)); - + } + todo_wine_if(i < 2) + { ok(ssii.sig == 0, "Mismatch in sig: %lx\n", ssii.sig); ok(ssii.size == indexes[i].imagesize, "Mismatch in size: %lx\n", ssii.size); ok(!ssii.stripped, "Mismatch in stripped: %x\n", ssii.stripped); ok(ssii.timestamp == indexes[i].timestamp, "Mismatch in timestamp: %lx\n", ssii.timestamp); + } + if (i >= 2) ok(!wcscmp(ssii.file, filename), "Mismatch in file: %ls\n", ssii.file); - ok(!ssii.pdbfile[0], "Mismatch in pdbfile: %ls\n", ssii.pdbfile); - ok(!ssii.dbgfile[0], "Mismatch in dbgfile: %ls\n", ssii.dbgfile); + todo_wine + ok(!wcscmp(ssii.pdbfile, indexes[i].pdbname), "Mismatch in pdbfile: %ls\n", ssii.pdbfile); + if (i >= 2) + ok(!wcscmp(ssii.dbgfile, indexes[i].dbgname), "Mismatch in dbgfile: %ls\n", ssii.dbgfile);
DeleteFileW(filename); winetest_pop_context(); } + for (i = 0; i < ARRAY_SIZE(blob_refs); i++) free(blob_refs[i]); }
static void make_path(WCHAR file[MAX_PATH], const WCHAR* topdir, const WCHAR* subdir, const WCHAR* base) @@ -1533,7 +1581,8 @@ static void test_load_modules_path(void) if (test_files[val].guid) create_test_pdb_ds(filename, test_files[val].guid, test_files[val].age_or_timestamp); else - create_test_dbg(filename, IMAGE_FILE_MACHINE_AMD64 /* FIXME */, test_files[val].age_or_timestamp, 0x40000 * val * 0x20000); + /*create_test_dbg(filename, IMAGE_FILE_MACHINE_AMD64, 0x10E, test_files[val].age_or_timestamp, 0x40000 * val * 0x20000, blob); */ + ok(0, "not supported yet\n"); } else ok(0, "Unrecognized file reference %c\n", *ptr); } @@ -1754,7 +1803,7 @@ static void test_load_modules_details(void) if (test_files[val].guid) create_test_pdb_ds(filename, test_files[val].guid, test_files[val].age_or_timestamp); else - create_test_dbg(filename, IMAGE_FILE_MACHINE_AMD64 /* FIXME */, test_files[val].age_or_timestamp, 0x40000 * val * 0x20000); + create_test_dbg(filename, IMAGE_FILE_MACHINE_AMD64 /* FIXME */, 0x10E, test_files[val].age_or_timestamp, 0x40000 * val * 0x20000, NULL); } else ok(0, "Unrecognized file reference %c\n", *ptr); }
From: Eric Pouech epouech@codeweavers.com
Signed-off-by: Eric Pouech epouech@codeweavers.com --- dlls/dbghelp/msc.c | 29 +++++++++++++---------------- dlls/dbghelp/path.c | 2 +- dlls/dbghelp/pe_module.c | 2 +- dlls/dbghelp/tests/path.c | 15 --------------- 4 files changed, 15 insertions(+), 33 deletions(-)
diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c index e2e91e1abd2..d2bbf7f784c 100644 --- a/dlls/dbghelp/msc.c +++ b/dlls/dbghelp/msc.c @@ -4555,38 +4555,35 @@ DWORD msc_get_file_indexinfo(void* image, const IMAGE_DEBUG_DIRECTORY* debug_dir num_misc_records++; } } - return info->stripped && !num_misc_records ? ERROR_BAD_EXE_FORMAT : ERROR_SUCCESS; + return (!num_dir || (info->stripped && !num_misc_records)) ? ERROR_BAD_EXE_FORMAT : ERROR_SUCCESS; }
DWORD dbg_get_file_indexinfo(void* image, DWORD size, SYMSRV_INDEX_INFOW* info) { const IMAGE_SEPARATE_DEBUG_HEADER *header; + IMAGE_DEBUG_DIRECTORY *dbg; DWORD num_directories;
- if (size < sizeof(*header)) return ERROR_BAD_EXE_FORMAT; + if (size < sizeof(*header)) return ERROR_BAD_FORMAT; header = image; if (header->Signature != 0x4944 /* DI */ || size < sizeof(*header) + header->NumberOfSections * sizeof(IMAGE_SECTION_HEADER) + header->ExportedNamesSize + header->DebugDirectorySize) - return ERROR_BAD_EXE_FORMAT; + return ERROR_BAD_FORMAT; + + info->size = header->SizeOfImage; + /* seems to use header's timestamp, not debug_directory one */ + info->timestamp = header->TimeDateStamp; + info->stripped = FALSE; /* FIXME */
/* header is followed by: * - header->NumberOfSections of IMAGE_SECTION_HEADER * - header->ExportedNameSize * - then num_directories of IMAGE_DEBUG_DIRECTORY */ + dbg = (IMAGE_DEBUG_DIRECTORY*)((char*)(header + 1) + + header->NumberOfSections * sizeof(IMAGE_SECTION_HEADER) + + header->ExportedNamesSize); num_directories = header->DebugDirectorySize / sizeof(IMAGE_DEBUG_DIRECTORY);
- if (!num_directories) return ERROR_BAD_EXE_FORMAT; - - info->age = 0; - memset(&info->guid, 0, sizeof(info->guid)); - info->sig = 0; - info->dbgfile[0] = L'\0'; - info->pdbfile[0] = L'\0'; - info->size = header->SizeOfImage; - /* seems to use header's timestamp, not debug_directory one */ - info->timestamp = header->TimeDateStamp; - info->stripped = FALSE; /* FIXME */ - - return ERROR_SUCCESS; + return msc_get_file_indexinfo(image, dbg, num_directories, info); } diff --git a/dlls/dbghelp/path.c b/dlls/dbghelp/path.c index 0f52bca3684..c1fc6addb0c 100644 --- a/dlls/dbghelp/path.c +++ b/dlls/dbghelp/path.c @@ -832,7 +832,7 @@ BOOL WINAPI SymSrvGetFileIndexInfoW(const WCHAR *file, SYMSRV_INDEX_INFOW* info, if (hMap) CloseHandle(hMap); if (hFile != INVALID_HANDLE_VALUE) CloseHandle(hFile);
- if (ret == ERROR_SUCCESS) wcscpy(info->file, file_name(file)); /* overflow? */ + if (ret == ERROR_SUCCESS || ret == ERROR_BAD_EXE_FORMAT) wcscpy(info->file, file_name(file)); /* overflow? */ SetLastError(ret); return ret == ERROR_SUCCESS; } diff --git a/dlls/dbghelp/pe_module.c b/dlls/dbghelp/pe_module.c index 74f5b08e613..75060e2dfa6 100644 --- a/dlls/dbghelp/pe_module.c +++ b/dlls/dbghelp/pe_module.c @@ -1019,7 +1019,7 @@ DWORD pe_get_file_indexinfo(void* image, DWORD size, SYMSRV_INDEX_INFOW* info) if (!(nthdr = RtlImageNtHeader(image))) return ERROR_BAD_FORMAT;
dbg = RtlImageDirectoryEntryToData(image, FALSE, IMAGE_DIRECTORY_ENTRY_DEBUG, &dirsize); - if (!dbg || dirsize < sizeof(dbg)) return ERROR_BAD_EXE_FORMAT; + if (!dbg) dirsize = 0;
/* fill in information from NT header */ info->timestamp = nthdr->FileHeader.TimeDateStamp; diff --git a/dlls/dbghelp/tests/path.c b/dlls/dbghelp/tests/path.c index 83d43008983..8a27effcdfc 100644 --- a/dlls/dbghelp/tests/path.c +++ b/dlls/dbghelp/tests/path.c @@ -817,8 +817,6 @@ static void test_srvgetindexes_pe(void) ok(ret, "SymSrvGetFileIndexInfo failed: %lu\n", GetLastError()); if (ret || indexes[i].last_error == ERROR_BAD_EXE_FORMAT) { - todo_wine_if(i==0||i==4) - { ok(ssii.age == indexes[i].age, "Mismatch in age: %lu\n", ssii.age); ok(IsEqualGUID(&ssii.guid, indexes[i].guid), "Mismatch in guid: guid=%s\n", wine_dbgstr_guid(&ssii.guid)); @@ -829,13 +827,9 @@ static void test_srvgetindexes_pe(void) (!ssii.stripped) == ((indexes[i].charac & IMAGE_FILE_DEBUG_STRIPPED) == 0), "Mismatch in stripped: %x\n", ssii.stripped); ok(ssii.timestamp == 0x67890000 + i, "Mismatch in timestamp: %lx\n", ssii.timestamp); - } - if (i > 4) - { ok(!wcscmp(ssii.file, filename + 2), "Mismatch in file: '%ls'\n", ssii.file); ok(!wcscmp(ssii.dbgfile, indexes[i].dbg_name), "Mismatch in dbgfile: '%ls'\n", ssii.dbgfile); ok(!wcscmp(ssii.pdbfile, indexes[i].pdb_name), "Mismatch in pdbfile: '%ls'\n", ssii.pdbfile); - } } ret = DeleteFileW(filename); ok(ret, "Couldn't delete test DLL file\n"); @@ -948,24 +942,15 @@ static void test_srvgetindexes_dbg(void) else ok(ret, "SymSrvGetFileIndexInfo failed: %lu\n", GetLastError());
- todo_wine - { ok(ssii.age == indexes[i].age, "Mismatch in age: %lx\n", ssii.age); ok(IsEqualGUID(&ssii.guid, indexes[i].guid), "Mismatch in guid: guid=%s\n", wine_dbgstr_guid(&ssii.guid)); - } - todo_wine_if(i < 2) - { ok(ssii.sig == 0, "Mismatch in sig: %lx\n", ssii.sig); ok(ssii.size == indexes[i].imagesize, "Mismatch in size: %lx\n", ssii.size); ok(!ssii.stripped, "Mismatch in stripped: %x\n", ssii.stripped); ok(ssii.timestamp == indexes[i].timestamp, "Mismatch in timestamp: %lx\n", ssii.timestamp); - } - if (i >= 2) ok(!wcscmp(ssii.file, filename), "Mismatch in file: %ls\n", ssii.file); - todo_wine ok(!wcscmp(ssii.pdbfile, indexes[i].pdbname), "Mismatch in pdbfile: %ls\n", ssii.pdbfile); - if (i >= 2) ok(!wcscmp(ssii.dbgfile, indexes[i].dbgname), "Mismatch in dbgfile: %ls\n", ssii.dbgfile);
DeleteFileW(filename);
The failure on Win11 doesn't seem related. It more or less looks like the issue we had with EnumerateLoadedModules failing some times to times (and very likely even native dbghelp's SymRefreshModuleList() relies on EnumerateLoadedModules()). I could (in another MR) wrap SymRefreshModuleList with some retry logic (also have pending implementation for SymRefreshModuleList for PE modules).