fix(windows): reintroduce hwnd val checks

@riverar pointed out on Discord that I had my if and else clauses here
mixed up. This commit reintroduces null value checks for HWNDs returned
from Windows API calls.
This commit is contained in:
LGUG2Z
2022-04-15 17:31:53 -07:00
parent fad4cbf019
commit 686d013734

View File

@@ -130,7 +130,11 @@ macro_rules! impl_process_windows_crate_integer_wrapper_result {
$(
impl ProcessWindowsCrateResult<$deref> for $input {
fn process(self) -> Result<$deref> {
Ok(self.0)
if self == HWND(0) {
Err(std::io::Error::last_os_error().into())
} else {
Ok(self.0)
}
}
}
)+