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
07b542cc
Commit
07b542cc
authored
Sep 13, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 13, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added variable value expression support.
parent
d1c15275
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
2 deletions
+41
-2
interp.c
dlls/vbscript/interp.c
+40
-2
lang.vbs
dlls/vbscript/tests/lang.vbs
+1
-0
No files found.
dlls/vbscript/interp.c
View file @
07b542cc
...
@@ -40,7 +40,8 @@ typedef HRESULT (*instr_func_t)(exec_ctx_t*);
...
@@ -40,7 +40,8 @@ typedef HRESULT (*instr_func_t)(exec_ctx_t*);
typedef
enum
{
typedef
enum
{
REF_NONE
,
REF_NONE
,
REF_DISP
REF_DISP
,
REF_VAR
}
ref_type_t
;
}
ref_type_t
;
typedef
struct
{
typedef
struct
{
...
@@ -50,6 +51,7 @@ typedef struct {
...
@@ -50,6 +51,7 @@ typedef struct {
IDispatch
*
disp
;
IDispatch
*
disp
;
DISPID
id
;
DISPID
id
;
}
d
;
}
d
;
VARIANT
*
v
;
}
u
;
}
u
;
}
ref_t
;
}
ref_t
;
...
@@ -59,12 +61,30 @@ typedef struct {
...
@@ -59,12 +61,30 @@ typedef struct {
BOOL
owned
;
BOOL
owned
;
}
variant_val_t
;
}
variant_val_t
;
static
BOOL
lookup_dynamic_vars
(
dynamic_var_t
*
var
,
const
WCHAR
*
name
,
ref_t
*
ref
)
{
while
(
var
)
{
if
(
!
strcmpiW
(
var
->
name
,
name
))
{
ref
->
type
=
REF_VAR
;
ref
->
u
.
v
=
&
var
->
v
;
return
TRUE
;
}
var
=
var
->
next
;
}
return
FALSE
;
}
static
HRESULT
lookup_identifier
(
exec_ctx_t
*
ctx
,
BSTR
name
,
ref_t
*
ref
)
static
HRESULT
lookup_identifier
(
exec_ctx_t
*
ctx
,
BSTR
name
,
ref_t
*
ref
)
{
{
named_item_t
*
item
;
named_item_t
*
item
;
DISPID
id
;
DISPID
id
;
HRESULT
hres
;
HRESULT
hres
;
if
(
lookup_dynamic_vars
(
ctx
->
script
->
global_vars
,
name
,
ref
))
return
S_OK
;
LIST_FOR_EACH_ENTRY
(
item
,
&
ctx
->
script
->
named_items
,
named_item_t
,
entry
)
{
LIST_FOR_EACH_ENTRY
(
item
,
&
ctx
->
script
->
named_items
,
named_item_t
,
entry
)
{
if
(
item
->
flags
&
SCRIPTITEM_GLOBALMEMBERS
)
{
if
(
item
->
flags
&
SCRIPTITEM_GLOBALMEMBERS
)
{
hres
=
disp_get_id
(
item
->
disp
,
name
,
&
id
);
hres
=
disp_get_id
(
item
->
disp
,
name
,
&
id
);
...
@@ -210,12 +230,26 @@ static HRESULT do_icall(exec_ctx_t *ctx, VARIANT *res)
...
@@ -210,12 +230,26 @@ static HRESULT do_icall(exec_ctx_t *ctx, VARIANT *res)
vbstack_to_dp
(
ctx
,
arg_cnt
,
&
dp
);
vbstack_to_dp
(
ctx
,
arg_cnt
,
&
dp
);
switch
(
ref
.
type
)
{
switch
(
ref
.
type
)
{
case
REF_VAR
:
if
(
!
res
)
{
FIXME
(
"REF_VAR no res
\n
"
);
return
E_NOTIMPL
;
}
if
(
arg_cnt
)
{
FIXME
(
"arguments not implemented
\n
"
);
return
E_NOTIMPL
;
}
V_VT
(
res
)
=
VT_BYREF
|
VT_VARIANT
;
V_BYREF
(
res
)
=
V_VT
(
ref
.
u
.
v
)
==
(
VT_VARIANT
|
VT_BYREF
)
?
V_VARIANTREF
(
ref
.
u
.
v
)
:
ref
.
u
.
v
;
break
;
case
REF_DISP
:
case
REF_DISP
:
hres
=
disp_call
(
ctx
->
script
,
ref
.
u
.
d
.
disp
,
ref
.
u
.
d
.
id
,
&
dp
,
res
);
hres
=
disp_call
(
ctx
->
script
,
ref
.
u
.
d
.
disp
,
ref
.
u
.
d
.
id
,
&
dp
,
res
);
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
return
hres
;
return
hres
;
break
;
break
;
default
:
case
REF_NONE
:
FIXME
(
"%s not found
\n
"
,
debugstr_w
(
identifier
));
FIXME
(
"%s not found
\n
"
,
debugstr_w
(
identifier
));
return
DISP_E_UNKNOWNNAME
;
return
DISP_E_UNKNOWNNAME
;
}
}
...
@@ -254,6 +288,10 @@ static HRESULT assign_ident(exec_ctx_t *ctx, BSTR name, VARIANT *val, BOOL own_v
...
@@ -254,6 +288,10 @@ static HRESULT assign_ident(exec_ctx_t *ctx, BSTR name, VARIANT *val, BOOL own_v
return
hres
;
return
hres
;
switch
(
ref
.
type
)
{
switch
(
ref
.
type
)
{
case
REF_VAR
:
FIXME
(
"REF_VAR not implemented
\n
"
);
hres
=
E_NOTIMPL
;
break
;
case
REF_DISP
:
case
REF_DISP
:
hres
=
disp_propput
(
ctx
->
script
,
ref
.
u
.
d
.
disp
,
ref
.
u
.
d
.
id
,
val
);
hres
=
disp_propput
(
ctx
->
script
,
ref
.
u
.
d
.
disp
,
ref
.
u
.
d
.
id
,
val
);
if
(
own_val
)
if
(
own_val
)
...
...
dlls/vbscript/tests/lang.vbs
View file @
07b542cc
...
@@ -66,6 +66,7 @@ Call ok(getVT(&hffFFffFF&) = "VT_I2", "getVT(&hffFFffFF&) is not VT_I2")
...
@@ -66,6 +66,7 @@ Call ok(getVT(&hffFFffFF&) = "VT_I2", "getVT(&hffFFffFF&) is not VT_I2")
Call
ok
(
getVT
(
1
&
100000
)
=
"VT_BSTR"
,
"getVT(1 & 100000) is not VT_BSTR"
)
Call
ok
(
getVT
(
1
&
100000
)
=
"VT_BSTR"
,
"getVT(1 & 100000) is not VT_BSTR"
)
Call
ok
(
getVT
(
-
empty
)
=
"VT_I2"
,
"getVT(-empty) = "
&
getVT
(
-
empty
))
Call
ok
(
getVT
(
-
empty
)
=
"VT_I2"
,
"getVT(-empty) = "
&
getVT
(
-
empty
))
Call
ok
(
getVT
(
-
null
)
=
"VT_NULL"
,
"getVT(-null) = "
&
getVT
(
-
null
))
Call
ok
(
getVT
(
-
null
)
=
"VT_NULL"
,
"getVT(-null) = "
&
getVT
(
-
null
))
Call
ok
(
getVT
(
y
)
=
"VT_EMPTY*"
,
"getVT(y) = "
&
getVT
(
y
))
Call
ok
(
"ab"
&
"cd"
=
"abcd"
,
"
""
ab
""
&
""
cd
""
<>
""
abcd
""
"
)
Call
ok
(
"ab"
&
"cd"
=
"abcd"
,
"
""
ab
""
&
""
cd
""
<>
""
abcd
""
"
)
Call
ok
(
"ab "
&
null
=
"ab "
,
"
""
ab
""
& null = "
&
(
"ab "
&
null
))
Call
ok
(
"ab "
&
null
=
"ab "
,
"
""
ab
""
& null = "
&
(
"ab "
&
null
))
...
...
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