aboutsummaryrefslogtreecommitdiff
path: root/loader_launcher_proxy/dllmain.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'loader_launcher_proxy/dllmain.cpp')
-rw-r--r--loader_launcher_proxy/dllmain.cpp28
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;