Now, I am create a drive in mode kernel (KMDF). How can I get current position of the mouse cursor?
Thank you for your help.
Now, I am create a drive in mode kernel (KMDF). How can I get current position of the mouse cursor?
Thank you for your help.
No, there is not. Cursor position is entirely a user session abstraction, kernel mode drivers report raw deltas in movement and button state and that is merged across all raw input streams into one coherent mouse position (in win32k.sys which projects this into user mode). While GetCursorPos() is available in UMDF, UMDF drivers run in a different session than the logged in user, so it would not do what you want.
What are you trying to do with the position of the mouse? Once you have computed whatever the converter function does, do you need to update the position of the mouse? Why does this have to be done in a driver vs an application running as the user?
Cursor position is not available in KM. What bigger problem are you trying to solve?
Thank you always for your contribution.
I have to make a driver that receives data from serial port COM and this raw data to pass through a converter(function) that was given to me.
Precisely, this converter uses GetCursorPos() method of win32. So when I compile and deploy my KMDF project it gives me error.
Is there any other way to retrieves the position of the mouse cursor, in screen coordinates?
5 people are following this question.