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