From bdf32ee0325e24d9921f65c9e32de75ee665a001 Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Mon, 23 Jan 2006 16:37:48 +0100 Subject: [PATCH] dbghelp: Brought dbghelp.h a bit closer to PSDK definitions. --- dlls/dbghelp/dbghelp.c | 4 +- dlls/dbghelp/dbghelp_private.h | 2 +- dlls/dbghelp/module.c | 8 +-- dlls/dbghelp/path.c | 16 ++--- dlls/dbghelp/pe_module.c | 2 +- dlls/dbghelp/source.c | 2 +- dlls/dbghelp/symbol.c | 4 +- dlls/dbghelp/type.c | 2 +- include/dbghelp.h | 117 +++++++++++++++++++++++++++------ 9 files changed, 116 insertions(+), 41 deletions(-) diff --git a/dlls/dbghelp/dbghelp.c b/dlls/dbghelp/dbghelp.c index 289e11385e1..f776190ae03 100644 --- a/dlls/dbghelp/dbghelp.c +++ b/dlls/dbghelp/dbghelp.c @@ -118,7 +118,7 @@ BOOL validate_addr64(DWORD64 addr) * SymSetSearchPath (DBGHELP.@) * */ -BOOL WINAPI SymSetSearchPath(HANDLE hProcess, PSTR searchPath) +BOOL WINAPI SymSetSearchPath(HANDLE hProcess, PCSTR searchPath) { struct process* pcs = process_find_by_handle(hProcess); @@ -200,7 +200,7 @@ static BOOL check_live_target(struct process* pcs) * Note also that this scheme can be intertwined with the deferred loading * mechanism (ie only load the debug information when we actually need it). */ -BOOL WINAPI SymInitialize(HANDLE hProcess, PSTR UserSearchPath, BOOL fInvadeProcess) +BOOL WINAPI SymInitialize(HANDLE hProcess, PCSTR UserSearchPath, BOOL fInvadeProcess) { struct process* pcs; diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h index c3e3676b0f0..a4950fa2085 100644 --- a/dlls/dbghelp/dbghelp_private.h +++ b/dlls/dbghelp/dbghelp_private.h @@ -367,7 +367,7 @@ extern BOOL pe_load_debug_directory(const struct process* pcs, /* pe_module.c */ extern BOOL pe_load_nt_header(HANDLE hProc, DWORD base, IMAGE_NT_HEADERS* nth); extern struct module* - pe_load_module(struct process* pcs, char* name, + pe_load_module(struct process* pcs, const char* name, HANDLE hFile, DWORD base, DWORD size); extern struct module* pe_load_module_from_pcs(struct process* pcs, const char* name, diff --git a/dlls/dbghelp/module.c b/dlls/dbghelp/module.c index afd33fdb2b1..0227aa0a5b0 100644 --- a/dlls/dbghelp/module.c +++ b/dlls/dbghelp/module.c @@ -362,8 +362,8 @@ enum module_type module_get_type_by_name(const char* name) /*********************************************************************** * SymLoadModule (DBGHELP.@) */ -DWORD WINAPI SymLoadModule(HANDLE hProcess, HANDLE hFile, char* ImageName, - char* ModuleName, DWORD BaseOfDll, DWORD SizeOfDll) +DWORD WINAPI SymLoadModule(HANDLE hProcess, HANDLE hFile, const char* ImageName, + const char* ModuleName, DWORD BaseOfDll, DWORD SizeOfDll) { struct process* pcs; struct module* module = NULL; @@ -449,8 +449,8 @@ DWORD64 WINAPI SymLoadModuleEx(HANDLE hProcess, HANDLE hFile, PCSTR ImageName, /*********************************************************************** * SymLoadModule64 (DBGHELP.@) */ -DWORD64 WINAPI SymLoadModule64(HANDLE hProcess, HANDLE hFile, PSTR ImageName, - PSTR ModuleName, DWORD64 BaseOfDll, DWORD SizeOfDll) +DWORD64 WINAPI SymLoadModule64(HANDLE hProcess, HANDLE hFile, PCSTR ImageName, + PCSTR ModuleName, DWORD64 BaseOfDll, DWORD SizeOfDll) { if (!validate_addr64(BaseOfDll)) return FALSE; return SymLoadModule(hProcess, hFile, ImageName, ModuleName, (DWORD)BaseOfDll, SizeOfDll); diff --git a/dlls/dbghelp/path.c b/dlls/dbghelp/path.c index 32fd305bb06..b8f1775586c 100644 --- a/dlls/dbghelp/path.c +++ b/dlls/dbghelp/path.c @@ -33,9 +33,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(dbghelp); static inline BOOL is_sep(char ch) {return ch == '/' || ch == '\\';} -static inline char* file_name(char* str) +static inline const char* file_name(const char* str) { - char* p; + const char* p; for (p = str + strlen(str) - 1; p >= str && !is_sep(*p); p--); return p + 1; @@ -45,7 +45,7 @@ static inline char* file_name(char* str) * FindDebugInfoFile (DBGHELP.@) * */ -HANDLE WINAPI FindDebugInfoFile(PSTR FileName, PSTR SymbolPath, PSTR DebugFilePath) +HANDLE WINAPI FindDebugInfoFile(PCSTR FileName, PCSTR SymbolPath, PSTR DebugFilePath) { HANDLE h; @@ -65,7 +65,7 @@ HANDLE WINAPI FindDebugInfoFile(PSTR FileName, PSTR SymbolPath, PSTR DebugFilePa * FindDebugInfoFileEx (DBGHELP.@) * */ -HANDLE WINAPI FindDebugInfoFileEx(PSTR FileName, PSTR SymbolPath, +HANDLE WINAPI FindDebugInfoFileEx(PCSTR FileName, PCSTR SymbolPath, PSTR DebugFilePath, PFIND_DEBUG_FILE_CALLBACK Callback, PVOID CallerData) @@ -79,7 +79,7 @@ HANDLE WINAPI FindDebugInfoFileEx(PSTR FileName, PSTR SymbolPath, * FindExecutableImage (DBGHELP.@) * */ -HANDLE WINAPI FindExecutableImage(PSTR FileName, PSTR SymbolPath, PSTR ImageFilePath) +HANDLE WINAPI FindExecutableImage(PCSTR FileName, PCSTR SymbolPath, PSTR ImageFilePath) { HANDLE h; if (!SearchPathA(SymbolPath, FileName, NULL, MAX_PATH, ImageFilePath, NULL)) @@ -180,7 +180,7 @@ static BOOL do_search(const char* file, char* buffer, BOOL recurse, /*********************************************************************** * SearchTreeForFile (DBGHELP.@) */ -BOOL WINAPI SearchTreeForFile(LPSTR root, LPSTR file, LPSTR buffer) +BOOL WINAPI SearchTreeForFile(PCSTR root, PCSTR file, PSTR buffer) { TRACE("(%s, %s, %p)\n", debugstr_a(root), debugstr_a(file), buffer); @@ -293,7 +293,7 @@ static BOOL CALLBACK sffip_cb(LPCSTR buffer, void* user) * SymFindFileInPath (DBGHELP.@) * */ -BOOL WINAPI SymFindFileInPath(HANDLE hProcess, LPSTR searchPath, LPSTR full_path, +BOOL WINAPI SymFindFileInPath(HANDLE hProcess, PCSTR searchPath, PCSTR full_path, PVOID id, DWORD two, DWORD three, DWORD flags, LPSTR buffer, PFINDFILEINPATHCALLBACK cb, PVOID user) @@ -302,7 +302,7 @@ BOOL WINAPI SymFindFileInPath(HANDLE hProcess, LPSTR searchPath, LPSTR full_path struct process* pcs = process_find_by_handle(hProcess); char tmp[MAX_PATH]; char* ptr; - char* filename; + const char* filename; TRACE("(%p %s %s %p %08lx %08lx %08lx %p %p %p)\n", hProcess, searchPath, full_path, id, two, three, flags, diff --git a/dlls/dbghelp/pe_module.c b/dlls/dbghelp/pe_module.c index 7e217ff47ec..0e69124b13a 100644 --- a/dlls/dbghelp/pe_module.c +++ b/dlls/dbghelp/pe_module.c @@ -324,7 +324,7 @@ BOOL pe_load_debug_info(const struct process* pcs, struct module* module) * pe_load_module * */ -struct module* pe_load_module(struct process* pcs, char* name, +struct module* pe_load_module(struct process* pcs, const char* name, HANDLE hFile, DWORD base, DWORD size) { struct module* module = NULL; diff --git a/dlls/dbghelp/source.c b/dlls/dbghelp/source.c index 805815afde2..d3ff53e7a6f 100644 --- a/dlls/dbghelp/source.c +++ b/dlls/dbghelp/source.c @@ -97,7 +97,7 @@ const char* source_get(const struct module* module, unsigned idx) * SymEnumSourceFiles (DBGHELP.@) * */ -BOOL WINAPI SymEnumSourceFiles(HANDLE hProcess, ULONG64 ModBase, LPSTR Mask, +BOOL WINAPI SymEnumSourceFiles(HANDLE hProcess, ULONG64 ModBase, PCSTR Mask, PSYM_ENUMSOURCEFILES_CALLBACK cbSrcFiles, PVOID UserContext) { diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c index 4fdf134fb28..faeee981c2e 100644 --- a/dlls/dbghelp/symbol.c +++ b/dlls/dbghelp/symbol.c @@ -925,7 +925,7 @@ BOOL WINAPI SymGetSymFromAddr(HANDLE hProcess, DWORD Address, * SymFromName (DBGHELP.@) * */ -BOOL WINAPI SymFromName(HANDLE hProcess, LPSTR Name, PSYMBOL_INFO Symbol) +BOOL WINAPI SymFromName(HANDLE hProcess, PCSTR Name, PSYMBOL_INFO Symbol) { struct process* pcs = process_find_by_handle(hProcess); struct module* module; @@ -977,7 +977,7 @@ BOOL WINAPI SymFromName(HANDLE hProcess, LPSTR Name, PSYMBOL_INFO Symbol) /*********************************************************************** * SymGetSymFromName (DBGHELP.@) */ -BOOL WINAPI SymGetSymFromName(HANDLE hProcess, LPSTR Name, PIMAGEHLP_SYMBOL Symbol) +BOOL WINAPI SymGetSymFromName(HANDLE hProcess, PCSTR Name, PIMAGEHLP_SYMBOL Symbol) { char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME]; SYMBOL_INFO*si = (SYMBOL_INFO*)buffer; diff --git a/dlls/dbghelp/type.c b/dlls/dbghelp/type.c index a62d50a749f..4a336c5482f 100644 --- a/dlls/dbghelp/type.c +++ b/dlls/dbghelp/type.c @@ -796,7 +796,7 @@ BOOL WINAPI SymGetTypeInfo(HANDLE hProcess, DWORD64 ModBase, * */ BOOL WINAPI SymGetTypeFromName(HANDLE hProcess, ULONG64 BaseOfDll, - LPSTR Name, PSYMBOL_INFO Symbol) + PCSTR Name, PSYMBOL_INFO Symbol) { struct process* pcs = process_find_by_handle(hProcess); struct module* module; diff --git a/include/dbghelp.h b/include/dbghelp.h index e53b324e273..e529e4264be 100644 --- a/include/dbghelp.h +++ b/include/dbghelp.h @@ -93,6 +93,7 @@ typedef enum SymDeferred, SymSym, SymDia, + SymVirtual, NumSymTypes } SYM_TYPE; @@ -106,6 +107,16 @@ typedef struct _IMAGEHLP_SYMBOL CHAR Name[1]; } IMAGEHLP_SYMBOL, *PIMAGEHLP_SYMBOL; +typedef struct _IMAGEHLP_SYMBOL64 +{ + DWORD SizeOfStruct; + DWORD64 Address; + DWORD Size; + DWORD Flags; + DWORD MaxNameLength; + CHAR Name[1]; +} IMAGEHLP_SYMBOL64, *PIMAGEHLP_SYMBOL64; + typedef struct _IMAGEHLP_MODULE { DWORD SizeOfStruct; @@ -241,6 +252,10 @@ enum sevMax }; +#define EVENT_SRCSPEW_START 100 +#define EVENT_SRCSPEW 100 +#define EVENT_SRCSPEW_END 199 + typedef struct _IMAGEHLP_CBA_EVENT { DWORD severity; @@ -257,6 +272,7 @@ typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOAD DWORD TimeDateStamp; CHAR FileName[MAX_PATH]; BOOLEAN Reparse; + HANDLE hFile; } IMAGEHLP_DEFERRED_SYMBOL_LOAD, *PIMAGEHLP_DEFERRED_SYMBOL_LOAD; typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOAD64 @@ -268,6 +284,7 @@ typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOAD64 CHAR FileName[MAX_PATH]; BOOLEAN Reparse; HANDLE hFile; + DWORD Flags; } IMAGEHLP_DEFERRED_SYMBOL_LOAD64, *PIMAGEHLP_DEFERRED_SYMBOL_LOAD64; typedef struct _IMAGEHLP_DUPLICATE_SYMBOL @@ -278,6 +295,14 @@ typedef struct _IMAGEHLP_DUPLICATE_SYMBOL DWORD SelectedSymbol; } IMAGEHLP_DUPLICATE_SYMBOL, *PIMAGEHLP_DUPLICATE_SYMBOL; +typedef struct _IMAGEHLP_DUPLICATE_SYMBOL64 +{ + DWORD SizeOfStruct; + DWORD NumberOfDups; + PIMAGEHLP_SYMBOL64 Symbol; + DWORD SelectedSymbol; +} IMAGEHLP_DUPLICATE_SYMBOL64, *PIMAGEHLP_DUPLICATE_SYMBOL64; + #define SYMOPT_CASE_INSENSITIVE 0x00000001 #define SYMOPT_UNDNAME 0x00000002 #define SYMOPT_DEFERRED_LOADS 0x00000004 @@ -291,6 +316,10 @@ typedef struct _IMAGEHLP_DUPLICATE_SYMBOL #define SYMOPT_EXACT_SYMBOLS 0x00000400 #define SYMOPT_WILD_UNDERSCORE 0x00000800 #define SYMOPT_USE_DEFAULTS 0x00001000 +/* latest SDK defines: +#define SYMOPT_ALLOW_ABSOLUTE_SYMBOLS 0x00000800 +#define SYMOPT_IGNORE_NT_SYMPATH 0x00001000 +*/ #define SYMOPT_INCLUDE_32BIT_MODULES 0x00002000 #define SYMOPT_PUBLICS_ONLY 0x00004000 #define SYMOPT_NO_PUBLICS 0x00008000 @@ -298,6 +327,8 @@ typedef struct _IMAGEHLP_DUPLICATE_SYMBOL #define SYMOPT_NO_IMAGE_SEARCH 0x00020000 #define SYMOPT_SECURE 0x00040000 #define SYMOPT_NO_PROMPTS 0x00080000 +#define SYMOPT_OVERWRITE 0x00100000 +#define SYMOPT_IGNORE_IMAGEDIR 0x00200000 #define SYMOPT_DEBUG 0x80000000 @@ -479,6 +510,12 @@ typedef struct _MINIDUMP_LOCATION_DESCRIPTOR RVA Rva; } MINIDUMP_LOCATION_DESCRIPTOR; +typedef struct _MINIDUMP_LOCATION_DESCRIPTOR64 +{ + ULONG64 DataSize; + RVA64 Rva; +} MINIDUMP_LOCATION_DESCRIPTOR64; + typedef struct _MINIDUMP_DIRECTORY { ULONG StreamType; @@ -696,16 +733,20 @@ BOOL WINAPI MiniDumpReadDumpStream(PVOID, ULONG, PMINIDUMP_DIRECTORY*, PVOID*, typedef BOOL (CALLBACK *PENUMLOADED_MODULES_CALLBACK)(PSTR, DWORD, ULONG, PVOID); BOOL WINAPI EnumerateLoadedModules(HANDLE, PENUMLOADED_MODULES_CALLBACK, PVOID); +typedef BOOL (CALLBACK *PENUMLOADED_MODULES_CALLBACK64)(PSTR, DWORD, ULONG64, PVOID); +BOOL WINAPI EnumerateLoadedModules64(HANDLE, PENUMLOADED_MODULES_CALLBACK64, PVOID); typedef BOOL (CALLBACK *PSYM_ENUMMODULES_CALLBACK)(PSTR, DWORD, PVOID); BOOL WINAPI SymEnumerateModules(HANDLE, PSYM_ENUMMODULES_CALLBACK, PVOID); +typedef BOOL (CALLBACK *PSYM_ENUMMODULES_CALLBACK64)(PSTR, DWORD64, PVOID); +BOOL WINAPI SymEnumerateModules64(HANDLE, PSYM_ENUMMODULES_CALLBACK64, PVOID); BOOL WINAPI SymGetModuleInfo(HANDLE, DWORD, PIMAGEHLP_MODULE); BOOL WINAPI SymGetModuleInfoW(HANDLE, DWORD, PIMAGEHLP_MODULEW); BOOL WINAPI SymGetModuleInfo64(HANDLE, DWORD64, PIMAGEHLP_MODULE64); BOOL WINAPI SymGetModuleInfoW64(HANDLE, DWORD64, PIMAGEHLP_MODULEW64); DWORD WINAPI SymGetModuleBase(HANDLE, DWORD); DWORD64 WINAPI SymGetModuleBase64(HANDLE, DWORD64); -DWORD WINAPI SymLoadModule(HANDLE, HANDLE, PSTR, PSTR, DWORD, DWORD); -DWORD64 WINAPI SymLoadModule64(HANDLE, HANDLE, PSTR, PSTR, DWORD64, DWORD); +DWORD WINAPI SymLoadModule(HANDLE, HANDLE, PCSTR, PCSTR, DWORD, DWORD); +DWORD64 WINAPI SymLoadModule64(HANDLE, HANDLE, PCSTR, PCSTR, DWORD64, DWORD); DWORD64 WINAPI SymLoadModuleEx(HANDLE, HANDLE, PCSTR, PCSTR, DWORD64, DWORD, PMODLOAD_DATA, DWORD); BOOL WINAPI SymUnloadModule(HANDLE, DWORD); @@ -737,6 +778,7 @@ BOOL WINAPI SymUnloadModule64(HANDLE, DWORD64); #define SYMFLAG_VIRTUAL 0x00001000 #define SYMFLAG_THUNK 0x00002000 #define SYMFLAG_TLSREL 0x00004000 +#define SYMFLAG_SLOT 0x00008000 #define MAX_SYM_NAME 2000 @@ -823,32 +865,46 @@ BOOL WINAPI SymGetTypeInfo(HANDLE, DWORD64, ULONG, IMAGEHLP_SYMBOL_TYPE_INFO, PV typedef BOOL (CALLBACK *PSYM_ENUMERATESYMBOLS_CALLBACK)(PSYMBOL_INFO, ULONG, PVOID); BOOL WINAPI SymEnumTypes(HANDLE, ULONG64, PSYM_ENUMERATESYMBOLS_CALLBACK, PVOID); BOOL WINAPI SymFromAddr(HANDLE, DWORD64, DWORD64*, SYMBOL_INFO*); -BOOL WINAPI SymFromName(HANDLE, LPSTR, PSYMBOL_INFO); +BOOL WINAPI SymFromToken(HANDLE, DWORD64, DWORD, PSYMBOL_INFO); +BOOL WINAPI SymFromName(HANDLE, PCSTR, PSYMBOL_INFO); BOOL WINAPI SymGetSymFromAddr(HANDLE, DWORD, PDWORD, PIMAGEHLP_SYMBOL); -BOOL WINAPI SymGetSymFromName(HANDLE, PSTR, PIMAGEHLP_SYMBOL); -BOOL WINAPI SymGetTypeFromName(HANDLE, ULONG64, LPSTR, PSYMBOL_INFO); +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 SymGetSymNext(HANDLE, PIMAGEHLP_SYMBOL); +BOOL WINAPI SymGetSymNext64(HANDLE, PIMAGEHLP_SYMBOL64); BOOL WINAPI SymGetSymPrev(HANDLE, PIMAGEHLP_SYMBOL); +BOOL WINAPI SymGetSymPrev64(HANDLE, PIMAGEHLP_SYMBOL64); BOOL WINAPI SymEnumSymbols(HANDLE, ULONG64, PCSTR, PSYM_ENUMERATESYMBOLS_CALLBACK, 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); +BOOL WINAPI SymEnumSymbolsForAddr(HANDLE, DWORD64, PSYM_ENUMERATESYMBOLS_CALLBACK, 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); BOOL WINAPI SymRegisterCallback64(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 string, PCSTR re, BOOL _case); -BOOL WINAPI SymMatchStringW(PCWSTR string, PCWSTR re, BOOL _case); +BOOL WINAPI SymMatchString(PCSTR, PCSTR, BOOL); +BOOL WINAPI SymMatchStringW(PCWSTR, PCWSTR, BOOL); BOOL WINAPI SymSearch(HANDLE, ULONG64, DWORD, DWORD, PCSTR, DWORD64, PSYM_ENUMERATESYMBOLS_CALLBACK, PVOID, DWORD); +DWORD WINAPI UnDecorateSymbolName(PCSTR, PSTR, DWORD, DWORD); +BOOL WINAPI SymGetScope(HANDLE, ULONG64, DWORD, PSYMBOL_INFO); +BOOL WINAPI SymFromIndex(HANDLE, ULONG64, DWORD, PSYMBOL_INFO); +BOOL WINAPI SymAddSymbol(HANDLE, ULONG64, PCSTR, DWORD64, DWORD, DWORD); +BOOL WINAPI SymDeleteSymbol(HANDLE, ULONG64, PCSTR, DWORD64, DWORD); /************************* * Source Files * *************************/ typedef BOOL (CALLBACK *PSYM_ENUMSOURCEFILES_CALLBACK)(PSOURCEFILE, PVOID); -BOOL WINAPI SymEnumSourceFiles(HANDLE, ULONG64, LPSTR, PSYM_ENUMSOURCEFILES_CALLBACK, +BOOL WINAPI SymEnumSourceFiles(HANDLE, ULONG64, PCSTR, PSYM_ENUMSOURCEFILES_CALLBACK, PVOID); BOOL WINAPI SymGetLineFromAddr(HANDLE, DWORD, PDWORD, PIMAGEHLP_LINE); BOOL WINAPI SymGetLineFromAddr64(HANDLE, DWORD64, PDWORD, PIMAGEHLP_LINE64); @@ -856,6 +912,14 @@ BOOL WINAPI SymGetLinePrev(HANDLE, PIMAGEHLP_LINE); BOOL WINAPI SymGetLinePrev64(HANDLE, PIMAGEHLP_LINE64); BOOL WINAPI SymGetLineNext(HANDLE, PIMAGEHLP_LINE); BOOL WINAPI SymGetLineNext64(HANDLE, PIMAGEHLP_LINE64); +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 SymGetSourceFile(HANDLE, ULONG64, PCSTR, PCSTR, PSTR, DWORD); +BOOL WINAPI SymGetSourceFileToken(HANDLE, ULONG64, PCSTR, PVOID*, DWORD*); +BOOL WINAPI SymGetSourceFileFromToken(HANDLE, PVOID, PCSTR, PSTR, DWORD); +BOOL WINAPI SymGetSourceVarFromToken(HANDLE, PVOID, PCSTR, PCSTR, PSTR, DWORD); typedef struct _SRCCODEINFO { @@ -874,18 +938,18 @@ BOOL WINAPI SymEnumLines(HANDLE, ULONG64, PCSTR, PCSTR, PSYM_ENUMLINES_CALLBACK, /************************* * File & image handling * *************************/ -BOOL WINAPI SymInitialize(HANDLE, PSTR, BOOL); +BOOL WINAPI SymInitialize(HANDLE, PCSTR, BOOL); BOOL WINAPI SymCleanup(HANDLE); -HANDLE WINAPI FindDebugInfoFile(PSTR, PSTR, PSTR); +HANDLE WINAPI FindDebugInfoFile(PCSTR, PCSTR, PSTR); typedef BOOL (CALLBACK *PFIND_DEBUG_FILE_CALLBACK)(HANDLE, PSTR, PVOID); -HANDLE WINAPI FindDebugInfoFileEx(PSTR, PSTR, PSTR, PFIND_DEBUG_FILE_CALLBACK, PVOID); +HANDLE WINAPI FindDebugInfoFileEx(PCSTR, PCSTR, PSTR, PFIND_DEBUG_FILE_CALLBACK, PVOID); typedef BOOL (CALLBACK *PFINDFILEINPATHCALLBACK)(PSTR, PVOID); -BOOL WINAPI SymFindFileInPath(HANDLE, LPSTR, LPSTR, PVOID, DWORD, DWORD, DWORD, - LPSTR, PFINDFILEINPATHCALLBACK, PVOID); -HANDLE WINAPI FindExecutableImage(PSTR, PSTR, PSTR); +BOOL WINAPI SymFindFileInPath(HANDLE, PCSTR, PCSTR, PVOID, DWORD, DWORD, DWORD, + PSTR, PFINDFILEINPATHCALLBACK, PVOID); +HANDLE WINAPI FindExecutableImage(PCSTR, PCSTR, PSTR); typedef BOOL (CALLBACK *PFIND_EXE_FILE_CALLBACK)(HANDLE, PSTR, PVOID); -HANDLE WINAPI FindExecutableImageEx(PSTR, PSTR, PSTR, PFIND_EXE_FILE_CALLBACK, PVOID); +HANDLE WINAPI FindExecutableImageEx(PCSTR, PCSTR, PSTR, PFIND_EXE_FILE_CALLBACK, PVOID); PIMAGE_NT_HEADERS WINAPI ImageNtHeader(PVOID); PVOID WINAPI ImageDirectoryEntryToDataEx(PVOID, BOOLEAN, USHORT, PULONG, PIMAGE_SECTION_HEADER *); @@ -893,13 +957,19 @@ PVOID WINAPI ImageDirectoryEntryToData(PVOID, BOOLEAN, USHORT, PULONG); PIMAGE_SECTION_HEADER WINAPI ImageRvaToSection(PIMAGE_NT_HEADERS, PVOID, ULONG); PVOID WINAPI ImageRvaToVa(PIMAGE_NT_HEADERS, PVOID, ULONG, PIMAGE_SECTION_HEADER*); BOOL WINAPI SymGetSearchPath(HANDLE, PSTR, DWORD); -BOOL WINAPI SymSetSearchPath(HANDLE, PSTR); +BOOL WINAPI SymSetSearchPath(HANDLE, PCSTR); DWORD WINAPI GetTimestampForLoadedLibrary(HMODULE); BOOL WINAPI MakeSureDirectoryPathExists(PCSTR); -BOOL WINAPI SearchTreeForFile(PSTR, PSTR, PSTR); +BOOL WINAPI SearchTreeForFile(PCSTR, PCSTR, PSTR); typedef BOOL (CALLBACK *PENUMDIRTREE_CALLBACK)(LPCSTR, PVOID); -BOOL WINAPI EnumDirTree(HANDLE, PCSTR, PCSTR, LPSTR, PENUMDIRTREE_CALLBACK, void*); -BOOL WINAPI SymMatchFileName(LPSTR, LPSTR, LPSTR*, LPSTR*); +BOOL WINAPI EnumDirTree(HANDLE, PCSTR, PCSTR, PSTR, PENUMDIRTREE_CALLBACK, void*); +BOOL WINAPI SymMatchFileName(PSTR, PSTR, PSTR*, PSTR*); +PCHAR WINAPI SymSetHomeDirectory(HANDLE, PCSTR); +PCHAR WINAPI SymGetHomeDirectory(DWORD, PSTR, size_t); +#define hdBase 0 +#define hdSym 1 +#define hdSrc 2 +#define hdMax 3 /************************* * Context management * @@ -1000,6 +1070,8 @@ BOOL WINAPI SymRegisterFunctionEntryCallback64(HANDLE, PSYMBOL_FUNCENTRY_CALLBAC * Version, global stuff * *************************/ +#define API_VERSION_NUMBER 9 + typedef struct API_VERSION { USHORT MajorVersion; @@ -1054,9 +1126,12 @@ BOOL WINAPI UnmapDebugInformation(PIMAGE_DEBUG_INFORMATION); DWORD WINAPI SymGetOptions(void); DWORD WINAPI SymSetOptions(DWORD); -BOOL WINAPI SymSetParentWindow(HWND hwnd); +BOOL WINAPI SymSetParentWindow(HWND); + +/************************* + * Version, global stuff * + *************************/ -/* Symbol server bits */ typedef BOOL (WINAPI* PSYMBOLSERVERPROC)(LPCSTR, LPCSTR, PVOID, DWORD, DWORD, LPSTR); typedef BOOL (WINAPI* PSYMBOLSERVEROPENPROC)(void); typedef BOOL (WINAPI* PSYMBOLSERVERCLOSEPROC)(void);