Create EhWin32FromHResult.cpp

This commit is contained in:
vxunderground
2022-07-14 22:42:59 -05:00
committed by GitHub
parent 3a129e49a2
commit c8dbf589dc
@@ -0,0 +1,10 @@
DWORD EhWin32FromHResult(HRESULT Result)
{
if ((Result & 0xFFFF0000) == MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, 0))
return HRESULT_CODE(Result);
if (Result == S_OK)
return ERROR_SUCCESS;
return ERROR_CAN_NOT_COMPLETE;
}