https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bf7e7c2383b8ef43c1752…
commit bf7e7c2383b8ef43c1752df4e0d40ccfc19aa36e
Author: Serge Gautherie <32623169+SergeGautherie(a)users.noreply.github.com>
AuthorDate: Sun Dec 17 22:13:45 2023 +0100
Commit: GitHub <noreply(a)github.com>
CommitDate: Sun Dec 17 22:13:45 2023 +0100
[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.
---
win32ss/gdi/eng/error.c | 10 ++--------
win32ss/gdi/ntgdi/misc.h | 6 +++---
2 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/win32ss/gdi/eng/error.c b/win32ss/gdi/eng/error.c
index 380869bfd6e..b276d3aad25 100644
--- a/win32ss/gdi/eng/error.c
+++ b/win32ss/gdi/eng/error.c
@@ -1,8 +1,5 @@
#include <win32k.h>
-#define NDEBUG
-#include <debug.h>
-
/*
* @implemented
*
http://msdn.microsoft.com/en-us/library/ff564940%28VS.85%29.aspx
@@ -12,10 +9,7 @@ APIENTRY
EngGetLastError(VOID)
{
PTEB pTeb = NtCurrentTeb();
- if (pTeb)
- return NtCurrentTeb()->LastErrorValue;
- else
- return ERROR_SUCCESS;
+ return (pTeb ? pTeb->LastErrorValue : ERROR_SUCCESS);
}
/*
@@ -34,7 +28,7 @@ EngSetLastError(_In_ ULONG iError)
VOID
FASTCALL
-SetLastNtError(NTSTATUS Status)
+SetLastNtError(_In_ NTSTATUS Status)
{
EngSetLastError(RtlNtStatusToDosError(Status));
}
diff --git a/win32ss/gdi/ntgdi/misc.h b/win32ss/gdi/ntgdi/misc.h
index 06fa17b8255..6b0e2f022b0 100644
--- a/win32ss/gdi/ntgdi/misc.h
+++ b/win32ss/gdi/ntgdi/misc.h
@@ -60,9 +60,9 @@ DWORD
NTAPI
RegGetSectionDWORD(LPCWSTR pszSection, LPWSTR pszValue, DWORD dwDefault);
-VOID FASTCALL
-SetLastNtError(
- NTSTATUS Status);
+VOID
+FASTCALL
+SetLastNtError(_In_ NTSTATUS Status);
typedef struct _GDI_POOL *PGDI_POOL;