From 1986a25e6bce7abcf1ea7b22dda47179cff89729 Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Sun, 4 Dec 2005 15:09:07 +0000 Subject: [PATCH] Don't try to create a file, if no parent fcb was found. svn path=/trunk/; revision=19871 --- reactos/drivers/fs/vfat/create.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/reactos/drivers/fs/vfat/create.c b/reactos/drivers/fs/vfat/create.c index c702a30e7e3..b0b8323fb45 100644 --- a/reactos/drivers/fs/vfat/create.c +++ b/reactos/drivers/fs/vfat/create.c @@ -439,7 +439,7 @@ VfatCreateFile ( PDEVICE_OBJECT DeviceObject, PIRP Irp ) ULONG RequestedDisposition, RequestedOptions; PVFATCCB pCcb; PVFATFCB pFcb = NULL; - PVFATFCB ParentFcb; + PVFATFCB ParentFcb = NULL; PWCHAR c, last; BOOLEAN PagingFileCreate = FALSE; BOOLEAN Dots; @@ -543,8 +543,8 @@ VfatCreateFile ( PDEVICE_OBJECT DeviceObject, PIRP Irp ) * fail immediately */ if (Status == STATUS_OBJECT_PATH_NOT_FOUND || - Status == STATUS_INVALID_PARAMETER || - Status == STATUS_DELETE_PENDING) + Status == STATUS_INVALID_PARAMETER || + Status == STATUS_DELETE_PENDING) { if (ParentFcb) { @@ -552,6 +552,11 @@ VfatCreateFile ( PDEVICE_OBJECT DeviceObject, PIRP Irp ) } return(Status); } + if (!NT_SUCCESS(Status) && ParentFcb == NULL) + { + DPRINT1("VfatOpenFile faild for '%wZ', status %x\n", &PathNameU, Status); + return Status; + } /* * If the file open failed then create the required file @@ -564,11 +569,6 @@ VfatCreateFile ( PDEVICE_OBJECT DeviceObject, PIRP Irp ) RequestedDisposition == FILE_SUPERSEDE) { ULONG Attributes; - if (ParentFcb == NULL) - { - ParentFcb = vfatOpenRootFCB (DeviceExt); - ASSERT(ParentFcb != NULL); - } Attributes = Stack->Parameters.Create.FileAttributes; vfatSplitPathName(&PathNameU, NULL, &FileNameU);