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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/other-licenses/nsis/Contrib/InetBgDL/InetBgDL.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,65 @@
     1.4 +//
     1.5 +// Copyright (C) Anders Kjersem. Licensed under the zlib/libpng license
     1.6 +//
     1.7 +
     1.8 +#if (defined(_MSC_VER) && !defined(_DEBUG))
     1.9 +  #pragma comment(linker,"/opt:nowin98")
    1.10 +  #pragma comment(linker,"/ignore:4078")
    1.11 +  #pragma comment(linker,"/merge:.rdata=.text")
    1.12 +#endif
    1.13 +
    1.14 +#ifdef UNICODE
    1.15 +# ifndef _UNICODE
    1.16 +#    define _UNICODE
    1.17 +#  endif
    1.18 +#endif
    1.19 +
    1.20 +#define _WIN32_WINNT 0x0400
    1.21 +#include <windows.h>
    1.22 +#include <tchar.h>
    1.23 +#include <wininet.h>
    1.24 +
    1.25 +#if defined(_DEBUG) || 0
    1.26 +#  define PLUGIN_DEBUG 1
    1.27 +void MYTRACE(LPCTSTR fmt, ...)
    1.28 +{
    1.29 +  va_list argptr;
    1.30 +  va_start(argptr, fmt);
    1.31 +  TCHAR buffer[2048] = { _T('\0') };
    1.32 +  wvsprintf(buffer, fmt, argptr);
    1.33 +  buffer[(sizeof(buffer)/sizeof(*buffer)) - 1] = _T('\0');
    1.34 +  OutputDebugString(buffer);
    1.35 +  va_end(argptr);
    1.36 +}
    1.37 +#else
    1.38 +void MYTRACE(...) { }
    1.39 +#endif
    1.40 +#  define TRACE MYTRACE
    1.41 +
    1.42 +#ifndef ASSERT
    1.43 +#  define ASSERT(x)
    1.44 +#endif
    1.45 +
    1.46 +#define NSISPIEXPORTFUNC EXTERN_C void __declspec(dllexport) __cdecl
    1.47 +
    1.48 +namespace NSIS {
    1.49 +
    1.50 +#define NSISCALL __stdcall
    1.51 +typedef struct _xparams_t {
    1.52 +  LPVOID xx1;//exec_flags_type *exec_flags;
    1.53 +  int (NSISCALL *ExecuteCodeSegment)(int, HWND);
    1.54 +  void (NSISCALL *validate_filename)(TCHAR*);
    1.55 +  int (NSISCALL *RegisterPluginCallback)(HMODULE,LPVOID);
    1.56 +} xparams_t;
    1.57 +typedef struct _stack_t {
    1.58 +  struct _stack_t *next;
    1.59 +  TCHAR text[1];
    1.60 +} stack_t;
    1.61 +
    1.62 +} // namespace NSIS
    1.63 +
    1.64 +enum NSPIM 
    1.65 +{
    1.66 +  NSPIM_UNLOAD,
    1.67 +  NSPIM_GUIUNLOAD,
    1.68 +};

mercurial