Hi, all NT driver experts,
I’m doing some hypercall experiments on Windows Server 2008. Although from another discussion thread (titled “WinHV WDK Library”) I knew that it is not recommended (by Jake) that we use hypercall to build end-to-end tasks due to VM state issue, I’m still doing the experiment just to have a feeling how hypercall is used.
My question is, according to the documents, hypervisor will signal a SINTx interrupt after it posts a message to a partition. But how do I catch that interrupt in my driver?
More specifically, I read that the SINTx is associated with an interrupt vector. So it looks like I should somehow get an unused interrupt vector, register my ISR with the vector, and fill that vector in the SINTx register. Right?
But, there are some facts with my driver. My driver which calls the hypercall is a KMDF driver. Moreover, because its only purpose is to call the hypercalls, it is written as a software-only, non-PnP driver which does not manage any hardware (and whose device object is created as a KMDF control device object). Therefore, the EvtDevicePrepareHardware callback, which a PnP driver gets its device hardware resource information from PnP Manager, won’t get called for my non-PnP driver, and therefore my driver cannot get the “assigned” hardware resources, including the interrupt vector.
On the other hand, I also read that IoReportResourceForDetection and IoReportDetectedDevice could be used for non-PnP driver to request for hardware resources, but my question is how do I know which interrupt vector is unused for me to fill in the CM_RESOURCE_LIST structure?
Lastly, I’m thinking since my purpose is to register my ISR with some interrupt vector, maybe there is some simpler way to bypass the above mechanisms? For example, any simpler, more direct kernel routines which can achieve this purpose?
Thanks a lot for any input!
Best regards,
Chengwei