Git Product home page Git Product logo

Comments (4)

fafalone avatar fafalone commented on July 1, 2024

Well thats annoying; I made those changes and somehow they didn't take... maybe forgot to save, or tB did that fakeout...

Fixed in v8.0.404, available now.

Hey is this something regex would be able to help with? If so, if you're up for it and whenever you have the time, could you check for other W functions that have String arguments but not DeclareWide?

from windevlib.

GCuser99 avatar GCuser99 commented on July 1, 2024

I ran the search for unAliased W's with String Args and included in list below. For each of those found, I also examined their corresponding A and Aliased siblings and included what looked to be incorrect in those too (for example, some A/W versions were misidentified as W/A respectively).

Public Declare PtrSafe Function CommandLineToArgvW Lib "shell32" (ByVal lpCmdLine As String, pNumArgs As Long) As LongPtr

'the DeclareWide Aliased version has LongPtr that should be String
Public DeclareWide PtrSafe Function PathIsSystemFolder Lib "shlwapi" Alias "PathIsSystemFolderW" (ByVal pszPath As LongPtr, ByVal dwAttrb As Long) As BOOL
Public Declare PtrSafe Function PathIsSystemFolderW Lib "shlwapi" (ByVal pszPath As String, ByVal dwAttrb As Long) As BOOL

Public Declare PtrSafe Function UrlCreateFromPathW Lib "shlwapi" (ByVal pszPath As String, ByVal pszUrl As String, ByRef pcchUrl As Long, ByVal dwFlags As Long) As Long

'the Aliased version should be DeclareWide and lpsz arg switched to String
Public Declare PtrSafe Function IsBadStringPtr Lib "kernel32" Alias "IsBadStringPtrW" (ByVal lpsz As LongPtr, ByVal ucchMax As LongPtr) As BOOL
Public Declare PtrSafe Function IsBadStringPtrW Lib "kernel32" (ByVal lpsz As String, ByVal ucchMax As LongPtr) As BOOL

Public Declare PtrSafe Function CreateWaitableTimerExW Lib "kernel32" (lpTimerAttributes As SECURITY_ATTRIBUTES, ByVal lpTimerName As String, ByVal dwFlags As CreateWaitableTimerExFlags, ByVal dwDesiredAccess As Long) As LongPtr

'switch the args between W and A versions?
Public Declare PtrSafe Function CreateServiceA Lib "advapi32" (ByVal hService As LongPtr, ByVal lpServiceName As LongPtr, ByVal lpDisplayName As LongPtr, ByVal dwDesiredAccess As Long, ByVal dwServiceType As ServiceType, ByVal dwStartType As ServiceStartType, ByVal dwErrorControl As ServiceErrorControlType, Optional ByVal lpBinaryPathName As LongPtr, Optional ByVal lpLoadOrderGroup As LongPtr, Optional ByRef lpdwTagId As Long, Optional ByVal lpDependencies As LongPtr, Optional ByVal lpServiceStartName As LongPtr, Optional ByVal lpPassword As LongPtr) As BOOL
Public Declare PtrSafe Function CreateServiceW Lib "advapi32" (ByVal hService As LongPtr, ByVal lpServiceName As LongPtr, ByVal lpDisplayName As LongPtr, ByVal dwDesiredAccess As Long, ByVal dwServiceType As ServiceType, ByVal dwStartType As ServiceStartType, ByVal dwErrorControl As ServiceErrorControlType, Optional ByVal lpBinaryPathName As String, Optional ByVal lpLoadOrderGroup As String, Optional ByRef lpdwTagId As Long, Optional ByVal lpDependencies As String, Optional ByVal lpServiceStartName As String, Optional ByVal lpPassword As String) As BOOL

Public Declare PtrSafe Function mmioRenameW Lib "winmm" (ByVal szFileName As LongPtr, ByVal SzNewFileName As String, lpmmioinfo As MMIOINFO, ByVal dwRenameFlags As Long) As MMIOERR

Public Declare PtrSafe Function GetPrintProcessorDirectoryW Lib "winspool.drv" (ByVal pName As LongPtr, ByVal pEnvironment As LongPtr, ByVal Level As Long, ByVal pPrintProcessorInfo As String, ByVal cbBuf As Long, pcbNeeded As Long) As BOOL

Public Declare PtrSafe Function SetFormW Lib "winspool.drv" (ByVal hPrinter As LongPtr, ByVal pFormName As String, ByVal Level As Long, pForm As Any) As BOOL

'switch the args between W and A versions?
Public Declare PtrSafe Function AddPortA Lib "winspool.drv" (ByVal pName As LongPtr, ByVal hwnd As LongPtr, ByVal pMonitorName As LongPtr) As BOOL
Public Declare PtrSafe Function AddPortW Lib "winspool.drv" (ByVal pName As String, ByVal hwnd As LongPtr, ByVal pMonitorName As String) As BOOL

'these two do not have corresponding A and Aliased W    
Public Declare PtrSafe Function CredUIStoreSSOCredW Lib "credui.dll" (ByVal pszRealm As String, ByVal pszUsername As String, ByVal pszPassword As String, ByVal bPersist As BOOL) As Long
Public Declare PtrSafe Function CCredUIReadSSOCredW Lib "credui.dll" (ByVal pszRealm As String, ppszUsername As LongPtr) As Long

Public Declare PtrSafe Function GetUrlCacheEntryInfoExW Lib "wininet" (ByVal lpszUrl As LongPtr, lpCacheEntryInfo As INTERNET_CACHE_ENTRY_INFOW, lpcbCacheEntryInfo As Long, ByVal lpszRedirectUrl As String, lpcbRedirectUrl As Long, ByVal lpReserved As LongPtr, ByVal dwFlags As Long) As BOOL

'these two do not have corresponding A and Aliased W   
Public Declare PtrSafe Function PrivacySetZonePreferenceW Lib "wininet" (ByVal dwZone As URLZONE, ByVal dwType As PrivacyType, ByVal dwTemplate As INET_PRIVACY_TEMPLATES, Optional ByVal pszPreference As String) As Long
Public Declare PtrSafe Function PrivacyGetZonePreferenceW Lib "wininet" (ByVal dwZone As URLZONE, ByVal dwType As PrivacyType, pdwTemplate As INET_PRIVACY_TEMPLATES, Optional ByVal pszBuffer As String, Optional pdwBufferLength As Long) As Long

from windevlib.

fafalone avatar fafalone commented on July 1, 2024

There's no CredUIStoreSSOCred[A} defined in the Windows API, same for the one below that, and PrivacyGet/SetZonePreferenceW, and the CmdLine...-- but there's only 1 C at the start of CredUIReadSSOCredW so glad that was caught. I'm going to use overloads so either String or LongPtr can be used with W.

Thanks again, really great working finding all these bugs 💯

from windevlib.

fafalone avatar fafalone commented on July 1, 2024

All identified issues fixed in v8.0.406, available now.

from windevlib.

Related Issues (20)

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.