Retired Microsoft Blog disclaimer

This directory is a mirror of retired "Decrypt My World" MSDN blog and is provided as is. All posting authorship and copyrights belong to respective authors.
Original URL: https://blogs.msdn.microsoft.com/alejacma/2010/03/17/sendinput-doesnt-work-but-it-doesnt-return-an-error/
Post name: SendInput doesn’t work but it doesn’t return an error
Original author: Alejandro Campos Magencio
Posting date: 2010-03-17T03:45:00+00:00


Hi all,

The other daya customer of mine was trying to use SendInput to simulate mouse and keyboard input on WinLogon desktop. The API was returning successfully, but it was not doing anything at all.He had no issues to use the API on Default desktop (more info on Desktopshere).

SendInput will just ignore our actions if the calling thread of the API is not the active desktop, and if we have no journal playback access to that desktop.

In this case, the app was on active desktop (app running as localsystem and attached to winsta0\winlogon desktop), but it had no journal playback access on it.

So we added DESKTOP_JOURNALPLAYBACK to the access mask passed to OpenDesktop API when attaching to winsta0\winlogon desktop, and SendInput started working just fine.

Desktop Security and Access Rights
"
DESKTOP_JOURNALPLAYBACK (0x0020L) Required to perform journal playback on a desktop.
"

I hope this helps.

Regards,

 

Alex (Alejandro Campos Magencio)


Share this article:

Comments:

Comments are closed.