Git Product home page Git Product logo

windevlib's Introduction

WinDevLib

Windows Development Library for twinBASIC

Current Version: 8.3.433 (Ju1y 1st, 2024)

IMPORTANT: twinBASIC Beta 553 or newer is now required.

(c) 2022-2024 Jon Johnson (fafalone)

This project is a comprehensive twinBASIC replacement for oleexp.tlb, my Modern Shell Interfaces Type Library project for VB6, that is x64 compatible, due to the many problems using midl to create a 64bit tlb.

This and oleexp are projects to supply Windows shell and component interfaces in a format consumable by VB6/VBA/tB. This involves not only defining interfaces, but using VB/tB compatible types-- so in some cases, even though there may be an existing way to import references to interfaces, they may be unusable due to e.g. the use of unsigned types, C-style arrays, double pointers, etc. All interfaces, types, consts, and APIs from oleexp are covered. For a full list of interfaces, see INTERFACES.md.

In addition to the 2200+ common COM interfaces, WinDevLib now includes expansive coverage of Windows APIs from all the common modules. This makes it similar to working in C++ with #include <Windows.h> and a few others. Currently, approximately 6,000 of the most common APIs have been added- redone by hand from the original headers, in order to restore 64bit type info lost in VB6 versions, avoid the errors of automated conversion tools (e.g. Win32API_PtrSafe.txt is riddled with errors), and make them friendlier by converting groups of constants associated with a variable into an Enum so it comes up in Intellisense. This takes advantage of tB's ability to provide Intellisense for types besides Long in API defs (hopefully UDTs soon, this project has provisioning for that).

This project is implemented purely in tB native code, as unlike VB6 there's language support for defining interfaces and coclasses. As a twinPACKAGE, regular code is supported in addition to the definitions, so the regular addin modules have been built in (mIID.bas, mPKEY.bas, etc). Does it still make sense to use a project like this when interfaces can be defined in-language? I'd say yes, because for a large number of interfaces, there's deep dependency chains with other interfaces and the types they rely on. It makes more sense to drop this in and be done with it than constantly have to define the interfaces you want and then stubs for their dependencies, especially when you might need those later on. This project is even more useful now with the API coverage; it should cover about 99% of your needs for core system DLLS.

Please report any bugs via the Issues feature here on GitHub.

Requirements

twinBASIC Beta 553 or newer is required.

Adding WinDevLib to your project

You have 2 options for this:

Via the Package Server

twinBASIC has an online package server and WinDevLib is published on it. Open your project settings and scroll to the COM Type Library / ActiveX References, then click TWINPACK PACKAGES. Add "Windows Development Library for twinBASIC v7.0.272" (or whatever the newest version is). The other similar entry, "WinDevLib for Implements" contains Implements compatible versions of a small number of common interfaces not defined in a compatible way in the main project; you normally don't need this. For more details, including illustrations, see this post.

From a local file

You can download the project from this repository and use the WinDevLib.twinpack file. Navigate to the same area as above, and click on the "Import from file" button. WinDevLib.twinproj is the source for the package, if you want to edit it.

Optional Features

Compiler Flags

WinDevLib has some compiler constants you can enable:

WINDEVLIB_LITE - This flag disables most API declares and misc WinAPI definitions, including everything in wdAPIComCtl, wdAPI, and wdDefs. I used to like doing my APIs separate too, which is why oleexp never had the expansive coverage. But with that coverage now present, I think it's worth using, but this option will still be supported.

WINDEVLIB_COMCTL_LIB_DEFINED - You can use this flag if you already have an alternative common controls definition set, e.g. tbComCtlLib; it will disable wdAPIComCtl. (Note: WinDevLib has more complete comctl defs than tbComCtlLib, as that project was deprecated and not updated).

WINDEVLIB_DLGH - This enabled constants from dlg.h. These are extremely uncommon to use, and have very short, generic names likely to cause conflicts, so they're opt-in.

WINDEVLIB_NOQUADLI - Restores the old LARGE_INTEGER definition of lo/high Long values.

Warning

The WINDEVLIB_NOQUADLI constant will break alignment on numerous Types; most only on x64, but some on both.

WINDEVLIB_AVOID_INTRINSICS - Uses the Interlocked* APIs that are exported from kernel32.dll (32bit mode only) instead of the static library containing compiler intrinsic versions of those in addition to all the ones not exported and all the 64bit ones.

WINDEVLIB_NOLIBS - Fully exclude static libraries (currently only Interlocked); mainly intended for comparing current tB versions to Beta 423 where the Import Library syntax is not yet supported.

Custom Helper Functions

In addition to coverage of common Windows SDK-defined macros and inlined functions, a small number of custom helper functions are provided to deal with Windows data types and similar not properly supported by the language. These are:

Public Function LPWSTRtoStr(lPtr As LongPtr, Optional ByVal fFree As Boolean = True) As String
Converts a pointer to an LPWSTR/LPCWSTR/PWSTR/etc to an instrinsic String (BSTR)

Public Function UtfToANSI(sIn As String) As String
Converts a Unicode string to ANSI. This function is [ConstantFoldable] -- it can be used to create strings resolved at compile time and stored as constants; this technique was developed to use ANSI strings in kernel mode, where the APIs that handle a normal String cannot be used.

Public Function VariantLPWSTRtoSTR(pVar As Variant, pOut As String) As Boolean
Retrieves a tB-style String from a VT_LPWSTR Variant. Returns False if pVar is a null pointer, or VT_LPWSTR or PropVariantToStringAlloc returns a nullptr.

Public Function GetSystemErrorString(lErrNum As Long, Optional ByVal lpSource As LongPtr = 0) As String
Public Function GetNtErrorString(lErrNum As Long) As String
Retrieve descriptions of HRESULT and NTSTATUS error codes, respectively.

Public Function VariantSetType(pvar As Variant, [TypeHint(VARENUM)] ByVal vt As Integer, [TypeHint(VARENUM)] Optional ByVal vtOnlyIf As Integer = -1) As Boolean
Sets a Variant to the specified type without any alteration to the data. vtOnlyIf returns False if the original type is other than specified. This should only be used when VariantChangeType is not applicable, and only with full understanding of consequences like automation errors if you attempt to use intrinsic operations on unsupported types; e.g. if you set the type to VT_UI4, then CLng() will raise a 'type unsupported' runtime error.

Public Function PointerAdd(ByVal Start As LongPtr, ByVal Incr As LongPtr) As LongPtr
Public Function UnsignedAdd(ByVal Start As Long, ByVal Incr As Long) As Long
Public Function UnsignedAdd(ByVal Start As Integer, ByVal Incr As Integer) As Integer
Public Function UnsignedAdd(ByVal Start As LongLong, ByVal Incr As LongLong) As LongLong
Perform addition as if Start and Incr were unsigned, returning an unsigned result. Important for large address aware operations in 32bit.'

Public Function SwapVtableEntry(pObj As LongPtr, EntryNumber As Integer, ByVal lpFN As LongPtr) As LongPtr
This is the common vtable redirection helper function rewritten to support both 32 and 64bit operations.

Public Function PointToLongLong(pt As POINT) As LongLong
Public Function PointToLongLong(ByVal ptx As Long, ByVal pty As Long) As LongLong
Public Function PointToLongLong(ByVal ptx As Integer, ByVal pty As Integer) As LongLong
Public Function PointFToLongLong(pt As POINTF) As LongLong
Public Function PointFToLongLong(ptx As Single, pty As Single) As LongLong
Public Function PointSToLong(pt As POINTS) As Long
Public Function SizeToLongLong(z As SIZE) As LongLong
Public Function SizeToLongLong(ByVal cx As Long, ByVal cy As Long) As LongLong
Functions for converting POINT and SIZE types or coords to Long or LongLong for methods requiring them to be passed ByVal, which is currently unsupported.

Public Function CUIntToInt(ByVal Value As Long) As Integer - Create unsigned Integer from a Long
Public Function CIntToUInt(ByVal Value As Integer) As Long - Convert an Integer to Long as if it were unsigned (&HFFFF = 65536 instead of -1)
Public Function CULngToLng(ByVal Value As Double) As Long
Public Function CULngToLng(ByVal Value As LongLong) As Long
Public Function CLngToULng(ByVal Value As Long) As LongLong
Public Sub CLngToULng(ByVal Value As Long, pULng As Double)

Guide to switching existing code to WinDevLib

WinDevLib presented the best opportunity there would be to ditch some olelib legacy baggage. It's fairly simple to move your VB6 projects to WinDevLib, just follow these steps:

oleexp type library issues

The follow steps apply only if you're converting code that previously relied on my oleexp.tlb project:

  1. Replace public aliases: It's important to do this first. Run a Replace All changing oleexp.LONG_PTR to LongPtr, oleexp.REFERENCE_TIME to LongLong, oleexp.HNSTIME to LongLong, oleexp.KNOWNFOLDERID to UUID, oleexp.EventRegistrationToken to LongLong, oleexp.BINDPTR to LongPtr, and oleexp.LPCRITICAL_SECTION to LongPtr. If you've used them without the oleexp. prefix, you'll also need to replace those, but if you've imported into tB they should be tagged.

  2. Replace oleexp.IUnknown with IUnknownUnrestricted. WinDevLib keeps this separate due to the major issues with conflicts with the former approach. If your project has IUnknown without oleexp. in front of it, do not replace those, as it's not referring to oleexp.

  3. After you've done those two, you can now go ahead and simply delete all remaining instances of oleexp. (including the .).

Issues specific to oleexpimp.tlb

There's 'WinDevLib for Implements' (WinDevLibImpl.twinpack/.twinproj) as well, but you'll note it has substantially fewer interfaces than oleexpimp.tlb. This is because there's two reasons for an interface to have an alternate version: It uses [ Preservesig ] on one or more methods, or it uses As Any. twinBASIC allows using Implements with As Any by replacing it with As LongPtr (which is what the alternate versions do). So many interfaces were in oleexpimp.tlb for this latter reason, and subsequently are not included in WinDevLibImpl as it's not neccessary.

If you find an oleexpimp.tlb interface is not in WinDevLibImpl, you will be able to use the one from WinDevLib, simply make sure As Any is changed to As LongPtr.

tB has announced plans to support [ PreserveSig ] in implemented interfaces in the future; when that happens WinDevLibImpl will be deprecated.

Important

