Example #1
0
NTSTATUS
NTAPI
NtfsFsdDirectoryControl(PDEVICE_OBJECT DeviceObject,
                        PIRP Irp)
{
    PNTFS_IRP_CONTEXT IrpContext = NULL;
    NTSTATUS Status = STATUS_UNSUCCESSFUL;

    DPRINT1("NtfsDirectoryControl() called\n");

    FsRtlEnterFileSystem();
    ASSERT(DeviceObject);
    ASSERT(Irp);

    NtfsIsIrpTopLevel(Irp);

    IrpContext = NtfsAllocateIrpContext(DeviceObject, Irp);
    if (IrpContext)
    {
        switch (IrpContext->MinorFunction)
        {
            case IRP_MN_QUERY_DIRECTORY:
                Status = NtfsQueryDirectory(IrpContext);
                break;

            case IRP_MN_NOTIFY_CHANGE_DIRECTORY:
                DPRINT1("IRP_MN_NOTIFY_CHANGE_DIRECTORY\n");
                Status = STATUS_NOT_IMPLEMENTED;
                break;

            default:
                Status = STATUS_INVALID_DEVICE_REQUEST;
                break;
        }
    }
    else
        Status = STATUS_INSUFFICIENT_RESOURCES;

    Irp->IoStatus.Status = Status;
    Irp->IoStatus.Information = 0;
    IoCompleteRequest(Irp, IO_NO_INCREMENT);

    if (IrpContext)
        ExFreePoolWithTag(IrpContext, 'PRIN');

    IoSetTopLevelIrp(NULL);
    FsRtlExitFileSystem();
    return Status;
}
Example #2
0
/*
 * FUNCTION: This function manages IRP for various major functions
 * ARGUMENTS:
 *           DriverObject = object describing this driver
 *           Irp = IRP to be passed to internal functions
 * RETURNS: Status of I/O Request
 */
NTSTATUS NTAPI
NtfsFsdDispatch(PDEVICE_OBJECT DeviceObject,
                PIRP Irp)
{
  PNTFS_IRP_CONTEXT IrpContext = NULL;
  NTSTATUS Status = STATUS_UNSUCCESSFUL;
  
  TRACE_(NTFS, "NtfsFsdDispatch()\n");
  
  FsRtlEnterFileSystem();
  ASSERT(DeviceObject);
  ASSERT(Irp);
  
  NtfsIsIrpTopLevel(Irp);
  
  IrpContext = NtfsAllocateIrpContext(DeviceObject, Irp);
  if (IrpContext)
  {
    switch (IrpContext->MajorFunction)
    {
      case IRP_MJ_QUERY_VOLUME_INFORMATION:
      {
        Status = NtfsQueryVolumeInformation(IrpContext);
        break;
      }
      case IRP_MJ_SET_VOLUME_INFORMATION:
      {
        Status = NtfsSetVolumeInformation(IrpContext);
        break;
      }
    }
  }
  else
    Status = STATUS_INSUFFICIENT_RESOURCES;
	
  Irp->IoStatus.Status = Status;
  IoCompleteRequest(Irp, IO_NO_INCREMENT);
	
	if (IrpContext)
    ExFreePoolWithTag(IrpContext, 'PRIN');
	
  IoSetTopLevelIrp(NULL);
  FsRtlExitFileSystem();
  return Status;
}