Busywork courtesy of Microsoft

Add messages


Missing include


1
This commit is contained in:
fireice-uk
2017-12-26 21:11:22 +00:00
parent 5e5888bff8
commit b216f39a52
6 changed files with 59 additions and 5 deletions
+6 -4
View File
@@ -1,6 +1,6 @@
project(xmr-stak)
cmake_minimum_required(VERSION 3.1.0)
cmake_minimum_required(VERSION 3.4.0)
# enforce C++11
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -522,9 +522,11 @@ endif()
file(GLOB SRCFILES_CPP "xmrstak/cli/*.cpp")
set_source_files_properties(${SRCFILES_CPP} PROPERTIES LANGUAGE CXX)
add_executable(xmr-stak
${SRCFILES_CPP}
)
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
add_executable(xmr-stak ${SRCFILES_CPP} xmrstak/cli/xmr-stak.manifest)
else()
add_executable(xmr-stak ${SRCFILES_CPP})
endif()
set(EXECUTABLE_OUTPUT_PATH "bin")
set(LIBRARY_OUTPUT_PATH "bin")
@@ -31,6 +31,7 @@ extern "C"
#include "cryptonight.h"
#include "cryptonight_aesni.h"
#include "xmrstak/backend/cryptonight.hpp"
#include "xmrstak/misc/console.hpp"
#include "xmrstak/jconf.hpp"
#include <stdio.h>
#include <stdlib.h>
@@ -178,6 +179,7 @@ size_t cryptonight_init(size_t use_fast_mem, size_t use_mlock, alloc_msg* msg)
if(AddPrivilege(TEXT("SeLockMemoryPrivilege")) == 0)
{
printer::inst()->print_msg(L0, "Elevating because we need to set up fast memory privileges.");
RequestElevation();
if(AddLargePageRights())
+4 -1
View File
@@ -535,8 +535,11 @@ int main(int argc, char *argv[])
#ifdef _WIN32
/* For Windows 7 and 8 request elevation at all times unless we are using slow memory */
if(jconf::inst()->GetSlowMemSetting() != jconf::slow_mem_cfg::always_use && LOBYTE(LOWORD(GetVersion())) < 10)
if(jconf::inst()->GetSlowMemSetting() != jconf::slow_mem_cfg::always_use && !IsWindows10OrNewer())
{
printer::inst()->print_msg(L0, "Elevating due to Windows 7 or 8. You need Windows 10 to use fast memory without UAC elevation.");
RequestElevation();
}
#endif
if (!BackendConnector::self_test())
+34
View File
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="amd64"
name="xmr-stak"
type="win32"
/>
<description>XMR-Stak Monero Miner</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="asInvoker"
uiAccess="false"
/>
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
</application>
</compatibility>
</assembly>
+12
View File
@@ -64,4 +64,16 @@ VOID RequestElevation()
SelfElevate(xmrstak::params::inst().minerArg0, xmrstak::params::inst().minerArgs);
}
BOOL IsWindows10OrNewer()
{
OSVERSIONINFOEX osvi = { 0 };
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
osvi.dwMajorVersion = 10;
osvi.dwMinorVersion = 0;
DWORDLONG dwlConditionMask = 0;
VER_SET_CONDITION(dwlConditionMask, VER_MAJORVERSION, VER_GREATER_EQUAL);
VER_SET_CONDITION(dwlConditionMask, VER_MINORVERSION, VER_GREATER_EQUAL);
return ::VerifyVersionInfo(&osvi, VER_MAJORVERSION | VER_MINORVERSION, dwlConditionMask);
}
#endif
+1
View File
@@ -6,4 +6,5 @@
BOOL IsElevated();
BOOL SelfElevate(const std::string& my_path, const std::string& params);
VOID RequestElevation();
BOOL IsWindows10OrNewer();
#endif