ReactOS  0.4.13-dev-92-gf251225
main.c File Reference
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include <sys/types.h>
#include "windef.h"
#include "winbase.h"
#include "winsock2.h"
#include "ws2ipdef.h"
#include "winnls.h"
#include "wininet.h"
#include "ole2.h"
#include "dispex.h"
#include "activscp.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/unicode.h"
Include dependency graph for main.c:

Go to the source code of this file.

Classes

struct  pac_script
 

Macros

#define closesocket   close
 
#define ioctlsocket   ioctl
 
#define USE_WS_PREFIX
 
#define COBJMACROS
 
#define DISPID_GLOBAL_DNSRESOLVE   0x1000
 
#define IActiveScriptParse_Release   IActiveScriptParse32_Release
 
#define IActiveScriptParse_InitNew   IActiveScriptParse32_InitNew
 
#define IActiveScriptParse_ParseScriptText   IActiveScriptParse32_ParseScriptText
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (jsproxy)
 
BOOL WINAPI DllMain (HINSTANCE hinst, DWORD reason, LPVOID reserved)
 
static WCHARstrdupAW (const char *src, int len)
 
static charstrdupWA (const WCHAR *src)
 
BOOL WINAPI InternetDeInitializeAutoProxyDll (LPSTR mime, DWORD reserved)
 
static WCHARload_script (const char *filename)
 
BOOL WINAPI JSPROXY_InternetInitializeAutoProxyDll (DWORD version, LPSTR tmpfile, LPSTR mime, AutoProxyHelperFunctions *callbacks, LPAUTO_PROXY_SCRIPT_BUFFER buffer)
 
