Skip to content

Commit d71f6de

Browse files
committed
#15: whoops
1 parent a7c8fb7 commit d71f6de

1 file changed

Lines changed: 28 additions & 3 deletions

File tree

dllmain.cpp

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,34 @@ void UCOColor(WORD color, const char* text)
162162
#endif
163163
}
164164

165-
void* InitSteamClient(HMODULE* phMod, bool bLocal, const char* iface);
166-
void LoadBreakpadSymbols(HMODULE hMod);
167-
void UpdateMinidumpSteamID(uint64 sid);
165+
void* InitSteamClient(HMODULE* phMod, bool bLocal, const char* iface)
166+
{
167+
UCOLOG("[UCOnline2] InitSteamClient -> %s", iface);
168+
169+
const char* steamClientPath = "steamclient.dll";
170+
#if defined(_M_AMD64)
171+
steamClientPath = "steamclient64.dll";
172+
#endif
173+
174+
HMODULE hMod = LoadLibraryA(steamClientPath);
175+
if (!hMod)
176+
{
177+
UCOColor(FOREGROUND_RED | FOREGROUND_INTENSITY, "[UCOnline2] Failed to load steamclient.dll\r\n");
178+
return nullptr;
179+
}
180+
181+
if (phMod)
182+
*phMod = hMod;
183+
184+
Fn_CreateInterface pfnCreateInterface = (Fn_CreateInterface)GetProcAddress(hMod, "CreateInterface");
185+
if (!pfnCreateInterface)
186+
{
187+
UCOColor(FOREGROUND_RED | FOREGROUND_INTENSITY, "[UCOnline2] Failed to get CreateInterface\r\n");
188+
return nullptr;
189+
}
190+
191+
return pfnCreateInterface(iface, nullptr);
192+
}
168193

169194
// ============================================================
170195
// LoadGameOverlay

0 commit comments

Comments
 (0)