Vanara Versions Save

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

v4.0.0

1 month ago
  • Nullable notation added to every project
  • Lots of breaking changes from that nullability as I adjusted code based on new constraints
    • I'm still deciding on if I will try to backport fixes applied to the 4.0 branch to master or fold them together. Your feedback is appreciated.
  • Use of global using statements
  • Addition of .NET 7.0 and 8.0
  • Finally fixing and releasing VssApi
  • Fixed #392, #439, #441, #442, #443, #445, #448, #450

Full Changelog: https://github.com/dahall/Vanara/compare/v3.4.17...v4.0.0

v4.0.0-beta

5 months ago
  • Nullable notation added to every project
  • Lots of breaking changes from that nullability as I adjusted code based on new constraints
  • Use of global using statements
  • Addition of .NET 7.0
  • Updates and additions to unit tests

This will stay in beta status for about two months while I collect feedback and fix problems. I hope you'll try it and give me a hand finding the errors and inconsistencies.

v3.4.17

6 months ago

Updates

  • Updated CryptUI.CRYPTUI_WIZ_DIGITAL_SIGN_BLOB_INFO and CRYPTUI_WIZ_DIGITAL_SIGN_CERT_PVK_INFO and CRYPTUI_WIZ_DIGITAL_SIGN_CONTEXT with better ctors and enums.
  • Updated Kernel32 with functions and structures to handle resource message tables.
  • Added ShellItemImages.GetImage (non-async) method and changed ShellItem.GetImage to use it.
  • Added NtDll.RtlGetVersion per #421

Fixes

  • Fixed incorrect AllocZeros value in HGlobalMemoryMethods
  • IpHlpApi struct fixes
  • Fixed bug in RECT type converter when serialized
  • Fixed bug in HRESULT type converter and added ability to add values and libs to error message cache
  • Fixed bug in SOCKET_ADDRESS.GetSOCKADDR that prevented 16 bit entries from translating
  • Fixed DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY enum #423
  • Changed visibility of MESSAGE_RESOURCE_ENTRY.GetText to internal
  • Fixed ResourceFile with updates to Kernel32
  • Fixes #427 - Bad impl of Kernel32.FILE_ID_128.Identifier
  • Fixed #428 (bad return value for User32.MB_GetString)
  • Fixed bug in SafeNativeArray.GetPointers

v3.4.16

9 months ago

Additions

  • Updated NuGet packages
  • Update WinSCard.cs with nullable support and UIntPtr

