ReactOS 0.4.15-dev-7887-g64a59a1
main.c
Go to the documentation of this file.
1/*
2 * Copyright 2014 Hans Leidekker for CodeWeavers
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19#include <stdarg.h>
20#ifdef __REACTOS__
21#include <stdio.h>
22#define COBJMACROS
23#endif
24#include <sys/types.h>
25
26#include "windef.h"
27#include "winbase.h"
28#include "winsock2.h"
29#include "ws2ipdef.h"
30#include "ws2tcpip.h"
31#include "winnls.h"
32#include "wininet.h"
33#ifndef __REACTOS__
34#define COBJMACROS
35#endif
36#include "ole2.h"
37#include "dispex.h"
38#include "activscp.h"
39#include "wine/debug.h"
40#include "wine/heap.h"
41
43
45
48{
49 0, 0, &cs_jsproxy,
51 0, 0, { (DWORD_PTR)(__FILE__ ": cs_jsproxy") }
52};
53static CRITICAL_SECTION cs_jsproxy = { &critsect_debug, -1, 0, 0, 0, 0 };
54
55static const WCHAR global_funcsW[] = {'g','l','o','b','a','l','_','f','u','n','c','s',0};
56static const WCHAR dns_resolveW[] = {'d','n','s','_','r','e','s','o','l','v','e',0};
57
58/******************************************************************
59 * DllMain (jsproxy.@)
60 */
62{
63 switch (reason)
64 {
68 break;
69
71 break;
72 }
73 return TRUE;
74}
75
76static inline WCHAR *strdupAW( const char *src, int len )
77{
78 WCHAR *dst = NULL;
79 if (src)
80 {
81 int dst_len = MultiByteToWideChar( CP_ACP, 0, src, len, NULL, 0 );
82 if ((dst = heap_alloc( (dst_len + 1) * sizeof(WCHAR) )))
83 {
84 len = MultiByteToWideChar( CP_ACP, 0, src, len, dst, dst_len );
85 dst[dst_len] = 0;
86 }
87 }
88 return dst;
89}
90
91static inline char *strdupWA( const WCHAR *src )
92{
93 char *dst = NULL;
94 if (src)
95 {
96 int len = WideCharToMultiByte( CP_ACP, 0, src, -1, NULL, 0, NULL, NULL );
97 if ((dst = heap_alloc( len ))) WideCharToMultiByte( CP_ACP, 0, src, -1, dst, len, NULL, NULL );
98 }
99 return dst;
100}
101
102static struct pac_script
103{
107
108/******************************************************************
109 * InternetDeInitializeAutoProxyDll (jsproxy.@)
110 */
112{
113 TRACE( "%s, %u\n", debugstr_a(mime), reserved );
114
116
117 heap_free( global_script->text );
118 global_script->text = NULL;
119
121 return TRUE;
122}
123
124static WCHAR *load_script( const char *filename )
125{
127 DWORD size, bytes_read;
128 char *buffer;
129 int len;
130 WCHAR *script = NULL;
131
133 if (handle == INVALID_HANDLE_VALUE) return NULL;
134
136 if (!(buffer = heap_alloc( size ))) goto done;
137 if (!ReadFile( handle, buffer, size, &bytes_read, NULL ) || bytes_read != size) goto done;
138
140 if (!(script = heap_alloc( (len + 1) * sizeof(WCHAR) ))) goto done;
142 script[len] = 0;
143
144done:
146 heap_free( buffer );
147 return script;
148}
149
150/******************************************************************
151 * InternetInitializeAutoProxyDll (jsproxy.@)
152 */
156{
157 BOOL ret = FALSE;
158
159 TRACE( "%u, %s, %s, %p, %p\n", version, debugstr_a(tmpfile), debugstr_a(mime), callbacks, buffer );
160
161 if (callbacks) FIXME( "callbacks not supported\n" );
162
164
165 if (buffer && buffer->dwStructSize == sizeof(*buffer) && buffer->lpszScriptBuffer)
166 {
167 if (!buffer->dwScriptBufferSize)
168 {
171 return FALSE;
172 }
173 heap_free( global_script->text );
174 if ((global_script->text = strdupAW( buffer->lpszScriptBuffer,
175 buffer->dwScriptBufferSize ))) ret = TRUE;
176 }
177 else
178 {
179 heap_free( global_script->text );
180 if ((global_script->text = load_script( tmpfile ))) ret = TRUE;
181 }
182
184 return ret;
185}
186
188 IDispatchEx *iface, REFIID riid, void **ppv )
189{
190 *ppv = NULL;
191
192 if (IsEqualGUID( riid, &IID_IUnknown ) ||
194 IsEqualGUID( riid, &IID_IDispatchEx ))
195 *ppv = iface;
196 else
197 return E_NOINTERFACE;
198
199 return S_OK;
200}
201
203 IDispatchEx *iface )
204{
205 return 2;
206}
207
209 IDispatchEx *iface )
210{
211 return 1;
212}
213
215 IDispatchEx *iface, UINT *info )
216{
217 return E_NOTIMPL;
218}
219
221 IDispatchEx *iface, UINT info, LCID lcid, ITypeInfo **type_info )
222{
223 return E_NOTIMPL;
224}
225
227 IDispatchEx *iface, REFIID riid, LPOLESTR *names, UINT count, LCID lcid, DISPID *id )
228{
229 return E_NOTIMPL;
230}
231
234 DISPPARAMS *params, VARIANT *result, EXCEPINFO *excep, UINT *err )
235{
236 return E_NOTIMPL;
237}
238
240 IDispatchEx *iface, BSTR name, DWORD flags )
241{
242 return E_NOTIMPL;
243}
244
246 IDispatchEx *iface, DISPID id )
247{
248 return E_NOTIMPL;
249}
250
252 IDispatchEx *iface, DISPID id, DWORD flags_fetch, DWORD *flags )
253{
254 return E_NOTIMPL;
255}
256
258 IDispatchEx *iface, DISPID id, BSTR *name )
259{
260 return E_NOTIMPL;
261}
262
264 IDispatchEx *iface, DWORD flags, DISPID id, DISPID *next )
265{
266 return E_NOTIMPL;
267}
268
270 IDispatchEx *iface, IUnknown **unk )
271{
272 return E_NOTIMPL;
273}
274
275#define DISPID_GLOBAL_DNSRESOLVE 0x1000
276
278 IDispatchEx *iface, BSTR name, DWORD flags, DISPID *id )
279{
280 if (!lstrcmpW( name, dns_resolveW ))
281 {
283 return S_OK;
284 }
285 return DISP_E_UNKNOWNNAME;
286}
287
288static char *get_computer_name( COMPUTER_NAME_FORMAT format )
289{
290 char *ret;
291 DWORD size = 0;
292
294 if (GetLastError() != ERROR_MORE_DATA) return NULL;
295 if (!(ret = heap_alloc( size ))) return NULL;
297 {
298 heap_free( ret );
299 return NULL;
300 }
301 return ret;
302}
303
304static void printf_addr( const WCHAR *fmt, WCHAR *buf, SIZE_T size, struct sockaddr_in *addr )
305{
306 swprintf( buf, fmt,
307 (unsigned int)(ntohl( addr->sin_addr.s_addr ) >> 24 & 0xff),
308 (unsigned int)(ntohl( addr->sin_addr.s_addr ) >> 16 & 0xff),
309 (unsigned int)(ntohl( addr->sin_addr.s_addr ) >> 8 & 0xff),
310 (unsigned int)(ntohl( addr->sin_addr.s_addr ) & 0xff) );
311}
312
314{
315 static const WCHAR fmtW[] = {'%','u','.','%','u','.','%','u','.','%','u',0};
316 WCHAR addr[16];
317 struct addrinfo *ai, *elem;
318 char *hostnameA;
319 int res;
320
321 if (hostname[0])
322 hostnameA = strdupWA( hostname );
323 else
324 hostnameA = get_computer_name( ComputerNamePhysicalDnsFullyQualified );
325
326 if (!hostnameA) return E_OUTOFMEMORY;
327 res = getaddrinfo( hostnameA, NULL, NULL, &ai );
328 heap_free( hostnameA );
329 if (res) return S_FALSE;
330
331 elem = ai;
332 while (elem && elem->ai_family != AF_INET) elem = elem->ai_next;
333 if (!elem)
334 {
335 freeaddrinfo( ai );
336 return S_FALSE;
337 }
338 printf_addr( fmtW, addr, ARRAY_SIZE(addr), (struct sockaddr_in *)elem->ai_addr );
339 freeaddrinfo( ai );
340 V_VT( result ) = VT_BSTR;
342 return S_OK;
343}
344
346 IDispatchEx *iface, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params,
347 VARIANT *result, EXCEPINFO *exep, IServiceProvider *caller )
348{
349 if (id == DISPID_GLOBAL_DNSRESOLVE)
350 {
351 if (params->cArgs != 1) return DISP_E_BADPARAMCOUNT;
352 if (V_VT(&params->rgvarg[0]) != VT_BSTR) return DISP_E_BADVARTYPE;
353 return dns_resolve( V_BSTR(&params->rgvarg[0]), result );
354 }
356}
357
358static const IDispatchExVtbl dispex_vtbl =
359{
375};
376
378
380 IActiveScriptSite *iface, REFIID riid, void **ppv )
381{
382 *ppv = NULL;
383
385 *ppv = iface;
386 else if (IsEqualGUID( &IID_IActiveScriptSite, riid ))
387 *ppv = iface;
388 else
389 return E_NOINTERFACE;
390
391 IUnknown_AddRef( (IUnknown *)*ppv );
392 return S_OK;
393}
394
396 IActiveScriptSite *iface )
397{
398 return 2;
399}
400
402 IActiveScriptSite *iface )
403{
404 return 1;
405}
406
408 IActiveScriptSite *iface, LCID *lcid )
409{
410 return E_NOTIMPL;
411}
412
414 IActiveScriptSite *iface, LPCOLESTR name, DWORD mask,
416{
417 if (!lstrcmpW( name, global_funcsW ) && mask == SCRIPTINFO_IUNKNOWN)
418 {
420 return S_OK;
421 }
422 return E_NOTIMPL;
423}
424
427{
428 return E_NOTIMPL;
429}
430
432 IActiveScriptSite *iface, const VARIANT *result, const EXCEPINFO *info )
433{
434 return E_NOTIMPL;
435}
436
439{
440 return E_NOTIMPL;
441}
442
445{
446 return E_NOTIMPL;
447}
448
450 IActiveScriptSite *iface )
451{
452 return E_NOTIMPL;
453}
454
456 IActiveScriptSite *iface )
457{
458 return E_NOTIMPL;
459}
460
461static const IActiveScriptSiteVtbl site_vtbl =
462{
474};
475
477
479{
480 static const WCHAR pacjsW[] = {'p','a','c','.','j','s',0};
481 HMODULE hmod = GetModuleHandleA( "jsproxy.dll" );
482 HRSRC rsrc;
483 DWORD size;
484 const char *data;
485 BSTR ret;
486 int len;
487
488 if (!(rsrc = FindResourceW( hmod, pacjsW, (LPCWSTR)40 ))) return NULL;
489 size = SizeofResource( hmod, rsrc );
490 data = LoadResource( hmod, rsrc );
491
493 if (!(ret = SysAllocStringLen( NULL, len + lstrlenW( script ) + 1 ))) return NULL;
495 lstrcpyW( ret + len, script );
496 return ret;
497}
498
499#ifdef _WIN64
500#define IActiveScriptParse_Release IActiveScriptParse64_Release
501#define IActiveScriptParse_InitNew IActiveScriptParse64_InitNew
502#define IActiveScriptParse_ParseScriptText IActiveScriptParse64_ParseScriptText
503#else
504#define IActiveScriptParse_Release IActiveScriptParse32_Release
505#define IActiveScriptParse_InitNew IActiveScriptParse32_InitNew
506#define IActiveScriptParse_ParseScriptText IActiveScriptParse32_ParseScriptText
507#endif
508
509static BOOL run_script( const WCHAR *script, const WCHAR *url, const WCHAR *hostname, char **result_str, DWORD *result_len )
510{
511 static const WCHAR jscriptW[] = {'J','S','c','r','i','p','t',0};
512 static const WCHAR findproxyW[] = {'F','i','n','d','P','r','o','x','y','F','o','r','U','R','L',0};
513 IActiveScriptParse *parser = NULL;
514 IActiveScript *engine = NULL;
516 BOOL ret = FALSE;
517 CLSID clsid;
518 DISPID dispid;
519 BSTR func = NULL, full_script = NULL;
520 VARIANT args[2], retval;
521 DISPPARAMS params;
522 HRESULT hr, init;
523
525 hr = CLSIDFromProgID( jscriptW, &clsid );
526 if (hr != S_OK) goto done;
527
528 hr = CoCreateInstance( &clsid, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
529 &IID_IActiveScript, (void **)&engine );
530 if (hr != S_OK) goto done;
531
532 hr = IActiveScript_QueryInterface( engine, &IID_IActiveScriptParse, (void **)&parser );
533 if (hr != S_OK) goto done;
534
536 if (hr != S_OK) goto done;
537
538 hr = IActiveScript_SetScriptSite( engine, &script_site );
539 if (hr != S_OK) goto done;
540
541 hr = IActiveScript_AddNamedItem( engine, global_funcsW, SCRIPTITEM_GLOBALMEMBERS );
542 if (hr != S_OK) goto done;
543
544 if (!(full_script = include_pac_utils( script ))) goto done;
545
546 hr = IActiveScriptParse_ParseScriptText( parser, full_script, NULL, NULL, NULL, 0, 0, 0, NULL, NULL );
547 if (hr != S_OK) goto done;
548
549 hr = IActiveScript_SetScriptState( engine, SCRIPTSTATE_STARTED );
550 if (hr != S_OK) goto done;
551
552 hr = IActiveScript_GetScriptDispatch( engine, NULL, &dispatch );
553 if (hr != S_OK) goto done;
554
555 if (!(func = SysAllocString( findproxyW ))) goto done;
556 hr = IDispatch_GetIDsOfNames( dispatch, &IID_NULL, &func, 1, LOCALE_SYSTEM_DEFAULT, &dispid );
557 if (hr != S_OK) goto done;
558
559 V_VT( &args[0] ) = VT_BSTR;
561 V_VT( &args[1] ) = VT_BSTR;
562 V_BSTR( &args[1] ) = SysAllocString( url );
563
564 params.rgvarg = args;
565 params.rgdispidNamedArgs = NULL;
566 params.cArgs = 2;
567 params.cNamedArgs = 0;
568 hr = IDispatch_Invoke( dispatch, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT, DISPATCH_METHOD,
569 &params, &retval, NULL, NULL );
570 VariantClear( &args[0] );
571 VariantClear( &args[1] );
572 if (hr != S_OK)
573 {
574 WARN("script failed 0x%08x\n", hr);
575 goto done;
576 }
577 if ((*result_str = strdupWA( V_BSTR( &retval ) )))
578 {
579 TRACE( "result: %s\n", debugstr_a(*result_str) );
580 *result_len = strlen( *result_str ) + 1;
581 ret = TRUE;
582 }
583 VariantClear( &retval );
584
585done:
586 SysFreeString( full_script );
588 if (dispatch) IDispatch_Release( dispatch );
590 if (engine) IActiveScript_Release( engine );
591 if (SUCCEEDED( init )) CoUninitialize();
592 return ret;
593}
594
595/******************************************************************
596 * InternetGetProxyInfo (jsproxy.@)
597 */
599 LPDWORD len_proxy )
600{
601 WCHAR *urlW = NULL, *hostnameW = NULL;
602 BOOL ret = FALSE;
603
604 TRACE( "%s, %u, %s, %u, %p, %p\n", debugstr_a(url), len_url, hostname, len_hostname, proxy, len_proxy );
605
607
608 if (!global_script->text)
609 {
611 goto done;
612 }
613 if (hostname && len_hostname < strlen( hostname ))
614 {
616 goto done;
617 }
618 if (!(urlW = strdupAW( url, -1 ))) goto done;
619 if (hostname && !(hostnameW = strdupAW( hostname, -1 ))) goto done;
620
621 TRACE( "%s\n", debugstr_w(global_script->text) );
622 ret = run_script( global_script->text, urlW, hostnameW, proxy, len_proxy );
623
624done:
625 heap_free( hostnameW );
626 heap_free( urlW );
628 return ret;
629}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
@ SCRIPTSTATE_STARTED
Definition: activscp.idl:58
enum tagSCRIPTSTATE SCRIPTSTATE
static int state
Definition: maze.c:121
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
static void run_script(const WCHAR *filename, IActiveScript *script, IActiveScriptParse *parser)
Definition: main.c:367
#define IActiveScriptParse_InitNew
Definition: main.c:47
#define IActiveScriptParse_ParseScriptText
Definition: main.c:48
#define IActiveScriptParse_Release
Definition: main.c:46
static IActiveScriptSite script_site
Definition: main.c:162
char * hostname
Definition: ftp.c:88
int proxy
Definition: main.c:67
#define ARRAY_SIZE(A)
Definition: main.h:33
void dispatch(HANDLE hStopEvent)
Definition: dispatch.c:70
const GUID IID_IUnknown
#define FIXME(fmt,...)
Definition: debug.h:111
#define WARN(fmt,...)
Definition: debug.h:112
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_NOTIMPL
Definition: ddrawi.h:99
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
Definition: main.c:26
static HINSTANCE instance
Definition: main.c:40
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1904
#define CloseHandle
Definition: compat.h:739
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_PROCESS_DETACH
Definition: compat.h:130
#define CP_ACP
Definition: compat.h:109
#define OPEN_EXISTING
Definition: compat.h:775
#define ReadFile(a, b, c, d, e)
Definition: compat.h:742
#define SetLastError(x)
Definition: compat.h:752
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:740
OLECHAR * BSTR
Definition: compat.h:2293
#define GENERIC_READ
Definition: compat.h:135
#define lstrcpyW
Definition: compat.h:749
#define WideCharToMultiByte
Definition: compat.h:111
#define MultiByteToWideChar
Definition: compat.h:110
#define FILE_SHARE_READ
Definition: compat.h:136
@ VT_BSTR
Definition: compat.h:2303
#define lstrlenW
Definition: compat.h:750
static const WCHAR version[]
Definition: asmname.c:66
BOOL WINAPI InternetGetProxyInfo(LPCSTR url, DWORD len_url, LPCSTR hostname, DWORD len_hostname, LPSTR *proxy, LPDWORD len_proxy)
Definition: main.c:598
static HRESULT WINAPI dispex_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params, VARIANT *result, EXCEPINFO *exep, IServiceProvider *caller)
Definition: main.c:345
static CRITICAL_SECTION cs_jsproxy
Definition: main.c:46
static HRESULT WINAPI dispex_DeleteMemberByDispID(IDispatchEx *iface, DISPID id)
Definition: main.c:245
static struct pac_script * global_script
Definition: main.c:106
static HRESULT WINAPI dispex_GetTypeInfoCount(IDispatchEx *iface, UINT *info)
Definition: main.c:214
static HRESULT WINAPI site_OnStateChange(IActiveScriptSite *iface, SCRIPTSTATE state)
Definition: main.c:437
static ULONG WINAPI dispex_Release(IDispatchEx *iface)
Definition: main.c:208
static HRESULT WINAPI site_OnLeaveScript(IActiveScriptSite *iface)
Definition: main.c:455
static char * strdupWA(const WCHAR *src)
Definition: main.c:91
static const WCHAR global_funcsW[]
Definition: main.c:55
static HRESULT WINAPI site_GetLCID(IActiveScriptSite *iface, LCID *lcid)
Definition: main.c:407
static void printf_addr(const WCHAR *fmt, WCHAR *buf, SIZE_T size, struct sockaddr_in *addr)
Definition: main.c:304
static BSTR include_pac_utils(const WCHAR *script)
Definition: main.c:478
static HRESULT WINAPI site_QueryInterface(IActiveScriptSite *iface, REFIID riid, void **ppv)
Definition: main.c:379
static CRITICAL_SECTION_DEBUG critsect_debug
Definition: main.c:47
static ULONG WINAPI site_AddRef(IActiveScriptSite *iface)
Definition: main.c:395
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:232
static HRESULT WINAPI site_OnScriptError(IActiveScriptSite *iface, IActiveScriptError *error)
Definition: main.c:443
BOOL WINAPI InternetDeInitializeAutoProxyDll(LPSTR mime, DWORD reserved)
Definition: main.c:111
static char * get_computer_name(COMPUTER_NAME_FORMAT format)
Definition: main.c:288
static WCHAR * load_script(const char *filename)
Definition: main.c:124
static ULONG WINAPI site_Release(IActiveScriptSite *iface)
Definition: main.c:401
static HRESULT WINAPI dispex_GetIDsOfNames(IDispatchEx *iface, REFIID riid, LPOLESTR *names, UINT count, LCID lcid, DISPID *id)
Definition: main.c:226
static const IDispatchExVtbl dispex_vtbl
Definition: main.c:358
static HRESULT WINAPI site_OnScriptTerminate(IActiveScriptSite *iface, const VARIANT *result, const EXCEPINFO *info)
Definition: main.c:431
static HRESULT WINAPI dispex_DeleteMemberByName(IDispatchEx *iface, BSTR name, DWORD flags)
Definition: main.c:239
static HRESULT WINAPI dispex_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv)
Definition: main.c:187
static ULONG WINAPI dispex_AddRef(IDispatchEx *iface)
Definition: main.c:202
static HRESULT dns_resolve(const WCHAR *hostname, VARIANT *result)
Definition: main.c:313
static HRESULT WINAPI dispex_GetDispID(IDispatchEx *iface, BSTR name, DWORD flags, DISPID *id)
Definition: main.c:277
static HRESULT WINAPI dispex_GetTypeInfo(IDispatchEx *iface, UINT info, LCID lcid, ITypeInfo **type_info)
Definition: main.c:220
BOOL WINAPI JSPROXY_InternetInitializeAutoProxyDll(DWORD version, LPSTR tmpfile, LPSTR mime, AutoProxyHelperFunctions *callbacks, LPAUTO_PROXY_SCRIPT_BUFFER buffer)
Definition: main.c:153
static const WCHAR dns_resolveW[]
Definition: main.c:56
static WCHAR * strdupAW(const char *src, int len)
Definition: main.c:76
static HRESULT WINAPI dispex_GetMemberName(IDispatchEx *iface, DISPID id, BSTR *name)
Definition: main.c:257
static HRESULT WINAPI site_GetItemInfo(IActiveScriptSite *iface, LPCOLESTR name, DWORD mask, IUnknown **item, ITypeInfo **type_info)
Definition: main.c:413
static IDispatchEx global_dispex
Definition: main.c:377
static HRESULT WINAPI site_OnEnterScript(IActiveScriptSite *iface)
Definition: main.c:449
static const IActiveScriptSiteVtbl site_vtbl
Definition: main.c:461
static HRESULT WINAPI site_GetDocVersionString(IActiveScriptSite *iface, BSTR *version)
Definition: main.c:425
static HRESULT WINAPI dispex_GetNextDispID(IDispatchEx *iface, DWORD flags, DISPID id, DISPID *next)
Definition: main.c:263
static HRESULT WINAPI dispex_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD flags_fetch, DWORD *flags)
Definition: main.c:251
#define DISPID_GLOBAL_DNSRESOLVE
Definition: main.c:275
static HRESULT WINAPI dispex_GetNameSpaceParent(IDispatchEx *iface, IUnknown **unk)
Definition: main.c:269
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
Definition: fileinfo.c:331
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
HRESULT WINAPI DECLSPEC_HOTPATCH CLSIDFromProgID(LPCOLESTR progid, LPCLSID clsid)
Definition: compobj.c:2602
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
#define swprintf
Definition: precomp.h:40
r reserved
Definition: btrfs.c:3006
#define AF_INET
Definition: tcpip.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
GLsizeiptr size
Definition: glext.h:5919
GLenum func
Definition: glext.h:6028
GLuint res
Definition: glext.h:9613
GLenum src
Definition: glext.h:6340
GLuint GLuint * names
Definition: glext.h:11545
GLuint buffer
Definition: glext.h:5915
GLenum GLint GLuint mask
Definition: glext.h:6028
GLenum const GLfloat * params
Definition: glext.h:5645
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLenum GLenum dst
Definition: glext.h:6340
GLbitfield flags
Definition: glext.h:7161
GLenum const GLvoid * addr
Definition: glext.h:9621
GLenum GLsizei len
Definition: glext.h:6722
GLuint64EXT * result
Definition: glext.h:11304
_Check_return_ _CRTIMP FILE *__cdecl tmpfile(void)
Definition: file.c:3914
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
const char * filename
Definition: ioapi.h:137
BOOL WINAPI GetComputerNameExA(COMPUTER_NAME_FORMAT, LPSTR, LPDWORD)
Definition: compname.c:376
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_w
Definition: kernel32.h:32
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
const WCHAR * mime
Definition: mimefilter.c:512
#define error(str)
Definition: mkdosfs.c:1605
#define ntohl(x)
Definition: module.h:205
static PEXPLICIT_ACCESSW *static HMODULE hmod
Definition: security.c:143
static HINSTANCE hinst
Definition: edit.c:551
static const WCHAR url[]
Definition: encode.c:1432
static size_t elem
Definition: string.c:68
static LPOLESTR
Definition: stg_prop.c:27
static VARIANTARG static DISPID
Definition: ordinal.c:52
static ATOM item
Definition: dde.c:856
REFCLSID clsid
Definition: msctf.c:82
script
Definition: msipriv.h:383
unsigned int UINT
Definition: ndis.h:50
#define LOCALE_SYSTEM_DEFAULT
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
const GUID IID_IDispatch
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
#define IID_NULL
Definition: guiddef.h:98
static unsigned __int64 next
Definition: rand_nt.c:6
#define err(...)
DWORD LCID
Definition: nls.h:13
#define args
Definition: format.c:66
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
LIST_ENTRY ProcessLocksList
Definition: winbase.h:883
Definition: match.c:390
Definition: dsound.c:943
Definition: name.c:39
WCHAR * text
Definition: main.c:104
Definition: import.c:81
#define DWORD_PTR
Definition: treelist.c:76
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint32_t * LPDWORD
Definition: typedefs.h:59
uint32_t ULONG
Definition: typedefs.h:59
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
int ret
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define WINAPI
Definition: msvc.h:6
#define S_FALSE
Definition: winerror.h:2357
#define E_NOINTERFACE
Definition: winerror.h:2364
#define DISP_E_BADVARTYPE
Definition: winerror.h:2517
#define DISP_E_BADPARAMCOUNT
Definition: winerror.h:2523
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
#define ERROR_CAN_NOT_COMPLETE
Definition: winerror.h:582
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
static int init
Definition: wintirpc.c:33
#define getaddrinfo
Definition: wspiapi.h:44
#define freeaddrinfo
Definition: wspiapi.h:46
static int callbacks
Definition: xmllint.c:838
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185