Skip to content

Commit 61c0815

Browse files
committed
Added DirectDraw detection which avoids hooking the launcher when certain interfering apps (e.g. Nvidia GFE overlay) are enabled.
1 parent 2d93187 commit 61c0815

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

loader_core/loader_core.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "stdafx.h"
1+
#include "stdafx.h"
22
#include "build_version.h"
33

44
loader_core loader_core::instance;
@@ -93,6 +93,10 @@ void loader_core::log_text_fmt(gw2al_log_level level, const wchar_t * source, co
9393

9494
void loader_core::innerInit()
9595
{
96+
HMODULE directDraw = GetModuleHandleA("ddraw.dll");
97+
if(directDraw)
98+
return;
99+
96100
if (SwitchState(LDR_ADDON_LOAD))
97101
{
98102
bool isFirstLoad = gw2al_core__init();
@@ -112,7 +116,9 @@ IDirect3D9* loader_core::RouteD3DCreate(UINT sdkVer)
112116

113117
IDirect3D9* ret = NULL;
114118

115-
if (d3d9_create_hook)
119+
HMODULE directDraw = GetModuleHandleA("ddraw.dll");
120+
121+
if (!directDraw && d3d9_create_hook)
116122
{
117123
LOG_DEBUG(L"core", L"Calling D3D9Create, hook = 0x%016llX", d3d9_create_hook);
118124
ret = d3d9_create_hook();
@@ -149,7 +155,9 @@ HRESULT loader_core::RouteDXGIFactoryCreate(UINT ver, UINT Flags, REFIID riid, v
149155

150156
HRESULT ret = NULL;
151157

152-
if (dxgi_create_hook)
158+
HMODULE directDraw = GetModuleHandleA("ddraw.dll");
159+
160+
if (!directDraw && dxgi_create_hook)
153161
{
154162
LOG_DEBUG(L"core", L"Calling DXGICreate, hook = 0x%016llX", dxgi_create_hook);
155163
ret = dxgi_create_hook(ver, Flags, riid, ppFactory);

0 commit comments

Comments
 (0)