Re: [ros-diffs] 01/01: [NULL] Additions for the Null driver.

Thomas Faber <[email protected]>
Newsgroups gmane.os.reactos.kernel
Message-ID <[email protected]>
On 2018-04-22 22:23, Hermès Bélusca-Maïto wrote:
> diff --git a/drivers/base/null/null.c b/drivers/base/null/null.c
> index 610e886ddd..0d4ed541de 100644
> --- a/drivers/base/null/null.c
> +++ b/drivers/base/null/null.c
> @@ -181,26 +199,16 @@ DriverEntry(IN PDRIVER_OBJECT DriverObject,
>       DriverObject->MajorFunction[IRP_MJ_READ] = NullDispatch;
>       DriverObject->MajorFunction[IRP_MJ_LOCK_CONTROL] = NullDispatch;
>       DriverObject->MajorFunction[IRP_MJ_QUERY_INFORMATION] = NullDispatch;
> +    DriverObject->DriverUnload = NullUnload;
>   
> -    /* Allocate the fast I/O dispatch table */
> -    FastIoDispatch = ExAllocatePoolWithTag(NonPagedPool,
> -                                           sizeof(FAST_IO_DISPATCH),
> -                                           'llun');
> -    if (!FastIoDispatch)
> -    {
> -        /* Failed, cleanup */
> -        IoDeleteDevice(DeviceObject);
> -        return STATUS_INSUFFICIENT_RESOURCES;
> -    }
> -
> -    /* Initialize it */
> -    RtlZeroMemory(FastIoDispatch, sizeof(FAST_IO_DISPATCH));
> -    FastIoDispatch->SizeOfFastIoDispatch = sizeof(FAST_IO_DISPATCH);
> +    /* Initialize the fast I/O dispatch table */
> +    RtlZeroMemory(&FastIoDispatch, sizeof(FastIoDispatch));
> +    FastIoDispatch.SizeOfFastIoDispatch = sizeof(FastIoDispatch);
>   
>       /* Setup our pointers */
> -    FastIoDispatch->FastIoRead = NullRead;
> -    FastIoDispatch->FastIoWrite = NullWrite;
> -    DriverObject->FastIoDispatch = FastIoDispatch;
> +    FastIoDispatch.FastIoRead = NullRead;
> +    FastIoDispatch.FastIoWrite = NullWrite;
> +    DriverObject->FastIoDispatch = &FastIoDispatch;


Are you sure FAST_IO_DISPATCH is allowed to be pageable? It seems to
only be used at low IRQLs, so it seems logical. However I see it
allocated nonpaged everywhere else and can't seem to find definitive
documentation on the subject.
(And yes, most filesystem drivers use a static structure, but those
  drivers don't use MmPageEntireDriver)

Thanks,
Thomas

_______________________________________________
Ros-dev mailing list
[email protected]
http://www.reactos.org/mailman/listinfo/ros-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.