- Implement RtlGetLastNtStatus, RtlGetLastWin32Error, RtlRestoreLastWin32Error, RtlSetLastWin32Error and RtlSetLastWin32ErrorAndNtStatusFromNtStatus.
Modified: trunk/reactos/include/ntos/rtl.h
Modified: trunk/reactos/lib/ntdll/def/ntdll.def
Modified: trunk/reactos/lib/rtl/error.c

Modified: trunk/reactos/include/ntos/rtl.h
--- trunk/reactos/include/ntos/rtl.h	2005-02-12 11:47:03 UTC (rev 13502)
+++ trunk/reactos/include/ntos/rtl.h	2005-02-12 12:42:10 UTC (rev 13503)
@@ -1320,6 +1320,12 @@
 			       PBOOLEAN GroupDefaulted);
 
 NTSTATUS STDCALL
+RtlGetLastNtStatus(VOID);
+
+ULONG STDCALL
+RtlGetLastWin32Error(VOID);
+
+NTSTATUS STDCALL
 RtlGetNextRange (IN OUT PRTL_RANGE_LIST_ITERATOR Iterator,
 		 OUT PRTL_RANGE *Range,
 		 IN BOOLEAN MoveForwards);
@@ -2218,6 +2224,9 @@
 VOID STDCALL
 RtlResetRtlTranslations (IN PNLSTABLEINFO NlsTable);
 
+VOID STDCALL
+RtlRestoreLastWin32Error(IN ULONG Error);
+
 /*
  * VOID
  * RtlRetrieveUlong (
@@ -2287,6 +2296,11 @@
 VOID STDCALL
 RtlSetAllBits (IN PRTL_BITMAP BitMapHeader);
 
+NTSTATUS STDCALL
+RtlSetAttributesSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
+				   IN SECURITY_DESCRIPTOR_CONTROL Control,
+				   OUT PULONG Revision);
+
 VOID
 STDCALL
 RtlSetBit (
@@ -2319,6 +2333,18 @@
 			       BOOLEAN GroupDefaulted);
 
 NTSTATUS STDCALL
+RtlSetInformationAcl (PACL Acl,
+		      PVOID Information,
+		      ULONG InformationLength,
+		      ACL_INFORMATION_CLASS InformationClass);
+
+VOID STDCALL
+RtlSetLastWin32Error(IN ULONG Error);
+
+VOID STDCALL
+RtlSetLastWin32ErrorAndNtStatusFromNtStatus(IN NTSTATUS Status);
+
+NTSTATUS STDCALL
 RtlSetOwnerSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor,
 			       PSID Owner,
 			       BOOLEAN OwnerDefaulted);
@@ -2334,12 +2360,6 @@
 				  PUCHAR RMControl);
 
 NTSTATUS STDCALL
-RtlSetInformationAcl (PACL Acl,
-		      PVOID Information,
-		      ULONG InformationLength,
-		      ACL_INFORMATION_CLASS InformationClass);
-
-NTSTATUS STDCALL
 RtlSetTimeZoneInformation (IN OUT PTIME_ZONE_INFORMATION TimeZoneInformation);
 
 ULONG STDCALL

Modified: trunk/reactos/lib/ntdll/def/ntdll.def
--- trunk/reactos/lib/ntdll/def/ntdll.def	2005-02-12 11:47:03 UTC (rev 13502)
+++ trunk/reactos/lib/ntdll/def/ntdll.def	2005-02-12 12:42:10 UTC (rev 13503)
@@ -453,6 +453,8 @@
 RtlGetFirstRange@12
 RtlGetFullPathName_U@16
 RtlGetGroupSecurityDescriptor@12
+RtlGetLastNtStatus@0
+RtlGetLastWin32Error@0
 RtlGetLongestNtPathLength@0
 RtlGetNextRange@12
 RtlGetNtGlobalFlags@0
@@ -577,6 +579,7 @@
 RtlReleaseResource@4
 ;RtlRemoteCall
 RtlResetRtlTranslations@4
+RtlRestoreLastWin32Error@4=RtlSetLastWin32Error@4
 RtlRunDecodeUnicodeString@8
 RtlRunEncodeUnicodeString@8
 RtlSecondsSince1970ToTime@8
@@ -593,6 +596,8 @@
 RtlSetEnvironmentVariable@12
 RtlSetGroupSecurityDescriptor@12
 RtlSetInformationAcl@16
+RtlSetLastWin32Error@4
+RtlSetLastWin32ErrorAndNtStatusFromNtStatus@4
 RtlSetOwnerSecurityDescriptor@12
 RtlSetSaclSecurityDescriptor@16
 RtlSetSecurityDescriptorRMControl@8

Modified: trunk/reactos/lib/rtl/error.c
--- trunk/reactos/lib/rtl/error.c	2005-02-12 11:47:03 UTC (rev 13502)
+++ trunk/reactos/lib/rtl/error.c	2005-02-12 12:42:10 UTC (rev 13503)
@@ -991,4 +991,44 @@
    return -1; /* generic POSIX error */
 }
 
+
+/*
+ * @implemented
+ */
+NTSTATUS STDCALL
+RtlGetLastNtStatus(VOID)
+{
+  return NtCurrentTeb()->LastStatusValue;
+}
+
+
+/*
+ * @implemented
+ */
+ULONG STDCALL
+RtlGetLastWin32Error(VOID)
+{
+  return NtCurrentTeb()->LastErrorValue;
+}
+
+
+/*
+ * @implemented
+ */
+VOID STDCALL
+RtlSetLastWin32Error(IN ULONG Error)
+{
+  NtCurrentTeb()->LastErrorValue = Error;
+}
+
+
+/*
+ * @implemented
+ */
+VOID STDCALL
+RtlSetLastWin32ErrorAndNtStatusFromNtStatus(IN NTSTATUS Status)
+{
+  NtCurrentTeb()->LastErrorValue = RtlNtStatusToDosError(Status);
+}
+
 /* EOF */