update for HEAD-2003021201
[reactos.git] / include / ntos / rtl.h
old mode 100644 (file)
new mode 100755 (executable)
similarity index 95%
rename from include/ddk/rtl.h
rename to include/ntos/rtl.h
index 178977d..a1f0f2e
@@ -15,6 +15,7 @@
 #include <pe.h>
 
 
+#ifndef __USE_W32API
 
 /*
  * PURPOSE: Flags for RtlQueryRegistryValues
 #define RTL_QUERY_REGISTRY_DIRECT      (0x00000020)
 #define RTL_QUERY_REGISTRY_DELETE      (0x00000040)
 
-
-/*
- * PURPOSE: Used with RtlCheckRegistryKey, RtlCreateRegistryKey, 
- * RtlDeleteRegistryKey
- */
-#define RTL_REGISTRY_ABSOLUTE   0
-#define RTL_REGISTRY_SERVICES   1
-#define RTL_REGISTRY_CONTROL    2
-#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_HANDLE     0x40000000
-#define RTL_REGISTRY_OPTIONAL   0x80000000
-
-
-#define SHORT_SIZE     (sizeof(USHORT))
-#define SHORT_MASK     (SHORT_SIZE-1)
-#define LONG_SIZE      (sizeof(ULONG))
-#define LONG_MASK      (LONG_SIZE-1)
-#define LOWBYTE_MASK   0x00FF
-
-#define FIRSTBYTE(Value)       ((Value) & LOWBYTE_MASK)
-#define SECONDBYTE(Value)      (((Value) >> 8) & LOWBYTE_MASK)
-#define THIRDBYTE(Value)       (((Value) >> 16) & LOWBYTE_MASK)
-#define FOURTHBYTE(Value)      (((Value) >> 24) & LOWBYTE_MASK)
-
-/* FIXME: reverse byte-order on big-endian machines (e.g. MIPS) */
-#define SHORT_LEAST_SIGNIFICANT_BIT    0
-#define SHORT_MOST_SIGNIFICANT_BIT     1
-
-#define LONG_LEAST_SIGNIFICANT_BIT     0
-#define LONG_3RD_MOST_SIGNIFICANT_BIT  1
-#define LONG_2RD_MOST_SIGNIFICANT_BIT  2
-#define LONG_MOST_SIGNIFICANT_BIT      3
-
-
-
-#if defined(__NTOSKRNL__) || defined(__NTDLL__)
-#define NLS_MB_CODE_PAGE_TAG     NlsMbCodePageTag
-#define NLS_MB_OEM_CODE_PAGE_TAG NlsMbOemCodePageTag
-#else
-#define NLS_MB_CODE_PAGE_TAG     (*NlsMbCodePageTag)
-#define NLS_MB_OEM_CODE_PAGE_TAG (*NlsMbOemCodePageTag)
-#endif /* __NTOSKRNL__ || __NTDLL__ */
-
-extern BOOLEAN NLS_MB_CODE_PAGE_TAG;
-extern BOOLEAN NLS_MB_OEM_CODE_PAGE_TAG;
-
-
-/*
- * NOTE: ReactOS extensions
- */
-#define RtlMin(X,Y) (((X) < (Y))? (X) : (Y))
-#define RtlMax(X,Y) (((X) > (Y))? (X) : (Y))
-#define RtlMin3(X,Y,Z) (((X) < (Y)) ? RtlMin(X,Z) : RtlMin(Y,Z))
-#define RtlMax3(X,Y,Z) (((X) > (Y)) ? RtlMax(X,Z) : RtlMax(Y,Z))
-
-
 /*
  * VOID
  * InitializeObjectAttributes (
@@ -236,35 +176,23 @@ extern BOOLEAN NLS_MB_OEM_CODE_PAGE_TAG;
                } \
        }
 */
-static
-inline
-PSINGLE_LIST_ENTRY
- PopEntryList(
-       PSINGLE_LIST_ENTRY      ListHead
-       )
+static inline PSINGLE_LIST_ENTRY
+PopEntryList(PSINGLE_LIST_ENTRY ListHead)
 {
-       PSINGLE_LIST_ENTRY ListEntry;
+  PSINGLE_LIST_ENTRY ListEntry;
 
-       ListEntry = ListHead->Next;
-       if (ListEntry!=NULL)
-       {
-               ListHead->Next = ListEntry->Next;
-       }
-       return ListEntry;
+  ListEntry = ListHead->Next;
+  if (ListEntry!=NULL)
+  {
+    ListHead->Next = ListEntry->Next;
+  }
+
+  return(ListEntry);
 }
 
