-
Notifications
You must be signed in to change notification settings - Fork 335
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
ToastNotificationManager.CreateToastNotifier()
crash the app if user change their username without signing out
#4981
Comments
I have a question here, C++/WinRT translates the COM errors to C++ exceptions, specifically winrt::hresult_error. Is this a case of not handling the C++ exception? Does the debugger output show that there is a winrt::hresult_error going uncaught, and does the debugger output that should end up there from RoOriginateError not appear or is it not giving anything useful? If this is a case of why isn't the uncaught exception handler not catching the exception, then this exception is actually being thrown in the window procedure in Windows API parlance. What this means is that in the message pump, the message has been obtained from the message queue using GetMessage and has been dispatched to the window procedure using DispatchMessage, in doing this, there was a brief side trip into kernel mode and then the call to the window procedure came after transitioning back from kernel mode to user mode. This means that any exception thrown in the event handlers has to transition back across kernel mode. In older versions of Windows, that user mode to kernel mode transition will act like an unhandled exception and so the process will be terminated there. As far as I know, it is only Windows 11 24H2 where the exception will properly be transported across kernel mode and get caught on the main thread. So this seems to require OS support, or it hasn't been back ported yet. |
@DarranRowe The |
even this "microsoft-github-policy-service" is broken. please fix that first. |
Describe the bug
My app recently get a user report of crashing. After checking the log, I found it crashes in toast notification related apis. His pc was connected to a domain, and has its username changed, without manual rebooting / manual signing out his account. Some quick experiment found out that if you launch the app first then change your username, calling
ToastNotificationManager.CreateToastNotifier()
will throw exception.This is very corner case, but I think it should be documented (or don't throw exception). The majority of the WinRT api can still function normally in this case.
Steps to reproduce the bug
netplwiz
to do that)Expected behavior
No response
Screenshots
No response
NuGet package version
Windows App SDK 1.6.3: 1.6.241114003
Packaging type
Packaged (MSIX)
Windows version
No response
IDE
Visual Studio 2022
Additional context
Windows 11 23H2
The text was updated successfully, but these errors were encountered: