ReactOS 0.4.15-dev-7654-g6bc40d3
script.c File Reference
#include "mshtml_private.h"
#include <activdbg.h>
Include dependency graph for script.c:

Go to the source code of this file.

Classes

struct  ScriptHost
 
struct  fire_readystatechange_task_t
 
struct  ScriptBSC
 

Macros

#define CTXARG_T   DWORD
 
#define IActiveScriptSiteDebugVtbl   IActiveScriptSiteDebug32Vtbl
 
#define IActiveScriptParse_Release   IActiveScriptParse32_Release
 
#define IActiveScriptParse_InitNew   IActiveScriptParse32_InitNew
 
#define IActiveScriptParse_ParseScriptText   IActiveScriptParse32_ParseScriptText
 
#define IActiveScriptParseProcedure2_Release   IActiveScriptParseProcedure2_32_Release
 
#define IActiveScriptParseProcedure2_ParseProcedureText   IActiveScriptParseProcedure2_32_ParseProcedureText
 

Functions

static void set_script_prop (ScriptHost *script_host, DWORD property, VARIANT *val)
 
static BOOL init_script_engine (ScriptHost *script_host)
 
static void release_script_engine (ScriptHost *This)
 
void connect_scripts (HTMLInnerWindow *window)
 
static ScriptHostimpl_from_IActiveScriptSite (IActiveScriptSite *iface)
 
static HRESULT WINAPI ActiveScriptSite_QueryInterface (IActiveScriptSite *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ActiveScriptSite_AddRef (IActiveScriptSite *iface)
 
static ULONG WINAPI ActiveScriptSite_Release (IActiveScriptSite *iface)
 
static HRESULT WINAPI ActiveScriptSite_GetLCID (IActiveScriptSite *iface, LCID *plcid)
 
static HRESULT WINAPI ActiveScriptSite_GetItemInfo (IActiveScriptSite *iface, LPCOLESTR pstrName, DWORD dwReturnMask, IUnknown **ppiunkItem, ITypeInfo **ppti)
 
static HRESULT WINAPI ActiveScriptSite_GetDocVersionString (IActiveScriptSite *iface, BSTR *pbstrVersion)
 
static HRESULT WINAPI ActiveScriptSite_OnScriptTerminate (IActiveScriptSite *iface, const VARIANT *pvarResult, const EXCEPINFO *pexcepinfo)
 
static HRESULT WINAPI ActiveScriptSite_OnStateChange (IActiveScriptSite *iface, SCRIPTSTATE ssScriptState)
 
static HRESULT WINAPI ActiveScriptSite_OnScriptError (IActiveScriptSite *iface, IActiveScriptError *pscripterror)
 
static HRESULT WINAPI ActiveScriptSite_OnEnterScript (IActiveScriptSite *iface)
 
static HRESULT WINAPI ActiveScriptSite_OnLeaveScript (IActiveScriptSite *iface)
 
static ScriptHostimpl_from_IActiveScriptSiteInterruptPoll (IActiveScriptSiteInterruptPoll *iface)
 
static HRESULT WINAPI ActiveScriptSiteInterruptPoll_QueryInterface (IActiveScriptSiteInterruptPoll *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ActiveScriptSiteInterruptPoll_AddRef (IActiveScriptSiteInterruptPoll *iface)
 
static ULONG WINAPI ActiveScriptSiteInterruptPoll_Release (IActiveScriptSiteInterruptPoll *iface)
 
static HRESULT WINAPI ActiveScriptSiteInterruptPoll_QueryContinue (IActiveScriptSiteInterruptPoll *iface)
 
static ScriptHostimpl_from_IActiveScriptSiteWindow (IActiveScriptSiteWindow *iface)
 
static HRESULT WINAPI ActiveScriptSiteWindow_QueryInterface (IActiveScriptSiteWindow *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ActiveScriptSiteWindow_AddRef (IActiveScriptSiteWindow *iface)
 
static ULONG WINAPI ActiveScriptSiteWindow_Release (IActiveScriptSiteWindow *iface)
 
static HRESULT WINAPI ActiveScriptSiteWindow_GetWindow (IActiveScriptSiteWindow *iface, HWND *phwnd)
 
static HRESULT WINAPI ActiveScriptSiteWindow_EnableModeless (IActiveScriptSiteWindow *iface, BOOL fEnable)
 
static ScriptHostimpl_from_IActiveScriptSiteUIControl (IActiveScriptSiteUIControl *iface)
 
static HRESULT WINAPI ActiveScriptSiteUIControl_QueryInterface (IActiveScriptSiteUIControl *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ActiveScriptSiteUIControl_AddRef (IActiveScriptSiteUIControl *iface)
 
static ULONG WINAPI ActiveScriptSiteUIControl_Release (IActiveScriptSiteUIControl *iface)
 
static HRESULT WINAPI ActiveScriptSiteUIControl_GetUIBehavior (IActiveScriptSiteUIControl *iface, SCRIPTUICITEM UicItem, SCRIPTUICHANDLING *pUicHandling)
 
static ScriptHostimpl_from_IActiveScriptSiteDebug (IActiveScriptSiteDebug *iface)
 
static HRESULT WINAPI ActiveScriptSiteDebug_QueryInterface (IActiveScriptSiteDebug *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ActiveScriptSiteDebug_AddRef (IActiveScriptSiteDebug *iface)
 
static ULONG WINAPI ActiveScriptSiteDebug_Release (IActiveScriptSiteDebug *iface)
 
static HRESULT WINAPI ActiveScriptSiteDebug_GetDocumentContextFromPosition (IActiveScriptSiteDebug *iface, CTXARG_T dwSourceContext, ULONG uCharacterOffset, ULONG uNumChars, IDebugDocumentContext **ppsc)
 
static HRESULT WINAPI ActiveScriptSiteDebug_GetApplication (IActiveScriptSiteDebug *iface, IDebugApplication **ppda)
 
static HRESULT WINAPI ActiveScriptSiteDebug_GetRootApplicationNode (IActiveScriptSiteDebug *iface, IDebugApplicationNode **ppdanRoot)
 
static HRESULT WINAPI ActiveScriptSiteDebug_OnScriptErrorDebug (IActiveScriptSiteDebug *iface, IActiveScriptErrorDebug *pErrorDebug, BOOL *pfEnterDebugger, BOOL *pfCallOnScriptErrorWhenContinuing)
 
static ScriptHostimpl_from_IServiceProvider (IServiceProvider *iface)
 
static HRESULT WINAPI ASServiceProvider_QueryInterface (IServiceProvider *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ASServiceProvider_AddRef (IServiceProvider *iface)
 
static ULONG WINAPI ASServiceProvider_Release (IServiceProvider *iface)
 
static HRESULT WINAPI ASServiceProvider_QueryService (IServiceProvider *iface, REFGUID guidService, REFIID riid, void **ppv)
 
static ScriptHostcreate_script_host (HTMLInnerWindow *window, const GUID *guid)
 
static void fire_readystatechange_proc (task_t *_task)
 
static void fire_readystatechange_task_destr (task_t *_task)
 
static void set_script_elem_readystate (HTMLScriptElement *script_elem, READYSTATE readystate)
 
static void parse_elem_text (ScriptHost *script_host, HTMLScriptElement *script_elem, LPCWSTR text)
 
static ScriptBSCimpl_from_BSCallback (BSCallback *iface)
 
static void ScriptBSC_destroy (BSCallback *bsc)
 
static HRESULT ScriptBSC_init_bindinfo (BSCallback *bsc)
 
static HRESULT ScriptBSC_start_binding (BSCallback *bsc)
 
static HRESULT ScriptBSC_stop_binding (BSCallback *bsc, HRESULT result)
 
static HRESULT ScriptBSC_read_data (BSCallback *bsc, IStream *stream)
 
static HRESULT ScriptBSC_on_progress (BSCallback *bsc, ULONG status_code, LPCWSTR status_text)
 
static HRESULT ScriptBSC_on_response (BSCallback *bsc, DWORD response_code, LPCWSTR response_headers)
 
static HRESULT ScriptBSC_beginning_transaction (BSCallback *bsc, WCHAR **additional_headers)
 
static HRESULT bind_script_to_text (HTMLInnerWindow *window, IUri *uri, HTMLScriptElement *script_elem, WCHAR **ret)
 
static void parse_extern_script (ScriptHost *script_host, HTMLScriptElement *script_elem, LPCWSTR src)
 
static void parse_inline_script (ScriptHost *script_host, HTMLScriptElement *script_elem)
 
static void parse_script_elem (ScriptHost *script_host, HTMLScriptElement *script_elem)
 
static GUID get_default_script_guid (HTMLInnerWindow *window)
 
static BOOL get_guid_from_type (LPCWSTR type, GUID *guid)
 
static BOOL get_guid_from_language (LPCWSTR type, GUID *guid)
 
static BOOL get_script_guid (HTMLInnerWindow *window, nsIDOMHTMLScriptElement *nsscript, GUID *guid)
 
static ScriptHostget_script_host (HTMLInnerWindow *window, const GUID *guid)
 
static ScriptHostget_elem_script_host (HTMLInnerWindow *window, HTMLScriptElement *script_elem)
 
void doc_insert_script (HTMLInnerWindow *window, HTMLScriptElement *script_elem)
 
IDispatchscript_parse_event (HTMLInnerWindow *window, LPCWSTR text)
 
HRESULT exec_script (HTMLInnerWindow *window, const WCHAR *code, const WCHAR *lang, VARIANT *ret)
 
IDispatchget_script_disp (ScriptHost *script_host)
 
static EventTargetfind_event_target (HTMLDocumentNode *doc, HTMLScriptElement *script_elem)
 
static BOOL parse_event_str (WCHAR *event, const WCHAR **args)
 
static IDispatchparse_event_elem (HTMLDocumentNode *doc, HTMLScriptElement *script_elem, WCHAR **ret_event)
 
void bind_event_scripts (HTMLDocumentNode *doc)
 
BOOL find_global_prop (HTMLInnerWindow *window, BSTR name, DWORD flags, ScriptHost **ret_host, DISPID *ret_id)
 
static BOOL is_jscript_available (void)
 
void set_script_mode (HTMLOuterWindow *window, SCRIPTMODE mode)
 
void release_script_hosts (HTMLInnerWindow *window)
 

Variables

static const WCHAR documentW [] = {'d','o','c','u','m','e','n','t',0}
 
static const WCHAR windowW [] = {'w','i','n','d','o','w',0}
 
static const WCHAR script_endW [] = {'<','/','S','C','R','I','P','T','>',0}
 
static const WCHAR emptyW [] = {0}
 
static const IActiveScriptSiteVtbl ActiveScriptSiteVtbl
 
static const IActiveScriptSiteInterruptPollVtbl ActiveScriptSiteInterruptPollVtbl
 
static const IActiveScriptSiteWindowVtbl ActiveScriptSiteWindowVtbl
 
static const IActiveScriptSiteUIControlVtbl ActiveScriptSiteUIControlVtbl
 
static const IActiveScriptSiteDebugVtbl ActiveScriptSiteDebugVtbl
 
static const IServiceProviderVtbl ASServiceProviderVtbl
 
static const BSCallbackVtbl ScriptBSCVtbl
 

Macro Definition Documentation

◆ CTXARG_T

#define CTXARG_T   DWORD

Definition at line 36 of file script.c.

◆ IActiveScriptParse_InitNew

#define IActiveScriptParse_InitNew   IActiveScriptParse32_InitNew

Definition at line 40 of file script.c.

◆ IActiveScriptParse_ParseScriptText

#define IActiveScriptParse_ParseScriptText   IActiveScriptParse32_ParseScriptText

Definition at line 41 of file script.c.

◆ IActiveScriptParse_Release

#define IActiveScriptParse_Release   IActiveScriptParse32_Release

Definition at line 39 of file script.c.

◆ IActiveScriptParseProcedure2_ParseProcedureText

#define IActiveScriptParseProcedure2_ParseProcedureText   IActiveScriptParseProcedure2_32_ParseProcedureText

Definition at line 43 of file script.c.

◆ IActiveScriptParseProcedure2_Release

#define IActiveScriptParseProcedure2_Release   IActiveScriptParseProcedure2_32_Release

Definition at line 42 of file script.c.

◆ IActiveScriptSiteDebugVtbl

#define IActiveScriptSiteDebugVtbl   IActiveScriptSiteDebug32Vtbl

Definition at line 37 of file script.c.

Function Documentation

◆ ActiveScriptSite_AddRef()

static ULONG WINAPI ActiveScriptSite_AddRef ( IActiveScriptSite iface)
static

Definition at line 267 of file script.c.

268{
271
272 TRACE("(%p) ref=%d\n", This, ref);
273
274 return ref;
275}
#define InterlockedIncrement
Definition: armddk.h:53
static ScriptHost * impl_from_IActiveScriptSite(IActiveScriptSite *iface)
Definition: script.c:223
long LONG
Definition: pedump.c:60
#define TRACE(s)
Definition: solgame.cpp:4
Definition: send.c:48

◆ ActiveScriptSite_GetDocVersionString()

static HRESULT WINAPI ActiveScriptSite_GetDocVersionString ( IActiveScriptSite iface,
BSTR pbstrVersion 
)
static

Definition at line 331 of file script.c.

332{
334 FIXME("(%p)->(%p)\n", This, pbstrVersion);
335 return E_NOTIMPL;
336}
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ActiveScriptSite_GetItemInfo()

static HRESULT WINAPI ActiveScriptSite_GetItemInfo ( IActiveScriptSite iface,
LPCOLESTR  pstrName,
DWORD  dwReturnMask,
IUnknown **  ppiunkItem,
ITypeInfo **  ppti 
)
static

Definition at line 304 of file script.c.

306{
308
309 TRACE("(%p)->(%s %x %p %p)\n", This, debugstr_w(pstrName), dwReturnMask, ppiunkItem, ppti);
310
311 if(dwReturnMask != SCRIPTINFO_IUNKNOWN) {
312 FIXME("Unsupported mask %x\n", dwReturnMask);
313 return E_NOTIMPL;
314 }
315
316 *ppiunkItem = NULL;
317
318 if(strcmpW(pstrName, windowW))
320
321 if(!This->window)
322 return E_FAIL;
323
324 /* FIXME: Return proxy object */
325 *ppiunkItem = (IUnknown*)&This->window->base.IHTMLWindow2_iface;
326 IUnknown_AddRef(*ppiunkItem);
327
328 return S_OK;
329}
#define E_FAIL
Definition: ddrawi.h:102
#define NULL
Definition: types.h:112
static const WCHAR windowW[]
Definition: script.c:48
#define S_OK
Definition: intsafe.h:52
#define debugstr_w
Definition: kernel32.h:32
#define strcmpW(s1, s2)
Definition: unicode.h:38
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512

◆ ActiveScriptSite_GetLCID()

static HRESULT WINAPI ActiveScriptSite_GetLCID ( IActiveScriptSite iface,
LCID plcid 
)
static

Definition at line 294 of file script.c.

295{
297
298 TRACE("(%p)->(%p)\n", This, plcid);
299
300 *plcid = GetUserDefaultLCID();
301 return S_OK;
302}
LCID WINAPI GetUserDefaultLCID(void)
Definition: lang.c:778

◆ ActiveScriptSite_OnEnterScript()

static HRESULT WINAPI ActiveScriptSite_OnEnterScript ( IActiveScriptSite iface)
static

Definition at line 363 of file script.c.

364{
366
367 TRACE("(%p)->()\n", This);
368
369 return S_OK;
370}

◆ ActiveScriptSite_OnLeaveScript()

static HRESULT WINAPI ActiveScriptSite_OnLeaveScript ( IActiveScriptSite iface)
static

Definition at line 372 of file script.c.

373{
375
376 TRACE("(%p)->()\n", This);
377
378 return S_OK;
379}

◆ ActiveScriptSite_OnScriptError()

static HRESULT WINAPI ActiveScriptSite_OnScriptError ( IActiveScriptSite iface,
IActiveScriptError pscripterror 
)
static

Definition at line 356 of file script.c.

357{
359 FIXME("(%p)->(%p)\n", This, pscripterror);
360 return E_NOTIMPL;
361}

◆ ActiveScriptSite_OnScriptTerminate()

static HRESULT WINAPI ActiveScriptSite_OnScriptTerminate ( IActiveScriptSite iface,
const VARIANT pvarResult,
const EXCEPINFO *  pexcepinfo 
)
static

Definition at line 338 of file script.c.

340{
342 FIXME("(%p)->(%p %p)\n", This, pvarResult, pexcepinfo);
343 return E_NOTIMPL;
344}

◆ ActiveScriptSite_OnStateChange()

static HRESULT WINAPI ActiveScriptSite_OnStateChange ( IActiveScriptSite iface,
SCRIPTSTATE  ssScriptState 
)
static

Definition at line 346 of file script.c.

347{
349
350 TRACE("(%p)->(%x)\n", This, ssScriptState);
351
352 This->script_state = ssScriptState;
353 return S_OK;
354}

◆ ActiveScriptSite_QueryInterface()

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

Definition at line 228 of file script.c.

229{
231
232 *ppv = NULL;
233
235 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
236 *ppv = &This->IActiveScriptSite_iface;
237 }else if(IsEqualGUID(&IID_IActiveScriptSite, riid)) {
238 TRACE("(%p)->(IID_IActiveScriptSite %p)\n", This, ppv);
239 *ppv = &This->IActiveScriptSite_iface;
240 }else if(IsEqualGUID(&IID_IActiveScriptSiteInterruptPoll, riid)) {
241 TRACE("(%p)->(IID_IActiveScriptSiteInterruprtPoll %p)\n", This, ppv);
242 *ppv = &This->IActiveScriptSiteInterruptPoll_iface;
243 }else if(IsEqualGUID(&IID_IActiveScriptSiteWindow, riid)) {
244 TRACE("(%p)->(IID_IActiveScriptSiteWindow %p)\n", This, ppv);
245 *ppv = &This->IActiveScriptSiteWindow_iface;
246 }else if(IsEqualGUID(&IID_IActiveScriptSiteUIControl, riid)) {
247 TRACE("(%p)->(IID_IActiveScriptSiteUIControl %p)\n", This, ppv);
248 *ppv = &This->IActiveScriptSiteUIControl_iface;
249 }else if(IsEqualGUID(&IID_IActiveScriptSiteDebug, riid)) {
250 TRACE("(%p)->(IID_IActiveScriptSiteDebug %p)\n", This, ppv);
251 *ppv = &This->IActiveScriptSiteDebug_iface;
252 }else if(IsEqualGUID(&IID_IServiceProvider, riid)) {
253 TRACE("(%p)->(IID_IServiceProvider %p)\n", This, ppv);
254 *ppv = &This->IServiceProvider_iface;
255 }else if(IsEqualGUID(&IID_ICanHandleException, riid)) {
256 TRACE("(%p)->(IID_ICanHandleException not supported %p)\n", This, ppv);
257 return E_NOINTERFACE;
258 }else {
259 FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
260 return E_NOINTERFACE;
261 }
262
263 IUnknown_AddRef((IUnknown*)*ppv);
264 return S_OK;
265}
const GUID IID_IUnknown
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ ActiveScriptSite_Release()

static ULONG WINAPI ActiveScriptSite_Release ( IActiveScriptSite iface)
static

Definition at line 277 of file script.c.

278{
281
282 TRACE("(%p) ref=%d\n", This, ref);
283
284 if(!ref) {
286 if(This->window)
287 list_remove(&This->entry);
289 }
290
291 return ref;
292}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define InterlockedDecrement
Definition: armddk.h:52
static void list_remove(struct list_entry *entry)
Definition: list.h:90
static void release_script_engine(ScriptHost *This)
Definition: script.c:182

◆ ActiveScriptSiteDebug_AddRef()

static ULONG WINAPI ActiveScriptSiteDebug_AddRef ( IActiveScriptSiteDebug *  iface)
static

Definition at line 540 of file script.c.

541{
543 return IActiveScriptSite_AddRef(&This->IActiveScriptSite_iface);
544}
static ScriptHost * impl_from_IActiveScriptSiteDebug(IActiveScriptSiteDebug *iface)
Definition: script.c:528

◆ ActiveScriptSiteDebug_GetApplication()

static HRESULT WINAPI ActiveScriptSiteDebug_GetApplication ( IActiveScriptSiteDebug *  iface,
IDebugApplication **  ppda 
)
static

Definition at line 561 of file script.c.

562{
564 FIXME("(%p)->(%p)\n", This, ppda);
565 return E_NOTIMPL;
566}

◆ ActiveScriptSiteDebug_GetDocumentContextFromPosition()

static HRESULT WINAPI ActiveScriptSiteDebug_GetDocumentContextFromPosition ( IActiveScriptSiteDebug *  iface,
CTXARG_T  dwSourceContext,
ULONG  uCharacterOffset,
ULONG  uNumChars,
IDebugDocumentContext **  ppsc 
)
static

Definition at line 552 of file script.c.

554{
556 FIXME("(%p)->(%s %u %u %p)\n", This, wine_dbgstr_longlong(dwSourceContext), uCharacterOffset,
557 uNumChars, ppsc);
558 return E_NOTIMPL;
559}
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:49

◆ ActiveScriptSiteDebug_GetRootApplicationNode()

static HRESULT WINAPI ActiveScriptSiteDebug_GetRootApplicationNode ( IActiveScriptSiteDebug *  iface,
IDebugApplicationNode **  ppdanRoot 
)
static

Definition at line 568 of file script.c.

570{
572 FIXME("(%p)->(%p)\n", This, ppdanRoot);
573 return E_NOTIMPL;
574}

◆ ActiveScriptSiteDebug_OnScriptErrorDebug()

static HRESULT WINAPI ActiveScriptSiteDebug_OnScriptErrorDebug ( IActiveScriptSiteDebug *  iface,
IActiveScriptErrorDebug pErrorDebug,
BOOL pfEnterDebugger,
BOOL pfCallOnScriptErrorWhenContinuing 
)
static

Definition at line 576 of file script.c.

578{
580 FIXME("(%p)->(%p %p %p)\n", This, pErrorDebug, pfEnterDebugger, pfCallOnScriptErrorWhenContinuing);
581 return E_NOTIMPL;
582}

◆ ActiveScriptSiteDebug_QueryInterface()

static HRESULT WINAPI ActiveScriptSiteDebug_QueryInterface ( IActiveScriptSiteDebug *  iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 533 of file script.c.

535{
537 return IActiveScriptSite_QueryInterface(&This->IActiveScriptSite_iface, riid, ppv);
538}

◆ ActiveScriptSiteDebug_Release()

static ULONG WINAPI ActiveScriptSiteDebug_Release ( IActiveScriptSiteDebug *  iface)
static

Definition at line 546 of file script.c.

547{
549 return IActiveScriptSite_Release(&This->IActiveScriptSite_iface);
550}

◆ ActiveScriptSiteInterruptPoll_AddRef()

static ULONG WINAPI ActiveScriptSiteInterruptPoll_AddRef ( IActiveScriptSiteInterruptPoll iface)
static

Definition at line 407 of file script.c.

408{
410 return IActiveScriptSite_AddRef(&This->IActiveScriptSite_iface);
411}
static ScriptHost * impl_from_IActiveScriptSiteInterruptPoll(IActiveScriptSiteInterruptPoll *iface)
Definition: script.c:395

◆ ActiveScriptSiteInterruptPoll_QueryContinue()

static HRESULT WINAPI ActiveScriptSiteInterruptPoll_QueryContinue ( IActiveScriptSiteInterruptPoll iface)
static

Definition at line 419 of file script.c.

420{
422
423 TRACE("(%p)\n", This);
424
425 return S_OK;
426}

◆ ActiveScriptSiteInterruptPoll_QueryInterface()

static HRESULT WINAPI ActiveScriptSiteInterruptPoll_QueryInterface ( IActiveScriptSiteInterruptPoll iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 400 of file script.c.

402{
404 return IActiveScriptSite_QueryInterface(&This->IActiveScriptSite_iface, riid, ppv);
405}

◆ ActiveScriptSiteInterruptPoll_Release()

static ULONG WINAPI ActiveScriptSiteInterruptPoll_Release ( IActiveScriptSiteInterruptPoll iface)
static

Definition at line 413 of file script.c.

414{
416 return IActiveScriptSite_Release(&This->IActiveScriptSite_iface);
417}

◆ ActiveScriptSiteUIControl_AddRef()

static ULONG WINAPI ActiveScriptSiteUIControl_AddRef ( IActiveScriptSiteUIControl iface)
static

Definition at line 498 of file script.c.

499{
501 return IActiveScriptSite_AddRef(&This->IActiveScriptSite_iface);
502}
static ScriptHost * impl_from_IActiveScriptSiteUIControl(IActiveScriptSiteUIControl *iface)
Definition: script.c:487

◆ ActiveScriptSiteUIControl_GetUIBehavior()

static HRESULT WINAPI ActiveScriptSiteUIControl_GetUIBehavior ( IActiveScriptSiteUIControl iface,
SCRIPTUICITEM  UicItem,
SCRIPTUICHANDLING pUicHandling 
)
static

Definition at line 510 of file script.c.

512{
514
515 WARN("(%p)->(%d %p) semi-stub\n", This, UicItem, pUicHandling);
516
517 *pUicHandling = SCRIPTUICHANDLING_ALLOW;
518 return S_OK;
519}
@ SCRIPTUICHANDLING_ALLOW
Definition: activscp.idl:76
#define WARN(fmt,...)
Definition: debug.h:112

◆ ActiveScriptSiteUIControl_QueryInterface()

static HRESULT WINAPI ActiveScriptSiteUIControl_QueryInterface ( IActiveScriptSiteUIControl iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 492 of file script.c.

493{
495 return IActiveScriptSite_QueryInterface(&This->IActiveScriptSite_iface, riid, ppv);
496}

◆ ActiveScriptSiteUIControl_Release()

static ULONG WINAPI ActiveScriptSiteUIControl_Release ( IActiveScriptSiteUIControl iface)
static

Definition at line 504 of file script.c.

505{
507 return IActiveScriptSite_Release(&This->IActiveScriptSite_iface);
508}

◆ ActiveScriptSiteWindow_AddRef()

static ULONG WINAPI ActiveScriptSiteWindow_AddRef ( IActiveScriptSiteWindow iface)
static

Definition at line 447 of file script.c.

448{
450 return IActiveScriptSite_AddRef(&This->IActiveScriptSite_iface);
451}
static ScriptHost * impl_from_IActiveScriptSiteWindow(IActiveScriptSiteWindow *iface)
Definition: script.c:435

◆ ActiveScriptSiteWindow_EnableModeless()

static HRESULT WINAPI ActiveScriptSiteWindow_EnableModeless ( IActiveScriptSiteWindow iface,
BOOL  fEnable 
)
static

Definition at line 472 of file script.c.

473{
475 FIXME("(%p)->(%x)\n", This, fEnable);
476 return S_OK;
477}

◆ ActiveScriptSiteWindow_GetWindow()

static HRESULT WINAPI ActiveScriptSiteWindow_GetWindow ( IActiveScriptSiteWindow iface,
HWND phwnd 
)
static

Definition at line 459 of file script.c.

460{
462
463 TRACE("(%p)->(%p)\n", This, phwnd);
464
465 if(!This->window || !This->window->base.outer_window || !This->window->base.outer_window->doc_obj)
466 return E_UNEXPECTED;
467
468 *phwnd = This->window->base.outer_window->doc_obj->hwnd;
469 return S_OK;
470}
#define E_UNEXPECTED
Definition: winerror.h:2456

◆ ActiveScriptSiteWindow_QueryInterface()

static HRESULT WINAPI ActiveScriptSiteWindow_QueryInterface ( IActiveScriptSiteWindow iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 440 of file script.c.

442{
444 return IActiveScriptSite_QueryInterface(&This->IActiveScriptSite_iface, riid, ppv);
445}

◆ ActiveScriptSiteWindow_Release()

static ULONG WINAPI ActiveScriptSiteWindow_Release ( IActiveScriptSiteWindow iface)
static

Definition at line 453 of file script.c.

454{
456 return IActiveScriptSite_Release(&This->IActiveScriptSite_iface);
457}

◆ ASServiceProvider_AddRef()

static ULONG WINAPI ASServiceProvider_AddRef ( IServiceProvider iface)
static

Definition at line 605 of file script.c.

606{
608 return IActiveScriptSite_AddRef(&This->IActiveScriptSite_iface);
609}
static ScriptHost * impl_from_IServiceProvider(IServiceProvider *iface)
Definition: script.c:594

◆ ASServiceProvider_QueryInterface()

static HRESULT WINAPI ASServiceProvider_QueryInterface ( IServiceProvider iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 599 of file script.c.

600{
602 return IActiveScriptSite_QueryInterface(&This->IActiveScriptSite_iface, riid, ppv);
603}

◆ ASServiceProvider_QueryService()

static HRESULT WINAPI ASServiceProvider_QueryService ( IServiceProvider iface,
REFGUID  guidService,
REFIID  riid,
void **  ppv 
)
static

Definition at line 617 of file script.c.

619{
621
622 if(IsEqualGUID(&SID_SInternetHostSecurityManager, guidService)) {
623 TRACE("(%p)->(SID_SInternetHostSecurityManager)\n", This);
624
625 if(!This->window || !This->window->doc)
626 return E_NOINTERFACE;
627
628 return IInternetHostSecurityManager_QueryInterface(&This->window->doc->IInternetHostSecurityManager_iface,
629 riid, ppv);
630 }
631
632 if(IsEqualGUID(&SID_SContainerDispatch, guidService)) {
633 TRACE("(%p)->(SID_SContainerDispatch)\n", This);
634
635 if(!This->window || !This->window->doc)
636 return E_NOINTERFACE;
637
638 return IHTMLDocument2_QueryInterface(&This->window->doc->basedoc.IHTMLDocument2_iface, riid, ppv);
639 }
640
641 FIXME("(%p)->(%s %s %p)\n", This, debugstr_guid(guidService), debugstr_guid(riid), ppv);
642 return E_NOINTERFACE;
643}

◆ ASServiceProvider_Release()

static ULONG WINAPI ASServiceProvider_Release ( IServiceProvider iface)
static

Definition at line 611 of file script.c.

612{
614 return IActiveScriptSite_Release(&This->IActiveScriptSite_iface);
615}

◆ bind_event_scripts()

void bind_event_scripts ( HTMLDocumentNode doc)

Definition at line 1423 of file script.c.

1424{
1425 HTMLPluginContainer *plugin_container;
1426 nsIDOMHTMLScriptElement *nsscript;
1427 HTMLScriptElement *script_elem;
1428 EventTarget *event_target;
1429 nsIDOMNodeList *node_list;
1430 nsIDOMNode *script_node;
1431 nsAString selector_str;
1432 IDispatch *event_disp;
1433 UINT32 length, i;
1434 WCHAR *event;
1435 nsresult nsres;
1436 HRESULT hres;
1437
1438 static const PRUnichar selectorW[] = {'s','c','r','i','p','t','[','e','v','e','n','t',']',0};
1439
1440 TRACE("%p\n", doc);
1441
1442 if(!doc->nsdoc)
1443 return;
1444
1445 nsAString_InitDepend(&selector_str, selectorW);
1446 nsres = nsIDOMHTMLDocument_QuerySelectorAll(doc->nsdoc, &selector_str, &node_list);
1447 nsAString_Finish(&selector_str);
1448 if(NS_FAILED(nsres)) {
1449 ERR("QuerySelectorAll failed: %08x\n", nsres);
1450 return;
1451 }
1452
1453 if(!node_list)
1454 return;
1455
1456 nsres = nsIDOMNodeList_GetLength(node_list, &length);
1457 assert(nsres == NS_OK);
1458
1459 for(i=0; i < length; i++) {
1460 nsres = nsIDOMNodeList_Item(node_list, i, &script_node);
1461 if(NS_FAILED(nsres) || !script_node) {
1462 ERR("Item(%d) failed: %08x\n", i, nsres);
1463 continue;
1464 }
1465
1466 nsres = nsIDOMNode_QueryInterface(script_node, &IID_nsIDOMHTMLScriptElement, (void**)&nsscript);
1467 assert(nsres == NS_OK);
1468 nsIDOMNode_Release(script_node);
1469
1470 hres = script_elem_from_nsscript(doc, nsscript, &script_elem);
1471 if(FAILED(hres))
1472 continue;
1473
1474 event_disp = parse_event_elem(doc, script_elem, &event);
1475 if(event_disp) {
1476 event_target = find_event_target(doc, script_elem);
1477 if(event_target) {
1478 hres = IDispatchEx_QueryInterface(&event_target->dispex.IDispatchEx_iface, &IID_HTMLPluginContainer,
1479 (void**)&plugin_container);
1480 if(SUCCEEDED(hres))
1481 bind_activex_event(doc, plugin_container, event, event_disp);
1482 else
1483 bind_target_event(doc, event_target, event, event_disp);
1484
1485 IDispatchEx_Release(&event_target->dispex.IDispatchEx_iface);
1486 if(plugin_container)
1487 node_release(&plugin_container->element.node);
1488 }
1489
1491 IDispatch_Release(event_disp);
1492 }
1493
1494 IHTMLScriptElement_Release(&script_elem->IHTMLScriptElement_iface);
1495 }
1496
1497 nsIDOMNodeList_Release(node_list);
1498}
unsigned int UINT32
#define ERR(fmt,...)
Definition: debug.h:110
static IDispatch * parse_event_elem(HTMLDocumentNode *doc, HTMLScriptElement *script_elem, WCHAR **ret_event)
Definition: script.c:1363
static EventTarget * find_event_target(HTMLDocumentNode *doc, HTMLScriptElement *script_elem)
Definition: script.c:1296
#define assert(x)
Definition: debug.h:53
struct _cl_event * event
Definition: glext.h:7739
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
void bind_target_event(HTMLDocumentNode *doc, EventTarget *event_target, const WCHAR *event, IDispatch *disp)
Definition: htmlevent.c:1534
HRESULT script_elem_from_nsscript(HTMLDocumentNode *doc, nsIDOMHTMLScriptElement *nsscript, HTMLScriptElement **ret)
Definition: htmlscript.c:425
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT hres
Definition: protocol.c:465
#define NS_OK
void nsAString_Finish(nsAString *) DECLSPEC_HIDDEN
Definition: nsembed.c:836
void nsAString_InitDepend(nsAString *, const PRUnichar *) DECLSPEC_HIDDEN
Definition: nsembed.c:826
static void node_release(HTMLDOMNode *node)
#define NS_FAILED(res)
WCHAR PRUnichar
Definition: nsiface.idl:48
void bind_activex_event(HTMLDocumentNode *doc, HTMLPluginContainer *plugin_container, WCHAR *event, IDispatch *disp)
Definition: pluginhost.c:758
IDispatchEx IDispatchEx_iface
DispatchEx dispex
nsIDOMHTMLDocument * nsdoc
HTMLDOMNode node
HTMLElement element
Definition: pluginhost.h:54
IHTMLScriptElement IHTMLScriptElement_iface
Definition: htmlscript.h:24
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by run_end_load().

◆ bind_script_to_text()

static HRESULT bind_script_to_text ( HTMLInnerWindow window,
IUri uri,
HTMLScriptElement script_elem,
WCHAR **  ret 
)
static

Definition at line 884 of file script.c.

885{
886 UINT cp = CP_UTF8;
887 ScriptBSC *bsc;
888 IMoniker *mon;
889 WCHAR *text;
891
892 hres = CreateURLMonikerEx2(NULL, uri, &mon, URL_MK_UNIFORM);
893 if(FAILED(hres))
894 return hres;
895
896 bsc = heap_alloc_zero(sizeof(*bsc));
897 if(!bsc) {
898 IMoniker_Release(mon);
899 return E_OUTOFMEMORY;
900 }
901
902 init_bscallback(&bsc->bsc, &ScriptBSCVtbl, mon, 0);
903 IMoniker_Release(mon);
904 bsc->hres = E_FAIL;
905
906 hres = IUri_GetScheme(uri, &bsc->scheme);
907 if(FAILED(hres))
908 bsc->scheme = URL_SCHEME_UNKNOWN;
909
910 IHTMLScriptElement_AddRef(&script_elem->IHTMLScriptElement_iface);
911 bsc->script_elem = script_elem;
912
913 hres = start_binding(window, &bsc->bsc, NULL);
914 if(SUCCEEDED(hres))
915 hres = bsc->hres;
916 if(FAILED(hres)) {
917 IBindStatusCallback_Release(&bsc->bsc.IBindStatusCallback_iface);
918 return hres;
919 }
920
921 if(!bsc->bsc.readed) {
922 *ret = NULL;
923 return S_OK;
924 }
925
926 switch(bsc->bsc.bom) {
927 case BOM_UTF16:
928 if(bsc->bsc.readed % sizeof(WCHAR)) {
929 FIXME("The buffer is not a valid utf16 string\n");
930 hres = E_FAIL;
931 break;
932 }
933
934 text = heap_alloc(bsc->bsc.readed+sizeof(WCHAR));
935 if(!text) {
937 break;
938 }
939
940 memcpy(text, bsc->buf, bsc->bsc.readed);
941 text[bsc->bsc.readed/sizeof(WCHAR)] = 0;
942 break;
943
944 default:
945 /* FIXME: Try to use charset from HTTP headers first */
947 /* fall through */
948 case BOM_UTF8: {
949 DWORD len;
950
951 len = MultiByteToWideChar(cp, 0, bsc->buf, bsc->bsc.readed, NULL, 0);
952 text = heap_alloc((len+1)*sizeof(WCHAR));
953 if(!text) {
955 break;
956 }
957
958 MultiByteToWideChar(cp, 0, bsc->buf, bsc->bsc.readed, text, len);
959 text[len] = 0;
960 }
961 }
962
963 IBindStatusCallback_Release(&bsc->bsc.IBindStatusCallback_iface);
964 if(FAILED(hres))
965 return hres;
966
967 *ret = text;
968 return S_OK;
969}
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
@ BOM_UTF8
Definition: binding.h:32
@ BOM_UTF16
Definition: binding.h:33
void init_bscallback(BSCallback *, const BSCallbackVtbl *, IMoniker *, DWORD) DECLSPEC_HIDDEN
Definition: navigate.c:584
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define MultiByteToWideChar
Definition: compat.h:110
UINT get_document_charset(HTMLDocumentNode *doc)
Definition: htmldoc.c:96
static const BSCallbackVtbl ScriptBSCVtbl
Definition: script.c:872
const WCHAR * text
Definition: package.c:1799
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
POINT cp
Definition: magnifier.c:59
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static IHTMLWindow2 * window
Definition: events.c:77
const char * uri
Definition: sec_mgr.c:1588
static IBindStatusCallbackEx bsc
Definition: url.c:2150
HRESULT start_binding(HTMLInnerWindow *, BSCallback *, IBindCtx *) DECLSPEC_HIDDEN
Definition: navigate.c:762
unsigned int UINT
Definition: ndis.h:50
#define CP_UTF8
Definition: nls.h:20
@ URL_SCHEME_UNKNOWN
Definition: shlwapi.h:1146
HRESULT WINAPI CreateURLMonikerEx2(IMoniker *pmkContext, IUri *pUri, IMoniker **ppmk, DWORD dwFlags)
Definition: umon.c:668
int ret

Referenced by parse_extern_script().

◆ connect_scripts()

void connect_scripts ( HTMLInnerWindow window)

Definition at line 213 of file script.c.

214{
215 ScriptHost *iter;
216
217 LIST_FOR_EACH_ENTRY(iter, &window->script_hosts, ScriptHost, entry) {
219 IActiveScript_SetScriptState(iter->script, SCRIPTSTATE_CONNECTED);
220 }
221}
@ SCRIPTSTATE_STARTED
Definition: activscp.idl:58
@ SCRIPTSTATE_CONNECTED
Definition: activscp.idl:59
uint32_t entry
Definition: isohybrid.c:63
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
IActiveScript * script
Definition: script.c:62
SCRIPTSTATE script_state
Definition: script.c:66

Referenced by handle_load().

◆ create_script_host()

static ScriptHost * create_script_host ( HTMLInnerWindow window,
const GUID guid 
)
static

Definition at line 652 of file script.c.

653{
656
657 ret = heap_alloc_zero(sizeof(*ret));
658 if(!ret)
659 return NULL;
660
661 ret->IActiveScriptSite_iface.lpVtbl = &ActiveScriptSiteVtbl;
662 ret->IActiveScriptSiteInterruptPoll_iface.lpVtbl = &ActiveScriptSiteInterruptPollVtbl;
663 ret->IActiveScriptSiteWindow_iface.lpVtbl = &ActiveScriptSiteWindowVtbl;
664 ret->IActiveScriptSiteUIControl_iface.lpVtbl = &ActiveScriptSiteUIControlVtbl;
665 ret->IActiveScriptSiteDebug_iface.lpVtbl = &ActiveScriptSiteDebugVtbl;
666 ret->IServiceProvider_iface.lpVtbl = &ASServiceProviderVtbl;
667 ret->ref = 1;
668 ret->window = window;
669 ret->script_state = SCRIPTSTATE_UNINITIALIZED;
670
671 ret->guid = *guid;
672 list_add_tail(&window->script_hosts, &ret->entry);
673
674 hres = CoCreateInstance(&ret->guid, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
675 &IID_IActiveScript, (void**)&ret->script);
676 if(FAILED(hres))
677 WARN("Could not load script engine: %08x\n", hres);
678 else if(!init_script_engine(ret))
680
681 return ret;
682}
@ SCRIPTSTATE_UNINITIALIZED
Definition: activscp.idl:57
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
static const IActiveScriptSiteDebugVtbl ActiveScriptSiteDebugVtbl
Definition: script.c:584
static const IActiveScriptSiteWindowVtbl ActiveScriptSiteWindowVtbl
Definition: script.c:479
static const IActiveScriptSiteInterruptPollVtbl ActiveScriptSiteInterruptPollVtbl
Definition: script.c:428
static const IActiveScriptSiteUIControlVtbl ActiveScriptSiteUIControlVtbl
Definition: script.c:521
static const IServiceProviderVtbl ASServiceProviderVtbl
Definition: script.c:645
static const IActiveScriptSiteVtbl ActiveScriptSiteVtbl
Definition: script.c:381
static BOOL init_script_engine(ScriptHost *script_host)
Definition: script.c:92
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
const GUID * guid

Referenced by get_script_host().

◆ doc_insert_script()

void doc_insert_script ( HTMLInnerWindow window,
HTMLScriptElement script_elem 
)

Definition at line 1172 of file script.c.

1173{
1174 ScriptHost *script_host;
1175
1176 script_host = get_elem_script_host(window, script_elem);
1177 if(!script_host)
1178 return;
1179
1180 if(script_host->parse)
1181 parse_script_elem(script_host, script_elem);
1182}
static void parse_script_elem(ScriptHost *script_host, HTMLScriptElement *script_elem)
Definition: script.c:1015
static ScriptHost * get_elem_script_host(HTMLInnerWindow *window, HTMLScriptElement *script_elem)
Definition: script.c:1154
IActiveScriptParse * parse
Definition: script.c:63

Referenced by HTMLScriptElement_put_src(), HTMLScriptElement_put_text(), and run_insert_script().

◆ exec_script()

HRESULT exec_script ( HTMLInnerWindow window,
const WCHAR code,
const WCHAR lang,
VARIANT ret 
)

Definition at line 1245 of file script.c.

1246{
1247 ScriptHost *script_host;
1248 EXCEPINFO ei;
1249 GUID guid;
1250 HRESULT hres;
1251
1252 static const WCHAR delimW[] = {'"',0};
1253
1255 WARN("Could not find script GUID\n");
1256 return CO_E_CLASSSTRING;
1257 }
1258
1259 script_host = get_script_host(window, &guid);
1260 if(!script_host) {
1261 FIXME("No script host\n");
1262 return E_FAIL;
1263 }
1264
1265 if(!script_host->parse) {
1266 FIXME("script_host->parse == NULL\n");
1267 return E_FAIL;
1268 }
1269
1270 memset(&ei, 0, sizeof(ei));
1271 TRACE(">>>\n");
1272 hres = IActiveScriptParse_ParseScriptText(script_host->parse, code, NULL, NULL, delimW, 0, 0, SCRIPTTEXT_ISVISIBLE, ret, &ei);
1273 if(SUCCEEDED(hres))
1274 TRACE("<<<\n");
1275 else
1276 WARN("<<< %08x\n", hres);
1277
1278 return hres;
1279}
static ScriptHost * get_script_host(HTMLInnerWindow *window, const GUID *guid)
Definition: script.c:1142
#define IActiveScriptParse_ParseScriptText
Definition: script.c:41
static BOOL get_guid_from_language(LPCWSTR type, GUID *guid)
Definition: script.c:1085
struct stdole::EXCEPINFO EXCEPINFO
#define memset(x, y, z)
Definition: compat.h:39
Definition: inflate.c:139
static const WCHAR lang[]
Definition: wbemdisp.c:287
#define CO_E_CLASSSTRING
Definition: winerror.h:2806

Referenced by create_vbdisp(), exec_global_code(), HTMLWindow2_execScript(), invoke_vbdisp(), navigate_javascript_proc(), run_terminator(), and ScriptDisp_InvokeEx().

◆ find_event_target()

static EventTarget * find_event_target ( HTMLDocumentNode doc,
HTMLScriptElement script_elem 
)
static

Definition at line 1296 of file script.c.

1297{
1298 EventTarget *event_target = NULL;
1299 const PRUnichar *target_id;
1300 nsAString target_id_str;
1301 nsresult nsres;
1302 HRESULT hres;
1303
1304 nsAString_Init(&target_id_str, NULL);
1305 nsres = nsIDOMHTMLScriptElement_GetHtmlFor(script_elem->nsscript, &target_id_str);
1306 if(NS_FAILED(nsres)) {
1307 ERR("GetScriptFor failed: %08x\n", nsres);
1308 nsAString_Finish(&target_id_str);
1309 return NULL;
1310 }
1311
1312 nsAString_GetData(&target_id_str, &target_id);
1313 if(!*target_id) {
1314 FIXME("Empty for attribute\n");
1315 }else if(!strcmpW(target_id, documentW)) {
1316 event_target = &doc->node.event_target;
1317 htmldoc_addref(&doc->basedoc);
1318 }else if(!strcmpW(target_id, windowW)) {
1319 if(doc->window) {
1320 event_target = &doc->window->event_target;
1321 IDispatchEx_AddRef(&event_target->dispex.IDispatchEx_iface);
1322 }
1323 }else {
1324 HTMLElement *target_elem;
1325
1326 hres = get_doc_elem_by_id(doc, target_id, &target_elem);
1327 if(SUCCEEDED(hres) && target_elem) {
1328 event_target = &target_elem->node.event_target;
1329 }
1330 }
1331
1332 nsAString_Finish(&target_id_str);
1333 return event_target;
1334}
HRESULT get_doc_elem_by_id(HTMLDocumentNode *doc, const WCHAR *id, HTMLElement **ret)
Definition: htmldoc.c:23
static const WCHAR documentW[]
Definition: script.c:47
UINT32 nsAString_GetData(const nsAString *, const PRUnichar **) DECLSPEC_HIDDEN
Definition: nsembed.c:831
BOOL nsAString_Init(nsAString *, const PRUnichar *) DECLSPEC_HIDDEN
Definition: nsembed.c:817
static ULONG htmldoc_addref(HTMLDocument *This)
EventTarget event_target
HTMLDOMNode node
HTMLDocument basedoc
HTMLInnerWindow * window
EventTarget event_target
nsIDOMHTMLScriptElement * nsscript
Definition: htmlscript.h:26

Referenced by bind_event_scripts().

◆ find_global_prop()

BOOL find_global_prop ( HTMLInnerWindow window,
BSTR  name,
DWORD  flags,
ScriptHost **  ret_host,
DISPID ret_id 
)

Definition at line 1500 of file script.c.

1501{
1502 IDispatchEx *dispex;
1503 IDispatch *disp;
1504 ScriptHost *iter;
1505 HRESULT hres;
1506
1507 LIST_FOR_EACH_ENTRY(iter, &window->script_hosts, ScriptHost, entry) {
1508 disp = get_script_disp(iter);
1509 if(!disp)
1510 continue;
1511
1512 hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);
1513 if(SUCCEEDED(hres)) {
1514 hres = IDispatchEx_GetDispID(dispex, name, flags & (~fdexNameEnsure), ret_id);
1515 IDispatchEx_Release(dispex);
1516 }else {
1517 FIXME("No IDispatchEx\n");
1518 hres = E_NOTIMPL;
1519 }
1520
1521 IDispatch_Release(disp);
1522 if(SUCCEEDED(hres)) {
1523 *ret_host = iter;
1524 return TRUE;
1525 }
1526 }
1527
1528 return FALSE;
1529}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
IDispatch * get_script_disp(ScriptHost *script_host)
Definition: script.c:1281
GLbitfield flags
Definition: glext.h:7161
Definition: name.c:39

Referenced by search_window_props().

◆ fire_readystatechange_proc()

static void fire_readystatechange_proc ( task_t _task)
static

Definition at line 689 of file script.c.

690{
692
694 return;
695
698}
void fire_event(HTMLDocumentNode *doc, eventid_t eid, BOOL set_event, nsIDOMNode *target, nsIDOMEvent *nsevent, IDispatch *script_this)
Definition: htmlevent.c:1195
@ EVENTID_READYSTATECHANGE
Definition: htmlevent.h:47
nsIDOMNode * nsnode
HTMLDocumentNode * doc
BOOL pending_readystatechange_event
Definition: htmlscript.h:29
HTMLElement element
Definition: htmlscript.h:22
HTMLScriptElement * elem
Definition: script.c:686

Referenced by set_script_elem_readystate().

◆ fire_readystatechange_task_destr()

static void fire_readystatechange_task_destr ( task_t _task)
static

Definition at line 700 of file script.c.

701{
703
704 IHTMLScriptElement_Release(&task->elem->IHTMLScriptElement_iface);
705}

Referenced by set_script_elem_readystate().

◆ get_default_script_guid()

static GUID get_default_script_guid ( HTMLInnerWindow window)
static

Definition at line 1055 of file script.c.

1056{
1057 /* If not specified, we should use very first script host that was created for the page (or JScript if none) */
1058 return list_empty(&window->script_hosts)
1060 : LIST_ENTRY(list_head(&window->script_hosts), ScriptHost, entry)->guid;
1061}
static int list_empty(struct list_entry *head)
Definition: list.h:58
static const CLSID CLSID_JScript
Definition: activex.c:57
Definition: list.h:15
#define LIST_ENTRY(type)
Definition: queue.h:175

Referenced by get_script_guid(), and script_parse_event().

◆ get_elem_script_host()

static ScriptHost * get_elem_script_host ( HTMLInnerWindow window,
HTMLScriptElement script_elem 
)
static

Definition at line 1154 of file script.c.

1155{
1156 GUID guid;
1157
1158 if(!get_script_guid(window, script_elem->nsscript, &guid)) {
1159 WARN("Could not find script GUID\n");
1160 return NULL;
1161 }
1162
1164 && (!window->base.outer_window || window->base.outer_window->scriptmode != SCRIPTMODE_ACTIVESCRIPT)) {
1165 TRACE("Ignoring JScript\n");
1166 return NULL;
1167 }
1168
1169 return get_script_host(window, &guid);
1170}
static BOOL get_script_guid(HTMLInnerWindow *window, nsIDOMHTMLScriptElement *nsscript, GUID *guid)
Definition: script.c:1098
@ SCRIPTMODE_ACTIVESCRIPT

Referenced by doc_insert_script(), and parse_event_elem().

◆ get_guid_from_language()

static BOOL get_guid_from_language ( LPCWSTR  type,
GUID guid 
)
static

Definition at line 1085 of file script.c.

1086{
1087 HRESULT hres;
1088
1090 if(FAILED(hres))
1091 return FALSE;
1092
1093 /* FIXME: Check CATID_ActiveScriptParse */
1094
1095 return TRUE;
1096}
HRESULT WINAPI DECLSPEC_HOTPATCH CLSIDFromProgID(LPCOLESTR progid, LPCLSID clsid)
Definition: compobj.c:2602
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545

Referenced by exec_script(), get_script_guid(), and script_parse_event().

◆ get_guid_from_type()

static BOOL get_guid_from_type ( LPCWSTR  type,
GUID guid 
)
static

Definition at line 1063 of file script.c.

1064{
1065 const WCHAR text_javascriptW[] =
1066 {'t','e','x','t','/','j','a','v','a','s','c','r','i','p','t',0};
1067 const WCHAR text_jscriptW[] =
1068 {'t','e','x','t','/','j','s','c','r','i','p','t',0};
1069 const WCHAR text_vbscriptW[] =
1070 {'t','e','x','t','/','v','b','s','c','r','i','p','t',0};
1071
1072 /* FIXME: Handle more types */
1073 if(!strcmpiW(type, text_javascriptW) || !strcmpiW(type, text_jscriptW)) {
1075 }else if(!strcmpiW(type, text_vbscriptW)) {
1077 }else {
1078 FIXME("Unknown type %s\n", debugstr_w(type));
1079 return FALSE;
1080 }
1081
1082 return TRUE;
1083}
const CLSID CLSID_VBScript
#define strcmpiW(s1, s2)
Definition: unicode.h:39

Referenced by get_script_guid().

◆ get_script_disp()

IDispatch * get_script_disp ( ScriptHost script_host)

Definition at line 1281 of file script.c.

1282{
1283 IDispatch *disp;
1284 HRESULT hres;
1285
1286 if(!script_host->script)
1287 return NULL;
1288
1289 hres = IActiveScript_GetScriptDispatch(script_host->script, windowW, &disp);
1290 if(FAILED(hres))
1291 return NULL;
1292
1293 return disp;
1294}

Referenced by find_global_prop(), and HTMLWindow_invoke().

◆ get_script_guid()

static BOOL get_script_guid ( HTMLInnerWindow window,
nsIDOMHTMLScriptElement nsscript,
GUID guid 
)
static

Definition at line 1098 of file script.c.

1099{
1100 nsIDOMHTMLElement *nselem;
1101 const PRUnichar *language;
1102 nsAString val_str;
1103 BOOL ret = FALSE;
1104 nsresult nsres;
1105
1106 static const PRUnichar languageW[] = {'l','a','n','g','u','a','g','e',0};
1107
1108 nsAString_Init(&val_str, NULL);
1109
1110 nsres = nsIDOMHTMLScriptElement_GetType(nsscript, &val_str);
1111 if(NS_SUCCEEDED(nsres)) {
1112 const PRUnichar *type;
1113
1114 nsAString_GetData(&val_str, &type);
1115 if(*type) {
1117 nsAString_Finish(&val_str);
1118 return ret;
1119 }
1120 }else {
1121 ERR("GetType failed: %08x\n", nsres);
1122 }
1123
1124 nsres = nsIDOMHTMLScriptElement_QueryInterface(nsscript, &IID_nsIDOMHTMLElement, (void**)&nselem);
1125 assert(nsres == NS_OK);
1126
1127 nsres = get_elem_attr_value(nselem, languageW, &val_str, &language);
1128 nsIDOMHTMLElement_Release(nselem);
1129 if(NS_SUCCEEDED(nsres)) {
1130 if(*language) {
1131 ret = get_guid_from_language(language, guid);
1132 }else {
1134 ret = TRUE;
1135 }
1136 nsAString_Finish(&val_str);
1137 }
1138
1139 return ret;
1140}
static BOOL get_guid_from_type(LPCWSTR type, GUID *guid)
Definition: script.c:1063
static GUID get_default_script_guid(HTMLInnerWindow *window)
Definition: script.c:1055
unsigned int BOOL
Definition: ntddk_ex.h:94
nsresult get_elem_attr_value(nsIDOMHTMLElement *nselem, const WCHAR *name, nsAString *val_str, const PRUnichar **val)
Definition: htmlelem.c:143
static const WCHAR languageW[]
Definition: htmlelem.c:1130
#define NS_SUCCEEDED(res)

Referenced by get_elem_script_host().

◆ get_script_host()

static ScriptHost * get_script_host ( HTMLInnerWindow window,
const GUID guid 
)
static

Definition at line 1142 of file script.c.

1143{
1144 ScriptHost *iter;
1145
1146 LIST_FOR_EACH_ENTRY(iter, &window->script_hosts, ScriptHost, entry) {
1147 if(IsEqualGUID(guid, &iter->guid))
1148 return iter;
1149 }
1150
1152}
static ScriptHost * create_script_host(HTMLInnerWindow *window, const GUID *guid)
Definition: script.c:652
GUID guid
Definition: script.c:70

Referenced by exec_script(), get_elem_script_host(), and script_parse_event().

◆ impl_from_BSCallback()

static ScriptBSC * impl_from_BSCallback ( BSCallback iface)
inlinestatic

Definition at line 772 of file script.c.

773{
774 return CONTAINING_RECORD(iface, ScriptBSC, bsc);
775}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by ScriptBSC_destroy(), ScriptBSC_read_data(), ScriptBSC_start_binding(), and ScriptBSC_stop_binding().

◆ impl_from_IActiveScriptSite()

◆ impl_from_IActiveScriptSiteDebug()

◆ impl_from_IActiveScriptSiteInterruptPoll()

static ScriptHost * impl_from_IActiveScriptSiteInterruptPoll ( IActiveScriptSiteInterruptPoll iface)
inlinestatic

◆ impl_from_IActiveScriptSiteUIControl()

static ScriptHost * impl_from_IActiveScriptSiteUIControl ( IActiveScriptSiteUIControl iface)
inlinestatic

◆ impl_from_IActiveScriptSiteWindow()

static ScriptHost * impl_from_IActiveScriptSiteWindow ( IActiveScriptSiteWindow iface)
inlinestatic

◆ impl_from_IServiceProvider()

static ScriptHost * impl_from_IServiceProvider ( IServiceProvider iface)
inlinestatic

Definition at line 594 of file script.c.

595{
596 return CONTAINING_RECORD(iface, ScriptHost, IServiceProvider_iface);
597}

Referenced by ASServiceProvider_AddRef(), ASServiceProvider_QueryInterface(), ASServiceProvider_QueryService(), and ASServiceProvider_Release().

◆ init_script_engine()

static BOOL init_script_engine ( ScriptHost script_host)
static

Definition at line 92 of file script.c.

93{
94 IObjectSafety *safety;
96 DWORD supported_opts=0, enabled_opts=0;
99
100 hres = IActiveScript_QueryInterface(script_host->script, &IID_IActiveScriptParse, (void**)&script_host->parse);
101 if(FAILED(hres)) {
102 WARN("Could not get IActiveScriptHost: %08x\n", hres);
103 return FALSE;
104 }
105
106 hres = IActiveScript_QueryInterface(script_host->script, &IID_IObjectSafety, (void**)&safety);
107 if(FAILED(hres)) {
108 FIXME("Could not get IObjectSafety: %08x\n", hres);
109 return FALSE;
110 }
111
112 hres = IObjectSafety_GetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse, &supported_opts, &enabled_opts);
113 if(FAILED(hres)) {
114 FIXME("GetInterfaceSafetyOptions failed: %08x\n", hres);
115 }else if(!(supported_opts & INTERFACE_USES_DISPEX)) {
116 FIXME("INTERFACE_USES_DISPEX is not supported\n");
117 }else {
118 hres = IObjectSafety_SetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse,
119 INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER,
120 INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER);
121 if(FAILED(hres))
122 FIXME("SetInterfaceSafetyOptions failed: %08x\n", hres);
123 }
124
125 IObjectSafety_Release(safety);
126 if(FAILED(hres))
127 return FALSE;
128
129 V_VT(&var) = VT_I4;
130 V_I4(&var) = 1;
131 set_script_prop(script_host, SCRIPTPROP_INVOKEVERSIONING, &var);
132
133 V_VT(&var) = VT_BOOL;
134 V_BOOL(&var) = VARIANT_TRUE;
135 set_script_prop(script_host, SCRIPTPROP_HACK_TRIDENTEVENTSINK, &var);
136
137 hres = IActiveScriptParse_InitNew(script_host->parse);
138 if(FAILED(hres)) {
139 WARN("InitNew failed: %08x\n", hres);
140 return FALSE;
141 }
142
143 hres = IActiveScript_SetScriptSite(script_host->script, &script_host->IActiveScriptSite_iface);
144 if(FAILED(hres)) {
145 WARN("SetScriptSite failed: %08x\n", hres);
146 IActiveScript_Close(script_host->script);
147 return FALSE;
148 }
149
150 hres = IActiveScript_GetScriptState(script_host->script, &state);
151 if(FAILED(hres))
152 WARN("GetScriptState failed: %08x\n", hres);
154 FIXME("state = %x\n", state);
155
156 hres = IActiveScript_SetScriptState(script_host->script, SCRIPTSTATE_STARTED);
157 if(FAILED(hres)) {
158 WARN("Starting script failed: %08x\n", hres);
159 return FALSE;
160 }
161
162 hres = IActiveScript_AddNamedItem(script_host->script, windowW,
163 SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS);
164 if(SUCCEEDED(hres)) {
165 V_VT(&var) = VT_BOOL;
166 V_BOOL(&var) = VARIANT_TRUE;
167 set_script_prop(script_host, SCRIPTPROP_ABBREVIATE_GLOBALNAME_RESOLUTION, &var);
168 }else {
169 WARN("AddNamedItem failed: %08x\n", hres);
170 }
171
172 hres = IActiveScript_QueryInterface(script_host->script, &IID_IActiveScriptParseProcedure2,
173 (void**)&script_host->parse_proc);
174 if(FAILED(hres)) {
175 /* FIXME: QI for IActiveScriptParseProcedure */
176 WARN("Could not get IActiveScriptParseProcedure iface: %08x\n", hres);
177 }
178
179 return TRUE;
180}
@ SCRIPTSTATE_INITIALIZED
Definition: activscp.idl:62
enum tagSCRIPTSTATE SCRIPTSTATE
static int state
Definition: maze.c:121
@ VT_I4
Definition: compat.h:2298
@ VT_BOOL
Definition: compat.h:2306
#define IActiveScriptParse_InitNew
Definition: script.c:40
static void set_script_prop(ScriptHost *script_host, DWORD property, VARIANT *val)
Definition: script.c:74
const char * var
Definition: shader.c:5666
#define V_BOOL(A)
Definition: oleauto.h:224
#define V_VT(A)
Definition: oleauto.h:211
#define V_I4(A)
Definition: oleauto.h:247
IActiveScriptSite IActiveScriptSite_iface
Definition: script.c:53
IActiveScriptParseProcedure2 * parse_proc
Definition: script.c:64

Referenced by create_script_host().

◆ is_jscript_available()

static BOOL is_jscript_available ( void  )
static

Definition at line 1531 of file script.c.

1532{
1533 static BOOL available, checked;
1534
1535 if(!checked) {
1536 IUnknown *unk;
1537 HRESULT hres = CoGetClassObject(&CLSID_JScript, CLSCTX_INPROC_SERVER, NULL, &IID_IUnknown, (void**)&unk);
1538
1539 if(SUCCEEDED(hres)) {
1540 available = TRUE;
1541 IUnknown_Release(unk);
1542 }else {
1543 available = FALSE;
1544 }
1545 checked = TRUE;
1546 }
1547
1548 return available;
1549}
static WCHAR available[MAX_STRING_RESOURCE_LEN]
Definition: object.c:2336
HRESULT WINAPI DECLSPEC_HOTPATCH CoGetClassObject(REFCLSID rclsid, DWORD dwClsContext, COSERVERINFO *pServerInfo, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3103

Referenced by set_script_mode().

◆ parse_elem_text()

static void parse_elem_text ( ScriptHost script_host,
HTMLScriptElement script_elem,
LPCWSTR  text 
)
static

Definition at line 738 of file script.c.

739{
741 VARIANT var;
743
744 TRACE("%s\n", debugstr_w(text));
745
746 set_script_elem_readystate(script_elem, READYSTATE_INTERACTIVE);
747
749 memset(&excepinfo, 0, sizeof(excepinfo));
750 TRACE(">>>\n");
752 0, 0, SCRIPTTEXT_ISVISIBLE|SCRIPTTEXT_HOSTMANAGESSOURCE,
753 &var, &excepinfo);
754 if(SUCCEEDED(hres))
755 TRACE("<<<\n");
756 else
757 WARN("<<< %08x\n", hres);
758
759}
static const WCHAR script_endW[]
Definition: script.c:49
static void set_script_elem_readystate(HTMLScriptElement *script_elem, READYSTATE readystate)
Definition: script.c:707
static EXCEPINFO excepinfo
Definition: automation.c:50
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568

Referenced by parse_extern_script(), and parse_inline_script().

◆ parse_event_elem()

static IDispatch * parse_event_elem ( HTMLDocumentNode doc,
HTMLScriptElement script_elem,
WCHAR **  ret_event 
)
static

Definition at line 1363 of file script.c.

1364{
1365 ScriptHost *script_host;
1366 WCHAR *event = NULL;
1367 const WCHAR *args;
1368 nsAString nsstr;
1369 IDispatch *disp;
1370 nsresult nsres;
1371 HRESULT hres;
1372
1373 if(script_elem->parsed)
1374 return NULL;
1375
1376 script_host = get_elem_script_host(doc->window, script_elem);
1377 if(!script_host || !script_host->parse_proc)
1378 return NULL;
1379
1380 nsAString_Init(&nsstr, NULL);
1381 nsres = nsIDOMHTMLScriptElement_GetEvent(script_elem->nsscript, &nsstr);
1382 if(NS_SUCCEEDED(nsres)) {
1383 const PRUnichar *event_val;
1384
1385 nsAString_GetData(&nsstr, &event_val);
1386 event = heap_strdupW(event_val);
1387 }
1388 nsAString_Finish(&nsstr);
1389 if(!event)
1390 return NULL;
1391
1392 if(!parse_event_str(event, &args)) {
1393 WARN("parsing %s failed\n", debugstr_w(event));
1395 return NULL;
1396 }
1397
1398 nsAString_Init(&nsstr, NULL);
1399 nsres = nsIDOMHTMLScriptElement_GetText(script_elem->nsscript, &nsstr);
1400 if(NS_SUCCEEDED(nsres)) {
1401 const PRUnichar *text;
1402
1403 nsAString_GetData(&nsstr, &text);
1405 emptyW, NULL, NULL, script_endW, 0, 0,
1406 SCRIPTPROC_HOSTMANAGESSOURCE|SCRIPTPROC_IMPLICIT_THIS|SCRIPTPROC_IMPLICIT_PARENTS, &disp);
1407 if(FAILED(hres))
1408 disp = NULL;
1409 }else {
1410 ERR("GetText failed: %08x\n", nsres);
1411 disp = NULL;
1412 }
1413 nsAString_Finish(&nsstr);
1414 if(!disp) {
1416 return NULL;
1417 }
1418
1419 *ret_event = event;
1420 return disp;
1421}
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:178
#define IActiveScriptParseProcedure2_ParseProcedureText
Definition: script.c:43
static const WCHAR emptyW[]
Definition: script.c:50
static BOOL parse_event_str(WCHAR *event, const WCHAR **args)
Definition: script.c:1336
#define args
Definition: format.c:66
Definition: match.c:390

Referenced by bind_event_scripts().

◆ parse_event_str()

static BOOL parse_event_str ( WCHAR event,
const WCHAR **  args 
)
static

Definition at line 1336 of file script.c.

1337{
1338 WCHAR *ptr;
1339
1340 TRACE("%s\n", debugstr_w(event));
1341
1342 for(ptr = event; isalnumW(*ptr); ptr++);
1343 if(!*ptr) {
1344 *args = NULL;
1345 return TRUE;
1346 }
1347
1348 if(*ptr != '(')
1349 return FALSE;
1350
1351 *ptr++ = 0;
1352 *args = ptr;
1353 while(isalnumW(*ptr) || isspaceW(*ptr) || *ptr == ',')
1354 ptr++;
1355
1356 if(*ptr != ')')
1357 return FALSE;
1358
1359 *ptr++ = 0;
1360 return !*ptr;
1361}
static PVOID ptr
Definition: dispmode.c:27
#define isspaceW(n)
Definition: unicode.h:52
#define isalnumW(n)
Definition: unicode.h:49

Referenced by parse_event_elem().

◆ parse_extern_script()

static void parse_extern_script ( ScriptHost script_host,
HTMLScriptElement script_elem,
LPCWSTR  src 
)
static

Definition at line 971 of file script.c.

972{
973 WCHAR *text;
974 IUri *uri;
976
977 static const WCHAR wine_schemaW[] = {'w','i','n','e',':'};
978
979 if(strlenW(src) > sizeof(wine_schemaW)/sizeof(WCHAR) && !memcmp(src, wine_schemaW, sizeof(wine_schemaW)))
980 src += sizeof(wine_schemaW)/sizeof(WCHAR);
981
982 hres = create_uri(src, 0, &uri);
983 if(FAILED(hres))
984 return;
985
986 hres = bind_script_to_text(script_host->window, uri, script_elem, &text);
987 IUri_Release(uri);
988 if(FAILED(hres) || !text)
989 return;
990
991 parse_elem_text(script_host, script_elem, text);
992
994}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
HRESULT create_uri(const WCHAR *, DWORD, IUri **) DECLSPEC_HIDDEN
Definition: persist.c:158
static void parse_elem_text(ScriptHost *script_host, HTMLScriptElement *script_elem, LPCWSTR text)
Definition: script.c:738
static HRESULT bind_script_to_text(HTMLInnerWindow *window, IUri *uri, HTMLScriptElement *script_elem, WCHAR **ret)
Definition: script.c:884
GLenum src
Definition: glext.h:6340
#define strlenW(s)
Definition: unicode.h:28
HTMLInnerWindow * window
Definition: script.c:68

Referenced by parse_script_elem().

◆ parse_inline_script()

static void parse_inline_script ( ScriptHost script_host,
HTMLScriptElement script_elem 
)
static

Definition at line 996 of file script.c.

997{
998 const PRUnichar *text;
999 nsAString text_str;
1000 nsresult nsres;
1001
1002 nsAString_Init(&text_str, NULL);
1003 nsres = nsIDOMHTMLScriptElement_GetText(script_elem->nsscript, &text_str);
1004 nsAString_GetData(&text_str, &text);
1005
1006 if(NS_FAILED(nsres)) {
1007 ERR("GetText failed: %08x\n", nsres);
1008 }else if(*text) {
1009 parse_elem_text(script_host, script_elem, text);
1010 }
1011
1012 nsAString_Finish(&text_str);
1013}

Referenced by parse_script_elem().

◆ parse_script_elem()

static void parse_script_elem ( ScriptHost script_host,
HTMLScriptElement script_elem 
)
static

Definition at line 1015 of file script.c.

1016{
1017 nsAString src_str, event_str;
1018 const PRUnichar *src;
1019 nsresult nsres;
1020
1021 nsAString_Init(&event_str, NULL);
1022 nsres = nsIDOMHTMLScriptElement_GetEvent(script_elem->nsscript, &event_str);
1023 if(NS_SUCCEEDED(nsres)) {
1024 const PRUnichar *event;
1025
1026 nsAString_GetData(&event_str, &event);
1027 if(*event) {
1028 TRACE("deferring event %s script evaluation\n", debugstr_w(event));
1029 nsAString_Finish(&event_str);
1030 return;
1031 }
1032 }else {
1033 ERR("GetEvent failed: %08x\n", nsres);
1034 }
1035 nsAString_Finish(&event_str);
1036
1037 nsAString_Init(&src_str, NULL);
1038 nsres = nsIDOMHTMLScriptElement_GetSrc(script_elem->nsscript, &src_str);
1039 nsAString_GetData(&src_str, &src);
1040
1041 if(NS_FAILED(nsres)) {
1042 ERR("GetSrc failed: %08x\n", nsres);
1043 }else if(*src) {
1044 script_elem->parsed = TRUE;
1045 parse_extern_script(script_host, script_elem, src);
1046 }else {
1047 parse_inline_script(script_host, script_elem);
1048 }
1049
1050 nsAString_Finish(&src_str);
1051
1052 set_script_elem_readystate(script_elem, READYSTATE_COMPLETE);
1053}
static void parse_extern_script(ScriptHost *script_host, HTMLScriptElement *script_elem, LPCWSTR src)
Definition: script.c:971
static void parse_inline_script(ScriptHost *script_host, HTMLScriptElement *script_elem)
Definition: script.c:996

Referenced by doc_insert_script().

◆ release_script_engine()

static void release_script_engine ( ScriptHost This)
static

Definition at line 182 of file script.c.

183{
184 if(!This->script)
185 return;
186
187 switch(This->script_state) {
189 IActiveScript_SetScriptState(This->script, SCRIPTSTATE_DISCONNECTED);
190
194 IActiveScript_Close(This->script);
195
196 default:
197 if(This->parse_proc) {
199 This->parse_proc = NULL;
200 }
201
202 if(This->parse) {
204 This->parse = NULL;
205 }
206 }
207
208 IActiveScript_Release(This->script);
209 This->script = NULL;
210 This->script_state = SCRIPTSTATE_UNINITIALIZED;
211}
@ SCRIPTSTATE_DISCONNECTED
Definition: activscp.idl:60
#define IActiveScriptParseProcedure2_Release
Definition: script.c:42
#define IActiveScriptParse_Release
Definition: script.c:39

Referenced by ActiveScriptSite_Release(), create_script_host(), and release_script_hosts().

◆ release_script_hosts()

void release_script_hosts ( HTMLInnerWindow window)

Definition at line 1583 of file script.c.

1584{
1585 script_queue_entry_t *queue_iter;
1586 ScriptHost *iter;
1587
1588 while(!list_empty(&window->script_queue)) {
1589 queue_iter = LIST_ENTRY(list_head(&window->script_queue), script_queue_entry_t, entry);
1590
1591 list_remove(&queue_iter->entry);
1592 IHTMLScriptElement_Release(&queue_iter->script->IHTMLScriptElement_iface);
1593 heap_free(queue_iter);
1594 }
1595
1596 while(!list_empty(&window->script_hosts)) {
1597 iter = LIST_ENTRY(list_head(&window->script_hosts), ScriptHost, entry);
1598
1600 list_remove(&iter->entry);
1601 iter->window = NULL;
1602 IActiveScriptSite_Release(&iter->IActiveScriptSite_iface);
1603 }
1604}
struct list entry
Definition: script.c:71
Definition: htmlscript.h:33
struct list entry
Definition: htmlscript.h:34
HTMLScriptElement * script
Definition: htmlscript.h:35

Referenced by detach_inner_window().

◆ script_parse_event()

IDispatch * script_parse_event ( HTMLInnerWindow window,
LPCWSTR  text 
)

Definition at line 1184 of file script.c.

1185{
1186 ScriptHost *script_host;
1187 GUID guid;
1188 const WCHAR *ptr;
1189 IDispatch *disp;
1190 HRESULT hres;
1191
1192 static const WCHAR delimiterW[] = {'\"',0};
1193
1194 TRACE("%s\n", debugstr_w(text));
1195
1196 for(ptr = text; isalnumW(*ptr); ptr++);
1197 if(*ptr == ':') {
1198 LPWSTR language;
1199 BOOL b;
1200
1201 language = heap_alloc((ptr-text+1)*sizeof(WCHAR));
1202 if(!language)
1203 return NULL;
1204
1205 memcpy(language, text, (ptr-text)*sizeof(WCHAR));
1206 language[ptr-text] = 0;
1207
1208 b = get_guid_from_language(language, &guid);
1209
1210 heap_free(language);
1211
1212 if(!b) {
1213 WARN("Could not find language\n");
1214 return NULL;
1215 }
1216
1217 ptr++;
1218 }else {
1219 ptr = text;
1221 }
1222
1224 && (!window->base.outer_window || window->base.outer_window->scriptmode != SCRIPTMODE_ACTIVESCRIPT)) {
1225 TRACE("Ignoring JScript\n");
1226 return NULL;
1227 }
1228
1229 script_host = get_script_host(window, &guid);
1230 if(!script_host || !script_host->parse_proc)
1231 return NULL;
1232
1234 NULL, NULL, delimiterW, 0 /* FIXME */, 0,
1235 SCRIPTPROC_HOSTMANAGESSOURCE|SCRIPTPROC_IMPLICIT_THIS|SCRIPTPROC_IMPLICIT_PARENTS, &disp);
1236 if(FAILED(hres)) {
1237 WARN("ParseProcedureText failed: %08x\n", hres);
1238 return NULL;
1239 }
1240
1241 TRACE("ret %p\n", disp);
1242 return disp;
1243}
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define b
Definition: ke_i.h:79
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by check_event_attr(), and window_set_timer().

◆ ScriptBSC_beginning_transaction()

static HRESULT ScriptBSC_beginning_transaction ( BSCallback bsc,
WCHAR **  additional_headers 
)
static

Definition at line 867 of file script.c.

868{
869 return S_FALSE;
870}
#define S_FALSE
Definition: winerror.h:2357

◆ ScriptBSC_destroy()

static void ScriptBSC_destroy ( BSCallback bsc)
static

Definition at line 777 of file script.c.

778{
780
781 if(This->script_elem) {
782 IHTMLScriptElement_Release(&This->script_elem->IHTMLScriptElement_iface);
783 This->script_elem = NULL;
784 }
785
786 heap_free(This->buf);
788}
static ScriptBSC * impl_from_BSCallback(BSCallback *iface)
Definition: script.c:772

◆ ScriptBSC_init_bindinfo()

static HRESULT ScriptBSC_init_bindinfo ( BSCallback bsc)
static

Definition at line 790 of file script.c.

791{
792 return S_OK;
793}

◆ ScriptBSC_on_progress()

static HRESULT ScriptBSC_on_progress ( BSCallback bsc,
ULONG  status_code,
LPCWSTR  status_text 
)
static

Definition at line 856 of file script.c.

857{
858 return S_OK;
859}

◆ ScriptBSC_on_response()

static HRESULT ScriptBSC_on_response ( BSCallback bsc,
DWORD  response_code,
LPCWSTR  response_headers 
)
static

Definition at line 861 of file script.c.

863{
864 return S_OK;
865}

◆ ScriptBSC_read_data()

static HRESULT ScriptBSC_read_data ( BSCallback bsc,
IStream stream 
)
static

Definition at line 827 of file script.c.

828{
830 DWORD readed;
832
833 if(!This->buf) {
834 This->buf = heap_alloc(128);
835 if(!This->buf)
836 return E_OUTOFMEMORY;
837 This->size = 128;
838 }
839
840 do {
841 if(This->bsc.readed >= This->size) {
842 void *new_buf;
843 new_buf = heap_realloc(This->buf, This->size << 1);
844 if(!new_buf)
845 return E_OUTOFMEMORY;
846 This->size <<= 1;
847 This->buf = new_buf;
848 }
849
850 hres = read_stream(&This->bsc, stream, This->buf+This->bsc.readed, This->size-This->bsc.readed, &readed);
851 }while(hres == S_OK);
852
853 return S_OK;
854}
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:71
HRESULT read_stream(BSCallback *, IStream *, void *, DWORD, DWORD *) DECLSPEC_HIDDEN
Definition: navigate.c:602
Definition: parse.h:23

◆ ScriptBSC_start_binding()

static HRESULT ScriptBSC_start_binding ( BSCallback bsc)
static

Definition at line 795 of file script.c.

796{
798
799 /* FIXME: We should find a better to decide if 'loading' state is supposed to be used by the protocol. */
800 if(This->scheme == URL_SCHEME_HTTPS || This->scheme == URL_SCHEME_HTTP)
801 set_script_elem_readystate(This->script_elem, READYSTATE_LOADING);
802
803 return S_OK;
804}
@ URL_SCHEME_HTTPS
Definition: shlwapi.h:1157
@ URL_SCHEME_HTTP
Definition: shlwapi.h:1148

◆ ScriptBSC_stop_binding()

static HRESULT ScriptBSC_stop_binding ( BSCallback bsc,
HRESULT  result 
)
static

Definition at line 806 of file script.c.

807{
809
810 This->hres = result;
811
812 if(SUCCEEDED(result)) {
813 if(This->script_elem->readystate == READYSTATE_LOADING)
814 set_script_elem_readystate(This->script_elem, READYSTATE_LOADED);
815 }else {
816 FIXME("binding failed %08x\n", result);
817 heap_free(This->buf);
818 This->buf = NULL;
819 This->size = 0;
820 }
821
822 IHTMLScriptElement_Release(&This->script_elem->IHTMLScriptElement_iface);
823 This->script_elem = NULL;
824 return S_OK;
825}
GLuint64EXT * result
Definition: glext.h:11304

◆ set_script_elem_readystate()

static void set_script_elem_readystate ( HTMLScriptElement script_elem,
READYSTATE  readystate 
)
static

Definition at line 707 of file script.c.

708{
709 script_elem->readystate = readystate;
710
711 if(readystate != READYSTATE_INTERACTIVE) {
712 if(!script_elem->element.node.doc->window->parser_callback_cnt) {
715
716 if(script_elem->pending_readystatechange_event)
717 return;
718
719 task = heap_alloc(sizeof(*task));
720 if(!task)
721 return;
722
723 IHTMLScriptElement_AddRef(&script_elem->IHTMLScriptElement_iface);
724 task->elem = script_elem;
725
727 script_elem->element.node.doc->window->task_magic);
728 if(SUCCEEDED(hres))
730 }else {
733 script_elem->element.node.nsnode, NULL, NULL);
734 }
735 }
736}
static void fire_readystatechange_proc(task_t *_task)
Definition: script.c:689
static void fire_readystatechange_task_destr(task_t *_task)
Definition: script.c:700
HRESULT push_task(task_t *, task_proc_t, task_proc_t, LONG) DECLSPEC_HIDDEN
Definition: task.c:39
unsigned parser_callback_cnt
READYSTATE readystate
Definition: htmlscript.h:30

Referenced by parse_elem_text(), parse_script_elem(), ScriptBSC_start_binding(), and ScriptBSC_stop_binding().

◆ set_script_mode()

void set_script_mode ( HTMLOuterWindow window,
SCRIPTMODE  mode 
)

Definition at line 1551 of file script.c.

1552{
1553 nsIWebBrowserSetup *setup;
1554 nsresult nsres;
1555
1557 TRACE("jscript.dll not available\n");
1558 window->scriptmode = SCRIPTMODE_GECKO;
1559 return;
1560 }
1561
1562 window->scriptmode = mode;
1563
1564 if(!window->doc_obj->nscontainer || !window->doc_obj->nscontainer->webbrowser)
1565 return;
1566
1567 nsres = nsIWebBrowser_QueryInterface(window->doc_obj->nscontainer->webbrowser,
1568 &IID_nsIWebBrowserSetup, (void**)&setup);
1569 if(NS_SUCCEEDED(nsres)) {
1570 nsres = nsIWebBrowserSetup_SetProperty(setup, SETUP_ALLOW_JAVASCRIPT,
1571 window->scriptmode == SCRIPTMODE_GECKO);
1572
1573 if(NS_SUCCEEDED(nsres))
1574 nsres = nsIWebBrowserSetup_SetProperty(setup, SETUP_DISABLE_NOSCRIPT, TRUE);
1575
1576 nsIWebBrowserSetup_Release(setup);
1577 }
1578
1579 if(NS_FAILED(nsres))
1580 ERR("JavaScript setup failed: %08x\n", nsres);
1581}
static BOOL is_jscript_available(void)
Definition: script.c:1531
GLenum mode
Definition: glext.h:6217
static BOOL setup(void)
Definition: enum_files.c:97
@ SCRIPTMODE_GECKO

Referenced by set_current_mon().

◆ set_script_prop()

static void set_script_prop ( ScriptHost script_host,
DWORD  property,
VARIANT val 
)
static

Definition at line 74 of file script.c.

75{
76 IActiveScriptProperty *script_prop;
78
79 hres = IActiveScript_QueryInterface(script_host->script, &IID_IActiveScriptProperty,
80 (void**)&script_prop);
81 if(FAILED(hres)) {
82 WARN("Could not get IActiveScriptProperty iface: %08x\n", hres);
83 return;
84 }
85
86 hres = IActiveScriptProperty_SetProperty(script_prop, property, NULL, val);
87 IActiveScriptProperty_Release(script_prop);
88 if(FAILED(hres))
89 WARN("SetProperty(%x) failed: %08x\n", property, hres);
90}
GLuint GLfloat * val
Definition: glext.h:7180

Referenced by init_script_engine().

Variable Documentation

◆ ActiveScriptSiteDebugVtbl

const IActiveScriptSiteDebugVtbl ActiveScriptSiteDebugVtbl
static
Initial value:
= {
}
static HRESULT WINAPI ActiveScriptSiteDebug_GetRootApplicationNode(IActiveScriptSiteDebug *iface, IDebugApplicationNode **ppdanRoot)
Definition: script.c:568
static ULONG WINAPI ActiveScriptSiteDebug_Release(IActiveScriptSiteDebug *iface)
Definition: script.c:546
static HRESULT WINAPI ActiveScriptSiteDebug_GetApplication(IActiveScriptSiteDebug *iface, IDebugApplication **ppda)
Definition: script.c:561
static HRESULT WINAPI ActiveScriptSiteDebug_QueryInterface(IActiveScriptSiteDebug *iface, REFIID riid, void **ppv)
Definition: script.c:533
static HRESULT WINAPI ActiveScriptSiteDebug_OnScriptErrorDebug(IActiveScriptSiteDebug *iface, IActiveScriptErrorDebug *pErrorDebug, BOOL *pfEnterDebugger, BOOL *pfCallOnScriptErrorWhenContinuing)
Definition: script.c:576
static HRESULT WINAPI ActiveScriptSiteDebug_GetDocumentContextFromPosition(IActiveScriptSiteDebug *iface, CTXARG_T dwSourceContext, ULONG uCharacterOffset, ULONG uNumChars, IDebugDocumentContext **ppsc)
Definition: script.c:552
static ULONG WINAPI ActiveScriptSiteDebug_AddRef(IActiveScriptSiteDebug *iface)
Definition: script.c:540

Definition at line 584 of file script.c.

Referenced by create_script_host().

◆ ActiveScriptSiteInterruptPollVtbl

const IActiveScriptSiteInterruptPollVtbl ActiveScriptSiteInterruptPollVtbl
static
Initial value:
= {
}
static HRESULT WINAPI ActiveScriptSiteInterruptPoll_QueryContinue(IActiveScriptSiteInterruptPoll *iface)
Definition: script.c:419
static ULONG WINAPI ActiveScriptSiteInterruptPoll_AddRef(IActiveScriptSiteInterruptPoll *iface)
Definition: script.c:407
static ULONG WINAPI ActiveScriptSiteInterruptPoll_Release(IActiveScriptSiteInterruptPoll *iface)
Definition: script.c:413
static HRESULT WINAPI ActiveScriptSiteInterruptPoll_QueryInterface(IActiveScriptSiteInterruptPoll *iface, REFIID riid, void **ppv)
Definition: script.c:400

Definition at line 428 of file script.c.

Referenced by create_script_host().

◆ ActiveScriptSiteUIControlVtbl

const IActiveScriptSiteUIControlVtbl ActiveScriptSiteUIControlVtbl
static
Initial value:
= {
}
static ULONG WINAPI ActiveScriptSiteUIControl_Release(IActiveScriptSiteUIControl *iface)
Definition: script.c:504
static ULONG WINAPI ActiveScriptSiteUIControl_AddRef(IActiveScriptSiteUIControl *iface)
Definition: script.c:498
static HRESULT WINAPI ActiveScriptSiteUIControl_GetUIBehavior(IActiveScriptSiteUIControl *iface, SCRIPTUICITEM UicItem, SCRIPTUICHANDLING *pUicHandling)
Definition: script.c:510
static HRESULT WINAPI ActiveScriptSiteUIControl_QueryInterface(IActiveScriptSiteUIControl *iface, REFIID riid, void **ppv)
Definition: script.c:492

