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
61c18632
Commit
61c18632
authored
Nov 07, 2017
by
Piotr Caban
Committed by
Alexandre Julliard
Nov 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Fix automatic value getting in ITypeInfo::Invoke.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
baba9a8e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
125 additions
and
4 deletions
+125
-4
test_reg.idl
dlls/oleaut32/tests/test_reg.idl
+11
-0
typelib.c
dlls/oleaut32/tests/typelib.c
+113
-3
typelib.c
dlls/oleaut32/typelib.c
+1
-1
No files found.
dlls/oleaut32/tests/test_reg.idl
View file @
61c18632
...
...
@@ -131,6 +131,15 @@ library register_test
}
[
uuid
(
fed318b2
-
c2ed
-
11
e7
-
abc4
-
cec278b6b50a
)
]
interface
ICollection
:
IDispatch
{
[
id
(
DISPID_VALUE
)
]
HRESULT
Item
(
[
in
]
int
i
,
[
out
,
retval
]
int
*
p
)
;
}
[
uuid
(
f1b68c3b
-
02
a3
-
4110
-
bc4c
-
cf9bc7e7f177
)
]
interface
IInvokeTest
:
IDispatch
...
...
@@ -143,6 +152,8 @@ library register_test
LONG
testprop2
(
[
in
]
IUnknown
*
i
)
;
[
id
(
3
)
]
HRESULT
testfunc
(
[
in
]
int
i
,
[
out
,
retval
]
int
*
p
)
;
[
propget
,
id
(
4
)
]
HRESULT
testget
(
[
out
,
retval
]
ICollection
**
p
)
;
}
/*
uuid
is
same
as
for
test_struct2
in
test_tlb
.
idl
,
fields
are
different
*/
...
...
dlls/oleaut32/tests/typelib.c
View file @
61c18632
...
...
@@ -98,6 +98,91 @@ static const BOOL abi_supports_stdcall = TRUE;
static
const
BOOL
abi_supports_stdcall
=
FALSE
;
#endif
static
HRESULT
WINAPI
collection_QueryInterface
(
ICollection
*
iface
,
REFIID
riid
,
void
**
ret
)
{
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
)
||
IsEqualIID
(
riid
,
&
IID_IDispatch
)
||
IsEqualIID
(
riid
,
&
IID_ICollection
))
{
*
ret
=
iface
;
return
S_OK
;
}
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
collection_AddRef
(
ICollection
*
iface
)
{
return
2
;
}
static
ULONG
WINAPI
collection_Release
(
ICollection
*
iface
)
{
return
1
;
}
static
HRESULT
WINAPI
collection_GetTypeInfoCount
(
ICollection
*
iface
,
UINT
*
cnt
)
{
ok
(
0
,
"unexpected call
\n
"
);
*
cnt
=
0
;
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
collection_GetTypeInfo
(
ICollection
*
iface
,
UINT
index
,
LCID
lcid
,
ITypeInfo
**
ti
)
{
ok
(
0
,
"unexpected call
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
collection_GetIDsOfNames
(
ICollection
*
iface
,
REFIID
riid
,
LPOLESTR
*
names
,
UINT
cnt
,
LCID
lcid
,
DISPID
*
dispid
)
{
ok
(
0
,
"unexpected call
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
collection_Invoke
(
ICollection
*
iface
,
DISPID
dispid
,
REFIID
riid
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dispparams
,
VARIANT
*
res
,
EXCEPINFO
*
ei
,
UINT
*
argerr
)
{
if
(
dispid
!=
DISPID_VALUE
)
{
ok
(
0
,
"unexpected call
\n
"
);
return
E_NOTIMPL
;
}
ok
(
flags
==
(
DISPATCH_METHOD
|
DISPATCH_PROPERTYGET
),
"flags = %x
\n
"
,
flags
);
ok
(
dispparams
!=
NULL
,
"dispparams == NULL
\n
"
);
ok
(
!
dispparams
->
rgdispidNamedArgs
,
"dispparams->rgdispidNamedArgs != NULL
\n
"
);
ok
(
dispparams
->
cArgs
==
1
,
"dispparams->cArgs = %d
\n
"
,
dispparams
->
cArgs
);
ok
(
!
dispparams
->
cNamedArgs
,
"dispparams->cNamedArgs = %d
\n
"
,
dispparams
->
cNamedArgs
);
ok
(
V_VT
(
dispparams
->
rgvarg
)
==
VT_I4
,
"V_VT(dispparams->rgvarg) = %d
\n
"
,
V_VT
(
dispparams
->
rgvarg
));
ok
(
V_I4
(
dispparams
->
rgvarg
)
==
7
,
"V_I4(dispparams->rgvarg) = %d
\n
"
,
V_I4
(
dispparams
->
rgvarg
));
ok
(
res
!=
NULL
,
"res == NULL
\n
"
);
ok
(
V_VT
(
res
)
==
VT_EMPTY
,
"V_VT(res) = %d
\n
"
,
V_VT
(
res
));
V_VT
(
res
)
=
VT_I4
;
V_I4
(
res
)
=
15
;
return
S_OK
;
}
static
HRESULT
WINAPI
collection_Item
(
ICollection
*
iface
,
int
i
,
int
*
p
)
{
ok
(
0
,
"unexpected call
\n
"
);
return
E_NOTIMPL
;
}
static
const
ICollectionVtbl
collectionvtbl
=
{
collection_QueryInterface
,
collection_AddRef
,
collection_Release
,
collection_GetTypeInfoCount
,
collection_GetTypeInfo
,
collection_GetIDsOfNames
,
collection_Invoke
,
collection_Item
};
static
ICollection
collection
=
{
&
collectionvtbl
};
static
HRESULT
WINAPI
invoketest_QueryInterface
(
IInvokeTest
*
iface
,
REFIID
riid
,
void
**
ret
)
{
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
)
||
...
...
@@ -169,6 +254,13 @@ static HRESULT WINAPI invoketest_testfunc(IInvokeTest *iface, int i, int *p)
return
S_OK
;
}
static
HRESULT
WINAPI
invoketest_testget
(
IInvokeTest
*
iface
,
ICollection
**
p
)
{
*
p
=
&
collection
;
ICollection_AddRef
(
&
collection
);
return
S_OK
;
}
static
const
IInvokeTestVtbl
invoketestvtbl
=
{
invoketest_QueryInterface
,
invoketest_AddRef
,
...
...
@@ -180,7 +272,8 @@ static const IInvokeTestVtbl invoketestvtbl = {
invoketest_get_test
,
invoketest_putref_testprop
,
invoketest_putref_testprop2
,
invoketest_testfunc
invoketest_testfunc
,
invoketest_testget
};
static
IInvokeTest
invoketest
=
{
&
invoketestvtbl
};
...
...
@@ -968,6 +1061,22 @@ static void test_TypeInfo(void)
ok
(
V_VT
(
&
res
)
==
VT_I4
,
"got %d
\n
"
,
V_VT
(
&
res
));
ok
(
V_I4
(
&
res
)
==
1
,
"got %d
\n
"
,
V_I4
(
&
res
));
/* call propget with DISPATCH_METHOD|DISPATCH_PROPERTYGET flags */
V_VT
(
&
args
[
0
])
=
VT_I4
;
V_I4
(
&
args
[
0
])
=
7
;
dispparams
.
cArgs
=
1
;
dispparams
.
rgvarg
=
args
;
i
=
0
;
V_VT
(
&
res
)
=
VT_EMPTY
;
V_I4
(
&
res
)
=
0
;
hr
=
ITypeInfo_Invoke
(
pTypeInfo
,
&
invoketest
,
4
,
DISPATCH_METHOD
|
DISPATCH_PROPERTYGET
,
&
dispparams
,
&
res
,
NULL
,
&
i
);
ok
(
hr
==
S_OK
,
"got 0x%08x, %d
\n
"
,
hr
,
i
);
ok
(
V_VT
(
&
res
)
==
VT_I4
,
"got %d
\n
"
,
V_VT
(
&
res
));
ok
(
V_I4
(
&
res
)
==
15
,
"got %d
\n
"
,
V_I4
(
&
res
));
/* DISPATCH_PROPERTYPUTREF */
l
=
1
;
V_VT
(
&
args
[
0
])
=
VT_I4
|
VT_BYREF
;
...
...
@@ -4837,7 +4946,7 @@ static void test_register_typelib(BOOL system_registration)
{
TYPEKIND
kind
;
WORD
flags
;
}
attrs
[
13
]
=
}
attrs
[]
=
{
{
TKIND_INTERFACE
,
0
},
{
TKIND_INTERFACE
,
TYPEFLAG_FDISPATCHABLE
},
...
...
@@ -4851,6 +4960,7 @@ static void test_register_typelib(BOOL system_registration)
{
TKIND_DISPATCH
,
TYPEFLAG_FDISPATCHABLE
},
{
TKIND_DISPATCH
,
TYPEFLAG_FDISPATCHABLE
},
{
TKIND_INTERFACE
,
TYPEFLAG_FDISPATCHABLE
},
{
TKIND_INTERFACE
,
TYPEFLAG_FDISPATCHABLE
},
{
TKIND_RECORD
,
0
}
};
...
...
@@ -4886,7 +4996,7 @@ static void test_register_typelib(BOOL system_registration)
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
count
=
ITypeLib_GetTypeInfoCount
(
typelib
);
ok
(
count
==
1
3
,
"got %d
\n
"
,
count
);
ok
(
count
==
1
4
,
"got %d
\n
"
,
count
);
for
(
i
=
0
;
i
<
count
;
i
++
)
{
...
...
dlls/oleaut32/typelib.c
View file @
61c18632
...
...
@@ -7496,7 +7496,7 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
* pointer to be valid */
VariantInit
(
pVarResult
);
hres
=
IDispatch_Invoke
(
pDispatch
,
DISPID_VALUE
,
&
IID_NULL
,
GetSystemDefaultLCID
(),
INVOKE_PROPERTYGET
,
GetSystemDefaultLCID
(),
wFlags
,
pDispParams
,
pVarResult
,
pExcepInfo
,
pArgErr
);
IDispatch_Release
(
pDispatch
);
}
...
...
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