Add casts for NTSTATUS in NtStatusToErrorCode

This commit is contained in:
Jeffrey Walton 2023-06-23 00:18:42 -04:00
parent df86e69902
commit 805a1c4fcf
No known key found for this signature in database
GPG Key ID: B36AB348921B1838

View File

@ -100,9 +100,9 @@ OS_RNG_Err::OS_RNG_Err(const std::string &operation)
#if defined(USE_MS_CNGAPI)
inline DWORD NtStatusToErrorCode(NTSTATUS status)
{
if (status == STATUS_INVALID_PARAMETER)
if (status == (NTSTATUS)STATUS_INVALID_PARAMETER)
return ERROR_INVALID_PARAMETER;
else if (status == STATUS_INVALID_HANDLE)
else if (status == (NTSTATUS)STATUS_INVALID_HANDLE)
return ERROR_INVALID_HANDLE;
else
return (DWORD)status;