Debug (Windows): adds ffDebugHResult

This commit is contained in:
李通洲
2026-03-27 20:14:47 +08:00
parent 63f7e15554
commit 90ca39b464
2 changed files with 18 additions and 1 deletions
+16
View File
@@ -32,3 +32,19 @@ const char* ffDebugNtStatus(NTSTATUS status)
{
return ffDebugWin32Error(RtlNtStatusToDosError(status));
}
static inline DWORD HRESULTToWin32Error(HRESULT hr)
{
if (SUCCEEDED(hr))
return ERROR_SUCCESS;
if (HRESULT_FACILITY(hr) == FACILITY_WIN32)
return HRESULT_CODE(hr);
return ERROR_INTERNAL_ERROR;
}
const char* ffDebugHResult(HRESULT hr)
{
return ffDebugWin32Error(HRESULTToWin32Error(hr));
}