diff options
author | BobTheBob9 <for.oliver.kirkham@gmail.com> | 2022-08-22 21:59:18 +0100 |
---|---|---|
committer | BobTheBob9 <for.oliver.kirkham@gmail.com> | 2022-08-22 21:59:18 +0100 |
commit | ee8ae568bc42cb5311edd7294eb0f8f2ae078bd1 (patch) | |
tree | 9cb1cdb308d81772812cd4456f94634ee10b6670 /loader_launcher_proxy/dllmain.cpp | |
parent | 921668fd9578d514258edec7432b656cc5d7041d (diff) | |
download | NorthstarLauncher-ee8ae568bc42cb5311edd7294eb0f8f2ae078bd1.tar.gz NorthstarLauncher-ee8ae568bc42cb5311edd7294eb0f8f2ae078bd1.zip |
add more prs
Diffstat (limited to 'loader_launcher_proxy/dllmain.cpp')
-rw-r--r-- | loader_launcher_proxy/dllmain.cpp | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/loader_launcher_proxy/dllmain.cpp b/loader_launcher_proxy/dllmain.cpp index 1215ca1f..a86dddea 100644 --- a/loader_launcher_proxy/dllmain.cpp +++ b/loader_launcher_proxy/dllmain.cpp @@ -2,7 +2,7 @@ #include <stdio.h> #include <string> #include <system_error> -#include <Shlwapi.h> +#include <shlwapi.h> #include <sstream> #include <fstream> #include <filesystem> @@ -14,7 +14,7 @@ HMODULE hTier0Module; using CreateInterfaceFn = void* (*)(const char* pName, int* pReturnCode); // does not seem to ever be used -extern "C" _declspec(dllexport) void* __fastcall CreateInterface(const char* pName, int* pReturnCode) +extern "C" __declspec(dllexport) void* __fastcall CreateInterface(const char* pName, int* pReturnCode) { //AppSystemCreateInterfaceFn(pName, pReturnCode); printf("external CreateInterface: name: %s\n", pName); @@ -45,14 +45,20 @@ FARPROC GetLauncherMain() void LibraryLoadError(DWORD dwMessageId, const wchar_t* libName, const wchar_t* location) { - char text[4096]; - std::string message = std::system_category().message(dwMessageId); - sprintf_s(text, "Failed to load the %ls at \"%ls\" (%lu):\n\n%hs", libName, location, dwMessageId, message.c_str()); - if (dwMessageId == 126 && std::filesystem::exists(location)) - { - sprintf_s(text, "%s\n\nThe file at the specified location DOES exist, so this error indicates that one of its *dependencies* failed to be found.", text); - } - MessageBoxA(GetForegroundWindow(), text, "Northstar Launcher Proxy Error", 0); + char text[4096]; + std::string message = std::system_category().message(dwMessageId); + sprintf_s(text, "Failed to load the %ls at \"%ls\" (%lu):\n\n%hs", libName, location, dwMessageId, message.c_str()); + + if (dwMessageId == 126 && std::filesystem::exists(location)) + { + sprintf_s( + text, + "%s\n\nThe file at the specified location DOES exist, so this error indicates that one of its *dependencies* failed to be " + "found.", + text); + } + + MessageBoxA(GetForegroundWindow(), text, "Northstar Launcher Proxy Error", 0); } BOOL APIENTRY DllMain( HMODULE hModule, @@ -87,7 +93,7 @@ bool ShouldLoadNorthstar() std::stringstream runNorthstarFileBuffer; runNorthstarFileBuffer << runNorthstarFile.rdbuf(); runNorthstarFile.close(); - if (runNorthstarFileBuffer.str()._Starts_with("0")) + if (runNorthstarFileBuffer.str().starts_with("0")) loadNorthstar = false; } return loadNorthstar; |