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

Function Ext2GetRetrievalPointerBase

Ext4Fsd/fsctl.c:1157–1288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1155}
1156
1157NTSTATUS
1158Ext2GetRetrievalPointerBase (
1159 IN PEXT2_IRP_CONTEXT IrpContext
1160)
1161{
1162 PIRP Irp = NULL;
1163 PIO_STACK_LOCATION IrpSp;
1164 PEXTENDED_IO_STACK_LOCATION EIrpSp;
1165
1166 PDEVICE_OBJECT DeviceObject;
1167 PFILE_OBJECT FileObject;
1168
1169 PEXT2_VCB Vcb = NULL;
1170 PEXT2_FCB Fcb = NULL;
1171 PEXT2_CCB Ccb = NULL;
1172
1173 PLARGE_INTEGER FileAreaOffset;
1174
1175 ULONG OutputSize;
1176
1177 NTSTATUS Status = STATUS_SUCCESS;
1178
1179 BOOLEAN FcbResourceAcquired = FALSE;
1180
1181 __try {
1182
1183 ASSERT(IrpContext);
1184 Irp = IrpContext->Irp;
1185 ASSERT(Irp);
1186
1187 IrpSp = IoGetCurrentIrpStackLocation(Irp);
1188 EIrpSp = (PEXTENDED_IO_STACK_LOCATION)IrpSp;
1189 ASSERT(IrpSp);
1190
1191 OutputSize = EIrpSp->Parameters.FileSystemControl.OutputBufferLength;
1192
1193 ASSERT((IrpContext->Identifier.Type == EXT2ICX) &&
1194 (IrpContext->Identifier.Size == sizeof(EXT2_IRP_CONTEXT)));
1195
1196 DeviceObject = IrpContext->DeviceObject;
1197
1198 /* This request is not allowed on the main device object */
1199 if (IsExt2FsDevice(DeviceObject)) {
1200 Status = STATUS_INVALID_DEVICE_REQUEST;
1201 __leave;
1202 }
1203
1204 Vcb = (PEXT2_VCB) DeviceObject->DeviceExtension;
1205 ASSERT(Vcb != NULL);
1206 ASSERT((Vcb->Identifier.Type == EXT2VCB) &&
1207 (Vcb->Identifier.Size == sizeof(EXT2_VCB)));
1208 ASSERT(IsMounted(Vcb));
1209
1210 FileObject = IrpContext->FileObject;
1211 Fcb = (PEXT2_FCB) FileObject->FsContext;
1212
1213 /* check Fcb is valid or not */
1214 if (Fcb == NULL || Fcb->Identifier.Type == EXT2VCB) {

Callers 1

Ext2UserFsRequestFunction · 0.85

Calls 3

Ext2GetUserBufferFunction · 0.85
Ext2QueueRequestFunction · 0.85
Ext2CompleteIrpContextFunction · 0.85

Tested by

no test coverage detected