mirror of
https://github.com/narzoul/DDrawCompat
synced 2024-12-30 08:55:36 +01:00
Fixed hangup while installing hooks on Windows 11 22H2
This commit is contained in:
parent
359256660e
commit
f1d8dbd1cb
@ -22,9 +22,29 @@ namespace
|
||||
ULONG64 g_debugBase = 0;
|
||||
bool g_isDbgEngInitialized = false;
|
||||
|
||||
LONG WINAPI dbgEngWinVerifyTrust(HWND hwnd, GUID* pgActionID, LPVOID pWVTData);
|
||||
PIMAGE_NT_HEADERS getImageNtHeaders(HMODULE module);
|
||||
bool initDbgEng();
|
||||
|
||||
FARPROC WINAPI dbgEngGetProcAddress(HMODULE hModule, LPCSTR lpProcName)
|
||||
{
|
||||
LOG_FUNC("dbgEngGetProcAddress", hModule, lpProcName);
|
||||
if (0 == strcmp(lpProcName, "WinVerifyTrust"))
|
||||
{
|
||||
return LOG_RESULT(reinterpret_cast<FARPROC>(&dbgEngWinVerifyTrust));
|
||||
}
|
||||
return LOG_RESULT(GetProcAddress(hModule, lpProcName));
|
||||
}
|
||||
|
||||
LONG WINAPI dbgEngWinVerifyTrust(
|
||||
[[maybe_unused]] HWND hwnd,
|
||||
[[maybe_unused]] GUID* pgActionID,
|
||||
[[maybe_unused]] LPVOID pWVTData)
|
||||
{
|
||||
LOG_FUNC("dbgEngWinVerifyTrust", hwnd, pgActionID, pWVTData);
|
||||
return LOG_RESULT(0);
|
||||
}
|
||||
|
||||
FARPROC* findProcAddressInIat(HMODULE module, const char* procName)
|
||||
{
|
||||
if (!module || !procName)
|
||||
@ -208,6 +228,8 @@ namespace
|
||||
}
|
||||
g_isDbgEngInitialized = true;
|
||||
|
||||
Compat::hookIatFunction(GetModuleHandle("dbgeng"), "GetProcAddress", dbgEngGetProcAddress);
|
||||
|
||||
HRESULT result = S_OK;
|
||||
if (FAILED(result = DebugCreate(IID_IDebugClient4, reinterpret_cast<void**>(&g_debugClient))) ||
|
||||
FAILED(result = g_debugClient->QueryInterface(IID_IDebugControl, reinterpret_cast<void**>(&g_debugControl))) ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user