Closed riverar closed 8 months ago
Duplicate of #644, which by the way was resolved by honoring DoNotRelease
attributes in the metadata. While CsWin32's friendly overload does return a safe handle, it's an object that will not release the handle (it's created with ownsHandle: false
).
The SafeHandle
return type is believed to be useful for other reasons (e.g. for passing to another API that requires a SafeHandle parameter type), even if it never releases the native handle.
https://learn.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulehandlea