Handle unsupported display deferrals in the HLE test
(cherry picked from commit efe102edac86f365a9951f3c92228413cbee8e46)
This commit is contained in:
1 parent
e8eb93a2bd
commit
3f497dafc1
1 file changed
+9
-6
@@ -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),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user