It seems that certain API-specific calls set the error returned by GetLastError()
. For example, wglCreateContextAttribsARB(...)
can return (information from the specification):
ERROR_INVALID_VERSION_ARB == 0x2095
ERROR_INVALID_PROFILE_ARB == 0x2096
When debugging, however, I get different results. For example, trying to use wglCreateContextAttribsARB(...)
to set up a GL 4.5 context (which my GPU doesn't support) results in an error value of 0xC0072095
. The lower 16 bits match the invalid version error (which makes sense because it is a version issue), but the upper 16 bits don't make sense to me.
I skimmed the GetLastError documentation, which said that bit 29 should be set for application error codes. However, I couldn't find any justification as to why the other bits would be set, and in any case this conflicts with the ARB specification saying that such-and-such a value is returned.
What's going on?