<context>
I am trying to work around an annoying Windows bug/feature. When writing a WDDM miniport driver, in order to get Windows to unload the BDD driver attached to the POST display, you need to have the UEFI GOP framebuffer match the range of one of the resource list entries.
Specifically, in dxgkrnl!DpiAddDevice
a call to dxgkrnl!DpiFdoDetectPostDevice
is made where a IoCallDriver
(IRP_MJ_PNP
/IRP_MN_QUERY_RESOURCES
) is made using the PDO passed to AddDevice.
I want to find a way to intercept this call and append an entry to the UEFI framebuffer directly.
In my device (QEMU device), I set up a BAR pointing to the UEFI framebuffer. This works but causes random crashes on some systems. I suspect it is a bug in either the hypervisor I am using or UEFI or both. To isolate the issue, I am trying to write a driver which does not require modifying the BAR.
</context>
I tried to write a lower filter driver that is installed with the function driver. However, I see that the IoCallDriver
is not making it to my filter driver. This makes sense because IoCallDriver
is called with the PDO and not the result of IoAttachDeviceToDeviceStack
. Do I need to write a bus filter driver? Is there an easier way to achieve what I want?