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

Function Ext2OplockRequest

Ext4Fsd/fsctl.c:448–613  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

446 */
447
448NTSTATUS
449Ext2OplockRequest (
450 IN PEXT2_IRP_CONTEXT IrpContext
451)
452{
453 NTSTATUS Status;
454
455 ULONG FsCtrlCode;
456 PDEVICE_OBJECT DeviceObject;
457 PFILE_OBJECT FileObject;
458
459 PIRP Irp = NULL;
460 PIO_STACK_LOCATION IrpSp;
461 PEXTENDED_IO_STACK_LOCATION EIrpSp;
462
463 PEXT2_VCB Vcb = NULL;
464 PEXT2_FCB Fcb = NULL;
465 PEXT2_CCB Ccb = NULL;
466
467 ULONG OplockCount = 0;
468
469 BOOLEAN VcbResourceAcquired = FALSE;
470 BOOLEAN FcbResourceAcquired = FALSE;
471
472 ASSERT(IrpContext);
473
474 __try {
475
476 Irp = IrpContext->Irp;
477 ASSERT(Irp);
478
479 IrpSp = IoGetCurrentIrpStackLocation(Irp);
480 ASSERT(IrpSp);
481 EIrpSp = (PEXTENDED_IO_STACK_LOCATION)IrpSp;
482
483 ASSERT((IrpContext->Identifier.Type == EXT2ICX) &&
484 (IrpContext->Identifier.Size == sizeof(EXT2_IRP_CONTEXT)));
485
486 DeviceObject = IrpContext->DeviceObject;
487
488 //
489 // This request is not allowed on the main device object
490 //
491 if (IsExt2FsDevice(DeviceObject)) {
492 Status = STATUS_INVALID_DEVICE_REQUEST;
493 __leave;
494 }
495
496 Vcb = (PEXT2_VCB) DeviceObject->DeviceExtension;
497
498 ASSERT(Vcb != NULL);
499
500 ASSERT((Vcb->Identifier.Type == EXT2VCB) &&
501 (Vcb->Identifier.Size == sizeof(EXT2_VCB)));
502
503 ASSERT(IsMounted(Vcb));
504
505 FileObject = IrpContext->FileObject;

Callers 1

Ext2UserFsRequestFunction · 0.85

Calls 2

Ext2IsFastIoPossibleFunction · 0.85
Ext2CompleteIrpContextFunction · 0.85

Tested by

no test coverage detected