Handle unsupported display deferrals in the HLE test

(cherry picked from commit efe102edac86f365a9951f3c92228413cbee8e46)
This commit is contained in:
EatCodeSleep2 authored and local committed 2026-11-25 01:02:59 -06:00
1 parent e8eb93a2bd
commit 3f497dafc1
1 file changed
+9 -6
+9 -6
View File
@@ -185,11 +185,14 @@ mod tests {
type Acquire = extern "system" fn(This, *mut *mut c_void) -> HRESULT;
type Close = extern "system" fn(This, *mut c_void);
let mut handle = std::ptr::null_mut();
assert_eq!(
method::<Acquire>(&SHELL_OBJECT, 0x20)(&SHELL_OBJECT, &mut handle),
S_OK
);
assert!(!handle.is_null());
method::<Close>(&SHELL_OBJECT, 0x28)(&SHELL_OBJECT, handle);
match method::<Acquire>(&SHELL_OBJECT, 0x20)(&SHELL_OBJECT, &mut handle) {
S_OK => {
assert!(!handle.is_null());
method::<Close>(&SHELL_OBJECT, 0x28)(&SHELL_OBJECT, handle);
}
// Windows can reject display power requests on some hosts.
NOT_SUPPORTED => assert!(handle.is_null()),
hr => panic!("unexpected display deferral HRESULT {:#010x}", hr as u32),
}
}
}