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
1c194f3b
Commit
1c194f3b
authored
Jan 27, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Fix VT_UNKNOWN handling in set statements.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
cd191894
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
7 deletions
+50
-7
interp.c
dlls/vbscript/interp.c
+6
-6
lang.vbs
dlls/vbscript/tests/lang.vbs
+6
-0
run.c
dlls/vbscript/tests/run.c
+38
-1
No files found.
dlls/vbscript/interp.c
View file @
1c194f3b
...
...
@@ -458,22 +458,22 @@ static HRESULT stack_assume_disp(exec_ctx_t *ctx, unsigned n, IDispatch **disp)
{
VARIANT
*
v
=
stack_top
(
ctx
,
n
),
*
ref
;
if
(
V_VT
(
v
)
!=
VT_DISPATCH
)
{
if
(
V_VT
(
v
)
!=
VT_DISPATCH
&&
(
disp
||
V_VT
(
v
)
!=
VT_UNKNOWN
)
)
{
if
(
V_VT
(
v
)
!=
(
VT_VARIANT
|
VT_BYREF
))
{
FIXME
(
"not supported type: %s
\n
"
,
debugstr_variant
(
v
));
return
E_FAIL
;
}
ref
=
V_VARIANTREF
(
v
);
if
(
V_VT
(
ref
)
!=
VT_DISPATCH
)
{
if
(
V_VT
(
ref
)
!=
VT_DISPATCH
&&
(
disp
||
V_VT
(
ref
)
!=
VT_UNKNOWN
)
)
{
FIXME
(
"not disp %s
\n
"
,
debugstr_variant
(
ref
));
return
E_FAIL
;
}
V_VT
(
v
)
=
V
T_DISPATCH
;
V_
DISPATCH
(
v
)
=
V_DISPATCH
(
ref
);
if
(
V_
DISPATCH
(
v
))
I
Dispatch_AddRef
(
V_DISPATCH
(
v
));
V_VT
(
v
)
=
V
_VT
(
ref
)
;
V_
UNKNOWN
(
v
)
=
V_UNKNOWN
(
ref
);
if
(
V_
UNKNOWN
(
v
))
I
Unknown_AddRef
(
V_UNKNOWN
(
v
));
}
if
(
disp
)
...
...
dlls/vbscript/tests/lang.vbs
View file @
1c194f3b
...
...
@@ -1197,6 +1197,12 @@ Call ok(obj.Test1 = 6, "obj.Test1 is not 6")
obj
.
AddToTest1
(
5
)
Call
ok
(
obj
.
Test1
=
11
,
"obj.Test1 is not 11"
)
set
obj
=
unkObj
set
x
=
obj
call
ok
(
getVT
(
obj
)
=
"VT_UNKNOWN*"
,
"getVT(obj) = "
&
getVT
(
obj
))
call
ok
(
getVT
(
x
)
=
"VT_UNKNOWN*"
,
"getVT(x) = "
&
getVT
(
x
))
call
ok
(
getVT
(
unkObj
)
=
"VT_UNKNOWN"
,
"getVT(unkObj) = "
&
getVT
(
unkObj
))
' Array tests
Call
ok
(
getVT
(
arr
)
=
"VT_EMPTY*"
,
"getVT(arr) = "
&
getVT
(
arr
))
...
...
dlls/vbscript/tests/run.c
View file @
1c194f3b
...
...
@@ -144,6 +144,7 @@ DEFINE_EXPECT(OnLeaveScript);
#define DISPID_GLOBAL_TESTERROROBJECT 1023
#define DISPID_GLOBAL_THROWWITHDESC 1024
#define DISPID_GLOBAL_PROPARGSET 1025
#define DISPID_GLOBAL_UNKOBJ 1026
#define DISPID_TESTOBJ_PROPGET 2000
#define DISPID_TESTOBJ_PROPPUT 2001
...
...
@@ -214,6 +215,8 @@ static const char *vt2a(VARIANT *v)
return
"VT_BSTR"
;
case
VT_DISPATCH
:
return
"VT_DISPATCH"
;
case
VT_UNKNOWN
:
return
"VT_UNKNOWN"
;
case
VT_BOOL
:
return
"VT_BOOL"
;
case
VT_ARRAY
|
VT_VARIANT
:
...
...
@@ -595,6 +598,35 @@ static void _test_grfdex(unsigned line, DWORD grfdex, DWORD expect)
static
IDispatchEx
enumDisp
;
static
HRESULT
WINAPI
unkObj_QueryInterface
(
IUnknown
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
))
{
*
ppv
=
iface
;
return
S_OK
;
}
*
ppv
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
unkObj_AddRef
(
IUnknown
*
iface
)
{
return
2
;
}
static
ULONG
WINAPI
unkObj_Release
(
IUnknown
*
iface
)
{
return
1
;
}
static
const
IUnknownVtbl
unkObjVtbl
=
{
unkObj_QueryInterface
,
unkObj_AddRef
,
unkObj_Release
};
static
IUnknown
unkObj
=
{
&
unkObjVtbl
};
static
HRESULT
WINAPI
EnumVARIANT_QueryInterface
(
IEnumVARIANT
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
riid
,
&
IID_IEnumVARIANT
))
{
...
...
@@ -1138,7 +1170,8 @@ static HRESULT WINAPI Global_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD
{
L"throwInt"
,
DISPID_GLOBAL_THROWINT
},
{
L"testOptionalArg"
,
DISPID_GLOBAL_TESTOPTIONALARG
},
{
L"testErrorObject"
,
DISPID_GLOBAL_TESTERROROBJECT
},
{
L"throwWithDesc"
,
DISPID_GLOBAL_THROWWITHDESC
}
{
L"throwWithDesc"
,
DISPID_GLOBAL_THROWWITHDESC
},
{
L"unkObj"
,
DISPID_GLOBAL_UNKOBJ
}
};
test_grfdex
(
grfdex
,
fdexNameCaseInsensitive
);
...
...
@@ -1657,6 +1690,10 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
ok
(
hres
==
S_OK
,
"Invoke failed: %08x
\n
"
,
hres
);
return
S_OK
;
}
case
DISPID_GLOBAL_UNKOBJ
:
V_VT
(
pvarRes
)
=
VT_UNKNOWN
;
V_UNKNOWN
(
pvarRes
)
=
&
unkObj
;
return
S_OK
;
}
ok
(
0
,
"unexpected call %d
\n
"
,
id
);
...
...
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