reactos/win32ss/gdi/eng/error.c
Serge Gautherie bf7e7c2383
[WIN32SS:GDI] eng/error.c: Minor code tweaks (#6128)
- Remove a useless debug.h include.
- Use the initialized pTeb pointer.
- Remove a useless else.
- Add a SAL2 annotation.
2023-12-17 22:13:45 +01:00

35 lines
606 B
C

#include <win32k.h>
/*
* @implemented
* http://msdn.microsoft.com/en-us/library/ff564940%28VS.85%29.aspx
*/
ULONG
APIENTRY
EngGetLastError(VOID)
{
PTEB pTeb = NtCurrentTeb();
return (pTeb ? pTeb->LastErrorValue : ERROR_SUCCESS);
}
/*
* @implemented
* http://msdn.microsoft.com/en-us/library/ff565015%28VS.85%29.aspx
* Win: UserSetLastError
*/
VOID
APIENTRY
EngSetLastError(_In_ ULONG iError)
{
PTEB pTeb = NtCurrentTeb();
if (pTeb)
pTeb->LastErrorValue = iError;
}
VOID
FASTCALL
SetLastNtError(_In_ NTSTATUS Status)
{
EngSetLastError(RtlNtStatusToDosError(Status));
}