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. I have the CLSID entries for both 32 and 64 bit versions created (as 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.
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.
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. 0x80270301 is the value of a symbol called E_SHELL_EXTENSION_BLOCKED so I'm assuming it's related. But I can find no information about why it is getting blocked.
Can anyone help point me the right direction?