fix formatting (again)

svn path=/trunk/; revision=39377
This commit is contained in:
Christoph von Wittich 2009-02-04 06:04:24 +00:00
parent 29f2647a3e
commit 217745c949
3 changed files with 63 additions and 63 deletions

View file

@ -275,8 +275,8 @@ CdfsFindFile(PDEVICE_EXTENSION DeviceExt,
Record->RecordLength, Record->ExtAttrRecordLength, Record->FileIdLength); Record->RecordLength, Record->ExtAttrRecordLength, Record->FileIdLength);
Status = CdfsGetEntryName Status = CdfsGetEntryName
(DeviceExt, &Context, &Block, &StreamOffset, (DeviceExt, &Context, &Block, &StreamOffset,
DirSize, (PVOID*)&Record, name, &DirIndex, &Offset); DirSize, (PVOID*)&Record, name, &DirIndex, &Offset);
if (Status == STATUS_NO_MORE_ENTRIES) if (Status == STATUS_NO_MORE_ENTRIES)
{ {
@ -295,8 +295,8 @@ CdfsFindFile(PDEVICE_EXTENSION DeviceExt,
ShortName.MaximumLength = 26; ShortName.MaximumLength = 26;
ShortName.Buffer = ShortNameBuffer; ShortName.Buffer = ShortNameBuffer;
OffsetOfEntry.QuadPart = StreamOffset.QuadPart + Offset; OffsetOfEntry.QuadPart = StreamOffset.QuadPart + Offset;
CdfsShortNameCacheGet(Parent, &OffsetOfEntry, &LongName, &ShortName); CdfsShortNameCacheGet(Parent, &OffsetOfEntry, &LongName, &ShortName);
DPRINT("ShortName '%wZ'\n", &ShortName); DPRINT("ShortName '%wZ'\n", &ShortName);

View file

@ -106,15 +106,15 @@ VOID
CdfsDestroyFCB(PFCB Fcb) CdfsDestroyFCB(PFCB Fcb)
{ {
PLIST_ENTRY Entry; PLIST_ENTRY Entry;
ExDeleteResourceLite(&Fcb->PagingIoResource); ExDeleteResourceLite(&Fcb->PagingIoResource);
ExDeleteResourceLite(&Fcb->MainResource); ExDeleteResourceLite(&Fcb->MainResource);
while (!IsListEmpty(&Fcb->ShortNameList)) while (!IsListEmpty(&Fcb->ShortNameList))
{ {
Entry = Fcb->ShortNameList.Flink; Entry = Fcb->ShortNameList.Flink;
RemoveEntryList(Entry); RemoveEntryList(Entry);
ExFreePool(Entry); ExFreePool(Entry);
} }
ExFreePool(Fcb); ExFreePool(Fcb);
@ -541,8 +541,8 @@ CdfsDirFindFile(PDEVICE_EXTENSION DeviceExt,
ShortName.Buffer = ShortNameBuffer; ShortName.Buffer = ShortNameBuffer;
memset(ShortNameBuffer, 0, 26); memset(ShortNameBuffer, 0, 26);
OffsetOfEntry.QuadPart = StreamOffset.QuadPart + Offset; OffsetOfEntry.QuadPart = StreamOffset.QuadPart + Offset;
CdfsShortNameCacheGet(DirectoryFcb, &OffsetOfEntry, &LongName, &ShortName); CdfsShortNameCacheGet(DirectoryFcb, &OffsetOfEntry, &LongName, &ShortName);
DPRINT("ShortName '%wZ'\n", &ShortName); DPRINT("ShortName '%wZ'\n", &ShortName);

View file

@ -103,9 +103,9 @@ CdfsWriteNumberInShortName
{ {
while (Number) while (Number)
{ {
*EndOfNumberTarget = '0' + (Number % 10); *EndOfNumberTarget = '0' + (Number % 10);
EndOfNumberTarget--; EndOfNumberTarget--;
Number /= 10; Number /= 10;
} }
return EndOfNumberTarget; return EndOfNumberTarget;
} }
@ -131,86 +131,86 @@ CdfsShortNameCacheGet
/* Try to find the name in our cache */ /* Try to find the name in our cache */
for (Entry = DirectoryFcb->ShortNameList.Flink; for (Entry = DirectoryFcb->ShortNameList.Flink;
Entry != &DirectoryFcb->ShortNameList; Entry != &DirectoryFcb->ShortNameList;
Entry = Entry->Flink) Entry = Entry->Flink)
{ {
ShortNameEntry = CONTAINING_RECORD(Entry, CDFS_SHORT_NAME, Entry); ShortNameEntry = CONTAINING_RECORD(Entry, CDFS_SHORT_NAME, Entry);
if (ShortNameEntry->StreamOffset.QuadPart == StreamOffset->QuadPart) if (ShortNameEntry->StreamOffset.QuadPart == StreamOffset->QuadPart)
{ {
/* Cache hit */ /* Cache hit */
RtlCopyMemory RtlCopyMemory
(ShortName->Buffer, ShortNameEntry->Name.Buffer, (ShortName->Buffer, ShortNameEntry->Name.Buffer,
ShortNameEntry->Name.Length); ShortNameEntry->Name.Length);
ShortName->Length = ShortNameEntry->Name.Length; ShortName->Length = ShortNameEntry->Name.Length;
ExReleaseResourceLite(&DirectoryFcb->NameListResource); ExReleaseResourceLite(&DirectoryFcb->NameListResource);
DPRINT("Yield short name %wZ from cache\n", ShortName); DPRINT("Yield short name %wZ from cache\n", ShortName);
return; return;
} }
} }
/* Cache miss */ /* Cache miss */
if ((RtlIsNameLegalDOS8Dot3(LongName, NULL, &HasSpaces) == FALSE) || if ((RtlIsNameLegalDOS8Dot3(LongName, NULL, &HasSpaces) == FALSE) ||
(HasSpaces == TRUE)) (HasSpaces == TRUE))
{ {
RtlGenerate8dot3Name(LongName, FALSE, &Context, ShortName); RtlGenerate8dot3Name(LongName, FALSE, &Context, ShortName);
} }
else else
{ {
/* copy short name */ /* copy short name */
RtlUpcaseUnicodeString RtlUpcaseUnicodeString
(ShortName, (ShortName,
LongName, LongName,
FALSE); FALSE);
} }
DPRINT("Initial Guess %wZ\n", ShortName); DPRINT("Initial Guess %wZ\n", ShortName);
/* Find the part that'll be numberified */ /* Find the part that'll be numberified */
LastDot = &ShortName->Buffer[(ShortName->Length / sizeof(WCHAR)) - 1]; LastDot = &ShortName->Buffer[(ShortName->Length / sizeof(WCHAR)) - 1];
for (Scan = ShortName->Buffer; for (Scan = ShortName->Buffer;
Scan - ShortName->Buffer < ShortName->Length; Scan - ShortName->Buffer < ShortName->Length;
Scan++) Scan++)
if (*Scan == '.') LastDot = Scan - 1; if (*Scan == '.') LastDot = Scan - 1;
/* Make it unique by scanning the cache and bumping */ /* Make it unique by scanning the cache and bumping */
/* Note that incrementing the ambiguous name is enough, since we add new /* Note that incrementing the ambiguous name is enough, since we add new
* entries at the tail. We'll scan over all collisions. */ * entries at the tail. We'll scan over all collisions. */
/* XXX could perform better. */ /* XXX could perform better. */
for (Entry = DirectoryFcb->ShortNameList.Flink; for (Entry = DirectoryFcb->ShortNameList.Flink;
Entry != &DirectoryFcb->ShortNameList; Entry != &DirectoryFcb->ShortNameList;
Entry = Entry->Flink) Entry = Entry->Flink)
{ {
ShortNameEntry = CONTAINING_RECORD(Entry, CDFS_SHORT_NAME, Entry); ShortNameEntry = CONTAINING_RECORD(Entry, CDFS_SHORT_NAME, Entry);
if (RtlCompareUnicodeString if (RtlCompareUnicodeString
(ShortName, (ShortName,
&ShortNameEntry->Name, &ShortNameEntry->Name,
TRUE) == 0) /* Match */ TRUE) == 0) /* Match */
{ {
Scan = CdfsWriteNumberInShortName(LastDot, ++Number); Scan = CdfsWriteNumberInShortName(LastDot, ++Number);
*Scan = '~'; *Scan = '~';
DPRINT("Collide; try %wZ\n", ShortName); DPRINT("Collide; try %wZ\n", ShortName);
} }
} }
/* We've scanned over all entries and now have a unique one. Cache it. */ /* We've scanned over all entries and now have a unique one. Cache it. */
ShortNameEntry = ExAllocatePool(PagedPool, sizeof(CDFS_SHORT_NAME)); ShortNameEntry = ExAllocatePool(PagedPool, sizeof(CDFS_SHORT_NAME));
if (!ShortNameEntry) if (!ShortNameEntry)
{ {
/* We couldn't cache it, but we can return it. We run the risk of /* We couldn't cache it, but we can return it. We run the risk of
* generating a non-unique name later. */ * generating a non-unique name later. */
ExReleaseResourceLite(&DirectoryFcb->NameListResource); ExReleaseResourceLite(&DirectoryFcb->NameListResource);
DPRINT1("Couldn't cache potentially clashing 8.3 name %wZ\n", ShortName); DPRINT1("Couldn't cache potentially clashing 8.3 name %wZ\n", ShortName);
return; return;
} }
ShortNameEntry->StreamOffset = *StreamOffset; ShortNameEntry->StreamOffset = *StreamOffset;
ShortNameEntry->Name.Buffer = ShortNameEntry->NameBuffer; ShortNameEntry->Name.Buffer = ShortNameEntry->NameBuffer;
ShortNameEntry->Name.Length = ShortName->Length; ShortNameEntry->Name.Length = ShortName->Length;
ShortNameEntry->Name.MaximumLength = sizeof(ShortNameEntry->NameBuffer); ShortNameEntry->Name.MaximumLength = sizeof(ShortNameEntry->NameBuffer);
RtlCopyMemory RtlCopyMemory
(ShortNameEntry->NameBuffer, (ShortNameEntry->NameBuffer,
ShortName->Buffer, ShortName->Buffer,
ShortName->Length); ShortName->Length);
InsertTailList(&DirectoryFcb->ShortNameList, &ShortNameEntry->Entry); InsertTailList(&DirectoryFcb->ShortNameList, &ShortNameEntry->Entry);
ExReleaseResourceLite(&DirectoryFcb->NameListResource); ExReleaseResourceLite(&DirectoryFcb->NameListResource);