Skip to content

Releases: dahall/Vanara

Release Notes - 3.3.8

07 Apr 19:46
Compare
Choose a tag to compare

Additions

  • BREAKING CHANGE: Removed Vanara.Windows.Forms.NavigationLogDirection in leiu of duplicate in Vanara.Windows.Shell
  • Updated ComStream to support IStream implementation
  • Enhanced ComConnectionPoint
  • Added Vanara.PInvoke.IMAPI (Image Mastering API) assembly
  • Added Vanara.Windows.Shell.ShellBrowser (#221)
  • Added optional parameter overloads for SetFilePointer, SetFilePointerEx
  • Added generic Win32Error.ThrowLastErrorIf method
  • Added IDeviceContext.MeasureText extension method to overcome deprecation of TextFormatFlags.ModifyString

Fixes

  • Fixed a number of interfaces in SearchApi that had properties in wrong order which caused memory access violations

Release Notes - 3.3.7

24 Mar 15:02
Compare
Choose a tag to compare

Fixes

  • Use explicit framework reference rather than TFM -windows. (#212). This reduces package sizes by up to 70%. Thanks to @NN--- for identifying problem and providing fix.
  • Fixed bug in ReadOnlyPropertyStore.TryGetValue (#219)

Additions

  • Cleaned, updated all NtDll parameter attributes and added overloads where required (#220).
  • Separated out UNICODE_STRING structures and functions and added a SafeUNICODE_STRING class that abstracts process specific memory access and layout.
  • Added marshaler to handle strings replacing UNICODE_STRING
  • Added HPROCESS.IsWow64() extension method

Release Notes - 3.3.6

19 Mar 14:06
Compare
Choose a tag to compare

Additions

  • Added generic CloseHandle and DuplicateHandle methods to better support IKernelHandle and SafeKernelHandle instances.
  • Added parameter attributes to CreateFileMapping variants
  • Added Function Discovery API assembly
  • Added Windows Connect Now (wcnapi) assembly
  • Added many methods to SafeSAFEARRAY to make it more like System.Array and more interoperable.
  • Added SAFEARRAY function overloads for simpler parameter passing.
  • Added VARTYPE.GetCorrespondingType extension method to convert to a .NET or Vanara type.

Fixes

  • Truncated desc for Kernel32 project to avoid 35K char limit
  • Fixed bug in LinkedListToIEnum extension method taking offset; now returning 0 for offset ends links.
  • Changed return value of OpenFileById from IntPtr to SafeHFILE
  • Added equality operators for IHandle and IntPtr to SafeHANDLE.
  • Made implicit conversion to HANDLE work from SafeHandle instead of SafeHANDLE
  • Changed INVALID_SET_FILE_POINTER a UInt32 to match SetFilePointer output type. Changed unsafe overload of ReadFIle to have all pointer params. Added SetFilePointer overload taking uint values as params.
  • Change all IO completion keys to IntPtr instead of UIntPtr -- they need to interchange with HANDLE types almost always.
  • Fixed ISearchRoot. IDL has property methods in put/get order instead of get/put and wrapping them in properties does not seem to allow that order.
  • Fixed READ_USN_JOURNAL_DATA.FirstUsn type per #215.
  • Fixed bug in FreePropVariantArray param definition
  • Fixed parameters on a number of SAFEARRAY functions.
  • Fixed bug in SAFEARRAYBOUND.ctor.
  • Fixed bugs in PROPVARIANT.GetSafeArray and SetSafeArray that caused crashed on all but a few use cases.

Release Notes - 3.3.5

01 Mar 22:21
Compare
Choose a tag to compare

Additions

  • Added Vanara.PInvoke.RstrtMgr project/assembly with Restart Manager functions. 100% complete.
  • Added over 100 new structures supporting control codes and DeviceIoControl
  • Added AnySizeStringMarshaler which is an IVanaraMarshaler implementation to handle structures where the last field is a single character string array.
  • Added ability to use "*" as field name to indicate that string or array length should be determined by the amount of allocated memory.
  • Added parameter attributes and DeviceIoControl overload that takes no input or output params.
  • Added non-opaque SID structure
  • Added COMPRESSION_FORMAT enum
  • Added/updated tests for Kernel32

Fixes

  • Fixed ambiguity with changes to PostQueuedCompletionStatus
  • Replaced GetLogicalDriveStrings with overloaded methods not using StringBuilder.
  • Usability updates to CldApi functions.
  • Fixed path size limitation on EnumFindMethods parameter (#213)

Release Notes - 3.3.3 and 3.3.4

11 Feb 20:34
Compare
Choose a tag to compare

Release 3.3.4

Fixes

  • Fixed bug with ShellContextMenu failing when passed the desktop shell item. Took chance to optimize folder params. (#206)
  • Fixed bug in ShellItemImages throwing unnecessary error if unable to generate thumbnail
  • Fixed bug in ShellItem when calling GetHandler without BHID value
  • Fixed issues with BasicMessageWindow that caused creation failures and WndProc call failures.

Additions

  • Added IContextCallback, ContextSwitcher and other IIDs. (#209 and #211)
  • Added WindowClass to encapsulate information about a window class.
  • Improved parameter attributes and overloads for CreateWindowEx and GetClassInfoEx

Release 3.3.3

Fixes

  • Fixed disposal bug in BasicMessageWindow
  • Fixes to NtQueryInformationProcess to compensate for bitness issues between processes. #123
  • Updated project files with ImportWindowsDesktopTargets feature to prevent NETSDK1136 build error (#200)
  • Reverted HBITMAP.ToBitmap() extension to just call Image.FromHBITMAP to avoid flipping until addressed (#202)
  • Fixed layout problem with MIB_UDP6ROW_OWNER_MODULE (#189)
  • Removed all calls to Marshal.ReleaseComObject where there exists a possibility that the interface could have been referenced by another object and changed to nulling the holding variable. See discussion thread #188.

Additions

  • Changed Win32Error.GetLastError to use function from Kernel32 instead of Marshal.GetLastError to improve speed.
  • Added Macros.MAKEINTATOM function
  • Added CreateWindowEx overload taking IntPtr for class name
  • Added ability to ShellAssociations from ShellItem and improved readability of exception handlers for ERROR_* conditions
  • Converted message window from Control to BasicMessageWindow in ShellContextMenu
  • Added SafeMemStruct.InitializeSizeField method to initialize an in-memory structure's size field
  • Added UNICODE_STRING.ToString(HPROCESS hProc) method
  • Added addition PROCESSINFOCLASS values from ProcessHacker and PInvoke.net
  • Added missing ReportIScsiTargetPortals function
  • Completed work for WSMan, including enhanced definitions for the IWSMan set of interfaces.
  • Added MiniDumpWriteDump and supporting structs #204
  • Moved VerRsrc structures and enum to new Version assembly
  • Added Vanara.PInvoke.Version project will all functions
  • Added MiniDumpWriteDump overload and fixed test (thanks @nn)

Release Notes - 3.3.2

21 Jan 17:17
Compare
Choose a tag to compare

Fixes
Fixed access violation exception in ShellContextMenu when building a MenuItemInfo for separators (#195)

Additions
Finished work and added some helper methods on IScsiDsc
Added more SetupAPI functions
Added InteropExtensions.SizeOf(object) method to calculate the size of an object in native memory. It will handle blittalbe structures, primitives, strings and arrays or enumerable lists of those items.
Added SafeMemStruct.Append overloaded methods to extend memory and write in bytes, memory or objects and return a pointer to the newly written element.
Added SafeMemStruct.GetFieldAddress method to get the location of a field in the structure's memory.

Release Notes - 3.3.1

20 Jan 16:32
Compare
Choose a tag to compare

This is a massive release with tons of additions, fixes and, unfortunately, breaking changes. I try to avoid them, but when stuff breaks and requires fixing, well, code has to change. PLEASE check your dependencies and assumptions with listed changes.

New Assemblies

  • Vanara.PInvoke.ComDlg32
  • Vanara.PInvoke.IScsiDsc
  • Vanara.PInvoke.Msi
  • Vanara.PInvoke.NewDev
  • Vanara.PInvoke.OleDlg
  • Vanara.PInvoke.Rpc
  • Vanara.PInvoke.SHCore (#193)
  • Vanara.PInvoke.SetupAPI
  • Vanara.PInvoke.WTSApi32
  • Vanara.PInvoke.WsmSvc (#194)

BREAKING CHANGES

  • Changed AppendMenu param from UIntPtr to IntPtr for easier conversion from HMENU and int command ids. Change MENUINFO.dwMenuData to IntPtr for easier conversions.
  • Moved IObjectWithSite from Shell32 to Ole32
  • Moved RPC enums from Ole32 to Rpc assembly and static class.
  • Revamped SendMessage overloads to reduce accidential use of wrong overload. Most uses still work except passing a class in as lParam.
  • Changed IDropTarget methods to use MouseButtonState param value instead of uint. Fixed dependencies.
  • Changed ThrowLastErrorIfInvalid to a generic method to return the same type as the delegate
  • Changed all IContextMenu variants to have PreserveSig model for implementation
  • Changed allocated string fields in ComDlg32 to StrPtrAuto rather than String.
  • Cleaned and extended Vanara.Security to support ActiveDirectoryExtension on all platforms
  • Enhanced ShellContextMenu further to support non-WinForms platforms better. (#178)
  • Extended IntPtr.Write(object value...) method to handle almost all cases of object types (arrays, lists, etc.)
  • Extended and improved object GetValue(this REG_VALUE_TYPE value) method
  • Made serious changes to IOleCommandTarget. It was very broken (#188). Added other missing stuff from docobj.h.
  • Moved DEVICE_SCALE_FACTOR from Shell32 to Shared
  • Moved HOTKEYF from ComCtrl32 to User32 to align with WM_GETHOTKEY location
  • Moved IOleCommand declaration to Ole Ole32 from Shell32
  • Moved MouseButtonState from User32 to Shared assembly and up to PInvoke namespace. Fixed dependencies.
  • Moved OLE types CY, DECIMAL and DATE up to Shared assembly.
  • Moved PDCAP enum from PowrProf to Shared and added a few other enums and structure to Shared.Wdm.cs from that header file.

Fixes

  • Fixed structures that could not load due to marshal attribute bugs
  • Derived ShellContextMenu from IDisposable so that it correctly disposes the underlying IContextMenu instance. #178
  • Fix misspelled path of file Winternl.cs (#187)
  • Fixed Int32/UInt32 mismatch on OFN
  • Fixed ShellContextMenu build error due to change to AppendMenu
  • Fixed alignment issue with MIB_UDPROW_OWNER_MODULE (#189)
  • Fixed bug in GetObject overloads
  • Fixed bug in LookupAccountSid2 where assigned return values incorrectly.
  • Fixed declaration of IEnumAssocHandlers.Next
  • Fixed methods in Shell32 (SHGetFolderLocation, SHGetFolderPath, SHGetFolderPathAndSubDir) that should use CSIDL enum but didn't. Fixed dependencies.
  • Fixed packing directive on MIB_UDP6ROW_OWNER_MODULE and MIB_UDPROW_OWNER_MODULE per issue #189
  • Removed Security.PermissionSetAttribute from all classes, properties and methods. It is now marked Obsolete.
  • Removed exception on index == 0 from IndirectResource ctor
  • Removed incorrect FlagsAttribute from WindowMessage enum and removed duplicate, unused WM_HSHELL values
  • Updated Windows.Shell project to support forms

Additions

  • Abstracted out read-only methods from SafeAllocatedMemoryHandle into SafeAllocatedMemoryHandleBase
  • Added BITMAPINFO.FromHBITMAP method and default static values for BITMAPINFO and DIBSECTION
  • Added BROADCAST_QUERY_DENY return value.
  • Added BasicMessageWindow class as a simple alternative to NativeWindow and MessageWindow
  • Added BindToHandler overloads accepting BHID enum values
  • Added CW_USEDEFAULT constant and fixed return value of CreateWindow function
  • Added CorrespondingTypeAttribute to power GUID values when they support a secondary value
  • Added CorrespondingTypeAttributes to all BHID enum values
  • Added GDI extension methods for HBITMAP - IsBottomUpDIB, IsDIB and simplified ToBitmap
  • Added GetVolumePathNamesForVolumeName overload
  • Added HWND.HWND_MESSAGE value
  • Added IArrayStruct interface to identify two-field structures where the first field is an UInt32 and the second is a pointer to an array of structures along with supporting marshaler and extension method.
  • Added IArrayStruct inheritance for DRT_DATA
  • Added IDC_ cursor resource id constants
  • Added IDI_* values for static icons and overloaded LoadIcon function to accept a ResourceId param.
  • Added ISafeMemoryHandle.GetBytes method that was already implemented all implemented classes
  • Added LsaQueryCAPs overload taking a pointer for the first param
  • Added MADCAP functions to Vanara.PInvoke.Dhcp
  • Added Null field to SafeCoTaskMemStruct and SafeCoTaskMemStruct
  • Added PlatformTarget value as pre-processor constant for all projects.
  • Added ResourceId.IsIntResource property
  • Added SafeHBITMAP.ToBitmap method
  • Added ShellDataObject constructor taking a list of ShellItems which adds them via CFSTR_SHELLIDLIST
  • Added ShellItem.Verbs to get a list of active verbs
  • Added ShellItemImages and associated tests to pull images for a shell item from a variety of different interfaces. For some items, the image appears upside down without an DIB indication.
  • Added StructHelper.InitWithSize to simplify the many structures that have to be initialized with their size.
  • Added VOLUME_DISK_EXTENTS
  • Added Vanara.Collections.ICOMEnum interface to indicate COM interfaces that support the Enum/Reset pattern. Useful for simplifying getting IEnumerable runs from them. Added ICOMEnum interface to all appropriate COM interfaces.
  • Added Vanara.Diagnostics.DeviceManager and supporting classes to manage devices and device classes on local or remote machines.
  • Added LookupAccountSidLocal per #184 comment.
  • Added PropertyDescriptionList.GetValuesForShellItem method to retrieve list of properties from a shell item. Useful for tooltips and like items retrieved from ShellAssociation.
  • Added ShellItem.ContextMenu and Images properties, enhanced GetHandler method to check for correct interfaces, changed InvokeVerb to use ShellContextMenu
  • Added abstract SystemEventHandler which provides a smart message window that will automatically spin up a thread, if needed, for the message pump. Converted ShellItemChangeWatcher from using NativeWindow to using SystemEventHandler to support console use
  • Added access to handlers for ShellAssociation #181
  • Added binary negate overload to BOOL and BOOLEAN
  • Added check for empty icon file in LoadImageFromExtractImage
  • Added constants for static controls (msgs, notifications and styles)
  • Added constructor for MSG struct
  • Added conversion methods from HBITMAP to Bitmap and BitmapSource
  • Added conversion methods from HICON to HBITMAP and BitmapSource.
  • Added explicit conversion from SOCKADDR_STORAGE to SOCKADDR_IN and SOCKADDR_IN6
  • Added missing ASSOCSTR values (#180)
  • Added new SendMessage overload for WM_GETTEXT use case (#191).
  • Added over 100 new COM interfaces to Ole32
  • Added owner-draw structures and enum to User32.
  • Added param attributes for CreateWindow(Ex) and CREATESTRUCT structure
  • Based on Windows error in LookupAccountSid, I've added LookupAccountSid2 based on LsaLookupSid2.
  • To Shell32.ShellUtil, added SHIL to pixel conversions and wrapper methods to handle getting images and icons from shell items and folders.
  • Finished work on PowerManager event additions for all power events. (#190)

Release Notes - 3.3.0

20 Nov 19:57
Compare
Choose a tag to compare

* New support for .NET 5.0 in all assemblies

Additions

  • Added SHChangeNotify overloads for strings and PIDLs
  • Added time_t class with conversion support to/from DateTime
  • Added HEVENT handle
  • Added DHCP client APIs in new Dhcp assembly

Fixes

  • Fixed bug in ShellContextMenu.Invoke (#177)

Release Notes - 3.2.21

13 Nov 18:42
Compare
Choose a tag to compare

Added

  • Added SafeNativeListBase which is a SafeMemoryHandle that acts as a read-only list and derived SafeNativeLinkedList from it and added ability to change way linked list is retrieved.
  • Added InitVariantFromStrRet
  • Added IntPtr.AsRef extension method
  • Added RefEnumerator.Count, Reset and indexer
  • Added InteropExtensions.UnsafePtrToArray method
  • Added OLE types CY, DATE, UDATE and DECIMAL
  • Added missing VarXX functions from OleAuto32
  • Added VariantToStrRet function

Fixed

  • Changed GetLogicalProcessorInformationEx helper method to return a safe handle rather than an array so that the memory of linked, nested child arrays is not disposed before use. (#176)

Release Notes - 3.2.20

08 Nov 23:17
Compare
Choose a tag to compare

Additions

  • Added PIDL conversion to byte[]
  • Added PropertyDescriptor.TryCreate method and CanGroupBy and IsViewable properties
  • Updated Theraot NuGet pkg to 3.2.0 across solution
  • Added FileIconInit method and SHSTOCKICONINFO.Default field.
  • Added GetSystemIcon overload that uses an index and optimized methods.
  • Added Vanara.Windows.Shell.StockIcon class
  • Added second IExtractIcon.Extract extension to handle getting one icon
  • Exposed underlying handle of StockIcon via IconHandle
  • Added Vanara.Windows.Shell.ShellDataTable which is a DataTable that defines its columns and row from items in a shell folder. Designed for streamlined async reading of a shell folder's items and their properties.
  • Overloaded IntPtr.LinkedListToEnum extension method to allow for offset func.
  • Added IGraphicsObjectHandle to all appropriate GDI safe handles
  • Added GetUIObjectOf extension methods that return HRESULT
  • Added missing param attributes to CopyImage
  • Added methods to convert between SHIL values and the system's closest pixel size

Fixes

  • Fixed layout of PARTITION_INFORMATION_GPT so it is blittable (#173)
  • Optimized PROPERTYKEY.Equals
  • Rebased PIDL on SafeHANDLE from GenericSafeHandle to avoid generics.
  • Fixed params on IShellFolder2.GetDetailsEx
  • Removed unnecessary handling of 'shell::' prefixed paths in GetShellItemForPath. Determined that SHCreateItemFromParsingName already does this.
  • Updated parameter attributes and overloads for Shell_GetCachedImageIndex and SHMapPIDLToSystemImageListIndex
  • BREAKING CHANGES: Changed name of IExtractIcon to IExtractIconW and added IExtractIconA. In use, both are required. Changed Extract method to unsafe and made parameters pointers to allow for null values. Added Extract extension method for safe access to method.
  • MANY BREAKING CHANGES: Since these all can implemented interfaces, changed all interfaces methods to PreserveSig with HRESULT return values for ICategorizer, ICategoryProvider, IObjectWithFolderEnumMode, IShellFolder, IShellFolder2, and IShellIcon. Updated extension methods accordingly.
  • Fixed minor bug in IconExtension.GetSystemIcon
  • Fixed #175 per detail for GetLogicalProcessorInformationEx
  • Moved pure extensions for Gdi functions to Gdi32
  • Changed IExtractImage interface to PreserveSig format
  • Changed IThumbnailProvider.GetThumbnail to return a SafeHBITMAP instead of HBITMAP
  • Fixed ShellNavigationHistory so events fire
  • Unchanged non-errant IpHlpLib fields base to FILETIME from SYSTEMTIME per #154 and updated documentation