Commit 92000a91 authored by Raphael Junqueira's avatar Raphael Junqueira Committed by Alexandre Julliard

Fix open_pdb_file (used for locate/open pdbs):

- pdb_match heuristic now only stop when "first file" exists - SymFindFileInPath now fill output buffer with a valid value on success.
parent 54160222
......@@ -1763,8 +1763,14 @@ static void pdb_convert_symbol_file(const PDB_SYMBOLS* symbols,
static BOOL CALLBACK pdb_match(char* file, void* user)
{
/* accept first file */
return FALSE;
/* accept first file that exists */
HANDLE h = CreateFileA(file, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
TRACE("match with %s returns %x\n", file, h);
if (INVALID_HANDLE_VALUE != h) {
CloseHandle(h);
return FALSE;
}
return TRUE;
}
static HANDLE open_pdb_file(const struct process* pcs, const char* filename)
......@@ -1781,6 +1787,7 @@ static HANDLE open_pdb_file(const struct process* pcs, const char* filename)
{
h = CreateFileA(dbg_file_path, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
TRACE("with %s returns %x\n", dbg_file_path, h);
}
return (h == INVALID_HANDLE_VALUE) ? NULL : h;
}
......
......@@ -342,7 +342,10 @@ BOOL WINAPI SymFindFileInPath(HANDLE hProcess, LPSTR searchPath, LPSTR full_path
strcpy(tmp, searchPath);
searchPath = NULL;
}
if (do_search(filename, tmp, FALSE, sffip_cb, &s)) return TRUE;
if (do_search(filename, tmp, FALSE, sffip_cb, &s)) {
strcpy(buffer, tmp);
return TRUE;
}
}
return 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