-
Notifications
You must be signed in to change notification settings - Fork 61
Description
Description
When using "Runas" and elevating a WebView2 application from non-admin account, there is an issue whereby the msedgewebview2.exe processes are created as the non-admin user
This causes an access denied 0x80004005 error (presumably because the msedgewebview2.exe processes do not have permission to access the administrator application data)
Version
SDK: 1.0.705.50
Runtime: 88.0.705.68 (x64)
Framework: Win32
OS: Windows 10 20H2 Build 19042.804
Repro Steps
Login as a user who does not have administrative privileges
Run the application elevated as an adminstrative user by using "runas"
The application should then call CreateCoreWebView2EnvironmentWithOptions as below:
Set the userDataFolder to a directory within the users application data folder, for example the environment expansion of "%APPDATA%\MyApplication" i.e "C:\Users\Administrator\AppData\Local\MyApplication"
CreateCoreWebView2EnvironmentWithOptions(
NULL,
szAppData,
NULL,
Callback(this,
&CMyApp::OnWebView2EnvironmentCreated).Get());
The expected behaviour is that this would work fine and the application would be running on the desktop, with an elevated administrator token.
What actually happens is that the EnvironmentCompletedHandler produces an error code of 0x80004005.
Running process explorer you can see that some "msedgewebview2.exe" processes are started, and they are all running as the standard user rather than the administrator/elevated user. I believe that this is incorrect behaviour.