Vanara.Core 4.2.1
![]()
Vanara.Core NuGet Package
This library includes shared methods, structures and constants for use throughout the Vanara assemblies. Think of it as windows.h with some useful extensions. It includes:
- Extension methods for working with enumerated types (enum), FILETIME, and method and property extractions via reflection
- Extension and helper methods to marshaling structures arrays and strings
- SafeHandle based classes for working with memory allocated via CoTaskMem, HGlobal, or Local calls that handles packing and extracting arrays, structures and raw memory
- Safe pinning of objects in memory
- Memory stream based on marshaled memory
What is Vanara?
Vanara is a community project that contains various .NET assemblies which have P/Invoke functions, interfaces, enums and structures from Windows libraries. Each assembly is associated with one or a few tightly related libraries.
Issues?
First check if it's already fixed by trying the MyGet build. If you're still running into problems, file an issue.
Included in Vanara.Core
| Classes | Structures | Enumerations | Interfaces |
|---|---|---|---|
| AddAsCtorAttribute AddAsMemberAttribute AdjustAutoMethodNamePatternAttribute AlignedMemory AppendedStringAttribute ArrayAttribute AutoHandleAttribute AutoSafeHandleAttribute BeginEndEventContext BitFieldAttribute BitHelper ByteSizeFormatter CloseHandleFunc ComConnectionPoint ComEnumString ComReleaser ComReleaserFactory ComStream ComTypeExtensions ConstantConversionExtensions CorrespondingTypeAttribute CoTaskMemoryMethods DeferAutoMethodFromAttribute EnumerableEqualityComparer EnumExtensions EventedList FileTimeExtensions FixedStringAttribute Formatter FormatterComposer GenericSafeHandle GenericVirtualReadOnlyDictionary GuidToStringMarshaler HexDumpHelpers HGlobalMemoryMethods History IArrayStructExtensions IArrayStructMarshaler IgnoreAttribute InteropExtensions IntPtrConverter IOExtensions LibHelper LinqHelpers ListChangedEventArgs MarshaledAlternativeAttribute MarshaledAttribute Marshaler MarshalerOptions MarshalException MarshalFieldAs MarshalingStream Matrix Matrix MemoryMethodsBase NativeMemoryEnumerator NativeMemoryStream PinnedObject ReflectionExtensions ReflectionExtensions SafeAllocatedMemoryHandle SafeAllocatedMemoryHandleBase SafeByteArray SafeCoTaskMemHandle SafeCoTaskMemString SafeCoTaskMemStruct SafeGuidPtr SafeHANDLE SafeHGlobalHandle SafeHGlobalStruct SafeLPSTR SafeLPTSTR SafeLPWSTR SafeMemoryHandle SafeMemoryHandleExt SafeMemoryPool SafeMemString SafeMemStruct SizeDefAttribute SizeFieldNameAttribute SizeFieldNameAttributeExt SizeOfAttribute SpanAction SparseArray StringHelper StructPtrAttribute SuppressAutoGenAttribute TryGetDelegate TryGetValueDelegate UnionHelper UntypedNativeMemoryEnumerator VanaraCustomMarshaler VanaraMarshaler VanaraMarshalerAttribute VirtualDictionary VirtualList VirtualListMethodCarrier VirtualReadOnlyDictionary VirtualReadOnlyList | AnySizeStructFieldArray AnySizeStructUnmanagedFieldArray ArrayPointer BitField BOOL BOOLEAN EnumFlagIndexer GuidPtr IUnknownPointer LPCSTRArrayPointer LPCTSTRArrayPointer LPCWSTRArrayPointer ManagedArrayPointer ManagedStructPointer RefEnumerator SizeT StrPtrAnsi StrPtrAuto StrPtrUni StructPointer time_t | ArrayLayout Bitness CorrespondingAction FileAttributeConstant FileOpConstant FilePermissionConstant LayoutModel SizingMethod StringEncoding StringListPackMethod | IArrayStruct IHandle IHistory IMemoryMethods ISafeMemoryHandle ISafeMemoryHandleBase ISafeMemoryHandleFactory ISimpleMemoryMethods ISupportIndexer IVanaraMarshaler IVirtualListMethods IVirtualReadOnlyListMethods |
Showing the top 20 packages that depend on Vanara.Core.
| Packages | Downloads |
|---|---|
|
Vanara.PInvoke.DwmApi
PInvoke API (methods, structures and constants) imported from Windows DwmApi.dll.
|
20 |
|
Vanara.PInvoke.Kernel32
Methods, structures and constants imported from Kernel32.dll.
|
20 |
|
Vanara.PInvoke.Kernel32
PInvoke API (methods, structures and constants) imported from Windows Kernel32.dll.
|
20 |
|
Vanara.PInvoke.Kernel32
PInvoke API (methods, structures and constants) imported from Windows Kernel32.dll.
|
21 |
|
Vanara.PInvoke.Shared
Shared methods, structures and constants for use throughout the Vanara.PInvoke assemblies. Includes:
* IEnumerable helpers for COM enumerations
* Custom marshaler for CoTaskMem pointers
* Enhanced error results classes for HRESULT, Win32Error and NTStatus
* Standard windows.h macros (e.g. HIWORD, MAKELONG, etc.)
* Overlapped method wrapper
* Resource ID holder
* Shared structures and enums (see release notes)
|
20 |
|
Vanara.PInvoke.Shared
Shared methods, structures and constants for use throughout the Vanara.PInvoke assemblies. Includes:
* IEnumerable helpers for COM enumerations
* Custom marshaler for CoTaskMem pointers
* Enhanced error results classes for HRESULT, Win32Error and NTStatus
* Standard windows.h macros (e.g. HIWORD, MAKELONG, etc.)
* Overlapped method wrapper
* Resource ID holder
* Shared structures and enums (see release notes)
|
21 |
|
Vanara.PInvoke.Shared
Shared methods, structures and constants for use throughout the Vanara.PInvoke assemblies. Includes:
* IEnumerable helpers for COM enumerations
* Custom marshaler for CoTaskMem pointers
* Enhanced error results classes for HRESULT, Win32Error and NTStatus
* Standard windows.h macros (e.g. HIWORD, MAKELONG, etc.)
* Overlapped method wrapper
* Resource ID holder
* Shared structures and enums (see release notes)
|
22 |
|
Vanara.PInvoke.User32
PInvoke API (methods, structures and constants) imported from Windows User32.dll.
|
20 |
Currently implements:
Classes
AddAsCtorAttribute, AddAsMemberAttribute, AdjustAutoMethodNamePatternAttribute, AlignedMemory<T>, AppendedStringAttribute, ArrayAttribute, AutoHandleAttribute, AutoSafeHandleAttribute, BeginEndEventContext, BitFieldAttribute<T>, BitHelper, ByteSizeFormatter, CloseHandleFunc, ComConnectionPoint, ComEnumString, ComReleaser<T>, ComReleaserFactory, ComStream, ComTypeExtensions, ConstantConversionExtensions, CorrespondingTypeAttribute, CoTaskMemoryMethods, DeferAutoMethodFromAttribute, EnumerableEqualityComparer<T>, EnumExtensions, EventedList<T>, FileTimeExtensions, FixedStringAttribute, Formatter, FormatterComposer, GenericSafeHandle, GenericVirtualReadOnlyDictionary<T>, GuidToStringMarshaler, HexDumpHelpers, HGlobalMemoryMethods, History<T>, IArrayStructExtensions, IArrayStructMarshaler<T>, IgnoreAttribute, InteropExtensions, IntPtrConverter, IOExtensions, LibHelper, LinqHelpers, ListChangedEventArgs<T>, MarshaledAlternativeAttribute, MarshaledAttribute, Marshaler, MarshalerOptions, MarshalException, MarshalFieldAs, MarshalingStream, Matrix, Matrix<T>, MemoryMethodsBase, NativeMemoryEnumerator<T>, NativeMemoryStream, PinnedObject, ReflectionExtensions, ReflectionExtensions, SafeAllocatedMemoryHandle, SafeAllocatedMemoryHandleBase, SafeByteArray, SafeCoTaskMemHandle, SafeCoTaskMemString, SafeCoTaskMemStruct<T>, SafeGuidPtr, SafeHANDLE, SafeHGlobalHandle, SafeHGlobalStruct<T>, SafeLPSTR, SafeLPTSTR, SafeLPWSTR, SafeMemoryHandle<T>, SafeMemoryHandleExt<T>, SafeMemoryPool<T>, SafeMemString<T>, SafeMemStruct<T>, SizeDefAttribute, SizeFieldNameAttribute, SizeFieldNameAttributeExt, SizeOfAttribute, SpanAction, SparseArray<T>, StringHelper, StructPtrAttribute, SuppressAutoGenAttribute, TryGetDelegate, TryGetValueDelegate, UnionHelper, UntypedNativeMemoryEnumerator, VanaraCustomMarshaler<T>, VanaraMarshaler, VanaraMarshalerAttribute, VirtualDictionary<T>, VirtualList<T>, VirtualListMethodCarrier<T>, VirtualReadOnlyDictionary<T>, VirtualReadOnlyList<T>
Structures
AnySizeStructFieldArray<T>, AnySizeStructUnmanagedFieldArray<T>, ArrayPointer<T>, BitField<T>, BOOL, BOOLEAN, EnumFlagIndexer<T>, GuidPtr, IUnknownPointer<T>, LPCSTRArrayPointer, LPCTSTRArrayPointer, LPCWSTRArrayPointer, ManagedArrayPointer<T>, ManagedStructPointer<T>, RefEnumerator<T>, SizeT, StrPtrAnsi, StrPtrAuto, StrPtrUni, StructPointer<T>, time_t
Enumerations
ArrayLayout, Bitness, CorrespondingAction, FileAttributeConstant, FileOpConstant, FilePermissionConstant, LayoutModel, SizingMethod, StringEncoding, StringListPackMethod
.NET Framework 4.8
- System.Memory (>= 4.5.5)
.NET Standard 2.0
- System.ValueTuple (>= 4.6.1)
- System.Memory (>= 4.5.5)
.NET 9.0
- No dependencies.
.NET 8.0
- No dependencies.
.NET Standard 2.1
- System.Runtime.CompilerServices.Unsafe (>= 6.1.2)
.NET 6.0
- No dependencies.
.NET 5.0
- No dependencies.
.NET Core 3.1
- No dependencies.
.NET 7.0
- No dependencies.
| Version | Downloads | Last updated |
|---|---|---|
| 4.2.1 | 7 | 09/13/2025 |
| 4.2.0 | 8 | 08/29/2025 |
| 4.1.6 | 12 | 06/21/2025 |
| 4.1.5 | 9 | 06/22/2025 |
| 4.1.4 | 13 | 06/14/2025 |
| 4.1.3 | 13 | 04/28/2025 |
| 4.1.2 | 14 | 04/19/2025 |
| 4.1.1 | 16 | 03/17/2025 |
| 4.1.0 | 18 | 03/17/2025 |
| 4.0.6 | 17 | 03/17/2025 |
| 4.0.5 | 17 | 03/17/2025 |
| 4.0.4 | 15 | 03/17/2025 |
| 4.0.3 | 19 | 03/17/2025 |
| 4.0.2 | 20 | 03/17/2025 |
| 4.0.1 | 18 | 03/17/2025 |
| 4.0.0 | 17 | 03/17/2025 |
| 4.0.0-beta2 | 18 | 03/08/2025 |
| 4.0.0-beta | 17 | 03/08/2025 |
| 3.4.17 | 16 | 03/17/2025 |
| 3.4.16 | 13 | 03/17/2025 |
| 3.4.15 | 18 | 03/17/2025 |
| 3.4.14 | 17 | 03/17/2025 |
| 3.4.13 | 16 | 03/17/2025 |
| 3.4.12 | 18 | 03/17/2025 |
| 3.4.11 | 14 | 03/17/2025 |
| 3.4.10 | 19 | 03/17/2025 |
| 3.4.9 | 14 | 03/17/2025 |
| 3.4.8 | 14 | 03/17/2025 |
| 3.4.7 | 18 | 03/17/2025 |
| 3.4.6 | 17 | 03/17/2025 |
| 3.4.5 | 15 | 03/17/2025 |
| 3.4.4 | 17 | 03/17/2025 |
| 3.4.3 | 17 | 03/17/2025 |
| 3.4.2 | 17 | 03/17/2025 |
| 3.4.1 | 19 | 03/17/2025 |
| 3.4.0 | 16 | 03/17/2025 |
| 3.3.15 | 17 | 03/17/2025 |
| 3.3.14 | 20 | 03/17/2025 |
| 3.3.13 | 15 | 03/17/2025 |
| 3.3.12 | 19 | 03/17/2025 |
| 3.3.11 | 17 | 03/17/2025 |
| 3.3.10 | 18 | 03/17/2025 |
| 3.3.9 | 19 | 03/17/2025 |
| 3.3.8 | 17 | 03/17/2025 |
| 3.3.7 | 17 | 03/17/2025 |
| 3.3.6 | 17 | 03/17/2025 |
| 3.3.5 | 18 | 03/17/2025 |
| 3.3.4 | 16 | 03/17/2025 |
| 3.3.3 | 18 | 03/17/2025 |
| 3.3.2 | 19 | 03/17/2025 |
| 3.3.1 | 16 | 03/17/2025 |
| 3.3.0 | 22 | 03/17/2025 |
| 3.2.21 | 16 | 03/17/2025 |
| 3.2.20 | 16 | 03/17/2025 |
| 3.2.19 | 18 | 03/17/2025 |
| 3.2.18 | 18 | 03/17/2025 |
| 3.2.17 | 17 | 03/17/2025 |
| 3.2.16 | 17 | 03/17/2025 |
| 3.2.15 | 19 | 03/17/2025 |
| 3.2.14 | 21 | 03/17/2025 |
| 3.2.13 | 18 | 03/17/2025 |
| 3.2.12 | 18 | 03/17/2025 |
| 3.2.11 | 16 | 03/17/2025 |
| 3.2.10 | 19 | 03/17/2025 |
| 3.2.9 | 16 | 03/17/2025 |
| 3.2.7 | 19 | 03/17/2025 |
| 3.2.6 | 17 | 03/17/2025 |
| 3.2.5 | 19 | 03/17/2025 |
| 3.2.4 | 18 | 03/17/2025 |
| 3.2.3 | 17 | 03/17/2025 |
| 3.2.2 | 18 | 03/17/2025 |
| 3.2.1 | 15 | 03/17/2025 |
| 3.2.0 | 18 | 03/17/2025 |
| 3.1.9 | 17 | 03/17/2025 |
| 3.1.8 | 17 | 03/17/2025 |
| 3.1.7 | 16 | 03/17/2025 |
| 3.1.6 | 20 | 03/17/2025 |
| 3.1.5 | 18 | 03/17/2025 |
| 3.1.4 | 19 | 03/17/2025 |
| 3.1.3 | 15 | 03/17/2025 |
| 3.1.2 | 19 | 03/17/2025 |
| 3.1.1 | 16 | 03/17/2025 |
| 3.1.0 | 18 | 03/17/2025 |
| 3.0.1 | 20 | 03/17/2025 |
| 3.0.0 | 17 | 03/17/2025 |
| 2.3.11 | 19 | 03/17/2025 |
| 2.3.10 | 18 | 03/17/2025 |
| 2.3.9 | 19 | 03/17/2025 |
| 2.3.8 | 19 | 03/17/2025 |
| 2.3.7 | 18 | 03/17/2025 |
| 2.3.6 | 18 | 03/17/2025 |
| 2.3.5 | 19 | 03/17/2025 |
| 2.3.4 | 20 | 03/17/2025 |
| 2.3.3 | 17 | 03/17/2025 |
| 2.3.2 | 16 | 03/17/2025 |
| 2.3.1 | 17 | 03/17/2025 |
| 2.3.0 | 19 | 03/17/2025 |
| 2.2.1 | 19 | 03/17/2025 |
| 2.2.0 | 18 | 03/17/2025 |
| 2.1.2 | 17 | 03/17/2025 |
| 2.1.0 | 20 | 03/17/2025 |
| 2.0.1 | 20 | 03/17/2025 |
| 2.0.0 | 19 | 03/17/2025 |
| 1.1.0 | 17 | 03/17/2025 |
| 1.0.18 | 17 | 03/17/2025 |
| 1.0.17 | 18 | 03/17/2025 |
| 1.0.16 | 17 | 03/17/2025 |
| 1.0.15 | 15 | 03/17/2025 |
| 1.0.14 | 17 | 03/17/2025 |
| 1.0.13 | 19 | 03/17/2025 |
| 1.0.12 | 17 | 03/17/2025 |
| 1.0.11 | 16 | 03/17/2025 |
| 1.0.10 | 17 | 03/08/2025 |
| 1.0.8 | 19 | 03/17/2025 |
| 1.0.7 | 16 | 03/17/2025 |
| 1.0.6 | 18 | 03/17/2025 |
| 1.0.5 | 17 | 03/17/2025 |
| 1.0.4 | 17 | 03/17/2025 |
| 1.0.3 | 17 | 03/17/2025 |
| 1.0.2 | 17 | 03/17/2025 |
| 1.0.1 | 17 | 03/17/2025 |
| 1.0.0 | 19 | 03/17/2025 |