Where can I find a list of all windows error codes?

user98188 picture user98188 · Jul 4, 2009 · Viewed 12.6k times · Source

In a previous question, I asked what it meant when my program returned an obscure value like

-1073741819

Well, now I'm getting another large return value,

-1073740777

And I would like to know if there is some list of all of these values and what they mean sopmewhere?

Answer

Jared Oberhaus picture Jared Oberhaus · Jul 4, 2009

Because the Windows error code system is extensible, there is no single place to look up all possible Windows error codes. However, you can start with:

  • Study the Structure of COM Error Codes. Sometimes knowing what facility an error comes from can help you discover what header file it comes from.
  • Visual Studio, since at least 2003, includes an ERRLOOK tool. Try that first if you're using Visual Studio.
  • Many of the codes you'll encounter are in Winerror.h. I've included a link to MSDN that contains the contents of that header file. Or you can look at the error code listing by number on this page.
  • Ideally you know what function returned the code, and then you can lookup the function on MSDN and look at all the possible return values. Of course, you'll need to refer to Winerror.h, or an another header file to get the actual values.
  • You can find (like Unix grep) in the Include directory of the platform SDK for either the hex value of the entire error code, or the decimal value of just the code section--that is, the lower 16 bits. Use HRESULT_CODE to extract that. See the Structure of COM Error Codes above.
  • There are a few error lookup tools where you can paste in a value and it looks it up in its database and tells you what it means. Look here and here.
  • Google. Use the full hex value. Sometimes you'll find very useful information, or at least clues.