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 */
......
......@@ -119,6 +119,16 @@ typedef struct _IMAGEHLP_SYMBOL64
CHAR Name[1];
} IMAGEHLP_SYMBOL64, *PIMAGEHLP_SYMBOL64;
typedef struct _IMAGEHLP_SYMBOLW64
{
DWORD SizeOfStruct;
DWORD64 Address;
DWORD Size;
DWORD Flags;
DWORD MaxNameLength;
WCHAR Name[1];
} IMAGEHLP_SYMBOLW64, *PIMAGEHLP_SYMBOLW64;
typedef struct _IMAGEHLP_MODULE
{
DWORD SizeOfStruct;
......@@ -210,6 +220,15 @@ typedef struct _IMAGEHLP_LINE
DWORD Address;
} IMAGEHLP_LINE, *PIMAGEHLP_LINE;
typedef struct _IMAGEHLP_LINEW
{
DWORD SizeOfStruct;
PVOID Key;
DWORD LineNumber;
PWSTR FileName;
DWORD Address;
} IMAGEHLP_LINEW, *PIMAGEHLP_LINEW;
typedef struct _IMAGEHLP_LINE64
{
DWORD SizeOfStruct;
......@@ -224,7 +243,7 @@ typedef struct _IMAGEHLP_LINEW64
DWORD SizeOfStruct;
PVOID Key;
DWORD LineNumber;
PWCHAR FileName;
PWSTR FileName;
DWORD64 Address;
} IMAGEHLP_LINEW64, *PIMAGEHLP_LINEW64;
......@@ -234,6 +253,12 @@ typedef struct _SOURCEFILE
PCHAR FileName;
} SOURCEFILE, *PSOURCEFILE;
typedef struct _SOURCEFILEW
{
DWORD64 ModBase;
PWSTR FileName;
} SOURCEFILEW, *PSOURCEFILEW;
#define CBA_DEFERRED_SYMBOL_LOAD_START 0x00000001
#define CBA_DEFERRED_SYMBOL_LOAD_COMPLETE 0x00000002
#define CBA_DEFERRED_SYMBOL_LOAD_FAILURE 0x00000003
......@@ -758,15 +783,15 @@ BOOL WINAPI MiniDumpReadDumpStream(PVOID, ULONG, PMINIDUMP_DIRECTORY*, PVOID*,
typedef BOOL (CALLBACK *PENUMLOADED_MODULES_CALLBACK)(PSTR, ULONG, ULONG, PVOID);
BOOL WINAPI EnumerateLoadedModules(HANDLE, PENUMLOADED_MODULES_CALLBACK, PVOID);
typedef BOOL (CALLBACK *PENUMLOADED_MODULES_CALLBACK64)(PSTR, DWORD64, ULONG, PVOID);
typedef BOOL (CALLBACK *PENUMLOADED_MODULES_CALLBACK64)(PCSTR, DWORD64, ULONG, PVOID);
BOOL WINAPI EnumerateLoadedModules64(HANDLE, PENUMLOADED_MODULES_CALLBACK64, PVOID);
typedef BOOL (CALLBACK *PENUMLOADED_MODULES_CALLBACKW64)(PWSTR, DWORD64, ULONG, PVOID);
typedef BOOL (CALLBACK *PENUMLOADED_MODULES_CALLBACKW64)(PCWSTR, DWORD64, ULONG, PVOID);
BOOL WINAPI EnumerateLoadedModulesW64(HANDLE, PENUMLOADED_MODULES_CALLBACKW64, PVOID);
typedef BOOL (CALLBACK *PSYM_ENUMMODULES_CALLBACK)(PSTR, ULONG, PVOID);
typedef BOOL (CALLBACK *PSYM_ENUMMODULES_CALLBACK)(PCSTR, ULONG, PVOID);
BOOL WINAPI SymEnumerateModules(HANDLE, PSYM_ENUMMODULES_CALLBACK, PVOID);
typedef BOOL (CALLBACK *PSYM_ENUMMODULES_CALLBACK64)(PSTR, DWORD64, PVOID);
typedef BOOL (CALLBACK *PSYM_ENUMMODULES_CALLBACK64)(PCSTR, DWORD64, PVOID);
BOOL WINAPI SymEnumerateModules64(HANDLE, PSYM_ENUMMODULES_CALLBACK64, PVOID);
typedef BOOL (CALLBACK *PSYM_ENUMMODULES_CALLBACKW64)(PWSTR, DWORD64, PVOID);
typedef BOOL (CALLBACK *PSYM_ENUMMODULES_CALLBACKW64)(PCWSTR, DWORD64, PVOID);
BOOL WINAPI SymEnumerateModulesW64(HANDLE, PSYM_ENUMMODULES_CALLBACKW64, PVOID);
BOOL WINAPI SymGetModuleInfo(HANDLE, DWORD, PIMAGEHLP_MODULE);
BOOL WINAPI SymGetModuleInfoW(HANDLE, DWORD, PIMAGEHLP_MODULEW);
......@@ -882,6 +907,30 @@ typedef enum _IMAGEHLP_SYMBOL_TYPE_INFO
TI_GET_CALLING_CONVENTION,
} IMAGEHLP_SYMBOL_TYPE_INFO;
#define IMAGEHLP_GET_TYPE_INFO_UNCACHED 0x00000001
#define IMAGEHLP_GET_TYPE_INFO_CHILDREN 0x00000002
typedef struct _IMAGEHLP_GET_TYPE_INFO_PARAMS
{
ULONG SizeOfStruct;
ULONG Flags;
ULONG NumIds;
PULONG TypeIds;
ULONG64 TagFilter;
ULONG NumReqs;
IMAGEHLP_SYMBOL_TYPE_INFO* ReqKinds;
PULONG_PTR ReqOffsets;
PULONG ReqSizes;
ULONG_PTR ReqStride;
ULONG_PTR BufferSize;
PVOID Buffer;
ULONG EntriesMatched;
ULONG EntriesFilled;
ULONG64 TagsFound;
ULONG64 AllReqsValid;
ULONG NumReqsValid;
PULONG64 ReqsValid;
} IMAGEHLP_GET_TYPE_INFO_PARAMS, *PIMAGEHLP_GET_TYPE_INFO_PARAMS;
typedef struct _TI_FINDCHILDREN_PARAMS
{
ULONG Count;
......@@ -912,6 +961,7 @@ typedef struct _TI_FINDCHILDREN_PARAMS
#define SYMSEARCH_GLOBALSONLY 0x04
BOOL WINAPI SymGetTypeInfo(HANDLE, DWORD64, ULONG, IMAGEHLP_SYMBOL_TYPE_INFO, PVOID);
BOOL WINAPI SymGetTypeInfoEx(HANDLE, DWORD64, PIMAGEHLP_GET_TYPE_INFO_PARAMS);
typedef BOOL (CALLBACK *PSYM_ENUMERATESYMBOLS_CALLBACK)(PSYMBOL_INFO, ULONG, PVOID);
typedef BOOL (CALLBACK *PSYM_ENUMERATESYMBOLS_CALLBACKW)(PSYMBOL_INFOW, ULONG, PVOID);
BOOL WINAPI SymEnumTypes(HANDLE, ULONG64, PSYM_ENUMERATESYMBOLS_CALLBACK, PVOID);
......@@ -919,25 +969,35 @@ BOOL WINAPI SymEnumTypesW(HANDLE, ULONG64, PSYM_ENUMERATESYMBOLS_CALLBACKW, PVOI
BOOL WINAPI SymFromAddr(HANDLE, DWORD64, DWORD64*, SYMBOL_INFO*);
BOOL WINAPI SymFromAddrW(HANDLE, DWORD64, DWORD64*, SYMBOL_INFOW*);
BOOL WINAPI SymFromToken(HANDLE, DWORD64, DWORD, PSYMBOL_INFO);
BOOL WINAPI SymFromTokenW(HANDLE, DWORD64, DWORD, PSYMBOL_INFOW);
BOOL WINAPI SymFromName(HANDLE, PCSTR, PSYMBOL_INFO);
BOOL WINAPI SymFromNameW(HANDLE, PCWSTR, PSYMBOL_INFOW);
BOOL WINAPI SymGetSymFromAddr(HANDLE, DWORD, PDWORD, PIMAGEHLP_SYMBOL);
BOOL WINAPI SymGetSymFromAddr64(HANDLE, DWORD64, PDWORD64, PIMAGEHLP_SYMBOL64);
BOOL WINAPI SymGetSymFromName(HANDLE, PCSTR, PIMAGEHLP_SYMBOL);
BOOL WINAPI SymGetSymFromName64(HANDLE, PCSTR, PIMAGEHLP_SYMBOL64);
BOOL WINAPI SymGetTypeFromName(HANDLE, ULONG64, PCSTR, PSYMBOL_INFO);
BOOL WINAPI SymGetTypeFromNameW(HANDLE, ULONG64, PCWSTR, PSYMBOL_INFOW);
BOOL WINAPI SymGetSymNext(HANDLE, PIMAGEHLP_SYMBOL);
BOOL WINAPI SymGetSymNext64(HANDLE, PIMAGEHLP_SYMBOL64);
BOOL WINAPI SymGetSymNextW64(HANDLE, PIMAGEHLP_SYMBOLW64);
BOOL WINAPI SymGetSymPrev(HANDLE, PIMAGEHLP_SYMBOL);
BOOL WINAPI SymGetSymPrev64(HANDLE, PIMAGEHLP_SYMBOL64);
BOOL WINAPI SymGetSymPrevW64(HANDLE, PIMAGEHLP_SYMBOLW64);
BOOL WINAPI SymEnumSymbols(HANDLE, ULONG64, PCSTR, PSYM_ENUMERATESYMBOLS_CALLBACK,
PVOID);
BOOL WINAPI SymEnumSymbolsW(HANDLE, ULONG64, PCWSTR, PSYM_ENUMERATESYMBOLS_CALLBACKW,
PVOID);
typedef BOOL (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACK)(PSTR, DWORD, ULONG, PVOID);
BOOL WINAPI SymEnumerateSymbols(HANDLE, DWORD, PSYM_ENUMSYMBOLS_CALLBACK, PVOID);
typedef BOOL (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACK64)(PSTR, DWORD64, ULONG, PVOID);
BOOL WINAPI SymEnumerateSymbols64(HANDLE, DWORD64, PSYM_ENUMSYMBOLS_CALLBACK64, PVOID);
typedef BOOL (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACK)(PCSTR, DWORD, ULONG, PVOID);
typedef BOOL (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACKW)(PCWSTR, DWORD, ULONG, PVOID);
BOOL WINAPI SymEnumerateSymbols(HANDLE, ULONG, PSYM_ENUMSYMBOLS_CALLBACK, PVOID);
BOOL WINAPI SymEnumerateSymbolsW(HANDLE, ULONG, PSYM_ENUMSYMBOLS_CALLBACKW, PVOID);
typedef BOOL (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACK64)(PCSTR, DWORD64, ULONG, PVOID);
typedef BOOL (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACK64W)(PCWSTR, DWORD64, ULONG, PVOID);
BOOL WINAPI SymEnumerateSymbols64(HANDLE, ULONG64, PSYM_ENUMSYMBOLS_CALLBACK64, PVOID);
BOOL WINAPI SymEnumerateSymbolsW64(HANDLE, ULONG64, PSYM_ENUMSYMBOLS_CALLBACK64W, PVOID);
BOOL WINAPI SymEnumSymbolsForAddr(HANDLE, DWORD64, PSYM_ENUMERATESYMBOLS_CALLBACK, PVOID);
BOOL WINAPI SymEnumSymbolsForAddrW(HANDLE, DWORD64, PSYM_ENUMERATESYMBOLS_CALLBACKW, PVOID);
typedef BOOL (CALLBACK *PSYMBOL_REGISTERED_CALLBACK)(HANDLE, ULONG, PVOID, PVOID);
BOOL WINAPI SymRegisterCallback(HANDLE, PSYMBOL_REGISTERED_CALLBACK, PVOID);
typedef BOOL (CALLBACK *PSYMBOL_REGISTERED_CALLBACK64)(HANDLE, ULONG, ULONG64, ULONG64);
......@@ -945,54 +1005,84 @@ BOOL WINAPI SymRegisterCallback64(HANDLE, PSYMBOL_REGISTERED_CALLBACK64, ULONG64
BOOL WINAPI SymRegisterCallbackW64(HANDLE, PSYMBOL_REGISTERED_CALLBACK64, ULONG64);
BOOL WINAPI SymUnDName(PIMAGEHLP_SYMBOL, PSTR, DWORD);
BOOL WINAPI SymUnDName64(PIMAGEHLP_SYMBOL64, PSTR, DWORD);
DWORD WINAPI UnDecorateSymbolName(LPCSTR, LPSTR, DWORD, DWORD);
BOOL WINAPI SymMatchString(PCSTR, PCSTR, BOOL);
BOOL WINAPI SymMatchStringA(PCSTR, PCSTR, BOOL);
BOOL WINAPI SymMatchStringW(PCWSTR, PCWSTR, BOOL);
BOOL WINAPI SymSearch(HANDLE, ULONG64, DWORD, DWORD, PCSTR, DWORD64, PSYM_ENUMERATESYMBOLS_CALLBACK, PVOID, DWORD);
BOOL WINAPI SymSearchW(HANDLE, ULONG64, DWORD, DWORD, PCWSTR, DWORD64, PSYM_ENUMERATESYMBOLS_CALLBACKW, PVOID, DWORD);
DWORD WINAPI UnDecorateSymbolName(PCSTR, PSTR, DWORD, DWORD);
DWORD WINAPI UnDecorateSymbolNameW(PCWSTR, PWSTR, DWORD, DWORD);
BOOL WINAPI SymGetScope(HANDLE, ULONG64, DWORD, PSYMBOL_INFO);
BOOL WINAPI SymGetScopeW(HANDLE, ULONG64, DWORD, PSYMBOL_INFOW);
BOOL WINAPI SymFromIndex(HANDLE, ULONG64, DWORD, PSYMBOL_INFO);
BOOL WINAPI SymFromIndexW(HANDLE, ULONG64, DWORD, PSYMBOL_INFOW);
BOOL WINAPI SymAddSymbol(HANDLE, ULONG64, PCSTR, DWORD64, DWORD, DWORD);
BOOL WINAPI SymAddSymbolW(HANDLE, ULONG64, PCWSTR, DWORD64, DWORD, DWORD);
BOOL WINAPI SymDeleteSymbol(HANDLE, ULONG64, PCSTR, DWORD64, DWORD);
BOOL WINAPI SymDeleteSymbolW(HANDLE, ULONG64, PCWSTR, DWORD64, DWORD);
/*************************
* Source Files *
*************************/
typedef BOOL (CALLBACK *PSYM_ENUMSOURCEFILES_CALLBACK)(PSOURCEFILE, PVOID);
typedef BOOL (CALLBACK *PSYM_ENUMSOURCEFILES_CALLBACKW)(PSOURCEFILEW, PVOID);
BOOL WINAPI SymEnumSourceFiles(HANDLE, ULONG64, PCSTR, PSYM_ENUMSOURCEFILES_CALLBACK,
PVOID);
BOOL WINAPI SymEnumSourceFilesW(HANDLE, ULONG64, PCWSTR, PSYM_ENUMSOURCEFILES_CALLBACKW, PVOID);
BOOL WINAPI SymGetLineFromAddr(HANDLE, DWORD, PDWORD, PIMAGEHLP_LINE);
BOOL WINAPI SymGetLineFromAddrW(HANDLE, DWORD, PDWORD, PIMAGEHLP_LINEW);
BOOL WINAPI SymGetLineFromAddr64(HANDLE, DWORD64, PDWORD, PIMAGEHLP_LINE64);
BOOL WINAPI SymGetLineFromAddrW64(HANDLE, DWORD64, PDWORD, PIMAGEHLP_LINEW64);
BOOL WINAPI SymGetLinePrev(HANDLE, PIMAGEHLP_LINE);
BOOL WINAPI SymGetLinePrevW(HANDLE, PIMAGEHLP_LINEW);
BOOL WINAPI SymGetLinePrev64(HANDLE, PIMAGEHLP_LINE64);
BOOL WINAPI SymGetLinePrevW64(HANDLE, PIMAGEHLP_LINEW64);
BOOL WINAPI SymGetLineNext(HANDLE, PIMAGEHLP_LINE);
BOOL WINAPI SymGetLineNextW(HANDLE, PIMAGEHLP_LINEW);
BOOL WINAPI SymGetLineNext64(HANDLE, PIMAGEHLP_LINE64);
BOOL WINAPI SymGetLineNextW64(HANDLE, PIMAGEHLP_LINEW64);
BOOL WINAPI SymGetLineFromName(HANDLE, PCSTR, PCSTR, DWORD, PLONG, PIMAGEHLP_LINE);
BOOL WINAPI SymGetLineFromName64(HANDLE, PCSTR, PCSTR, DWORD, PLONG, PIMAGEHLP_LINE64);
ULONG WINAPI SymGetFileLineOffsets64(HANDLE, LPSTR, LPSTR, PDWORD64, ULONG);
ULONG WINAPI SymGetFileLineOffsetsW64(HANDLE, PWCH, PWCH, PDWORD64, ULONG);
BOOL WINAPI SymGetLineFromNameW64(HANDLE, PCWSTR, PCWSTR, DWORD, PLONG, PIMAGEHLP_LINEW64);
ULONG WINAPI SymGetFileLineOffsets64(HANDLE, PCSTR, PCSTR, PDWORD64, ULONG);
BOOL WINAPI SymGetSourceFile(HANDLE, ULONG64, PCSTR, PCSTR, PSTR, DWORD);
BOOL WINAPI SymGetSourceFileW(HANDLE, ULONG64, PCWSTR, PCWSTR, PWSTR, DWORD);
BOOL WINAPI SymGetSourceFileToken(HANDLE, ULONG64, PCSTR, PVOID*, DWORD*);
BOOL WINAPI SymGetSourceFileTokenW(HANDLE, ULONG64, PCWSTR, PVOID*, DWORD*);
BOOL WINAPI SymGetSourceFileFromToken(HANDLE, PVOID, PCSTR, PSTR, DWORD);
BOOL WINAPI SymGetSourceFileFromTokenW(HANDLE, PVOID, PCWSTR, PWSTR, DWORD);
BOOL WINAPI SymGetSourceVarFromToken(HANDLE, PVOID, PCSTR, PCSTR, PSTR, DWORD);
BOOL WINAPI SymGetSourceVarFromTokenW(HANDLE, PVOID, PCWSTR, PCWSTR, PWSTR, DWORD);
typedef struct _SRCCODEINFO
{
DWORD SizeOfStruct;
PVOID Key;
DWORD64 ModBase;
char Obj[MAX_PATH+1];
char FileName[MAX_PATH+1];
CHAR Obj[MAX_PATH+1];
CHAR FileName[MAX_PATH+1];
DWORD LineNumber;
DWORD64 Address;
} SRCCODEINFO, *PSRCCODEINFO;
typedef struct _SRCCODEINFOW
{
DWORD SizeOfStruct;
PVOID Key;
DWORD64 ModBase;
WCHAR Obj[MAX_PATH+1];
WCHAR FileName[MAX_PATH+1];
DWORD LineNumber;
DWORD64 Address;
} SRCCODEINFOW, *PSRCCODEINFOW;
typedef BOOL (CALLBACK* PSYM_ENUMLINES_CALLBACK)(PSRCCODEINFO, PVOID);
typedef BOOL (CALLBACK* PSYM_ENUMLINES_CALLBACKW)(PSRCCODEINFOW, PVOID);
BOOL WINAPI SymEnumLines(HANDLE, ULONG64, PCSTR, PCSTR, PSYM_ENUMLINES_CALLBACK, PVOID);
BOOL WINAPI SymEnumLinesW(HANDLE, ULONG64, PCWSTR, PCWSTR, PSYM_ENUMLINES_CALLBACKW, PVOID);
BOOL WINAPI SymEnumSourceLines(HANDLE, ULONG64, PCSTR, PCSTR, DWORD, DWORD, PSYM_ENUMLINES_CALLBACK, PVOID);
BOOL WINAPI SymEnumSourceLinesW(HANDLE, ULONG64, PCWSTR, PCWSTR, DWORD, DWORD, PSYM_ENUMLINES_CALLBACKW, PVOID);
/*************************
* File & image handling *
......@@ -1002,19 +1092,27 @@ BOOL WINAPI SymInitializeW(HANDLE, PCWSTR, BOOL);
BOOL WINAPI SymCleanup(HANDLE);
HANDLE WINAPI FindDebugInfoFile(PCSTR, PCSTR, PSTR);
typedef BOOL (CALLBACK *PFIND_DEBUG_FILE_CALLBACK)(HANDLE, PSTR, PVOID);
typedef BOOL (CALLBACK *PFIND_DEBUG_FILE_CALLBACK)(HANDLE, PCSTR, PVOID);
typedef BOOL (CALLBACK *PFIND_DEBUG_FILE_CALLBACKW)(HANDLE, PCWSTR, PVOID);
HANDLE WINAPI FindDebugInfoFileEx(PCSTR, PCSTR, PSTR, PFIND_DEBUG_FILE_CALLBACK, PVOID);
HANDLE WINAPI FindDebugInfoFileExW(PCWSTR, PCWSTR, PWSTR, PFIND_DEBUG_FILE_CALLBACKW, PVOID);
HANDLE WINAPI SymFindDebugInfoFile(HANDLE, PCSTR, PSTR, PFIND_DEBUG_FILE_CALLBACK, PVOID);
HANDLE WINAPI SymFindDebugInfoFileW(HANDLE, PCWSTR, PWSTR, PFIND_DEBUG_FILE_CALLBACKW, PVOID);
typedef BOOL (CALLBACK *PFINDFILEINPATHCALLBACK)(PCSTR, PVOID);
typedef BOOL (CALLBACK *PFINDFILEINPATHCALLBACKW)(PCWSTR, PVOID);
BOOL WINAPI FindFileInPath(HANDLE, PCSTR, PCSTR, PVOID, DWORD, DWORD, DWORD,
PSTR, PFINDFILEINPATHCALLBACK, PVOID);
BOOL WINAPI SymFindFileInPath(HANDLE, PCSTR, PCSTR, PVOID, DWORD, DWORD, DWORD,
PSTR, PFINDFILEINPATHCALLBACK, PVOID);
typedef BOOL (CALLBACK *PFINDFILEINPATHCALLBACKW)(PCWSTR, PVOID);
BOOL WINAPI SymFindFileInPathW(HANDLE, PCWSTR, PCWSTR, PVOID, DWORD, DWORD, DWORD,
PWSTR, PFINDFILEINPATHCALLBACKW, PVOID);
HANDLE WINAPI FindExecutableImage(PCSTR, PCSTR, PSTR);
typedef BOOL (CALLBACK *PFIND_EXE_FILE_CALLBACK)(HANDLE, PSTR, PVOID);
typedef BOOL (CALLBACK *PFIND_EXE_FILE_CALLBACK)(HANDLE, PCSTR, PVOID);
typedef BOOL (CALLBACK *PFIND_EXE_FILE_CALLBACKW)(HANDLE, PCWSTR, PVOID);
HANDLE WINAPI FindExecutableImageEx(PCSTR, PCSTR, PSTR, PFIND_EXE_FILE_CALLBACK, PVOID);
typedef BOOL (CALLBACK *PFIND_EXE_FILE_CALLBACKW)(HANDLE, PWSTR, PVOID);
HANDLE WINAPI FindExecutableImageExW(PCWSTR, PCWSTR, PWSTR, PFIND_EXE_FILE_CALLBACKW, PVOID);
HANDLE WINAPI SymFindExecutableImage(HANDLE, PCSTR, PSTR, PFIND_EXE_FILE_CALLBACK, PVOID);
HANDLE WINAPI SymFindExecutableImageW(HANDLE, PCWSTR, PWSTR, PFIND_EXE_FILE_CALLBACKW, PVOID);
PIMAGE_NT_HEADERS WINAPI ImageNtHeader(PVOID);
PVOID WINAPI ImageDirectoryEntryToDataEx(PVOID, BOOLEAN, USHORT, PULONG,
PIMAGE_SECTION_HEADER *);
......@@ -1029,14 +1127,16 @@ DWORD WINAPI GetTimestampForLoadedLibrary(HMODULE);
BOOL WINAPI MakeSureDirectoryPathExists(PCSTR);
BOOL WINAPI SearchTreeForFile(PCSTR, PCSTR, PSTR);
BOOL WINAPI SearchTreeForFileW(PCWSTR, PCWSTR, PWSTR);
typedef BOOL (CALLBACK *PENUMDIRTREE_CALLBACK)(LPCSTR, PVOID);
BOOL WINAPI EnumDirTree(HANDLE, PCSTR, PCSTR, PSTR, PENUMDIRTREE_CALLBACK, void*);
typedef BOOL (CALLBACK *PENUMDIRTREE_CALLBACKW)(LPCWSTR, PVOID);
BOOL WINAPI EnumDirTreeW(HANDLE, PCWSTR, PCWSTR, PWSTR, PENUMDIRTREE_CALLBACKW, void*);
BOOL WINAPI SymMatchFileName(PSTR, PSTR, PSTR*, PSTR*);
BOOL WINAPI SymMatchFileNameW(PWSTR, PWSTR, PWSTR*, PWSTR*);
typedef BOOL (CALLBACK *PENUMDIRTREE_CALLBACK)(PCSTR, PVOID);
typedef BOOL (CALLBACK *PENUMDIRTREE_CALLBACKW)(PCWSTR, PVOID);
BOOL WINAPI EnumDirTree(HANDLE, PCSTR, PCSTR, PSTR, PENUMDIRTREE_CALLBACK, PVOID);
BOOL WINAPI EnumDirTreeW(HANDLE, PCWSTR, PCWSTR, PWSTR, PENUMDIRTREE_CALLBACKW, PVOID);
BOOL WINAPI SymMatchFileName(PCSTR, PCSTR, PSTR*, PSTR*);
BOOL WINAPI SymMatchFileNameW(PCWSTR, PCWSTR, PWSTR*, PWSTR*);
PCHAR WINAPI SymSetHomeDirectory(HANDLE, PCSTR);
PWSTR WINAPI SymSetHomeDirectoryW(HANDLE, PCWSTR);
PCHAR WINAPI SymGetHomeDirectory(DWORD, PSTR, size_t);
PWSTR WINAPI SymGetHomeDirectoryW(DWORD, PWSTR, size_t);
#define hdBase 0
#define hdSym 1
#define hdSrc 2
......@@ -1190,7 +1290,7 @@ typedef struct _IMAGE_DEBUG_INFORMATION
} IMAGE_DEBUG_INFORMATION, *PIMAGE_DEBUG_INFORMATION;
PIMAGE_DEBUG_INFORMATION WINAPI MapDebugInformation(HANDLE, PSTR, PSTR, DWORD);
PIMAGE_DEBUG_INFORMATION WINAPI MapDebugInformation(HANDLE, PCSTR, PCSTR, ULONG);
BOOL WINAPI UnmapDebugInformation(PIMAGE_DEBUG_INFORMATION);
......@@ -1203,13 +1303,17 @@ BOOL WINAPI SymSetParentWindow(HWND);
* Version, global stuff *
*************************/
typedef BOOL (WINAPI* PSYMBOLSERVERPROC)(LPCSTR, LPCSTR, PVOID, DWORD, DWORD, LPSTR);
typedef BOOL (WINAPI* PSYMBOLSERVERPROC)(PCSTR, PCSTR, PVOID, DWORD, DWORD, PSTR);
typedef BOOL (WINAPI* PSYMBOLSERVERPROCA)(PCSTR, PCSTR, PVOID, DWORD, DWORD, PSTR);
typedef BOOL (WINAPI* PSYMBOLSERVERPROCW)(PCWSTR, PCWSTR, PVOID, DWORD, DWORD, PWSTR);
typedef BOOL (WINAPI* PSYMBOLSERVEROPENPROC)(void);
typedef BOOL (WINAPI* PSYMBOLSERVERCLOSEPROC)(void);
typedef BOOL (WINAPI* PSYMBOLSERVERSETOPTIONSPROC)(UINT_PTR, ULONG64);
typedef BOOL (CALLBACK* PSYMBOLSERVERCALLBACKPROC)(UINT_PTR, ULONG64, ULONG64);
typedef UINT_PTR (WINAPI* PSYMBOLSERVERGETOPTIONSPROC)(void);
typedef BOOL (WINAPI* PSYMBOLSERVERPINGPROC)(LPCSTR);
typedef BOOL (WINAPI* PSYMBOLSERVERPINGPROC)(PCSTR);
typedef BOOL (WINAPI* PSYMBOLSERVERPINGPROCA)(PCSTR);
typedef BOOL (WINAPI* PSYMBOLSERVERPINGPROCW)(PCWSTR);
#define SSRVOPT_CALLBACK 0x0001
#define SSRVOPT_DWORD 0x0002
......
......@@ -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