-/*
-VOID
-PushEntryList (
-       PSINGLE_LIST_ENTRY      ListHead,
-       PSINGLE_LIST_ENTRY      Entry
-       );
-*/
-/*
-#define PushEntryList(ListHead,Entry) \
-       (Entry)->Next = (ListHead)->Next; \
-       (ListHead)->Next = (Entry)
-*/
+#define RtlCopyMemory(Destination,Source,Length) \
+       memcpy((Destination),(Source),(Length))
+
 static
 inline
 VOID
@@ -277,48 +205,6 @@ PushEntryList (
        ListHead->Next = Entry;
 }
 
-
-/*
- * An ReactOS extension
- */
-static
-inline
-PSINGLE_LIST_ENTRY
- PopEntrySList(
-       PSLIST_HEADER   ListHead
-       )
-{
-       PSINGLE_LIST_ENTRY ListEntry;
-
-       ListEntry = ListHead->s.Next.Next;
-       if (ListEntry!=NULL)
-       {
-               ListHead->s.Next.Next = ListEntry->Next;
-    ListHead->s.Depth++;
-    ListHead->s.Sequence++;
-  }
-       return ListEntry;
-}
-
-
-/*
- * An ReactOS extension
- */
-static
-inline
-VOID
-PushEntrySList (
-       PSLIST_HEADER   ListHead,
-       PSINGLE_LIST_ENTRY      Entry
-       )
-{
-       Entry->Next = ListHead->s.Next.Next;
-       ListHead->s.Next.Next = Entry;
-  ListHead->s.Depth++;
-  ListHead->s.Sequence++;
-}
-
-
 /*
  *VOID
  *RemoveEntryList (
@@ -370,92 +256,395 @@ PushEntrySList (
        {RemoveEntryList((ListHead)->Flink)}
 */
 /*
-PLIST_ENTRY
-RemoveHeadList (
-       PLIST_ENTRY     ListHead
+PLIST_ENTRY
+RemoveHeadList (
+       PLIST_ENTRY     ListHead
+       );
+*/
+
+static
+inline
+PLIST_ENTRY
+RemoveHeadList (
+       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
+ * RemoveTailList (
+ *     PLIST_ENTRY     ListHead
+ *     );
+ *
+ * FUNCTION:
+ *     Removes the tail entry from a double linked list
+ *
+ * ARGUMENTS:
+ *     ListHead = Head of the list
+ *
+ * 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
+       )
+{
+       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);
+}
+
+NTSTATUS
+STDCALL
+RtlAppendUnicodeToString (
+       PUNICODE_STRING Destination,
+       PWSTR           Source
+       );
+
+ULONG
+STDCALL
+RtlCompareMemory (
+       PVOID   Source1,
+       PVOID   Source2,
+       ULONG   Length
+       );
+
+BOOLEAN
+STDCALL
+RtlEqualUnicodeString (
+       PUNICODE_STRING String1,
+       PUNICODE_STRING String2,
+       BOOLEAN         CaseInSensitive
+       );
+
+VOID
+RtlGetCallersAddress (
+       PVOID   * CallersAddress
+       );
+
+NTSTATUS
+STDCALL
+RtlQueryRegistryValues (
+       IN      ULONG                           RelativeTo,
+       IN      PWSTR                           Path,
+       IN      PRTL_QUERY_REGISTRY_TABLE       QueryTable,
+       IN      PVOID                           Context,
+       IN      PVOID                           Environment
+       );
+
+NTSTATUS
+STDCALL
+RtlWriteRegistryValue (
+       ULONG   RelativeTo,
+       PWSTR   Path,
+       PWSTR   ValueName,
+       ULONG   ValueType,
+       PVOID   ValueData,
+       ULONG   ValueLength
+       );
+
+NTSTATUS STDCALL
+RtlDeleteRegistryValue(IN ULONG RelativeTo,
+                      IN PWSTR Path,
+                      IN PWSTR ValueName);
+
+VOID STDCALL
+RtlMoveMemory (PVOID Destination, CONST VOID* Source, ULONG Length);
+
+BOOLEAN STDCALL
+RtlEqualLuid(IN PLUID Luid1,
+            IN PLUID Luid2);
+
+VOID
+STDCALL
+RtlFillMemory (
+       PVOID   Destination,
+       ULONG   Length,
+       UCHAR   Fill
+       );
+
+VOID STDCALL
+RtlZeroMemory (PVOID Destination, ULONG Length);
+
+#else /* __USE_W32API */
+
+#include <ddk/ntifs.h>
+
+#endif /* __USE_W32API */
+
+
+/*
+ * PURPOSE: Used with RtlCheckRegistryKey, RtlCreateRegistryKey, 
+ * RtlDeleteRegistryKey
+ */
+#define RTL_REGISTRY_ABSOLUTE   0
+#define RTL_REGISTRY_SERVICES   1
+#define RTL_REGISTRY_CONTROL    2
+#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_HANDLE     0x40000000
+#define RTL_REGISTRY_OPTIONAL   0x80000000
+
+
+#define SHORT_SIZE     (sizeof(USHORT))
+#define SHORT_MASK     (SHORT_SIZE-1)
+#define LONG_SIZE      (sizeof(ULONG))
+#define LONG_MASK      (LONG_SIZE-1)
+#define LOWBYTE_MASK   0x00FF
+
+#define FIRSTBYTE(Value)       ((Value) & LOWBYTE_MASK)
+#define SECONDBYTE(Value)      (((Value) >> 8) & LOWBYTE_MASK)
+#define THIRDBYTE(Value)       (((Value) >> 16) & LOWBYTE_MASK)
+#define FOURTHBYTE(Value)      (((Value) >> 24) & LOWBYTE_MASK)
+
+/* FIXME: reverse byte-order on big-endian machines (e.g. MIPS) */
+#define SHORT_LEAST_SIGNIFICANT_BIT    0
+#define SHORT_MOST_SIGNIFICANT_BIT     1
+
+#define LONG_LEAST_SIGNIFICANT_BIT     0
+#define LONG_3RD_MOST_SIGNIFICANT_BIT  1
+#define LONG_2RD_MOST_SIGNIFICANT_BIT  2
+#define LONG_MOST_SIGNIFICANT_BIT      3
+
+
+
+#if defined(__NTOSKRNL__) || defined(__NTDLL__)
+#define NLS_MB_CODE_PAGE_TAG     NlsMbCodePageTag
+#define NLS_MB_OEM_CODE_PAGE_TAG NlsMbOemCodePageTag
+#else
+#define NLS_MB_CODE_PAGE_TAG     (*NlsMbCodePageTag)
+#define NLS_MB_OEM_CODE_PAGE_TAG (*NlsMbOemCodePageTag)
+#endif /* __NTOSKRNL__ || __NTDLL__ */
+
+extern BOOLEAN NLS_MB_CODE_PAGE_TAG;
+extern BOOLEAN NLS_MB_OEM_CODE_PAGE_TAG;
+
+
+/*
+ * NOTE: ReactOS extensions
+ */
+#define RtlMin(X,Y) (((X) < (Y))? (X) : (Y))
+#define RtlMax(X,Y) (((X) > (Y))? (X) : (Y))
+#define RtlMin3(X,Y,Z) (((X) < (Y)) ? RtlMin(X,Z) : RtlMin(Y,Z))
+#define RtlMax3(X,Y,Z) (((X) > (Y)) ? RtlMax(X,Z) : RtlMax(Y,Z))
+
+
+/*
+ * VOID
+ * InitializeUnicodeString(PUNICODE_STRING DestinationString,
+ *                         USHORT Lenght,
+ *                         USHORT MaximumLength,
+ *                         PCWSTR Buffer);
+ *
+ * Initialize n UNICODE_STRING from its fields. Use when you know the values of
+ * all the fields in advance
+ */
+
+#define InitializeUnicodeString(__PDEST_STRING__,__LENGTH__,__MAXLENGTH__,__BUFFER__) \
+{ \
+  (__PDEST_STRING__)->Length = (__LENGTH__); \
+  (__PDEST_STRING__)->MaximumLength = (__MAXLENGTH__); \
+  (__PDEST_STRING__)->Buffer = (__BUFFER__); \
+}
+
+
+/*
+ * VOID
+ * RtlInitUnicodeStringFromLiteral(PUNICODE_STRING DestinationString,
+ *                                 PCWSTR SourceString);
+ *
+ * Initialize a UNICODE_STRING from a wide string literal. WARNING: use only with
+ * string literals and statically initialized arrays, it will calculate the wrong
+ * length otherwise
+ */
+
+#define RtlInitUnicodeStringFromLiteral(__PDEST_STRING__,__SOURCE_STRING__) \
+ InitializeUnicodeString( \
+  (__PDEST_STRING__), \
+  sizeof(__SOURCE_STRING__) - sizeof(WCHAR), \
+  sizeof(__SOURCE_STRING__), \
+  (__SOURCE_STRING__) \
+)
+
+
+/*
+ * Static initializer for UNICODE_STRING variables.
+ *
+ * Usage:
+ *    UNICODE_STRING wstr = UNICODE_STRING_INITIALIZER(L"string");
+ */
+
+#define UNICODE_STRING_INITIALIZER(__SOURCE_STRING__) \
+{ \
+  sizeof((__SOURCE_STRING__)) - sizeof(WCHAR), \
+  sizeof((__SOURCE_STRING__)), \
+  (__SOURCE_STRING__) \
+}
+
+
+/*
+ * Initializer for empty UNICODE_STRING variables.
+ *
+ * Usage:
+ *    UNICODE_STRING wstr = EMPTY_UNICODE_STRING;
+ */
+
+#define EMPTY_UNICODE_STRING {0, 0, NULL}
+
+
+/*
+VOID
+PushEntryList (
+       PSINGLE_LIST_ENTRY      ListHead,
+       PSINGLE_LIST_ENTRY      Entry
        );
 */
+/*
+#define PushEntryList(ListHead,Entry) \
+       (Entry)->Next = (ListHead)->Next; \
+       (ListHead)->Next = (Entry)
+*/
+
+
+#ifndef __USE_W32API
+
 
+/*
+ * An ReactOS extension
+ */
 static
 inline
-PLIST_ENTRY
-RemoveHeadList (
-       PLIST_ENTRY     ListHead
+PSINGLE_LIST_ENTRY
+ PopEntrySList(
+       PSLIST_HEADER   ListHead
        )
 {
-       PLIST_ENTRY Old;
-       PLIST_ENTRY OldFlink;
-       PLIST_ENTRY OldBlink;
-
-       Old = ListHead->Flink;
+       PSINGLE_LIST_ENTRY ListEntry;
 
-       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);
+       ListEntry = ListHead->s.Next.Next;
+       if (ListEntry!=NULL)
+       {
+               ListHead->s.Next.Next = ListEntry->Next;
+    ListHead->s.Depth++;
+    ListHead->s.Sequence++;
+  }
+       return ListEntry;
 }
 
 
 /*
- * PLIST_ENTRY
- * RemoveTailList (
- *     PLIST_ENTRY     ListHead
- *     );
- *
- * FUNCTION:
- *     Removes the tail entry from a double linked list
- *
- * ARGUMENTS:
- *     ListHead = Head of the list
- *
- * RETURNS:
- *     The removed entry
+ * An ReactOS extension
  */
