Added project layout info

pull/10/head
David Hall 2017-11-27 23:07:30 -07:00
parent a225a8e3bc
commit 564a97ec23
1 changed files with 15 additions and 6 deletions

View File

@ -1,11 +1,20 @@
![Vanara](/docs/Vanara64x64.png)
# Vanara
> A set of .NET assemblies containing PInvoke (Interop) references and related extensions.
In a number of projects I have needed to use native API calls. Over the years I have collected quite a few of these interop code chunks and I decided to pull them all together into a set of reusable libraries. I have tried to carve up the libraries into small enough chunks that they are easy to identify and consume. The only problem with this is that you can literally end up with over 20 dependencies on some of the higher function libraries (oh well).
I have tried to follow the concepts below in laying out the libraries.
* All functions that are imported from a single DLL should be placed into a single assembly that is named after the DLL
* (e.g. The assembly `Vanara.PInvoke.Gdi32.dll` hosts all functions and supporting enumerations, constants and structures that are exported from `gdi32.dll` in the system directory.)
* Any structure or macro or enumeration (no function) that is used by many libraries is put into either `Vanara.Core` or `Vanara.PInvoke.Shared`
* (e.g. The macro HIWORD and the structure SIZE are both in `Vanara.PInvoke.Shared` and classes to simplfy interop calls and native memory management are in `Vanara.Core`.)
* Inside a project, all constructs are contained in a file named after the header file (*.h) in which they are defined in the Windows API
* (e.g. In the Kernel32 assembly, you'll find a FileApi.cs, a WinBase.cs and a WinNT.cs file representing fileapi.h, winbase.h and winnt.h respectively.)
* Where the direct interpretation of a structure leads to memory leaks or misuse, I have tried to simplify their use
* Where structures are always passed by reference and where that structure needs to clean up memory allocations, I have changed the structure to class implementing `IDisposable`.
* Wherever possible, all handles have been turned into `SafeHandle` derivatives.
* Wherever possible, all functions that allocate memory that is to be freed by the caller use a safe memory handle.
## Quick Links
* [Discussion Forum (users helping users, enhancement requests, Q&A)](https://groups.google.com/forum/#!forum/vanara)
* [Documentation Wiki (samples, library how-to, etc.)](https://github.com/dahall/Vanara/wiki)
* [API documentation (class/method/property help)](https://dahall.github.io/Vanara)
* [Issues](https://github.com/dahall/Vanara/issues)
## Installation
@ -33,9 +42,9 @@ Link | Assembly | Description | Dependencies
[![NuGet](https://img.shields.io/nuget/v/Vanara.PInvoke.UxTheme.svg?style=flat-square)](https://www.nuget.org/packages/Vanara.PInvoke.UxTheme)| Vanara.PInvoke.UxTheme | Methods, structures and constants imported from UxTheme.dll | Vanara.PInvoke.Gdi32
[![NuGet](https://img.shields.io/nuget/v/Vanara.PInvoke.VirtDisk.svg?style=flat-square)](https://www.nuget.org/packages/Vanara.PInvoke.VirtDisk)| Vanara.PInvoke.VirtDisk | Methods, structures and constants imported from VirtDisk.dll | Vanara.PInvoke.Shared
[![NuGet](https://img.shields.io/nuget/v/Vanara.PInvoke.WinINet.svg?style=flat-square)](https://www.nuget.org/packages/Vanara.PInvoke.WinINet)| Vanara.PInvoke.WinINet | Methods, structures and constants imported from WinINet.dll | Vanara.PInvoke.Shared
[![NuGet](https://img.shields.io/nuget/v/Vanara.Security.svg?style=flat-square)](https://www.nuget.org/packages/Vanara.Security)| Vanara.Security | Wrapper classes for security related items in the PInvoke libraries | Vanara.PInvoke.AclUI, Vanara.PInvoke.CredUI
[![NuGet](https://img.shields.io/nuget/v/Vanara.Security.svg?style=flat-square)](https://www.nuget.org/packages/Vanara.Security)| Vanara.Security | Wrapper classes for security related items in the PInvoke libraries | Vanara.PInvoke.NTDSApi, Vanara.PInvoke.Security
[![NuGet](https://img.shields.io/nuget/v/Vanara.SystemServices.svg?style=flat-square)](https://www.nuget.org/packages/Vanara.SystemServices)| Vanara.SystemServices | Wrapper classes for system related items in the PInvoke libraries | Vanara.PInvoke.Kernel32, Vanara.PInvoke.VirtDisk
[![NuGet](https://img.shields.io/nuget/v/Vanara.UI.svg?style=flat-square)](https://www.nuget.org/packages/Vanara.UI)| Vanara.UI | Wrapper classes for user interface related items in the PInvoke libraries | Vanara.PInvoke.ComCtl32, Vanara.PInvoke.NetListMgr, Vanara.PInvoke.Shell32, Vanara.PInvoke.UxTheme
[![NuGet](https://img.shields.io/nuget/v/Vanara.UI.svg?style=flat-square)](https://www.nuget.org/packages/Vanara.UI)| Vanara.UI | Wrapper classes for user interface related items in the PInvoke libraries | Vanara.PInvoke.AclUI, Vanara.PInvoke.CredUI, Vanara.PInvoke.ComCtl32, Vanara.PInvoke.DwmApi, Vanara.PInvoke.NetListMgr, Vanara.PInvoke.Shell32, Vanara.PInvoke.UxTheme
## Sample Code
There are numerous examples in the [UnitTest](https://github.com/dahall/Vanara/tree/master/UnitTests) folder.