Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | // |
michael@0 | 2 | // Copyright (C) Anders Kjersem. Licensed under the zlib/libpng license |
michael@0 | 3 | // |
michael@0 | 4 | |
michael@0 | 5 | #if (defined(_MSC_VER) && !defined(_DEBUG)) |
michael@0 | 6 | #pragma comment(linker,"/opt:nowin98") |
michael@0 | 7 | #pragma comment(linker,"/ignore:4078") |
michael@0 | 8 | #pragma comment(linker,"/merge:.rdata=.text") |
michael@0 | 9 | #endif |
michael@0 | 10 | |
michael@0 | 11 | #ifdef UNICODE |
michael@0 | 12 | # ifndef _UNICODE |
michael@0 | 13 | # define _UNICODE |
michael@0 | 14 | # endif |
michael@0 | 15 | #endif |
michael@0 | 16 | |
michael@0 | 17 | #define _WIN32_WINNT 0x0400 |
michael@0 | 18 | #include <windows.h> |
michael@0 | 19 | #include <tchar.h> |
michael@0 | 20 | #include <wininet.h> |
michael@0 | 21 | |
michael@0 | 22 | #if defined(_DEBUG) || 0 |
michael@0 | 23 | # define PLUGIN_DEBUG 1 |
michael@0 | 24 | void MYTRACE(LPCTSTR fmt, ...) |
michael@0 | 25 | { |
michael@0 | 26 | va_list argptr; |
michael@0 | 27 | va_start(argptr, fmt); |
michael@0 | 28 | TCHAR buffer[2048] = { _T('\0') }; |
michael@0 | 29 | wvsprintf(buffer, fmt, argptr); |
michael@0 | 30 | buffer[(sizeof(buffer)/sizeof(*buffer)) - 1] = _T('\0'); |
michael@0 | 31 | OutputDebugString(buffer); |
michael@0 | 32 | va_end(argptr); |
michael@0 | 33 | } |
michael@0 | 34 | #else |
michael@0 | 35 | void MYTRACE(...) { } |
michael@0 | 36 | #endif |
michael@0 | 37 | # define TRACE MYTRACE |
michael@0 | 38 | |
michael@0 | 39 | #ifndef ASSERT |
michael@0 | 40 | # define ASSERT(x) |
michael@0 | 41 | #endif |
michael@0 | 42 | |
michael@0 | 43 | #define NSISPIEXPORTFUNC EXTERN_C void __declspec(dllexport) __cdecl |
michael@0 | 44 | |
michael@0 | 45 | namespace NSIS { |
michael@0 | 46 | |
michael@0 | 47 | #define NSISCALL __stdcall |
michael@0 | 48 | typedef struct _xparams_t { |
michael@0 | 49 | LPVOID xx1;//exec_flags_type *exec_flags; |
michael@0 | 50 | int (NSISCALL *ExecuteCodeSegment)(int, HWND); |
michael@0 | 51 | void (NSISCALL *validate_filename)(TCHAR*); |
michael@0 | 52 | int (NSISCALL *RegisterPluginCallback)(HMODULE,LPVOID); |
michael@0 | 53 | } xparams_t; |
michael@0 | 54 | typedef struct _stack_t { |
michael@0 | 55 | struct _stack_t *next; |
michael@0 | 56 | TCHAR text[1]; |
michael@0 | 57 | } stack_t; |
michael@0 | 58 | |
michael@0 | 59 | } // namespace NSIS |
michael@0 | 60 | |
michael@0 | 61 | enum NSPIM |
michael@0 | 62 | { |
michael@0 | 63 | NSPIM_UNLOAD, |
michael@0 | 64 | NSPIM_GUIUNLOAD, |
michael@0 | 65 | }; |