1/**
2 * This file is part of the mingw-w64 runtime package.
3 * No warranty is given; refer to the file DISCLAIMER within this package.
4 */
5#ifndef _ERRHANDLING_H_
6#define _ERRHANDLING_H_
7
8#include <apiset.h>
9#include <apisetcconv.h>
10#include <minwindef.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
17  typedef LONG (WINAPI *PTOP_LEVEL_EXCEPTION_FILTER) (struct _EXCEPTION_POINTERS *ExceptionInfo);
18  typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER;
19
20  WINBASEAPI LONG WINAPI UnhandledExceptionFilter (struct _EXCEPTION_POINTERS *ExceptionInfo);
21  WINBASEAPI LPTOP_LEVEL_EXCEPTION_FILTER WINAPI SetUnhandledExceptionFilter (LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter);
22  WINBASEAPI UINT WINAPI SetErrorMode (UINT uMode);
23  WINBASEAPI PVOID WINAPI AddVectoredExceptionHandler (ULONG First, PVECTORED_EXCEPTION_HANDLER Handler);
24  WINBASEAPI ULONG WINAPI RemoveVectoredExceptionHandler (PVOID Handle);
25  WINBASEAPI PVOID WINAPI AddVectoredContinueHandler (ULONG First, PVECTORED_EXCEPTION_HANDLER Handler);
26  WINBASEAPI ULONG WINAPI RemoveVectoredContinueHandler (PVOID Handle);
27#if _WIN32_WINNT >= 0x0600
28  WINBASEAPI UINT WINAPI GetErrorMode (VOID);
29#endif
30
31#if !defined (RC_INVOKED) && defined (WINBASE_DECLARE_RESTORE_LAST_ERROR)
32  WINBASEAPI VOID WINAPI RestoreLastError (DWORD dwErrCode);
33
34  typedef VOID (WINAPI *PRESTORE_LAST_ERROR) (DWORD);
35
36#define RESTORE_LAST_ERROR_NAME_A "RestoreLastError"
37#define RESTORE_LAST_ERROR_NAME_W L"RestoreLastError"
38#define RESTORE_LAST_ERROR_NAME TEXT ("RestoreLastError")
39#endif
40
41#endif
42
43#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
44  WINBASEAPI VOID WINAPI RaiseException (DWORD dwExceptionCode, DWORD dwExceptionFlags, DWORD nNumberOfArguments, CONST ULONG_PTR *lpArguments);
45  WINBASEAPI DWORD WINAPI GetLastError (VOID);
46  WINBASEAPI VOID WINAPI SetLastError (DWORD dwErrCode);
47#endif
48
49#ifdef __cplusplus
50}
51#endif
52#endif
53