Vanara

A set of .NET libraries for Windows implementing PInvoke calls to many native Windows APIs with supporting wrappers.

MIT License

Stars
1.7K
Committers
26

Bot releases are hidden (Show)

Vanara - Release Notes - 3.4.0

Published by dahall over 2 years ago

Major Changes to .NET Version support

  • Removed support for .NET 2.0, 3.5, and 4.0, .NET Core 2.0, 2.1, and 3.0 since all are or shortly will be out of support.
  • Added support for .NET 4.8 and 6.0.
  • Removed PackageReference details for .NET 5 and 6 projects with System.Drawing.Common.
  • Moved most TargetFrameworks tags out of project files and into Directory.Build.props for easier maintenance.

Breaking Changes due to dependency reduction

  • Reduced dependencies of almost all assemblies on .NET runtime assemblies not part of core System assemblies, most specifically System.Drawing and System.Windows.Forms. This forced the removal of some overloaded methods and the replacement of leveraged structures and enums with native equivalents.
  • Added Vanara.Windows.Shell.Common which has all the content from Vanara.Windows.Shell that did not have dependencies.
  • Removed dependencies on WinForms and WPF for Gdi32 and User32 assemblies. This forced the removal of extension methods to convert HBITMAP and HICON to System.Windows.Media.Imaging.BitmapSource and all uses of IWin32Window.
  • Extracted all extension methods from Gdi32 and User32 and moved them to Vanara.Windows.Extensions.
  • Moved TEXTMETRIC, LOGPALLETTE, PALLETTEENTRY, and PC from Gdi32 to Shared project to remove dependencies on Ggi32 by other projects (e.g. Ole).
  • Added POINT struct to Vanara.PInvoke, changed all System.Drawing.Point reference to POINT, and optimized RECT and SIZE structures.
  • Added extension assemblies for WinForms, WPF, and WinUI/UWP
  • Converted ShellView items returning PIDLs to return ShellItems

Upgrade notes

  • Replace all instances of System.Drawing.Point in Vanara methods and properties with Vanara.PInvoke.POINT
  • Replace all instances of System.Windows.Forms.Form and Control and IWin32Window with the raw window handle (HWND)
  • If you are missing other items from System.Drawing or System.Windows.Forms look for new values or check the new Vanara.Windows.Extentions assembly.

New Assemblies

  • Added Antimalware assembly (Vanara.PInvoke.AMSI) with supporting wrapper class: Vanara.SystemServices.AntimalwareScan.
  • Vanara.PInvoke.Ime32
  • Vanara.PInvoke.Usp10 (Uniscribe)
  • Vanara.PInvoke.WinHTTP

Additions

  • Added ABN and ABS enums to ShellApi
  • Added HWND.HWND_BROADCAST constant
  • Added NMHDR.LParamAsRef method
  • Added PinnedObject implicit operator to unsafe void*.
  • Added SafeAllocatedMemoryHandleBase.GetBytes() and pulled SafeMemoryHandle.Locked from IMemoryMethods instance
  • Added SafeMoveableHGlobalHandle class and added support to locking memory to all memory classes.
  • Added StringHelper methods supporting encoders
  • Added Vanara.Windows.Shell.Taskbar class to get/set information regarding the system taskbar.
  • Added elements from mstcpip.h to Ws2_32
  • Added extra buffer when setting size from VanaraMarshaler to prevent errors when they're off due to alignment issues
  • Added helper functions to WINDOWPOS to help when using it with LPARAM values.
  • Added indexer to SafeMemString
  • Added missing hook constants from winuser.h
  • Added tcp_keepalive struct to Ws2_32
  • Applied new lang constructs to CLIPFORMAT
  • Extended SafeAllocatedMemoryHandle.ToType extension method to support CharSet
  • Incorporated non-breaking suggestions for Device and DeviceManager in #282
  • Made CorrespondingTypeAttribute.GetAttrForEnum public.
  • Made some optimizing changes to PInvoke.VirtDisk and added VirtualDisk.SetParentPath and SetParentPathWithDepth methods.

Fixes

  • Changed SafeMoveableHGlobalHandle.ctor(IntPtr...) method to not accept size and rather extract it using GlobalSize
  • Correct alignment for WTSINFO and WTSINFOEX. (#279)
  • Corrected APPBARDATA structure layout to address #276
  • Fixed #268
  • Fixed #274 (error in EnumerableEqualityComparer.Equals)
  • Fixed SecPkgContext_IssuerListInfoEx size and added extraction property
  • Fixed WINHTTP_CURRENT_USER_IE_PROXY_CONFIG so it exposed pointers which can be freed.
  • Fixed bug in Win32Error.ThrowLastErrorIf method that would exception if error was success.
  • Fixed bug with VirtDisk.GetStorageDependencyInformation and implemented VirtualDisk.GetStorageDependencyInformation() and VirtualDisk.DangerousGetHandle()
  • Fixed incorrect struct layout for WTSINFO (#278)
  • Fixed minor error handling in EnumFlagIndexer and added Intersect method.
  • Fixed multiple problems with SystemParametersInfo and SPI values (#283). Overload methods now are tested against all SPI values.
  • Fixed small bug in IntPtr.ToStringEnum
  • Lots of work to make using IDataObject and the clipboard more stable and usable. Added Get/Set extension methods for IDataObject. Added attributes to clipboard formats to help reading. Added formatters to process clipboard types. Fixed bugs in ShellDataObject and NativeClipboard.
  • Lower System.ValueTuple version dependency. (#280)
  • Prevented #269 by addeding documentation and removing [Optional] attribute on final param for SHChangeNotify.
  • TYPEFLAGS changed to uint (#267)
  • Updated documentation for all window messages.
Vanara - Release Notes - 3.3.15

Published by dahall almost 3 years ago

Additions

  • Added IStorageProviderCopyHook per request #252
  • Added BeginEndEventContext to call delegates on context entry and exit
  • Added WindowStylesEx.WS_EX_NOREDIRECTIONBITMAP (#254)
  • Cleaned BITS file syntax and added support for v10.2 and 10.3: IBackgroundCopyFile6, IBackgroundCopyJobHttpOptions2, IBackgroundCopyJobHttpOptions3, and IBackgroundCopyServerCertificateValidationCallback
  • Added Shell notify icon messages (#260)

Fixes

  • Work on fixing and enabling Audit log writes using AuthzReportSecurityEvent and AuthzReportSecurityEventFromParams. The prior is now fully working. (#251)
  • Finished fixing AuthzReportSecurityEventFromParams. BREAKING CHANGE: removed SafeAUTHZ_SOURCE_SCHEMA_REGISTRATION as all functionality was possible by marshaling AUTHZ_SOURCE_SCHEMA_REGISTRATION correctly.
  • Fixed bug with AVICOMPRESSOPTIONS functions (#253)
  • Made changes to address #255.
  • Fixed missing size in HeapAlloc, HeapReAlloc, and SafeHHEAP.GetBlock (#258)
  • Changed IBackgroundCopyJob.SetNotifyInterface parameter to IBackgroundCopyCallback instead of Object
  • Fixed #257 problem with BackgroundCopyJob constructor throwing error on systems prior to Win 10 and deficiencies with BackgroundCopyManager.Version property.
  • Fixing wrong size of IMAGEHLP_MODULE64.ModuleName; see https://docs.microsoft.com/en-us/windows/win32/api/dbghelp/ns-dbghelp-imagehlp_modulew64 (#256)
  • Updated IEnumFromCom to support intialized (new) items so it covers structures and classes.
  • Fixed #262 and adjusted other functions in ICreateTypeInfo to include enums.
Vanara - Release Notes - 3.3.14

Published by dahall almost 3 years ago

Additions

  • Added EnhancedStorge and PortableDeviceAPI (WPD) assemblies
  • Added new DNS, TimeStamp, Kernel and various other functions introduced in Win11
  • Added SafePSECURITY_DESCRIPTOR.ToString(SECURITY_INFO) overload
  • Added IObjectSafety interface
  • Added intefaces to UrlMon: IAuthenticate, IAuthenticateEx, IBindHost and IPersistMoniker
  • Added GetInfo, SetInfo, ReadMemeory and WriteMemory process extension methods.
  • Added KERNEL_USER_TIMES to NtDll
  • Added path extension methods for processes and extended GetInformation to also get values from NtQueryInformationProcess.
  • Added Process.GetPebAddress extension method
  • Code cleanup of SecurityBaseApi.cs and addition of generic GetTokenInformation overload.
  • Added MANDATORY_LEVEL enum.
  • Added extension methods HTOKEN.GetIntegrityLevel, PSECURITY_DESCRIPTOR.GetIntegrityLevel, PACE.GetAceType.
  • Added IEquatable support to SID_IDENTIFIER_AUTHORITY and PSID_IDENTIFIER_AUTHORITY
  • Added SafePSID.Authority and SubAuthorities properties and mirrored extension methods for PSID.
  • Added GetModuleHandleEx overload for an address
  • Added GetProcAddress methods to SafeHINSTANCE
  • Added Ole32.IPersistPropertyBag interface
  • Added missing constants from lmaccess.h
  • Added LocalGroup and UserAccount classes to Vanara.SystemServices to retrieve local group and user account information from a server's SAM. Added access through Computer class.
  • Added IPortableDeviceManager extension methods

Fixes

  • Changed paramters to CoDecodeProxy, added CoGetClassObject overload
  • Fixed PROCESS_INFORMATION_CLASS values and types.
  • Updated and fixed attributes for appmodel.h functions, adding GetPackageFullName function.
  • Extracted WinNTExtensions into its own file and added PACL.GetAce and PACL.EnumerateAces extension methods.
  • Updated SafePSID.FromToken to use generic GetInfo.
  • BREAKING CHANGE: Removed ProcessIntegrityLevel and replaced use with AdvApi32.MANDATORY_LEVEL.
  • Fix MIB_TCP_STATE enum wrapper (#250)
Vanara - Release Notes - 3.3.13

Published by dahall about 3 years ago

Additions

  • Added methods and interfaces for File History (FhSvcCtl)
  • Added NotifyIcon.GetBounds extension method
  • Updated SafeAnysizeStruct so an IntPtr field can be used for the array size.
  • Updated documentation for NOTIFYICONIDENTIFIER and added constructors.
  • Added Rtl*Heap functions
  • Added missing constants and CLSID for component category registration.
  • Added Shell32.IDeskBand and supporting types
  • Added ability to set a COLORREF by using a tuple (e.g. COLORREF c = (255,255,0);)
  • Added SHCIDS constants
  • Added IsNullOrEmpty property to StrPtrXX structures.
  • Added IEquatable support to GuidPtr and StrPtr* structs. …
  • Added char* cast to StrPtrUni and sbyte* cast to StrPtrAnsi.
  • Added Wireless Ad Hoc interfaces to WlanApi assembly.

Fixes

  • Removed HelpBuilder project and files -- unused and problematic.
  • Fixed parameter and field types for User32 mouse functions (#248)
  • Fixed bug in SafeProcThreadAttributeList.Create (#249)
  • BREAKING CHANGE Changed const params in SHCreateDefaultContextMenu, SHCreateShellFolderView and SHCreateShellFolderViewEx from ref to in.
Vanara - Release Notes - 3.3.12

Published by dahall about 3 years ago

Additions

  • Added assembly for CimFs library
  • Added BasicMessageWindow.HandleCreated and HandleDestroyed events.
  • Added CorrespondingType attributes to StandardClipboardFormat values.
  • Added CorrespondingTypeAttribute.EncodingType property to allow for encoding as part of a conversion.
  • Added Flags attribute to DROPEFFECT and UPDFCACHE
  • Added NativeClipboard.GetShellDataObject
  • Added ASCII text item to NativeClipboard.SetText method.
  • Added ShellDataObject.GetData handler for CFSTR_INETURL
  • Added ShellDataObject.SetData handler for CFSTR_DROPDESCRIPTION
  • Added ShellDataObject.SetOleStreamData
  • Added ShellItemArray.ToDataObject method to extract an IDataObject
  • Added ShellItemPropertyStore.Dispose overload to null out use of ShellItem. May help with #242.
  • Added SystemEventHandler.MessageWindowHandleCreated event
  • Added USN type with correct mapping (long for LONGLONG instead of int) and corrected all references in structures and functions. #241

Fixes

  • Changed HFILE to implement ISyncHandle
  • Changed ShellDataObject.ctor to take IEnumerable instead of array and expanded it to set CFSTR_SHELLIDLIST, CFSTR_FILEDESCRIPTORW, CFSTR_FILECONTENTS, CF_HDROP, CFSTR_FILENAMEA, and CFSTR_FILENAMEW.
  • Changed order of title and url placement in NativeClipboard.SetUrl to url first.
  • Fixed misspelling in FILEDESCRIPTOR.nFileSize
  • Made adjustments to WinCon to fix INPUT_EVENT marshaling problems (#244)
  • Renamed PInvoke\NTDll to PInvoke\NtDll to match NuGet package (#243)
  • Streamlined disposals of ShellItem and ReadOnlyPropertyStore to address #242 and minimize impact of garbage collection when IPropertyStore is used.
  • Updated NativeClipboard to ensure that the listener window is only created when the ClipboardUpdate event is handled.
  • Updated User32.INPUT structure for better usability, changed UIntPtr fields to IntPtr in a few structures and functions, added VK_* constants.
Vanara - Release Notes - 3.3.11

Published by dahall about 3 years ago

Additions

  • Added NtCreateProcess(Ex) methods to NtDll (#233)
  • Completed addition of all functions to Multimedia project
  • Added WinBio functions and corrected structures -- only partially functional
  • Added winsock2 select function (#239)

Fixes

  • Changed all dll references to lowercase to avoid new .NET 5 behavior (fixes #235)
  • Switched ShellBrowser event handler based methods to overrides and reformatted doc.
  • Fixed #225 with ExplorerBrowser failing when added to designer window.
Vanara - Release Notes - 3.3.10 and 3.3.9

Published by dahall over 3 years ago

3.3.9

Additions

  • Added CfgMgr32 assembly (#222) with initial requested functions
  • Added assembly for Text Services Framework
  • Added DEVPROPKEY.LookupName and ToString methods
  • Added DEVPROPKEY.TryGetReadOnly method to look at read-only flag.
  • Added DEVPROPTYPE.GetObject extension methods
  • Added GUID_DEVINTERFACE_* constants
  • Added LANGID structure
  • Added actions to DEVPROPKEY corresponding type info
  • Added missing structures from SetupAPI's devpropdef.h.

Fixes

  • Extracted and fixed IEnumFromCom
  • Fixed #223 due to INPUT alignment problem
  • Fixed bug in ExplorerBrowser to avoid releasing a PIDL whose owner is the shell itself (#224)
  • Fixed #226 by correcting layout and marshaling for WlanSetFilterList and DOT11_SSID
  • Fixed bug in IEnumFromCom single object constructor
  • Fixed bug in IntPtr.ToStringEnum method that failed when just the ending null terminator was present.
  • Moved LCID to WinNT folder where it belongs and updated with LANGID parts

3.3.10

Additions

  • Added Lz32 assembly with all functions from lzexpand.h.
  • Added SafeHANDLE.ReleaseOwnership method to extract handle from safe handle so it is not closed on disposal.
  • Added constants and conversion methods for enums in the C Run-time Library related to files.
  • Added related structures for BITMAPINFO and new SafeBITMAPINFO class to handle various incarnations
  • Added partial Multimedia assembly.

Fixes

  • BREAKING CHANGES: Worked over functions related to BITMAPINFO adding attributes, creating overloads and changing 'ref' params to 'in' params where immutable. Needed because these functions often could fail due to poor processing of the structure.
  • Extracted OFSTRUCT from Kernel32 to Shared and changed fFixedDisk field to bool.
  • FIxes and improvements to PInvoke.VirtDisk (some breaking changes) and Vanara.VirtualDisk (chaged Enabled to ResilientChangeTrackingEnabled to avoid confusion).
  • Fixed #228 by adjusting field type of Vanara.PInvoke.CryptUI.CRYPTUI_WIZ_IMPORT_SRC_INFO.CRYPTUI_WIZ_IMPORT_SRC_INFO_UNION.pwszFileName to blittable StrPtrUni
  • Fixed #230 by changing all import library references from Kernelbase to Psapi for functions defined in psapi.h. This allows the functions to work on all versions of Windows.
  • Fixes to Cabinet assembly based on #232 issue and @IllidanS4. Many of which are BREAKING CHANGES.
  • Modified structure fields to make blittable
  • Support Windows 10 window-frame style (#229)
Vanara - Release Notes - 3.3.8

Published by dahall over 3 years ago

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
Vanara - Release Notes - 3.3.7

Published by dahall over 3 years ago

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
Vanara - Release Notes - 3.3.6

Published by dahall over 3 years ago

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.
Vanara - Release Notes - 3.3.5

Published by dahall over 3 years ago

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)
Vanara - Release Notes - 3.3.3 and 3.3.4

Published by dahall over 3 years ago

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)
Vanara - Release Notes - 3.3.2

Published by dahall over 3 years ago

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.

Vanara - Release Notes - 3.3.1

Published by dahall over 3 years ago

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)
Vanara - Release Notes - 3.3.0

Published by dahall almost 4 years ago

* 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)
Vanara - Release Notes - 3.2.21

Published by dahall almost 4 years ago

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)
Vanara - Release Notes - 3.2.20

Published by dahall almost 4 years ago

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
Vanara - Release Notes - 3.2.19

Published by dahall almost 4 years ago

Let's just call this release Friday Fixes. Almost all these are bugs turned up after re-running a bunch of the tests

  • Changed all methods that returned SafeCoTaskMemString to string. After much reading and testing I determined this was redundant with marshaling code in .NET.
  • Fixed bug with CorrespondingTypeAttribute.GetAttrForEnum with default action
  • Fixed bugs in PROPVARIANT get value operations
  • Fixed bug in PropVariantToStringVector overload
  • Added GetPropertyDescriptionList default prop value to get all properties.
  • Made BindContext.EnumObjectParam return empty enumeration if method fails
  • Fixed bug in IndirectResource.ctor
  • Fixed bug in lookup table for WIA_PROPID_TO_NAME
  • Fixed bug in PropVariantToStringVector
  • Fixed a number of bugs with IUri and IUriBuilder
Vanara - Release Notes - 3.2.18

Published by dahall almost 4 years ago

Additions

  • Added missing constants and macros related to SID size.
  • Added SafePSID.FromToken and PSID.GetDomainSid methods
  • Added SafeDRT_DATA to DRT
  • Added Null fields to SafeHCRYPTHASH, SafeHCRYPTPROV and SafePCCERT_CONTEXT
  • Added missing Crypt32 constants
  • Added CERT_RDN_ATTR and CRYPT_BIT_BLOB
  • Added predefined values to SafeOID
  • Added methods to assist with memory alignment.
  • Added NativeMemoryStream.ReadToPtr and WriteFromPtr methods to interact with allocated memory.
  • Added methods to convert from IN_ADDR to IN6_ADDR
  • Added SIZEOF_SOCKET_ADDRESS_LIST macro.
  • Extended SOCKADDR explicit cast to SOCKADDR_IN6 so that if represented by a v4 IP address, it will convert it to IPV6 before casting.
  • Added LsaOpenPolicy test for remote machine (#169)
  • Added DISPID constants to ShlDisp and updated dependent interfaces
  • Added overload for ConnectToConnectionPoint for optional last param and fixed attributes.
  • Added missing EnumeratorToEnumVariantMarshaler for .NET Core
  • Initial implementation of FirewallApi.dll. Yes, it is in VB instaead of C#. Ony VB support parameterized properties and the underlying COM objects have these. Plus, it was a fun experiment.
  • Added Vanara.Collections.History class
  • Added standard HWND constants as static fields in HWND
  • Added PID constants for property ID values in a PROPERTYKEY
  • Added explicit ReadConsoleA and WriteConsoleA for UTF-8 operations (#171)
  • Added IsUserCetAvailableInEnvironment and SetProcessDynamicEHContinuationTargets functions to Kernel32
  • Added Get*Profile** function overloads to replace StringBuilder with allocated memory for multistring results (#172)
  • Added Vanara.Configuration.InitializationFile wrapper class for all PrivateProfile functions.
  • Added equality operators to PIDL
  • Added shell::: URI handling to ShellUtil.GetShellItemForPath
  • For ShellItem, added TypeConverter for strings, DataObject property, multiple Open method overloads, and ToUri method.

Fixes

  • BREAKING CHANGE: Modified interfaces IOleWindow and IShellBrowser and all derived interfaces so they use PreserveSigAttribute. All these interfaces can be client implemented and needed that capability.
  • BREAKING CHANGE: Fixed return value of TrackPopupMenuEx so command identifiers could be returned.
  • BREAKING CHANGE: Reconfigured PROPSPEC structure so it works on both X86 and X64 and added constructors to help.
  • BREAKING CHANGES: Fixed all the profile functions for ease of use and proper function.
  • Fixed signature on CryptSignAndEncodeCertificate and CryptSignCertificate and added Null field on SafeHCRYPTKEY
  • Fixed field types in CERT_INFO and CERT_PUBLIC_KEY_INFO
  • Addressed #168 by adding protected virtual GetDialogFlags and GetPreVistaDialogFlags methods that return the flags used by SDK functions.
  • Changed SOCKET_ADDRESS_LIST[] references to IntPtr or void**.
  • Fixed condition in HRESULT.FormatMessage that fails when MUI file couldn't be found.
  • Fixed bug in marshaler for LSA_UNICODE_STRING under X64 that caused alignment error and failure on all calls. Thanks @ryannewington for identifying the problem and where to fix it (#169).
  • Fixed attributes on IShellView.GetItemObject
  • Fixed bug in IContextMenu3.HandleMenuMsg2 declaration
  • Fixed bug in IPropertySetStorage::Create definition …
  • Fixed problems with IPropertyStorage::Read/WriteMultiple definitions and provided overload to simplify. Fixed param on Commit method.
Vanara - Release Notes - 3.2.16

Published by dahall about 4 years ago

Additions

  • Added DRT and PeerDist libraries
  • Added Vanara.Network.InternetProxyOptions to manage proxy settings for an internet session or for the system.
  • Added new property keys for Recycle Bin (#162)
  • Added missing FOLDERID items (#164)
  • Adding missing enums PER_CONN_AUTODISCOVERY_FLAGS and PER_CONN_FLAGS

Fixes

  • BREAKING CHANGES Changed function of IndirectResource so that it accepts a string and then provides read-only properties of the parts rather than other way around. Too fragile. Also fixed ResourceId property so that it is an Int32 and not a pointer. Wrong impl.
  • Fixed error in ReadOnlyPropertyStore.TryGetValue that only would return true (#163)
  • Fixed bug in ShellFileOperations when supplying multiple files at once causing an endless loop
  • Removed BITS and VirtualDisk project references from SystemServices
  • Renamed WIndows.Forms to Windows.Forms (#165)
  • Corrected FOLDERTYPEID ControlPanelCategory (#166)