mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 20:03:12 +00:00
[FASTFAT_NEW]
- Plug in a commented out notification call in case of cleanup. - Implement a case of device info query. - Implement lock control. svn path=/trunk/; revision=48518
This commit is contained in:
parent
aac1625f1f
commit
11f2175562
3 changed files with 109 additions and 6 deletions
|
@ -303,12 +303,11 @@ FatiCleanup(PFAT_IRP_CONTEXT IrpContext, PIRP Irp)
|
||||||
if (FlagOn(Fcb->State, FCB_STATE_DELETE_ON_CLOSE) &&
|
if (FlagOn(Fcb->State, FCB_STATE_DELETE_ON_CLOSE) &&
|
||||||
Fcb->Header.AllocationSize.LowPart == 0)
|
Fcb->Header.AllocationSize.LowPart == 0)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
FatNotifyReportChange(IrpContext,
|
||||||
/*FatNotifyReportChange(IrpContext,
|
|
||||||
Vcb,
|
Vcb,
|
||||||
Fcb,
|
Fcb,
|
||||||
FILE_NOTIFY_CHANGE_FILE_NAME,
|
FILE_NOTIFY_CHANGE_FILE_NAME,
|
||||||
FILE_ACTION_REMOVED );*/
|
FILE_ACTION_REMOVED);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Remove the entry from the splay table if the file was deleted */
|
/* Remove the entry from the splay table if the file was deleted */
|
||||||
|
|
|
@ -13,12 +13,98 @@
|
||||||
|
|
||||||
/* FUNCTIONS ****************************************************************/
|
/* FUNCTIONS ****************************************************************/
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
|
FatiLockControl(PFAT_IRP_CONTEXT IrpContext, PIRP Irp)
|
||||||
|
{
|
||||||
|
PIO_STACK_LOCATION IrpSp;
|
||||||
|
TYPE_OF_OPEN TypeOfOpen;
|
||||||
|
PVCB Vcb;
|
||||||
|
PFCB Fcb;
|
||||||
|
PCCB Ccb;
|
||||||
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
/* Get IRP stack location */
|
||||||
|
IrpSp = IoGetCurrentIrpStackLocation(Irp);
|
||||||
|
|
||||||
|
/* Determine type of open */
|
||||||
|
TypeOfOpen = FatDecodeFileObject(IrpSp->FileObject, &Vcb, &Fcb, &Ccb);
|
||||||
|
|
||||||
|
/* Only user file open is allowed */
|
||||||
|
if (TypeOfOpen != UserFileOpen)
|
||||||
|
{
|
||||||
|
FatCompleteRequest(IrpContext, Irp, STATUS_INVALID_PARAMETER);
|
||||||
|
return STATUS_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Acquire shared FCB lock */
|
||||||
|
if (!FatAcquireSharedFcb(IrpContext, Fcb))
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
//Status = FatFsdPostRequest(IrpContext, Irp);
|
||||||
|
Status = STATUS_NOT_IMPLEMENTED;
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check oplock state */
|
||||||
|
Status = FsRtlCheckOplock(&Fcb->Fcb.Oplock,
|
||||||
|
Irp,
|
||||||
|
IrpContext,
|
||||||
|
FatOplockComplete,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
if (Status != STATUS_SUCCESS)
|
||||||
|
{
|
||||||
|
/* Release FCB lock */
|
||||||
|
FatReleaseFcb(IrpContext, Fcb);
|
||||||
|
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Process the lock */
|
||||||
|
Status = FsRtlProcessFileLock(&Fcb->Fcb.Lock, Irp, NULL);
|
||||||
|
|
||||||
|
/* Update Fast I/O state */
|
||||||
|
Fcb->Header.IsFastIoPossible = FatIsFastIoPossible(Fcb);
|
||||||
|
|
||||||
|
/* Complete the request */
|
||||||
|
FatCompleteRequest(IrpContext, NULL, 0);
|
||||||
|
|
||||||
|
/* Release FCB lock */
|
||||||
|
FatReleaseFcb(IrpContext, Fcb);
|
||||||
|
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
FatLockControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
FatLockControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
||||||
{
|
{
|
||||||
|
PFAT_IRP_CONTEXT IrpContext;
|
||||||
|
NTSTATUS Status;
|
||||||
|
BOOLEAN TopLevel;
|
||||||
|
|
||||||
DPRINT1("FatLockControl()\n");
|
DPRINT1("FatLockControl()\n");
|
||||||
return STATUS_NOT_IMPLEMENTED;
|
|
||||||
|
/* Enter FsRtl critical region */
|
||||||
|
FsRtlEnterFileSystem();
|
||||||
|
|
||||||
|
/* Set Top Level IRP if not set */
|
||||||
|
TopLevel = FatIsTopLevelIrp(Irp);
|
||||||
|
|
||||||
|
/* Build an irp context */
|
||||||
|
IrpContext = FatBuildIrpContext(Irp, IoIsOperationSynchronous(Irp));
|
||||||
|
|
||||||
|
/* Call internal function */
|
||||||
|
Status = FatiLockControl(IrpContext, Irp);
|
||||||
|
|
||||||
|
/* Reset Top Level IRP */
|
||||||
|
if (TopLevel) IoSetTopLevelIrp(NULL);
|
||||||
|
|
||||||
|
/* Leave FsRtl critical region */
|
||||||
|
FsRtlExitFileSystem();
|
||||||
|
|
||||||
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
|
|
|
@ -83,6 +83,25 @@ FatiQueryFsSizeInfo(PVCB Vcb,
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
|
FatiQueryFsDeviceInfo(PVCB Vcb,
|
||||||
|
PFILE_FS_DEVICE_INFORMATION Buffer,
|
||||||
|
PLONG Length)
|
||||||
|
{
|
||||||
|
/* Deduct the minimum written length */
|
||||||
|
*Length -= sizeof(FILE_FS_DEVICE_INFORMATION);
|
||||||
|
|
||||||
|
/* Zero it */
|
||||||
|
RtlZeroMemory(Buffer, sizeof(FILE_FS_DEVICE_INFORMATION));
|
||||||
|
|
||||||
|
/* Set values */
|
||||||
|
Buffer->DeviceType = FILE_DEVICE_DISK;
|
||||||
|
Buffer->Characteristics = Vcb->TargetDeviceObject->Characteristics;
|
||||||
|
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
FatiQueryVolumeInfo(PFAT_IRP_CONTEXT IrpContext, PIRP Irp)
|
FatiQueryVolumeInfo(PFAT_IRP_CONTEXT IrpContext, PIRP Irp)
|
||||||
|
@ -142,8 +161,7 @@ FatiQueryVolumeInfo(PFAT_IRP_CONTEXT IrpContext, PIRP Irp)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FileFsDeviceInformation:
|
case FileFsDeviceInformation:
|
||||||
UNIMPLEMENTED
|
Status = FatiQueryFsDeviceInfo(Vcb, Buffer, &Length);
|
||||||
//Status = FatiQueryFsDeviceInfo(IrpContext, Vcb, Buffer, &Length);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FileFsAttributeInformation:
|
case FileFsAttributeInformation:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue