diff --git a/CONTRIB.txt b/CONTRIB.txt index 7b1c9fb0..461ec90e 100644 --- a/CONTRIB.txt +++ b/CONTRIB.txt @@ -6,5 +6,20 @@ Please send pull requests to add what you've come up with. ## Guidelines +### Project structure + + * One class library and NuGet package per P/Invoke'd DLL. + * Types and enums in common Windows header files should be defined in the PInvoke.Windows.Core project. + +### File structure + * Nested classes and structs go into their own files. * P/Invoke methods go into the *binary*.cs file. While higher level helper methods go in *binary*.Helpers.cs. + + ### Naming + + * All method names should match exactly their names as found in the native DLL. + Do not remove a common prefix even if it is redundant with the class name. + This is for predictability across the entire family of libraries and so + searches for method names as they are found in the native libraries' documentation + will always turn up results if they are defined by these packages. diff --git a/README.md b/README.md index e45a95bf..c0973720 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,20 @@ P/Invoke A library intended to contain all P/Invoke method signatures for popular operating systems. Think of it as http://pinvoke.net, but proven to compile, work properly +## Usage + +Install the NuGet package(s) for the DLLs you want to P/Invoke into. +For example, if you want to P/Invoke into Win32's BCrypt.dll, install this package: + + Install-Package PInvoke.BCrypt + +Then import the following namespaces, as demonstrated below (if using C# 6): + + using PInvoke; + using static PInvoke.BCrypt; // Supported in C# 6 (VS2015) and later. + +This will allow you to conveniently call these methods either + ## Design goals Provide a slightly higher than lowest level API for P/Invoke signatures. @@ -16,9 +30,6 @@ or elsewhere as applicable. This is a portable library so you can use it anywhere. -## Testing -In as many cases as possible, these P/Invoke method signatures will be tested via unit testing in this project. - ## Distribution This library should be available on NuGet for easy consumption by your projects. You may also copy and paste the P/Invoke signatures you need directly into your projects if desired.