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
{{ message }}
Repository navigation
GetStdHandle shouldn't return a CloseHandleSafeHandle #91
Standard output handles should rarely be closed. Here's Raymond Chen's explanation. Thus, the proper way to use GetStdHandle is by combining it with DangerousAddRef:
Activity
AArnott commentedon Feb 16, 2021
Great point. I filed microsoft/win32metadata#244 against the metadata so we can do this along with other projections.
AArnott commentedon Feb 23, 2021
Now that #143 is done, we actually can create
SafeHandleinstances withownsHandle: falseset on them.Merge pull request #91 from AArnott/noticeDotNetInstallFailure
xPaw commentedon Oct 14, 2024
I'm curious, how are you expected to pass a handle from GetStdHandle into functions such as GetConsoleMode which expect SafeHandle?
Use SafeFileHandle or is there a better way of doing it?
AArnott commentedon Oct 15, 2024
Pavel Djundik (@xPaw): it's trivial if you call the
GetStdHandlemethod that returns aSafeHandle:xPaw commentedon Oct 15, 2024
Ah that's the trick, thank you.