- Finished implementing RtlInsertUnicodePrefix: handle greater and less than insertions.
[reactos.git] / reactos / include / ndk / rtlfuncs.h
index 991c395..0a5ddd4 100644 (file)
 #include "extypes.h"
 #include "rtltypes.h"
 
+/* MACROS ********************************************************************/
+
+/* FIXME: Eventually move the ones in rtltypes.h here... */
+
+/*
+ * Splay Tree Macros
+ */
+#define RtlIsLeftChild(Links) \
+    (RtlLeftChild(RtlParent(Links)) == (PRTL_SPLAY_LINKS)(Links))
+
+#define RtlRightChild(Links) \
+    (PRTL_SPLAY_LINKS)(Links)->RightChild
+
+#define RtlIsRoot(Links) \
+    (RtlParent(Links) == (PRTL_SPLAY_LINKS)(Links))
+
+#define RtlLeftChild(Links) \
+    (PRTL_SPLAY_LINKS)(Links)->LeftChild
+
+#define RtlParent(Links) \
+    (PRTL_SPLAY_LINKS)(Links)->Parent
+
+#define RtlInitializeSplayLinks(Links)                  \
+    PRTL_SPLAY_LINKS _SplayLinks;                       \
+    _SplayLinks = (PRTL_SPLAY_LINKS)(Links);            \
+    _SplayLinks->Parent = _SplayLinks;                  \
+    _SplayLinks->LeftChild = NULL;                      \
+    _SplayLinks->RightChild = NULL;
+
+#define RtlInsertAsLeftChild(ParentLinks,ChildLinks)    \
+    PRTL_SPLAY_LINKS _SplayParent;                      \
+    PRTL_SPLAY_LINKS _SplayChild;                       \
+    _SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks);     \
+    _SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks);       \
+    _SplayParent->LeftChild = _SplayChild;              \
+    _SplayChild->Parent = _SplayParent;
+
+#define RtlInsertAsRightChild(ParentLinks,ChildLinks)   \
+    PRTL_SPLAY_LINKS _SplayParent;                      \
+    PRTL_SPLAY_LINKS _SplayChild;                       \
+    _SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks);     \
+    _SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks);       \
+    _SplayParent->RightChild = _SplayChild;             \
+    _SplayChild->Parent = _SplayParent;
+
 /* PROTOTYPES ****************************************************************/
 
+/*
+ * Splay Tree Functions
+ */
+NTSYSAPI
+PRTL_SPLAY_LINKS
+NTAPI
+RtlSplay(PRTL_SPLAY_LINKS Links);
+
+NTSYSAPI
+PRTL_SPLAY_LINKS
+NTAPI
+RtlDelete(PRTL_SPLAY_LINKS Links);
+
+NTSYSAPI
+VOID
+NTAPI
+RtlDeleteNoSplay(
+    PRTL_SPLAY_LINKS Links,
+    PRTL_SPLAY_LINKS *Root
+);
+
+NTSYSAPI
+PRTL_SPLAY_LINKS
+NTAPI
+RtlSubtreeSuccessor(PRTL_SPLAY_LINKS Links);
+
+NTSYSAPI
+PRTL_SPLAY_LINKS
+NTAPI
+RtlSubtreePredecessor(PRTL_SPLAY_LINKS Links);
+
+NTSYSAPI
+PRTL_SPLAY_LINKS
+NTAPI
+RtlRealSuccessor(PRTL_SPLAY_LINKS Links);
+
+NTSYSAPI
+PRTL_SPLAY_LINKS
+NTAPI
+RtlRealPredecessor(PRTL_SPLAY_LINKS Links);
+
 /*
  * Error and Exception Functions
  */
@@ -539,6 +625,14 @@ RtlSelfRelativeToAbsoluteSD(
     IN PULONG PrimaryGroupSize
 );
 
+NTSYSAPI
+NTSTATUS
+NTAPI
+RtlSelfRelativeToAbsoluteSD2(
+    IN OUT PSECURITY_DESCRIPTOR SelfRelativeSD,
+    OUT PULONG BufferSize
+);
+
 NTSYSAPI
 NTSTATUS
 NTAPI
@@ -1313,6 +1407,15 @@ VOID
 NTAPI
 RtlReleasePebLock(VOID);
 
+NTSYSAPI
+VOID
+NTAPI
+RtlSetProcessIsCritical(
+    IN BOOLEAN NewValue,
+    OUT PBOOLEAN OldValue OPTIONAL,
+    IN BOOLEAN IsWinlogon
+);
+
 /*
  * Environment/Path Functions
  */
@@ -1979,6 +2082,19 @@ ULONG
 NTAPI
 RtlUniform(PULONG Seed);
 
+/*
+ * Network Functions
+ */
+NTSYSAPI
+NTSTATUS
+NTAPI
+RtlIpv4StringToAddressW(
+    IN LPWSTR IpString,
+    IN ULONG Base,
+    OUT PULONG PtrToIpAddr,
+    OUT PULONG IpAddr
+);
+
 /*
  * Time Functions
  */
@@ -2033,6 +2149,10 @@ NTSTATUS
 NTAPI
 RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation);
 
+NTSYSAPI
+BOOLEAN
+NTAPI
+RtlGetNtProductType(OUT PNT_PRODUCT_TYPE ProductType);
 
 static __inline struct _PEB* NtCurrentPeb (void) 
 {