- Implement RtlGetLastNtStatus, RtlGetLastWin32Error, RtlRestoreLastWin32Error, RtlSe...
[reactos.git] / reactos / include / ntos / rtl.h
index 7b9d12a..6623ea5 100755 (executable)
@@ -1,4 +1,4 @@
-/* $Id: rtl.h,v 1.35 2004/10/22 20:53:11 ekohl Exp $
+/* $Id$
  * 
  */
 #ifndef __DDK_RTL_H
  * ARGUMENTS:
  *         ListHead = Caller supplied storage for the head of the list
  */
-#define InitializeListHead(ListHead) \
-{ \
-       (ListHead)->Flink = (ListHead); \
-       (ListHead)->Blink = (ListHead); \
+static __inline VOID
+InitializeListHead(
+       IN PLIST_ENTRY  ListHead)
+{
+       ListHead->Flink = ListHead->Blink = ListHead;
 }
 
 
  *        ListHead = Head of the list
  *        Entry = Entry to insert
  */
-#define InsertHeadList(ListHead, ListEntry) \
-{ \
-       PLIST_ENTRY OldFlink; \
-       OldFlink = (ListHead)->Flink; \
-       (ListEntry)->Flink = OldFlink; \
-       (ListEntry)->Blink = (ListHead); \
-       OldFlink->Blink = (ListEntry); \
-       (ListHead)->Flink = (ListEntry); \
-       ASSERT((ListEntry) != NULL); \
-       ASSERT((ListEntry)->Blink!=NULL); \
-       ASSERT((ListEntry)->Blink->Flink == (ListEntry)); \
-       ASSERT((ListEntry)->Flink != NULL); \
-       ASSERT((ListEntry)->Flink->Blink == (ListEntry)); \
+static __inline VOID
+InsertHeadList(
+       IN PLIST_ENTRY  ListHead,
+       IN PLIST_ENTRY  Entry)
+{
+       PLIST_ENTRY OldFlink;
+       OldFlink = ListHead->Flink;
+       Entry->Flink = OldFlink;
+       Entry->Blink = ListHead;
+       OldFlink->Blink = Entry;
+       ListHead->Flink = Entry;
 }
 
 
  *     ListHead = Head of the list
  *     Entry = Entry to insert
  */
-#define InsertTailList(ListHead, ListEntry) \
-{ \
-       PLIST_ENTRY OldBlink; \
-       OldBlink = (ListHead)->Blink; \
-       (ListEntry)->Flink = (ListHead); \
-       (ListEntry)->Blink = OldBlink; \
-       OldBlink->Flink = (ListEntry); \
-       (ListHead)->Blink = (ListEntry); \
+static __inline VOID
+InsertTailList(
+       IN PLIST_ENTRY  ListHead,
+       IN PLIST_ENTRY  Entry)
+{
+       PLIST_ENTRY OldBlink;
+       OldBlink = ListHead->Blink;
+       Entry->Flink = ListHead;
+       Entry->Blink = OldBlink;
+       OldBlink->Flink = Entry;
+       ListHead->Blink = Entry;
 }
 
 /*
  * RETURNS:
  *     The removed entry
  */
-/*
 #define PopEntryList(ListHead) \
        (ListHead)->Next; \
        { \
-               PSINGLE_LIST_ENTRY FirstEntry; \
-               FirstEntry = (ListHead)->Next; \
-               if (FirstEntry != NULL) \
-               { \
-                       (ListHead)->Next = FirstEntry->Next; \
-               } \
+               PSINGLE_LIST_ENTRY _FirstEntry; \
+               _FirstEntry = (ListHead)->Next; \
+               if (_FirstEntry != NULL) \
+                       (ListHead)->Next = _FirstEntry->Next; \
        }
-*/
-static inline PSINGLE_LIST_ENTRY
-PopEntryList(PSINGLE_LIST_ENTRY ListHead)
-{
-  PSINGLE_LIST_ENTRY ListEntry;
-
-  ListEntry = ListHead->Next;
-  if (ListEntry!=NULL)
-  {
-    ListHead->Next = ListEntry->Next;
-  }
-
-  return(ListEntry);
-}
 
 #define RtlCopyMemory(Destination,Source,Length) \
        memcpy((Destination),(Source),(Length))
 
-static
-inline
-VOID
-PushEntryList (
-       PSINGLE_LIST_ENTRY      ListHead,
-       PSINGLE_LIST_ENTRY      Entry
-       )
-{
-       Entry->Next = ListHead->Next;
-       ListHead->Next = Entry;
-}
+#define PushEntryList(_ListHead, _Entry) \
+       (_Entry)->Next = (_ListHead)->Next; \
+       (_ListHead)->Next = (_Entry); \
 
 /*
- *VOID
+ *BOOLEAN
  *RemoveEntryList (
  *     PLIST_ENTRY     Entry
  *     );
@@ -231,21 +208,18 @@ PushEntryList (
  * ARGUMENTS:
  *     ListEntry = Entry to remove
  */
-#define RemoveEntryList(ListEntry) \
-{ \
-       PLIST_ENTRY OldFlink; \
-       PLIST_ENTRY OldBlink; \
-       ASSERT((ListEntry) != NULL); \
-       ASSERT((ListEntry)->Blink!=NULL); \
-       ASSERT((ListEntry)->Blink->Flink == (ListEntry)); \
-       ASSERT((ListEntry)->Flink != NULL); \
-       ASSERT((ListEntry)->Flink->Blink == (ListEntry)); \
-       OldFlink = (ListEntry)->Flink; \
-       OldBlink = (ListEntry)->Blink; \
-       OldFlink->Blink = OldBlink; \
-       OldBlink->Flink = OldFlink; \
-        (ListEntry)->Flink = NULL; \
-        (ListEntry)->Blink = NULL; \
+static __inline BOOLEAN
+RemoveEntryList(
+  IN PLIST_ENTRY  Entry)
+{
+  PLIST_ENTRY OldFlink;
+  PLIST_ENTRY OldBlink;
+
+  OldFlink = Entry->Flink;
+  OldBlink = Entry->Blink;
+  OldFlink->Blink = OldBlink;
+  OldBlink->Flink = OldFlink;
+  return (OldFlink == OldBlink);
 }
 
 
@@ -264,42 +238,18 @@ PushEntryList (
  * RETURNS:
  *     The removed entry
  */
-/*
-#define RemoveHeadList(ListHead) \
-       (ListHead)->Flink; \
-       {RemoveEntryList((ListHead)->Flink)}
-*/
-/*
-PLIST_ENTRY
-RemoveHeadList (
-       PLIST_ENTRY     ListHead
-       );
-*/
-
-static
-inline
-PLIST_ENTRY
-RemoveHeadList (
-       PLIST_ENTRY     ListHead
-       )
+static __inline PLIST_ENTRY 
+RemoveHeadList(
+  IN PLIST_ENTRY  ListHead)
 {
-       PLIST_ENTRY Old;
-       PLIST_ENTRY OldFlink;
-       PLIST_ENTRY OldBlink;
-
-       Old = ListHead->Flink;
-
-       OldFlink = ListHead->Flink->Flink;
-       OldBlink = ListHead->Flink->Blink;
-       OldFlink->Blink = OldBlink;
-       OldBlink->Flink = OldFlink;
-        if (Old != ListHead)
-     {
-        Old->Flink = NULL;
-        Old->Blink = NULL;
-     }
-   
-       return(Old);
+  PLIST_ENTRY Flink;
+  PLIST_ENTRY Entry;
+
+  Entry = ListHead->Flink;
+  Flink = Entry->Flink;
+  ListHead->Flink = Flink;
+  Flink->Blink = ListHead;
+  return Entry;
 }
 
 
@@ -318,42 +268,18 @@ RemoveHeadList (
  * RETURNS:
  *     The removed entry
  */
-/*
-#define RemoveTailList(ListHead) \
-       (ListHead)->Blink; \
-       {RemoveEntryList((ListHead)->Blink)}
-*/
-/*
-PLIST_ENTRY
-RemoveTailList (
-       PLIST_ENTRY     ListHead
-       );
-*/
-
-static
-inline
-PLIST_ENTRY
-RemoveTailList (
-       PLIST_ENTRY ListHead
-       )
+static __inline PLIST_ENTRY
+RemoveTailList(
+  IN PLIST_ENTRY  ListHead)
 {
-       PLIST_ENTRY Old;
-       PLIST_ENTRY OldFlink;
-       PLIST_ENTRY OldBlink;
-
-       Old = ListHead->Blink;
-
-       OldFlink = ListHead->Blink->Flink;
-       OldBlink = ListHead->Blink->Blink;
-       OldFlink->Blink = OldBlink;
-       OldBlink->Flink = OldFlink;
-   if (Old != ListHead)
-     {
-        Old->Flink = NULL;
-        Old->Blink = NULL;
-     }
-   
-       return(Old);
+  PLIST_ENTRY Blink;
+  PLIST_ENTRY Entry;
+
+  Entry = ListHead->Blink;
+  Blink = Entry->Blink;
+  ListHead->Blink = Blink;
+  Blink->Flink = ListHead;
+  return Entry;
 }
 
 
@@ -449,21 +375,19 @@ RemoveTailList (
   
 #define IsLastEntry(ListHead, Entry) ((ListHead)->Blink == Entry)
   
+#define RtlEqualMemory(Destination,Source,Length)   (!memcmp((Destination), (Source), (Length)))
 
 NTSTATUS
 STDCALL
 RtlAppendUnicodeToString (
        PUNICODE_STRING Destination,
-       PWSTR           Source
+       PCWSTR          Source
        );
 
-ULONG
-STDCALL
-RtlCompareMemory (
-       PVOID   Source1,
-       PVOID   Source2,
-       ULONG   Length
-       );
+SIZE_T STDCALL
+RtlCompareMemory(IN const VOID *Source1,
+                 IN const VOID *Source2,
+                 IN SIZE_T Length);
 
 BOOLEAN
 STDCALL
@@ -534,8 +458,7 @@ RtlZeroMemory (PVOID Destination, ULONG Length);
 #define RTL_REGISTRY_WINDOWS_NT 3
 #define RTL_REGISTRY_DEVICEMAP  4
 #define RTL_REGISTRY_USER       5
-#define RTL_REGISTRY_ENUM       6   /* ReactOS specific: Used internally in kernel only */
-#define RTL_REGISTRY_MAXIMUM    7
+#define RTL_REGISTRY_MAXIMUM    6
 
 #define RTL_REGISTRY_HANDLE     0x40000000
 #define RTL_REGISTRY_OPTIONAL   0x80000000
@@ -598,7 +521,7 @@ PushEntryList (
 
 NTSTATUS STDCALL
 RtlAbsoluteToSelfRelativeSD (PSECURITY_DESCRIPTOR AbsSD,
-                            PSECURITY_DESCRIPTOR RelSD,
+                            PSECURITY_DESCRIPTOR_RELATIVE RelSD,
                             PULONG BufferLength);
 
 NTSTATUS STDCALL
@@ -796,11 +719,10 @@ RtlClearBits (
        IN      ULONG           NumberToClear
        );
 
-DWORD
-STDCALL
+ULONG STDCALL
 RtlCompactHeap (
-       HANDLE  hheap,
-       DWORD   flags
+       HANDLE Heap,
+       ULONG   Flags
        );
 
 LONG
@@ -930,6 +852,10 @@ NTSTATUS STDCALL
 RtlCreateSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor,
                             ULONG Revision);
 
+NTSTATUS STDCALL
+RtlCreateSecurityDescriptorRelative (PSECURITY_DESCRIPTOR_RELATIVE SecurityDescriptor,
+                                    ULONG Revision);
+
 NTSTATUS
 STDCALL
 RtlCreateSystemVolumeInformationFolder(
@@ -938,7 +864,7 @@ RtlCreateSystemVolumeInformationFolder(
 
 BOOLEAN STDCALL
 RtlCreateUnicodeString (OUT PUNICODE_STRING Destination,
-                       IN PWSTR Source);
+                       IN PCWSTR Source);
 
 BOOLEAN STDCALL
 RtlCreateUnicodeStringFromAsciiz (OUT PUNICODE_STRING Destination,
@@ -955,6 +881,12 @@ RtlCustomCPToUnicodeN (
        ULONG           CustomSize
        );
 
+BOOLEAN STDCALL
+RtlCutoverTimeToSystemTime(IN PTIME_FIELDS CutoverTimeFields,
+                           OUT PLARGE_INTEGER SystemTime,
+                           IN PLARGE_INTEGER CurrentTime,
+                           IN BOOLEAN ThisYearsCutoverOnly);
+
 NTSTATUS STDCALL
 RtlDecompressBuffer(IN USHORT CompressionFormat,
                    OUT PUCHAR UncompressedBuffer,
@@ -1038,7 +970,7 @@ RtlDescribeChunk(IN USHORT CompressionFormat,
 NTSTATUS STDCALL
 RtlDestroyAtomTable (IN PRTL_ATOM_TABLE AtomTable);
 
-BOOL STDCALL
+HANDLE STDCALL
 RtlDestroyHeap (HANDLE hheap);
 
 NTSTATUS
@@ -1387,6 +1319,12 @@ RtlGetGroupSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor,
                               PSID* Group,
                               PBOOLEAN GroupDefaulted);
 
+NTSTATUS STDCALL
+RtlGetLastNtStatus(VOID);
+
+ULONG STDCALL
+RtlGetLastWin32Error(VOID);
+
 NTSTATUS STDCALL
 RtlGetNextRange (IN OUT PRTL_RANGE_LIST_ITERATOR Iterator,
                 OUT PRTL_RANGE *Range,
@@ -1409,6 +1347,10 @@ RtlGetSaclSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor,
                              PACL* Sacl,
                              PBOOLEAN SaclDefaulted);
 
+BOOLEAN STDCALL
+RtlGetSecurityDescriptorRMControl(PSECURITY_DESCRIPTOR SecurityDescriptor,
+                                 PUCHAR RMControl);
+
 NTSTATUS
 STDCALL
 RtlGetSetBootStatusData(
@@ -1493,6 +1435,13 @@ RtlInitializeSid (PSID Sid,
                  PSID_IDENTIFIER_AUTHORITY IdentifierAuthority,
                  UCHAR SubAuthorityCount);
 
+VOID
+STDCALL
+RtlInitializeBitMap(
+  IN PRTL_BITMAP  BitMapHeader,
+  IN PULONG  BitMapBuffer,
+  IN ULONG  SizeOfBitMap); 
+  
 VOID
 STDCALL
 RtlInitNlsTables (
@@ -1528,10 +1477,10 @@ NTSTATUS
 STDCALL
 RtlInitializeContext (
        IN      HANDLE                  ProcessHandle,
-       IN      PCONTEXT                Context,
-       IN      PVOID                   Parameter,
-       IN      PTHREAD_START_ROUTINE   StartAddress,
-       IN OUT  PUSER_STACK             UserStack
+       OUT     PCONTEXT                ThreadContext,
+       IN      PVOID                   ThreadStartParam  OPTIONAL,
+       IN      PTHREAD_START_ROUTINE   ThreadStartAddress,
+       IN      PINITIAL_TEB            InitialTeb
        );
 
 VOID
@@ -2018,11 +1967,8 @@ RtlLockBootStatusData(
        HANDLE Filehandle
        );
 
-BOOL
-STDCALL
-RtlLockHeap (
-       HANDLE  hheap
-       );
+BOOLEAN STDCALL
+RtlLockHeap (IN HANDLE Heap);
 
 NTSTATUS STDCALL
 RtlLookupAtomInAtomTable (IN PRTL_ATOM_TABLE AtomTable,
@@ -2063,7 +2009,7 @@ RtlLookupElementGenericTableFullAvl (
 
 NTSTATUS STDCALL
 RtlMakeSelfRelativeSD (PSECURITY_DESCRIPTOR AbsSD,
-                      PSECURITY_DESCRIPTOR RelSD,
+                      PSECURITY_DESCRIPTOR_RELATIVE RelSD,
                       PULONG BufferLength);
 
 VOID STDCALL
@@ -2226,7 +2172,8 @@ RtlQueryTimeZoneInformation (IN OUT PTIME_ZONE_INFORMATION TimeZoneInformation);
 VOID STDCALL
 RtlRaiseException (IN PEXCEPTION_RECORD ExceptionRecord);
 
-VOID STDCALL RtlRaiseStatus(NTSTATUS Status);
+VOID STDCALL
+RtlRaiseStatus(NTSTATUS Status);
 
 ULONG STDCALL
 RtlRandom (PULONG Seed);
@@ -2249,13 +2196,12 @@ RtlRealSuccessor (
        PRTL_SPLAY_LINKS Links
        );
 
-LPVOID
-STDCALL
+PVOID STDCALL
 RtlReAllocateHeap (
-       HANDLE  hheap,
-       DWORD   flags,
-       LPVOID  ptr,
-       DWORD   size
+       HANDLE Heap,
+       ULONG Flags,
+       PVOID Ptr,
+       ULONG Size
        );
 
 VOID
@@ -2278,6 +2224,9 @@ RtlReserveChunk (
 VOID STDCALL
 RtlResetRtlTranslations (IN PNLSTABLEINFO NlsTable);
 
+VOID STDCALL
+RtlRestoreLastWin32Error(IN ULONG Error);
+
 /*
  * VOID
  * RtlRetrieveUlong (
@@ -2286,7 +2235,7 @@ RtlResetRtlTranslations (IN PNLSTABLEINFO NlsTable);
  *     );
  */
 #define RtlRetrieveUlong(DestAddress,SrcAddress) \
-       if ((ULONG)(SrcAddress) & LONG_MASK) \
+       if ((ULONG_PTR)(SrcAddress) & LONG_MASK) \
        { \
                ((PUCHAR)(DestAddress))[0]=((PUCHAR)(SrcAddress))[0]; \
                ((PUCHAR)(DestAddress))[1]=((PUCHAR)(SrcAddress))[1]; \
@@ -2306,7 +2255,7 @@ RtlResetRtlTranslations (IN PNLSTABLEINFO NlsTable);
  *     );
  */
 #define RtlRetrieveUshort(DestAddress,SrcAddress) \
-       if ((ULONG)(SrcAddress) & SHORT_MASK) \
+       if ((ULONG_PTR)(SrcAddress) & SHORT_MASK) \
        { \
                ((PUCHAR)(DestAddress))[0]=((PUCHAR)(SrcAddress))[0]; \
                ((PUCHAR)(DestAddress))[1]=((PUCHAR)(SrcAddress))[1]; \
@@ -2325,7 +2274,7 @@ RtlSecondsSince1980ToTime (ULONG SecondsSince1980,
                           PLARGE_INTEGER Time);
 
 NTSTATUS STDCALL
-RtlSelfRelativeToAbsoluteSD (PSECURITY_DESCRIPTOR RelSD,
+RtlSelfRelativeToAbsoluteSD (PSECURITY_DESCRIPTOR_RELATIVE RelSD,
                             PSECURITY_DESCRIPTOR AbsSD,
                             PULONG AbsSDSize,
                             PACL Dacl,
@@ -2340,13 +2289,18 @@ RtlSelfRelativeToAbsoluteSD (PSECURITY_DESCRIPTOR RelSD,
 NTSTATUS
 STDCALL
 RtlSelfRelativeToAbsoluteSD2(
-       PSECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor,
+       PSECURITY_DESCRIPTOR_RELATIVE SelfRelativeSecurityDescriptor,
        PULONG BufferSize
        );
 
 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 (
@@ -2362,6 +2316,11 @@ RtlSetBits (
        ULONG           NumberToSet
        );
 
+NTSTATUS STDCALL
+RtlSetControlSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
+                               IN SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest,
+                               IN SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet);
+
 NTSTATUS STDCALL
 RtlSetDaclSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor,
                              BOOLEAN DaclPresent,
@@ -2373,6 +2332,18 @@ RtlSetGroupSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor,
                               PSID Group,
                               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,
@@ -2384,17 +2355,14 @@ RtlSetSaclSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor,
                              PACL Sacl,
                              BOOLEAN SaclDefaulted);
 
-NTSTATUS STDCALL
-RtlSetInformationAcl (PACL Acl,
-                     PVOID Information,
-                     ULONG InformationLength,
-                     ACL_INFORMATION_CLASS InformationClass);
+VOID STDCALL
+RtlSetSecurityDescriptorRMControl(PSECURITY_DESCRIPTOR SecurityDescriptor,
+                                 PUCHAR RMControl);
 
 NTSTATUS STDCALL
 RtlSetTimeZoneInformation (IN OUT PTIME_ZONE_INFORMATION TimeZoneInformation);
 
-ULONG
-STDCALL
+ULONG STDCALL
 RtlSizeHeap(
        IN PVOID HeapHandle, 
        IN ULONG Flags, 
@@ -2415,10 +2383,10 @@ RtlSplay (
  *     );
  */
 #define RtlStoreUlong(Address,Value) \
-       if ((ULONG)(Address) & LONG_MASK) \
+       if ((ULONG_PTR)(Address) & LONG_MASK) \
        { \
                ((PUCHAR)(Address))[LONG_LEAST_SIGNIFICANT_BIT]=(UCHAR)(FIRSTBYTE(Value)); \
-               ((PUCHAR)(Address))[LONG_3RD_MOST_SIGNIFICANT_BIT]=(UCHAR)(FIRSTBYTE(Value)); \
+               ((PUCHAR)(Address))[LONG_3RD_MOST_SIGNIFICANT_BIT]=(UCHAR)(SECONDBYTE(Value)); \
                ((PUCHAR)(Address))[LONG_2ND_MOST_SIGNIFICANT_BIT]=(UCHAR)(THIRDBYTE(Value)); \
                ((PUCHAR)(Address))[LONG_MOST_SIGNIFICANT_BIT]=(UCHAR)(FOURTHBYTE(Value)); \
        } \
@@ -2435,7 +2403,7 @@ RtlSplay (
  *     );
  */
 #define RtlStoreUshort(Address,Value) \
-       if ((ULONG)(Address) & SHORT_MASK) \
+       if ((ULONG_PTR)(Address) & SHORT_MASK) \
        { \
                ((PUCHAR)(Address))[SHORT_LEAST_SIGNIFICANT_BIT]=(UCHAR)(FIRSTBYTE(Value)); \
                ((PUCHAR)(Address))[SHORT_MOST_SIGNIFICANT_BIT]=(UCHAR)(SECONDBYTE(Value)); \
@@ -2605,11 +2573,8 @@ RtlUnicodeToOemN (
 ULONG STDCALL
 RtlUniform (PULONG Seed);
 
-BOOL
-STDCALL
-RtlUnlockHeap (
-       HANDLE  hheap
-       );
+BOOLEAN STDCALL
+RtlUnlockHeap (IN HANDLE Heap);
 
 NTSTATUS
 STDCALL
@@ -2708,18 +2673,17 @@ RtlUshortByteSwap (IN USHORT Source);
 BOOLEAN STDCALL
 RtlValidAcl (PACL Acl);
 
-BOOL
-STDCALL
+BOOLEAN STDCALL
 RtlValidateHeap (
-       HANDLE  hheap,
-       DWORD   flags,
+       HANDLE Heap,
+       ULONG   Flags,
        PVOID   pmem
        );
 
 BOOLEAN
 STDCALL
 RtlValidRelativeSecurityDescriptor (
-       IN PSECURITY_DESCRIPTOR SecurityDescriptorInput,
+       IN PSECURITY_DESCRIPTOR_RELATIVE SecurityDescriptorInput,
        IN ULONG SecurityDescriptorLength,
        IN SECURITY_INFORMATION RequiredInformation
        );
@@ -2755,8 +2719,7 @@ RtlWalkFrameChain (
        IN ULONG Flags
        );
 
-ULONG
-STDCALL
+BOOLEAN STDCALL
 RtlZeroHeap(
     IN PVOID HeapHandle,
     IN ULONG Flags
@@ -2870,7 +2833,7 @@ BOOLEAN
 FASTCALL
 RtlpCreateUnicodeString(
    IN OUT PUNICODE_STRING UniDest,
-   IN PWSTR  Source,
+   IN PCWSTR  Source,
    IN POOL_TYPE PoolType);   
 
 NTSTATUS