Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 13th June 2007, 18:34   #1
windsor_gabe
Junior Member
 
Join Date: Jun 2007
Posts: 4
plugin function signature

First time post!

I've been using NSIS for a few days now and I'm creating my first plugin (using VC++). I looked at the exdll.h file, and also at some of the Contrib plugins (InstallOptions, etc).

The plugin functions in InstallOptions use 4 parameters, but the example plugin function in exdll.c uses 5 (the same 4 plus an 'extra_parameters').

Which one is correct? I'm assuming that the exdll.c function is up-to-date and the other ones are just old, but in that case how do those plugins still work?
windsor_gabe is offline   Reply With Quote
Old 13th June 2007, 18:42   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,338
Newer plug-ins that need the fifth parameter use it. Older plug-ins that don't need it, simply don't use it.

The functions use cdecl calling convention so its the caller's responsibility to clear the stack after the function returns. So the caller, the installer in this case, can pass as many extra arguments as it wants without affecting older plug-ins.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 13th June 2007, 18:46   #3
windsor_gabe
Junior Member
 
Join Date: Jun 2007
Posts: 4
Thanks that really help...and thanks for the quick reply!
windsor_gabe is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump