-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Browser processes killed on WM_QUERYENDSESSION #3700
Comments
We have a similar problem. In our app we need to use I think it would be good if the value of |
I think that it is WM_ENDSESSION that is killing the WebView browser processes. So, if app process stops shutdown before OS tries to shutdown WebView browser processes, WebView2 browser processes would not be killed. This would always work. On the other hand, if the app is set to be shutdown last, WebView2 browser processes could be shutdown before the app process. I've created a tracking work item for this and see whether we can do something about and not impacting normal logoff/shutdown or WebView2 Runtime uninstall scenarios. |
This has been quiet for a while - any progress to report? A corollary to Urmeli0815's suggestion would be for the webview process to always set its own priority to one earlier than default, i.e. 0x27F; would fix a lot of things :) |
At the moment the best solution would be the workaround mentioned by jebihug: the app calls SetProcessShutdownParameters(0x281, 0) so that the app process got notified before WebView2 processes. If the app doesn't have a requirement of being notified of shutdown later than default, this should work. The work item is still active, but not a high priority work item right now. As there are a set of WebView2 processes, and within the group there are relative shutdown orders, it requires some designing for how to solve the issue. |
My application is listening for the WM_QUERYENDSESSION message. If the user has not saved his work then a shutdown reason block is set (ShutdownBlockReasonCreate) and FALSE is returned.
When the user logoff, Windows display a screen showing applications that hang with the message defined with ShutdownBlockReasonCreate. If the user cancel the end of the Windows session because he realize that he haven't saved something, then the application is reshown but the browser processes have been killed and the application show balck screen insteed of the web page.
This is reproductible with the WebView2APISample, is you modify the WM_QUERYENDSESSION with:
Before the user query the end of session:
After the user canceled the end of session:
I think that the browser process should not be terminated before the application is realy being terminated.
If I use SetProcessShutdownParameters(0x3FF, 0); in the main application to set the shutdown priority the "highest" then the problem disappear. Is this because the application receive early the WM_QUERYENDSESSION and respond FALSE and then others processes do not receive the WM_QUERYENDSESSION ?
Is this workaround will always works ?
AB#46194890
The text was updated successfully, but these errors were encountered: