Winapi 从ExceptionCode获取描述

Winapi 从ExceptionCode获取描述,winapi,seh,Winapi,Seh,是否有用于将ExceptionRecord中的ExceptionCode:s转换为可读消息(如FormatMessage)的API,以用于常规错误。没有用于此的内置函数 很多人都是手工操作的: fostlib::exceptions::structured::structuredin: MyUnHandledExceptionFilterin: GetExceptionStringin: 是,FormatMessage()。但是,异常代码通常是本机操作系统错误代码,而不是winapi错误代码

是否有用于将ExceptionRecord中的ExceptionCode:s转换为可读消息(如FormatMessage)的API,以用于常规错误。

没有用于此的内置函数

很多人都是手工操作的:

fostlib::exceptions::structured::structured
in:

MyUnHandledExceptionFilter
in:

GetExceptionString
in:

是,FormatMessage()。但是,异常代码通常是本机操作系统错误代码,而不是winapi错误代码。因此,您需要格式化来自模块的消息,并传递从GetModuleHandle(L“ntdll.dll”)获得的模块句柄。但是,所需的格式消息忽略插入选项很麻烦。或者生成一些代码/bin/sh echo“const size_t N_MESSAGES=$(grep'STATUS_u''D:\bin-win64\mingw64\x86\u 64-w64-mingw32\include\winnt.h'| wc-l);“>>seh.stub echo”ExceptionName ExceptionName ExceptionName[]=“>>seh.stub echo”{>>seh.stub grep“STATUS”\ud:\bin-win64\mingw64\x86\u 64-w64-w64-mingw32\include\winnt\t.h”\\\ sed.*t's/\define(\STR.\DWORD.*1){,/g'| sort>>seh.stub echo“};”>>seh.stub