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
9d755220
Commit
9d755220
authored
Sep 08, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 08, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added interp_icallv implementation.
parent
060255d0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
115 additions
and
5 deletions
+115
-5
interp.c
dlls/vbscript/interp.c
+64
-3
vbdisp.c
dlls/vbscript/vbdisp.c
+43
-0
vbscript.h
dlls/vbscript/vbscript.h
+6
-2
vbscript_main.c
dlls/vbscript/vbscript_main.c
+2
-0
No files found.
dlls/vbscript/interp.c
View file @
9d755220
...
...
@@ -28,15 +28,75 @@ WINE_DEFAULT_DEBUG_CHANNEL(vbscript);
typedef
struct
{
vbscode_t
*
code
;
instr_t
*
instr
;
script_ctx_t
*
script
;
}
exec_ctx_t
;
typedef
HRESULT
(
*
instr_func_t
)(
exec_ctx_t
*
);
typedef
enum
{
REF_NONE
,
REF_DISP
}
ref_type_t
;
typedef
struct
{
ref_type_t
type
;
union
{
struct
{
IDispatch
*
disp
;
DISPID
id
;
}
d
;
}
u
;
}
ref_t
;
static
HRESULT
lookup_identifier
(
exec_ctx_t
*
ctx
,
BSTR
name
,
ref_t
*
ref
)
{
named_item_t
*
item
;
DISPID
id
;
HRESULT
hres
;
LIST_FOR_EACH_ENTRY
(
item
,
&
ctx
->
script
->
named_items
,
named_item_t
,
entry
)
{
if
(
item
->
flags
&
SCRIPTITEM_GLOBALMEMBERS
)
{
hres
=
disp_get_id
(
item
->
disp
,
name
,
&
id
);
if
(
SUCCEEDED
(
hres
))
{
ref
->
type
=
REF_DISP
;
ref
->
u
.
d
.
disp
=
item
->
disp
;
ref
->
u
.
d
.
id
=
id
;
return
S_OK
;
}
}
}
FIXME
(
"create if no option explicit
\n
"
);
ref
->
type
=
REF_NONE
;
return
S_OK
;
}
static
HRESULT
interp_icallv
(
exec_ctx_t
*
ctx
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
BSTR
identifier
=
ctx
->
instr
->
arg1
.
bstr
;
DISPPARAMS
dp
=
{
0
};
ref_t
ref
;
HRESULT
hres
;
TRACE
(
"
\n
"
);
hres
=
lookup_identifier
(
ctx
,
identifier
,
&
ref
);
if
(
FAILED
(
hres
))
return
hres
;
switch
(
ref
.
type
)
{
case
REF_DISP
:
hres
=
disp_call
(
ctx
->
script
,
ref
.
u
.
d
.
disp
,
ref
.
u
.
d
.
id
,
&
dp
,
NULL
);
if
(
FAILED
(
hres
))
return
hres
;
break
;
default:
FIXME
(
"%s not found
\n
"
,
debugstr_w
(
identifier
));
return
DISP_E_UNKNOWNNAME
;
}
return
S_OK
;
}
static
HRESULT
interp_ret
(
exec_ctx_t
*
ctx
)
...
...
@@ -67,6 +127,7 @@ HRESULT exec_script(script_ctx_t *ctx, function_t *func)
exec
.
code
=
func
->
code_ctx
;
exec
.
instr
=
exec
.
code
->
instrs
+
func
->
code_off
;
exec
.
script
=
ctx
;
while
(
exec
.
instr
)
{
op
=
exec
.
instr
->
op
;
...
...
dlls/vbscript/vbdisp.c
View file @
9d755220
...
...
@@ -203,3 +203,46 @@ HRESULT init_global(script_ctx_t *ctx)
{
return
create_vbdisp
(
&
ctx
->
script_obj
);
}
HRESULT
disp_get_id
(
IDispatch
*
disp
,
BSTR
name
,
DISPID
*
id
)
{
IDispatchEx
*
dispex
;
HRESULT
hres
;
if
(
disp
->
lpVtbl
==
(
IDispatchVtbl
*
)
&
DispatchExVtbl
)
FIXME
(
"properly handle builtin objects
\n
"
);
hres
=
IDispatch_QueryInterface
(
disp
,
&
IID_IDispatchEx
,
(
void
**
)
&
dispex
);
if
(
FAILED
(
hres
))
{
TRACE
(
"unsing IDispatch
\n
"
);
return
IDispatch_GetIDsOfNames
(
disp
,
&
IID_NULL
,
&
name
,
1
,
0
,
id
);
}
hres
=
IDispatchEx_GetDispID
(
dispex
,
name
,
fdexNameCaseInsensitive
,
id
);
IDispatchEx_Release
(
dispex
);
return
hres
;
}
HRESULT
disp_call
(
script_ctx_t
*
ctx
,
IDispatch
*
disp
,
DISPID
id
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
)
{
const
WORD
flags
=
DISPATCH_METHOD
|
(
retv
?
DISPATCH_PROPERTYGET
:
0
);
IDispatchEx
*
dispex
;
EXCEPINFO
ei
;
HRESULT
hres
;
memset
(
&
ei
,
0
,
sizeof
(
ei
));
if
(
retv
)
V_VT
(
retv
)
=
VT_EMPTY
;
hres
=
IDispatch_QueryInterface
(
disp
,
&
IID_IDispatchEx
,
(
void
**
)
&
dispex
);
if
(
FAILED
(
hres
))
{
UINT
err
=
0
;
TRACE
(
"using IDispatch
\n
"
);
return
IDispatch_Invoke
(
disp
,
id
,
&
IID_NULL
,
ctx
->
lcid
,
flags
,
dp
,
retv
,
&
ei
,
&
err
);
}
hres
=
IDispatchEx_InvokeEx
(
dispex
,
id
,
ctx
->
lcid
,
flags
,
dp
,
retv
,
&
ei
,
NULL
/* CALLER_FIXME */
);
IDispatchEx_Release
(
dispex
);
return
hres
;
}
dlls/vbscript/vbscript.h
View file @
9d755220
...
...
@@ -33,6 +33,7 @@
typedef
struct
_function_t
function_t
;
typedef
struct
_vbscode_t
vbscode_t
;
typedef
struct
_script_ctx_t
script_ctx_t
;
typedef
struct
named_item_t
{
IDispatch
*
disp
;
...
...
@@ -48,7 +49,10 @@ typedef struct {
LONG
ref
;
}
vbdisp_t
;
typedef
struct
{
HRESULT
disp_get_id
(
IDispatch
*
,
BSTR
,
DISPID
*
);
HRESULT
disp_call
(
script_ctx_t
*
,
IDispatch
*
,
DISPID
,
DISPPARAMS
*
,
VARIANT
*
);
struct
_script_ctx_t
{
IActiveScriptSite
*
site
;
LCID
lcid
;
...
...
@@ -58,7 +62,7 @@ typedef struct {
struct
list
code_list
;
struct
list
named_items
;
}
script_ctx_t
;
};
HRESULT
init_global
(
script_ctx_t
*
);
...
...
dlls/vbscript/vbscript_main.c
View file @
9d755220
...
...
@@ -27,6 +27,8 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
vbscript
);
DEFINE_GUID
(
GUID_NULL
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
);
static
HINSTANCE
vbscript_hinstance
;
static
HRESULT
WINAPI
ClassFactory_QueryInterface
(
IClassFactory
*
iface
,
REFIID
riid
,
void
**
ppv
)
...
...
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