BeginUpdateResource requires custom handle handling #781
Labels
broken api
An API is inaccurate and could lead to runtime failure
usability
Touch-up to improve the user experience for a language projection
Actual behavior
The handle returned by
BeginUpdateResource
must be closed by a call toEndUpdateResource
instead of the normalCloseHandle
call. The default destructor forSafeFileHandle
callsCloseHandle
, which throws an error because it's attempting to close a handle it was never meant to close. I worked around the issue by setting the handle as invalid after callingEndUpdateResource
.Expected behavior
The disposal of the HANDLE from BeginUpdateResource shouldn't throw an exception, which can't be traced because it's hidden in a generated Dispose call at the close of using block.
Repro steps
NativeMethods.txt
content:NativeMethods.json
content (if present):Code using the various UpdateResource functions
UpdateResource overload
Context
0.1.619-beta
netstandard2.0
LangVersion
:8.0
The text was updated successfully, but these errors were encountered: