ViusalStudio进行调试时无法拖拽文件进程序 - 小众知识

ViusalStudio进行调试时无法拖拽文件进程序

2020-12-16 14:28:26 苏内容
  标签: VS
阅读:6882

ViusalStudio进行调试时无法拖拽文件进程序,而独立运行exe时没有问题。

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

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.

My problem:

I can drag-drop when run the .exe file normally (run from Windows Explorer (WE)) but when debugging in VS2010 I cannot do drag-dropping between my app and WE.

I tried to open WE in privileged mode but still cannot debug either.

Do you have the same problem? If you do, do you have any work-around for it? Please share.



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.

One more thing about turning off UAC is that we need to reboot the OS 


需要禁用UAC中UIPI


经过小编调试,发现是visual studio的权限太高,已管理员权限运行,UAC为了防止攻击就禁止了拖拽,解决办法就是取消denev.exe的管理员权限启动

扩展阅读
相关阅读
© CopyRight 2010-2021, PREDREAM.ORG, Inc.All Rights Reserved. 京ICP备13045924号-1