#ifdef _MSC_VER
#pragma once
#endif // _MSC_VER
#ifndef _ERRHANDLING_H_
#define _ERRHANDLING_H_
#include <apiset.h>
#include <apisetcconv.h>
#include <minwindef.h>
#ifdef __cplusplus
extern
"C"
{
#endif
#pragma region Application Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
typedef LONG (WINAPI *PTOP_LEVEL_EXCEPTION_FILTER)(
typedef
(
__stdcall
*
PTOP_LEVEL_EXCEPTION_FILTER
)(
_In_ struct _EXCEPTION_POINTERS *ExceptionInfo
);
typedef
PTOP_LEVEL_EXCEPTION_FILTER
LPTOP_LEVEL_EXCEPTION_FILTER
;
__analysis_noreturn
(
_In_ DWORD dwExceptionCode,
_In_ DWORD dwExceptionFlags,
_In_ DWORD nNumberOfArguments,
_In_reads_opt_(nNumberOfArguments) CONST ULONG_PTR* lpArguments
);
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#pragma region Desktop Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
__callback
(
_In_ struct _EXCEPTION_POINTERS* ExceptionInfo
);
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#pragma region Application Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
LPTOP_LEVEL_EXCEPTION_FILTER
SetUnhandledExceptionFilter
(
_In_opt_ LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter
LPTOP_LEVEL_EXCEPTION_FILTER
lpTopLevelExceptionFilter
);
#ifndef _M_CEE_PURE
_Check_return_
_Post_equals_last_error_
(
);
#endif
(
);
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#pragma region Desktop Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#if (_WIN32_WINNT >= 0x0600)
(
);
#endif // (_WIN32_WINNT >= 0x0600)
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#pragma region Application Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
(
);
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#pragma region Desktop Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#if (_WIN32_WINNT >= 0x0501)
_Ret_maybenull_
AddVectoredExceptionHandler
(
_In_ PVECTORED_EXCEPTION_HANDLER Handler
PVECTORED_EXCEPTION_HANDLER
);
RemoveVectoredExceptionHandler
(
);
_Ret_maybenull_
AddVectoredContinueHandler
(
_In_ PVECTORED_EXCEPTION_HANDLER Handler
PVECTORED_EXCEPTION_HANDLER
);
RemoveVectoredContinueHandler
(
);
#endif // (_WIN32_WINNT >= 0x0501)
#if !defined(RC_INVOKED)
#if defined(WINBASE_DECLARE_RESTORE_LAST_ERROR)
WINBASEAPI
VOID
WINAPI
RestoreLastError(
_In_ DWORD dwErrCode
);
typedef VOID (WINAPI* PRESTORE_LAST_ERROR)(DWORD);
#define RESTORE_LAST_ERROR_NAME_A "RestoreLastError"
#define RESTORE_LAST_ERROR_NAME_W L"RestoreLastError"
#define RESTORE_LAST_ERROR_NAME TEXT("RestoreLastError")
#endif
#endif
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#pragma region Application Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
(
_In_opt_ PEXCEPTION_RECORD pExceptionRecord,
_In_opt_ PCONTEXT pContextRecord,
);
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#pragma region Desktop Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
(
_In_ LPCSTR lpMessageText
);
(
_In_ LPCWSTR lpMessageText
);
#ifdef UNICODE
#define FatalAppExit FatalAppExitW
#else
#define FatalAppExit FatalAppExitA
#endif // !UNICODE
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
#pragma region Application Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
(
);
(
_In_opt_ LPDWORD lpOldMode
);
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
#pragma region Desktop Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
TerminateProcessOnMemoryExhaustion
(
_In_ SIZE_T FailedAllocationSize
);
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
#ifdef __cplusplus
}
#endif
#endif // _ERRHANDLING_H_