1) I thought certain MDL fast I/O routines can get called at DISPATCH_LEVEL
2) For perf reasons, causing a page-fault in the middle of a "fast I/O" is
probably a bad idea.
That being said -- these concerns seem silly since we are talking about the
"Null" driver which... is entirely PAGED_CODE and clearly neither #1 or #2
are actual issues.
In Windows, the fast I/o table is part of the DEVICE_OBJECT itself. Not
sure why our driver allocates a separate pool allocation to begin with.
Best regards,
Alex Ionescu
On Mon, Apr 23, 2018 at 1:30 AM, Ged Murphy <gedmurphy.maillists(a)gmail.com>
wrote:
  They're pagable in NT6, I don't know whether
that's the case in NT5.
 Change looks good to me, I'm not really sure why Alex used NNP?
 Perhaps our kernel does/did things slightly differently back when he wrote
 the Null driver?
 Ged.
 -----Original Message-----
 From: Ros-dev <ros-dev-bounces(a)reactos.org> On Behalf Of Thomas Faber
 Sent: Monday, 23 April 2018 07:49
 To: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
 Cc: ros-dev(a)reactos.org
 Subject: Re: [ros-dev] [ros-diffs] 01/01: [NULL] Additions for the Null
 driver.
 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
 Ros-dev(a)reactos.org
 
http://www.reactos.org/mailman/listinfo/ros-dev
 _______________________________________________
 Ros-dev mailing list
 Ros-dev(a)reactos.org
 
http://www.reactos.org/mailman/listinfo/ros-dev