Commit 9d2f48dc authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

dbghelp: Better match the PSDK types, especially with regards to constness.

Also add a number of missing prototypes, especially 64bit or Unicode versions of existing prototypes, and the related structures. Update win32.api to fix the winapi_check warnings.
parent 7a70f9f5
......@@ -175,7 +175,7 @@ BOOL WINAPI SymSetSearchPath(HANDLE hProcess, PCSTR searchPath)
/***********************************************************************
* SymGetSearchPathW (DBGHELP.@)
*/
BOOL WINAPI SymGetSearchPathW(HANDLE hProcess, LPWSTR szSearchPath,
BOOL WINAPI SymGetSearchPathW(HANDLE hProcess, PWSTR szSearchPath,
DWORD SearchPathLength)
{
struct process* pcs = process_find_by_handle(hProcess);
......@@ -188,7 +188,7 @@ BOOL WINAPI SymGetSearchPathW(HANDLE hProcess, LPWSTR szSearchPath,
/***********************************************************************
* SymGetSearchPath (DBGHELP.@)
*/
BOOL WINAPI SymGetSearchPath(HANDLE hProcess, LPSTR szSearchPath,
BOOL WINAPI SymGetSearchPath(HANDLE hProcess, PSTR szSearchPath,
DWORD SearchPathLength)
{
WCHAR* buffer = HeapAlloc(GetProcessHeap(), 0, SearchPathLength * sizeof(WCHAR));
......
......@@ -41,8 +41,8 @@ DWORD WINAPI GetTimestampForLoadedLibrary(HMODULE Module)
/***********************************************************************
* MapDebugInformation (DBGHELP.@)
*/
PIMAGE_DEBUG_INFORMATION WINAPI MapDebugInformation(HANDLE FileHandle, LPSTR FileName,
LPSTR SymbolPath, DWORD ImageBase)
PIMAGE_DEBUG_INFORMATION WINAPI MapDebugInformation(HANDLE FileHandle, PCSTR FileName,
PCSTR SymbolPath, ULONG ImageBase)
{
FIXME("(%p, %s, %s, 0x%08x): stub\n", FileHandle, FileName, SymbolPath, ImageBase);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
......
......@@ -248,8 +248,8 @@ static BOOL add_module(struct dump_context* dc, const WCHAR* name,
*
* Callback for accumulating in dump_context a PE modules set
*/
static BOOL WINAPI fetch_pe_module_info_cb(WCHAR* name, DWORD64 base, DWORD size,
void* user)
static BOOL WINAPI fetch_pe_module_info_cb(PCWSTR name, DWORD64 base, ULONG size,
PVOID user)
{
struct dump_context* dc = (struct dump_context*)user;
IMAGE_NT_HEADERS nth;
......@@ -813,9 +813,9 @@ BOOL WINAPI MiniDumpWriteDump(HANDLE hProcess, DWORD pid, HANDLE hFile,
*
*
*/
BOOL WINAPI MiniDumpReadDumpStream(void* base, ULONG str_idx,
BOOL WINAPI MiniDumpReadDumpStream(PVOID base, ULONG str_idx,
PMINIDUMP_DIRECTORY* pdir,
void** stream, ULONG* size)
PVOID* stream, ULONG* size)
{
MINIDUMP_HEADER* mdHead = (MINIDUMP_HEADER*)base;
......
......@@ -370,7 +370,7 @@ static BOOL module_is_elf_container_loaded(const struct process* pcs,
{
size_t len;
struct module* module;
LPCWSTR filename, modname;
PCWSTR filename, modname;
if (!base) return FALSE;
filename = get_filename(ImageName, NULL);
......@@ -428,8 +428,8 @@ enum module_type module_get_type_by_name(const WCHAR* name)
/***********************************************************************
* SymLoadModule (DBGHELP.@)
*/
DWORD WINAPI SymLoadModule(HANDLE hProcess, HANDLE hFile, const char* ImageName,
const char* ModuleName, DWORD BaseOfDll, DWORD SizeOfDll)
DWORD WINAPI SymLoadModule(HANDLE hProcess, HANDLE hFile, PCSTR ImageName,
PCSTR ModuleName, DWORD BaseOfDll, DWORD SizeOfDll)
{
return SymLoadModuleEx(hProcess, hFile, ImageName, ModuleName, BaseOfDll,
SizeOfDll, NULL, 0);
......@@ -442,7 +442,7 @@ DWORD64 WINAPI SymLoadModuleEx(HANDLE hProcess, HANDLE hFile, PCSTR ImageName,
PCSTR ModuleName, DWORD64 BaseOfDll, DWORD DllSize,
PMODLOAD_DATA Data, DWORD Flags)
{
LPWSTR wImageName, wModuleName;
PWSTR wImageName, wModuleName;
unsigned len;
DWORD64 ret;
......@@ -636,7 +636,7 @@ struct enum_modW64_32
char module[MAX_PATH];
};
static BOOL CALLBACK enum_modW64_32(PWSTR name, DWORD64 base, PVOID user)
static BOOL CALLBACK enum_modW64_32(PCWSTR name, DWORD64 base, PVOID user)
{
struct enum_modW64_32* x = user;
......@@ -667,7 +667,7 @@ struct enum_modW64_64
char module[MAX_PATH];
};
static BOOL CALLBACK enum_modW64_64(PWSTR name, DWORD64 base, PVOID user)
static BOOL CALLBACK enum_modW64_64(PCWSTR name, DWORD64 base, PVOID user)
{
struct enum_modW64_64* x = user;
......@@ -722,7 +722,7 @@ struct enum_load_modW64_64
char module[MAX_PATH];
};
static BOOL CALLBACK enum_load_modW64_64(PWSTR name, DWORD64 base, ULONG size,
static BOOL CALLBACK enum_load_modW64_64(PCWSTR name, DWORD64 base, ULONG size,
PVOID user)
{
struct enum_load_modW64_64* x = user;
......@@ -754,7 +754,7 @@ struct enum_load_modW64_32
char module[MAX_PATH];
};
static BOOL CALLBACK enum_load_modW64_32(PWSTR name, DWORD64 base, ULONG size,
static BOOL CALLBACK enum_load_modW64_32(PCWSTR name, DWORD64 base, ULONG size,
PVOID user)
{
struct enum_load_modW64_32* x = user;
......
......@@ -88,7 +88,7 @@ HANDLE WINAPI FindDebugInfoFileEx(PCSTR FileName, PCSTR SymbolPath,
*
*/
HANDLE WINAPI FindExecutableImageExW(PCWSTR FileName, PCWSTR SymbolPath, PWSTR ImageFilePath,
PFIND_EXE_FILE_CALLBACKW Callback, void* user)
PFIND_EXE_FILE_CALLBACKW Callback, PVOID user)
{
HANDLE h;
......@@ -105,7 +105,7 @@ HANDLE WINAPI FindExecutableImageExW(PCWSTR FileName, PCWSTR SymbolPath, PWSTR I
*
*/
HANDLE WINAPI FindExecutableImageEx(PCSTR FileName, PCSTR SymbolPath, PSTR ImageFilePath,
PFIND_EXE_FILE_CALLBACK Callback, void* user)
PFIND_EXE_FILE_CALLBACK Callback, PVOID user)
{
HANDLE h;
......@@ -129,7 +129,7 @@ HANDLE WINAPI FindExecutableImage(PCSTR FileName, PCSTR SymbolPath, PSTR ImageFi
/***********************************************************************
* MakeSureDirectoryPathExists (DBGHELP.@)
*/
BOOL WINAPI MakeSureDirectoryPathExists(LPCSTR DirPath)
BOOL WINAPI MakeSureDirectoryPathExists(PCSTR DirPath)
{
char path[MAX_PATH];
const char *p = DirPath;
......@@ -157,11 +157,11 @@ BOOL WINAPI MakeSureDirectoryPathExists(LPCSTR DirPath)
* SymMatchFileNameW (DBGHELP.@)
*
*/
BOOL WINAPI SymMatchFileNameW(WCHAR* file, WCHAR* match,
WCHAR** filestop, WCHAR** matchstop)
BOOL WINAPI SymMatchFileNameW(PCWSTR file, PCWSTR match,
PWSTR* filestop, PWSTR* matchstop)
{
WCHAR* fptr;
WCHAR* mptr;
PCWSTR fptr;
PCWSTR mptr;
TRACE("(%s %s %p %p)\n",
debugstr_w(file), debugstr_w(match), filestop, matchstop);
......@@ -175,8 +175,8 @@ BOOL WINAPI SymMatchFileNameW(WCHAR* file, WCHAR* match,
break;
fptr--; mptr--;
}
if (filestop) *filestop = fptr;
if (matchstop) *matchstop = mptr;
if (filestop) *filestop = (PWSTR)fptr;
if (matchstop) *matchstop = (PWSTR)mptr;
return mptr == match - 1;
}
......@@ -185,11 +185,11 @@ BOOL WINAPI SymMatchFileNameW(WCHAR* file, WCHAR* match,
* SymMatchFileName (DBGHELP.@)
*
*/
BOOL WINAPI SymMatchFileName(char* file, char* match,
char** filestop, char** matchstop)
BOOL WINAPI SymMatchFileName(PCSTR file, PCSTR match,
PSTR* filestop, PSTR* matchstop)
{
char* fptr;
char* mptr;
PCSTR fptr;
PCSTR mptr;
TRACE("(%s %s %p %p)\n", file, match, filestop, matchstop);
......@@ -202,14 +202,14 @@ BOOL WINAPI SymMatchFileName(char* file, char* match,
break;
fptr--; mptr--;
}
if (filestop) *filestop = fptr;
if (matchstop) *matchstop = mptr;
if (filestop) *filestop = (PSTR)fptr;
if (matchstop) *matchstop = (PSTR)mptr;
return mptr == match - 1;
}
static BOOL do_searchW(const WCHAR* file, WCHAR* buffer, BOOL recurse,
PENUMDIRTREE_CALLBACKW cb, void* user)
static BOOL do_searchW(PCWSTR file, PWSTR buffer, BOOL recurse,
PENUMDIRTREE_CALLBACKW cb, PVOID user)
{
HANDLE h;
WIN32_FIND_DATAW fd;
......@@ -280,7 +280,7 @@ BOOL WINAPI SearchTreeForFile(PCSTR root, PCSTR file, PSTR buffer)
*
*/
BOOL WINAPI EnumDirTreeW(HANDLE hProcess, PCWSTR root, PCWSTR file,
LPWSTR buffer, PENUMDIRTREE_CALLBACKW cb, PVOID user)
PWSTR buffer, PENUMDIRTREE_CALLBACKW cb, PVOID user)
{
TRACE("(%p %s %s %p %p %p)\n",
hProcess, debugstr_w(root), debugstr_w(file), buffer, cb, user);
......@@ -301,7 +301,7 @@ struct enum_dir_treeWA
char name[MAX_PATH];
};
static BOOL CALLBACK enum_dir_treeWA(LPCWSTR name, PVOID user)
static BOOL CALLBACK enum_dir_treeWA(PCWSTR name, PVOID user)
{
struct enum_dir_treeWA* edt = user;
......@@ -310,7 +310,7 @@ static BOOL CALLBACK enum_dir_treeWA(LPCWSTR name, PVOID user)
}
BOOL WINAPI EnumDirTree(HANDLE hProcess, PCSTR root, PCSTR file,
LPSTR buffer, PENUMDIRTREE_CALLBACK cb, PVOID user)
PSTR buffer, PENUMDIRTREE_CALLBACK cb, PVOID user)
{
WCHAR rootW[MAX_PATH];
WCHAR fileW[MAX_PATH];
......@@ -348,9 +348,9 @@ struct sffip
/* checks that buffer (as found by matching the name) matches the info
* (information is based on file type)
* returns TRUE when file is found, FALSE to continue searching
* (NB this is the opposite conventions as for SymFindFileInPathProc)
* (NB this is the opposite convention of SymFindFileInPathProc)
*/
static BOOL CALLBACK sffip_cb(LPCWSTR buffer, void* user)
static BOOL CALLBACK sffip_cb(PCWSTR buffer, PVOID user)
{
struct sffip* s = (struct sffip*)user;
DWORD size, checksum;
......@@ -469,7 +469,7 @@ static BOOL CALLBACK sffip_cb(LPCWSTR buffer, void* user)
*/
BOOL WINAPI SymFindFileInPathW(HANDLE hProcess, PCWSTR searchPath, PCWSTR full_path,
PVOID id, DWORD two, DWORD three, DWORD flags,
LPWSTR buffer, PFINDFILEINPATHCALLBACKW cb,
PWSTR buffer, PFINDFILEINPATHCALLBACKW cb,
PVOID user)
{
struct sffip s;
......@@ -531,7 +531,7 @@ BOOL WINAPI SymFindFileInPathW(HANDLE hProcess, PCWSTR searchPath, PCWSTR full_p
*/
BOOL WINAPI SymFindFileInPath(HANDLE hProcess, PCSTR searchPath, PCSTR full_path,
PVOID id, DWORD two, DWORD three, DWORD flags,
LPSTR buffer, PFINDFILEINPATHCALLBACK cb,
PSTR buffer, PFINDFILEINPATHCALLBACK cb,
PVOID user)
{
WCHAR searchPathW[MAX_PATH];
......
......@@ -465,7 +465,7 @@ done_err:
* StackWalk (DBGHELP.@)
*/
BOOL WINAPI StackWalk(DWORD MachineType, HANDLE hProcess, HANDLE hThread,
LPSTACKFRAME frame, LPVOID ctx,
LPSTACKFRAME frame, PVOID ctx,
PREAD_PROCESS_MEMORY_ROUTINE f_read_mem,
PFUNCTION_TABLE_ACCESS_ROUTINE FunctionTableAccessRoutine,
PGET_MODULE_BASE_ROUTINE GetModuleBaseRoutine,
......@@ -501,7 +501,7 @@ BOOL WINAPI StackWalk(DWORD MachineType, HANDLE hProcess, HANDLE hThread,
* StackWalk64 (DBGHELP.@)
*/
BOOL WINAPI StackWalk64(DWORD MachineType, HANDLE hProcess, HANDLE hThread,
LPSTACKFRAME64 frame64, LPVOID ctx,
LPSTACKFRAME64 frame64, PVOID ctx,
PREAD_PROCESS_MEMORY_ROUTINE64 f_read_mem,
PFUNCTION_TABLE_ACCESS_ROUTINE64 FunctionTableAccessRoutine,
PGET_MODULE_BASE_ROUTINE64 GetModuleBaseRoutine,
......
......@@ -1531,7 +1531,7 @@ PVOID WINAPI SymFunctionTableAccess64(HANDLE hProcess, DWORD64 AddrBase)
/***********************************************************************
* SymUnDName (DBGHELP.@)
*/
BOOL WINAPI SymUnDName(PIMAGEHLP_SYMBOL sym, LPSTR UnDecName, DWORD UnDecNameLength)
BOOL WINAPI SymUnDName(PIMAGEHLP_SYMBOL sym, PSTR UnDecName, DWORD UnDecNameLength)
{
TRACE("(%p %s %u)\n", sym, UnDecName, UnDecNameLength);
return UnDecorateSymbolName(sym->Name, UnDecName, UnDecNameLength,
......@@ -1544,7 +1544,7 @@ static void und_free (void* ptr) { HeapFree(GetProcessHeap(), 0, ptr); }
/***********************************************************************
* UnDecorateSymbolName (DBGHELP.@)
*/
DWORD WINAPI UnDecorateSymbolName(LPCSTR DecoratedName, LPSTR UnDecoratedName,
DWORD WINAPI UnDecorateSymbolName(PCSTR DecoratedName, PSTR UnDecoratedName,
DWORD UndecoratedLength, DWORD Flags)
{
/* undocumented from msvcrt */
......
......@@ -176,7 +176,7 @@ static inline BOOL module_is_container(const IMAGEHLP_MODULE64* wmod_cntnr,
wmod_child->BaseOfImage + wmod_child->ImageSize;
}
static BOOL CALLBACK info_mod_cb(PSTR mod_name, DWORD64 base, void* ctx)
static BOOL CALLBACK info_mod_cb(PCSTR mod_name, DWORD64 base, PVOID ctx)
{
struct info_module* im = (struct info_module*)ctx;
......
......@@ -566,7 +566,7 @@ static BOOL CALLBACK print_types_cb(PSYMBOL_INFO sym, ULONG size, void* ctx)
return TRUE;
}
static BOOL CALLBACK print_types_mod_cb(PSTR mod_name, DWORD base, void* ctx)
static BOOL CALLBACK print_types_mod_cb(PCSTR mod_name, ULONG base, PVOID ctx)
{
return SymEnumTypes(dbg_curr_process->handle, base, print_types_cb, ctx);
}
......
......@@ -345,7 +345,7 @@ struct mod_loader_info
IMAGEHLP_MODULE* imh_mod;
};
static BOOL CALLBACK mod_loader_cb(PSTR mod_name, DWORD base, void* ctx)
static BOOL CALLBACK mod_loader_cb(PCSTR mod_name, ULONG base, PVOID ctx)
{
struct mod_loader_info* mli = (struct mod_loader_info*)ctx;
......
......@@ -867,17 +867,24 @@ ULONG64
%ptr
DWORD *
DWORD64 *
LPAPI_VERSION
LPEXT_API_VERSION
LPSTACKFRAME
LPSTACKFRAME64
LPVOID
PDWORD
PDWORD64
PENUMDIRTREE_CALLBACK
PENUMDIRTREE_CALLBACKW
PENUMLOADED_MODULES_CALLBACK
PENUMLOADED_MODULES_CALLBACK64
PENUMLOADED_MODULES_CALLBACKW64
PFIND_DEBUG_FILE_CALLBACK
PFIND_EXE_FILE_CALLBACK
PFIND_EXE_FILE_CALLBACKW
PFINDFILEINPATHCALLBACK
PFINDFILEINPATHCALLBACKW
PFUNCTION_TABLE_ACCESS_ROUTINE
PFUNCTION_TABLE_ACCESS_ROUTINE64
PGET_MODULE_BASE_ROUTINE
......@@ -886,10 +893,14 @@ PIMAGE_DEBUG_INFORMATION
PIMAGEHLP_CONTEXT
PIMAGEHLP_LINE
PIMAGEHLP_LINE64
PIMAGEHLP_LINEW64
PIMAGEHLP_MODULE
PIMAGEHLP_MODULEW
PIMAGEHLP_MODULE64
PIMAGEHLP_MODULEW64
PIMAGEHLP_STACK_FRAME
PIMAGEHLP_SYMBOL
PIMAGEHLP_SYMBOL64
PMINIDUMP_CALLBACK_INFORMATION
PMINIDUMP_DIRECTORY *
PMINIDUMP_EXCEPTION_INFORMATION
......@@ -897,32 +908,38 @@ PMINIDUMP_USER_STREAM_INFORMATION
PMODLOAD_DATA
PREAD_PROCESS_MEMORY_ROUTINE
PREAD_PROCESS_MEMORY_ROUTINE64
PSTR *
PSYM_ENUMERATESYMBOLS_CALLBACK
PSYM_ENUMERATESYMBOLS_CALLBACKW
PSYM_ENUMLINES_CALLBACK
PSYM_ENUMMODULES_CALLBACK
PSYM_ENUMMODULES_CALLBACK64
PSYM_ENUMMODULES_CALLBACKW64
PSYM_ENUMSOURCEFILES_CALLBACK
PSYM_ENUMSYMBOLS_CALLBACK
PSYMBOL_FUNCENTRY_CALLBACK
PSYMBOL_FUNCENTRY_CALLBACK64
PSYMBOL_INFO
PSYMBOL_INFOW
PSYMBOL_REGISTERED_CALLBACK
PSYMBOL_REGISTERED_CALLBACK64
PTRANSLATE_ADDRESS_ROUTINE
PTRANSLATE_ADDRESS_ROUTINE64
PVOID
PVOID *
PWINDBG_EXTENSION_APIS
PWSTR *
ULONG *
char **
void *
void **
%str
LPCSTR
LPSTR
PCSTR
PSTR
char *
%wstr
PCWSTR
PWSTR
%void
......
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