You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to invoke the release methods properly, we need to understand whether they were successful. But they're all over the map on this. For example:
I believe the release methods will also need to understand what constitutes a "invalid" or sentinel value as well. Some APIs use NULL while others use INVALID_HANDLE_VALUE, and the two aren't always equivalent (but sometimes they are). If a safe handle needs to condition the close on whether the handle value is valid, it will need to know what an invalid handle looks like.
WIL's unique_any is a good example of all the data that's actually required to build a safe handle around the numerous Win32 handle types.
Activity
AArnott commentedon Nov 14, 2020
One really weird outlier is
ClosePrivateNamespacewhich takes two parameters. I think we'll just have to avoid generating aSafeHandlefor that one.Robo210 commentedon Mar 11, 2021
I believe the release methods will also need to understand what constitutes a "invalid" or sentinel value as well. Some APIs use NULL while others use INVALID_HANDLE_VALUE, and the two aren't always equivalent (but sometimes they are). If a safe handle needs to condition the close on whether the handle value is valid, it will need to know what an invalid handle looks like.
WIL's unique_any is a good example of all the data that's actually required to build a safe handle around the numerous Win32 handle types.
AArnott commentedon Mar 17, 2021
ReleaseDCis another odd case that takes two parameters.