chore: checkpoint before Python removal

This commit is contained in:
2026-03-26 22:33:59 +00:00
parent 683cec9307
commit e568ddf82a
29972 changed files with 11269302 additions and 2 deletions

View File

@@ -0,0 +1,34 @@
use crate::Win32::Foundation::NTSTATUS;
impl NTSTATUS {
#[inline]
pub const fn is_ok(self) -> bool {
self.0 >= 0
}
#[inline]
pub const fn is_err(self) -> bool {
!self.is_ok()
}
#[inline]
pub const fn to_hresult(self) -> windows_core::HRESULT {
windows_core::HRESULT::from_nt(self.0)
}
#[inline]
pub fn ok(self) -> windows_core::Result<()> {
if self.is_ok() {
Ok(())
} else {
Err(self.to_hresult().into())
}
}
}
impl From<NTSTATUS> for windows_core::HRESULT {
fn from(value: NTSTATUS) -> Self {
value.to_hresult()
}
}
impl From<NTSTATUS> for windows_core::Error {
fn from(value: NTSTATUS) -> Self {
value.to_hresult().into()
}
}