Definition at line 521 of file script.c.

Referenced by create_script_host().

◆ ActiveScriptSiteVtbl

const IActiveScriptSiteVtbl ActiveScriptSiteVtbl
static
Initial value:
= {
}
static ULONG WINAPI ActiveScriptSite_Release(IActiveScriptSite *iface)
Definition: script.c:277
static HRESULT WINAPI ActiveScriptSite_OnLeaveScript(IActiveScriptSite *iface)
Definition: script.c:372
static HRESULT WINAPI ActiveScriptSite_OnStateChange(IActiveScriptSite *iface, SCRIPTSTATE ssScriptState)
Definition: script.c:346
static HRESULT WINAPI ActiveScriptSite_GetDocVersionString(IActiveScriptSite *iface, BSTR *pbstrVersion)
Definition: script.c:331
static HRESULT WINAPI ActiveScriptSite_GetItemInfo(IActiveScriptSite *iface, LPCOLESTR pstrName, DWORD dwReturnMask, IUnknown **ppiunkItem, ITypeInfo **ppti)
Definition: script.c:304
static HRESULT WINAPI ActiveScriptSite_QueryInterface(IActiveScriptSite *iface, REFIID riid, void **ppv)
Definition: script.c:228
static HRESULT WINAPI ActiveScriptSite_OnEnterScript(IActiveScriptSite *iface)
Definition: script.c:363
static ULONG WINAPI ActiveScriptSite_AddRef(IActiveScriptSite *iface)
Definition: script.c:267
static HRESULT WINAPI ActiveScriptSite_OnScriptTerminate(IActiveScriptSite *iface, const VARIANT *pvarResult, const EXCEPINFO *pexcepinfo)
Definition: script.c:338
static HRESULT WINAPI ActiveScriptSite_GetLCID(IActiveScriptSite *iface, LCID *plcid)
Definition: script.c:294
static HRESULT WINAPI ActiveScriptSite_OnScriptError(IActiveScriptSite *iface, IActiveScriptError *pscripterror)
Definition: script.c:356

