pdvos Posted October 20, 2022 Posted October 20, 2022 (edited) ConsoleWrite("starting" & @CRLF) $hDLL = DllOpen("CredCreator.dll") ;~ ConsoleWrite("Error" & $hDLL & @error) $Cred_Create = DllCall($hDLL,"ptr","cred_create","wstr","KEYTEST") ConsoleWrite("$Cred_Create=" & $Cred_Create & " error=" & @error & @CRLF) $Cred_Register = DllCall($hDLL,"int","cred_register","ptr", "mgr", "wstr","USERNAME", "wstr", "PASSWORD") ConsoleWrite("$Cred_Register=" & $Cred_Register & " error=" & @error & @CRLF) $cred_free = DllCall($hDLL,"none","cred_free","ptr", "mgr") ConsoleWrite("cred_free=" & $Cred_Register & " error=" & @error & @CRLF) DllClose($hDLL) Hello, I got this from a C file ;~ DLLEXPORT(void*) cred_create(wchar_t* AppName); ;~ DLLEXPORT(int) cred_register(void* mgr, wchar_t* username, wchar_t* password); ;~ DLLEXPORT(void) cred_free(void* mgr); Did I "translate" it correctly in the DllCall ... so void* = ptr and wchar_t* = wstr int = int etc or could I use wchar_t .. I saw some examples here that used it but I get an error 2 (unknown return type) Edited October 20, 2022 by pdvos
pdvos Posted October 24, 2022 Author Posted October 24, 2022 Ah seemed that I translated it correctly but it went wrong on the part were the dll returned pointers (and seemingly this didn't work) I asked the dll guy to return an int an now it's working... $Cred_Register = DllCall($hDLL,"int","cred_register","wstr", "AppName" , "wstr","User", "wstr", Password")
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now