mirror of
https://github.com/reactos/reactos.git
synced 2025-04-27 09:00:27 +00:00
Alex Vlasov
- Implement FatRead as a wrapper around internal helper FatiRead. - Stubplement FatiRead. svn path=/trunk/; revision=39029
This commit is contained in:
parent
d86e5e4347
commit
093e6f6d3c
1 changed files with 58 additions and 1 deletions
|
@ -4,6 +4,7 @@
|
||||||
* FILE: drivers/filesystems/fastfat/rw.c
|
* FILE: drivers/filesystems/fastfat/rw.c
|
||||||
* PURPOSE: Read/write support
|
* PURPOSE: Read/write support
|
||||||
* PROGRAMMERS: Aleksey Bragin (aleksey@reactos.org)
|
* PROGRAMMERS: Aleksey Bragin (aleksey@reactos.org)
|
||||||
|
* Alexey Vlasov
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* INCLUDES *****************************************************************/
|
/* INCLUDES *****************************************************************/
|
||||||
|
@ -13,12 +14,68 @@
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
|
FatiRead(PFAT_IRP_CONTEXT IrpContext)
|
||||||
|
{
|
||||||
|
CSHORT FcbType;
|
||||||
|
ULONG NumberOfBytes;
|
||||||
|
|
||||||
|
FcbType = *((PCSHORT) IrpContext->FileObject->FsContext);
|
||||||
|
NumberOfBytes = IrpContext->Stack->Parameters.Read.Length;
|
||||||
|
if (NumberOfBytes == 0)
|
||||||
|
{
|
||||||
|
FatCompleteRequest(IrpContext, IrpContext->Irp, STATUS_SUCCESS);
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
//if (FcbType == FAT_NTC_VCB)
|
||||||
|
|
||||||
|
DPRINT1("FatiRead()\n");
|
||||||
|
return STATUS_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
FatRead(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
FatRead(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
||||||
{
|
{
|
||||||
|
NTSTATUS Status;
|
||||||
|
BOOLEAN TopLevel, CanWait;
|
||||||
|
PFAT_IRP_CONTEXT IrpContext;
|
||||||
|
|
||||||
|
CanWait = TRUE;
|
||||||
|
TopLevel = FALSE;
|
||||||
|
Status = STATUS_INVALID_DEVICE_REQUEST;
|
||||||
|
/* Get CanWait flag */
|
||||||
|
if (IoGetCurrentIrpStackLocation(Irp)->FileObject != NULL)
|
||||||
|
CanWait = IoIsOperationSynchronous(Irp);
|
||||||
|
|
||||||
|
/* Enter FsRtl critical region */
|
||||||
|
FsRtlEnterFileSystem();
|
||||||
|
|
||||||
|
if (DeviceObject != FatGlobalData.DiskDeviceObject)
|
||||||
|
{
|
||||||
|
/* Set Top Level IRP if not set */
|
||||||
|
if (IoGetTopLevelIrp() == NULL)
|
||||||
|
{
|
||||||
|
IoSetTopLevelIrp(Irp);
|
||||||
|
TopLevel = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Build an irp context */
|
||||||
|
IrpContext = FatBuildIrpContext(Irp, CanWait);
|
||||||
|
|
||||||
|
/* Perform the actual read */
|
||||||
|
Status = FatiRead(IrpContext);
|
||||||
|
|
||||||
|
/* Restore top level Irp */
|
||||||
|
if (TopLevel)
|
||||||
|
IoSetTopLevelIrp(NULL);
|
||||||
|
}
|
||||||
|
/* Leave FsRtl critical region */
|
||||||
|
FsRtlExitFileSystem();
|
||||||
|
|
||||||
DPRINT1("FatRead()\n");
|
DPRINT1("FatRead()\n");
|
||||||
return STATUS_NOT_IMPLEMENTED;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
|
|
Loading…
Reference in a new issue