Definition at line 381 of file script.c.

Referenced by create_script_host().

◆ ActiveScriptSiteWindowVtbl

const IActiveScriptSiteWindowVtbl ActiveScriptSiteWindowVtbl
static
Initial value:
= {
}
static ULONG WINAPI ActiveScriptSiteWindow_Release(IActiveScriptSiteWindow *iface)
Definition: script.c:453
static HRESULT WINAPI ActiveScriptSiteWindow_GetWindow(IActiveScriptSiteWindow *iface, HWND *phwnd)
Definition: script.c:459
static HRESULT WINAPI ActiveScriptSiteWindow_EnableModeless(IActiveScriptSiteWindow *iface, BOOL fEnable)
Definition: script.c:472
static HRESULT WINAPI ActiveScriptSiteWindow_QueryInterface(IActiveScriptSiteWindow *iface, REFIID riid, void **ppv)
Definition: script.c:440
static ULONG WINAPI ActiveScriptSiteWindow_AddRef(IActiveScriptSiteWindow *iface)
Definition: script.c:447

Definition at line 479 of file script.c.

Referenced by create_script_host().

◆ ASServiceProviderVtbl

const IServiceProviderVtbl ASServiceProviderVtbl
static
Initial value:
= {
}
static ULONG WINAPI ASServiceProvider_AddRef(IServiceProvider *iface)
Definition: script.c:605
static HRESULT WINAPI ASServiceProvider_QueryService(IServiceProvider *iface, REFGUID guidService, REFIID riid, void **ppv)
Definition: script.c:617
static HRESULT WINAPI ASServiceProvider_QueryInterface(IServiceProvider *iface, REFIID riid, void **ppv)
Definition: script.c:599
static ULONG WINAPI ASServiceProvider_Release(IServiceProvider *iface)
Definition: script.c:611

