mirror of
https://github.com/xmrig/xmrig.git
synced 2024-11-16 15:57:38 +00:00
MSR mod: fix for error 183
When WinRing0 driver starts, but some other version already created "\\.\WinRing0_1_2_0", it returns error 183 ERROR_ALREADY_EXISTS - "Cannot create a file when that file already exists."
This commit is contained in:
parent
e1cc0000c6
commit
f682d9a2e9
1 changed files with 7 additions and 0 deletions
|
@ -153,6 +153,13 @@ xmrig::Msr::Msr() : d_ptr(new MsrPrivate())
|
|||
}
|
||||
}
|
||||
|
||||
d_ptr->driver = CreateFileW(L"\\\\.\\" SERVICE_NAME, GENERIC_READ | GENERIC_WRITE, 0, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
|
||||
if (d_ptr->driver != INVALID_HANDLE_VALUE) {
|
||||
LOG_WARN("%s " YELLOW("service ") YELLOW_BOLD("WinRing0_1_2_0") YELLOW(" already exists, but with a different service name"), tag());
|
||||
d_ptr->reuse = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!d_ptr->reuse) {
|
||||
d_ptr->service = CreateServiceW(d_ptr->manager, kServiceName, kServiceName, SERVICE_ALL_ACCESS, SERVICE_KERNEL_DRIVER, SERVICE_DEMAND_START, SERVICE_ERROR_NORMAL, path.c_str(), nullptr, nullptr, nullptr, nullptr, nullptr);
|
||||
if (!d_ptr->service) {
|
||||
|
|
Loading…
Reference in a new issue