Error codes are unsigned 32-bit values which are private to each
calling thread. Most methods will set the last error code value when
they fail; a few methods set it when they succeed. Failure
is typically indicated by a return value such as FALSE, NULL,
INVALID_QUEUE or HTTP_ERROR. Those methods which call
SetLastError when they succeed are noted on the method
reference page.
Applications can retrieve the value saved by this method by calling
the GetLastError method. The use of GetLastError is
optional; an application can use the method to determine the
specific reason for a failure.