Glad to see you got this working in .NET. Its a good example of passing structure pointers to the Win32 API from a managed environment.
Just a quick comment though. You call Marshal.FreeHGlobal() in the class Finalize method, so keep in mind how long it may take for the Garbage Collector to actually free that unmanaged memory. The only way to ensure that the memory is freed in a timely manner is to call FreeHGlobal directly after AllocHGlobal or at least make sure to call the class Dispose method after youre finished using it.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.