Tag Archives: hresult

New HRESULT Error Code List

Frustrated by the lack of a simple resource on the Internet that associates HRESULT values with symbols and descriptions, I’ve created my own. This new list of HRESULT codes should hopefully help anyone programming on Windows systems (or even just having to interface with them).

For those who don’t know, HRESULTs are basically error codes that are used by some software systems. These are the kind of codes that you’ll occasionally see in cryptic error messages, such as ‘Operation failed, error code 0x80001234’.

There are a couple of minor issues to sort out, but the first generated list can be access from http://codeswamp.tolon.co.uk.

HRESULT Lookup Utility

When dealing with software on Windows we are often confronted with HRESULT error codes, presented either as hexadecimal (e.g. 0x80070057) or as a negative decimal number (-2147024809). To understand what the error code means we look it up, usually in the ‘Error Lookup’ utility that comes with Visual Studio, but this has significant limitations.

Presenting the ‘Error Lookup’ with a a hex HRESULT code will show us the error message, but it does not show us the symbol as it is defined in the Platform SDK (usually winerror.h). So for 0x80070057, it will tell us that the message is ‘The parameter is incorrect’, but it will not tell us the original symbol (E_INVALIDARG).

Another limitation is that we cannot look up a HRESULT symbol to obtain the error code value (and message).

This is where my new utility will help.

hrlookup has been written to provide more information about HRESULT error codes and symbols so that we will no longer need to search online for well-known values just to find the symbol name.

Only a command-line version is available just now, but I’m planning to create a user interface soon.

Download hrlookup from here