The EngSetLastError function causes GDI to report an error code, which can be retrieved by an application.
VOID
EngSetLastError(
IN ULONG iError
);
None
Declared in winddi.h. Include winddi.h.
EngSetLastError sets the last error code for the calling thread. This function allows a driver to communicate error conditions to an application. To facilitate this communication, a driver should use the Win32 application error codes defined in winerror.h.
Only the last error code to be set is retrievable; that is, consecutive calls to EngSetLastError will cause the last-error code field to be overwritten.