[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.
This commit is contained in:
Serge Gautherie 2023-12-17 22:13:45 +01:00 committed by GitHub
parent 91d291f766
commit bf7e7c2383
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 11 deletions

View file

@ -1,8 +1,5 @@
#include <win32k.h> #include <win32k.h>
#define NDEBUG
#include <debug.h>
/* /*
* @implemented * @implemented
* http://msdn.microsoft.com/en-us/library/ff564940%28VS.85%29.aspx * http://msdn.microsoft.com/en-us/library/ff564940%28VS.85%29.aspx
@ -12,10 +9,7 @@ APIENTRY
EngGetLastError(VOID) EngGetLastError(VOID)
{ {
PTEB pTeb = NtCurrentTeb(); PTEB pTeb = NtCurrentTeb();
if (pTeb) return (pTeb ? pTeb->LastErrorValue : ERROR_SUCCESS);
return NtCurrentTeb()->LastErrorValue;
else
return ERROR_SUCCESS;
} }
/* /*
@ -34,7 +28,7 @@ EngSetLastError(_In_ ULONG iError)
VOID VOID
FASTCALL FASTCALL
SetLastNtError(NTSTATUS Status) SetLastNtError(_In_ NTSTATUS Status)
{ {
EngSetLastError(RtlNtStatusToDosError(Status)); EngSetLastError(RtlNtStatusToDosError(Status));
} }

View file

@ -60,9 +60,9 @@ DWORD
NTAPI NTAPI
RegGetSectionDWORD(LPCWSTR pszSection, LPWSTR pszValue, DWORD dwDefault); RegGetSectionDWORD(LPCWSTR pszSection, LPWSTR pszValue, DWORD dwDefault);
VOID FASTCALL VOID
SetLastNtError( FASTCALL
NTSTATUS Status); SetLastNtError(_In_ NTSTATUS Status);
typedef struct _GDI_POOL *PGDI_POOL; typedef struct _GDI_POOL *PGDI_POOL;