Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
aa5b68ac
Commit
aa5b68ac
authored
Mar 16, 2018
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Split named item lookup into a helper function.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f94d0e7b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
21 deletions
+37
-21
interp.c
dlls/vbscript/interp.c
+4
-21
vbscript.c
dlls/vbscript/vbscript.c
+32
-0
vbscript.h
dlls/vbscript/vbscript.h
+1
-0
No files found.
dlls/vbscript/interp.c
View file @
aa5b68ac
...
...
@@ -99,6 +99,7 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_
{
named_item_t
*
item
;
function_t
*
func
;
IDispatch
*
disp
;
unsigned
i
;
DISPID
id
;
HRESULT
hres
;
...
...
@@ -178,30 +179,12 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_
return
S_OK
;
}
LIST_FOR_EACH_ENTRY
(
item
,
&
ctx
->
script
->
named_items
,
named_item_t
,
entry
)
{
if
((
item
->
flags
&
SCRIPTITEM_ISVISIBLE
)
&&
!
strcmpiW
(
item
->
name
,
name
))
{
if
(
!
item
->
disp
)
{
IUnknown
*
unk
;
hres
=
IActiveScriptSite_GetItemInfo
(
ctx
->
script
->
site
,
item
->
name
,
SCRIPTINFO_IUNKNOWN
,
&
unk
,
NULL
);
if
(
FAILED
(
hres
))
{
WARN
(
"GetItemInfo failed: %08x
\n
"
,
hres
);
continue
;
}
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IDispatch
,
(
void
**
)
&
item
->
disp
);
IUnknown_Release
(
unk
);
if
(
FAILED
(
hres
))
{
WARN
(
"object does not implement IDispatch
\n
"
);
continue
;
}
}
disp
=
lookup_named_item
(
ctx
->
script
,
name
,
SCRIPTITEM_ISVISIBLE
);
if
(
disp
)
{
ref
->
type
=
REF_OBJ
;
ref
->
u
.
obj
=
item
->
disp
;
ref
->
u
.
obj
=
disp
;
return
S_OK
;
}
}
LIST_FOR_EACH_ENTRY
(
item
,
&
ctx
->
script
->
named_items
,
named_item_t
,
entry
)
{
if
((
item
->
flags
&
SCRIPTITEM_GLOBALMEMBERS
))
{
...
...
dlls/vbscript/vbscript.c
View file @
aa5b68ac
...
...
@@ -96,6 +96,38 @@ static void exec_queued_code(script_ctx_t *ctx)
}
}
IDispatch
*
lookup_named_item
(
script_ctx_t
*
ctx
,
const
WCHAR
*
name
,
unsigned
flags
)
{
named_item_t
*
item
;
HRESULT
hres
;
LIST_FOR_EACH_ENTRY
(
item
,
&
ctx
->
named_items
,
named_item_t
,
entry
)
{
if
((
item
->
flags
&
flags
)
==
flags
&&
!
strcmpiW
(
item
->
name
,
name
))
{
if
(
!
item
->
disp
)
{
IUnknown
*
unk
;
hres
=
IActiveScriptSite_GetItemInfo
(
ctx
->
site
,
item
->
name
,
SCRIPTINFO_IUNKNOWN
,
&
unk
,
NULL
);
if
(
FAILED
(
hres
))
{
WARN
(
"GetItemInfo failed: %08x
\n
"
,
hres
);
continue
;
}
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IDispatch
,
(
void
**
)
&
item
->
disp
);
IUnknown_Release
(
unk
);
if
(
FAILED
(
hres
))
{
WARN
(
"object does not implement IDispatch
\n
"
);
continue
;
}
}
return
item
->
disp
;
}
}
return
NULL
;
}
static
HRESULT
set_ctx_site
(
VBScript
*
This
)
{
HRESULT
hres
;
...
...
dlls/vbscript/vbscript.h
View file @
aa5b68ac
...
...
@@ -355,6 +355,7 @@ void release_vbscode(vbscode_t*) DECLSPEC_HIDDEN;
HRESULT
compile_script
(
script_ctx_t
*
,
const
WCHAR
*
,
const
WCHAR
*
,
vbscode_t
**
)
DECLSPEC_HIDDEN
;
HRESULT
exec_script
(
script_ctx_t
*
,
function_t
*
,
vbdisp_t
*
,
DISPPARAMS
*
,
VARIANT
*
)
DECLSPEC_HIDDEN
;
void
release_dynamic_vars
(
dynamic_var_t
*
)
DECLSPEC_HIDDEN
;
IDispatch
*
lookup_named_item
(
script_ctx_t
*
,
const
WCHAR
*
,
unsigned
)
DECLSPEC_HIDDEN
;
typedef
struct
{
UINT16
len
;
...
...
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