In a program I’m developing I need to gather information about runtime errors. Currently, I am able to gather all the information I need, including the message via FormatMessage, but the identifier of the error (for example, ERROR_SUCCESS). I know that when the application is compiled these identifiers are not actually present in the binaries.
Is there a function in the Windows API which can retrieve these identifiers or do I need to store them with my application?
ERROR_SUCCESSitself is just a constant. I haven’t found a way to go from number -> constant identifier.You could scan
WinError.hwith Clang and create some kind of table for your application.