Shyke 0 Report post Posted January 5, 2007 Alright, welcome to another one of my ignorance related problems!!We start with needed to call the windows "crypt32.dll" function "CryptProtectData". I start with:DllCall("crypt32.dll", "int", "CryptProtectData")Knowing that the shown code isn't gonna do crap all but unsure how to progress on it. I do a little bit of searching into this function and find this site with data on it although in Perl. I'm unsure of how to use this in AutoIt and come to you guys for help. Share this post Link to post Share on other sites
SmOke_N 199 Report post Posted January 5, 2007 The first step is knowing the parameters and what to substitute the MSDN params with:http://msdn.microsoft.com/library/default....protectdata.asphttp://www.autoitscript.com/forum/index.php?showtopic=7072 Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Share this post Link to post Share on other sites
Shyke 0 Report post Posted January 5, 2007 My problem is that I don't know how to use those parameters with DLLCall. Share this post Link to post Share on other sites
fisofo 0 Report post Posted January 6, 2007 have you viewed the DllCall entry in the helpfile? It provides some excellent examples. DllCall ( "dll", "return type", "function" [, "type1", param1 [, "type n", param n]] ) Type1 = type of parameter param1 = first parameter Share this post Link to post Share on other sites
WeMartiansAreFriendly 1 Report post Posted January 6, 2007 also check out this pagehttp://www.autoitscript.com/forum/index.php?showtopic=7072 Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet() Share this post Link to post Share on other sites
Shyke 0 Report post Posted January 6, 2007 Dim $data = "data", $desc = "description of data", $pass = "pass", $out = "" $return = DllCall("crypt32.dll", "int", "CryptProtectData", "ptr", $data, "str", $desc, "ptr", $pass, "none", "", "none", "", "dword", "CRYPTPROTECT_LOCAL_MACHINE", "ptr", $out) Alright, between AutoItSmith and I.. we got that. Of course it doesn't work how I want it to. It returns a 0... which was pretty much expected knowing my luck. Would anyone have any idea why? Share this post Link to post Share on other sites
NELyon 1 Report post Posted January 6, 2007 Sometimes DLLs return arrays. Check it with IsArray() Share this post Link to post Share on other sites
Shyke 0 Report post Posted January 6, 2007 (edited) It's not an array. EDIT: That DLL is supposed to return a one or a zero (success or failure) and set the protected data inside of $out. Edited January 6, 2007 by Shyke Share this post Link to post Share on other sites
Paulchen 0 Report post Posted January 6, 2007 can you post your sample code incl. the DATA_BLOB and CRYPTPROTECT_PROMPTSTRUCT structure? paul Share this post Link to post Share on other sites
Shyke 0 Report post Posted January 6, 2007 (edited) I'm only currently working with:Dim $data = "data", $desc = "description of data", $pass = "pass", $out = "" $return = DllCall("crypt32.dll", "int", "CryptProtectData", "str", $data, "str", $desc, "ptr", $pass, "none", "", "none", "", "dword", "CRYPTPROTECT_LOCAL_MACHINE", "ptr", $out)The MSDN thingy and the AutoIt DLLCall topic... Edited January 6, 2007 by Shyke Share this post Link to post Share on other sites
Dae 0 Report post Posted January 6, 2007 I'm only currently working with: Dim $data = "data", $desc = "description of data", $pass = "pass", $out = "" $return = DllCall("crypt32.dll", "int", "CryptProtectData", "str", $data, "str", $desc, "ptr", $pass, "none", "", "none", "", "dword", "CRYPTPROTECT_LOCAL_MACHINE", "ptr", $out)oÝ÷ Ù8^º¹ Dunno why I chose 1 and 0 but that link says they are ints. Dunno how it wants you to get the size for the BLOB_DATA's, but in the example in that first link it calls the DLL with pointers set to 0 in order to get $prompt size, then it calls the DLL again with the correct structs. Not sure if you just set that one pointer to 0, or all of them. Sorry if this doesn't help! Share this post Link to post Share on other sites
Shyke 0 Report post Posted January 7, 2007 What are the use of the "DllStructCreate()" calls in this??? Share this post Link to post Share on other sites
Dae 0 Report post Posted January 7, 2007 What are the use of the "DllStructCreate()" calls in this???3 parameters require a struct. So you use that to create a struct, give it the data it needs, then get the pointer of that struct for the parameter. Look at the links. Share this post Link to post Share on other sites