In some cases driver sends IOCTLS to the underlying devices.
It uses IoBuildDeviceIoControlRequest() function to allocate
IOCTL IRP.
This function allocates threaded IRP which has a number of
limitations for contexts it may be sent from.
In particular it must be sent from PASSIVE_LEVEL
and non-arbitrary thread context to complete successfully.
Since this is not always true for contexts driver sends IRPs from,
never completed IOCTLs were observed on load tests.
This patch fixes the problem by using IoAllocateIrp()
function to allocate IOCTL IRPs.
Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
This makes include policy more strict and ensures
all system includes properly wrapped with extern "C"
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
API doesn't fill IOSTATUS->STATUS field when IRP
processing finished synchronously. In this case IoCallDriver
returns proper status directly.
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
For some requests API requires iostatus->status
IRP field to be initialized with STATUS_NOT_SUPPORTED.
Driver verifier checks this and produces BSOD on violation.
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>