-/*
-#define RemoveTailList(ListHead) \
-       (ListHead)->Blink; \
-       {RemoveEntryList((ListHead)->Blink)}
-*/
-/*
-PLIST_ENTRY
-RemoveTailList (
-       PLIST_ENTRY     ListHead
-       );
-*/
+static
+inline
+VOID
+PushEntrySList (
+       PSLIST_HEADER   ListHead,
+       PSINGLE_LIST_ENTRY      Entry
+       )
+{
+       Entry->Next = ListHead->s.Next.Next;
+       ListHead->s.Next.Next = Entry;
+  ListHead->s.Depth++;
+  ListHead->s.Sequence++;
+}
 
+#else /* __USE_W32API */
+
+/*
+ * An ReactOS extension
+ */
 static
 inline
-PLIST_ENTRY
-RemoveTailList (
-       PLIST_ENTRY ListHead
+PSINGLE_LIST_ENTRY
+ PopEntrySList(
+       PSLIST_HEADER   ListHead
        )
 {
-       PLIST_ENTRY Old;
-       PLIST_ENTRY OldFlink;
-       PLIST_ENTRY OldBlink;
+       PSINGLE_LIST_ENTRY ListEntry;
 
-       Old = ListHead->Blink;
+       ListEntry = ListHead->Next.Next;
+       if (ListEntry!=NULL)
+       {
+               ListHead->Next.Next = ListEntry->Next;
+    ListHead->Depth++;
+    ListHead->Sequence++;
+  }
+       return ListEntry;
+}
 
-       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);
+
+/*
+ * An ReactOS extension
+ */
+static
+inline
+VOID
+PushEntrySList (
+       PSLIST_HEADER   ListHead,
+       PSINGLE_LIST_ENTRY      Entry
+       )
+{
+       Entry->Next = ListHead->Next.Next;
+       ListHead->Next.Next = Entry;
+  ListHead->Depth++;
+  ListHead->Sequence++;
 }
 
+#endif /* __USE_W32API */
+
 
 NTSTATUS
 STDCALL
@@ -513,13 +702,6 @@ RtlAppendUnicodeStringToString (
        PUNICODE_STRING Source
        );
 
-NTSTATUS
-STDCALL
-RtlAppendUnicodeToString (
-       PUNICODE_STRING Destination,
-       PWSTR           Source
-       );
-
 BOOLEAN
 STDCALL
 RtlAreBitsClear (
@@ -581,14 +763,6 @@ RtlCompactHeap (
        DWORD   flags
        );
 
-ULONG
-STDCALL
-RtlCompareMemory (
-       PVOID   Source1,
-       PVOID   Source2,
-       ULONG   Length
-       );
-
 LONG
 STDCALL
 RtlCompareString (
@@ -602,7 +776,7 @@ STDCALL
 RtlCompareUnicodeString (
        PUNICODE_STRING String1,
        PUNICODE_STRING String2,
-       BOOLEAN         BaseInsensitive
+       BOOLEAN         CaseInsensitive
        );
 
 NTSTATUS STDCALL
@@ -651,9 +825,6 @@ RtlCopyMemory (
        );
 #endif
 
-#define RtlCopyMemory(Destination,Source,Length) \
-       memcpy((Destination),(Source),(Length))
-
 #define RtlCopyBytes RtlCopyMemory
 
 VOID STDCALL
@@ -696,8 +867,8 @@ STDCALL
 RtlCreateHeap (
        ULONG                   Flags,
        PVOID                   BaseAddress,
-       ULONG                   SizeToReserve,
-       ULONG                   SizeToCommit,
+       ULONG                   SizeToReserve,     // dwMaximumSize
+       ULONG                   SizeToCommit,      // dwInitialSize
        PVOID                   Unknown,
        PRTL_HEAP_DEFINITION    Definition
        );
@@ -770,11 +941,6 @@ RtlDeleteAtomFromAtomTable(IN PRTL_ATOM_TABLE AtomTable,
                           IN RTL_ATOM Atom);
 
 NTSTATUS STDCALL
-RtlDeleteRegistryValue(IN ULONG RelativeTo,
-                      IN PWSTR Path,
-                      IN PWSTR ValueName);
-
-NTSTATUS STDCALL
 RtlDescribeChunk(IN USHORT CompressionFormat,
                 IN OUT PUCHAR *CompressedBuffer,
                 IN PUCHAR EndOfCompressedBufferPlus1,
@@ -824,10 +990,6 @@ RtlEnlargedUnsignedMultiply (
        ULONG   Multiplier
        );
 
-BOOLEAN STDCALL
-RtlEqualLuid(IN PLUID Luid1,
-            IN PLUID Luid2);
-
 BOOLEAN
 STDCALL
 RtlEqualString (
@@ -836,14 +998,6 @@ RtlEqualString (
        BOOLEAN CaseInSensitive
        );
 
-BOOLEAN
-STDCALL
-RtlEqualUnicodeString (
-       PUNICODE_STRING String1,
-       PUNICODE_STRING String2,
-       BOOLEAN         CaseInSensitive
-       );
-
 LARGE_INTEGER
 STDCALL
 RtlExtendedIntegerMultiply (
@@ -869,14 +1023,6 @@ RtlExtendedMagicDivide (
 
 VOID
 STDCALL
-RtlFillMemory (
-       PVOID   Destination,
-       ULONG   Length,
-       UCHAR   Fill
-       );
-
-VOID
-STDCALL
 RtlFillMemoryUlong (
        PVOID   Destination,
        ULONG   Length,
@@ -991,11 +1137,6 @@ RtlGenerate8dot3Name(IN PUNICODE_STRING Name,
                     IN OUT PGENERATE_NAME_CONTEXT Context,
                     OUT PUNICODE_STRING Name8dot3);
 
-VOID
-RtlGetCallersAddress (
-       PVOID   * CallersAddress
-       );
-
 NTSTATUS STDCALL
 RtlGetCompressionWorkSpaceSize(IN USHORT CompressionFormatAndEngine,
                               OUT PULONG CompressBufferAndWorkSpaceSize,
@@ -1008,8 +1149,6 @@ RtlGetDefaultCodePage (
        PUSHORT OemCodePage
        );
 
-#define RtlGetProcessHeap() (NtCurrentPeb()->ProcessHeap)
-
 PVOID
 STDCALL
 RtlImageDirectoryEntryToData (
@@ -1063,70 +1202,6 @@ RtlInitUnicodeString (
        PCWSTR          SourceString
        );
 
-/*
-VOID
-InitializeUnicodeString (
-       PUNICODE_STRING DestinationString,
-        USHORT          Lenght,
-        USHORT          MaximumLength,
-       PCWSTR          Buffer
-       );
-
- Initialize an UNICODE_STRING from its fields. Use when you know the values of
- all the fields in advance
-
- */
-
-#define InitializeUnicodeString(__PDEST_STRING__,__LENGTH__,__MAXLENGTH__,__BUFFER__) \
-{ \
- (__PDEST_STRING__)->Length = (__LENGTH__); \
- (__PDEST_STRING__)->MaximumLength = (__MAXLENGTH__); \
- (__PDEST_STRING__)->Buffer = (__BUFFER__); \
-}
-
-/*
-VOID
-RtlInitUnicodeStringFromLiteral (
-       PUNICODE_STRING DestinationString,
-       PCWSTR          SourceString
-       );
-
- Initialize an UNICODE_STRING from a wide string literal. WARNING: use only with
- string literals and statically initialized arrays, it will calculate the wrong
- length otherwise
-
- */
-
-#define RtlInitUnicodeStringFromLiteral(__PDEST_STRING__,__SOURCE_STRING__) \
- InitializeUnicodeString( \
-  (__PDEST_STRING__), \
-  sizeof(__SOURCE_STRING__) - sizeof(WCHAR), \
-  sizeof(__SOURCE_STRING__), \
-  (__SOURCE_STRING__) \
- )
-
-/*
- Static initializer for UNICODE_STRING variables. Usage:
-
- UNICODE_STRING wstr = UNICODE_STRING_INITIALIZER(L"string");
-
-*/
-
-#define UNICODE_STRING_INITIALIZER(__SOURCE_STRING__) \
-{ \
- sizeof((__SOURCE_STRING__)) - sizeof(WCHAR), \
- sizeof((__SOURCE_STRING__)), \
- (__SOURCE_STRING__) \
-}
-
-/*
- Initializer for empty UNICODE_STRING variables. Usage:
-
- UNICODE_STRING wstr = EMPTY_UNICODE_STRING;
-
-*/
-#define EMPTY_UNICODE_STRING {0, 0, NULL}
-
 VOID
 STDCALL
 RtlInitializeBitMap (
@@ -1394,9 +1469,6 @@ RtlLookupAtomInAtomTable (
        OUT     PRTL_ATOM       Atom
        );
 
-VOID STDCALL
-RtlMoveMemory (PVOID Destination, CONST VOID* Source, ULONG Length);
-
 NTSTATUS
 STDCALL
 RtlMultiByteToUnicodeN (
@@ -1475,13 +1547,6 @@ RtlOemToUnicodeN (
        ULONG   OemSize
        );
 
-NTSTATUS
-STDCALL
-RtlOpenCurrentUser (
-       IN      ACCESS_MASK     DesiredAccess,
-       OUT     PHANDLE         KeyHandle
-       );
-
 NTSTATUS STDCALL
 RtlPinAtomInAtomTable (
        IN      PRTL_ATOM_TABLE AtomTable,
@@ -1517,16 +1582,6 @@ RtlQueryAtomInAtomTable (
 
 NTSTATUS
 STDCALL
-RtlQueryRegistryValues (
-       IN      ULONG                           RelativeTo,
-       IN      PWSTR                           Path,
-       IN      PRTL_QUERY_REGISTRY_TABLE       QueryTable,
-       IN      PVOID                           Context,
-       IN      PVOID                           Environment
-       );
-
-NTSTATUS
-STDCALL
 RtlQueryTimeZoneInformation (
        IN OUT  PTIME_ZONE_INFORMATION  TimeZoneInformation
        );
@@ -1905,20 +1960,6 @@ RtlValidSecurityDescriptor (
 BOOLEAN STDCALL
 RtlValidSid(IN PSID Sid);
 
-NTSTATUS
-STDCALL
-RtlWriteRegistryValue (
-       ULONG   RelativeTo,
-       PWSTR   Path,
-       PWSTR   ValueName,
-       ULONG   ValueType,
-       PVOID   ValueData,
-       ULONG   ValueLength
-       );
-
-VOID STDCALL
-RtlZeroMemory (PVOID Destination, ULONG Length);
-
 ULONG
 STDCALL
 RtlxAnsiStringToUnicodeSize (