fix init func status error
This commit is contained in:
@@ -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; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user