Commit d3868239 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

dbghelp: Move get_dos_file_name to path.c.

parent 171c6fad
......@@ -668,6 +668,7 @@ extern BOOL pdb_virtual_unwind(struct cpu_stack_walk *csw, DWORD_PTR ip,
extern BOOL path_find_symbol_file(const struct process* pcs, const struct module* module,
PCSTR full_path, const GUID* guid, DWORD dw1, DWORD dw2,
WCHAR *buffer, BOOL* is_unmatched) DECLSPEC_HIDDEN;
extern WCHAR *get_dos_file_name(const WCHAR *filename) DECLSPEC_HIDDEN;
/* pe_module.c */
extern BOOL pe_load_nt_header(HANDLE hProc, DWORD64 base, IMAGE_NT_HEADERS* nth) DECLSPEC_HIDDEN;
......
......@@ -396,29 +396,6 @@ static BOOL elf_map_shdr(struct elf_map_file_data* emfd, struct image_file_map*
return TRUE;
}
static WCHAR *get_dos_file_name(const WCHAR *filename)
{
WCHAR *dos_path;
size_t len;
if (*filename == '/')
{
char *unix_path;
len = WideCharToMultiByte(CP_UNIXCP, 0, filename, -1, NULL, 0, NULL, NULL);
unix_path = heap_alloc(len * sizeof(WCHAR));
WideCharToMultiByte(CP_UNIXCP, 0, filename, -1, unix_path, len, NULL, NULL);
dos_path = wine_get_dos_file_name(unix_path);
heap_free(unix_path);
}
else
{
len = lstrlenW(filename);
dos_path = heap_alloc((len + 1) * sizeof(WCHAR));
memcpy(dos_path, filename, (len + 1) * sizeof(WCHAR));
}
return dos_path;
}
/******************************************************************
* elf_map_file
*
......
......@@ -27,6 +27,7 @@
#include "winnls.h"
#include "winternl.h"
#include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
......@@ -696,3 +697,26 @@ BOOL path_find_symbol_file(const struct process* pcs, const struct module* modul
}
return FALSE;
}
WCHAR *get_dos_file_name(const WCHAR *filename)
{
WCHAR *dos_path;
size_t len;
if (*filename == '/')
{
char *unix_path;
len = WideCharToMultiByte(CP_UNIXCP, 0, filename, -1, NULL, 0, NULL, NULL);
unix_path = heap_alloc(len * sizeof(WCHAR));
WideCharToMultiByte(CP_UNIXCP, 0, filename, -1, unix_path, len, NULL, NULL);
dos_path = wine_get_dos_file_name(unix_path);
heap_free(unix_path);
}
else
{
len = lstrlenW(filename);
dos_path = heap_alloc((len + 1) * sizeof(WCHAR));
memcpy(dos_path, filename, (len + 1) * sizeof(WCHAR));
}
return dos_path;
}
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