mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 22:52:54 +00:00
[FASTFAT]
- Prevent code duplication by using vfatAttachFCBToFileObject() for volume opening, instead of rewritting the whole function. - Properly check requested disposition when opening a volume. This fixes bug #5839. Trying to exec \\.\C: in explorer run dialog now ends with an error, as it does on Windows. svn path=/trunk/; revision=50958
This commit is contained in:
parent
2edb1c468c
commit
8de09facc2
1 changed files with 4 additions and 13 deletions
|
@ -433,7 +433,6 @@ VfatCreateFile ( PDEVICE_OBJECT DeviceObject, PIRP Irp )
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
PDEVICE_EXTENSION DeviceExt;
|
PDEVICE_EXTENSION DeviceExt;
|
||||||
ULONG RequestedDisposition, RequestedOptions;
|
ULONG RequestedDisposition, RequestedOptions;
|
||||||
PVFATCCB pCcb;
|
|
||||||
PVFATFCB pFcb = NULL;
|
PVFATFCB pFcb = NULL;
|
||||||
PVFATFCB ParentFcb = NULL;
|
PVFATFCB ParentFcb = NULL;
|
||||||
PWCHAR c, last;
|
PWCHAR c, last;
|
||||||
|
@ -468,9 +467,8 @@ VfatCreateFile ( PDEVICE_OBJECT DeviceObject, PIRP Irp )
|
||||||
if (FileObject->FileName.Length == 0 &&
|
if (FileObject->FileName.Length == 0 &&
|
||||||
(FileObject->RelatedFileObject == NULL || FileObject->RelatedFileObject->FsContext2 != NULL))
|
(FileObject->RelatedFileObject == NULL || FileObject->RelatedFileObject->FsContext2 != NULL))
|
||||||
{
|
{
|
||||||
if (RequestedDisposition == FILE_CREATE ||
|
if (RequestedDisposition != FILE_OPEN ||
|
||||||
RequestedDisposition == FILE_OVERWRITE_IF ||
|
RequestedDisposition != FILE_OPEN_IF)
|
||||||
RequestedDisposition == FILE_SUPERSEDE)
|
|
||||||
{
|
{
|
||||||
return(STATUS_ACCESS_DENIED);
|
return(STATUS_ACCESS_DENIED);
|
||||||
}
|
}
|
||||||
|
@ -481,16 +479,9 @@ VfatCreateFile ( PDEVICE_OBJECT DeviceObject, PIRP Irp )
|
||||||
return(STATUS_NOT_A_DIRECTORY);
|
return(STATUS_NOT_A_DIRECTORY);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pFcb = DeviceExt->VolumeFcb;
|
pFcb = DeviceExt->VolumeFcb;
|
||||||
pCcb = ExAllocateFromNPagedLookasideList(&VfatGlobalData->CcbLookasideList);
|
vfatAttachFCBToFileObject(DeviceExt, pFcb, FileObject);
|
||||||
if (pCcb == NULL)
|
|
||||||
{
|
|
||||||
return (STATUS_INSUFFICIENT_RESOURCES);
|
|
||||||
}
|
|
||||||
RtlZeroMemory(pCcb, sizeof(VFATCCB));
|
|
||||||
FileObject->SectionObjectPointer = &pFcb->SectionObjectPointers;
|
|
||||||
FileObject->FsContext = pFcb;
|
|
||||||
FileObject->FsContext2 = pCcb;
|
|
||||||
pFcb->RefCount++;
|
pFcb->RefCount++;
|
||||||
|
|
||||||
Irp->IoStatus.Information = FILE_OPENED;
|
Irp->IoStatus.Information = FILE_OPENED;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue