-
Notifications
You must be signed in to change notification settings - Fork 118
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
Add wincred.h #70
Comments
Hey @hpoul, I think you will find @timsneath's answer in #64 (comment) helpful on the autogeneration / hand coding front. Do you have an idea of which specific API calls you want to make? |
@domesticmouse thanks for your fast reply, i think right now it's CredWrite, CredRead, CredDelete. I don't have experience with win32 APIs (yet), but those seem to be the closest to keychain read/write/delete :) not sure if it's better to have a generic ffi bridge, or just use the specific C functions in my library (which is how i've implemented it for linux right now), but if it's easier to build on this package, it would be great ;-) |
Yeah, easy enough to add those functions, and they seem useful to others also. I'll put a quick pull request together. As far as the latter question is concerned, you're obviously welcome to do what works best for you. But three reasons why you might consider a direct dependency on win32:
|
cool thanks, that would be great. To be honest my question was actually if it would be easier for me to work out how to add those APIs to |
You are very welcome to do so, if you want to get familiar with these APIs. A couple of tips:
If you don't feel comfortable with doing this work, let me know; happy to investigate it at some point. |
@timsneath Can we promote your comment to a section in either the README? Seems like a useful getting started guide. |
Thanks for the hints.. I've started adding the functions/structs and https://github.com/authpass/win32/blob/wincred/example/credentials.dart#L35-L43 final cred = CREDENTIAL.allocate();
final result = CredRead(
TEXT(credentialName), CRED_TYPE_GENERIC, 0, cred.addressOf);
if (result != TRUE) {
final errorCode = GetLastError();
print('Error ($result): $errorCode');
return;
}
print('Success. size: ${cred.CredentialBlobSize}'); outputs:
(Even though I've written 10 bytes, which I can see in the Credential Manager) |
never mind, I somehow missed that it was |
Ah yes -- they're sneaky with that. The second |
I am interested in using wincred.h: https://docs.microsoft.com/en-us/windows/win32/api/wincred/nf-wincred-credwritea
to port my plugin to windows.
Do you have any plans to add support for it - or how much work is it? I'm not completely sure how much magic is autogenerated and what has to be manually added :-)
The text was updated successfully, but these errors were encountered: