Link: MS-ERREF

This is a PDF running to 528 pages. Page 6 describes how the error codes are devised.

Page 9 onwards describes what error codes mean.

This documentation is covered by Microsoft copyrights.