Access Violation calling unmanaged dll
I have an unmanaged dll, up_control64.dll
, that contains a function
What should I do to transfer C union struct to C# struct, that let them have same kind in memory
This is my struct in C:
Why would I need `DangerousAddRef`/`DangerousRelease` around `DangerousGetHandle`?
I’ve been looking into the Microsoft.Windows.CsWin32
NuGet package and comparing the P/Invoke code it generates to what I would write by hand. In some cases it uses SafeHandle.DangerousAddRef
/SafeHandle.DangerousRelease
when I wouldn’t have. I’m trying to understand why, and haven’t come up with anything.