1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-15 06:04:49 +01:00

detect D3DWindower as well

This commit is contained in:
FunkyFr3sh 2024-07-20 02:19:31 +02:00
parent ce64c20ae6
commit 751a1e9419

View File

@ -162,6 +162,24 @@ BOOL util_caller_is_ddraw_wrapper(void* return_address)
HMODULE mod = NULL;
DWORD flags = GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT;
HMODULE D3dHook_dll = GetModuleHandleA("D3dHook.dll");
if (D3dHook_dll)
{
if ((getModuleHandleExA(flags, return_address, &mod) && mod == D3dHook_dll) ||
(getModuleHandleExA(flags, directDrawCreate, &mod) && mod == D3dHook_dll) ||
(getModuleHandleExA(flags, directDrawCreateEx, &mod) && mod == D3dHook_dll))
{
MessageBoxA(
NULL,
"Error: You cannot combine cnc-ddraw with other DirectDraw wrappers. \n\n"
"Please disable D3DWindower and then try to start the game again.",
"Conflicting DirectDraw wrapper detected - cnc-ddraw",
MB_OK | MB_TOPMOST);
return TRUE;
}
}
HMODULE wndmode_dll = GetModuleHandleA("wndmode.dll");
if (wndmode_dll)
{