MCPcopy Create free account
hub / github.com/bobranten/Ext4Fsd / Ext2GetRetrievalPointers

Function Ext2GetRetrievalPointers

Ext4Fsd/fsctl.c:908–1155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

906
907
908NTSTATUS
909Ext2GetRetrievalPointers (
910 IN PEXT2_IRP_CONTEXT IrpContext
911)
912{
913 PIRP Irp = NULL;
914 PIO_STACK_LOCATION IrpSp;
915 PEXTENDED_IO_STACK_LOCATION EIrpSp;
916
917 PDEVICE_OBJECT DeviceObject;
918 PFILE_OBJECT FileObject;
919
920 PEXT2_VCB Vcb = NULL;
921 PEXT2_FCB Fcb = NULL;
922 PEXT2_CCB Ccb = NULL;
923
924 PSTARTING_VCN_INPUT_BUFFER SVIB;
925 PRETRIEVAL_POINTERS_BUFFER RPSB;
926
927 PEXT2_EXTENT Chain = NULL;
928 PEXT2_EXTENT Extent = NULL;
929
930 LONGLONG Vbn = 0;
931 ULONG Length = 0;
932 ULONG i = 0;
933
934 ULONG UsedSize = 0;
935 ULONG InputSize;
936 ULONG OutputSize;
937
938 NTSTATUS Status = STATUS_SUCCESS;
939
940 BOOLEAN FcbResourceAcquired = FALSE;
941
942 __try {
943
944 ASSERT(IrpContext);
945 Irp = IrpContext->Irp;
946 ASSERT(Irp);
947
948 IrpSp = IoGetCurrentIrpStackLocation(Irp);
949 EIrpSp = (PEXTENDED_IO_STACK_LOCATION)IrpSp;
950 ASSERT(IrpSp);
951
952 InputSize = EIrpSp->Parameters.FileSystemControl.InputBufferLength;
953 OutputSize = EIrpSp->Parameters.FileSystemControl.OutputBufferLength;
954
955 ASSERT((IrpContext->Identifier.Type == EXT2ICX) &&
956 (IrpContext->Identifier.Size == sizeof(EXT2_IRP_CONTEXT)));
957
958 DeviceObject = IrpContext->DeviceObject;
959
960 /* This request is not allowed on the main device object */
961 if (IsExt2FsDevice(DeviceObject)) {
962 Status = STATUS_INVALID_DEVICE_REQUEST;
963 __leave;
964 }
965

Callers 1

Ext2UserFsRequestFunction · 0.85

Calls 7

Ext2GetUserBufferFunction · 0.85
Ext2BuildExtentsFunction · 0.85
Ext2DestroyExtentChainFunction · 0.85
Ext2QueryExtentMappingsFunction · 0.85
Ext2FreePoolFunction · 0.85
Ext2QueueRequestFunction · 0.85
Ext2CompleteIrpContextFunction · 0.85

Tested by

no test coverage detected