Added another parameter to plug-in functions. This parameter is a structure with pointers to exec_flags and ExecuteCodeSegment. This is backward compatible with older plug-ins because plug-in functions use the __cdecl calling convention which means NSIS clears the stack.

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3751 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2004-10-23 17:43:08 +00:00
parent 54eca79ebf
commit 89d3581649
5 changed files with 39 additions and 6 deletions

View file

@ -26,6 +26,14 @@ static stack_t *g_st;
exec_flags g_exec_flags;
struct {
exec_flags *flags;
void *ExecuteCodeSegment;
} plugin_extra_parameters = {
&g_exec_flags,
&ExecuteCodeSegment
};
#if defined(NSIS_SUPPORT_ACTIVEXREG) || defined(NSIS_SUPPORT_CREATESHORTCUT)
HRESULT g_hres;
#endif
@ -924,17 +932,18 @@ static int NSISCALL ExecuteEntry(entry *entry_)
}
else
{
void (*func)(HWND,int,char*,void*);
void (*func)(HWND,int,char*,void*,void*);
func=(void*)funke;
func(
g_hwnd,
NSIS_MAX_STRLEN,
(char*)g_usrvars,
#ifdef NSIS_SUPPORT_STACK
(void*)&g_st
(void*)&g_st,
#else
NULL
NULL,
#endif//NSIS_SUPPORT_STACK
&plugin_extra_parameters
);
}
}