简体   繁体   English

在开始菜单搜索中,覆盖“以管理员身份运行”的COM shell扩展失败

[英]COM shell extension to override “Run as Administrator” fails in start menu search

I'm working on a COM server DLL to override the "Run as Administrator" in Windows 10. I'm doing this by setting the DLL GUID as DelegateExecute on the Computer\\HKEY_CLASSES_ROOT\\exefile\\shell\\runas\\command registry key. 我正在使用COM服务器DLL来覆盖Windows 10中的“以管理员身份运行”。我这样做是通过在Computer \\ HKEY_CLASSES_ROOT \\ exefile \\ shell \\ runas \\ command注册表项上将DLL GUID设置为DelegateExecute来实现的。 I have the CLSID entries for both 32 and 64 bit versions created (as InprocServer32). 我创建了32位和64位版本的CLSID条目(作为InprocServer32)。

This is working fine for the most part. 这在大多数情况下工作得很好。 Right clicking exe files in explorer and running as administrator is delegated to the DLL, if an installer tries to launch with elevated privileges it gets delegated to the DLL, right clicking on start menu items is delegated, and so on. 右键单击资源管理器中的exe文件并以管理员身份运行委派给DLL,如果安装程序尝试使用提升的权限启动,则会委派给DLL,右键单击开始菜单项,等等。

The only problem is that when using the start menu search and hitting an item that is listed as "Run command" (search for "wusa" for example) then clicking "run as administrator" in the right side of the search (or by right clicking the result) does nothing. 唯一的问题是,当使用开始菜单搜索并点击列为“运行命令”的项目(例如搜索“wusa”),然后点击搜索右侧的“以管理员身份运行”(或右侧)点击结果)什么也没做。

Using Process Monitor from sysinternals I can see that RuntimeBroker.exe correctly reads through the registry and detects that my DLL is the one need to be called but then it stops right after getting the filename and instead looks at a registry key called ...\\AppActivationErrorHandlers\\80270301 and then stops. 使用sysinternals中的Process Monitor我可以看到RuntimeBroker.exe正确读取注册表并检测到我的DLL是需要调用的DLL,但它在获取文件名后立即停止,而是查看名为...的注册表项。 AppActivationErrorHandlers \\ 80270301然后停止。 0x80270301 is the value of a symbol called E_SHELL_EXTENSION_BLOCKED so I'm assuming it's related. 0x80270301是一个名为E_SHELL_EXTENSION_BLOCKED的符号的值,所以我假设它是相关的。 But I can find no information about why it is getting blocked. 但我找不到有关它被阻止的原因的信息。

Can anyone help point me the right direction? 任何人都可以帮我指出正确的方向吗?

I solved the problem by switching from an InprocServer (DLL) to a LocalServer (EXE). 我通过从InprocServer(DLL)切换到LocalServer(EXE)解决了这个问题。 Presumably because the security requirements is lower for an out-of-proc exe is lower than the DLL. 大概是因为进程外exe的安全性要求低于DLL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM