Serial key check with standalone DLL file - NSIS => Prototype => Pascal conversion function

Could you help me create a Serial Check function that is based on a DLL file? Unfortunately, I do not have a functional prototype.

I have a version of the NSIS function:

SetOutPath $PLUGINSDIR
  File "serialtest.dll"
   System::Call "serialtest::_sn_serialtest(t r1) i .r2 ?u"
  ${If} $2 == 0
   Messagebox MB_OK|MB_ICONSTOP \
    "Invalid Serial Number!"
   Abort
  ${Endif}

t - text, string (LPCSTR, pointer to the first character)

r1-r9- This is $ 1- $ 9 for NSIS (can be entered or displayed). In this case, r1 is $ 1, and $ 1 is a serial number with delimiters '-'.

i - int (includes char, byte, short, descriptors, pointers, etc.)

. - means no input

u - unload DLL

Additional Information: NSIS Script is written in ANSI, and I am using the Unicode version of Inno Setup.

, " ". : CustomPage Inno Setup

+3
2

NSIS, script:

serialtest::_sn_serialtest(t r1) i .r2 ?u

:

serialtest.dll - ,
t - , LPCSTR - ( )

, :

int _sn_serialtest(
  __in LPCSTR sn
);

, , , , , C ( NSIS, Googled), , , cdecl, , , :

function _sn_serialtest(sn: AnsiString): Integer;
  external '_sn_serialtest@files:serialtest.dll cdecl';
+2

, , :

NSIS cdecl , System:: Call stdcall, WinAPI. ( cdecl ?c )

t NSIS, - char*, unicode WCHAR* (t TCHAR, w m WCHAR char).

C int WINAPI _sn_serialtest(LPCTSTR); LPCTSTR= LPCSTR WINAPI= __stdcall.

+2

All Articles