Skip to content

Commit

Permalink
Use generated E_POINTER constant in windows-core (#3008)
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr authored Apr 22, 2024
1 parent 97375aa commit 18498cb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions crates/libs/core/src/imp/com_bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ impl Default for DateTime {
pub const E_BOUNDS: windows_core::HRESULT = windows_core::HRESULT(0x8000000B_u32 as _);
pub const E_NOINTERFACE: windows_core::HRESULT = windows_core::HRESULT(0x80004002_u32 as _);
pub const E_OUTOFMEMORY: windows_core::HRESULT = windows_core::HRESULT(0x8007000E_u32 as _);
pub const E_POINTER: windows_core::HRESULT = windows_core::HRESULT(0x80004003_u32 as _);
windows_core::imp::define_interface!(IAgileObject, IAgileObject_Vtbl, 0x94ea2b94_e9cc_49e0_c0ff_ee64ca8f5b90);
impl std::ops::Deref for IAgileObject {
type Target = windows_core::IUnknown;
Expand Down
4 changes: 2 additions & 2 deletions crates/libs/core/src/imp/weak_ref_count.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ impl TearOff {
let this = Self::from_strong_ptr(ptr);

if iid.is_null() || interface.is_null() {
return windows_core::HRESULT(-2147467261); // E_POINTER
return E_POINTER;
}

// Only directly respond to queries for the the tear-off's strong interface. This is
Expand All @@ -147,7 +147,7 @@ impl TearOff {
let this = Self::from_weak_ptr(ptr);

if iid.is_null() || interface.is_null() {
return windows_core::HRESULT(-2147467261); // E_POINTER
return E_POINTER;
}

// While the weak vtable is packed into the same allocation as the strong vtable and
Expand Down
1 change: 1 addition & 0 deletions crates/libs/core/tests/com_bindings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
Windows.Win32.Foundation.E_BOUNDS
Windows.Win32.Foundation.E_NOINTERFACE
Windows.Win32.Foundation.E_OUTOFMEMORY
Windows.Win32.Foundation.E_POINTER
Windows.Win32.Foundation.JSCRIPT_E_CANTEXECUTE
Windows.Win32.Foundation.RPC_E_DISCONNECTED
Windows.Win32.Foundation.TYPE_E_TYPEMISMATCH
Expand Down

0 comments on commit 18498cb

Please sign in to comment.