tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

exdll.c (1189B)


      1 // Unicode support by Jim Park -- 08/02/2007
      2 
      3 #include <windows.h>
      4 #include "tchar.h"
      5 #include "exdll.h"
      6 
      7 HINSTANCE g_hInstance;
      8 
      9 HWND g_hwndParent;
     10 
     11 // To work with Unicode version of NSIS, please use TCHAR-type
     12 // functions for accessing the variables and the stack.
     13 
     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;
     19 
     20  EXDLL_INIT();
     21 
     22 
     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.
     29 
     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 }
     37 
     38 
     39 
     40 BOOL WINAPI DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)
     41 {
     42  g_hInstance=hInst;
     43 return TRUE;
     44 }