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.
This commit is contained in:
Raphael Junqueira 2005-05-18 09:42:17 +00:00 committed by Alexandre Julliard
parent 54160222a0
commit 92000a91da
2 changed files with 13 additions and 3 deletions

View File

@ -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;
}

View File

@ -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;
}