other-licenses/nsis/Contrib/ExDLL/exdll.c

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 // Unicode support by Jim Park -- 08/02/2007
michael@0 2
michael@0 3 #include <windows.h>
michael@0 4 #include "tchar.h"
michael@0 5 #include "exdll.h"
michael@0 6
michael@0 7 HINSTANCE g_hInstance;
michael@0 8
michael@0 9 HWND g_hwndParent;
michael@0 10
michael@0 11 // To work with Unicode version of NSIS, please use TCHAR-type
michael@0 12 // functions for accessing the variables and the stack.
michael@0 13
michael@0 14 void __declspec(dllexport) myFunction(HWND hwndParent, int string_size,
michael@0 15 TCHAR *variables, stack_t **stacktop,
michael@0 16 extra_parameters *extra)
michael@0 17 {
michael@0 18 g_hwndParent=hwndParent;
michael@0 19
michael@0 20 EXDLL_INIT();
michael@0 21
michael@0 22
michael@0 23 // note if you want parameters from the stack, pop them off in order.
michael@0 24 // i.e. if you are called via exdll::myFunction file.dat poop.dat
michael@0 25 // calling popstring() the first time would give you file.dat,
michael@0 26 // and the second time would give you poop.dat.
michael@0 27 // you should empty the stack of your parameters, and ONLY your
michael@0 28 // parameters.
michael@0 29
michael@0 30 // do your stuff here
michael@0 31 {
michael@0 32 TCHAR buf[1024];
michael@0 33 wsprintf(buf,_T("$0=%s\n"),getuservariable(INST_0));
michael@0 34 MessageBox(g_hwndParent,buf,0,MB_OK);
michael@0 35 }
michael@0 36 }
michael@0 37
michael@0 38
michael@0 39
michael@0 40 BOOL WINAPI DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)
michael@0 41 {
michael@0 42 g_hInstance=hInst;
michael@0 43 return TRUE;
michael@0 44 }

mercurial