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 * Win: UserSetLastError 25 */ 26 VOID 27 APIENTRY 28 EngSetLastError(_In_ ULONG iError) 29 { 30 PTEB pTeb = NtCurrentTeb(); 31 if (pTeb) 32 pTeb->LastErrorValue = iError; 33 } 34 35 VOID 36 FASTCALL 37 SetLastNtError(NTSTATUS Status) 38 { 39 EngSetLastError(RtlNtStatusToDosError(Status)); 40 } 41