Skip to main content

winwrap/raw/um/
errhandlingapi.rs

1use crate::*;
2use winapi::shared::basetsd::ULONG_PTR;
3use winapi::shared::minwindef::{DWORD, UINT, LPDWORD};
4use winapi::shared::ntdef::{LONG, ULONG, PVOID, NULL, LPCSTR, LPCWSTR};
5use winapi::um::errhandlingapi::LPTOP_LEVEL_EXCEPTION_FILTER;
6use winapi::um::winnt::{EXCEPTION_POINTERS, PVECTORED_EXCEPTION_HANDLER, PEXCEPTION_RECORD, PCONTEXT};
7
8tp_func! {winapi::um::errhandlingapi,
9pub unsafe fn RaiseException(
10    dwExceptionCode: DWORD,
11    dwExceptionFlags: DWORD,
12    nNumberOfArguments: DWORD,
13    lpArguments: *const ULONG_PTR,
14);}
15
16tp_func! {winapi::um::errhandlingapi,
17pub unsafe fn UnhandledExceptionFilter(
18    ExceptionInfo: *mut EXCEPTION_POINTERS,
19) -> LONG;}
20
21tp_func! {winapi::um::errhandlingapi,
22pub unsafe fn SetUnhandledExceptionFilter(
23    lpTopLevelExceptionFilter: LPTOP_LEVEL_EXCEPTION_FILTER,
24) -> LPTOP_LEVEL_EXCEPTION_FILTER;}
25
26tp_func! {winapi::um::errhandlingapi,
27pub safe fn GetLastError() -> DWORD;}
28
29tp_func! {winapi::um::errhandlingapi,
30pub safe fn SetLastError(
31    dwErrCode: DWORD,
32);}
33
34tp_func! {winapi::um::errhandlingapi,
35pub safe fn GetErrorMode() -> UINT;}
36
37tp_func! {winapi::um::errhandlingapi,
38pub safe fn SetErrorMode(
39    uMode: UINT,
40) -> UINT;}
41
42e_make_func! {winapi::um::errhandlingapi,
43pub fn AddVectoredExceptionHandler(
44    First: ULONG,
45    Handler: PVECTORED_EXCEPTION_HANDLER,
46) -> PVOID;NULL}
47
48e_make_func2! {winapi::um::errhandlingapi,
49pub fn RemoveVectoredExceptionHandler(
50    Handle: PVOID,
51) -> ULONG;0}
52
53e_make_func! {winapi::um::errhandlingapi,
54pub fn AddVectoredContinueHandler(
55    First: ULONG,
56    Handler: PVECTORED_EXCEPTION_HANDLER,
57) -> PVOID;NULL}
58
59e_make_func2! {winapi::um::errhandlingapi,
60pub fn RemoveVectoredContinueHandler(
61    Handle: PVOID,
62) -> ULONG;0}
63
64tp_func! {winapi::um::errhandlingapi,
65pub unsafe fn RaiseFailFastException(
66pExceptionRecord: PEXCEPTION_RECORD,
67pContextRecord: PCONTEXT,
68dwFlags: DWORD,
69);}
70
71tp_func! {winapi::um::errhandlingapi,
72pub unsafe fn FatalAppExitA(
73uAction: UINT,
74lpMessageText: LPCSTR,
75);}
76
77tp_func! {winapi::um::errhandlingapi,
78pub unsafe fn FatalAppExitW(
79uAction: UINT,
80lpMessageText: LPCWSTR,
81); }
82
83tp_func! {winapi::um::errhandlingapi,
84pub safe fn GetThreadErrorMode() -> DWORD;}
85
86make_func2! {winapi::um::errhandlingapi,
87pub unsafe fn SetThreadErrorMode(
88dwNewMode: DWORD,
89lpOldMode: LPDWORD,
90) -> BOOL;0
91}