ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

NTSTATUS NTAPI NullDispatch ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 81 of file null.c.

Referenced by DriverEntry().

{
    PIO_STACK_LOCATION IoStack = IoGetCurrentIrpStackLocation(Irp);
    NTSTATUS Status;
    PFILE_OBJECT FileObject;
    ULONG Length;
    PAGED_CODE();

    /* Get the file object and check what kind of request this is */
    FileObject = IoStack->FileObject;
    switch (IoStack->MajorFunction)
    {
        case IRP_MJ_CREATE:
        case IRP_MJ_CLOSE:

            /* Check if this is synch I/O */
            if (FileObject->Flags & FO_SYNCHRONOUS_IO)
            {
                /* Set distinguished value for Cc */
                FileObject->PrivateCacheMap = (PVOID)1;
            }

            /* Complete successfully */
            Irp->IoStatus.Status = STATUS_SUCCESS;
            Irp->IoStatus.Information = 0;
            break;

         case IRP_MJ_READ:

            /* Return as if we read the entire file */
            Irp->IoStatus.Status = STATUS_END_OF_FILE;
            Irp->IoStatus.Information = 0;
            break;

        case IRP_MJ_WRITE:

            /* Return as if we wrote the entire request */
            Irp->IoStatus.Status = STATUS_SUCCESS;
            Irp->IoStatus.Information = IoStack->Parameters.Write.Length;
            break;

        case IRP_MJ_LOCK_CONTROL:

            /* Dummy */
            Irp->IoStatus.Status = STATUS_SUCCESS;
            Irp->IoStatus.Information = 0;
            break;

        case IRP_MJ_QUERY_INFORMATION:

            /* Get the length inputted and do the request */
            Length = IoStack->Parameters.QueryFile.Length;
            Irp->IoStatus.Status = NullQueryFileInformation(Irp->AssociatedIrp.
                                                            SystemBuffer,
                                                            &Length,
                                                            IoStack->
                                                            Parameters.
                                                            QueryFile.
                                                            FileInformationClass);

            /* Return the actual length */
            Irp->IoStatus.Information = Length;
            break;
    }

    /* Complete the request */
    Status = Irp->IoStatus.Status;
    IoCompleteRequest(Irp, IO_NO_INCREMENT);
    return Status;
}

Generated on Sun May 27 2012 05:21:33 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.