Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
cbf62049
Commit
cbf62049
authored
Oct 18, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 18, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Store script site only in script context.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7665051d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
20 deletions
+8
-20
vbscript.c
dlls/vbscript/vbscript.c
+8
-20
No files found.
dlls/vbscript/vbscript.c
View file @
cbf62049
...
...
@@ -52,7 +52,6 @@ struct VBScript {
LONG
ref
;
SCRIPTSTATE
state
;
IActiveScriptSite
*
site
;
script_ctx_t
*
ctx
;
LONG
thread_id
;
BOOL
is_initialized
;
...
...
@@ -70,8 +69,8 @@ static void change_state(VBScript *This, SCRIPTSTATE state)
return
;
This
->
state
=
state
;
if
(
This
->
site
)
IActiveScriptSite_OnStateChange
(
This
->
site
,
state
);
if
(
This
->
ctx
->
site
)
IActiveScriptSite_OnStateChange
(
This
->
ctx
->
site
,
state
);
}
static
inline
BOOL
is_started
(
VBScript
*
This
)
...
...
@@ -137,9 +136,6 @@ static HRESULT set_ctx_site(VBScript *This)
if
(
FAILED
(
hres
))
return
hres
;
IActiveScriptSite_AddRef
(
This
->
site
);
This
->
ctx
->
site
=
This
->
site
;
change_state
(
This
,
SCRIPTSTATE_INITIALIZED
);
return
S_OK
;
}
...
...
@@ -218,12 +214,6 @@ static void decrease_state(VBScript *This, SCRIPTSTATE state)
case
SCRIPTSTATE_INITIALIZED
:
case
SCRIPTSTATE_UNINITIALIZED
:
change_state
(
This
,
state
);
if
(
This
->
site
)
{
IActiveScriptSite_Release
(
This
->
site
);
This
->
site
=
NULL
;
}
release_script
(
This
->
ctx
);
This
->
thread_id
=
0
;
break
;
...
...
@@ -402,8 +392,6 @@ static ULONG WINAPI VBScript_Release(IActiveScript *iface)
if
(
!
ref
)
{
decrease_state
(
This
,
SCRIPTSTATE_CLOSED
);
destroy_script
(
This
->
ctx
);
if
(
This
->
site
)
IActiveScriptSite_Release
(
This
->
site
);
heap_free
(
This
);
}
...
...
@@ -421,16 +409,16 @@ static HRESULT WINAPI VBScript_SetScriptSite(IActiveScript *iface, IActiveScript
if
(
!
pass
)
return
E_POINTER
;
if
(
This
->
site
)
if
(
This
->
ctx
->
site
)
return
E_UNEXPECTED
;
if
(
InterlockedCompareExchange
(
&
This
->
thread_id
,
GetCurrentThreadId
(),
0
))
return
E_UNEXPECTED
;
This
->
site
=
pass
;
IActiveScriptSite_AddRef
(
This
->
site
);
This
->
ctx
->
site
=
pass
;
IActiveScriptSite_AddRef
(
This
->
ctx
->
site
);
hres
=
IActiveScriptSite_GetLCID
(
This
->
site
,
&
lcid
);
hres
=
IActiveScriptSite_GetLCID
(
This
->
ctx
->
site
,
&
lcid
);
if
(
hres
==
S_OK
)
This
->
ctx
->
lcid
=
lcid
;
...
...
@@ -532,7 +520,7 @@ static HRESULT WINAPI VBScript_AddNamedItem(IActiveScript *iface, LPCOLESTR pstr
if
(
dwFlags
&
SCRIPTITEM_GLOBALMEMBERS
)
{
IUnknown
*
unk
;
hres
=
IActiveScriptSite_GetItemInfo
(
This
->
site
,
pstrName
,
SCRIPTINFO_IUNKNOWN
,
&
unk
,
NULL
);
hres
=
IActiveScriptSite_GetItemInfo
(
This
->
ctx
->
site
,
pstrName
,
SCRIPTINFO_IUNKNOWN
,
&
unk
,
NULL
);
if
(
FAILED
(
hres
))
{
WARN
(
"GetItemInfo failed: %08x
\n
"
,
hres
);
return
hres
;
...
...
@@ -748,7 +736,7 @@ static HRESULT WINAPI VBScriptParse_InitNew(IActiveScriptParse *iface)
return
E_UNEXPECTED
;
This
->
is_initialized
=
TRUE
;
return
This
->
site
?
set_ctx_site
(
This
)
:
S_OK
;
return
This
->
ctx
->
site
?
set_ctx_site
(
This
)
:
S_OK
;
}
static
HRESULT
WINAPI
VBScriptParse_AddScriptlet
(
IActiveScriptParse
*
iface
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment