I was interested in getting feedback from current mail group users.
We have mirrored your mail list in a new application that provides a more aggregated and safe environment which utilizes the power of broadband.
Roomity.com v 1.5 is a web 2.01 community webapp. Our newest version adds broadcast video and social networking such as favorite authors and an html editor.
It?s free to join and any feedback would be appreciated.
S.
------------------------------------------------------------------------------------------------------------------------------------------------------------
Broadband interface (RIA) + mail box saftey = <a href="http://React_OS_Differences_Commit_List.roomity.com">React_OS_Differences_Commit_List.roomity.com</a>
*Your* clubs, no sign up to read, ad supported; try broadband internet. ~~1131397873277~~
------------------------------------------------------------------------------------------------------------------------------------------------------------
- Implement simple case of RtlInsertUnicodePrefix where a new node entry
needs to be created.
Modified: trunk/reactos/include/ndk/rtlfuncs.h
Modified: trunk/reactos/lib/rtl/unicodeprefix.c
_____
Modified: trunk/reactos/include/ndk/rtlfuncs.h
--- trunk/reactos/include/ndk/rtlfuncs.h 2005-11-07 19:14:38 UTC
(rev 19039)
+++ trunk/reactos/include/ndk/rtlfuncs.h 2005-11-07 19:31:15 UTC
(rev 19040)
@@ -36,6 +36,13 @@
#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;
+
/* PROTOTYPES
****************************************************************/
/*
_____
Modified: trunk/reactos/lib/rtl/unicodeprefix.c
--- trunk/reactos/lib/rtl/unicodeprefix.c 2005-11-07 19:14:38 UTC
(rev 19039)
+++ trunk/reactos/lib/rtl/unicodeprefix.c 2005-11-07 19:31:15 UTC
(rev 19040)
@@ -25,7 +25,7 @@
/* FUNCTIONS
***************************************************************/
-/*STATIC*/
+STATIC
ULONG
NTAPI
ComputeUnicodeNameLength(IN PUNICODE_STRING UnicodeName)
@@ -82,15 +82,52 @@
{
/*
* implementation notes:
- * - get name length (number of names)
- * - init splay links
- * - find a matching tree
- * - if !found, insert a new NTC_ROOT entry and return TRUE;
+ * - get name length (number of names) DONE
+ * - init splay links DONE
+ * - find a matching tree DONE
+ * - if !found, insert a new NTC_ROOT entry and return TRUE; DONE
* - if found, loop tree and compare strings:
* if equal, handle casematch/nomatch
* if greater or lesser equal, then add left/right childs
accordingly
* - splay the tree
*/
+ PUNICODE_PREFIX_TABLE_ENTRY CurrentEntry, PreviousEntry;
+ ULONG NameCount;
+
+ /* Find out how many names there are */
+ NameCount = ComputeUnicodeNameLength(Prefix);
+
+ /* Set up the initial entry data */
+ PrefixTableEntry->NameLength = NameCount;
+ PrefixTableEntry->Prefix = Prefix;
+ RtlInitializeSplayLinks(&PrefixTableEntry->Links);
+
+ /* Find the right spot where to insert this entry */
+ PreviousEntry = (PUNICODE_PREFIX_TABLE_ENTRY)PrefixTable;
+ CurrentEntry = PreviousEntry->NextPrefixTree;
+ while (CurrentEntry->NameLength > NameCount)
+ {
+ /* Not a match, move to the next entry */
+ PreviousEntry = CurrentEntry;
+ CurrentEntry = CurrentEntry->NextPrefixTree;
+ }
+
+ /* Check if we did find a tree by now */
+ if (CurrentEntry->NameLength != NameCount)
+ {
+ /* We didn't, so insert a new entry in the list */
+ PreviousEntry->NextPrefixTree = PrefixTableEntry;
+ PrefixTableEntry->NextPrefixTree = CurrentEntry;
+
+ /* This is now a root entry with case match */
+ PrefixTableEntry->NodeTypeCode = PFX_NTC_ROOT;
+ PrefixTableEntry->CaseMatch = PrefixTableEntry;
+
+ /* Quick return */
+ return TRUE;
+ }
+
+ /* FIXME */
UNIMPLEMENTED;
return FALSE;
}
@@ -104,8 +141,7 @@
BOOLEAN Restart)
{
PRTL_SPLAY_LINKS SplayLinks;
- PUNICODE_PREFIX_TABLE_ENTRY Entry;
- PUNICODE_PREFIX_TABLE_ENTRY CaseMatchEntry;
+ PUNICODE_PREFIX_TABLE_ENTRY Entry, CaseMatchEntry;
/* We might need this entry 2/3rd of the time, so cache it now */
CaseMatchEntry = PrefixTable->LastNextEntry->CaseMatch;
- Finish implementation of RtlRemoveUnicodePrefix
Modified: trunk/reactos/include/ndk/rtlfuncs.h
Modified: trunk/reactos/lib/rtl/unicodeprefix.c
_____
Modified: trunk/reactos/include/ndk/rtlfuncs.h
--- trunk/reactos/include/ndk/rtlfuncs.h 2005-11-07 17:35:10 UTC
(rev 19038)
+++ trunk/reactos/include/ndk/rtlfuncs.h 2005-11-07 19:14:38 UTC
(rev 19039)
@@ -24,6 +24,9 @@
#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))
_____
Modified: trunk/reactos/lib/rtl/unicodeprefix.c
--- trunk/reactos/lib/rtl/unicodeprefix.c 2005-11-07 17:35:10 UTC
(rev 19038)
+++ trunk/reactos/lib/rtl/unicodeprefix.c 2005-11-07 19:14:38 UTC
(rev 19039)
@@ -45,8 +45,8 @@
}
/*
-* @unimplemented
-*/
+ * @unimplemented
+ */
PUNICODE_PREFIX_TABLE_ENTRY
NTAPI
RtlFindUnicodePrefix(PUNICODE_PREFIX_TABLE PrefixTable,
@@ -58,8 +58,8 @@
}
/*
-* @implemented
-*/
+ * @implemented
+ */
VOID
NTAPI
RtlInitializeUnicodePrefix(PUNICODE_PREFIX_TABLE PrefixTable)
@@ -72,8 +72,8 @@
}
/*
-* @unimplemented
-*/
+ * @unimplemented
+ */
BOOLEAN
NTAPI
RtlInsertUnicodePrefix(PUNICODE_PREFIX_TABLE PrefixTable,
@@ -168,8 +168,8 @@
}
/*
-* @unimplemented
-*/
+ * @implemented
+ */
VOID
NTAPI
RtlRemoveUnicodePrefix(PUNICODE_PREFIX_TABLE PrefixTable,
@@ -199,7 +199,60 @@
/* Check if this entry is a case match */
if (PrefixTableEntry->CaseMatch != PrefixTableEntry)
{
- /* FIXME */
+ /* Get the case match entry */
+ Entry = PrefixTableEntry->CaseMatch;
+
+ /* Now loop until we find one referencing what the caller
sent */
+ while (Entry->CaseMatch != PrefixTableEntry) Entry =
Entry->CaseMatch;
+
+ /* We found the entry that was sent, link them to delete
this entry */
+ Entry->CaseMatch = PrefixTableEntry->CaseMatch;
+
+ /* Copy the data */
+ Entry->NodeTypeCode = PrefixTableEntry->NodeTypeCode;
+ Entry->NextPrefixTree = PrefixTableEntry->NextPrefixTree;
+ Entry->Links = PrefixTableEntry->Links;
+
+ /* Now check if we are a root entry */
+ if (RtlIsRoot(&PrefixTableEntry->Links))
+ {
+ /* We are, so make this entry root as well */
+ Entry->Links.Parent = &Entry->Links;
+
+ /* Find the entry referencing us */
+ RefEntry = Entry->NextPrefixTree;
+ while (RefEntry->NextPrefixTree != Entry)
+ {
+ /* Not this one, move to the next entry */
+ RefEntry = RefEntry->NextPrefixTree;
+ }
+
+ /* Link them to us now */
+ RefEntry->NextPrefixTree = Entry;
+ }
+ else if (RtlIsLeftChild(&PrefixTableEntry->Links))
+ {
+ /* We were the left child, so make us as well */
+ Entry->Links.LeftChild = &Entry->Links;
+ }
+ else
+ {
+ /* We were the right child, so make us as well */
+ Entry->Links.RightChild = &Entry->Links;
+ }
+
+ /* Check if we have a left child */
+ if (RtlLeftChild(&Entry->Links))
+ {
+ /* Update its parent link */
+ RtlLeftChild(&Entry->Links)->Parent = &Entry->Links;
+ }
+ /* Check if we have a right child */
+ if (RtlRightChild(&Entry->Links))
+ {
+ /* Update its parent link */
+ RtlRightChild(&Entry->Links)->Parent = &Entry->Links;
+ }
}
else
{
- Implement PFX_NTC_ROOT/PFX_NTC_CHILD deletions in
RtlRemoveUnicodePrefix, if the entry isn't a case match.
Modified: trunk/reactos/lib/rtl/unicodeprefix.c
_____
Modified: trunk/reactos/lib/rtl/unicodeprefix.c
--- trunk/reactos/lib/rtl/unicodeprefix.c 2005-11-07 04:23:28 UTC
(rev 19034)
+++ trunk/reactos/lib/rtl/unicodeprefix.c 2005-11-07 04:42:28 UTC
(rev 19035)
@@ -175,7 +175,8 @@
RtlRemoveUnicodePrefix(PUNICODE_PREFIX_TABLE PrefixTable,
PUNICODE_PREFIX_TABLE_ENTRY PrefixTableEntry)
{
- PUNICODE_PREFIX_TABLE_ENTRY Entry;
+ PUNICODE_PREFIX_TABLE_ENTRY Entry, RefEntry, NewEntry;
+ PRTL_SPLAY_LINKS SplayLinks;
/* Erase the last entry */
PrefixTable->LastNextEntry = NULL;
@@ -186,7 +187,7 @@
/* Get the case match entry */
Entry = PrefixTableEntry->CaseMatch;
- /* Now loop until we find the one matching what the caller sent
*/
+ /* Now loop until we find one referencing what the caller sent
*/
while (Entry->CaseMatch != PrefixTableEntry) Entry =
Entry->CaseMatch;
/* We found the entry that was sent, link them to delete this
entry */
@@ -195,7 +196,66 @@
else if ((PrefixTableEntry->NodeTypeCode == PFX_NTC_ROOT) ||
(PrefixTableEntry->NodeTypeCode == PFX_NTC_CHILD))
{
- /* FIXME */
+ /* Check if this entry is a case match */
+ if (PrefixTableEntry->CaseMatch != PrefixTableEntry)
+ {
+ /* FIXME */
+ }
+ else
+ {
+ /* It's not a case match, so we'll delete the actual entry
*/
+ SplayLinks = &PrefixTableEntry->Links;
+
+ /* Find the root entry */
+ while (!RtlIsRoot(SplayLinks)) SplayLinks =
RtlParent(SplayLinks);
+ Entry = CONTAINING_RECORD(SplayLinks,
+ UNICODE_PREFIX_TABLE_ENTRY,
+ Links);
+
+ /* Delete the entry and check if the whole tree is gone */
+ SplayLinks = RtlDelete(&PrefixTableEntry->Links);
+ if (!SplayLinks)
+ {
+ /* The tree is also gone now, find the entry
referencing us */
+ RefEntry = Entry->NextPrefixTree;
+ while (RefEntry->NextPrefixTree != Entry)
+ {
+ /* Not this one, move to the next entry */
+ RefEntry = RefEntry->NextPrefixTree;
+ }
+
+ /* Link them so this entry stops being referenced */
+ RefEntry->NextPrefixTree = Entry->NextPrefixTree;
+ }
+ else if (&Entry->Links != SplayLinks)
+ {
+ /* The tree is still here, but we got moved to a new
one */
+ NewEntry = CONTAINING_RECORD(SplayLinks,
+
UNICODE_PREFIX_TABLE_ENTRY,
+ Links);
+
+ /* Find the entry referencing us */
+ RefEntry = Entry->NextPrefixTree;
+ while (RefEntry->NextPrefixTree != Entry)
+ {
+ /* Not this one, move to the next entry */
+ RefEntry = RefEntry->NextPrefixTree;
+ }
+
+ /* Since we got moved, make us the new root entry */
+ NewEntry->NodeTypeCode = PFX_NTC_ROOT;
+
+ /* Link us with the entry referencing the old root */
+ RefEntry->NextPrefixTree = NewEntry;
+
+ /* And link us with the old tree */
+ NewEntry->NextPrefixTree = Entry->NextPrefixTree;
+
+ /* Set the old tree as a child */
+ Entry->NodeTypeCode = PFX_NTC_CHILD;
+ Entry->NextPrefixTree = NULL;
+ }
+ }
}
}
- Implement PFX_NTC_CASE_MATCH deletions in RtlRemoveUnicodePrefix
Modified: trunk/reactos/lib/rtl/unicodeprefix.c
_____
Modified: trunk/reactos/lib/rtl/unicodeprefix.c
--- trunk/reactos/lib/rtl/unicodeprefix.c 2005-11-07 01:01:29 UTC
(rev 19033)
+++ trunk/reactos/lib/rtl/unicodeprefix.c 2005-11-07 04:23:28 UTC
(rev 19034)
@@ -175,7 +175,28 @@
RtlRemoveUnicodePrefix(PUNICODE_PREFIX_TABLE PrefixTable,
PUNICODE_PREFIX_TABLE_ENTRY PrefixTableEntry)
{
- UNIMPLEMENTED;
+ PUNICODE_PREFIX_TABLE_ENTRY Entry;
+
+ /* Erase the last entry */
+ PrefixTable->LastNextEntry = NULL;
+
+ /* Check if this was a Case Match Entry */
+ if (PrefixTableEntry->NodeTypeCode == PFX_NTC_CASE_MATCH)
+ {
+ /* Get the case match entry */
+ Entry = PrefixTableEntry->CaseMatch;
+
+ /* Now loop until we find the one matching what the caller sent
*/
+ while (Entry->CaseMatch != PrefixTableEntry) Entry =
Entry->CaseMatch;
+
+ /* We found the entry that was sent, link them to delete this
entry */
+ Entry->CaseMatch = PrefixTableEntry->CaseMatch;
+ }
+ else if ((PrefixTableEntry->NodeTypeCode == PFX_NTC_ROOT) ||
+ (PrefixTableEntry->NodeTypeCode == PFX_NTC_CHILD))
+ {
+ /* FIXME */
+ }
}
/* EOF */