Author: sginsberg
Date: Thu Sep 25 13:15:35 2008
New Revision: 36515
URL:
http://svn.reactos.org/svn/reactos?rev=36515&view=rev
Log:
- Implement EngSet/GetLastError
Modified:
branches/nwin32/subsystems/win32/win32k/eng/engerror.c
Modified: branches/nwin32/subsystems/win32/win32k/eng/engerror.c
URL:
http://svn.reactos.org/svn/reactos/branches/nwin32/subsystems/win32/win32k/…
==============================================================================
--- branches/nwin32/subsystems/win32/win32k/eng/engerror.c [iso-8859-1] (original)
+++ branches/nwin32/subsystems/win32/win32k/eng/engerror.c [iso-8859-1] Thu Sep 25
13:15:35 2008
@@ -27,13 +27,39 @@
APIENTRY
EngSetLastError(IN ULONG iError)
{
- UNIMPLEMENTED;
+ PTEB Teb;
+
+ /* Get the TEB */
+ Teb = PsGetThreadTeb(PsGetCurrentThread());
+
+ /* Check if we have one */
+ if (Teb)
+ {
+ /* Set the error */
+ Teb->LastErrorValue = iError;
+ }
}
ULONG
APIENTRY
EngGetLastError(VOID)
{
- UNIMPLEMENTED;
- return 0;
+ PTEB Teb;
+ ULONG iError;
+
+ /* Assume success */
+ iError = NO_ERROR;
+
+ /* Get the TEB */
+ Teb = PsGetThreadTeb(PsGetCurrentThread());
+
+ /* Check if we have one */
+ if (Teb)
+ {
+ /* Get the error */
+ iError = Teb->LastErrorValue;
+ }
+
+ /* Return the error */
+ return iError;
}