Fixes

  • Fixed SCardListReaders overloads (#402)
  • Fixed STORAGE_PROPERTY_ID enum values (#403)
  • Fixed SCardTransmit parameters (#404)
  • Applied suggested fix for IP_ADDRESS_PREFIX (#405)
  • Added missing enums to DOT11_PHY_TYPE #408
  • Fix IEnumSTATPROPSETSTG attributes (causing InvalidCastException) (#411)
  • Fix PROPVARIANT at 64-bit, Clearing string Vectors + UT (#413 and #416)
  • Added null checks to ShellItemImages.GetImageAsync to prevent #414
  • Added constants to DPI_AWARENESS_CONTEXT per #417
  • Addressed multi-thread issues with StaticFieldValueHash (#419)

v3.4.15

11 months ago
  • Fixed bug with SetWindowSubclass, SUBCLASSPROC, and RemoveWindowSubclass (#393)
  • Fixed IDataObject.SetData extension to get CF_HDROP right with Unicode and changed DROPFILES.DangerousGetFileList to static function taking a DROPFILES pointer.
  • Fixed formatting
  • Fixed definition of WINDOWPLACEMENT (#394)
  • Fixed generic GetThemeColor (#395)
  • Fixed incorrect values in User32.WINEVENT (#398)
  • Added coclass for IApplicationDocumentLists #399
  • Added overload for Shell32.SHAddToRecentDocs and supporting structures #401
  • Removed ICOMEnum from IEnumObjects (it doesn't follow Next method pattern) and added an extension method for IEnumObjects.Enumerate that will enumerate the interfaces exposed by IEnumObject. Fixes #400

v3.4.14

1 year ago

Additions

  • Added SP_DRVINFO_DETAIL_DATA_MGD which will take memory tied to SP_DRVINFO_DETAIL_DATA and extract the correct values. (#374)
  • Added SetupDiEnumDriverInfo overload to enumerate values (#374)
  • Added CorrespondingTypeAttribute values to GetClassLongFlag enum

Fixes

  • Changed parameters of SetupDiGetDriverInfoDetail to use an IntPtr and a new overload to extract the results to SP_DRVINFO_DETAIL_DATA_MGD.
  • Fixed stack overflow in POINT.X and POINT.Y (#375)
  • Fixed LOGPALETTE structure and associated functions
  • Added unit test and corrected return values in Lz32
  • Changed default flag for ShellItemPropertyStore to GPS_BESTEFFORT to prevent exceptions. #378
  • Fixed the DsFreeSpnArray function signature, as it was corrupting the native heap. (#382)
  • Added (#383) support for MessageBoxTimeout, an undocumented function.
  • Add two undocumented API in ntdll (#386)
  • Fixed IN6_ADDR.ToString and words property capturing and giving incorrect values (#388)

v3.4.13

1 year ago

Additions

  • Added AvRt.dll support in Vanara.PInvoke.Avrt
  • Added tdh.dll methods to Vanara.PInvoke.Security.
  • Finished work on Vanara.PInvoke.CoreAudio
  • #371 Add Create method for types MONITORINFO and MONITORINFOEX
  • Added and modified classes supporting window creation and message pumps
  • Added conversion operator from FileSystemInfo to FILEDESCRIPTOR
  • Added CorrespondingTypeAttribute to WindowLongFlags values
  • Added equality ops to PROC_THREAD_ATTRIBUTE and cleaned file
  • Added GetClassLongFlag enum and updated GetClassLong and SetClassLong parameter
  • Added CallWindowProc and FindWindowEx overloads
  • Added IComparable and IEquatable to SafeAllocatedMemoryHandle
  • Added MessagePump and ExaminedMessagePump as means to process Get/PeekMessage->DispatchMessage loops.
  • Added missing constants to UxTheme
  • Added missing DWM constants
  • Added missing WindowLongFlags values
  • Added Ole32.IDataObjectV for a more complete reference to IDataObject
  • Added Point.x and y properties to match some C++ implementations
  • Added SafeHANDLE.ThrowIfDisposed method to help implement safer calls.
  • Added SafeNativeArray.GetRefAt method to get a reference to an element in the array
  • Added SafeSyncHandle.Wait method wrapping WaitForSingleObject
  • Added some UxTheme method overloads taking enums

Fixes

  • BREAKING CHANGE: Removed inaccurate tdh.h values from AdvApi32 class and put them in Tdh
  • More BREAKING CHANGES to NativeClipboard. (Sorry!) All atomic methods to set data have been removed due to inconsistencies and design challenges. New model forces all setting and getting to be done through IDataObject and it's methods and extensions. See documentation for class for example. Addresses #355.
  • Fixed and extended implicit operators for RECT and PRECT
  • Fixed bug in NativeClipboard.Clear
  • Fixed bug in NativeClipboard.SetText where only one value was getting set. (#355)
  • Fixed bug in User32.SetWindowLong
  • Fixed bug with CreateClassInfoEx
  • Fixed bug with WindowLongFlags additions
  • Fixed INVALID_FILE_ATTRIBUTES value and type (#369)
  • Fixed packing on WINHTTP_CONNECTION_INFO (#368)
  • Hopeful fix for #373
  • Lots of work on WindowBase, VisibleWindow, WindowClass and MessagePump
  • Moved IWindowCore to MessagePump.cs
  • Reverted User32.BasicMessageWindow to previous, simpler implementation
  • Significant expansion to User32.WindowClass wrapper around WNDCLASSEX
  • Updates to synchapi method params and extension of SafeEventHandle

v3.4.12

1 year ago

Additions

  • Added Vanara.PInvoke.DavClnt which takes methods out of NetApi32. Set those methods to Obsolete.
  • Added Vanara.PInvoke.PhotoAcquire assembly with interfaces for Photo Acquisition.
  • Updated NuGet package dependencies
  • Add implicit op from SafeHANDLE to HANDLE
  • Add MouseActivateCode as WM_MOUSEACTIVE response (#358)
  • Added <Platforms> tag to Directory.Build.props
  • Added ability for IDataObject.GetData to retrieve an HGLOBAL as an IStream
  • Added ability to pick character set in IDataObject.GetData<T> method
  • Added CHANGEFILTERSTRUCT.Default field
  • Added Clipboard functions that wrap Unicode to Ansi and back conversions
  • Added DS_xx dialog box styles to User32 as DialogBoxStyles enum (#359)
  • Added enum overloads for PeekMessage and PostMessage
  • Added implicit op for SystemColorIndex to HBRUSH
  • Added locking to SafeMemoryHandle.ToType extension method
  • Added Missing Disk Management Control Codes #345
  • Added mssing Pack = 1 to TASKDIALOG_BUTTON (#351)
  • Added NativeClipboard.GetFileNameMap, GetShellItemArray, IsFormatAvailable(string) and SetShellItems methods (#353)
  • Added Null field to all GDI handles
  • Added OBM_ constants
  • Added SafeMoveableHGlobal.CallLocked method
  • Added SetWindowAttributes in DwmApi from Windows 11. (#363)
  • Added Shell32.SHCreateDataObject overload to simplify use and prevent unintentional bugs using PIDL class.
  • Added support for memory classes and interfaces to indicate if they zero memory on initialization to prevent re-zeroing.
  • Added Type.GetConstants extension method
  • Added WideCharToMultiByte and MultiByteToWideChar overloads taking byte arrays.

Fixes

  • BREAKING CHANGE: Changed parameters of Ole32.IStreamV.Seek and CopyTo methods to use out parameters. Cost of throwing away value was determined to be zero.
  • BREAKING CHANGE: Made NativeClipboard a static class and removed dependencies on User32.
  • Changed ASCII encoder to UTF8 encoder in string helper classes for broader character support.
  • Changed NativeClipboard.SetShellItems functionality and added overlaod.
  • Changed return value of User32.GetMessage to int so value of -1 can be returned. Fixes #360.
  • Changed VSS_MGMT_OBJECT_PROP to struct for marshaling
  • Fixed #357 (set moniker on IFileSystemImage2.BootImageOptionsArray)
  • Fixed alignment of SET_VIRTUAL_DISK_INFO (#356)
  • Fixed bug in IEnumString.Enum extension method
  • Fixed bug in InteropExtensions.Write(IEnumerable...) method that wiped out existing values if an offset was provided.
  • Fixed bug in ShellLink.ShowState that was carried over from old code. (#349)
  • Fixed definition problem with IDataTransferManagerInterop.GetForWindow (#354)
  • Fixed exceptions being thrown by BOOL and BOOLEAN when interacting with int and ! operator
  • Fixed layout of TOUCHPREDICTIONPARAMETERS (#347)
  • Fixed NativeClipboard GetText and SetText methods. Also changed ctor so that if no HWND is passed, it uses the Desktop's window handle. Fixes #355.
  • Fixed optional param problem with DateTime APIs in Kernel32.
  • Fixed unbounded recursion in SafeLPSTR, SafeLPTSTR and SafeLPWSTR implicit cast operators from string by inverting the types.
  • Fixes access violation when calling TaskDialogIndirect
  • Got the VssApi projects to build
  • Removed dependencies on all x64 preprocessor indications and just made all structures work for both 32 and 64-bit (#346)
  • Removed platforms from solution leaving only AnyCPU
  • Tons of fixes and updates to IDataObject and Clipboard methods and wrapper classes.
  • Updated NUnit package version for tests
  • Updated SafeMoveableHGlobalHandle class and added tests.

v3.4.11

1 year ago

Additions

  • Added Vanara.PInvoke.WebSocket assembly
  • Added Vanara.PInvoke.WscApi project for Windows Security Center functions.
  • Added IPPROTO_IPV6 socket options
  • Added Microsoft-specific winsock constructs to Ws2_32
  • Added QOS2 overloads
  • Added ShellFileOperations ctor taking an IFileOperation rather than creating one every time. (#336)
  • Added overloads with more precise params to WinSock2 functions
  • Added supporting macros as properties to IP_PATTERN

Fixes

  • Added definition for CoGetObject that supports BIND_OPTS_V derivatives (#338)
  • Add [Flags] attribute to a couple of enums which require it (#342)
  • Add high resolution flag for waitable timer initialisation (#343)
  • Changed BIND_OPTS2.locale field to LCID type
  • Fix POINTER_INPUT_TYPE missing initial value (#340)
  • Fixed NullReferenceException caused by unsuccessful CredRead call (#344)
  • Fixed problems with SendMessage overloads not passing parameters (#333)
  • Overloadded SetWaitableTimer and SetWaitableTimerEx to accept a long value for the lpDueTime param.

v3.4.10

1 year ago

Additions

  • Added Vanara.PInvoke.QoS project with QWave and QoS traffic support.
  • Added DebuggerDisplayAttribute to IndirectString
  • Added SHLoadIndirectString stub to IndirectString to avoid referencing full library.
  • Added TestHelper.IsElevated property
  • Added WindowsFirewall and supporting classes to Vanara.SystemServices.
  • Added explicit conversion from WSRESULT to Win32Error
  • Added indexer to SafeElementArray
  • Added new functions introducted in Win11
  • Added nullable support to IndirectResource and IndirectString
  • Added overload to WinSpool.DeviceCapabilities to support NULL pDevNode param (#331)
  • Adding NMTBCUSTOMDRAW struct (#328)
  • Added DistributedRoutingTable and supporting classes
  • Cleaned ResourceId and added equality operators
  • Exposed static fields in SafeElementArray

Fixes

  • Changed SafeDRT_DATA to inherit from SafeElementArray for direct access to bytes.
  • Corrected build warnings related to RequiresUnreferencedCodeAttribute
  • Fixed SetPointSize LOGFONT passed by value with a ref (#332)
  • Fixed TBBUTTONINFO.fsStyle set failure #326
  • Fixed packing issue with TBBUTTONINFO (#327)
  • Fixed problem with IndirectResource and nullable string values
  • Moved classes IndirectResource and IndirectString to Vanara.PInvoke.Shared library since they capture a pattern across Win32.