1 #include <win32k.h> 2 3 #define NDEBUG 4 #include <debug.h> 5 6 /* 7 * @implemented 8 * http://msdn.microsoft.com/en-us/library/ff564940%28VS.85%29.aspx 9 */ 10 ULONG 11 APIENTRY 12 EngGetLastError(VOID) 13 { 14 PTEB pTeb = NtCurrentTeb(); 15 if (pTeb) 16 return NtCurrentTeb()->LastErrorValue; 17 else 18 return ERROR_SUCCESS; 19 } 20 21 /* 22 * @implemented 23 * http://msdn.microsoft.com/en-us/library/ff565015%28VS.85%29.aspx 24 */ 25 VOID 26 APIENTRY 27 EngSetLastError(_In_ ULONG iError) 28 { 29 PTEB pTeb = NtCurrentTeb(); 30 if (pTeb) 31 pTeb->LastErrorValue = iError; 32 } 33 34 VOID 35 FASTCALL 36 SetLastNtError(NTSTATUS Status) 37 { 38 EngSetLastError(RtlNtStatusToDosError(Status)); 39 } 40