|
|
#1 |
|
Junior Member
Join Date: May 2004
Location: Norway
Posts: 2
|
Calling a dll to encrypt a password
I'm trying to get my script to take input from a password box and then pass it to a dll which contains a function that encrypts it. The prototype for the (Delphi) function is this: function IDPEncryptPassword(P: PChar; var MaxLen: integer): LongBool;
However, when the function returns it has not changed the original string, and the debug info prints this. The int I pass into the function has also not changed size (stays 1024). Could anyone please help me out with what I'm doing wrong? I'm an NSIS newbie and don't really have the skills to spot what I'm doing wrong (yet . The relevant section is this:;the relevant dll's have been loaded just before this ; read the entered value ReadIniStr $4 "$PLUGINSDIR\userpass.ini" "Field 3" "State" WriteINIStr "C:\Infront\IDP\IDP.ini" "Funccall" "Password before" $4 SetPluginUnload alwaysoff StrCpy $5 ${NSIS_MAX_STRLEN} ; just print out debug info WriteINIStr "C:\Infront\IDP\IDP.ini" "Funccall" "intsize before" $5 /* This is the problem area!!! */ System::Call 'IDPGenPwd::IDPEncryptPassword(t .r4, *i r5r5)i .r6' ; This is where it's supposed to write the encrypted password WriteINIStr "C:\Infront\IDP\IDP.ini" "IAS" "Password" $4 ; Debug info WriteINIStr "C:\Infront\IDP\IDP.ini" "Funccall" "Error code" $6 WriteINIStr "C:\Infront\IDP\IDP.ini" "Funccall" "intsize" $5 SetPluginUnload manual System::Free 0 Attached is the complete script. Any help is highly appreciated!! |
|
|
|
|
|
#2 |
|
Major Dude
|
The input will always be returned if an output part doesn't return or if you don't specify to output a value. In this case, you used $5 as input.
If you're expecting an output, you should put a "." before the variable r5 (on System plugin call). Or if you're expecting an input and an output, you should put two variables (on System plugin call) with a "." before the second one. I'll show what is my point with the correct code (I think, as you explained): code: |
|
|
|
|
|
#3 | |
|
Junior Member
Join Date: May 2004
Location: Norway
Posts: 2
|
Quote:
|
|
|
|
|
|
|
#4 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
That's not exact deguix. Please refer to the new System documentation:
http://nsis.sf.net/System.html NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|