From 097277520c4f9f2fd18d4272fdce2debed644231 Mon Sep 17 00:00:00 2001 From: Kenny Kerr Date: Thu, 6 Jun 2024 07:48:08 -0500 Subject: [PATCH] debug_assert system APIs --- crates/libs/windows/src/Windows/UI/UIAutomation/Core/mod.rs | 3 ++- crates/libs/windows/src/Windows/UI/UIAutomation/mod.rs | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/libs/windows/src/Windows/UI/UIAutomation/Core/mod.rs b/crates/libs/windows/src/Windows/UI/UIAutomation/Core/mod.rs index cf0adfb90a..39b1d59570 100644 --- a/crates/libs/windows/src/Windows/UI/UIAutomation/Core/mod.rs +++ b/crates/libs/windows/src/Windows/UI/UIAutomation/Core/mod.rs @@ -24,7 +24,8 @@ impl ICoreAutomationConnectionBoundObjectProvider { let this = self; unsafe { let mut result__ = core::mem::zeroed(); - _ = (windows_core::Interface::vtable(this).IsComThreadingRequired)(windows_core::Interface::as_raw(this), &mut result__); + let hresult__ = (windows_core::Interface::vtable(this).IsComThreadingRequired)(windows_core::Interface::as_raw(this), &mut result__); + debug_assert!(hresult__.0 == 0); result__ } } diff --git a/crates/libs/windows/src/Windows/UI/UIAutomation/mod.rs b/crates/libs/windows/src/Windows/UI/UIAutomation/mod.rs index cac740db5a..6a980ffaaf 100644 --- a/crates/libs/windows/src/Windows/UI/UIAutomation/mod.rs +++ b/crates/libs/windows/src/Windows/UI/UIAutomation/mod.rs @@ -48,7 +48,8 @@ impl AutomationConnection { let this = self; unsafe { let mut result__ = core::mem::zeroed(); - _ = (windows_core::Interface::vtable(this).IsRemoteSystem)(windows_core::Interface::as_raw(this), &mut result__); + let hresult__ = (windows_core::Interface::vtable(this).IsRemoteSystem)(windows_core::Interface::as_raw(this), &mut result__); + debug_assert!(hresult__.0 == 0); result__ } } @@ -113,7 +114,8 @@ impl AutomationElement { let this = self; unsafe { let mut result__ = core::mem::zeroed(); - _ = (windows_core::Interface::vtable(this).IsRemoteSystem)(windows_core::Interface::as_raw(this), &mut result__); + let hresult__ = (windows_core::Interface::vtable(this).IsRemoteSystem)(windows_core::Interface::as_raw(this), &mut result__); + debug_assert!(hresult__.0 == 0); result__ } }