From 1b6a04ca5504955c571d1c97504fb45ea0befee4 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Mon, 8 Jan 2024 01:21:28 +0400 Subject: Initial vendor packages Signed-off-by: Valentin Popov --- vendor/winapi/src/winrt/roerrorapi.rs | 103 ++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 vendor/winapi/src/winrt/roerrorapi.rs (limited to 'vendor/winapi/src/winrt/roerrorapi.rs') diff --git a/vendor/winapi/src/winrt/roerrorapi.rs b/vendor/winapi/src/winrt/roerrorapi.rs new file mode 100644 index 0000000..aa9f683 --- /dev/null +++ b/vendor/winapi/src/winrt/roerrorapi.rs @@ -0,0 +1,103 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::{UINT32, UINT_PTR}; +use shared::minwindef::{BOOL, BYTE, UINT, USHORT}; +use um::restrictederrorinfo::IRestrictedErrorInfo; +use um::unknwnbase::IUnknown; +use um::winnt::{HRESULT, PCWSTR, PVOID, VOID}; +use winrt::hstring::HSTRING; +ENUM!{enum RO_ERROR_REPORTING_FLAGS { + RO_ERROR_REPORTING_NONE = 0x00000000, + RO_ERROR_REPORTING_SUPPRESSEXCEPTIONS = 0x00000001, + RO_ERROR_REPORTING_FORCEEXCEPTIONS = 0x00000002, + RO_ERROR_REPORTING_USESETERRORINFO = 0x00000004, + RO_ERROR_REPORTING_SUPPRESSSETERRORINFO = 0x00000008, +}} +extern "system" { + pub fn RoGetErrorReportingFlags( + pflags: *mut UINT32, + ) -> HRESULT; + pub fn RoSetErrorReportingFlags( + flags: UINT32, + ) -> HRESULT; + pub fn RoResolveRestrictedErrorInfoReference( + reference: PCWSTR, + ppRestrictedErrorInfo: *mut *mut IRestrictedErrorInfo , + ) -> HRESULT; + pub fn SetRestrictedErrorInfo( + pRestrictedErrorInfo: *const IRestrictedErrorInfo, + ) -> HRESULT; + pub fn GetRestrictedErrorInfo( + ppRestrictedErrorInfo: *mut *mut IRestrictedErrorInfo, + ) -> HRESULT; + pub fn RoOriginateErrorW( + error: HRESULT, + cchMax: UINT, + message: PCWSTR, + ) -> BOOL; + pub fn RoOriginateError( + error: HRESULT, + message: HSTRING, + ) -> BOOL; + pub fn RoTransformErrorW( + oldError: HRESULT, + newError: HRESULT, + cchMax: UINT, + message: PCWSTR, + ) -> BOOL; + pub fn RoTransformError( + oldError: HRESULT, + newError: HRESULT, + message: HSTRING, + ) -> BOOL; + pub fn RoCaptureErrorContext( + hr: HRESULT, + ) -> HRESULT; + pub fn RoFailFastWithErrorContext( + hrError: HRESULT, + ); + pub fn RoOriginateLanguageException( + error: HRESULT, + message: HSTRING, + languageException: *const IUnknown, + ) -> BOOL; + pub fn RoClearError(); + pub fn RoReportUnhandledError( + pRestrictedErrorInfo: *const IRestrictedErrorInfo, + ) -> HRESULT; +} +FN!{stdcall PINSPECT_MEMORY_CALLBACK( + *const VOID, + UINT_PTR, + UINT32, + *mut BYTE, +) -> HRESULT} +extern "system" { + pub fn RoInspectThreadErrorInfo( + targetTebAddress: UINT_PTR, + machine: USHORT, + readMemoryCallback: PINSPECT_MEMORY_CALLBACK, + context: PVOID, + targetErrorInfoAddress: *mut UINT_PTR, + ) -> HRESULT; + pub fn RoInspectCapturedStackBackTrace( + targetErrorInfoAddress: UINT_PTR, + machine: USHORT, + readMemoryCallback: PINSPECT_MEMORY_CALLBACK, + context: PVOID, + frameCount: *mut UINT32, + targetBackTraceAddress: *mut UINT_PTR, + ) -> HRESULT; + pub fn RoGetMatchingRestrictedErrorInfo( + hrIn: HRESULT, + ppRestrictedErrorInfo: *mut *mut IRestrictedErrorInfo, + ) -> HRESULT; + pub fn RoReportFailedDelegate( + punkDelegate: *const IUnknown, + pRestrictedErrorInfo: *const IRestrictedErrorInfo, + ) -> HRESULT; + pub fn IsErrorPropagationEnabled() -> BOOL; +} -- cgit v1.2.3