microsoft / WindowsAppSDK

The Windows App SDK empowers all Windows desktop apps with modern Windows UI, APIs, and platform features, including back-compat support, shipped via NuGet.
https://docs.microsoft.com/windows/apps/windows-app-sdk/
MIT License
3.86k stars 328 forks source link

WinAppSdk apps should default to using safe and performant process defaults #1727

Open ChrisGuzak opened 3 years ago

ChrisGuzak commented 3 years ago

Summary

By default, Win32 processes have some unfortunate behavior due to the compatibility implications of changing them. For example COM will catch crashes on incoming RPC calls and continue execution. This can be modified using IGlobalOptions and specifying COMGLB_EXCEPTION_HANDLING as COMGLB_EXCEPTION_DONOT_HANDLE_ANY. Another option is enabled using HeapSetInformation(..., HeapEnableTerminationOnCorruption, ...) There are also performance and flexibility related options, that currently are private, enabling proxies to be agile, sharing the FTM instance, etc. There are also reliability options, causing app termination when an invalid handle is used, ProcessStrictHandleCheck.

Rationale

Important Notes

Open Questions

sylveon commented 2 years ago

ProcessStrictHandleCheck runs into compat issues with third party libraries. If it is enabled by default, there should be an opt-out

https://github.com/discord/gamesdk-and-dispatch/issues/37