1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4 // All files in the project carrying such notice may not be copied, modified, or distributed
5 // except according to those terms.
6 //! ApiSet Contract for api-ms-win-core-errorhandling-l1
7 use shared
::basetsd
::ULONG_PTR
;
8 use shared
::minwindef
::{BOOL, DWORD, LPDWORD, UINT, ULONG}
;
10 EXCEPTION_POINTERS
, LONG
, LPCSTR
, LPCWSTR
, PCONTEXT
, PEXCEPTION_RECORD
,
11 PVECTORED_EXCEPTION_HANDLER
, PVOID
,
13 FN
!{stdcall
PTOP_LEVEL_EXCEPTION_FILTER(
14 ExceptionInfo
: *mut EXCEPTION_POINTERS
,
16 pub type LPTOP_LEVEL_EXCEPTION_FILTER
= PTOP_LEVEL_EXCEPTION_FILTER
;
18 pub fn RaiseException(
19 dwExceptionCode
: DWORD
,
20 dwExceptionFlags
: DWORD
,
21 nNumberOfArguments
: DWORD
,
22 lpArguments
: *const ULONG_PTR
,
24 pub fn UnhandledExceptionFilter(
25 ExceptionInfo
: *mut EXCEPTION_POINTERS
,
27 pub fn SetUnhandledExceptionFilter(
28 lpTopLevelExceptionFilter
: LPTOP_LEVEL_EXCEPTION_FILTER
,
29 ) -> LPTOP_LEVEL_EXCEPTION_FILTER
;
30 pub fn GetLastError() -> DWORD
;
34 pub fn GetErrorMode() -> UINT
;
38 pub fn AddVectoredExceptionHandler(
40 Handler
: PVECTORED_EXCEPTION_HANDLER
,
42 pub fn RemoveVectoredExceptionHandler(
45 pub fn AddVectoredContinueHandler(
47 Handler
: PVECTORED_EXCEPTION_HANDLER
,
49 pub fn RemoveVectoredContinueHandler(
55 pub fn RaiseFailFastException(
56 pExceptionRecord
: PEXCEPTION_RECORD
,
57 pContextRecord
: PCONTEXT
,
62 lpMessageText
: LPCSTR
,
66 lpMessageText
: LPCWSTR
,
68 pub fn GetThreadErrorMode() -> DWORD
;
69 pub fn SetThreadErrorMode(
74 // What library provides this function?
75 // TerminateProcessOnMemoryExhaustion