Releases: dahall/Vanara
Releases · dahall/Vanara
Release Notes - 5.0.0
Major release due to magnitude of changes introduced with full generation. Generation of simpler methods and consolidation of methods into safe handles added for primary assemblies. More to come.
Generator
- Complete rewrite of code generator to merge existing and new SizeDef and Ignore attributes
- Lots of updates based on new generated code. Mostly cosmetic, removing duplicate functions that are now generated, adjusting attributes to get the correct generation, and fixing a few bugs along the way.
- Added generator support of methods that ask for a known interface and its GUID to automatically grab the grid.
- Fixed and finished adding LPArray generator
- Generator that adds simplified methods as overloads or as members of supporting handles
Additions
- Added SHCreateDefaultContextMenuEx overloads and improve DEFCONTEXTMENU
- Added ShellItemArray.FromPaths for creating from file paths
- Added DisposingList to Vanara.Core for managed disposal of list elements
- Added DynamicallyAccessedMembersAttribute for backward compatibility
- Added FMTID values and moved PROPERTYKEY constants to using those instead of individual definitionFixed bug in SAFEARRAY.VarType property
- Added Guid* operator to SafeGuidPtr
- Added InteropExtensions.UnsafeAddrOfPinnedSpanElement method
- Added OleThreadState class to handle thread-safe calling of OleInitializeCleaned and optimized POINT struct
- Added OleThreadState handling to ShellContextMenu, added Invoke method, optimized codeChanged ctors for CMINVOKECOMMANDINFOEX
- Added SafeMemStruct.GetStringAtOffset method
- Added Shell32.PIDL IsFolder and IsRoot properties
- Added StringSyntaxAttribute for pre-NET7
- Added StructPointer support for putting and geting "in" struct values
- Added ability to export and import wallpaper settings for WallpaperManagerCommits
- Added default ctor to SafeAnysizeStructMarshaler to prevent errors
- Added enhanced interface for errors, IErrorProvider2 and used to genercize FunctionHelper.CallMethodWithTypedBufUpdated MarshalAs LPArray attributes with direction attribute and size param valueAdded more SizeParamIndex values
- Added function and property to SafeBITMAPINFO to get header by ref.
- Added implicit conversion of HCFFILE and SafeHCFFILE to HFILE for appropriate use by many CldApi functions (#563)Commits on Oct 14, 2025
- Added memory handle support for Span in ctor and implicit operator
- Added more attributes to IShellFolder methods
- Added more buffer error codes
- Added unit tests for ShellItemChangeWatcher.
- Introduced a readonly FOURCC struct in Vanara.PInvoke to represent four-character codes used in multimedia formats. Provides constructors for uint, string, and char inputs, implicit conversions, string validation, and a string representation method. Designed for interop compatibility with sequential layout.Added code generation to Gdi32 assembly
- Updated WLAN enums
Breaking Changes
- Update IShellItem.BindToHandler signature and docs
- Hid ShellItem.Dispose() to favor new Dispose(bool) methodUpdated shell unit tests to cover and exercise changes
- Removed Vanara.PInvoke.SizeFieldName and updated helper method to use SafeDefAttribute instead. Too much overlapping functionality, limited use, and additional work for generator.Updated methods that have called FunctionHelper.IUnkObj to use MarshalAs attribute so generator can see themReplaced SizeFieldName attributes with SizeDef
- Changed shell object wrappers to better handle disposing of COM objects using Dispose pattern and hard releasing of interface. Added Dispose(bool) method and finalizers.Updated lots of unit tests to work better, work correctly, or use more recent data.Commits on Dec 10, 2025
Fixes
- Changed IPropertyDescription.FormatForDisplay to expose HRESULT return valueChanged impl of SHGetPropertyStoreFromIDList to use generated overload
- Clarified ambiguous calls in ShlObj and improved structures with ctors and attributesChanged IContextMenu.GetCommandString declaration and fixed extension
- Cleaned up PROPERTYKEY
- Converted NativeClipboard to use OleThreadState
- Enhance Shell32.BHID enum with additional CorrespondingType mappings
- Fix ListViewNotification enum to start with correct LVN_FIRST value #571
- Fix msbuild commands in cibuild.yml
- Fixed Marshal.SizeOf expressions
- Fixed bug in IEnumerable.MarshalObjectsToPtr
- Fixed bug in LoadString overload (#570)
- Fixed bug in NCryptBufferDesc marshaling
- Fixed bug in SafePACL when adding ACEs to empty ACL
- Fixed bug in ShellDataTable.PopulateTableAsync that was failing a lookup
- Fixed bug in WNetEnumResources
- Fixed bug in update to FunctionHelper's known buffer errors
- Fixed bug with User32.RAWHID field and added accessor methods
- Fixed bugs in GetKnownFolderFromGuid and GetKnownFolderFromPath
- Fixed disposal pattern for ShellFileOperations
- Fixed enumerators that don't capture native memory #569
- Fixed errant attributes exposed by generator
- Fixed fields in PERF_DATA_HEADER per #561
- Fixed incorrect definition of IExtractImage.GetLocation
- Fixed initialization bug in MIB_IFROW
- Fixed marshaling of WLAN_CONNECTION_NOTIFICATION_DATA #566
- Fixed new bug in FindPackagesByPackageFamily (#558)
- Fixed problems with initializing Clipboard functions and added supporting comparers and retrieversClipboard now throws an error if trying to be used in an MTA
- Improve ShellLibrary init and disposal, clarify docs
- Lots of changes to PIDL: Added ctor, Desktop property, GetRelativeTo and FIndCommonParent methodsChanged ctors for MENUITEMINFO
- Made LsaRetrievePrivateData usable via overload
- Made MoveFileEx and MoveFileWithProgress nullable (#568)
- Major changes and fixes for ShellContextMenu with improved resource management, async support, and more robust menu handling.Refactored ShellItem to use a DisposingList for tracking and disposing of all IDisposable resources. Updated the Dispose pattern to prevent double disposal and ensure proper cleanup. Refactored key properties (ContextMenu, PIDL, Properties, PropertyDescriptions) to use AddDisposable for resource tracking. Changed GetToolTip to avoid leaking COM objects. Enhanced BindToHandler to follow COM conventions and improved XML documentation throughout.Override Dispose and Init to manage IShellFolder and categories lifetimes properly. Add a cached ContextMenu property returning a ShellContextMenu instance. Adjust GetInstance visibility for internal use.Implement IDisposable in ShellFolderCategorizer
- More fixes adding finalizer to shell object wrappers
- Move HWINSTA and HDESK from Shared to User32
- Moved HANDLE and HANDLEConverter from autogen in Vanara.PInvoke.Shared to Vanara.CoreAdjusted Kernel32, User32, and Net assemblies to work with generator
- Optimized and fixed ShellItemPropertyUpdates
- Rearchitected PropertyStore and ShellItemPropertyStore to avoid disposal conflicts of held interfaces. Cleaned code.Fixed bug in PropertyDescription.FormatForDisplay
- Refactor Shell32 helpers, add SHCreateItemHandlerFromParsingName
- Removed ability in .NET 8 and later to automatically marshal binary serialized values supporting ISerialize due to security concerns. Still works in other builds.Enhanced test support classes
- lpNewFileName may be null when used with MOVEFILE_DELAY_UNTIL_REBOOT.
Full Changelog: v4.2.1...v5.0.0
Release Notes - 4.2.1
Additions
- Added Vanara.PInvoke.WindowsDriverFramework (partial implementation) and Vanara.PInvoke.Hid (full impl) (#548)
- Added enumerability to BitField
Fixes
Release Notes - 4.2.0
Major changes
- Migrated solution to Central Package Management
- Added Vanara.PInvoke.TelephonyApi (TAPI) assembly with all 3.x interfaces
- Many additions, changes, and a few BREAKING CHANGES to Kernel32 as I did a full review after many years.
Additions
- Added bindlink.h to Kernel32
- Added ComConnectionPoint functionality to retrive the cookie for each supported IID.
- Added functions for hit lists to BitHelper
- Added generator that looks for MarshaledAlternativeAttribute and creates conversion code to process between original simple structure and new Marshaled structure
- Added GuidToStringMarshaler, an ICustomMarshaler to convert an object with a Guid value or a Guid string representation to a formatted string value.
- Added INVALID_HANDLE_VALUE fields to base handles
- Added missing MRU list and Flat scrollbar functions and types
- Added missing WinCrypt structures, updated IntPtr fields with stronger typed StructPointer and ArrayPointer types, added missing error constants.
- Added ModalDialog class to handle resource based dialogs
- Added multiple SendDlgItemMessage overloads (like SendMessage)
- Added ReadFile overloads
- Added SafeHANDLE null equality handler (false) and made ReleaseOwnership virtual
- Added some annotation attributes that will eventually feed generators: AddAsMember, Ignore, and SizeDef
- Added spuihelp.h methods and other minor fixes to SpeechApi
- Added support to VanaraMarshaler for Marshaled structures
- Added UnionHelper static class that has methods to make processing overlapping values easier without using ExplicitLayout
- Added Win32Error.GetExceptionForLastError
- Adds the two flags that were introduced after Windows 10 1709 but are still missing from Vanara’s CF_UPDATE_FLAGS enum.
- Add ed CF_UPDATE_FLAG_ALWAYS_FULL & CF_UPDATE_FLAG_ALLOW_PARTIAL to CF_UPDATE_FLAGS (#540)
Changes and Fixes
- BREAKING CHANGE: Changed SafeAllocatedMemoryHandle.CopyTo(SafeAllocatedMemoryHandle h, SizeT l) and removed second param to prevent ambigous calls. Moved DangerousSetSize to SafeAllocateMemoryHandleBase. Added param check to CopyTo(SizeT start, SizeT length, ISafeMemoryHandleBase dest, SizeT destOffset = default) to prevent buffer overreads and fixed dest checks.
- BREAKING CHANGES: Fixed MemoryApi MapUserPhysicalPagesScatter and GetMemoryErrorHandlingCapabilities parameters
- Changed all handles to derive from SafeHANDLE instead of SafeHandle and derivatives to get extra functionality and work better with new analyzer. Hopefully not a breaking change.
- Changed SafeEventHandle parameters to HEVENT for broader use.
- Created NUnit TestWhenElevated attribute to mark methods that shouldn't fail if run when not elevated.
- Exposed HINSTANCE of ModalDialog
- Extracted ISafeMemoryHandleBase from SafeAllocatedMemoryHandleBase and made ISafeMemoryHandle derive from it.
- Fixed bug how ModalDialog returned from WM_COMMAND
- Fixed bug in Library nuspec file
- Fixed bug in NativeMemoryStream.Read(byte[]) not handling null correctly.
- Fixed Clipboard.AnsiToUnicode after changes to MultibyteToWideChar function
- Fixed incomplete parameter declarations in CldApi.CfUpdatePlaceholder (#546)
- Fixed layout issues with Ole32.DVTARGETDEVICE (#550)
- Fixed layout of OPEN_VIRTUAL_DISK_PARAMETERS (#541)
- Fixed problem wtih WlanApi.DOT11_SSID not handling UTF-8 strings (#545)
- Fixed problems with GETTEXTEX fields
- Minor changes, but unresolved problems, with CSharpRunner under .NET 8
- More work on SpeechApi adding in alternative Marshaled structures and overloads
- Updated AdvApi32.EVENT_TRACE_PROPERTIES with ctors
- Updated NuGet packages for solution
Release Notes - 4.1.6
Flubbed the push of 4.1.5 so had to roll to 4.1.6 to make NuGet.org work again. Sorry. :(
Release Notes - 4.1.5
Additions
- Added SpeechApi assembly and extra elements needed in UrlMon
- Added ID2D1RenderTarget.CreateSolidColorBrush accepting a Color param.
Fixes
- Fixed bugs with ID2D1GeometrySink.AddLines and AddBeziers declarations
- Fixed bug in ID2D1RenderTarget.CreateGradientStopCollection
- Fixed parameters in IWICBitmapFrameEncode.Initialize and IWICComponentFactory.CreateEncoder
- Updated pen functions to use better enum values
- Updated ID2D1Geometry method params for optionality
- Added D2D_MATRIX_3X2_F.Invert() and IsInvertible
- Added more System.Drawing.Color overloaded methods to D2D1
- Made D3D_SIZE_F implicit conversion from SIZE
- Fixed buggy GetSize and GetPixelFormat methods in various interfaces by making return value an out param and adding overloads
- Removed directory deletion from VssApi project due to failures
- Added and fixed undocumented D3D12 structures
Release Notes - 4.1.4
Breaking Changes
- Changed ID2D1RenderTarget.EndDraw to return HRESULT and added more overloaded extension methods.Fixed mult op, added ctor and Skew to D2D_MATRIX_3X2_F
- Breaking change: Fixed missing enum params in scrollbar functions
- Breaking change: Changed type of CLAIM_SECURITY_ATTRIBUTE_V1.Name from string to StrPtrUni to work more easily with unmanaged memory which is required by the rest of the structure.Moved memory references from SafeMemoryHandleExt to parent SafeAllocatedMemoryHandle for broader use.Fixed bug in PSID_IDENTIFIER_AUTHORITY.ctor(IntPtr)
Fixes
- Minor attribute updates to IClassFactory.CreateInstance
- Fixed argument for StringHelper.Write so that it doesn't break existing code.
- Implemented suggest fix for WindowBase.Create event #534
- Fixed bugs in SizeT conversions
- Fixed bug in ResourceId.id setter not handling 0.
- Fixed bug in ImageListExtension.ToImageList
- Updates to ShellContextMenu and bug fix #536
- Change ShellItem.InvokeVerb to use ShellExecuteEx instead of IContextMenu.InvokeCommand for better compatibilityMore work on ShellContextMenu
- Fixed CLAIM_SECURITY_ATTRIBUTE_V1 test to work with new change
- Adjusted PSID.ToString(string) to get common name with fewer privileges
- Fixed param type in NCrypt.NCryptSignHash
- Fixed misspelling in WpdParameterAttributeForm value
- Fixed problem with ID2D1RenderTarget.GetSize and GetPixelSize methods throwing memroy errors with return types.
Additions
- Added support for .NETStandard 2.1 and fixed bug #532
- Added first release of complex generic marshaler for structures
- Added ICreateSafeMemoryHandle to allow for interface creation of a safe memory handle and implemented in Core, Kernel32, and Cryptography assemblies.
- Added StringHelper methods to handle encoded strings
- Added IntPtr.ToStringEnum extension method handling encoded strings
- Added StringHelper.Write method with encoder
- Added AdvApi32 RegRenameKey method #535
- Added Encoding variants to IntPtr.Convert extensions
- Updated memory handles to use factory and handle disposable subrefrences
- Added extension IntPtr.ToStringEnum with encoding
- Added IntPtr.GetNulledArrayLength and fixed IntPtr.ToStringEnum for concattenated stringsCommits on May 21, 2025
- Added size constants to CMINVOKECOMMANDINFOEX
- Added SDDL string constants
- Updated AdvApi32 structures in WinNT with new *Pointer values
- Added lots of missing constants to PortableDeviceApi
- Made IPortableDeviceServiceManager.GetDeviceServices param nullable
- Added support for accelerators with MessagePump and VisualWindow
- Added more D2d1 helpers
- Enhanced D3DCOLORVALUE with more conversions and constructors
- Added D2D_MATRIX_3X2_F.Rotation
- Added DirectX error values from winerror.h
Release Notes - 4.1.3
Kind of an accidental release, so very few changes:
- Enhanced SafeMemoryPool so that all entries can be named.
- Added many extension methods for Type, most useful for marshaling.
- Fixed bug #530 [in declaration of IPropertyStoreFactory.GetPropertyStore
- Added Array.MarshalToPtr extension method
Release Notes - 4.1.2
Additions
- Added Vanara.PInvoke.Dcomp for DirectComposition
- Added explicit converter operators to IntPtr for all static XXPointer structs
- Added IHandle.IsInvalid and adjusted all implementers
- Added equality support to LUID
- Added Win32Error.ThrowLastErrorIfNull that handles null class values
- Updated base handle equality
- Added new FwpUClnt elements (#525)
- Added simplified System.Index and System.Range structs for .NET 4.8 and .NET Std 2.0
- Added Vanara.BitField struct to simplify bit fields in structures and updated bit fields in Shared and Kernel32 as additional tests.
Breaking changes
- Many changes in User32 to make WindowClass and WindowBase wrappers work. There are some breaking changes with removed and added procedures to both wrappers.
- Made all IUnknown out parameters nullable to handle output when result is a failure
- Obsoleted AnySizeStructFieldArray
- Added Win32.ThrowLastErrorIfInvalidHandle to handle IHandle implementers
- Removed IDCompositionAnimation from UIAnimation now that Dcomp is done.
- Removed X86 and X64 Platform specs
Fixes
- Adjustments to all assemblies after adding code generator for all methods that can retrieve a casted IUnknown pointer
- Fixes to some autohandle conversions
- Updated IntPtr references in ActiveDS and DirectoryServices to Pointer structures
- Fixed readonly declarations on ResourceId
- Fixed some nullable parameters
- Fixed bug in SYSTEM_LOGICAL_PROCESSOR_INFORMATION definition (#524)
- Applying unfunctional and unincluded IUnkMethodGenerator so that build occurs for other commits
- Added unit test for WinTrust and fixed some errors in WinTrust
- A number of fixes and extensions added to BCrypt and NCrypt, most notably with any methods using NCryptBufferDesc.
- Added missing BCrypt and NCrypt algorithm tags
- Extended OverlappedAsyncBase.EndOverlappedFunction to allow for the wait state to have a timeout. (#528)
Release Notes - 4.1.1
Fixed critical bug with default creation of SafeHANDLE derived classes.
Release Notes - 4.1.0
Major Changes (hopefully not breaking)
- Added .NET 9.0 support and removed .NET 4.5 support
- Moved Vanara.PInvoke.VssApi to .NET 8.0 LTS from 6.0
- Moved Unit Tests to .NET 8.0
- Auto-generated handles now implemented for all projects.
Fixes and Additions
- Moved IHandle into Handles folder
- Added true and false operators to handle-type classes
- Added attributes for code generation of handles
- Added missing constants to D3D11
- Fixed ID3D11SwapChain.Present method and added IDXGIKeyedMutex to DXGI
- Fix issue with plibNewPosition not set properly (#510)
- Added missing WM_xx messages for Per Monitor v2 (#511)
- Added ability (not on by default) for ComStream to leave the underlying stream open after disposal. Also, optimized the Dispose pattern and removed destructor.
- Added undocumented ListView messages (#515)
- Added Kernel32.WIN32_STREAM_ID_HEADER as work-around to challenges with BackupRead (#516)
- Fixed major bug in SafeMemoryHandleExt.ToString that caused exception when passing allowed len param as -1 (#517)
- Corrected package and assembly name of Vanara.WindowsUpdate from Vanara.PInvoke.WindowsUpdate
- Added ReadBackup overload that does the work of pulling each stream out of a file with test.