-
Notifications
You must be signed in to change notification settings - Fork 120
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
CreateActCtx is returning the wrong SafeHandle #1581
Comments
Thanks for your report. This needs to be fixed in the metadata. |
We are discussing changing how RAIIFree is handled in #1575. In that world, CreateActCtx would return HANDLE like today but would have @AArnott what do you think of this change? Would you be able to address this issue with that design? |
Yes, I can make cswin32 work with that. |
Some APIs return a common handle type but require the handle to be released with a less-common method. The metadata now includes this detail, and with this change, CsWin32 honors that. Fixes microsoft/win32metadata#1581
Actual behavior
I am running into an issue with https://github.com/ookii-dialogs/ookii-dialogs-wpf where upon closing the program, I get an SEHException on disposal of a SafeFileHandle. The HRESULT is 8000 4005 (unspecified error). I believe this is because CreateActCtx is returning a SafeFileHandle and thus CloseHandle is being called on the ctx rather than ReleaseActCtx.
Expected behavior
The handle returned by CreateActCtx should close the handle with ReleaseActCtx
Repro steps
This code, in a WPF or winforms app, along with version 5.0.1 of Ookii.Dialogs.Wpf should cause the error. I don't need it disabled, but disabling "Just my code" might also be necessary.
Context
0.2.63-beta
] https://github.com/ookii-dialogs/ookii-dialogs-wpf/blob/master/src/Ookii.Dialogs.Wpf/Ookii.Dialogs.Wpf.csproj#LL71C68-L71C79netframework4.6.2
]LangVersion
(if explicitly set by project): [e.g.9
]The text was updated successfully, but these errors were encountered: