Win32: How to post message to a process run by a different user in Windows?

我与影子孤独终老i 提交于 2019-12-02 12:22:46

问题


We run two application, each of them register the same message using RegisterWindowMessage(): application A as a regular user and application B as administrator in the same user's session on the machine, and those applications would send this message one to another. When A and B were run as a same user everything was fine and we were able to communicate using PostMessage() messaging. Now as application B is run as administrator messages do not come through any more. What can we do about it?

Does this situation mandate us to use other mechanisms (other than messages)?


回答1:


In Windows Vista and later, User Interface Privilege Isolation (UIPI) prevents a lower integrity process from sending window messages to a higher integrity process. In earlier Windows versions, malicious code could attack administrative processes by misusing window messages. By default, UIPI blocks all messages with a value above WM_USER, which includes messages registered via RegisterWindowMessage(). So, in order to allow A to send such messages to B, B must first call ChangeWindowMessageFilter() or ChangeWindowMessageFilterEx() for each blocked message that it wants to receive from lower integrity processes.



来源:https://stackoverflow.com/questions/15440710/win32-how-to-post-message-to-a-process-run-by-a-different-user-in-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!