Files
vxunderground-VX-API/VX-API/RtlNtStatusToDosErrorViaImport.cpp
vxunderground 5226cc3ab5 +27
bug fixes, new functions, new header
2022-10-21 08:10:17 -05:00

22 lines
517 B
C++

#include "Win32Helper.h"
DWORD RtlNtStatusToDosErrorViaImport(_In_ NTSTATUS Status)
{
RTLNTSTATUSTODOSERROR RtlNtStatusToDosError;
HMODULE hModule = NULL;
DWORD dwError = ERROR_SUCCESS;
hModule = GetModuleHandleEx2W(L"ntdll.dll");
if (hModule == NULL)
return -1;
RtlNtStatusToDosError = (RTLNTSTATUSTODOSERROR)GetProcAddressA((DWORD64)hModule, "RtlNtStatusToDosError");
if (!RtlNtStatusToDosError)
return -1;
dwError = RtlNtStatusToDosError(Status);
RtlNtStatusToDosError = NULL;
return dwError;
}