COM & Audio useful bindings

This commit is contained in:
Vincent Billet
2025-05-21 09:48:41 +02:00
parent 4329f50d26
commit b03cdd22d5
3 changed files with 550 additions and 24 deletions
+8
View File
@@ -173,6 +173,9 @@ FACILITY :: enum DWORD {
EAS = 85,
WEB = 885,
WEB_SOCKET = 886,
XAUDIO2 = 896,
XAPO = 897,
GAMEINPUT = 906,
MOBILE = 1793,
SQLITE = 1967,
SERVICE_FABRIC = 1968,
@@ -231,6 +234,7 @@ ERROR_PIPE_BUSY : DWORD : 231
// https://learn.microsoft.com/en-us/windows/win32/seccrypto/common-hresult-values
S_OK :: 0x00000000 // Operation successful
S_FALSE :: 0x00000001
E_NOTIMPL :: 0x80004001 // Not implemented
E_NOINTERFACE :: 0x80004002 // No such interface supported
E_POINTER :: 0x80004003 // Pointer that is not valid
@@ -270,6 +274,10 @@ MAKE_HRESULT :: #force_inline proc "contextless" (#any_int sev: int, #any_int fa
return HRESULT((uint(sev)<<31) | (uint(fac)<<16) | (uint(code)))
}
HRESULT_FROM_WIN32 :: #force_inline proc "contextless" (#any_int code: int) -> HRESULT {
return HRESULT(code) <= 0 ? HRESULT(code) : HRESULT((code & 0x0000FFFF) | (int(FACILITY.WIN32) << 16) | 0x80000000)
}
DECODE_HRESULT :: #force_inline proc "contextless" (#any_int hr: int) -> (SEVERITY, FACILITY, int) {
return HRESULT_SEVERITY(hr), HRESULT_FACILITY(hr), HRESULT_CODE(hr)
}