Cannot drag and drop to debugged-application run from a privileged-run Visual Studio 2010

前端 未结 2 1787
醉梦人生
醉梦人生 2021-01-11 17:28

I\'m debugging my application which has drag-n-drop features in Visual Studio 2010. I have to run the IDE in privileged mode since some of my project required so.

相关标签:
2条回答
  • 2021-01-11 17:59

    This is by design, an aspect of UAC called UIPI (User Interface Privilege Isolation). It prevents a non-elevated process from hijacking an elevated one through Windows messages or drag and drop. It protects against shatter attacks. There is a way for the elevated process to explicitly allow messages with ChangeWindowMessageFilter. But not for drag and drop, it isn't message based.

    There is no decent api-level workaround for this, it has to be done declaratively. The manifest for the program needs to use uiaccess = true, be code-signed with a certificate from an approved authority and be installed in c:\windows or c:\program files.

    0 讨论(0)
  • 2021-01-11 18:14

    Another workaround is to run the debug binary from Windows Explorer and attach to the process from within Visual Studio via the "Tools" or "Debug" menu. I have verified that drag events are received in the debugger when using this approach.

    0 讨论(0)
提交回复
热议问题