There currently seems to be an issue with using WinDevLib and WinDevLibImpl together if WinDevLibImpl does not use the current WinDevLib as a reference (it would usually use an old one as it's updated much less frequently). I've updated the reference on this repo and the package server, just note that you'll need to refresh both every time you update one if they're used together

API definition differences

This section applies both to API calls from oleexp.tlb and general Declare statements.

  1. Convert Currency to LongLong for interfaces and APIs: It's no longer neccessary to worry about multiplying and dividing by 10,000 since tB supports a true 64bit type in both 32bit and 64bit mode. So this change is ultimately for the better, but existing codebases will have had to have used Currency for all interfaces and oleexp APIs expecting a 64bit integer.

  2. (From type libraries only) If you see errors about wrong number of arguments or a mismatch on the return type, some oleexp.tlb and other type library defined APIs do a similar change as some interface arguents and rewrite the last argument as a return value. In these cases the return type will now be Long, and you can just move the receiving variable to the position of a final argument. If it uses Set, you can just drop that.

  3. Optional UDTs no longer use As Any. If you see errors like Validation of call to 'CreateFile' failed. Argument for 'lpSecurityAttributes': cannot coerce type 'Long' to 'SECURITY_ATTRIBUTES', this is an example of the issue. twinBASIC supports substituing vbNullPtr for a UDT (do not include ByVal), so WinDevLib can use the proper type while still permitting you to pass the equivalent of ByVal 0.

Example:

VB6:

Public Declare Function CreateFileW Lib "kernel32" (ByVal lpFileName As Long, ByVal dwDesiredAccess As Long, ByVal dwShareMode As Long, lpSecurityAttributes As Any, ByVal dwCreationDisposition As Long, ByVal dwFlagsAndAttributes As Long, ByVal hTemplateFile As Long) As Long

hFile = CreateFileW(StrPtr("name"), 0, 0, ByVal 0, ...)

twinBASIC:

Public Declare PtrSafe Function CreateFileW Lib "kernel32" (ByVal lpFileName As LongPtr, ByVal dwDesiredAccess As Long, ByVal dwShareMode As Long, lpSecurityAttributes As SECURITY_ATTRIBUTES, ByVal dwCreationDisposition As Long, ByVal dwFlagsAndAttributes As Long, ByVal hTemplateFile As LongPtr) As LongPtr

hFile = CreateFileW(StrPtr("name"), 0, 0, vbNullPtr, ...)
'---or---
Dim pSec As SECURITY_ATTRIBUTES
Dim lPtr As LongPtr = VarPtr(pSec)
hFile = CreateFileW(StrPtr("name"), 0, 0, lPtr, ...)
  1. String vs Long(Ptr) in APIs with both ANSI and Unicode versions: Most VB programs are written with ANSI versions of APIs being the default. This is not the case with WinDevLib. With very few exceptions, APIs are Unicode by default-- i.e. they use the W, rather than A, version of APIs e.g. DeleteFile maps to DeleteFileW rather than DeleteFileA. The A and W variants use String/LongPtr, and in almost all cases, the mapped version uses String with twinBASIC's DeclareWide keyword-- this disables Unicode-ANSI conversion. Since this is automatic, you generally don't need to make any changes; you can still use String without StrPtr or any manual Unicode <-> ANSI conversion. Note this usually only applies to strings passed as input, you'll need to update any externally allocated strings returned as a pointer, where you previously used e.g. lstrlenA, to use lstrlenW and Unicode handling in general.

All APIs are provided, as a minimum, as the explicit W variant, and an untagged version that maps to the W version. Most ANSI variants are also included, but code should use Unicode wherever possible. You generally don't need to change any code in the case of

UDTs used by these calls are also supplied in the same manner, the W variant, an untagged variant that's the same as the W version, and in some cases, an A version. UDTs always use LongPtr for strings, even the untagged versions for DeclareWide.

If you have any doubts about which API is being called, twinBASIC will show the full declaration when you hover your cursor over the API in your code.

Special thanks to GCUser99 for helping normalize API declaration in this project. ๐Ÿ‘

Tip

Reminder: Nothing can be used in place of an interface where WinDevLib has the interface as an argument but another signature used Long/LongPtr

Note

This is just for using WinDevLib-- you'll likely have a lot more changes to make if you want to make your project x64 compatible.

Scope of coverage

The goal of the API coverage in WinDevLib is to provide the kind of programming experience you'd get in C/C++ by including windows.h and many of the more common feature sets like DirectX and GDIPlus. It currently includes about 5,500 APIs. But even that is just scratching the surface of the total Windows API set. Due to the low quality of automated conversion, even by Microsoft themselves (see: Win32API_PtrSafe.txt), I'm not interested in simply feeding headers through a conversion utility or using a database, so instead WinDevLib will be focused on the most commonly used features in the major system DLLs, though less common ones can be added by request or as time goes on and the existing DLLs are completed. I do not intend to include native APIs that have fully equivalent regular APIs; that's basically doubling the work for no benefit-- but if they offer additional features or substantially improved performance, they will be included.

I've included the definitions, associated types, and associated constants, for extensive portions of the following modules: shell32.dll, shlwapi.dll, kernel32.dll, ktmw32.dll, user32.dll, advapi32.dll, tdh.dll, authz.dll, crypt32.dll, wintrust.dll, bcrypt.dll, ncrypt.dll, cryptui.dll, ole32.dll, oleaut32.dll, propsys.dll, gdi32.dll, gdiplus.dll, virtdisk.dll, userenv.dll, dbghelp.dll, mpr.dll, iphlpapi.dll, urlmon.dll, hlink.dll, winmm.dll, setupapi.dll, comctl32.dll, dwm.dll/uxtheme.dll, comdlg32.dll, winbio.dll, winspool.drv, imm32.dll, hid.dll, cldapi.dll, pdh.dll, powrprof.dll, wtsapi32.dll, and netapi32.dll. Please let me know any I've missed from these.
Limited coverage (or full coverage of very small sets) is provided for ntdll.dll, cfgmgr32.dll, version.dll, msimg32.dll, fwpuclnt.dll, sxs.dll, secur32.dll, msacm32.dll, url.dll, htmlhelp.dll, avifil32.dll, imagehlp.dll, and ws2_32.dll. If you feel any missing ones from these should be included, or would like to contribute more, let me know.
Finally, there's numerous additional API sets from small to large for independent Windows features. These include small sets like restartmgr.dll through very large sets like the various Media Foundation and DirectX DLLs. In the future I'll better organize coverage lists, but the bottom line is let me know if any common APIs or built in API sets for components should be added. TODO.md in the WDL project files contains ones planned but not yet done.

Future coverage: In the future I'm planning to expand native APIs with no equivalents, add additional Winsock coverage, and add OpenGL-- though for this last one I may wait for tB to have Alias support since existing OpenGL codebases make heavy use of them by way of NeHe's TLB. I welcome contributions of any of these. If you've done the consts->enums conversions already, I'd even take 32bit-only versions.

tbShellLib is now WinDevLib - Windows Development Library for twinBASIC

This project has grown well beyond it's original mission of shell programming. While that's still the largest single part, it's no longer a majority of the code, and the name change now much better reflects the purpose of providing a general Windows API experience like windows.h. Compiler constants and module names/file names have been updated to reflect the name change. tbShellLibImpl is now WinDevLibImpl. There are also some major chanages associated with this update, please see the full changelog below.

DLL Redirection Errors in Older Versions

twinBASIC now counts msvbvm60 redirects as legacy DLL redirects, which WinDevLib set to "Error". Please update to the latest version of WinDevLib to get rid of these errors and use it on twinBASIC Beta 456 and newer. Both this repo and the package server downloads have been updated.

Updates

Update (v8.3.430, 01 Jul 2024):
-Added HID APIs (hidclass.h, hidusage.h, hidpi.h, hidsdi.h 100%; HidD_ and HidP_ APIs in hid.dll)
-Added WinML interfaces (WinML.h, 100%)
-Added some additional APIs from sysinfoapi.h to bring coverage to 100%
-Added Common Dialog extended error codes from cderr.h (100% coverage)
-New helper function VarTypeEx returns the VarType without filtering flags like VT_BYREF.
-WinDevLib is now strict mode compliant
-(Bug fix) V_ISBYREF, V_ISARRAY, and V_ISVECTOR helper functions relied on VarType which filtered those flags.
-(Bug fix) DispatchMessage[A,W], SendNotifyMessage[A,W] return types incorrect for x64.
-(Bug fix) IMFVideoDisplayControl.GetCurrentImage second argument ByVal/ByRef mixup.
-(Bug fix) ListView_SetItemText macro incorrect.
-(Bug fix) SHSaveLibraryInFolderPath type mismatch.
-Note: ShellScalingApi.h was verified to be 100% covered.

Update (v8.3.428, 13 Jun 2024):
-Some additional system info structs to support upcoming project
-PRIVILEGE_SET and TOKEN_PRIVILEGES were intended to be buffered to the max number of privileges, but that was set too low; it's now 45.
-SE_DELEGATE_SESSION_USER_IMPERSONATE_NAME was missing.
-(Bug fix) MAXSIZE_T only defined for 64bit

Update (v8.3.426, 10 Jun 2024):
-Completed imagehlp.h/dbghelp.h API coverage, now 100%
Note: I've tried to implement the unusual alias struct in the header files as faithfully as possible, and a great many of these APIs do have aliases, so always consult the SDK source and wdAPIDbgHlp.twin in addition to MSDN-- MSDN covers only actual entry points.
-Added a large number of overloads for compatibility with oleexp.tlb APIs that use [PreserveSig(False)] to rewrite a last [out] parameter as the return value. This is for compatibility only and will not be expanded beyond oleexp APIs using it.
IMPORTANT: Due to this change, WinDevLib now requires twinBASIC Beta 553 or newer.
-Updated DirectML for recent additions (feature set >= 0x6000)
-Added ITipAutoCompleteProvider, ITipAutoCompleteClient, and coclass TipAutoCompleteClient
-Added IObjectWithPackageFullName
-Added coverage of interlockedapi.h (100%)
-Some additional system info structs
-(Bug fix) MkParseDisplayName should not use ANSI conversion.
-(Bug fix) MFCreateADTMediaSink should be MFCreateADTSMediaSink
-(Bug fix) IMFMediaType.GetMajorType, IQueueCommand methods used stdole.GUID instead of UUID, leading to automation type incompatible errors.
-(Bug fix) IMFMediaEngineEx.GetVideoSwapchainHandle Long instead of LongPtr.
-(Bug fix) SLIST_HEADER definition incorrect.

Update (v8.2.424, 06 Jun 2024):
-Added INATExternalIPAddressCallback for use with NATUPnP Type Library v1.0 (NATUPNPLib, included with Windows)
-Removed LOWORD(LongLong) and HIWORD(LongLong) overloads due to too many circumstances with ambiguity errors.
-(Bug fix) GetAdaptersAddresses returns variable length data, not a single UDT.

Update (v8.2.423, 04 Jun 2024):
-Added UPnP interfaces (upnp.h, upnphost.h, 100%)
-Added Real-time Work Queue (RTWorkQ.h) APIs and interfaces
-(Bug fix) WSAStartup used Integer instead of Long for first arg
-(Bug fix) RtlIpv4StringToAddressEx[A,W] arg 'Strict' should be ByVal
-(Bug fix) IP_ADDRESS_STRING/IP_MASK_STRING and several downstream types definitions incorrect (+/* typo)
-(Bug fix) GetAdaptersInfo returns variable length data, not a single UDT.

Update (v8.2.413, 02 Jun 2024):
-Missing common winmm time APIs timeSetEvent/timeKillEvent and related consts
Update (v8.2.412, 02 Jun 2024):
-Added Direct3D 9 interfaces (base interfaces courtesy of The trick's Dx9vb type library); d3d9.h, d3d9types.h, d3d9caps.h, d3dx9shader.h
-Added DXVA2, DXVA-HD, and EVR9 interfaces (evr9.h, dxva2api.h, dxvahd.h)
-Added Native WiFi APIs (wlanapi.h, 100%, see wdAPIWLAN.twin for dependent header coverage details)
-Coverage of oleexp's oledlg.inc was entirely missing; added and expanded to include 98% of oledlg.h (currently unsupported vararg APIs pending)
-(Bug fix) Numerous incorrect constants due to << overflowing to zero after exceeding Integer.
-(Bug fix) IBackgroundCopyJob2.GetReplyFileName, IBackgroundCopyJobHttpOptions.GetCertificateName used String for LPWSTR*

WinDevLibImpl v1.3.20: Add Implements-compatible IOleUILinkContainer

Update (v8.1.409, 25 May 2024):
-(Bug fix) GDI+ enum values incorrect in PixelOffsetMode, EncoderParameterValueType, SmoothingMode, InterpolationMode, MetafileFrameUnit, and CompositingQuality.
Update (v8.1.408, 25 May 2024):
-Began coverage of the Windows Filtering Platform. Initially, enough is declared to set up basic filters, like blocking all traffic from a given process.
-IShellItem2.GetCLSID now uses standardized UUID type instead of UUID.
-Add missing GDI+ startup output and inputex structs and enums
-(Bug fix) GdiplusStartupInput definition incorrect (did not cause runtime errors because size was > minimum, but optional args wouldn't work on x64)
-(Bug fix) IAudioEndpointOffloadStreamMute method arg types incorrect (but likely was harmless)
-(Bug fix) Switch imagehlp to dbghelp in identical parts of editor; DLL exports are not identical. Note: Dbghelp APIs are a work in progress; 40% done.
-(Bug fix) MFMEDIASOURCE_CHARACTERISTICS, MF_SOURCE_READER_FLAG, and MF_SOURCE_READER_CONTROL_FLAG enums all values incorrect.

Update (v8.0.406, 17 May 2024):
-(Bug fix) Numerous String/LongPtr bugs and standards issues; see Issue #30.

Update (v8.0.405, 17 May 2024):
-(Bug fix) IShellImageDataFactory method names incorrect
-(Bug fix) IShellImageData missing method, breaking 2nd half of interface. Some method names incorrect.

Update (v8.0.404, 17 May 2024):
-Added missing constants from shimgdata.h (now 100% covered)
-(Bug fix) URLDownloadToCacheFileW and URLDownloadToFileW still using String arguments.

Update (v8.0.403, 17 May 2024):
-(API Standards) URLOpenStream, URLPullStream, URLDownloadToCacheFile, and URLDownloadToFile did not conform to standards, additionally W versions used String without DeclareWide. (Issue #29)

Update (v8.0.402, 16 May 2024):
-Added Magnification API (magnification.h, 100% coverage)
-Added Cloud Filter APIs (cfapi.h, 100% coverage). Note: These APIs use overloaded String/LongPtr declares, please report any problems.
-Added Antimalware Scan Interfaces and APIs (amsi.h, 100% coverage). Note: These APIs use overloaded String/LongPtr declares, please report any problems.
-Added tokenbinding.h/dll APIs (100% coverage)
-Added Windows Connect Now interfaces/coclass (WcnApi.h, WcnTypes.h, WcnDevice.h, WcnFunctionDiscoveryKeys.h 100%)
-Added all netapi32 APIs from lmserver.h (100% coverage)
-Added Composite Image APIs (cimfs.h, 100% coverage)
-Added AVI file interfaces and APIs from vfw.h
-Added additional overloads for COM object APIs (e.g. CoMarshalInterThreadInterfaceInStream and CoGetInterfaceAndReleaseStream), to allow using LongPtr in addition to interfaces.
-Added missing WIC proxy functions WICCreateColorContext_Proxy, WICCreateImagingFactory_Proxy, and WICSetEncoderFormat_Proxy.
-DragQueryFile[A,W] now uses Optional for the last 2 arguments for compatibility with common usage.
-DLLVERSIONINFO member names now match SDK
-IOleInPlaceUIWindow.SetActiveObject now uses LongPtr in place of String for compatibility with OLEGuids
-IOleInPlaceActiveObject now uses PreserveSig to return the HRESULT on all methods for compatibility with OLEGuids.
The original, Implements-compatible version, is now in WinDevLibImpl.
-(API Standards) CreateFontIndirect now uses LOGFONT instead of LOGFONTW (identical besides name)
-(API Standards) GetIconInfoEx was using ICONINFOEXW instead of (previously missing) ICONINFOEX.
-(API Standards) CryptBinaryToString not marked DeclareWide. (Issue #26)
-(Bug fix) StopTrace and QueryTrace missing aliases (Issue #28)
-(Bug fix) DrawThemeParentBackgroundEx case incorrect
-(Bug fix) GetCurrentThemeName missing ByVal on String argument
-(Bug fix) GetFileVersionInfoA, GetFileVersionInfoSizeA, GetDiskFreeSpaceA incorrectly used W aliases. (Issue #27)
-(Bug fix) RegCreateKey missing DeclareWide (Issue #27)
-(Bug fix) Shell library helper functions incorrectly used Null instead of Nothing.
-(Bug fix) SetFocus missing argument
WinDevLibImpl v1.3.18 Implements-compatible version of IOleInPlaceActiveObject added.

Update (v7.10.396, 28 Apr 2024):
-MAJOR CHANGE: IShellIconOverlay will now no longer require using VarPtr() around the index output var.
-Added WIC proxy functions (Issue #22)
-Added iphlpapi ICMP APIs (icmpapi.h, 100%)
-Added additional netapi32 APIs, LMJoin.h, LMMsg.h, 100%; some missing APIs from LMShare.h (100% now hopefully)
-Added missing common API CreateBitmap (Issue #21)
-LVTILEVIEWINFO.SizeTile no longer uses redundant SIZELVT UDT
-First half of imagehlp.h/dbghelp.h added
-(Bug fix) PathIsNetworkPathW/PathFindFileNameW were incorrectly misnamed PathIsNetworkPathA/PathFindFileNameW (creating overloads).
-(Bug fix) BITMAPFILEHEADER definition incorrect (missing non-default packing alignment)
-(Bug fix) ImageEnumerateCertificates definition incorrect (ByRef/ByVal mixup)
-(Bug fix) STORAGE_BUS_TYPE values all off by one.

Update (v7.9.392, 24 Apr 2024):
-Added additional security dialog stuff; the Directory Object Picker interfaces/coclass and DsBrowserForContainer API; ObjSel.h, DSClient.h 100%

Update (v7.9.390, 24 Apr 2024):
-Large expansion of security APIs from security.h, minschannel.h, sspi.h, issper16.h, and credssp.h
All are 100% covered with the exception of kernel-mode only defs in sspi.h.
-Added new helper function for APIs/COM interfaces expecting a ByVal GUID:
UUIDtoLong(UUID, pl1 As Long, pl2 As Long, pl3 As Long, pl4 As Long)
UUIDtoLong(UUID, pls() As Long)
-Added VBA-related interfaces from vbinterf.h (100% coverage)
-Adjusted custom buffers on DEV_BROADCAST_* types to not leave padding bytes.
-Added non-aliased versions of RtlMoveMemory, RtlZeroMemory, and RtlFillMemory (Issue #20)
-(Bug fix) LoadIconMetrics enum had incorrect values and is now also renamed to the proper LI_METRIC name.

Update (v7.9.386, 19 April 2024):
-Added complete Virtual Disk Service interfaces and custom coclass VdsLoader
-Added DirectML interfaces
-Added Restart Manager APIs (restartmanager.h, 100% coverage)
-Added DDE APIs (dde.h, ddeml.h 100%)
-Added some misc missing extremely common APIs.

Update (v7.8.382, 17 April 2024):
-Added coverage of all Windows Biometric Framework application APIs (winbio_err.h, winbio_ioctl.h, winbio_types.h, winbio.h 100%)
-Added missing WMDM DRM interfaces/coclass (MS forgot to merge these into the SDK when it abandoned a separate WMDM sdk)
-Some additional defs to bring winsvc.h coverage to 100%
-Add some missing WIC GUIDs
-(Bug fix) SERVICE_REQUIRED_PRIVILEGES_INFO[W] definitions incorrect for 64bit
-(Bug fix) EnumServicesStatusEx, GetServiceDisplayName incorrect alias
-(Bug fix) QueryServiceStatusEx, QueryServiceDynamicInformation, GetServiceRegistryStateKey, GetServiceDirectory, GetSharedServiceDirectory, RegisterServiceCtrlHandler[A,W,Ex,ExA,ExW] definitions incorrect for 64bit (Ex incorrect alias as well)
-(Bug fix) QueryServiceStatusEx incorrect additional overload
-(Bug fix) SECURITY_MAX_SID_SIZE value incorrect

Update (v7.8.379, 12 April 2024):
-Large expansion of Direct3D 12 interfaces to cover latest SDK version of d3d12.idl
-Added Direct3D 12 Video interfaces
-Added some missing Direct2D and Direct3D 11 interfaces
-Added Windows Media Device Manager application interfaces (mswmdm.h, 50%- provider interfaces todo)
-Added cert signing APIs from Mssign32.dll (mssign.h, 100%)
-(Bug fix) GdipGetLineColors definition incorrect (Issue #18)
-(Bug fix) GdipDrawImagePointsRect[I] definitions incorrect for 64bit (Issue #19)
-(Bug fix) GdipEnumerateMetafileDestPoint[I] definitions incorrect for 64bit

Update (v7.7.372, 09 April 2024):
-Minor additions to bring coverage of shellapi.h to 100%
-Added macros/helpers from mfapi.h and mfplay.idl
-Add missing gdip function GdipDrawImageFX
-(Bug fix) GdipFillClosedCurve2[I] definitions incorrect. (Issue #17)

Update (v7.7.370, 05 April 2024):
-Added all Background Intelligent Transfer Service interfaces; 100% coverage of:
bits.idl, bits1_5.idl, bits2_0.idl, bits2_5.idl, bits3_0.idl, bits4_0.idl, bits5_0.idl, bits10_1.idl, bits10_2.idl, bits10_3.idl, bitscfg.idl, qmgr.idl.

Update (v7.7.360, 04 April 2024):
-Very large expansion of DirectWrite interfaces; only dwrite.h was covered; added 100%
coverage of dwrite_1.h, dwrite_2.h, and dwrite_3.h
-Added shdeprecated.h (100% coverage). Many of these are still in undocumented use.
-UserEnv.h expanded to 100% coverage
-Added crypto catalog APIs from mscat.h (100% coverage)
-(API Standards) GetClassInfo[A, ExA, Ex] did not conform to API standards. For compatibility, this has been resolved by adding overloads.
-CreateProfile does not have A/W variants. I have zero idea where I found otherwise, and with differently named arguments... no search results anywhere. Weird.
-Add DWRITE_RENDERING_MODE missing values

Update (v7.7.350, 31 Mar 2024):
-Large expansion of mfapi.h coverage; all APIs and GUIDs are covered, only missing the macros
-processenv.h coverage now 100%
-avrt.h 100% coverage in prep. for mfapi.h (limited current coverage)
-Added 100% cover of netioapi.h
-GetEnvironmentStrings now redirects to GetEnvironmentStringsW, per SDK.
-Added security center interfaces from iwscapi.h and APIs from wscapi.h (both 100% covered)
-Added WINDEVLIB_NOLIBS compiler option, completely disabling static library use (intended mainly to be able to test with tB Beta 423 or earlier)
-(Bug fix) SetCurrentDirectory[W] definitions incorrect.
-(Bug fix) Certain obscure PE header types missing alternate alignment attribute
-(Bug fix) GetNamedPipeClientComputerName[A.W] definitions incorrect
-(Bug fix) GetNamedPipeHandleState[A,W] definitions incorrect

Update (v7.7.345, 26 Mar 2024):
-Added tdh.dll event trace helper APIs (tdh.h; all APIs/types complete but macros not yet added)
-Added some additional native APIs.
-FlushViewOfFile was missing.
-(Bug fix) IMAGE_OPTIONAL_HEADER64 had an extra member and pointer member incorrectly declared as LongPtr, making the UDT offsets incorrect when handling a 64bit PE from a 32bit build. -(Bug fix) The extra member mentioned above is in the 32bit version; so the build-linked version (IMAGE_OPTIONAL_HEADER) had to have a conditional added.

Update (v7.7.343, 22 Mar 2024):
-(Bug fix) Coclass ActCtx conflicted with type ACTCTX; the former has been renamed CActCtx.
-(Bug fix) ReleaseActCtx had typo in name.

Update (v7.7.342, 21 Mar 2024):
-MAJOR CHANGE: The common used enum SHGNO_Flags has been renamed SHGDNF, the proper name per SDK.
-MAJOR CHANGE: The common used enum SVGIO_Flags has been renamed SVGIO, the proper name per SDK.
-MAJOR CHANGE: The common used enum SVSI_Flags has been renamed SVSIF, the proper name per SDK.
-Updated WebView2 to match current stable release 1.0.2365.46
-Filled out KUSER_SHARED_DATA more.
-(Bug fix) NET_ADDRESS_INFO union substitute sized incorrectly.

WinDevLibImpl v1.3.16: Updatrd to use enum name changes associated with WinDevLib update.

Update (v7.7.341, 16 Mar 2024):
-MAJOR CHANGE: The commonly used enum SFGAO_Flags has been renamed SFGAOF, in accordance with a previously overlooked official name for the enum: typedef ULONG SFGAOF; It is safe (as far as this package knows) to do a find/replace all for this. Also added missing value SFGAO_PLACEHOLDER.
-For code portability, over the coming weeks and months I'll be replacing DeclareWide with Declare.
This will only be done on functions where it doesn't matter; where no arguments or arg UDT members
are String. It will still be used where it matters (especially in A/W functions without the A/W)
-Added missing winmm video/animation consts and structs
-Added helper function InitVariantFromIDList (undocumented inline helper)
-Added interfaces IWebBrowserEventsService, IWebBrowserEventsUrlService (WebEvnts.idl, 100%)
-Added interfaces ILaunchUIContext, ILaunchUIContextProvider
-Added numerous shell related GUIDs
-Added some missing property key related enums from propkey.h (should be 100% now)
-Some enums for shell automation have officially associated IIDs; added these with new EnumId attrib
-Added some missing registry constants and enum associations
-Added SDK helper macros ISLBUTTON, ISMBUTTON, ISRBUTTON, ISDBLCLICK
-EnumWindows, EnumChildWindows, and EnumTaskWindows APIs were inexplicably missing.
-(API Standards) GetAltTabInfo did not conform to WinDevLib API standards (LongPtr instead of String)
-(API Standards) GetKeyboardLayoutName did not conform to WinDevLib API standards (LongPtr instead of String)
-(API Standards) ShutdownBlockReasonQuery was inconsistent with ShutdownBlockReasonCreate for String vs LongPtr.
-(API Standards) CreateDesktop[A,ExA,Ex] did not use appropriate DEVMODE[A,W] variants.
-(API Standards) RegCreateKey[A,W,ExA,ExW] did not use SECURITY_ATTRIBUTES instead of ByVal LongPtr.
-(API Standards) RegConnectRegistry[A, ExA] did not use String types
-(Bug fix) OpenDesktopA incorrectly used DeclareWide
-(Bug fix) FOLDERTYPEID_ GUIDs were not properly defined as Static
-(Bug fix) RegCreateKey, RegConnectRegistryExA definitions incorrect
-(Bug fix) RegCreateKeyTransacted definition incorrect (wrong alias)
-(Bug fix) Some winmm UDTs lacked required PackingAlignment attribute
-(Bug fix) WAVEFORMAT[EX,EXTENSIBLE] lacked required PackingAlignment attribute

Update (v7.6.334, 08 Mar 2024):
-Added 100% coverage of winsafer.h
-Expanded power API coverage; powerbase.h, powersetting.h, powrprof.h 100%.

Update (v7.6.332, 06 Mar 2024):
-NamespaceTreeControl default changed to INamespaceTreeControl2
-Added inline helper SDK macros FreeIDListArray[Full|Child], SetContractDelegateWindow
-(Bug fix) INameSpaceTreeControlEvents::OnGetTooltip should be ByVal pszTip
-(Bug fix) MSGBOXPARAMS[A,W], MSGBOXDATA defs incorrect for x64.

Update (v7.6.330, 04 Mar 2024):
-Added some additional sync APIs; synchapi.h coverage now 100%.
-IObjectCollection now uses proper types (IUnknown and IObjectArray)
-(Bug fix) IsBadStringPtr missing alias
-(Bug fix) GetTimeZoneInformationForYear definition incorrect (used Long instead of Integer; no change needed, would work either way)
-(Bug fix) HIMC/HIMCC types for IME APIs were incorrectly Long instead of LongPtr; this was only true on early Windows versions

Update (v7.6.325, 29 Feb 2024): -Suppress new tB warnings (configd as errors in WinDevLib) for msvbvm60 DLL redirects (this info is still noted in the descriptions for each API) -(Bug fix) DF_ALLOWOTHERACCOUNTHOOK value incorrect

Update (v7.6.324, 27 Feb 2024):
-Added additional Variant/PROPVARIANT helpers; propvarutil.h now 100% covered
-Additional DirectX As Any->proper type
-Substantial improvement to Task Scheduler 2.0 interfaces (intellisense, Boolean instead of Integer where appropriate, descriptions)
-(Bug fix) InitVariantFromString was not a dll export (replaced by macro)
-(Bug fix) VariantToFileTimeArray and VariantToFileTimeArrayAlloc don't exist
-(Bug fix) IScheduledWorkItem missing 3 methods and GetRunTimes, SetCreator methods incorrect.
-(Bug fix) ITaskSettings missing Compatibility Let/Get methods.
-(Bug fix) ITaskSettings3 missing CreateMaintenanceSettings method
-(Name change) ISchedulingAgent was apparently renamed ITaskScheduler by Windows 2000; coclass SchedulingAgent to CTaskScheduler.
Further, IEnumWorkItems was IEnumTasks before that; why olelib was inconsistent here, I don't know.
Since the SDK still defines these as aliases, WinDevLib now includes both names for all 3.
-(Name change) TASK_RUNLEVEL corrected to more appropriate TASK_RUNLEVEL_TYPE

Update (v7.6.322, 24 Feb 2024):
-Added DSA and DPA APIs (dpa_dsa.h, 100% coverage including macros)
-Further compat updates for The trick's typelibs:
-IDWriteFontFileLoader.CreateStreamFromKey last arg now retval.
-ID2D1RenderTarget many arguments now optional, with correct default values where appropriate
-IWICBitmap.Lock last arg now retval
-ID2D1Factory and ID2D1Geometry had many As Any arguments switched to their proper types
-Added SizeToLongLong helper function
-(Bug fix) PointFToLongLong helper function incorrect.
-(Bug fix) ID2D1RenderTarget::CreateBitmap definition incompatible with 64bit

Update: WinDevLibImpl v1.3.15 - `IPersistStream::GetMaxSize now LongLong instead of Currency, matching WinDevLib.

Update (v7.6.320, 20 Feb 2024):
-Added IPrintDocumentPackage* interfaces and coclasses (DocumentTarget.idl, 100%)
-Added un/under-documented MRU APIs from comctl32
-For compatibility with The trick's D2D and WIC typelibs:
-D2D1_MATRIX_ types are now flat; the D2D alias versions remain the same, switch to these if you were using the previous defs.
-ID2D1Effect data arguments are now As Any (no change needed)
-Some arguments now optional (no change needed)
NOTE: Unlike VB6, twinBASIC supports ByVal Nothing to pass a null pointer to a ByRef interface/object method.
-ID2D1DeviceContext::CreateEffect last param now return value
-IWICBitmapDecoder::GetFrame last param now return value
-Many Direct2D/DirectWrite types were changed from As Any to their real UDT, since tB supports vbNullPtr to pass the optional null.
While this reduces compatibility with The trick's TLBs (and oleexp), the extra info and intellisense benefits are worth it.
-(Bug fix) PathRemoveBackslashW incorrectly used String.
-(Bug fix) LookupPrivilegeValue[A] used LongPtr instead of String.
-(Bug fix) PointToLongLong ambiguous overloads; new PointFToLongLong for POINTF.
-(Bug fix) All Direct2D effects CLSID functions incorrect (returning UUID_NULL)
-(Bug fix) IDWriteLocalizedStrings, IDWriteTextFormat, IDWriteTextLayout, IDWriteLocalFontFileLoader string arguments improperly ByRef
-(Bug fix) IDWriteInlineObject, IDWriteTextRenderer, and IDWritePixelSnapping argument clientDrawingContext should be ByVal LongPtr.
-(Bug fix) Several DirectWrite font UDTs had plocalename members incorrectly defined as Long, making them incompatible with 64bit

Update (v7.6.312, 10 Feb 2024):
-Added IAccessControl/IAuditControl interfaces
-Added numerous missing propsys APIs; propsys.h coverage now 100%
-Added a few missing registry functions, also previously excluded deprecated ones-- winreg.h coverage is now 100%.
-GetProcessMemoryInfo now uses As Any so PROCESS_MEMORY_COUNTERS and PROCESS_MEMORY_COUNTERS_EX2 can also be used.
-Added System Restore APIs from SrRestorePtApi.h (100%). IMPORTANT: Event types have been prefixed with SRPT_ due to common name conflicts (e.g. it has BACKUP, RESTORE, etc, that are now SRPT_BACKUP, SRPT_RESTORE, etc)
-Added Compressor APIs from compressapi.h (100%). IMPORTANT: Compress and Decompress have been renamed CompressorCompress and CompressorDecompress, respectively, due to the short name conflict potential.
-(Internal) Moved crypto APIs to their own file, wdAPICrypto.twin. Internet APIs moved to new module wdAPIInternet with wdInternet.twin. DEVPKEY and MiscGUID regions moved to wdDefs.twin. wdAPI.twin was becoming unmanageable and running into performance issues; it was up to 65k lines before this reorganization.
-Implemented all basic Interlocked* APIs. These are implemented primarily as static libraries: Only a few of these are exported by the Windows API, and only on x86.
To handle this, I've included my Interlocked64 project as a static library. I've also produced a 32bit version to handle all the inline/instrinsic ones besides the basics.
If you wish to avoid static linking these obj files (while using the APIs), specify the compiler flag:
#WINDEVLIB_AVOID_INTRINSICS
This uses the kernel32 versions where available: You're limited to InterlockedIncrement, InterlockedDecrement, InterlockedExchange[Add], and InterlockedCompareExchange[64]. Using any besides those 6 will trigger the static library to be included. NOTE: TEMPORARY: Due to editing instability, a default alternative of ONLY the kernel32s are set-- for use in Beta 423. See wdInterlocked.twin. -Added addtional error codes -Added cards.dll APIs for 32bit only (no 64bit build exists)

Update (v7.5.310, 26 Jan 2024):
-Massive expansion of crypt APIs; coverage of wincrypt.h, dpapi.h (crypto data protection) and mssip.h now 100%
-Coverage of wintrust.h is now 99%; all but a couple of difficult to decipher macros and a byte sequence the order needs to be verified for.
-Coverage of memoryapi.h is now 100% (excluding APIs only available to Store Apps)
-Added UserNotification2 coclass; oleexp had this with a default of IUserNotification2, and while WinDevLib had UserNotification as a coclass, it had IUserNotification as a default without listing 2. Added 2 and the additional coclass.
-EVENT_FILTER_EVENT_ID is now buffered to the maximum number of IDs. This allows using it directly, at the expense of not being able to use LenB for size.
-Virtual* memory functions now use ByVal addresses instead of ByRef As Any; 99% of code uses this definition.
-(Bug fix) CertFreeCertificateContext definition incompatible with x64
-(Bug fix) SwapVTableEntry helper not working with old defs

Update (v7.4.308, 20 Jan 2024):
-Added interface IAttachmentExecute and coclass AttachmentServices.
-Added interface IStorageProviderBanners, and coclass StorageProviderBanners.
-Substantial expanson of crypto APIs; bcrypt.h, ncrypt.h, and ncryptprotect.h all now have 100% coverage, and wincrypt.h coverage has doubled (though still has quite a bit to go)
-Crypto provider enum Crypt_Providers (dwProvType) renamed to CryptProviders to resolve conflict with SDK-defined CRYPT_PROVIDERS type.
-Numerous missing IShellMenu related consts/types; fixed incorrect intellisense associations.
-(Bug fix) MEMORYSTATUS definition incorrect (incompatible with 64bit). The associated API should not be used however, as it has problems with >4GB RAM. Use GlobalMemoryStatusEx.

Update (v7.3.306, 17 Jan 2024):
-Some additional crypto APIs.
-Added undocumented TaskDialogIndirect button flags (Abort, Ignore, Continue, Retry, Help) and renamed the enum to the proper SDK-defined name (replace TDBUTTONS with TASKDIALOG_COMMON_BUTTON_FLAGS)
-Added x,y option to PointToLongLong helper.
-Added some missing GDI defs and macros.
-(Bug fix) Numerous duplicated enum values undetected last time.

Update (v7.3.304, 15 Jan 2024):
-Added legacy Sync Manager interfaces/coclasses (mobsync.h, 100%)
-Added process snapshot APIs (ProcessSnapshot.h, 100% coverage)
-Added all consts (grouped as enums where possible) from propkey.h
-Added new property keys from propkey.h
-Added some missing STR_ binding strings.
-Small additions to get shellapi.h coverage to 100%
-Added undocumented interfaces IInfoBarMessage, IInfoBarHost, and IBrowserProgressSessionProvider (for the popup banner menus in NSEs)
-Added undocumented interfaces IShellFolder3, IFilterItem, IItemFilter
-Added undocumented interfaces IScope, IScopeItem (NSE filtering)
-(Bug fix) LockWorkStation incorrect case.
-(Bug fix) SHFILEOPSTRUCT[A,W] definition incorrect for x86

Update (v7.2.301, 10 Jan 2024): Bug fix: Numerous duplicated enum values.

Update (v7.2.300, 09 Jan 2024):
-Added wincred advapi32.dll APIs; wincred.h, 100% coverage
-Completed adding WinHttp APIs, winhttp.h coverage now 100% (note: The WinHttp interface/coclass is not included as it already has a VB/tB-compatible typelib to add)
-Added remaining websocket.dll APIs, websocket.h coverage now 100%
-Added pointer encode/decodes functions (and kernel32's Beep): utilapiset.h 100% coverage
-A few missing WinInet APIs
-Around 100 additional HRESULT error constants w/ descriptions.
-Base WinRT IInspectable and some initialization APIs and HSTRING APIs added.
-(Bug fix) All ERROR_DS_x constants were wrong. ICM ERROR_x constants were wrong.

Update (v7.2.289, 06 Jan 2024): Bug fix: InternetConnect definition incorrect.
Update (v7.2.288, 06 Jan 2024):
-Added Photo Acquisition interfaces and coclasses (photoacquire.h, 100%)
-Added accessibility APIs from oleacc.dll (oleacc.h now 100% coverage). Really thought these were already added; there's a bug in oleexp where most are missing from that too despite presence in source.
-Added inline Library helper functions from ShObjIdl_core.h; also some additional shell32.dll APIs.
-Added SDDL language string constants; coverage of sddl.h now 100%.
-Additional advapi32.dll security APIs, to bring coverage of securitybaseapi.h to 100%.
-Added 100% coverage of dssec.h.
-Cleaned up PROCESS_BASIC_INFORMATION
-(Bug fix) LogonUserEx[A,W] definitions incorrect.
-(Bug fix) CreateWellKnownSid definition incorrect.
-(Bug fix) GetSidIdentifierAuthority definition likely incorrect.
-(Bug fix) SHChangeUpdateImageIDList missing 1-byte packing attribute.
-(Bug fix) A couple setup APIs missing 32bit 1-byte packing attribute.

Update (v7.1.286, 02 Jan 2024):
-Added initial coverage of Lsa* APIs from advapi32.dll/NTSecAPI.h/LSALookup.h/ntlsa.h
-WIC: Converted LongPtr buffer arguments to As Any, for more flexibility in what can be supplied.
-WIC: Converted all ByVal VarPtr(WICRect) LongPtr's to ByRef WICRect.
-(Bug fix) IWICBitmapSourceTransform::CopyPixels definition incorrect.
-(WinDevLibImpl) Added Implements-compatible WIC interfaces for custom codec creation.

Update (v7.0.283, 01 Jan 2024):
-Improved enum associations/formatting for WIC.
-Added numerous missing GUIDs from wincodecsdk.h
-(Bug fix) IWICPalette, IWICFormatConverter, IWICBitmapDecoderInfo, IWICPixelFormatInfo2, IWICMetadataReaderInfo, IWICMetadataHandlerInfo, IWICBitmapCodecInfo, IWICComponentInfo, WICMapGuidToShortName, WICMapSchemaToName had numerous ByVal/ByRef mixups.

Update (v7.0.282, 01 Jan 2024):
-Added all variable conversion and arithmetic helpers from oleauto.h; coverage of that header now 100% (of supported by language).
-Additional GUIDs and error consts from olectl.h to bring that header's coverage to 100%.
-VARCMP enum renamed VARCMPRES to avoid conflict with VarCmp API.
-Added missing flags for VariantChangeType[Ex]
-SHFileOperation and SHFILEOPSTRUCT did not conform to API standards. Struct names were incorrect; the operations aborted member was incorrectly defined as Boolean, but the padding bytes prevented it from failing the entire function.
-SysAllocStringByteLen now use ByVal As Any, since either a String or LongPtr would be ByVal.
-(Bug fix) SysAllocString definition incorrect (Long instead of LongPtr, impacting 64bit)
-(Bug fix) SysFreeString definition incorrect (ByRef instead of ByVal)
-(Bug fix) SysReAllocStringLen should use DeclareWide
-(Bug fix) LHashValOfName is a macro, not an export; now implemented properly.
-(Bug fix) FORMATETC used a Long for CLIPFORMAT, which is incorrect.
-(MAJOR BUG FIX) IStream was missing UnlockRegion. This impacted numerous derived interfaces, throwing off their vtables, completely breaking them. This bug was also present in WinDevLibImpl.

Update (v7.0.280, 28 Dec 2023):
-INDEXTOOVERLAYMASK was inexplicably missing; also added inverse, OVERLAYMASKTOINDEX.
-Additional setup APIs-- newdev.h, 100% coverage, and additional cfgmgr32 APIs.
-Additional kernel32 APIs-- processthreadsapi.h now has 100% coverage
-(Bug fix) SetupDiGetClassDevsW did not conform to WinDevLib API standards.
-(Bug fix) Some SetupAPI defs did not have the required 1-byte packing on 32bit
-(Bug fix) NMLVKEYDOWN and NMTVKEYDOWN did not have required packing alignment

Update (v7.0.277, 21 Dec 2023):
-Added customer caller for AuthzReportSecurityEvent (experimental).
-(Bug fix) SHEmptyRecycleBinW, PathRemoveBackslash, PathSkipRoot, CreateMailslot did not conform to API standards
-(Bug fix) All SHReg* APIs missing W variants
-(Bug fix) PathAddExtension, PathAddRoot, EnumSystemLanguageGroups, LoadCursorFromFile, waveInGetErrorText definitions incorrect (misplaced alias)
-(Bug fix) PathIsDirectoryA/W, PdhAddEnglishCounterA definitions incorrect (invalid alias)
-(Bug fix) GetLogicalDriveStringsA definition incorrect (DeclareWide on ANSI)
-(Bug fix) Mising DeclareWide:
Get/SetComputerName[Ex]
All THelp32.h APIs
SHUpdateImage
ShellNotify_Icon
WaveIn/OutDevCaps
HttpQueryInfo

Update (v7.0.276, 20 Dec 2023):
-Added cryptui.dll APIs (cryptuiapi.h, 100% coverage)
-Some additional SetupAPI and Cfgmgr32 defs, as well as devmgr.dll APIs documented and not (show device manager, prop pages, problem wizard, etc)
-More inexplicably missing shell32 APIs
-Additional APIs from ShellScalingAPI.h (now 100% coverage)
-(Bug fix) Duplicated DEVPROP_TYPE_* values.
-(Bug fix) GetExplicitEntriesFromAcl definition incorrect (misplaced Alias)
-(Bug fix) Wow64RevertWow64FsRedirection lacked explicit ByVal modifier.
-(Bug fix) Get/SetProcessDpiAwareness definitions incorrect.

Update (v7.0.272, 17 Dec 2023):

tbShellLib is now WinDevLib - Windows Development Library for twinBASIC

MAJOR CHANGES LARGE_INTEGER I've been considering these for a long time, and decided to pull the trigger before tB goes 1.0.

The LARGE_INTEGER type is defined in C as:

typedef union _LARGE_INTEGER {
    struct {
        DWORD LowPart;
        LONG HighPart;
    } DUMMYSTRUCTNAME;
    struct {
        DWORD LowPart;
        LONG HighPart;
    } u;
    LONGLONG QuadPart;
} LARGE_INTEGER;

The Windows API, from user to native to kernel, all recognize the QuadPart member and apply 8-byte packing rules. VB6 and VBA (except 64bit) lack a LongLong type, so programmers have traditionally used the LowPart/HighPart option. This does not trigger 8 byte packing rules, and while problems from this are rare in 32bit mode, they're quite common in 64bit mode. As a result of this, WinDevLib has up until now kept the traditional definition for LARGE_INTEGER and instead substituted a QLARGE_INTEGER or ULARGE_INTEGER in it's own definitions.
This will now change. The original plan was to wait for union support which would allow both while still triggering the 8 byte alignment rules, but that has recently been confirmed as a post-1.0 feature. When that is added, the old option will be added back in.
LARGE_INTEGER now by default uses QuadPart, and all QLARGE_INTEGER have been changed to LARGE_INTEGER.

Reminder: This does greatly simplify things; you can remove all conversions to Currency and related multiply/divide by 10,000. Also, note that if you use your own local definition, WinDevLib does not supercede it for your own code. It is strongly recommended to switch away from Currency when doing 64bit updates.

A compiler flag is available to restore the old definition (but not the use of QLARGE_INTEGER in WinDevLib defs): WINDEVLIB_NOQUADLI

SendMessage and PostMessage These will now conform to the same API standards as all other functions; the undenominated (without A or W suffix) will now point to SendMessageW and PostMessageW and use DeclareWide. Note that these have never affected the target itself, it's always just modified how String arguments are interpreted. 99% of usage of these will not be impacted by this, since you'll still be able to use String and not nee to modify the result for ANSI/Unicode conversion. PostMessage already used DeclareWide, which was perhaps causing unexpected issues in the edge cases.

Addtional changes:
-Added interface IActCtx and coclass ActCtx.
-Missing WH_ enum values and associated types for SetWindowsHookEx
-Numerous missing VK_* virtual key codes
-Missing WM_* wParam enums.
-Several service APIs did not conform to tbShellLib API standards with respect to A/W/DeclareWide UDT naming.
-Added a lot of additional user32 content.
-Added variable min/max constants from limits.h (100% coverage)
-Redid FILEDESCRIPTOR[A,W] to use proper FILETIME types and Integer for WCHAR instead of 2x Byte.
-Added several types associated with clipboard formats.
-Added unsigned variable helper functions (thanks to Krool for these): UnsignedAdd, CUIntToInt, CIntToUInt, CULngToLng, and CLngToULng. CULngToLng has an override between the original Double and LongLong, CLngToULng does too but rewrites the output into an argument since tB can't overload purely based on function return type.
-Added gesture angle macros GID_ROTATE_ANGLE_TO_ARGUMENT/GID_ROTATE_ANGLE_FROM_ARGUMENT
-Added hundreds of additional NTSTATUS values.
-Added overloads to LOWORD and HIWORD to handle LongLong directly.
-winuser.h now has 100% coverage of language-supported definitions (10.0.25309 SDK); the largest header to date with this distinction with over 16000 lines in the original.
-(Bug fix) LBItemFromPt was marked Private.
-(Bug fix) RealGetWindowClass definition incorrect (invalid alias).
-(Bug fix) Duplicated constant: CCHILDREN_SCROLLBAR
-(Bug fix) PostThreadMessage definition incorrect and did not meet API standards.
-(Bug fix) InsertMenuItem[A,W] definitions technically incorrect although not causing an error. Also did not conform to API standards.
-(Bug fix) PostThreadMessage definition incorrect.
-(Bug fix) PostMessageA incorrectly had DeclareWide.
-(Bug fix) ILCreateFromPathEx was removed as it's not exported from shell32 either by name or ordinal.
-(Bug fix) ILCloneChild, ILCloneFull, ILIsAligned, ILIsChild, ILIsEmpty, ILNext, and ILSkip are only macros; they were declared as shell32.dll functions. Some of these were aliases and modified appropriate, the rest were implemented as functions.
-(Bug fix) ILLoadFromStream is exported by ordinal only.

WinDevLibImpl v1.2.11.272 -(Bug fix, WinDevLibImpl) IPersistFile method definition incorrect.


For earlier version history, see CHANGELOG.md

For more information and a list of available interfaces, visit the VB Forums thread for this project.

windevlib's People

Contributors

fafalone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

windevlib's Issues

URLDownloadToCacheFileW and URLDownloadToFileW

These two should have String arguments changed to LongPtr I think:

Public Declare PtrSafe Function URLDownloadToCacheFileW Lib "urlmon" (ByVal lpUnkcaller As stdole.IUnknown, ByVal szURL As String, ByVal szFileName As LongPtr, ByVal dwBufLength As Long, ByVal dwReserved As Long, ByVal pbsc As IBindStatusCallback) As Long
Public Declare PtrSafe Function URLDownloadToFileW Lib "urlmon" (ByVal pCaller As stdole.IUnknown, ByVal szURL As String, ByVal szFile As String, ByVal dwReserved As Long, ByVal lpfnCB As IBindStatusCallback) As Long

Broken A/W/Alias pattern

I think the DeclareWide version of these should be aliased...

Public Declare PtrSafe Function StopTraceA Lib "advapi32" (ByVal TraceHandle As LongLong, ByVal InstanceName As String, Properties As EVENT_TRACE_PROPERTIES) As Long
Public Declare PtrSafe Function StopTraceW Lib "advapi32" Alias "StopTraceW" (ByVal TraceHandle As LongLong, ByVal InstanceName As LongPtr, Properties As EVENT_TRACE_PROPERTIES) As Long
Public DeclareWide PtrSafe Function StopTrace Lib "advapi32" (ByVal TraceHandle As LongLong, ByVal InstanceName As String, Properties As EVENT_TRACE_PROPERTIES) As Long
Public Declare PtrSafe Function QueryTraceA Lib "advapi32" (ByVal TraceHandle As LongLong, ByVal InstanceName As String, Properties As EVENT_TRACE_PROPERTIES) As Long
Public Declare PtrSafe Function QueryTraceW Lib "advapi32" Alias "QueryTraceW" (ByVal TraceHandle As LongLong, ByVal InstanceName As LongPtr, Properties As EVENT_TRACE_PROPERTIES) As Long
Public DeclareWide PtrSafe Function QueryTrace Lib "advapi32" (ByVal TraceHandle As LongLong, ByVal InstanceName As String, Properties As EVENT_TRACE_PROPERTIES) As Long

IShellItemImageFactory definition will not work for x64

The GetImage function takes a ByVal SIZE; in x64 this is done with 2x ByVal Long, but on x64 must be a single ByVal LongLong (CopyMemory to read it in/out).

The following updated definition will appear in future versions but the code in this repo is not yet updated:

[ InterfaceId ("bcc18b79-ba16-442f-80c4-8a59c30c463b") ]
Interface IShellItemImageFactory Extends stdole.iunknown
    #If Win64 Then
    Sub GetImage(ByVal cxy As LongLong, ByVal flags As SIIGBF, phbm As LongPtr)
    #Else
    Sub GetImage(ByVal cx As Long, ByVal cy As Long, ByVal flags As SIIGBF, phbm As LongPtr)
    #End If
End Interface

GetAsyncKeyState and GetKeyState Argument Type

Not a bug, but perhaps a minor improvement since it looks like you have the VirtualKeyCodes Enum defined:

'Currently in WDL:
Public DeclareWide PtrSafe Function GetAsyncKeyState Lib "user32" (ByVal VKey As Long) As Integer
Public DeclareWide PtrSafe Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer

'Proposed changes:
Public Declare PtrSafe Function GetAsyncKeyState Lib "user32" (ByVal VKey As VirtualKeyCodes) As Integer
Public Declare PtrSafe Function GetKeyState Lib "user32" (ByVal nVirtKey As VirtualKeyCodes) As Integer

A few more potential anomalies

Just checking - these W-Aliased-as-A look suspicious...

Public Declare PtrSafe Function GetFileVersionInfoSizeA Lib "version.dll" Alias "GetFileVersionInfoSizeW" (ByVal lptstrFilename As String, lpdwHandle As Long) As Long
Public Declare PtrSafe Function GetFileVersionInfoA Lib "version.dll" Alias "GetFileVersionInfoW" (ByVal lptstrFilename As String, ByVal dwhandle As Long, ByVal dwLen As Long, lpData As Any) As Long
Public Declare PtrSafe Function GetDiskFreeSpaceA Lib "kernel32" Alias "GetDiskFreeSpaceW" (ByVal lpRootPathName As String, lpSectorsPerCluster As Long, lpBytesPerSector As Long, lpNumberOfFreeClusters As Long, lpTotalNumberOfClusters As Long) As BOOL

and should this one be DeclareWide?

Public Declare PtrSafe Function RegCreateKey Lib "advapi32" Alias "RegCreateKeyW" ([TypeHint(RegKeyspace)] ByVal hKey As LongPtr, ByVal lpSubKey As String, phkResult As LongPtr) As Long

and this one's alias seems redundant:

Public Declare PtrSafe Function SHStrDupW Lib "shlwapi" Alias "SHStrDupW" (ByVal psz As LongPtr, ppwsz As LongPtr) As Long

SHUpdateImageA and aliased version of SHUpdateImage should have String argument?

Jon, should pszHashItem argument in the A and aliased version below be of type String?

[Description("Notifies the Shell that an image in the system image list has changed.")]
Public Declare PtrSafe Sub SHUpdateImageA Lib "shell32" (ByVal pszHashItem As LongPtr, ByVal iIndex As Long, ByVal uFlags As GILFlags, ByVal iImageIndex As Long)
[Description("Notifies the Shell that an image in the system image list has changed.")]
Public Declare PtrSafe Sub SHUpdateImageW Lib "shell32" (ByVal pszHashItem As LongPtr, ByVal iIndex As Long, ByVal uFlags As GILFlags, ByVal iImageIndex As Long)
[Description("Notifies the Shell that an image in the system image list has changed.")]
Public DeclareWide PtrSafe Sub SHUpdateImage Lib "shell32" Alias "SHUpdateImageW" (ByVal pszHashItem As LongPtr, ByVal iIndex As Long, ByVal uFlags As GILFlags, ByVal iImageIndex As Long)

CreateBitmap Function in "gdi32" Library

Jon, I could not find this one in your library:

Public Declare PtrSafe Function CreateBitmap Lib "gdi32" (ByVal nWidth As Long, ByVal nHeight As Long, ByVal nPlanes As Long, ByVal nBitCount As Long, lpBits As Any) As LongPtr

Thx!

Bug in ITypeLib 64 bit + Discussion on style of declarations

https://github.com/fafalone/tbShellLib/blob/93346dece996ba12da8526ad21a923bdb95cc00f/Export/Sources/slTypelib.twin#L33

This should return LongPtr I believe (it is PVOID)


Also I wonder how you would feel about 2 (or 3) improvements to make this more idiomatic:

https://github.com/fafalone/tbShellLib/blob/93346dece996ba12da8526ad21a923bdb95cc00f/Export/Sources/slTypelib.twin#L30

In my code, I have declared this as

Sub GetDocumentation(ByVal memid As MEMID, Optional ByRef pBstrName As String, Optional ByRef pBstrDocString As String = vbNullString, Optional ByRef pdwHelpContext As Long, Optional ByRef pBstrHelpFile As String)

with 2 changes: The Optional arguments, since these are optional from the API point of view. You can specify default of =vbNullString and =NULL_PTR or =0 if needed

Second change is I do

Public Enum MEMID
	[_]
End Enum

This does a sort of typedef for DWORD types which improves readability IMO

3rd change is I rename parameters to for example

Sub GetDocumentation(ByVal memid As MEMID, Optional ByRef outName As String, ...)

Since ByRef pBstrName to me is

  • Too much information; I don't need to know about Bstr as a VBA developer, just String
  • ByRef and p both mean kinda the same thing, doubling up makes me expect to get a pointer to a string out, not just a string
  • I think the outParam prefix is good from a VBA consumer point of view to make it clear. Attributes may be better in future tB.

I think this may be a harder sell as it is backwards incompatible for your library interface. However in my experience when I declare the APIs this way it makes me much less likely to need to look at the MSDN documentation. But it's still easy to look up online even if I've renamed the params, the function name is the same and the order of params is the same. Maybe for version 3.x of your package.

ShowWindow function triggering error

This was due to the SHOWWINDOW enum being moved; they're only not ambiguous when in the same module. I was in the middle of 10 things so an update is taking a while. For a temp workaround, fully qualify it with tbShellLib.slAPI.ShowWindow.

IUnknownUnrestricted not yet available

Up until twinBASIC Beta 132, there was no option to not have an interface inherit from something, so the definition in the current version will not work.

If you have Beta 132, the following definition will fix it and will be applied in the next version:

[ InterfaceId ("00000000-0000-0000-C000-000000000046") ]
Interface IUnknownUnrestricted Extends Nothing
    Sub QueryInterface(riid As UUID, ppvObject As any)
    Sub AddRef()
    Sub Release()
End Interface

OPENFILENAME[AW] UDTs incorrect

I just updated the package so it might be a few days until this is fixed... the OPENFILENAME, OPENFILENAMEA, and OPENFILENAMEW UDTs all have 2 members that should be a String/LongPtr but are set as Long.

The following definitions are correct:

Public Type OPENFILENAMEA
    lStructSize As Long
    hwndOwner As LongPtr
    hInstance As LongPtr
    lpstrFilter As String
    lpstrCustomFilter As String
    nMaxCustFilter As Long
    nFilterIndex As Long
    lpstrFile As String
    nMaxFile As Long
    lpstrFileTitle As String
    nMaxFileTitle As Long
    lpstrInitialDir As String
    lpstrTitle As String
    Flags As OFNFlags
    nFileOffset As Integer
    nFileExtension As Integer
    lpstrDefExt As String
    lCustData As LongPtr
    lpfnHook As LongPtr
    lpTemplateName As String
    pvReserved As LongPtr
    dwReserved As Long
    FlagsEx As OFNFlagsEx
End Type
Public Type OPENFILENAMEW
    lStructSize As Long
    hwndOwner As LongPtr
    hInstance As LongPtr
    lpstrFilter As LongPtr
    lpstrCustomFilter As LongPtr
    nMaxCustFilter As Long
    nFilterIndex As Long
    lpstrFile As LongPtr
    nMaxFile As Long
    lpstrFileTitle As LongPtr
    nMaxFileTitle As Long
    lpstrInitialDir As LongPtr
    lpstrTitle As LongPtr
    Flags As OFNFlags
    nFileOffset As Integer
    nFileExtension As Integer
    lpstrDefExt As LongPtr
    lCustData As LongPtr
    lpfnHook As LongPtr
    lpTemplateName As LongPtr
    pvReserved As LongPtr
    dwReserved As Long
    FlagsEx As OFNFlagsEx
End Type
Public Type OPENFILENAME
    lStructSize As Long
    hwndOwner As LongPtr
    hInstance As LongPtr
    lpstrFilter As LongPtr
    lpstrCustomFilter As LongPtr
    nMaxCustFilter As Long
    nFilterIndex As Long
    lpstrFile As LongPtr
    nMaxFile As Long
    lpstrFileTitle As LongPtr
    nMaxFileTitle As Long
    lpstrInitialDir As LongPtr
    lpstrTitle As LongPtr
    Flags As OFNFlags
    nFileOffset As Integer
    nFileExtension As Integer
    lpstrDefExt As LongPtr
    lCustData As LongPtr
    lpfnHook As LongPtr
    lpTemplateName As LongPtr
    pvReserved As LongPtr
    dwReserved As Long
    FlagsEx As OFNFlagsEx
End Type

Toolbox

I have just imported from the internet the tbshellLib. Should I see a toolbox?
grafik

CM_COLUMNINFO wszName array is too short

Public Const MAX_COLUMN_NAME_LEN = 80
Public Type CM_COLUMNINFO
	cbSize As Long ' size in bytes of struct
	dwMask As CM_MASK ' CM_MASK
	dwState As CM_STATE ' CM_STATE
	uWidth As Long ' CM_MASK_WIDTH, for SetColumnInfo it can be a CM_SET_WIDTH_VALUE
	uDefaultWidth As Long ' CM_MASK_DEFAULTWIDTH
	uIdealWidth As Long ' CM_MASK_IDEALWIDTH
	wszName(0 To (MAX_COLUMN_NAME_LEN - 1)) As Byte
End Type

should be

Public Const MAX_COLUMN_NAME_LEN = 80
Public Type CM_COLUMNINFO
	cbSize As Long ' size in bytes of struct
	dwMask As CM_MASK ' CM_MASK
	dwState As CM_STATE ' CM_STATE
	uWidth As CM_SET_WIDTH_VALUE ' CM_MASK_WIDTH, for SetColumnInfo it can be a CM_SET_WIDTH_VALUE
	uDefaultWidth As Long ' CM_MASK_DEFAULTWIDTH
	uIdealWidth As Long ' CM_MASK_IDEALWIDTH
	wszName(0 To (MAX_COLUMN_NAME_LEN - 1)) As Integer
End Type

4 more WIC proxy functions

You probably missed them because they are the only ones not preceded by "I"?

WICCreateImagingFactory_Proxy
WICCreateColorContext_Proxy
WICCreateColorTransform_Proxy
WICSetEncoderFormat_Proxy

Thanks!

SysReAllocStringW declared incorrectly

Missing an alias, should be

Public Declare PtrSafe Function SysReAllocStringW Lib "oleaut32" Alias "SysReAllocString" (ByVal pBSTR As LongPtr, Optional ByVal pszStrPtr As LongPtr) As Long

SHGetPathFromIDList and SHGetPathFromIDListW are declared incorrectly

These currently have an incorrect 3rd parameter and should instead be:

Public Declare PtrSafe Function SHGetPathFromIDList Lib "shell32" Alias "SHGetPathFromIDListA" (ByVal pidl As LongPtr, ByVal pszPath As String) As Long

Public Declare PtrSafe Function SHGetPathFromIDListW Lib "shell32" (ByVal pidl As LongPtr, ByVal pszPath As LongPtr) As Long

DeclareWide version of GetWindowTextW

Jon, this is more of a question than an issue...

In wdAPI.twin:

Public Declare PtrSafe Function GetWindowTextA Lib "user32" (ByVal hWnd As LongPtr, ByVal lpString As String, ByVal nMaxCount As Long) As Long
Public DeclareWide PtrSafe Function GetWindowTextW Lib "user32" (ByVal hWnd As LongPtr, ByVal lpString As LongPtr, ByVal nMaxCount As Long) As Long
Public DeclareWide PtrSafe Function GetWindowText Lib "user32" Alias "GetWindowTextW" (ByVal hWnd As LongPtr, ByVal lpString As String, ByVal nMaxCount As Long) As Long

Why isn't the second declare above like below (see lpString argument)?

Public DeclareWide PtrSafe Function GetWindowTextW Lib "user32" (ByVal hWnd As LongPtr, ByVal lpString As String, ByVal nMaxCount As Long) As Long

Why OLEAutomation(False)?

Is this restriction necessary? For example, if I want to return an ITypeInfo from a function in a dll I call from VBA, will I be able to with this flag?

CreateTypeLib API incorrectly defined

This bug carried over from oleexp; the 2nd argument should be ByVal, not ByRef. You can use CreateTypeLib2 as a workaround until the next update if this impacts you.

More A/W/DeclareWide Alias pattern anomalies

These don't follow the A/W/DeclareWide Alias pattern. Looks like the A's are aliased (as opposed to W's) and hence one of our filtering passes incorrectly replaced "DeclareWide" with "Declare" from the (unaliased) W's. Looks like the "standard" W entries were not originally included(?). When I get time I'll run a search for Aliased A's to check if there are any others like this.

Public Declare PtrSafe Function URLOpenStream Lib "urlmon" Alias "URLOpenStreamA" (ByVal pCaller As stdole.IUnknown, ByVal szURL As String, ByVal dw As Long, ByVal pCallback As IBindStatusCallback) As Long
Public Declare PtrSafe Function URLOpenStreamW Lib "urlmon" (ByVal pCaller As stdole.IUnknown, ByVal szURL As String, ByVal dw As Long, ByVal pCallback As IBindStatusCallback) As Long
Public Declare PtrSafe Function URLOpenPullStream Lib "urlmon" Alias "URLOpenPullStreamA" (ByVal pCaller As stdole.IUnknown, ByVal szURL As String, ByVal dwReserved As Long, ByVal pCallback As IBindStatusCallback) As Long
Public Declare PtrSafe Function URLOpenPullStreamW Lib "urlmon" (ByVal pCaller As stdole.IUnknown, ByVal szURL As String, ByVal dwReserved As Long, ByVal pCallback As IBindStatusCallback) As Long
Public Declare PtrSafe Function URLDownloadToCacheFile Lib "urlmon" Alias "URLDownloadToCacheFileA" (ByVal lpUnkcaller As stdole.IUnknown, ByVal szURL As String, ByVal szFileName As String, ByVal dwBufLength As Long, ByVal dwReserved As Long, ByVal pbsc As IBindStatusCallback) As Long
Public Declare PtrSafe Function URLDownloadToCacheFileW Lib "urlmon" (ByVal lpUnkcaller As stdole.IUnknown, ByVal szURL As String, ByVal szFileName As Long, ByVal dwBufLength As Long, ByVal dwReserved As Long, ByVal pbsc As IBindStatusCallback) As Long
Public Declare PtrSafe Function URLOpenBlockingStream Lib "urlmon" Alias "URLOpenBlockingStreamA" (ByVal pCaller As stdole.IUnknown, ByVal szURL As String, ByRef Strm As IStream, ByVal dwReserved As Long, ByVal lpfnCB As IBindStatusCallback) As Long
Public Declare PtrSafe Function URLOpenBlockingStreamW Lib "urlmon" (ByVal pCaller As stdole.IUnknown, ByVal szURL As String, ByRef Strm As IStream, ByVal dwReserved As Long, ByVal lpfnCB As IBindStatusCallback) As Long
Public Declare PtrSafe Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As stdole.IUnknown, ByVal szURL As String, ByVal szFile As String, ByVal dwReserved As Long, ByVal lpfnCB As IBindStatusCallback) As Long
Public Declare PtrSafe Function URLDownloadToFileW Lib "urlmon" (ByVal pCaller As stdole.IUnknown, ByVal szURL As String, ByVal szFile As String, ByVal dwReserved As Long, ByVal lpfnCB As IBindStatusCallback) As Long

CryptBinaryToString should be DeclareWide?

in wdAPICrypto.twin:

Public Declare PtrSafe Function CryptBinaryToStringW Lib "crypt32" (pbBinary As Any, ByVal cbBinary As Long, ByVal dwFlags As CRYPT_STRING_OPTIONS, ByVal pszString As LongPtr, pcchString As Long) As BOOL
Public Declare PtrSafe Function CryptBinaryToString Lib "crypt32" Alias "CryptBinaryToStringW" (pbBinary As Any, ByVal cbBinary As Long, ByVal dwFlags As CRYPT_STRING_OPTIONS, ByVal pszString As String, pcchString As Long) As BOOL

Thx!

SHCreateItemFromParsingName overload?

Jon, did you intend to overload this one?

Public DeclareWide PtrSafe Function SHCreateItemFromParsingName Lib "shell32" (ByVal pszPath As String, ByVal pbc As IBindCtx, riid As UUID, ppv As Any) As Long
Public DeclareWide PtrSafe Function SHCreateItemFromParsingName Lib "shell32" (ByVal pszPath As LongPtr, ByVal pbc As IBindCtx, riid As UUID, ppv As Any) As Long

GdipGetLineColors has different call signatures for 32-bit versus 64-bit

I've confirmed that the 32- and 64-bit versions have different call signatures by using both in tB (and of course they are not interchangeable). The 32-bit version requires a Long array of dimension 2 (Colors(0) and Colors(1)).

#If Win64 Then
Private Declare PtrSafe Function GdipGetLineColors Lib "gdiplus" (ByVal brush As LongPtr, color1 As Long, color2 As Long) As GpStatus
#Else
Private Declare Function GdipGetLineColors Lib "gdiPlus" (ByVal brush As Long, Colors As Any) As GpStatus
#End If

Thx!

GdipFillClosedCurve2 and GdipFillClosedCurve2I declarations

Jon, just now starting to use your WinDevLib for vb6-to-tB project conversion. This helps a lot but still a very tedious process!

Anyway, I'm currently using WinDevLib 7.7.370.0 and ran across possible mis-declarations for two GDI-Plus functions.

These are the current declarations your wdGDPI.twin module:

Public Declare PtrSafe Function GdipFillClosedCurve2 Lib "gdiplus" (ByVal Graphics As LongPtr, ByVal brush As LongPtr, Points As POINTF, ByVal count As Long, ByVal fillMode As GpFillMode) As GpStatus
Public Declare PtrSafe Function GdipFillClosedCurve2I Lib "gdiplus" (ByVal Graphics As LongPtr, ByVal brush As LongPtr, Points As POINT, ByVal count As Long, ByVal fillMode As GpFillMode) As GpStatus

which I believe might be missing the "tension" argument:

Public Declare PtrSafe Function GdipFillClosedCurve2 Lib "gdiplus" (ByVal Graphics As LongPtr, ByVal brush As LongPtr, Points As POINTF, ByVal count As Long, ByVal tension As Single, ByVal fillMode As GpFillMode) As GpStatus
Public Declare PtrSafe Function GdipFillClosedCurve2I Lib "gdiplus" (ByVal Graphics As LongPtr, ByVal brush As LongPtr, Points As POINT, ByVal count As Long, ByVal tension As Single, ByVal fillMode As GpFillMode) As GpStatus

Can you take a look? Thx!

Edit: I'm on Windows 11 if that matters

WDL Conversion Question

Jon, sorry for taking up your time, but I'm needing some clarification on how to switch my code to be WDL-compatible. I read your ReadMe and initially thought I understood, but am still having some issues.

How would I convert from my current usage to WDL usage given the declare and usage example blocks below? Passing vbNullPtr to the pCaller and IpfnCB arguments causes a compile error. Is passing NULL ok? I tested NULL and it seems to work, but I did not see explicit mention of that in your ReadMe.

'Legacy declare:
Public Declare PtrSafe Function UrlDownloadToFile Lib "urlmon" Alias "URLDownloadToFileW" ( _
    ByVal pCaller As Long, _
    ByVal szURL As LongPtr, _
    ByVal szFileName As LongPtr, _
    ByVal dwReserved As Long, _
    ByVal lpfnCB As Long) As Long

'WDL declare:
Public DeclareWide PtrSafe Function UrlDownloadToFile Lib "urlmon" Alias "URLDownloadToFileW" ( _
    ByVal pCaller As stdole.IUnknown, _
    ByVal szURL As String, _
    ByVal szFile As String, _
    ByVal dwReserved As Long, _
    ByVal lpfnCB As IBindStatusCallback) As Long
'Legacy usage:
ret = UrlDownloadToFile(0&, StrPtr(Url), StrPtr(filePath), 0&, 0&)

'WDL usage??? This seems to work but is it correct?
ret = UrlDownloadToFile(Null, Url, filePath, 0&, Null)

Thanks!

Incorrect argument for GdipDrawImagePointsRect and GdipDrawImagePointsRectI API functions

The first argument "Graphics" should be LongPtr type instead of Long I think. Here is what is currently in WDL:

Public Declare PtrSafe Function GdipDrawImagePointsRect Lib "gdiplus" (ByVal Graphics As Long, ByVal Image As LongPtr, points As POINTF, ByVal count As Long, ByVal srcx As Single, ByVal srcy As Single, ByVal srcwidth As Single, ByVal srcheight As Single, ByVal srcUnit As GpUnit, Optional ByVal imageAttributes As LongPtr = 0, Optional ByVal callback As LongPtr = 0, Optional callbackData As Any) As GpStatus

Public Declare PtrSafe Function GdipDrawImagePointsRectI Lib "gdiplus" (ByVal Graphics As Long, ByVal Image As LongPtr, dstpoints As POINT, ByVal count As Long, ByVal srcx As Long, ByVal srcy As Long, ByVal srcwidth As Long, ByVal srcheight As Long, ByVal srcUnit As GpUnit, Optional ByVal imageAttributes As LongPtr = 0, Optional ByVal callback As LongPtr = 0, Optional callbackData As Any) As GpStatus

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.