diff options
author | GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com> | 2024-08-23 23:20:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-23 23:20:27 +0200 |
commit | 04b7527fb0bdfce61d39c9d7de57f8c1e21ae660 (patch) | |
tree | 37028d8d439ac1eac5092e6367d382642abbf44f | |
parent | 314b86aead1f3bd2e20840d493178b07113571eb (diff) | |
parent | 9615ba206d47c00414c47402ba6880d08cc6c76a (diff) | |
download | NorthstarLauncher-04b7527fb0bdfce61d39c9d7de57f8c1e21ae660.tar.gz NorthstarLauncher-04b7527fb0bdfce61d39c9d7de57f8c1e21ae660.zip |
Merge branch 'main' into feat/whitelist-safeio-file-extensions
-rw-r--r-- | primedev/windows/libsys.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/primedev/windows/libsys.cpp b/primedev/windows/libsys.cpp index dc699b84..501eae68 100644 --- a/primedev/windows/libsys.cpp +++ b/primedev/windows/libsys.cpp @@ -56,15 +56,27 @@ HMODULE WINAPI WLoadLibraryExA(LPCSTR lpLibFileName, HANDLE hFile, DWORD dwFlags // replace xinput dll with one that has ASLR if (lpLibFileName <= lpLibName && !strncmp(lpLibName, XINPUT1_3_DLL, strlen(XINPUT1_3_DLL) + 1)) { - hModule = o_LoadLibraryExA("XInput9_1_0.dll", hFile, dwFlags); + const char* pszReplacementDll = "XInput1_4.dll"; + hModule = o_LoadLibraryExA(pszReplacementDll, hFile, dwFlags); if (!hModule) { - MessageBoxA(0, "Could not find XInput9_1_0.dll", "Northstar", MB_ICONERROR); + pszReplacementDll = "XInput9_1_0.dll"; + spdlog::warn("Couldn't load XInput1_4.dll. Will try XInput9_1_0.dll. If on Windows 7 this is expected"); + hModule = o_LoadLibraryExA(pszReplacementDll, hFile, dwFlags); + } + + if (!hModule) + { + spdlog::error("Couldn't load XInput9_1_0.dll"); + MessageBoxA( + 0, "Could not load a replacement for XInput1_3.dll\nTried: XInput1_4.dll and XInput9_1_0.dll", "Northstar", MB_ICONERROR); exit(EXIT_FAILURE); return nullptr; } + + spdlog::info("Successfully loaded {} as a replacement for XInput1_3.dll", pszReplacementDll); } else { |