mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 16:02:56 +00:00
[FASTFAT]
- Always use the full path name when looking for FCB hashes CORE-10483 #resolve svn path=/trunk/; revision=70304
This commit is contained in:
parent
99319d5ab2
commit
8b9fb19bab
1 changed files with 17 additions and 4 deletions
|
@ -437,6 +437,7 @@ vfatGrabFCBFromTable(
|
||||||
|
|
||||||
DPRINT("'%wZ'\n", PathNameU);
|
DPRINT("'%wZ'\n", PathNameU);
|
||||||
|
|
||||||
|
ASSERT(PathNameU->Length >= sizeof(WCHAR) && PathNameU->Buffer[0] == L'\\');
|
||||||
Hash = vfatNameHash(0, PathNameU);
|
Hash = vfatNameHash(0, PathNameU);
|
||||||
|
|
||||||
entry = pVCB->FcbHashTable[Hash % pVCB->HashTableSize];
|
entry = pVCB->FcbHashTable[Hash % pVCB->HashTableSize];
|
||||||
|
@ -812,14 +813,15 @@ vfatGetFCBForFile(
|
||||||
DPRINT("vfatGetFCBForFile (%p,%p,%p,%wZ)\n",
|
DPRINT("vfatGetFCBForFile (%p,%p,%p,%wZ)\n",
|
||||||
pVCB, pParentFCB, pFCB, pFileNameU);
|
pVCB, pParentFCB, pFCB, pFileNameU);
|
||||||
|
|
||||||
FileNameU.Buffer = NameBuffer;
|
RtlInitEmptyUnicodeString(&FileNameU, NameBuffer, sizeof(NameBuffer));
|
||||||
FileNameU.MaximumLength = sizeof(NameBuffer);
|
|
||||||
RtlCopyUnicodeString(&FileNameU, pFileNameU);
|
|
||||||
|
|
||||||
parentFCB = *pParentFCB;
|
parentFCB = *pParentFCB;
|
||||||
|
|
||||||
if (parentFCB == NULL)
|
if (parentFCB == NULL)
|
||||||
{
|
{
|
||||||
|
/* Passed-in name is the full name */
|
||||||
|
RtlCopyUnicodeString(&FileNameU, pFileNameU);
|
||||||
|
|
||||||
// Trivial case, open of the root directory on volume
|
// Trivial case, open of the root directory on volume
|
||||||
if (RtlEqualUnicodeString(&FileNameU, &RootNameU, FALSE))
|
if (RtlEqualUnicodeString(&FileNameU, &RootNameU, FALSE))
|
||||||
{
|
{
|
||||||
|
@ -888,9 +890,20 @@ vfatGetFCBForFile(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
/* Make absolute path */
|
||||||
|
RtlCopyUnicodeString(&FileNameU, &parentFCB->PathNameU);
|
||||||
|
curr = FileNameU.Buffer + FileNameU.Length / sizeof(WCHAR) - 1;
|
||||||
|
if (*curr != L'\\')
|
||||||
|
{
|
||||||
|
RtlAppendUnicodeToString(&FileNameU, L"\\");
|
||||||
|
curr++;
|
||||||
|
}
|
||||||
|
ASSERT(*curr == L'\\');
|
||||||
|
RtlAppendUnicodeStringToString(&FileNameU, pFileNameU);
|
||||||
|
|
||||||
FCB = parentFCB;
|
FCB = parentFCB;
|
||||||
parentFCB = NULL;
|
parentFCB = NULL;
|
||||||
prev = curr = FileNameU.Buffer - 1;
|
prev = curr;
|
||||||
last = FileNameU.Buffer + FileNameU.Length / sizeof(WCHAR) - 1;
|
last = FileNameU.Buffer + FileNameU.Length / sizeof(WCHAR) - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue