dapplo/Dapplo.Windows

Consider using other pinvoke libraries

Opened this issue · 6 comments

NN--- commented

You can save your time if you join other libraries instead of writing a new one

https://github.com/dahall/Vanara
https://github.com/AArnott/pinvoke

I agree, and will probably move the PInvokes towards one of those, I already looked at both some time ago. But for my project the goal isn't to have all Win32 APIs supported, and I had a hard time matching some of the calls I needed.

Although it would save me some time, using these projects will increase the number of dependencies & the final size of the product.

NN--- commented

I don't think there are such problems today.
Especially if you use .NET Core where you bring zillion framework dlls with you.

With https://github.com/dotnet/pinvoke now being a part of the dotnet foundation I will evaluate this. I actually prefer to remove all the low level calls and keep the added higher level API. Let's see how this looks, hopefully I have some time for this.

NN--- commented

IMO pinvoke provides too low level API.
With Vanara you get the nice wrappers.

I believe I only need the low level API, besides pinvoke being a part of the dotnet foundation makes it a bit more attractive. Disclamer: Didn't look at Vanara yet....

NN--- commented

You will need SafeHandle wrapper to automatically reclaim memory and so on.
Just try both and see what suits you better .