other-licenses/nsis/Contrib/InetBgDL/InetBgDL.h

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

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

mercurial