-
Notifications
You must be signed in to change notification settings - Fork 519
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
686 additions
and
582 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
crates/libs/bindgen/src/rust/extensions/mod/Win32/System/Rpc/RPC_STATUS.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
impl RPC_STATUS { | ||
#[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_win32(self.0 as u32) | ||
} | ||
#[inline] | ||
pub fn ok(self) -> ::windows_core::Result<()> { | ||
if self.is_ok() { | ||
Ok(()) | ||
} else { | ||
Err(self.to_hresult().into()) | ||
} | ||
} | ||
} | ||
impl ::core::convert::From<RPC_STATUS> for ::windows_core::HRESULT { | ||
fn from(value: RPC_STATUS) -> Self { | ||
value.to_hresult() | ||
} | ||
} | ||
impl ::core::convert::From<RPC_STATUS> for ::windows_core::Error { | ||
fn from(value: RPC_STATUS) -> Self { | ||
value.to_hresult().into() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1,192 changes: 612 additions & 580 deletions
1,192
crates/libs/windows/src/Windows/Win32/System/Rpc/mod.rs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters