summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpsychocrypt <psychocrypt@users.noreply.github.com>2017-12-03 21:12:43 +0100
committerpsychocrypt <psychocrypt@users.noreply.github.com>2017-12-06 22:21:48 +0100
commit350cfbc461fc6023b3232537cbf71bc18a85d07f (patch)
treeb4ff65f03a798f9f43950e91e1b02de87534d281
parent7ca6f6e2e9bd5f7a68c878a60a296af1a3636c6f (diff)
downloadxmr-stak-350cfbc461fc6023b3232537cbf71bc18a85d07f.zip
xmr-stak-350cfbc461fc6023b3232537cbf71bc18a85d07f.tar.gz
fix missing arguments
pass arguments to the restarted miner with high privileges
-rw-r--r--xmrstak/cli/cli-miner.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/xmrstak/cli/cli-miner.cpp b/xmrstak/cli/cli-miner.cpp
index 087d3b6..1298b60 100644
--- a/xmrstak/cli/cli-miner.cpp
+++ b/xmrstak/cli/cli-miner.cpp
@@ -280,7 +280,7 @@ void do_guided_config(bool userSetPasswd)
* - author: Cody Gray
* - date: Feb 4 '11
*/
-void UACDialog(std::string binaryName)
+void UACDialog(const std::string& binaryName, const std::string& args)
{
SHELLEXECUTEINFO shExInfo = {0};
shExInfo.cbSize = sizeof(shExInfo);
@@ -289,7 +289,7 @@ void UACDialog(std::string binaryName)
shExInfo.lpVerb = "runas";
shExInfo.lpFile = binaryName.c_str();
// disable UAC dialog (else the miner will go into a infinite loop)
- shExInfo.lpParameters = "--noUAC";
+ shExInfo.lpParameters = (args + " --noUAC").c_str();
shExInfo.lpDirectory = 0;
shExInfo.nShow = SW_SHOW;
shExInfo.hInstApp = 0;
@@ -474,7 +474,12 @@ int main(int argc, char *argv[])
#ifdef _WIN32
if(uacDialog)
- UACDialog(argv[0]);
+ {
+ std::string minerArgs;
+ for(int i = 1; i < argc; i++)
+ minerArgs += std::string(" ") + argv[i];
+ UACDialog(argv[0], minerArgs);
+ }
#endif
// check if we need a guided start
OpenPOWER on IntegriCloud