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

Function Ext2QueryDirectory

Ext4Fsd/dirctl.c:522–1024  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

520
521
522NTSTATUS
523Ext2QueryDirectory (IN PEXT2_IRP_CONTEXT IrpContext)
524{
525 PDEVICE_OBJECT DeviceObject;
526 NTSTATUS Status = STATUS_UNSUCCESSFUL;
527 PEXT2_VCB Vcb = NULL;
528 PFILE_OBJECT FileObject = NULL;
529 PEXT2_FCB Fcb = NULL;
530 PEXT2_MCB Mcb = NULL;
531 PEXT2_CCB Ccb = NULL;
532 PIRP Irp = NULL;
533 PIO_STACK_LOCATION IoStackLocation = NULL;
534
535 ULONG Length;
536 ULONG FileIndex;
537 PUNICODE_STRING FileName;
538 PUCHAR Buffer;
539
540 BOOLEAN RestartScan;
541 BOOLEAN ReturnSingleEntry;
542 BOOLEAN IndexSpecified;
543 BOOLEAN FirstQuery;
544 BOOLEAN FcbResourceAcquired = FALSE;
545
546 USHORT NameLen;
547 FILE_INFORMATION_CLASS fi;
548
549 OEM_STRING Oem = { 0 };
550 UNICODE_STRING Unicode = { 0 };
551 PEXT2_DIR_ENTRY2 pDir = NULL;
552
553 ULONG ByteOffset;
554 ULONG RecLen = 0;
555 ULONG EntrySize = 0;
556
557 EXT2_FILLDIR_CONTEXT fc = { 0 };
558
559 __try {
560
561 ASSERT(IrpContext);
562 ASSERT((IrpContext->Identifier.Type == EXT2ICX) &&
563 (IrpContext->Identifier.Size == sizeof(EXT2_IRP_CONTEXT)));
564
565 DeviceObject = IrpContext->DeviceObject;
566
567 //
568 // This request is not allowed on the main device object
569 //
570 if (IsExt2FsDevice(DeviceObject)) {
571 Status = STATUS_INVALID_DEVICE_REQUEST;
572 __leave;
573 }
574
575 Vcb = (PEXT2_VCB) DeviceObject->DeviceExtension;
576 ASSERT(Vcb != NULL);
577 ASSERT((Vcb->Identifier.Type == EXT2VCB) &&
578 (Vcb->Identifier.Size == sizeof(EXT2_VCB)));
579

Callers 1

Ext2DirectoryControlFunction · 0.85

Calls 13

Ext2GetUserBufferFunction · 0.85
Ext2AllocatePoolFunction · 0.85
ext3_dx_readdirFunction · 0.85
Ext2ReadInodeFunction · 0.85
ext3_rec_len_from_diskFunction · 0.85
Ext2IsWearingCloakFunction · 0.85
Ext2OEMToUnicodeSizeFunction · 0.85
Ext2FreePoolFunction · 0.85
Ext2OEMToUnicodeFunction · 0.85
Ext2ProcessEntryFunction · 0.85
Ext2LockUserBufferFunction · 0.85
Ext2QueueRequestFunction · 0.85

Tested by

no test coverage detected