fix init func status error

This commit is contained in:
2026-10-08 09:54:16 +08:00
parent 084e58bc74
commit 41c7204be2
2 changed files with 15 additions and 5 deletions
+5 -4
View File
@@ -28,14 +28,14 @@ namespace driver_func
return os;
}
auto init() -> BOOL
auto init(PDWORD status) -> BOOL
{
os = GetVersion();
if (os.dwBuildNumber == 7600 || os.dwBuildNumber == 7601)
{
null_device_handle = CreateFileA("\\\\.\\Nul", GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_SYSTEM, 0);
if (null_device_handle != NULL && null_device_handle != INVALID_HANDLE_VALUE)
return TRUE;
if (null_device_handle != NULL && null_device_handle != INVALID_HANDLE_VALUE) { *status = 0; return TRUE; }
else { *status = 105; return FALSE; }
}
else if (os.dwBuildNumber >= 14393)
{
@@ -47,7 +47,8 @@ namespace driver_func
gNtConvertBetweenAuxiliary = (NtConvertBetweenAuxiliaryCounterAndPerformanceCounterProc)
GetProcAddress(ntdll, "NtConvertBetweenAuxiliaryCounterAndPerformanceCounter");
return gNtConvertBetweenAuxiliary ? TRUE : FALSE;
if (!gNtConvertBetweenAuxiliary) { *status = 105; return FALSE; }
else { *status = 0; return TRUE; }
}
}
}