diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-09-27 01:01:55 +0100 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-09-27 01:01:55 +0100 |
commit | 22cfe175e12c68d62412ca662b300aa89e097b24 (patch) | |
tree | 650d45d0cb3754a8f940fcb9d656e1ec5e66d280 /LauncherInjector/main.cpp | |
parent | 26d090e4ae6153d1f7b49f8776c2923345dd810f (diff) | |
download | NorthstarLauncher-22cfe175e12c68d62412ca662b300aa89e097b24.tar.gz NorthstarLauncher-22cfe175e12c68d62412ca662b300aa89e097b24.zip |
improve some commandline arg stuff
Diffstat (limited to 'LauncherInjector/main.cpp')
-rw-r--r-- | LauncherInjector/main.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/LauncherInjector/main.cpp b/LauncherInjector/main.cpp index 597e72d3..8b136612 100644 --- a/LauncherInjector/main.cpp +++ b/LauncherInjector/main.cpp @@ -88,6 +88,15 @@ int main(int argc, char* argv[]) { std::wstring args; std::ifstream cmdlineArgFile; + args.append(L" "); + for (int i = 0; i < argc; i++) + { + std::string str = argv[i]; + + args.append(std::wstring(str.begin(), str.end())); + args.append(L" "); + } + if (!isdedi) cmdlineArgFile = std::ifstream("ns_startup_args.txt"); else @@ -103,9 +112,9 @@ int main(int argc, char* argv[]) { args.append(std::wstring(str.begin(), str.end())); } - if (isdedi) - // copy -dedicated into args if we have it in commandline args - args.append(L" -dedicated"); + //if (isdedi) + // // copy -dedicated into args if we have it in commandline args + // args.append(L" -dedicated"); STARTUPINFO startupInfo; PROCESS_INFORMATION processInfo; @@ -127,7 +136,7 @@ int main(int argc, char* argv[]) { HANDLE hThread = CreateRemoteThread(processInfo.hProcess, NULL, NULL, pLoadLibraryW, lpLibName, NULL, NULL); WaitForSingleObject(hThread, INFINITE); - MessageBoxA(0, std::to_string(GetLastError()).c_str(), "", MB_OK); + //MessageBoxA(0, std::to_string(GetLastError()).c_str(), "", MB_OK); CloseHandle(hThread); |