Author: fireball
Date: Sun Jan 20 16:49:58 2008
New Revision: 31902
URL:
http://svn.reactos.org/svn/reactos?rev=31902&view=rev
Log:
- Fix a bug, which led to incorrect prefix tree construction (and thus led to a crash when
trying native npfs.sys).
- Add tracing.
Modified:
trunk/reactos/lib/rtl/unicodeprefix.c
Modified: trunk/reactos/lib/rtl/unicodeprefix.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/unicodeprefix.c?re…
==============================================================================
--- trunk/reactos/lib/rtl/unicodeprefix.c (original)
+++ trunk/reactos/lib/rtl/unicodeprefix.c Sun Jan 20 16:49:58 2008
@@ -155,6 +155,9 @@
PRTL_SPLAY_LINKS SplayLinks;
RTL_GENERIC_COMPARE_RESULTS Result;
+ DPRINT("RtlFindUnicodePrefix(): Table %p, FullName %wZ, "
+ "CaseInsensitive %b\n", PrefixTable, FullName, CaseInsensitiveIndex);
+
/* Find out how many names there are */
NameCount = ComputeUnicodeNameLength(FullName);
@@ -279,6 +282,9 @@
NTAPI
RtlInitializeUnicodePrefix(PUNICODE_PREFIX_TABLE PrefixTable)
{
+ DPRINT("RtlInitializeUnicodePrefix(): Table %p\n",
+ PrefixTable);
+
/* Setup the table */
PrefixTable->NameLength = 0;
PrefixTable->LastNextEntry = NULL;
@@ -300,6 +306,9 @@
RTL_GENERIC_COMPARE_RESULTS Result;
PRTL_SPLAY_LINKS SplayLinks;
+ DPRINT("RtlInsertUnicodePrefix(): Table %p, Prefix %wZ, "
+ "TableEntry %p\n", PrefixTable, Prefix, PrefixTableEntry);
+
/* Find out how many names there are */
NameCount = ComputeUnicodeNameLength(Prefix);
@@ -404,7 +413,7 @@
if (RtlRightChild(&Entry->Links))
{
/* We do, enter it and restart the loop */
- SplayLinks = RtlLeftChild(&Entry->Links);
+ SplayLinks = RtlRightChild(&Entry->Links);
Entry = CONTAINING_RECORD(SplayLinks,
UNICODE_PREFIX_TABLE_ENTRY,
Links);
@@ -458,6 +467,9 @@
PRTL_SPLAY_LINKS SplayLinks;
PUNICODE_PREFIX_TABLE_ENTRY Entry, CaseMatchEntry;
+ DPRINT("RtlNextUnicodePrefix(): Table %p Restart %b\n",
+ PrefixTable, Restart);
+
/* We might need this entry 2/3rd of the time, so cache it now */
CaseMatchEntry = PrefixTable->LastNextEntry->CaseMatch;
@@ -529,6 +541,9 @@
PUNICODE_PREFIX_TABLE_ENTRY Entry, RefEntry, NewEntry;
PRTL_SPLAY_LINKS SplayLinks;
+ DPRINT("RtlRemoveUnicodePrefix(): Table %p, TableEntry %p\n",
+ PrefixTable, PrefixTableEntry);
+
/* Erase the last entry */
PrefixTable->LastNextEntry = NULL;