mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[FASTFAT]
Terminate the path name at the last slash when a file is opened using the IO_OPEN_TARGET_DIRECTORY option. This fixes some IoCreateFile kernel mode tests. svn path=/trunk/; revision=75975
This commit is contained in:
parent
4364981793
commit
4a830ca857
1 changed files with 9 additions and 9 deletions
|
@ -577,7 +577,7 @@ VfatCreateFile(
|
|||
else
|
||||
{
|
||||
PVFATFCB TargetFcb;
|
||||
LONG idx, FileNameLen;
|
||||
LONG idx;
|
||||
|
||||
vfatAddToStat(DeviceExt, Fat.CreateHits, 1);
|
||||
|
||||
|
@ -586,8 +586,8 @@ VfatCreateFile(
|
|||
{
|
||||
vfatGrabFCB(DeviceExt, ParentFcb);
|
||||
}
|
||||
Status = vfatGetFCBForFile(DeviceExt, &ParentFcb, &TargetFcb, &PathNameU);
|
||||
|
||||
Status = vfatGetFCBForFile(DeviceExt, &ParentFcb, &TargetFcb, &PathNameU);
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
vfatReleaseFCB(DeviceExt, TargetFcb);
|
||||
|
@ -615,14 +615,14 @@ VfatCreateFile(
|
|||
|
||||
if (idx > 0 || PathNameU.Buffer[0] == L'\\')
|
||||
{
|
||||
/* We don't want to include / in the name */
|
||||
FileNameLen = PathNameU.Length - ((idx + 1) * sizeof(WCHAR));
|
||||
/* Terminate the string at the last backslash */
|
||||
PathNameU.Buffer[idx + 1] = UNICODE_NULL;
|
||||
PathNameU.Length = (idx + 1) * sizeof(WCHAR);
|
||||
PathNameU.MaximumLength = PathNameU.Length + sizeof(WCHAR);
|
||||
|
||||
/* Update FO just to keep file name */
|
||||
/* Skip first slash */
|
||||
++idx;
|
||||
FileObject->FileName.Length = FileNameLen;
|
||||
RtlMoveMemory(&PathNameU.Buffer[0], &PathNameU.Buffer[idx], FileObject->FileName.Length);
|
||||
/* Update the file object as well */
|
||||
FileObject->FileName.Length = PathNameU.Length;
|
||||
FileObject->FileName.MaximumLength = PathNameU.MaximumLength;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue