summaryrefslogtreecommitdiffstats
path: root/xmrstak/backend/cpu/crypto/cryptonight_common.cpp
diff options
context:
space:
mode:
authorfireice-uk <fireice-uk@users.noreply.github.com>2017-10-04 19:04:40 +0100
committerfireice-uk <fireice-uk@users.noreply.github.com>2017-10-04 19:04:40 +0100
commit2b9bcc2dfd835d3c0a6a7de3f5f224c9afd5434b (patch)
treeca0b8315a4cd1c6e50e81f9ab181c6e14fddf0b5 /xmrstak/backend/cpu/crypto/cryptonight_common.cpp
parent821fe09e97e71247f5454caa7076263647056aa8 (diff)
downloadxmr-stak-2b9bcc2dfd835d3c0a6a7de3f5f224c9afd5434b.zip
xmr-stak-2b9bcc2dfd835d3c0a6a7de3f5f224c9afd5434b.tar.gz
Add a suggestion to reboot in cases where it might help
Diffstat (limited to 'xmrstak/backend/cpu/crypto/cryptonight_common.cpp')
-rw-r--r--xmrstak/backend/cpu/crypto/cryptonight_common.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/xmrstak/backend/cpu/crypto/cryptonight_common.cpp b/xmrstak/backend/cpu/crypto/cryptonight_common.cpp
index 1cff5bb..aeb5a83 100644
--- a/xmrstak/backend/cpu/crypto/cryptonight_common.cpp
+++ b/xmrstak/backend/cpu/crypto/cryptonight_common.cpp
@@ -164,6 +164,7 @@ BOOL AddLargePageRights()
}
#endif
+BOOL bRebootDesirable = FALSE; //If VirtualAlloc fails, suggest a reboot
size_t cryptonight_init(size_t use_fast_mem, size_t use_mlock, alloc_msg* msg)
{
#ifdef _WIN32
@@ -173,12 +174,17 @@ size_t cryptonight_init(size_t use_fast_mem, size_t use_mlock, alloc_msg* msg)
if(AddPrivilege(TEXT("SeLockMemoryPrivilege")) == 0)
{
if(AddLargePageRights())
+ {
msg->warning = "Added SeLockMemoryPrivilege to the current account. You need to reboot for it to work";
+ bRebootDesirable = TRUE;
+ }
else
msg->warning = "Obtaning SeLockMemoryPrivilege failed.";
return 0;
}
+
+ bRebootDesirable = TRUE;
return 1;
#else
return 1;
@@ -210,7 +216,10 @@ cryptonight_ctx* cryptonight_alloc_ctx(size_t use_fast_mem, size_t use_mlock, al
if(ptr->long_state == NULL)
{
_mm_free(ptr);
- msg->warning = "VirtualAlloc failed.";
+ if(bRebootDesirable)
+ msg->warning = "VirtualAlloc failed. Reboot might help.";
+ else
+ msg->warning = "VirtualAlloc failed.";
return NULL;
}
else
OpenPOWER on IntegriCloud