fix handle type.

This commit is contained in:
David Wiesen
2025-10-06 11:43:15 -07:00
parent b28888f16a
commit d41ab7290e

View File

@@ -596,7 +596,9 @@ mod imp {
fn query_console_snapshot() -> Option<ConsoleSnapshot> {
unsafe {
let handle = GetStdHandle(STD_OUTPUT_HANDLE);
if handle.is_null() || handle == INVALID_HANDLE_VALUE {
// `HANDLE` is an `isize`, so compare against 0 explicitly instead of treating
// it like a raw pointer when verifying the console handle succeeded.
if handle == 0 || handle == INVALID_HANDLE_VALUE {
return None;
}