Split kernel32 into separate files (part 2)

This commit is contained in:
2025-10-02 00:20:28 -06:00
parent 9ea5b24b67
commit fa3ed4893a
53 changed files with 7352 additions and 6134 deletions

View File

@@ -0,0 +1,44 @@
#pragma once
#include "common.h"
constexpr DWORD EXCEPTION_MAXIMUM_PARAMETERS = 15;
struct EXCEPTION_RECORD {
DWORD ExceptionCode;
DWORD ExceptionFlags;
EXCEPTION_RECORD *ExceptionRecord;
PVOID ExceptionAddress;
DWORD NumberParameters;
ULONG_PTR ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
};
using PEXCEPTION_RECORD = EXCEPTION_RECORD *;
using PCONTEXT = void *;
struct EXCEPTION_POINTERS {
PEXCEPTION_RECORD ExceptionRecord;
PCONTEXT ContextRecord;
};
using PEXCEPTION_POINTERS = EXCEPTION_POINTERS *;
using PVECTORED_EXCEPTION_HANDLER = LONG(WIN_FUNC *)(PEXCEPTION_POINTERS ExceptionInfo);
using LPTOP_LEVEL_EXCEPTION_FILTER = LONG(WIN_FUNC *)(PEXCEPTION_POINTERS ExceptionInfo);
constexpr LONG EXCEPTION_CONTINUE_EXECUTION = static_cast<LONG>(-1);
constexpr LONG EXCEPTION_CONTINUE_SEARCH = 0;
constexpr LONG EXCEPTION_EXECUTE_HANDLER = 1;
namespace kernel32 {
DWORD WIN_FUNC GetLastError();
void WIN_FUNC SetLastError(DWORD dwErrCode);
void WIN_FUNC RaiseException(DWORD dwExceptionCode, DWORD dwExceptionFlags, DWORD nNumberOfArguments,
const ULONG_PTR *lpArguments);
PVOID WIN_FUNC AddVectoredExceptionHandler(ULONG First, PVECTORED_EXCEPTION_HANDLER Handler);
LPTOP_LEVEL_EXCEPTION_FILTER WIN_FUNC
SetUnhandledExceptionFilter(LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter);
LONG WIN_FUNC UnhandledExceptionFilter(PEXCEPTION_POINTERS ExceptionInfo);
UINT WIN_FUNC SetErrorMode(UINT uMode);
} // namespace kernel32