MicrosoftEdge / MicrosoftEdge/WebView2Feedback
0x80070002 on CreateCoreWebView2EnvironmentWithOptions API whe user is logged off
@LiangTheDev is already working on this.
Since Apr 28, 2023.
- Dominant language
- PowerShell
- Stars
- 526
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
Hi all,
i got some situations that i would to debug better, maybe it's bug.
I have to launch my WebView2-base app from a service with Administrator privileges and it's not possibile, i know. To accomplish that, my application before build the WebView enviroment, check if itself is Administrator and re-launch itself with a less priviliged user ( CreateProcessAsUser API ).
The complete context is:
- A windows service run in a machine on wich i can interact with command remotly. On that machine a user could be generally be logged or not.
- A command create my WebView2 app, that being child of the service, that has Administrator privileges
- App can realize that, and create an identical process but with another well know user ( user that resides on the service machine obv )
- App run, get some statistic ad network analitycs e close itself
If all this process is executed when a user is logged on the service machne, it completes successfully. But when i got no user logged the api CreateCoreWebView2EnvironmentWithOptions fails with code 0x80070002 (Cannot find the specified file ).
I call CreateCoreWebView2EnvironmentWithOptions whit a custom UserDataFolder but it's an absolute path ad even with nullptr it fails.
I expected trouble with the CreateProcessAsAuser API in that context, but it creates the process fine. What could it be? Which file search the CreateCoreWebView2EnvironmentWithOptions? Can i have some hint on how to debug it? I can't realize why a file or directory can be found when a user logged instead of not.
PS: The fact of carrying out this procedure with a non logged in user was a constraint that I knew I had since the beginning of the project ( about 6 months ago ).
I seem to remember getting it to work but I don't remember the evergreen runtime versions... could something have changed?
Version
Browser Version 112.0.1722.48
WebView Version 1.0.1722.45
Framework: Win32
OS: Win10
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.