0,
FALSE);
- if (Status == STATUS_VERIFY_REQUIRED)
-
- {
- PDEVICE_OBJECT DeviceToVerify;
-
- DPRINT ("Media change detected!\n");
- DPRINT ("Device %p\n", DeviceExt->StorageDevice);
-
- /* Find the device to verify and reset the thread field to empty value again. */
- DeviceToVerify = IoGetDeviceToVerify (PsGetCurrentThread ());
- IoSetDeviceToVerify (PsGetCurrentThread (), NULL);
- Status = IoVerifyVolume (DeviceToVerify,
- FALSE);
- }
if (!NT_SUCCESS(Status))
{
DPRINT ("Status %lx\n", Status);
NTSTATUS Status = STATUS_SUCCESS;
PDEVICE_EXTENSION DeviceExt;
ULONG RequestedDisposition, RequestedOptions;
- PVFATCCB pCcb;
PVFATFCB pFcb = NULL;
PVFATFCB ParentFcb = NULL;
PWCHAR c, last;
if (FileObject->FileName.Length == 0 &&
(FileObject->RelatedFileObject == NULL || FileObject->RelatedFileObject->FsContext2 != NULL))
{
- if (RequestedDisposition == FILE_CREATE ||
- RequestedDisposition == FILE_OVERWRITE_IF ||
- RequestedDisposition == FILE_SUPERSEDE)
+ if (RequestedDisposition != FILE_OPEN ||
+ RequestedDisposition != FILE_OPEN_IF)
{
return(STATUS_ACCESS_DENIED);
}
return(STATUS_NOT_A_DIRECTORY);
}
#endif
+
pFcb = DeviceExt->VolumeFcb;
- pCcb = ExAllocateFromNPagedLookasideList(&VfatGlobalData->CcbLookasideList);
- if (pCcb == NULL)
- {
- return (STATUS_INSUFFICIENT_RESOURCES);
- }
- RtlZeroMemory(pCcb, sizeof(VFATCCB));
- FileObject->SectionObjectPointer = &pFcb->SectionObjectPointers;
- FileObject->FsContext = pFcb;
- FileObject->FsContext2 = pCcb;
+ vfatAttachFCBToFileObject(DeviceExt, pFcb, FileObject);
pFcb->RefCount++;
Irp->IoStatus.Information = FILE_OPENED;
RequestedDisposition == FILE_SUPERSEDE)
{
ULONG Attributes;
- Attributes = Stack->Parameters.Create.FileAttributes;
+ Attributes = Stack->Parameters.Create.FileAttributes & ~FILE_ATTRIBUTE_NORMAL;
vfatSplitPathName(&PathNameU, NULL, &FileNameU);
Status = VfatAddEntry (DeviceExt, &FileNameU, &pFcb, ParentFcb, RequestedOptions,