applied patch #1912699 - "Pinned" / always loaded plugins support

this patch also adds plugin_api_version to exec_flags so your plug-in can now tell if features it needs are available
more plug-ins that need this will be converted once the patch to make both the stubs and the plug-ins use the same header file is in place

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5809 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2008-11-29 22:03:33 +00:00
parent 9ac4ab0891
commit 4c30821aa5
10 changed files with 173 additions and 7 deletions

View file

@ -36,11 +36,23 @@ INST_LANG, // $LANGUAGE
__INST_LAST
};
#define PLUGINFUNCTION(name) void __declspec(dllexport) name(HWND hwndParent, int string_size, char *variables, stack_t **stacktop) { \
/* g_hwndParent=hwndParent; */\
typedef UINT_PTR (*NSISPLUGINCALLBACK)(UINT);
typedef struct {
void *exec_flags;
int (__stdcall *ExecuteCodeSegment)(int, HWND);
void (__stdcall *validate_filename)(char *);
BOOL (__stdcall *RegisterPluginCallback)(HMODULE, NSISPLUGINCALLBACK);
} extra_parameters;
#define PLUGINFUNCTION(name) \
void __declspec(dllexport) name( \
HWND hwndParent, int string_size, char *variables, stack_t **stacktop, extra_parameters *extra) { \
/*g_hwndParent=hwndParent;*/ \
g_stringsize=string_size; \
g_stacktop=stacktop; \
g_variables=variables;
g_variables=variables; \
extra->RegisterPluginCallback(g_hInstance, NSISCallback);
#define PLUGINFUNCTIONEND }
#define PLUGINFUNCTIONSHORT(name) void __declspec(dllexport) name(HWND hwndParent, int string_size, char *variables, stack_t **stacktop) { \
@ -61,9 +73,12 @@ extern void pushint(int value);
extern HANDLE GlobalCopy(HANDLE Old);
extern char *copymem(char *output, char *input, int size);
extern UINT_PTR NSISCallback(UINT);
extern HWND g_hwndParent;
extern int g_stringsize;
extern stack_t **g_stacktop;
extern char *g_variables;
extern HINSTANCE g_hInstance;
#endif