Fix Windows HANDLE check for windows-sys 0.52

This commit is contained in:
Yaroslav Volovich
2026-02-13 21:38:12 +00:00
parent c136143be9
commit ece9757260

View File

@@ -68,7 +68,7 @@ impl PowerRequest {
},
};
let handle = unsafe { PowerCreateRequest(&context) };
if handle.is_null() {
if handle == 0 {
let error = std::io::Error::last_os_error();
return Err(format!("PowerCreateRequest failed: {error}"));
}