Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CryptBinaryToString should be DeclareWide? #26

Closed
GCuser99 opened this issue May 10, 2024 · 6 comments
Closed

CryptBinaryToString should be DeclareWide? #26

GCuser99 opened this issue May 10, 2024 · 6 comments
Labels
conventions Inconsistency in API conventions in-progress Issue resolved in source, pending for release.

Comments

@GCuser99
Copy link

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!

@fafalone
Copy link
Owner

fafalone commented May 10, 2024

Yup should be. So should W because of the As Any. Right above it with String to binary the As Byte arguments should be As Any and DeclareWide used on W too. Changed for next release.

Btw, started finding APIs missed by your conversion:

Public DeclareWide PtrSafe Function MonitorFromPoint Lib "user32" (ByVal pt As LongLong, ByVal dwFlags As DefaultMonitorValues) As LongPtr
Public DeclareWide PtrSafe Function MonitorFromWindow Lib "user32" (ByVal hwnd As LongPtr, ByVal dwFlags As DefaultMonitorValues) As LongPtr
Public DeclareWide PtrSafe Function MonitorFromRect Lib "user32" (lprc As RECT, ByVal dwFlags As DefaultMonitorValues) As LongPtr

No biggie, it got 99% of them, just curious how some escaped. Don't worry about going crazy trying to fix it, I'll just get the stragglers manually as I see them

Edit: Actually looking closer at the changed log now, it only caught W+DeclareWide; any chance you could do DeclareWide->Declare where there's no As Any or As String and it's not an Aliased W?

@fafalone fafalone added in-progress Issue resolved in source, pending for release. conventions Inconsistency in API conventions labels May 10, 2024
@GCuser99
Copy link
Author

GCuser99 commented May 10, 2024

Sure Jon - do you want me to use same inputs or do you have an updated set to provide me so I can keep in sync with you?

EDIT: There's an equally large number of declares that match your latest pattern.

@fafalone
Copy link
Owner

Thanks a bunch. Here's the latest version of the files to run. No releases lately because I got bogged down in 'I should add this, and that, and that! So there's a bunch of unfinished stuff, and no major bugs.

Sources.zip

@GCuser99
Copy link
Author

Same format as before...

wdl 240510.zip

@fafalone
Copy link
Owner

Thanks looks great!

@fafalone
Copy link
Owner

Fixed in v8.0.402, now available.

Thanks for reporting and thanks again for the help with the APIs. I added a thanks at the bottom of the API section of the readme on the front page of the repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conventions Inconsistency in API conventions in-progress Issue resolved in source, pending for release.
Projects
None yet
Development

No branches or pull requests

2 participants