static HRESULT WINAPI dispex_QueryInterface (IDispatchEx *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI dispex_AddRef (IDispatchEx *iface)
 
static ULONG WINAPI dispex_Release (IDispatchEx *iface)
 
static HRESULT WINAPI dispex_GetTypeInfoCount (IDispatchEx *iface, UINT *info)
 
static HRESULT WINAPI dispex_GetTypeInfo (IDispatchEx *iface, UINT info, LCID lcid, ITypeInfo **type_info)
 
static HRESULT WINAPI dispex_GetIDsOfNames (IDispatchEx *iface, REFIID riid, LPOLESTR *names, UINT count, LCID lcid, DISPID *id)
 
static HRESULT WINAPI dispex_Invoke (IDispatchEx *iface, DISPID member, REFIID riid, LCID lcid, WORD flags, DISPPARAMS *params, VARIANT *result, EXCEPINFO *excep, UINT *err)
 
static HRESULT WINAPI dispex_DeleteMemberByName (IDispatchEx *iface, BSTR name, DWORD flags)
 
static HRESULT WINAPI dispex_DeleteMemberByDispID (IDispatchEx *iface, DISPID id)
 
static HRESULT WINAPI dispex_GetMemberProperties (IDispatchEx *iface, DISPID id, DWORD flags_fetch, DWORD *flags)
 
static HRESULT WINAPI dispex_GetMemberName (IDispatchEx *iface, DISPID id, BSTR *name)
 
static HRESULT WINAPI dispex_GetNextDispID (IDispatchEx *iface, DWORD flags, DISPID id, DISPID *next)
 
static HRESULT WINAPI dispex_GetNameSpaceParent (IDispatchEx *iface, IUnknown **unk)
 
static HRESULT WINAPI dispex_GetDispID (IDispatchEx *iface, BSTR name, DWORD flags, DISPID *id)
 
static charget_computer_name (COMPUTER_NAME_FORMAT format)
 
static void printf_addr (const WCHAR *fmt, WCHAR *buf, struct sockaddr_in *addr)
 
static HRESULT dns_resolve (const WCHAR *hostname, VARIANT *result)
 
static HRESULT WINAPI dispex_InvokeEx (IDispatchEx *iface, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params, VARIANT *result, EXCEPINFO *exep, IServiceProvider *caller)
 
static HRESULT WINAPI site_QueryInterface (IActiveScriptSite *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI site_AddRef (IActiveScriptSite *iface)
 
static ULONG WINAPI site_Release (IActiveScriptSite *iface)
 
static HRESULT WINAPI site_GetLCID (IActiveScriptSite *iface, LCID *lcid)
 
static HRESULT WINAPI site_GetItemInfo (IActiveScriptSite *iface, LPCOLESTR name, DWORD mask, IUnknown **item, ITypeInfo **type_info)
 
static HRESULT WINAPI site_GetDocVersionString (IActiveScriptSite *iface, BSTR *version)
 
static HRESULT WINAPI site_OnScriptTerminate (IActiveScriptSite *iface, const VARIANT *result, const EXCEPINFO *info)
 
static HRESULT WINAPI site_OnStateChange (IActiveScriptSite *iface, SCRIPTSTATE state)
 
static HRESULT WINAPI site_OnScriptError (IActiveScriptSite *iface, IActiveScriptError *error)
 
static HRESULT WINAPI site_OnEnterScript (IActiveScriptSite *iface)
 
static HRESULT WINAPI site_OnLeaveScript (IActiveScriptSite *iface)
 
static BSTR include_pac_utils (const WCHAR *script)
 
static BOOL run_script (const WCHAR *script, const WCHAR *url, const WCHAR *hostname, char **result_str, DWORD *result_len)
 
BOOL WINAPI InternetGetProxyInfo (LPCSTR url, DWORD len_url, LPCSTR hostname, DWORD len_hostname, LPSTR *proxy, LPDWORD len_proxy)
 

Variables

static HINSTANCE instance
 
static CRITICAL_SECTION cs_jsproxy = { &critsect_debug, -1, 0, 0, 0, 0 }
 
static CRITICAL_SECTION_DEBUG critsect_debug
 
static const WCHAR global_funcsW [] = {'g','l','o','b','a','l','_','f','u','n','c','s',0}
 
static const WCHAR dns_resolveW [] = {'d','n','s','_','r','e','s','o','l','v','e',0}
 
static struct pac_script pac_script
 
static struct pac_scriptglobal_script = &pac_script
 
static const IDispatchExVtbl dispex_vtbl
 
static IDispatchEx global_dispex = { &dispex_vtbl }
 
static const IActiveScriptSiteVtbl site_vtbl
 
static IActiveScriptSite script_site = { &site_vtbl }
 

Macro Definition Documentation

◆ closesocket

#define closesocket   close

Definition at line 39 of file main.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 53 of file main.c.

◆ DISPID_GLOBAL_DNSRESOLVE

#define DISPID_GLOBAL_DNSRESOLVE   0x1000

Definition at line 295 of file main.c.

◆ IActiveScriptParse_InitNew

#define IActiveScriptParse_InitNew   IActiveScriptParse32_InitNew

Definition at line 530 of file main.c.

◆ IActiveScriptParse_ParseScriptText

#define IActiveScriptParse_ParseScriptText   IActiveScriptParse32_ParseScriptText

Definition at line 531 of file main.c.

◆ IActiveScriptParse_Release

#define IActiveScriptParse_Release   IActiveScriptParse32_Release

Definition at line 529 of file main.c.

◆ ioctlsocket

#define ioctlsocket   ioctl

Definition at line 40 of file main.c.

◆ USE_WS_PREFIX

#define USE_WS_PREFIX

Definition at line 46 of file main.c.

Function Documentation

◆ dispex_AddRef()

static ULONG WINAPI dispex_AddRef ( IDispatchEx *  iface)
static

Definition at line 222 of file main.c.

224 {
225  return 2;
226 }

◆ dispex_DeleteMemberByDispID()

static HRESULT WINAPI dispex_DeleteMemberByDispID ( IDispatchEx *  iface,
DISPID  id 
)
static

Definition at line 265 of file main.c.

267 {
268  return E_NOTIMPL;
269 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ dispex_DeleteMemberByName()

static HRESULT WINAPI dispex_DeleteMemberByName ( IDispatchEx *  iface,
BSTR  name,
DWORD  flags 
)
static

Definition at line 259 of file main.c.

261 {
262  return E_NOTIMPL;
263 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ dispex_GetDispID()

static HRESULT WINAPI dispex_GetDispID ( IDispatchEx *  iface,
BSTR  name,
DWORD  flags,
DISPID id 
)
static

Definition at line 297 of file main.c.

299 {
300  if (!strcmpW( name, dns_resolveW ))
301  {
303  return S_OK;
304  }
305  return DISP_E_UNKNOWNNAME;
306 }
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
#define DISPID_GLOBAL_DNSRESOLVE
Definition: main.c:295
#define S_OK
Definition: intsafe.h:59
Definition: name.c:36
WINE_UNICODE_INLINE int strcmpW(const WCHAR *str1, const WCHAR *str2)
Definition: unicode.h:229
static const WCHAR dns_resolveW[]
Definition: main.c:76

◆ dispex_GetIDsOfNames()

static HRESULT WINAPI dispex_GetIDsOfNames ( IDispatchEx *  iface,
REFIID  riid,
LPOLESTR names,
UINT  count,
LCID  lcid,
DISPID id 
)
static

Definition at line 246 of file main.c.

248 {
249  return E_NOTIMPL;
250 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ dispex_GetMemberName()

static HRESULT WINAPI dispex_GetMemberName ( IDispatchEx *  iface,
DISPID  id,
BSTR name 
)
static

Definition at line 277 of file main.c.

279 {
280  return E_NOTIMPL;
281 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ dispex_GetMemberProperties()

static HRESULT WINAPI dispex_GetMemberProperties ( IDispatchEx *  iface,
DISPID  id,
DWORD  flags_fetch,
DWORD flags 
)
static

Definition at line 271 of file main.c.

273 {
274  return E_NOTIMPL;
275 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ dispex_GetNameSpaceParent()

static HRESULT WINAPI dispex_GetNameSpaceParent ( IDispatchEx *  iface,
IUnknown **  unk 
)
static

Definition at line 289 of file main.c.

291 {
292  return E_NOTIMPL;
293 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ dispex_GetNextDispID()

static HRESULT WINAPI dispex_GetNextDispID ( IDispatchEx *  iface,
DWORD  flags,
DISPID  id,
DISPID next 
)
static

Definition at line 283 of file main.c.

285 {
286  return E_NOTIMPL;
287 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ dispex_GetTypeInfo()

static HRESULT WINAPI dispex_GetTypeInfo ( IDispatchEx *  iface,
UINT  info,
LCID  lcid,
ITypeInfo **  type_info 
)
static

Definition at line 240 of file main.c.

242 {
243  return E_NOTIMPL;
244 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ dispex_GetTypeInfoCount()

static HRESULT WINAPI dispex_GetTypeInfoCount ( IDispatchEx *  iface,
UINT info 
)
static

Definition at line 234 of file main.c.

236 {
237  return E_NOTIMPL;
238 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ dispex_Invoke()

static HRESULT WINAPI dispex_Invoke ( IDispatchEx *  iface,
DISPID  member,
REFIID  riid,
LCID  lcid,
WORD  flags,
DISPPARAMS *  params,
VARIANT result,
EXCEPINFO *  excep,
UINT err 
)
static

Definition at line 252 of file main.c.

255 {
256  return E_NOTIMPL;
257 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ dispex_InvokeEx()

static HRESULT WINAPI dispex_InvokeEx ( IDispatchEx *  iface,
DISPID  id,
LCID  lcid,
WORD  flags,
DISPPARAMS *  params,
VARIANT result,
EXCEPINFO *  exep,
IServiceProvider caller 
)
static

Definition at line 370 of file main.c.

373 {
374  if (id == DISPID_GLOBAL_DNSRESOLVE)
375  {
376  if (params->cArgs != 1) return DISP_E_BADPARAMCOUNT;
377  if (V_VT(&params->rgvarg[0]) != VT_BSTR) return DISP_E_BADVARTYPE;
378  return dns_resolve( V_BSTR(&params->rgvarg[0]), result );
379  }
380  return DISP_E_MEMBERNOTFOUND;
381 }
static HRESULT dns_resolve(const WCHAR *hostname, VARIANT *result)
Definition: main.c:333
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
#define DISPID_GLOBAL_DNSRESOLVE
Definition: main.c:295
GLenum const GLfloat * params
Definition: glext.h:5645
#define DISP_E_BADVARTYPE
Definition: winerror.h:2517
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define DISP_E_BADPARAMCOUNT
Definition: winerror.h:2523
GLuint64EXT * result
Definition: glext.h:11304

◆ dispex_QueryInterface()

static HRESULT WINAPI dispex_QueryInterface ( IDispatchEx *  iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 207 of file main.c.

209 {
210  *ppv = NULL;
211 
212  if (IsEqualGUID( riid, &IID_IUnknown ) ||
214  IsEqualGUID( riid, &IID_IDispatchEx ))
215  *ppv = iface;
216  else
217  return E_NOINTERFACE;
218 
219  return S_OK;
220 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
const GUID IID_IDispatch
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

◆ dispex_Release()

static ULONG WINAPI dispex_Release ( IDispatchEx *  iface)
static

Definition at line 228 of file main.c.

230 {
231  return 1;
232 }

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hinst,
DWORD  reason,
LPVOID  reserved 
)

Definition at line 81 of file main.c.

82 {
83  switch (reason)
84  {
85  case DLL_PROCESS_ATTACH:
86  instance = hinst;
88  break;
89 
90  case DLL_PROCESS_DETACH:
91  break;
92  }
93  return TRUE;
94 }
#define TRUE
Definition: types.h:120
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
#define DLL_PROCESS_DETACH
Definition: compat.h:119
static HINSTANCE instance
Definition: main.c:62
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1904
static HINSTANCE hinst
Definition: edit.c:551

◆ dns_resolve()

static HRESULT dns_resolve ( const WCHAR hostname,
VARIANT result 
)
static

Definition at line 333 of file main.c.

334 {
335 #ifdef HAVE_GETADDRINFO
336  static const WCHAR fmtW[] = {'%','u','.','%','u','.','%','u','.','%','u',0};
337  WCHAR addr[16];
338  struct addrinfo *ai, *elem;
339  char *hostnameA;
340  int res;
341 
342  if (hostname[0])
343  hostnameA = strdupWA( hostname );
344  else
345  hostnameA = get_computer_name( ComputerNamePhysicalDnsFullyQualified );
346 
347  if (!hostnameA) return E_OUTOFMEMORY;
348  res = getaddrinfo( hostnameA, NULL, NULL, &ai );
349  heap_free( hostnameA );
350  if (res) return S_FALSE;
351 
352  elem = ai;
353  while (elem && elem->ai_family != AF_INET) elem = elem->ai_next;
354  if (!elem)
355  {
356  freeaddrinfo( ai );
357  return S_FALSE;
358  }
359  printf_addr( fmtW, addr, (struct sockaddr_in *)elem->ai_addr );
360  freeaddrinfo( ai );
361  V_VT( result ) = VT_BSTR;
363  return S_OK;
364 #else
365  FIXME("getaddrinfo not found at build time\n");
366  return S_FALSE;
367 #endif
368 }
#define freeaddrinfo
Definition: wspiapi.h:46
char * hostname
Definition: ftp.c:88
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static size_t elem
Definition: string.c:68
#define FIXME(fmt,...)
Definition: debug.h:110
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
__wchar_t WCHAR
Definition: xmlstorage.h:180
static char * get_computer_name(COMPUTER_NAME_FORMAT format)
Definition: main.c:308
GLenum const GLvoid * addr
Definition: glext.h:9621
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define S_OK
Definition: intsafe.h:59
static char * strdupWA(const WCHAR *src)
Definition: main.c:111
static void printf_addr(const WCHAR *fmt, WCHAR *buf, struct sockaddr_in *addr)
Definition: main.c:324
GLuint res
Definition: glext.h:9613
#define AF_INET
Definition: tcpip.h:117
GLuint64EXT * result
Definition: glext.h:11304
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
#define getaddrinfo
Definition: wspiapi.h:44

Referenced by dispex_InvokeEx().

◆ get_computer_name()

static char* get_computer_name ( COMPUTER_NAME_FORMAT  format)
static

Definition at line 308 of file main.c.

309 {
310  char *ret;
311  DWORD size = 0;
312 
314  if (GetLastError() != ERROR_MORE_DATA) return NULL;
315  if (!(ret = heap_alloc( size ))) return NULL;
316  if (!GetComputerNameExA( format, ret, &size ))
317  {
318  heap_free( ret );
319  return NULL;
320  }
321  return ret;
322 }
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
BOOL WINAPI GetComputerNameExA(COMPUTER_NAME_FORMAT, LPSTR, LPDWORD)
Definition: compname.c:370
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
#define ERROR_MORE_DATA
Definition: dderror.h:13
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by dns_resolve().

◆ include_pac_utils()

static BSTR include_pac_utils ( const WCHAR script)
static

Definition at line 503 of file main.c.

504 {
505  static const WCHAR pacjsW[] = {'p','a','c','.','j','s',0};
506  HMODULE hmod = GetModuleHandleA( "jsproxy.dll" );
507  HRSRC rsrc;
508  DWORD size;
509  const char *data;
510  BSTR ret;
511  int len;
512 
513  if (!(rsrc = FindResourceW( hmod, pacjsW, (LPCWSTR)40 ))) return NULL;
514  size = SizeofResource( hmod, rsrc );
515  data = LoadResource( hmod, rsrc );
516 
517  len = MultiByteToWideChar( CP_ACP, 0, data, size, NULL, 0 );
518  if (!(ret = SysAllocStringLen( NULL, len + strlenW( script ) + 1 ))) return NULL;
520  strcpyW( ret + len, script );
521  return ret;
522 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:342
#define CP_ACP
Definition: compat.h:99
OLECHAR * BSTR
Definition: compat.h:1934
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
smooth NULL
Definition: ftsmooth.c:416
script
Definition: msipriv.h:374
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int ret
GLenum GLsizei len
Definition: glext.h:6722
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:819
static PEXPLICIT_ACCESSW *static HMODULE hmod
Definition: security.c:141
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
#define MultiByteToWideChar
Definition: compat.h:100

Referenced by run_script().

◆ InternetDeInitializeAutoProxyDll()

BOOL WINAPI InternetDeInitializeAutoProxyDll ( LPSTR  mime,
DWORD  reserved 
)

Definition at line 131 of file main.c.

132 {
133  TRACE( "%s, %u\n", debugstr_a(mime), reserved );
134 
136 
137  heap_free( global_script->text );
138  global_script->text = NULL;
139 
141  return TRUE;
142 }
#define TRUE
Definition: types.h:120
const WCHAR * mime
Definition: mimefilter.c:512
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static struct pac_script * global_script
Definition: main.c:126
r reserved
Definition: btrfs.c:2655
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
static CRITICAL_SECTION cs_jsproxy
Definition: main.c:66
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by run_script().

◆ InternetGetProxyInfo()

BOOL WINAPI InternetGetProxyInfo ( LPCSTR  url,
DWORD  len_url,
LPCSTR  hostname,
DWORD  len_hostname,
LPSTR proxy,
LPDWORD  len_proxy 
)

Definition at line 623 of file main.c.

625 {
626  WCHAR *urlW = NULL, *hostnameW = NULL;
627  BOOL ret = FALSE;
628 
629  TRACE( "%s, %u, %s, %u, %p, %p\n", debugstr_a(url), len_url, hostname, len_hostname, proxy, len_proxy );
630 
632 
633  if (!global_script->text)
634  {
636  goto done;
637  }
638  if (hostname && len_hostname < strlen( hostname ))
639  {
641  goto done;
642  }
643  if (!(urlW = strdupAW( url, -1 ))) goto done;
644  if (hostname && !(hostnameW = strdupAW( hostname, -1 ))) goto done;
645 
646  TRACE( "%s\n", debugstr_w(global_script->text) );
647  ret = run_script( global_script->text, urlW, hostnameW, proxy, len_proxy );
648 
649 done:
650  heap_free( hostnameW );
651  heap_free( urlW );
653  return ret;
654 }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
static WCHAR * strdupAW(const char *src, int len)
Definition: main.c:96
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
char * hostname
Definition: ftp.c:88
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ERROR_CAN_NOT_COMPLETE
Definition: winerror.h:582
static struct pac_script * global_script
Definition: main.c:126
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
static BOOL run_script(const WCHAR *script, const WCHAR *url, const WCHAR *hostname, char **result_str, DWORD *result_len)
Definition: main.c:534
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
static const WCHAR url[]
Definition: encode.c:1432
#define SetLastError(x)
Definition: compat.h:409
int ret
static CRITICAL_SECTION cs_jsproxy
Definition: main.c:66
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
int proxy
Definition: main.c:67
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10

◆ JSPROXY_InternetInitializeAutoProxyDll()

BOOL WINAPI JSPROXY_InternetInitializeAutoProxyDll ( DWORD  version,
LPSTR  tmpfile,
LPSTR  mime,
AutoProxyHelperFunctions callbacks,
LPAUTO_PROXY_SCRIPT_BUFFER  buffer 
)

Definition at line 173 of file main.c.

176 {
177  BOOL ret = FALSE;
178 
179  TRACE( "%u, %s, %s, %p, %p\n", version, debugstr_a(tmpfile), debugstr_a(mime), callbacks, buffer );
180 
181  if (callbacks) FIXME( "callbacks not supported\n" );
182 
184 
185  if (buffer && buffer->dwStructSize == sizeof(*buffer) && buffer->lpszScriptBuffer)
186  {
187  if (!buffer->dwScriptBufferSize)
188  {
191  return FALSE;
192  }
193  heap_free( global_script->text );
194  if ((global_script->text = strdupAW( buffer->lpszScriptBuffer,
195  buffer->dwScriptBufferSize ))) ret = TRUE;
196  }
197  else
198  {
199  heap_free( global_script->text );
200  if ((global_script->text = load_script( tmpfile ))) ret = TRUE;
201  }
202 
204  return ret;
205 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define TRUE
Definition: types.h:120
const WCHAR * mime
Definition: mimefilter.c:512
static WCHAR * strdupAW(const char *src, int len)
Definition: main.c:96
GLuint buffer
Definition: glext.h:5915
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
unsigned int BOOL
Definition: ntddk_ex.h:94
static struct pac_script * global_script
Definition: main.c:126
#define FIXME(fmt,...)
Definition: debug.h:110
static const WCHAR version[]
Definition: asmname.c:64
_Check_return_ _CRTIMP FILE *__cdecl tmpfile(void)
Definition: file.c:3912
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
static WCHAR * load_script(const char *filename)
Definition: main.c:144
#define SetLastError(x)
Definition: compat.h:409
int ret
static CRITICAL_SECTION cs_jsproxy
Definition: main.c:66
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static int callbacks
Definition: xmllint.c:873
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ load_script()

static WCHAR* load_script ( const char filename)
static

Definition at line 144 of file main.c.

145 {
146  HANDLE handle;
147  DWORD size, bytes_read;
148  char *buffer;
149  int len;
150  WCHAR *script = NULL;
151 
153  if (handle == INVALID_HANDLE_VALUE) return NULL;
154 
155  size = GetFileSize( handle, NULL );
156  if (!(buffer = heap_alloc( size ))) goto done;
157  if (!ReadFile( handle, buffer, size, &bytes_read, NULL ) || bytes_read != size) goto done;
158 
160  if (!(script = heap_alloc( (len + 1) * sizeof(WCHAR) ))) goto done;
162  script[len] = 0;
163 
164 done:
165  CloseHandle( handle );
166  heap_free( buffer );
167  return script;
168 }
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define CloseHandle
Definition: compat.h:398
#define CP_ACP
Definition: compat.h:99
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
GLuint buffer
Definition: glext.h:5915
const char * filename
Definition: ioapi.h:135
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define FILE_SHARE_READ
Definition: compat.h:125
smooth NULL
Definition: ftsmooth.c:416
script
Definition: msipriv.h:374
#define OPEN_EXISTING
Definition: compat.h:426
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
Definition: fileinfo.c:481
GLenum GLsizei len
Definition: glext.h:6722
#define GENERIC_READ
Definition: compat.h:124
#define MultiByteToWideChar
Definition: compat.h:100
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:399
BOOL WINAPI ReadFile(IN HANDLE hFile, IN LPVOID lpBuffer, IN DWORD nNumberOfBytesToRead, OUT LPDWORD lpNumberOfBytesRead OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:123
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by JSPROXY_InternetInitializeAutoProxyDll().

◆ printf_addr()

static void printf_addr ( const WCHAR fmt,
WCHAR buf,
struct sockaddr_in addr 
)
static

Definition at line 324 of file main.c.

325 {
326  sprintfW( buf, fmt,
327  (unsigned int)(ntohl( addr->sin_addr.s_addr ) >> 24 & 0xff),
328  (unsigned int)(ntohl( addr->sin_addr.s_addr ) >> 16 & 0xff),
329  (unsigned int)(ntohl( addr->sin_addr.s_addr ) >> 8 & 0xff),
330  (unsigned int)(ntohl( addr->sin_addr.s_addr ) & 0xff) );
331 }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLenum const GLvoid * addr
Definition: glext.h:9621
#define sprintfW
Definition: unicode.h:58
Definition: dsound.c:943
#define ntohl(x)
Definition: module.h:203

Referenced by dns_resolve().

◆ run_script()

static BOOL run_script ( const WCHAR script,
const WCHAR url,
const WCHAR hostname,
char **  result_str,
DWORD result_len 
)
static

Definition at line 534 of file main.c.

535 {
536  static const WCHAR jscriptW[] = {'J','S','c','r','i','p','t',0};
537  static const WCHAR findproxyW[] = {'F','i','n','d','P','r','o','x','y','F','o','r','U','R','L',0};
538  IActiveScriptParse *parser = NULL;
539  IActiveScript *engine = NULL;
541  BOOL ret = FALSE;
542  CLSID clsid;
543  DISPID dispid;
544  BSTR func = NULL, full_script = NULL;
545  VARIANT args[2], retval;
547  HRESULT hr, init;
548 
549  init = CoInitialize( NULL );
550  hr = CLSIDFromProgID( jscriptW, &clsid );
551  if (hr != S_OK) goto done;
552 
553  hr = CoCreateInstance( &clsid, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
554  &IID_IActiveScript, (void **)&engine );
555  if (hr != S_OK) goto done;
556 
557  hr = IActiveScript_QueryInterface( engine, &IID_IActiveScriptParse, (void **)&parser );
558  if (hr != S_OK) goto done;
559 
561  if (hr != S_OK) goto done;
562 
563  hr = IActiveScript_SetScriptSite( engine, &script_site );
564  if (hr != S_OK) goto done;
565 
566  hr = IActiveScript_AddNamedItem( engine, global_funcsW, SCRIPTITEM_GLOBALMEMBERS );
567  if (hr != S_OK) goto done;
568 
569  if (!(full_script = include_pac_utils( script ))) goto done;
570 
571  hr = IActiveScriptParse_ParseScriptText( parser, full_script, NULL, NULL, NULL, 0, 0, 0, NULL, NULL );
572  if (hr != S_OK) goto done;
573 
574  hr = IActiveScript_SetScriptState( engine, SCRIPTSTATE_STARTED );
575  if (hr != S_OK) goto done;
576 
577  hr = IActiveScript_GetScriptDispatch( engine, NULL, &dispatch );
578  if (hr != S_OK) goto done;
579 
580  if (!(func = SysAllocString( findproxyW ))) goto done;
581  hr = IDispatch_GetIDsOfNames( dispatch, &IID_NULL, &func, 1, LOCALE_SYSTEM_DEFAULT, &dispid );
582  if (hr != S_OK) goto done;
583 
584  V_VT( &args[0] ) = VT_BSTR;
585  V_BSTR( &args[0] ) = SysAllocString( hostname );
586  V_VT( &args[1] ) = VT_BSTR;
587  V_BSTR( &args[1] ) = SysAllocString( url );
588 
589  params.rgvarg = args;
590  params.rgdispidNamedArgs = NULL;
591  params.cArgs = 2;
592  params.cNamedArgs = 0;
593  hr = IDispatch_Invoke( dispatch, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT, DISPATCH_METHOD,
594  &params, &retval, NULL, NULL );
595  VariantClear( &args[0] );
596  VariantClear( &args[1] );
597  if (hr != S_OK)
598  {
599  WARN("script failed 0x%08x\n", hr);
600  goto done;
601  }
602  if ((*result_str = strdupWA( V_BSTR( &retval ) )))
603  {
604  TRACE( "result: %s\n", debugstr_a(*result_str) );
605  *result_len = strlen( *result_str ) + 1;
606  ret = TRUE;
607  }
608  VariantClear( &retval );
609 
610 done:
611  SysFreeString( full_script );
612  SysFreeString( func );
613  if (dispatch) IDispatch_Release( dispatch );
615  if (engine) IActiveScript_Release( engine );
616  if (SUCCEEDED( init )) CoUninitialize();
617  return ret;
618 }
GLenum func
Definition: glext.h:6028
#define TRUE
Definition: types.h:120
HRESULT hr
Definition: shlfolder.c:183
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define IActiveScriptParse_Release
Definition: main.c:529
#define WARN(fmt,...)
Definition: debug.h:111
static IActiveScriptSite script_site
Definition: main.c:501
static const WCHAR global_funcsW[]
Definition: main.c:75
OLECHAR * BSTR
Definition: compat.h:1934
Definition: match.c:390
HRESULT WINAPI DECLSPEC_HOTPATCH CLSIDFromProgID(LPCOLESTR progid, LPCLSID clsid)
Definition: compobj.c:2511
#define DISPATCH_METHOD
Definition: oleauto.h:1006
char * hostname
Definition: ftp.c:88
GLenum const GLfloat * params
Definition: glext.h:5645
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
script
Definition: msipriv.h:374
#define IActiveScriptParse_InitNew
Definition: main.c:530
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR url[]
Definition: encode.c:1432
#define IActiveScriptParse_ParseScriptText
Definition: main.c:531
#define LOCALE_SYSTEM_DEFAULT
static BSTR include_pac_utils(const WCHAR *script)
Definition: main.c:503
char * args[]
Definition: main.c:34
int ret
static BOOL init(void)
Definition: main.c:59
REFCLSID clsid
Definition: msctf.c:84
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:651
#define IID_NULL
Definition: guiddef.h:93
#define V_VT(A)
Definition: oleauto.h:211
void dispatch(HANDLE hStopEvent)
Definition: dispatch.c:66
#define V_BSTR(A)
Definition: oleauto.h:226
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234
#define S_OK
Definition: intsafe.h:59
static VARIANTARG static DISPID
Definition: ordinal.c:49
static char * strdupWA(const WCHAR *src)
Definition: main.c:111
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:1991
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1897
Definition: import.c:86
struct stdole::DISPPARAMS DISPPARAMS
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by InternetGetProxyInfo().

◆ site_AddRef()

static ULONG WINAPI site_AddRef ( IActiveScriptSite iface)
static

Definition at line 420 of file main.c.

422 {
423  return 2;
424 }

◆ site_GetDocVersionString()

static HRESULT WINAPI site_GetDocVersionString ( IActiveScriptSite iface,
BSTR version 
)
static

Definition at line 450 of file main.c.

452 {
453  return E_NOTIMPL;
454 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ site_GetItemInfo()

static HRESULT WINAPI site_GetItemInfo ( IActiveScriptSite iface,
LPCOLESTR  name,
DWORD  mask,
IUnknown **  item,
ITypeInfo **  type_info 
)
static

Definition at line 438 of file main.c.

441 {
442  if (!strcmpW( name, global_funcsW ) && mask == SCRIPTINFO_IUNKNOWN)
443  {
444  *item = (IUnknown *)&global_dispex;
445  return S_OK;
446  }
447  return E_NOTIMPL;
448 }
static const WCHAR global_funcsW[]
Definition: main.c:75
GLenum GLint GLuint mask
Definition: glext.h:6028
#define S_OK
Definition: intsafe.h:59
static ATOM item
Definition: dde.c:856
#define E_NOTIMPL
Definition: ddrawi.h:99
static IDispatchEx global_dispex
Definition: main.c:402
Definition: name.c:36
WINE_UNICODE_INLINE int strcmpW(const WCHAR *str1, const WCHAR *str2)
Definition: unicode.h:229

◆ site_GetLCID()

static HRESULT WINAPI site_GetLCID ( IActiveScriptSite iface,
LCID lcid 
)
static

Definition at line 432 of file main.c.

434 {
435  return E_NOTIMPL;
436 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ site_OnEnterScript()

static HRESULT WINAPI site_OnEnterScript ( IActiveScriptSite iface)
static

Definition at line 474 of file main.c.

476 {
477  return E_NOTIMPL;
478 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ site_OnLeaveScript()

static HRESULT WINAPI site_OnLeaveScript ( IActiveScriptSite iface)
static

Definition at line 480 of file main.c.

482 {
483  return E_NOTIMPL;
484 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ site_OnScriptError()

static HRESULT WINAPI site_OnScriptError ( IActiveScriptSite iface,
IActiveScriptError error 
)
static

Definition at line 468 of file main.c.

470 {
471  return E_NOTIMPL;
472 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ site_OnScriptTerminate()

static HRESULT WINAPI site_OnScriptTerminate ( IActiveScriptSite iface,
const VARIANT result,
const EXCEPINFO *  info 
)
static

Definition at line 456 of file main.c.

458 {
459  return E_NOTIMPL;
460 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ site_OnStateChange()

static HRESULT WINAPI site_OnStateChange ( IActiveScriptSite iface,
SCRIPTSTATE  state 
)
static

Definition at line 462 of file main.c.

464 {
465  return E_NOTIMPL;
466 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ site_QueryInterface()

static HRESULT WINAPI site_QueryInterface ( IActiveScriptSite iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 404 of file main.c.

406 {
407  *ppv = NULL;
408 
409  if (IsEqualGUID( &IID_IUnknown, riid ))
410  *ppv = iface;
411  else if (IsEqualGUID( &IID_IActiveScriptSite, riid ))
412  *ppv = iface;
413  else
414  return E_NOINTERFACE;
415 
416  IUnknown_AddRef( (IUnknown *)*ppv );
417  return S_OK;
418 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

◆ site_Release()

static ULONG WINAPI site_Release ( IActiveScriptSite iface)
static

Definition at line 426 of file main.c.

428 {
429  return 1;
430 }

◆ strdupAW()

static WCHAR* strdupAW ( const char src,
int  len 
)
inlinestatic

Definition at line 96 of file main.c.

97 {
98  WCHAR *dst = NULL;
99  if (src)
100  {
101  int dst_len = MultiByteToWideChar( CP_ACP, 0, src, len, NULL, 0 );
102  if ((dst = heap_alloc( (dst_len + 1) * sizeof(WCHAR) )))
103  {
104  len = MultiByteToWideChar( CP_ACP, 0, src, len, dst, dst_len );
105  dst[dst_len] = 0;
106  }
107  }
108  return dst;
109 }
#define CP_ACP
Definition: compat.h:99
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLenum GLsizei len
Definition: glext.h:6722
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
#define MultiByteToWideChar
Definition: compat.h:100

Referenced by addr_to_str(), InternetGetProxyInfo(), JSPROXY_InternetInitializeAutoProxyDll(), parse_script_result(), and WinHttpDetectAutoProxyConfigUrl().

◆ strdupWA()

static char* strdupWA ( const WCHAR src)
inlinestatic

Definition at line 111 of file main.c.

112 {
113  char *dst = NULL;
114  if (src)
115  {
116  int len = WideCharToMultiByte( CP_ACP, 0, src, -1, NULL, 0, NULL, NULL );
117  if ((dst = heap_alloc( len ))) WideCharToMultiByte( CP_ACP, 0, src, -1, dst, len, NULL, NULL );
118  }
119  return dst;
120 }
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
smooth NULL
Definition: ftsmooth.c:416
GLenum GLsizei len
Definition: glext.h:6722
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340

Referenced by dns_resolve(), resolve_hostname(), run_script(), secure_proxy_connect(), and send_request().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( jsproxy  )

Variable Documentation

◆ critsect_debug

CRITICAL_SECTION_DEBUG critsect_debug
static
Initial value:
=
{
0, 0, &cs_jsproxy,
0, 0, { (DWORD_PTR)(__FILE__ ": cs_jsproxy") }
}
#define DWORD_PTR
Definition: treelist.c:76
static CRITICAL_SECTION_DEBUG critsect_debug
Definition: main.c:67
LIST_ENTRY ProcessLocksList
Definition: winbase.h:848
static CRITICAL_SECTION cs_jsproxy
Definition: main.c:66

Definition at line 67 of file main.c.

◆ cs_jsproxy

static CRITICAL_SECTION cs_jsproxy = { &critsect_debug, -1, 0, 0, 0, 0 }
static

◆ dispex_vtbl

const IDispatchExVtbl dispex_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI dispex_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params, VARIANT *result, EXCEPINFO *exep, IServiceProvider *caller)
Definition: main.c:370
static HRESULT WINAPI dispex_GetTypeInfoCount(IDispatchEx *iface, UINT *info)
Definition: main.c:234
static HRESULT WINAPI dispex_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv)
Definition: main.c:207
static HRESULT WINAPI dispex_GetNextDispID(IDispatchEx *iface, DWORD flags, DISPID id, DISPID *next)
Definition: main.c:283
static HRESULT WINAPI dispex_DeleteMemberByName(IDispatchEx *iface, BSTR name, DWORD flags)
Definition: main.c:259
static ULONG WINAPI dispex_Release(IDispatchEx *iface)
Definition: main.c:228
static HRESULT WINAPI dispex_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD flags_fetch, DWORD *flags)
Definition: main.c:271
static HRESULT WINAPI dispex_GetDispID(IDispatchEx *iface, BSTR name, DWORD flags, DISPID *id)
Definition: main.c:297
static HRESULT WINAPI dispex_Invoke(IDispatchEx *iface, DISPID member, REFIID riid, LCID lcid, WORD flags, DISPPARAMS *params, VARIANT *result, EXCEPINFO *excep, UINT *err)
Definition: main.c:252
static HRESULT WINAPI dispex_GetIDsOfNames(IDispatchEx *iface, REFIID riid, LPOLESTR *names, UINT count, LCID lcid, DISPID *id)
Definition: main.c:246
static HRESULT WINAPI dispex_DeleteMemberByDispID(IDispatchEx *iface, DISPID id)
Definition: main.c:265
static HRESULT WINAPI dispex_GetNameSpaceParent(IDispatchEx *iface, IUnknown **unk)
Definition: main.c:289
static HRESULT WINAPI dispex_GetTypeInfo(IDispatchEx *iface, UINT info, LCID lcid, ITypeInfo **type_info)
Definition: main.c:240
static HRESULT WINAPI dispex_GetMemberName(IDispatchEx *iface, DISPID id, BSTR *name)
Definition: main.c:277
static ULONG WINAPI dispex_AddRef(IDispatchEx *iface)
Definition: main.c:222

Definition at line 383 of file main.c.

◆ dns_resolveW

const WCHAR dns_resolveW[] = {'d','n','s','_','r','e','s','o','l','v','e',0}
static

Definition at line 76 of file main.c.

Referenced by dispex_GetDispID().

◆ global_dispex

IDispatchEx global_dispex = { &dispex_vtbl }
static

Definition at line 402 of file main.c.

Referenced by site_GetItemInfo().

◆ global_funcsW

const WCHAR global_funcsW[] = {'g','l','o','b','a','l','_','f','u','n','c','s',0}
static

Definition at line 75 of file main.c.

Referenced by run_script(), and site_GetItemInfo().

◆ global_script

◆ instance

HINSTANCE instance
static

Definition at line 62 of file main.c.

Referenced by DllMain().

◆ pac_script

◆ script_site

IActiveScriptSite script_site = { &site_vtbl }
static

Definition at line 501 of file main.c.

Referenced by run_script().

◆ site_vtbl

const IActiveScriptSiteVtbl site_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI site_OnScriptTerminate(IActiveScriptSite *iface, const VARIANT *result, const EXCEPINFO *info)
Definition: main.c:456
static HRESULT WINAPI site_OnEnterScript(IActiveScriptSite *iface)
Definition: main.c:474
static HRESULT WINAPI site_GetItemInfo(IActiveScriptSite *iface, LPCOLESTR name, DWORD mask, IUnknown **item, ITypeInfo **type_info)
Definition: main.c:438
static HRESULT WINAPI site_QueryInterface(IActiveScriptSite *iface, REFIID riid, void **ppv)
Definition: main.c:404
static ULONG WINAPI site_Release(IActiveScriptSite *iface)
Definition: main.c:426
static HRESULT WINAPI site_OnLeaveScript(IActiveScriptSite *iface)
Definition: main.c:480
static HRESULT WINAPI site_GetLCID(IActiveScriptSite *iface, LCID *lcid)
Definition: main.c:432
static HRESULT WINAPI site_GetDocVersionString(IActiveScriptSite *iface, BSTR *version)
Definition: main.c:450
static HRESULT WINAPI site_OnStateChange(IActiveScriptSite *iface, SCRIPTSTATE state)
Definition: main.c:462
static ULONG WINAPI site_AddRef(IActiveScriptSite *iface)
Definition: main.c:420
static HRESULT WINAPI site_OnScriptError(IActiveScriptSite *iface, IActiveScriptError *error)
Definition: main.c:468

Definition at line 486 of file main.c.