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
a3b8be05
Commit
a3b8be05
authored
May 11, 2007
by
Huw Davies
Committed by
Alexandre Julliard
May 18, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Typelib inheritance tests.
parent
5aa70b3d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
238 additions
and
0 deletions
+238
-0
tmarshal.idl
dlls/oleaut32/tests/tmarshal.idl
+70
-0
typelib.c
dlls/oleaut32/tests/typelib.c
+168
-0
No files found.
dlls/oleaut32/tests/tmarshal.idl
View file @
a3b8be05
...
...
@@ -158,4 +158,74 @@ library TestTypelib
interface
IWidget
;
[
source
]
interface
IWidget
;
}
;
[
odl
,
uuid
(
375
f8a9d
-
33
d0
-
44
f3
-
b972
-
61
f8407899e0
)
]
interface
ItestIF1
:
IUnknown
{
HRESULT
fn1
(
[
in
]
int
x
)
;
HRESULT
fn2
(
[
out
,
retval
]
int
*
x
)
;
}
[
odl
,
uuid
(
094056
a3
-
666
f
-
4956
-
be12
-
1859668310b8
)
]
interface
ItestIF2
:
ItestIF1
{
HRESULT
fn3
(
[
in
]
int
y
)
;
}
[
odl
,
uuid
(
33b
aba09
-
2
e68
-
43
ab
-
81
fe
-
d84b403df2e5
)
]
dispinterface
ItestIF3
{
interface
ItestIF2
;
}
[
odl
,
uuid
(
a01005c7
-
7491
-
42
eb
-
94
f3
-
668
e37ce60a6
)
]
dispinterface
ItestIF4
{
properties
:
methods
:
[
id
(
0
x1c
)
]
HRESULT
fn
(
[
in
]
int
z
)
;
}
[
odl
,
uuid
(
4
ab61e25
-
c09f
-
4239
-
8
f7f
-
7
a018ea0199f
),
dual
]
interface
ItestIF5
:
ItestIF2
{
[
id
(
0
x1234
)
]
HRESULT
fn4
(
[
in
]
int
a
)
;
[
id
(
0
x1235
)
]
HRESULT
fn5
(
[
in
]
int
a
)
;
}
[
odl
,
uuid
(
ec236d8e
-
2
cc7
-
44
f2
-
b394
-
36
c86ff3da74
)
]
interface
ItestIF6
:
IDispatch
{
[
id
(
0
x1234
)
]
HRESULT
fn4
(
[
in
]
int
a
)
;
[
id
(
0
x1235
)
]
HRESULT
fn5
(
[
in
]
int
a
)
;
}
[
odl
,
uuid
(
f711b105
-554d-4751
-
818
c
-
46
fcc5d7c0d5
),
dual
]
interface
ItestIF7
:
ItestIF6
{
[
id
(
0
x1236
)
]
HRESULT
fn6
(
[
in
]
int
a
)
;
}
}
;
dlls/oleaut32/tests/typelib.c
View file @
a3b8be05
...
...
@@ -29,6 +29,7 @@
#include "oleauto.h"
#include "ocidl.h"
#include "shlwapi.h"
#include "tmarshal.h"
#define ok_ole_success(hr, func) ok(hr == S_OK, #func " failed with error 0x%08x\n", hr)
...
...
@@ -573,6 +574,172 @@ static void test_QueryPathOfRegTypeLib(void)
do_typelib_reg_key
(
&
uid
,
0
,
0
,
NULL
,
1
);
}
static
void
test_inheritance
(
void
)
{
HRESULT
hr
;
ITypeLib
*
pTL
;
ITypeInfo
*
pTI
,
*
pTI_p
;
TYPEATTR
*
pTA
;
HREFTYPE
href
;
FUNCDESC
*
pFD
;
WCHAR
path
[
MAX_PATH
];
static
const
WCHAR
tl_path
[]
=
{
'.'
,
'\\'
,
'm'
,
'i'
,
'd'
,
'l'
,
'_'
,
't'
,
'm'
,
'a'
,
'r'
,
's'
,
'h'
,
'a'
,
'l'
,
'.'
,
't'
,
'l'
,
'b'
,
0
};
BOOL
use_midl_tlb
=
0
;
GetModuleFileNameW
(
NULL
,
path
,
MAX_PATH
);
if
(
use_midl_tlb
)
memcpy
(
path
,
tl_path
,
sizeof
(
tl_path
));
hr
=
LoadTypeLib
(
path
,
&
pTL
);
if
(
FAILED
(
hr
))
return
;
/* ItestIF3 is a syntax 2 dispinterface */
hr
=
ITypeLib_GetTypeInfoOfGuid
(
pTL
,
&
DIID_ItestIF3
,
&
pTI
);
ok
(
hr
==
S_OK
,
"hr %08x
\n
"
,
hr
);
hr
=
ITypeInfo_GetTypeAttr
(
pTI
,
&
pTA
);
ok
(
hr
==
S_OK
,
"hr %08x
\n
"
,
hr
);
ok
(
pTA
->
typekind
==
TKIND_DISPATCH
,
"kind %04x
\n
"
,
pTA
->
typekind
);
ok
(
pTA
->
cbSizeVft
==
28
,
"sizevft %d
\n
"
,
pTA
->
cbSizeVft
);
ok
(
pTA
->
wTypeFlags
==
TYPEFLAG_FDISPATCHABLE
,
"typeflags %x
\n
"
,
pTA
->
wTypeFlags
);
if
(
use_midl_tlb
)
{
ok
(
pTA
->
cFuncs
==
6
,
"cfuncs %d
\n
"
,
pTA
->
cFuncs
);
ok
(
pTA
->
cImplTypes
==
1
,
"cimpltypes %d
\n
"
,
pTA
->
cImplTypes
);
ITypeInfo_ReleaseTypeAttr
(
pTI
,
pTA
);
hr
=
ITypeInfo_GetRefTypeOfImplType
(
pTI
,
0
,
&
href
);
ok
(
hr
==
S_OK
,
"hr %08x
\n
"
,
hr
);
hr
=
ITypeInfo_GetRefTypeInfo
(
pTI
,
href
,
&
pTI_p
);
ok
(
hr
==
S_OK
,
"hr %08x
\n
"
,
hr
);
hr
=
ITypeInfo_GetTypeAttr
(
pTI_p
,
&
pTA
);
todo_wine
{
ok
(
IsEqualGUID
(
&
pTA
->
guid
,
&
IID_IDispatch
),
"guid {%08x-....
\n
"
,
pTA
->
guid
.
Data1
);
}
ITypeInfo_ReleaseTypeAttr
(
pTI_p
,
pTA
);
ITypeInfo_Release
(
pTI_p
);
/* Should have six methods */
hr
=
ITypeInfo_GetFuncDesc
(
pTI
,
6
,
&
pFD
);
todo_wine
{
ok
(
hr
==
TYPE_E_ELEMENTNOTFOUND
,
"hr %08x
\n
"
,
hr
);
}
hr
=
ITypeInfo_GetFuncDesc
(
pTI
,
5
,
&
pFD
);
todo_wine
{
ok
(
hr
==
S_OK
,
"hr %08x
\n
"
,
hr
);
}
if
(
SUCCEEDED
(
hr
))
{
ok
(
pFD
->
memid
==
0x60020000
,
"memid %08x
\n
"
,
pFD
->
memid
);
ok
(
pFD
->
oVft
==
20
,
"oVft %d
\n
"
,
pFD
->
oVft
);
ITypeInfo_ReleaseFuncDesc
(
pTI
,
pFD
);
}
}
ITypeInfo_Release
(
pTI
);
/* ItestIF4 is a syntax 1 dispinterface */
hr
=
ITypeLib_GetTypeInfoOfGuid
(
pTL
,
&
DIID_ItestIF4
,
&
pTI
);
ok
(
hr
==
S_OK
,
"hr %08x
\n
"
,
hr
);
hr
=
ITypeInfo_GetTypeAttr
(
pTI
,
&
pTA
);
ok
(
hr
==
S_OK
,
"hr %08x
\n
"
,
hr
);
ok
(
pTA
->
typekind
==
TKIND_DISPATCH
,
"kind %04x
\n
"
,
pTA
->
typekind
);
ok
(
pTA
->
cbSizeVft
==
28
,
"sizevft %d
\n
"
,
pTA
->
cbSizeVft
);
ok
(
pTA
->
wTypeFlags
==
TYPEFLAG_FDISPATCHABLE
,
"typeflags %x
\n
"
,
pTA
->
wTypeFlags
);
ok
(
pTA
->
cFuncs
==
1
,
"cfuncs %d
\n
"
,
pTA
->
cFuncs
);
ok
(
pTA
->
cImplTypes
==
1
,
"cimpltypes %d
\n
"
,
pTA
->
cImplTypes
);
ITypeInfo_ReleaseTypeAttr
(
pTI
,
pTA
);
hr
=
ITypeInfo_GetRefTypeOfImplType
(
pTI
,
0
,
&
href
);
ok
(
hr
==
S_OK
,
"hr %08x
\n
"
,
hr
);
hr
=
ITypeInfo_GetRefTypeInfo
(
pTI
,
href
,
&
pTI_p
);
ok
(
hr
==
S_OK
,
"hr %08x
\n
"
,
hr
);
hr
=
ITypeInfo_GetTypeAttr
(
pTI_p
,
&
pTA
);
ok
(
IsEqualGUID
(
&
pTA
->
guid
,
&
IID_IDispatch
),
"guid {%08x-....
\n
"
,
pTA
->
guid
.
Data1
);
ITypeInfo_ReleaseTypeAttr
(
pTI_p
,
pTA
);
ITypeInfo_Release
(
pTI_p
);
hr
=
ITypeInfo_GetFuncDesc
(
pTI
,
1
,
&
pFD
);
todo_wine
{
ok
(
hr
==
TYPE_E_ELEMENTNOTFOUND
,
"hr %08x
\n
"
,
hr
);
}
hr
=
ITypeInfo_GetFuncDesc
(
pTI
,
0
,
&
pFD
);
ok
(
hr
==
S_OK
,
"hr %08x
\n
"
,
hr
);
ok
(
pFD
->
memid
==
0x1c
,
"memid %08x
\n
"
,
pFD
->
memid
);
ITypeInfo_ReleaseFuncDesc
(
pTI
,
pFD
);
ITypeInfo_Release
(
pTI
);
/* ItestIF5 is dual with inherited ifaces which derive from IUnknown but not IDispatch */
hr
=
ITypeLib_GetTypeInfoOfGuid
(
pTL
,
&
IID_ItestIF5
,
&
pTI
);
ok
(
hr
==
S_OK
,
"hr %08x
\n
"
,
hr
);
hr
=
ITypeInfo_GetTypeAttr
(
pTI
,
&
pTA
);
ok
(
hr
==
S_OK
,
"hr %08x
\n
"
,
hr
);
ok
(
pTA
->
typekind
==
TKIND_DISPATCH
,
"kind %04x
\n
"
,
pTA
->
typekind
);
ok
(
pTA
->
cbSizeVft
==
28
,
"sizevft %d
\n
"
,
pTA
->
cbSizeVft
);
if
(
use_midl_tlb
)
{
ok
(
pTA
->
wTypeFlags
==
TYPEFLAG_FDUAL
,
"typeflags %x
\n
"
,
pTA
->
wTypeFlags
);
}
ok
(
pTA
->
cFuncs
==
8
,
"cfuncs %d
\n
"
,
pTA
->
cFuncs
);
ok
(
pTA
->
cImplTypes
==
1
,
"cimpltypes %d
\n
"
,
pTA
->
cImplTypes
);
ITypeInfo_ReleaseTypeAttr
(
pTI
,
pTA
);
hr
=
ITypeInfo_GetRefTypeOfImplType
(
pTI
,
0
,
&
href
);
ok
(
hr
==
S_OK
,
"hr %08x
\n
"
,
hr
);
hr
=
ITypeInfo_GetRefTypeInfo
(
pTI
,
href
,
&
pTI_p
);
ok
(
hr
==
S_OK
,
"hr %08x
\n
"
,
hr
);
hr
=
ITypeInfo_GetTypeAttr
(
pTI_p
,
&
pTA
);
todo_wine
{
ok
(
IsEqualGUID
(
&
pTA
->
guid
,
&
IID_IDispatch
),
"guid {%08x-....
\n
"
,
pTA
->
guid
.
Data1
);
}
ITypeInfo_ReleaseTypeAttr
(
pTI_p
,
pTA
);
ITypeInfo_Release
(
pTI_p
);
if
(
use_midl_tlb
)
{
hr
=
ITypeInfo_GetFuncDesc
(
pTI
,
6
,
&
pFD
);
ok
(
hr
==
S_OK
,
"hr %08x
\n
"
,
hr
);
ok
(
pFD
->
memid
==
0x1234
,
"memid %08x
\n
"
,
pFD
->
memid
);
ITypeInfo_ReleaseFuncDesc
(
pTI
,
pFD
);
}
ITypeInfo_Release
(
pTI
);
/* ItestIF7 is dual with inherited ifaces which derive from Dispatch */
hr
=
ITypeLib_GetTypeInfoOfGuid
(
pTL
,
&
IID_ItestIF7
,
&
pTI
);
ok
(
hr
==
S_OK
,
"hr %08x
\n
"
,
hr
);
hr
=
ITypeInfo_GetTypeAttr
(
pTI
,
&
pTA
);
ok
(
hr
==
S_OK
,
"hr %08x
\n
"
,
hr
);
ok
(
pTA
->
typekind
==
TKIND_DISPATCH
,
"kind %04x
\n
"
,
pTA
->
typekind
);
ok
(
pTA
->
cbSizeVft
==
28
,
"sizevft %d
\n
"
,
pTA
->
cbSizeVft
);
ok
(
pTA
->
wTypeFlags
==
(
TYPEFLAG_FDISPATCHABLE
|
TYPEFLAG_FDUAL
),
"typeflags %x
\n
"
,
pTA
->
wTypeFlags
);
ok
(
pTA
->
cFuncs
==
10
,
"cfuncs %d
\n
"
,
pTA
->
cFuncs
);
ok
(
pTA
->
cImplTypes
==
1
,
"cimpltypes %d
\n
"
,
pTA
->
cImplTypes
);
ITypeInfo_ReleaseTypeAttr
(
pTI
,
pTA
);
hr
=
ITypeInfo_GetRefTypeOfImplType
(
pTI
,
0
,
&
href
);
ok
(
hr
==
S_OK
,
"hr %08x
\n
"
,
hr
);
hr
=
ITypeInfo_GetRefTypeInfo
(
pTI
,
href
,
&
pTI_p
);
ok
(
hr
==
S_OK
,
"hr %08x
\n
"
,
hr
);
hr
=
ITypeInfo_GetTypeAttr
(
pTI_p
,
&
pTA
);
todo_wine
{
ok
(
IsEqualGUID
(
&
pTA
->
guid
,
&
IID_IDispatch
),
"guid {%08x-....
\n
"
,
pTA
->
guid
.
Data1
);
}
ITypeInfo_ReleaseTypeAttr
(
pTI_p
,
pTA
);
ITypeInfo_Release
(
pTI_p
);
hr
=
ITypeInfo_GetFuncDesc
(
pTI
,
9
,
&
pFD
);
ok
(
hr
==
S_OK
,
"hr %08x
\n
"
,
hr
);
ok
(
pFD
->
memid
==
0x1236
,
"memid %08x
\n
"
,
pFD
->
memid
);
ITypeInfo_ReleaseFuncDesc
(
pTI
,
pFD
);
ITypeInfo_Release
(
pTI
);
ITypeLib_Release
(
pTL
);
return
;
}
START_TEST
(
typelib
)
{
ref_count_test
(
wszStdOle2
);
...
...
@@ -580,4 +747,5 @@ START_TEST(typelib)
test_CreateDispTypeInfo
();
test_TypeInfo
();
test_QueryPathOfRegTypeLib
();
test_inheritance
();
}
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