Definition at line 645 of file script.c.

Referenced by create_script_host().

◆ documentW

const WCHAR documentW[] = {'d','o','c','u','m','e','n','t',0}
static

Definition at line 47 of file script.c.

Referenced by find_event_target(), and test_script_run().

◆ emptyW

const WCHAR emptyW[] = {0}
static

Definition at line 50 of file script.c.

Referenced by parse_event_elem(), and script_parse_event().

◆ script_endW

const WCHAR script_endW[] = {'<','/','S','C','R','I','P','T','>',0}
static

Definition at line 49 of file script.c.

Referenced by parse_elem_text(), and parse_event_elem().

◆ ScriptBSCVtbl

const BSCallbackVtbl ScriptBSCVtbl
static
Initial value:
= {
}
static HRESULT ScriptBSC_beginning_transaction(BSCallback *bsc, WCHAR **additional_headers)
Definition: script.c:867
static HRESULT ScriptBSC_init_bindinfo(BSCallback *bsc)
Definition: script.c:790
static HRESULT ScriptBSC_on_response(BSCallback *bsc, DWORD response_code, LPCWSTR response_headers)
Definition: script.c:861
static HRESULT ScriptBSC_on_progress(BSCallback *bsc, ULONG status_code, LPCWSTR status_text)
Definition: script.c:856
static HRESULT ScriptBSC_read_data(BSCallback *bsc, IStream *stream)
Definition: script.c:827
static HRESULT ScriptBSC_stop_binding(BSCallback *bsc, HRESULT result)
Definition: script.c:806
static void ScriptBSC_destroy(BSCallback *bsc)
Definition: script.c:777
static HRESULT ScriptBSC_start_binding(BSCallback *bsc)
Definition: script.c:795

Definition at line 872 of file script.c.

Referenced by bind_script_to_text().

◆ windowW

const WCHAR windowW[] = {'w','i','n','d','o','w',0}
static