dotnet / pinvoke

A library containing all P/Invoke code so you don't have to import it every time. Maintained and updated to support the latest Windows OS.
MIT License
2.12k stars 222 forks source link

Fix union use pattern #256

Closed AArnott closed 8 years ago

AArnott commented 8 years ago

The property accessors just don't produce the obviously correct calling pattern from consuming code. And the union struct makes coding against it more tedious than native code. This makes the calling pattern between native and managed identical, and leads to consuming code that will be most likely correct.

Fixes #251

AArnott commented 8 years ago

CC: @arlm

arlm commented 8 years ago

Cool. Thanks.

I have a new set of things to pull in but first I will finish some tasks here and also help with some of the other pending tasks on the PInvoke project also.

The fix seems prefect and well tested.