Calling D3DKMTSetProcessSchedulingPriorityClass & SetCursorPos from a IddCx UMDF Driver

Hi All,

I am currently working on a high performance Idd driver that is intended to be used in a Virtual Machine to capture the desktop output for sharing with the host. You may already be aware of the project this is for (Looking Glass).

We already have a user space application that works quite well but has some limitations which this driver hopes to resolve. With DXGI DesktopDuplication we have found that we can not get priority over the running application for capture (which is highly desirable) unless we run as the SYSTEM user which then allows us to call D3DKMTSetProcessSchedulingPriorityClass. There is very little documentation on this API, however I can attest that it does indeed work provided you have enough access to call it.

This brings me to the issue at hand, we have hit the same issue in the IddCx driver, we need to call D3DKMTSetProcessSchedulingPriorityClass however this is failing (STATUS_ACCESS_DENIED). I believe this is failing for the same reason I assume SetCursorPos also doesn’t work, in that the driver is not operating within the active console session.

I think (I could be wrong) I need to obtain the TOKEN_ADJUST_SESSIONID privilege in order to update my own SessionID to the current value returned by WTSGetActiveConsoleSessionId, however as a user mode driver, I don’t think there is a way to do this.

We also need SetCursorPos or an alternative, as we need to be able to move the mouse to a specific location when the mouse on the host system is moved into the client window.

Any advice or suggestions on how to accomplish the above would be greatly appreciated.