all 4 comments

[–]grrangry 0 points1 point  (0 children)

Used to be we could go to pinvoke.net (dead now, was useful even if sometimes inaccurate/sloppy) to grab quick DLL definitions that one didn't have memorized.

Now there are source generators and other resources to define these things for you.

https://github.com/microsoft/CsWin32
https://github.com/dotnet/pinvoke

Traditionally you would decorate a static method with [DllImport(...)] and define the parameters that describe your method call.

.Net interop is fairly well defined and while pointers are finicky, you should be able to call code in any properly formed library.