mirror of
https://github.com/reactos/reactos.git
synced 2025-06-26 06:29:43 +00:00
[FASTFAT]
- Fix failure case handling in vfatUpdateFCB - NULL output parameters on failure in vfatGetFCBForFile - Fix a few typos svn path=/trunk/; revision=65278
This commit is contained in:
parent
468b64c679
commit
453e370737
2 changed files with 13 additions and 11 deletions
|
@ -583,7 +583,7 @@ VfatCreateFile(
|
||||||
|
|
||||||
idx = FileObject->FileName.Length / sizeof(WCHAR) - 1;
|
idx = FileObject->FileName.Length / sizeof(WCHAR) - 1;
|
||||||
|
|
||||||
/* Skip tailing \ - if any */
|
/* Skip trailing \ - if any */
|
||||||
if (PathNameU.Buffer[idx] == L'\\')
|
if (PathNameU.Buffer[idx] == L'\\')
|
||||||
{
|
{
|
||||||
--idx;
|
--idx;
|
||||||
|
|
|
@ -371,6 +371,13 @@ vfatUpdateFCB(
|
||||||
|
|
||||||
DPRINT("vfatUpdateFCB(%p, %p, %wZ, %wZ, %p)\n", pVCB, Fcb, LongName, ShortName, ParentFcb);
|
DPRINT("vfatUpdateFCB(%p, %p, %wZ, %wZ, %p)\n", pVCB, Fcb, LongName, ShortName, ParentFcb);
|
||||||
|
|
||||||
|
/* Get full path name */
|
||||||
|
Status = vfatMakeFullName(ParentFcb, LongName, ShortName, &Fcb->PathNameU);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
/* Delete old name */
|
/* Delete old name */
|
||||||
if (Fcb->PathNameBuffer)
|
if (Fcb->PathNameBuffer)
|
||||||
{
|
{
|
||||||
|
@ -380,13 +387,6 @@ vfatUpdateFCB(
|
||||||
/* Delete from table */
|
/* Delete from table */
|
||||||
vfatDelFCBFromTable(pVCB, Fcb);
|
vfatDelFCBFromTable(pVCB, Fcb);
|
||||||
|
|
||||||
/* Get full path name */
|
|
||||||
Status = vfatMakeFullName(ParentFcb, LongName, ShortName, &Fcb->PathNameU);
|
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Split it properly */
|
/* Split it properly */
|
||||||
Fcb->PathNameBuffer = Fcb->PathNameU.Buffer;
|
Fcb->PathNameBuffer = Fcb->PathNameU.Buffer;
|
||||||
Fcb->DirNameU.Buffer = Fcb->PathNameU.Buffer;
|
Fcb->DirNameU.Buffer = Fcb->PathNameU.Buffer;
|
||||||
|
@ -414,8 +414,8 @@ vfatUpdateFCB(
|
||||||
/* Add to the table */
|
/* Add to the table */
|
||||||
vfatAddFCBToTable(pVCB, Fcb);
|
vfatAddFCBToTable(pVCB, Fcb);
|
||||||
|
|
||||||
/* If we moved accross directories, dereferenced our old parent
|
/* If we moved across directories, dereference our old parent
|
||||||
* We also derefence in case we're just renaming since AddFCBToTable references it
|
* We also dereference in case we're just renaming since AddFCBToTable references it
|
||||||
*/
|
*/
|
||||||
vfatReleaseFCB(pVCB, OldParent);
|
vfatReleaseFCB(pVCB, OldParent);
|
||||||
|
|
||||||
|
@ -887,7 +887,7 @@ vfatGetFCBForFile(
|
||||||
if (parentFCB)
|
if (parentFCB)
|
||||||
{
|
{
|
||||||
vfatReleaseFCB(pVCB, parentFCB);
|
vfatReleaseFCB(pVCB, parentFCB);
|
||||||
parentFCB = 0;
|
parentFCB = NULL;
|
||||||
}
|
}
|
||||||
// fail if element in FCB is not a directory
|
// fail if element in FCB is not a directory
|
||||||
if (!vfatFCBIsDirectory(FCB))
|
if (!vfatFCBIsDirectory(FCB))
|
||||||
|
@ -910,6 +910,8 @@ vfatGetFCBForFile(
|
||||||
if (FileNameU.Length + parentFCB->LongNameU.Length - Length > FileNameU.MaximumLength)
|
if (FileNameU.Length + parentFCB->LongNameU.Length - Length > FileNameU.MaximumLength)
|
||||||
{
|
{
|
||||||
vfatReleaseFCB(pVCB, parentFCB);
|
vfatReleaseFCB(pVCB, parentFCB);
|
||||||
|
*pParentFCB = NULL;
|
||||||
|
*pFCB = NULL;
|
||||||
return STATUS_OBJECT_NAME_INVALID;
|
return STATUS_OBJECT_NAME_INVALID;
|
||||||
}
|
}
|
||||||
RtlMoveMemory(prev + parentFCB->LongNameU.Length / sizeof(WCHAR), curr,
|
RtlMoveMemory(prev + parentFCB->LongNameU.Length / sizeof(WCHAR), curr,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue