Unable to correctly call a dll using system.dll
Hello,
During my installation flow, I need to check if a cd-key entered by end-user is valid (cd-key is get by a custom page into an ini file). I do it by using a dll.
The dll prototype is:
prototype cdecl BOOL MiscHelper.IsValid(BYVAL STRING, BYREF STRING);
the C prototype is:
typedef DWORD (__cdelc *IsValid) (const char*, const char*);
So the dll name is "MiscHelp.dll" and the exported function to call is "IsValid"
Here is my NSIS code to call the dll (within the main section)
SetOutPath "$PLUGINSDIR"
File "MiscHelper.dll"
ReadINIStr $0 "$PLUGINSDIR\MPkeysRetrieveTest.ini" "Field 1" "State"
StrCpy $1 "timeshift"
System::call "MiscHelper::IsValid(*t, *t) i(r1, r0).r8 ?e"
$1 is a seed name
$0 stores the key to check (and work)
My issue is that the return ($8) is always "0", whatsoever the key is valid or not. If I choose "b" or "t" for return type, I got no return at all.
Notice I've tested the dll with an Installshield script and it does work... but I really need to use NSIS and not IS.