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.

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

mercurial