20#define ok_ulonglong(expression, result) \
22 ULONG64 _value = (expression); \
23 ULONG64 _result = (result); \
24 ok(_value == (result), "Wrong value for '%s', expected: " #result " (%s), got: %s\n", \
25 #expression, wine_dbgstr_longlong(_result), wine_dbgstr_longlong(_value)); \
55#define init_sym(fInvadeProcess) init_sym_imp(fInvadeProcess, __FILE__, __LINE__)
57#define INIT_PSYM(buff) do { \
58 memset((buff), 0, sizeof((buff))); \
59 ((PSYMBOL_INFO)(buff))->SizeOfStruct = sizeof(SYMBOL_INFO); \
60 ((PSYMBOL_INFO)(buff))->MaxNameLen = MAX_SYM_NAME; \
80 errmsg =
"fileinfo is NULL.\n";
87 errmsg =
"FindResource failed";
95 errmsg =
"SizeofResource failed";
103 errmsg =
"LoadResource failed";
111 errmsg =
"LockResource failed";
117 if (pResCopy ==
NULL)
119 errmsg =
"LocalAlloc failed";
136 if (pResCopy !=
NULL)
169 ok(
FALSE,
"Dbghelp.dll is not loaded!\n");
173 memset(&fileInfo, 0,
sizeof(fileInfo));
180 ok(
FALSE,
"GetModuleFileNameW for dbghelp.dll failed!\n");
185 trace(
" API-Version: %hu.%hu.%hu (%hu)\n",
186 v->MajorVersion,
v->MinorVersion,
v->Revision,
v->Reserved);
188 trace(
" Fileversion: %hu.%hu.%hu.%hu\n",
244 skip(
"dbghelp.dll too old or cannot enumerate symbols!\n");
276 Ret =
SymFromName(hProc,
"_FfsChkdsk@24", pSymbol);
294 Ret =
SymFromName(hProc,
"_FfsFormat@24", pSymbol);
315 skip(
"dbghelp.dll too old or cannot enumerate symbols!\n");
469 skip(
"dbghelp.dll too old or cannot enumerate symbols!\n");
506 ok(
FALSE,
"SymRegisterCallback64Proc: Too many calls.\n");
511 "ActionCode (idx %u) expected %u, got %u\n",
527 ctx.isANSI = testANSI;
541 skip(
"SymRegisterCallbackW64 not found in dbghelp.dll\n");
578 ok(0,
"Failed extracting files\n");
598 trace(
"Module loaded by SymLoadModule64\n");
621 trace(
"Module loaded by LoadLibraryA\n");
std::map< E_MODULE, HMODULE > mod
int strcmp(const char *String1, const char *String2)
#define ok_hex(expression, result)
#define ok_int(expression, result)
_In_ ULONG _Out_writes_bytes_opt_ InformationLength PAUX_MODULE_EXTENDED_INFO ModuleInfo
EXPORT int errmsg(char *msg, va_alist)
LPAPI_VERSION WINAPI ImagehlpApiVersion(void)
FARPROC(WINAPI * PfnDliHook)(unsigned, PDelayLoadInfo)
static const WCHAR szDllName[]
BOOL WINAPI SymFromAddr(HANDLE hProcess, DWORD64 Address, DWORD64 *Displacement, PSYMBOL_INFO Symbol)
struct _SYMBOL_INFO * PSYMBOL_INFO
#define ERROR_MOD_NOT_FOUND
BOOL WINAPI SymCleanup(HANDLE hProcess)
BOOL WINAPI SymInitialize(HANDLE hProcess, PCSTR UserSearchPath, BOOL fInvadeProcess)
#define CBA_DEFERRED_SYMBOL_LOAD_COMPLETE
#define GetCurrentProcess()
struct _SYMBOL_INFO SYMBOL_INFO
#define CBA_DEFERRED_SYMBOL_LOAD_CANCEL
BOOL(CALLBACK * PSYMBOL_REGISTERED_CALLBACK64)(HANDLE, ULONG, ULONG64, ULONG64)
#define CBA_DEFERRED_SYMBOL_LOAD_PARTIAL
#define CBA_DEFERRED_SYMBOL_LOAD_START
DWORD WINAPI SymSetOptions(DWORD opts)
BOOL WINAPI SymRegisterCallbackW64(HANDLE hProcess, PSYMBOL_REGISTERED_CALLBACK64 CallbackFunction, ULONG64 UserContext)
DWORD WINAPI SymGetOptions(void)
BOOL WINAPI SymRegisterCallback64(HANDLE hProcess, PSYMBOL_REGISTERED_CALLBACK64 CallbackFunction, ULONG64 UserContext)
DWORD64 WINAPI SymLoadModule64(HANDLE hProcess, HANDLE hFile, PCSTR ImageName, PCSTR ModuleName, DWORD64 BaseOfDll, DWORD SizeOfDll)
BOOL WINAPI SymGetModuleInfo64(HANDLE hProcess, DWORD64 dwAddr, PIMAGEHLP_MODULE64 ModuleInfo)
static void cleanup(void)
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
DWORD WINAPI GetCurrentDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
BOOL WINAPI SetCurrentDirectoryA(IN LPCSTR lpPathName)
BOOL WINAPI FreeResource(HGLOBAL handle)
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
LPVOID WINAPI LockResource(HGLOBAL handle)
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
BOOL WINAPI VerQueryValueW(LPCVOID pBlock, LPCWSTR lpSubBlock, LPVOID *lplpBuffer, PUINT puLen)
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
HLOCAL NTAPI LocalFree(HLOCAL hMem)
_In_ BOOL _In_ HANDLE hProcess
LPCWSTR LPCWSTR szModuleName
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
static const WCHAR filenameW[]
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
PfnDliHook __pfnDliFailureHook2
int extract_msvc_dll(char szFile[MAX_PATH], char szPath[MAX_PATH])
static BOOL WINAPI SymRegisterCallbackW64_Stub(HANDLE hProcess, PSYMBOL_REGISTERED_CALLBACK64 CallbackFunction, ULONG64 UserContext)
static void test_SymEnumSymbols(HANDLE hProc, DWORD64 BaseAddress)
static BOOL CALLBACK SymRegisterCallback64Proc(HANDLE hProcess, ULONG ActionCode, ULONG64 CallbackData, ULONG64 UserContext)
static BOOL CALLBACK EnumSymProc(PSYMBOL_INFO pSymInfo, ULONG SymbolSize, PVOID UserContext)
static BOOL init_sym_imp(BOOL fInvadeProcess, const char *file, int line)
struct _test_context test_context
static VS_FIXEDFILEINFO dbghelpFileVer
void create_compressed_files()
#define init_sym(fInvadeProcess)
struct _symregcallback_context symregcallback_context
FARPROC WINAPI DliFailHook(unsigned dliNotify, PDelayLoadInfo pdli)
#define ok_ulonglong(expression, result)
static void test_SymFromAddr(HANDLE hProc, DWORD64 BaseAddress)
static void init_dbghelp_version()
static int g_SymRegisterCallbackW64NotFound
BOOL get_module_version(_In_ HMODULE mod, _Out_ VS_FIXEDFILEINFO *fileinfo)
static void test_SymRegCallback(HANDLE hProc, const char *szModuleName, BOOL testANSI)
static BOOL supports_pdb(HANDLE hProc, DWORD64 BaseAddress)
static struct _symregcallback_test_data symregcallback_test_data[]
static void test_SymFromName(HANDLE hProc, DWORD64 BaseAddress)
BOOL WINAPI SymEnumSymbols(HANDLE hProcess, ULONG64 BaseOfDll, PCSTR Mask, PSYM_ENUMERATESYMBOLS_CALLBACK EnumSymbolsCallback, PVOID UserContext)
BOOL WINAPI SymFromName(HANDLE hProcess, PCSTR Name, PSYMBOL_INFO Symbol)
_In_ PWDFDEVICE_INIT _In_ PWDF_REMOVE_LOCK_OPTIONS Options
DWORD WINAPI GetLastError(void)
_In_ PCALLBACK_FUNCTION CallbackFunction