- Notifications
You must be signed in to change notification settings - Fork550
Description
In a few places (funcBIOC_OID, NPF_BufferedWrite, perhaps others), data from the user is used as input to a function that requires that the memory not be paged out until it is done being processed. To avoid page faults (as in#374), we currently allocate a new buffer from NonPagedPool and copy the user data into it. In cases where the IRP is not pended (i.e. we wait for an event to signal that it is done being processed before returning the buffer to the user), we should be able to use the user data buffer directly instead of copying it. We would need to have a MDL describing the buffer pages and to ensure that they are probed and locked so they cannot be paged out.
I believe that in the case of IRP_MJ_DEVICE_CONTROL, all our IoControl codes (in ioctls.h) specify METHOD_BUFFERED, which means that the user data has already been copied into a nonpaged buffer by the I/O manager. We may still need to create a MDL to describe the buffer, especially for NPF_BufferedWrite because we use several sections of the buffer independently.