- Fix a bug, which led to incorrect prefix tree construction (and thus led to a crash when trying native npfs.sys).

- Add tracing.

svn path=/trunk/; revision=31902
This commit is contained in:
Aleksey Bragin 2008-01-20 13:49:58 +00:00
parent afb39ce8fa
commit 95ed37888e

View file

@ -155,6 +155,9 @@ RtlFindUnicodePrefix(PUNICODE_PREFIX_TABLE PrefixTable,
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 @@ VOID
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 @@ RtlInsertUnicodePrefix(PUNICODE_PREFIX_TABLE PrefixTable,
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 @@ RtlInsertUnicodePrefix(PUNICODE_PREFIX_TABLE PrefixTable,
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 @@ RtlNextUnicodePrefix(PUNICODE_PREFIX_TABLE PrefixTable,
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 @@ RtlRemoveUnicodePrefix(PUNICODE_PREFIX_TABLE PrefixTable,
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;