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
77e1b7a1
Commit
77e1b7a1
authored
Feb 24, 2010
by
Piotr Caban
Committed by
Alexandre Julliard
Feb 24, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Added implementation of ITypeInfo2_GetRefTypeOfImplType.
parent
31837863
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
5 deletions
+55
-5
typelib.c
dlls/oleaut32/tests/typelib.c
+23
-0
typelib2.c
dlls/oleaut32/typelib2.c
+32
-5
No files found.
dlls/oleaut32/tests/typelib.c
View file @
77e1b7a1
...
...
@@ -1037,6 +1037,10 @@ static void test_CreateTypeLib(void) {
hres
=
ICreateTypeInfo_AddImplType
(
createti
,
0
,
hreftype
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
hres
=
ITypeInfo_GetRefTypeOfImplType
(
interface1
,
0
,
&
hreftype
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
ok
(
hreftype
==
3
,
"hreftype = %d
\n
"
,
hreftype
);
memset
(
&
funcdesc
,
0
,
sizeof
(
FUNCDESC
));
funcdesc
.
funckind
=
FUNC_PUREVIRTUAL
;
funcdesc
.
invkind
=
INVOKE_PROPERTYGET
;
...
...
@@ -1168,6 +1172,9 @@ static void test_CreateTypeLib(void) {
hres
=
ICreateTypeInfo_QueryInterface
(
createti
,
&
IID_ITypeInfo
,
(
void
**
)
&
interface2
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
hres
=
ITypeInfo_GetRefTypeOfImplType
(
interface2
,
0
,
&
hreftype
);
ok
(
hres
==
TYPE_E_ELEMENTNOTFOUND
,
"got %08x
\n
"
,
hres
);
hres
=
ICreateTypeInfo_AddRefTypeInfo
(
createti
,
interface1
,
&
hreftype
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
...
...
@@ -1180,6 +1187,10 @@ static void test_CreateTypeLib(void) {
hres
=
ICreateTypeInfo_AddImplType
(
createti
,
0
,
hreftype
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
hres
=
ITypeInfo_GetRefTypeOfImplType
(
interface2
,
0
,
&
hreftype
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
ok
(
hreftype
==
2
,
"hreftype = %d
\n
"
,
hreftype
);
hres
=
ICreateTypeInfo_SetImplTypeFlags
(
createti
,
0
,
IMPLTYPEFLAG_FDEFAULT
);
ok
(
hres
==
TYPE_E_BADMODULEKIND
,
"got %08x
\n
"
,
hres
);
...
...
@@ -1240,6 +1251,18 @@ static void test_CreateTypeLib(void) {
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
ok
(
impltypeflags
==
0
,
"impltypeflags = %x
\n
"
,
impltypeflags
);
hres
=
ITypeInfo_GetRefTypeOfImplType
(
ti
,
0
,
&
hreftype
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
ok
(
hreftype
==
0
,
"hreftype = %d
\n
"
,
hreftype
);
hres
=
ITypeInfo_GetRefTypeOfImplType
(
ti
,
1
,
&
hreftype
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
ok
(
hreftype
==
1
,
"hreftype = %d
\n
"
,
hreftype
);
hres
=
ITypeInfo_GetRefTypeOfImplType
(
ti
,
2
,
&
hreftype
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
ok
(
hreftype
==
1
,
"hreftype = %d
\n
"
,
hreftype
);
ITypeInfo_Release
(
ti
);
ICreateTypeInfo_Release
(
createti
);
...
...
dlls/oleaut32/typelib2.c
View file @
77e1b7a1
...
...
@@ -2835,8 +2835,35 @@ static HRESULT WINAPI ITypeInfo2_fnGetRefTypeOfImplType(
UINT
index
,
HREFTYPE
*
pRefType
)
{
FIXME
(
"(%p,%d,%p), stub!
\n
"
,
iface
,
index
,
pRefType
);
return
E_OUTOFMEMORY
;
ICreateTypeInfo2Impl
*
This
=
impl_from_ITypeInfo2
(
iface
);
MSFT_RefRecord
*
ref
;
int
offset
;
TRACE
(
"(%p,%d,%p)
\n
"
,
iface
,
index
,
pRefType
);
if
(
!
pRefType
)
return
E_INVALIDARG
;
if
(
index
==
-
1
)
{
FIXME
(
"Dual interfaces not handled yet
\n
"
);
return
E_NOTIMPL
;
}
if
(
index
>=
This
->
typeinfo
->
cImplTypes
)
return
TYPE_E_ELEMENTNOTFOUND
;
if
((
This
->
typeinfo
->
typekind
&
0xf
)
==
TKIND_INTERFACE
)
{
*
pRefType
=
This
->
typeinfo
->
datatype1
+
2
;
return
S_OK
;
}
offset
=
ctl2_find_nth_reference
(
This
->
typelib
,
This
->
typeinfo
->
datatype1
,
index
);
if
(
offset
==
-
1
)
return
TYPE_E_ELEMENTNOTFOUND
;
ref
=
(
MSFT_RefRecord
*
)
&
This
->
typelib
->
typelib_segment_data
[
MSFT_SEG_REFERENCES
][
offset
];
*
pRefType
=
ref
->
reftype
;
return
S_OK
;
}
/******************************************************************************
...
...
@@ -2968,10 +2995,10 @@ static HRESULT WINAPI ITypeInfo2_fnGetRefTypeInfo(
WCHAR
*
filename
;
HRESULT
hres
;
if
(
hRefType
-
1
>=
This
->
typelib
->
typelib_segdir
[
MSFT_SEG_IMPORTINFO
].
length
)
if
(
(
hRefType
&
(
~
0x3
))
>=
This
->
typelib
->
typelib_segdir
[
MSFT_SEG_IMPORTINFO
].
length
)
return
E_FAIL
;
impinfo
=
(
MSFT_ImpInfo
*
)
&
This
->
typelib
->
typelib_segment_data
[
MSFT_SEG_IMPORTINFO
][
hRefType
-
1
];
impinfo
=
(
MSFT_ImpInfo
*
)
&
This
->
typelib
->
typelib_segment_data
[
MSFT_SEG_IMPORTINFO
][
hRefType
&
(
~
0x3
)
];
impfile
=
(
MSFT_ImpFile
*
)
&
This
->
typelib
->
typelib_segment_data
[
MSFT_SEG_IMPORTFILES
][
impinfo
->
oImpFile
];
guid
=
(
MSFT_GuidEntry
*
)
&
This
->
typelib
->
typelib_segment_data
[
MSFT_SEG_GUID
][
impinfo
->
oGuid
];
...
...
@@ -2990,7 +3017,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetRefTypeInfo(
int
i
=
0
;
for
(
iter
=
This
->
typelib
->
typeinfos
;
iter
;
iter
=
iter
->
next_typeinfo
)
{
if
(
This
->
typelib
->
typelib_typeinfo_offsets
[
i
]
==
hRefType
)
{
if
(
This
->
typelib
->
typelib_typeinfo_offsets
[
i
]
==
(
hRefType
&
(
~
0x3
))
)
{
*
ppTInfo
=
(
ITypeInfo
*
)
&
iter
->
lpVtblTypeInfo2
;
ITypeLib_AddRef
(
*
ppTInfo
);
...
...
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