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
ea6b690f
Commit
ea6b690f
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: Improve TKIND_COCLASS handling while creating typelib.
parent
e8d117f5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
9 deletions
+39
-9
typelib.c
dlls/oleaut32/tests/typelib.c
+33
-6
typelib2.c
dlls/oleaut32/typelib2.c
+6
-3
No files found.
dlls/oleaut32/tests/typelib.c
View file @
ea6b690f
...
...
@@ -972,6 +972,7 @@ static void test_CreateTypeLib(void) {
static
const
WCHAR
stdoleW
[]
=
{
's'
,
't'
,
'd'
,
'o'
,
'l'
,
'e'
,
'2'
,
'.'
,
't'
,
'l'
,
'b'
,
0
};
static
OLECHAR
interface1W
[]
=
{
'i'
,
'n'
,
't'
,
'e'
,
'r'
,
'f'
,
'a'
,
'c'
,
'e'
,
'1'
,
0
};
static
OLECHAR
interface2W
[]
=
{
'i'
,
'n'
,
't'
,
'e'
,
'r'
,
'f'
,
'a'
,
'c'
,
'e'
,
'2'
,
0
};
static
OLECHAR
coclassW
[]
=
{
'c'
,
'o'
,
'c'
,
'l'
,
'a'
,
's'
,
's'
,
0
};
static
WCHAR
defaultW
[]
=
{
'd'
,
'e'
,
'f'
,
'a'
,
'u'
,
'l'
,
't'
,
0x3213
,
0
};
static
OLECHAR
func1W
[]
=
{
'f'
,
'u'
,
'n'
,
'c'
,
'1'
,
0
};
static
OLECHAR
func2W
[]
=
{
'f'
,
'u'
,
'n'
,
'c'
,
'2'
,
0
};
...
...
@@ -983,7 +984,7 @@ static void test_CreateTypeLib(void) {
char
filename
[
MAX_PATH
];
WCHAR
filenameW
[
MAX_PATH
];
ICreateTypeLib2
*
createtl
;
ICreateTypeInfo
*
createti
,
*
createti2
;
ICreateTypeInfo
*
createti
;
ITypeLib
*
tl
,
*
stdole
;
ITypeInfo
*
interface1
,
*
interface2
,
*
unknown
,
*
ti
;
FUNCDESC
funcdesc
;
...
...
@@ -1163,13 +1164,13 @@ static void test_CreateTypeLib(void) {
hres
=
ICreateTypeLib_CreateTypeInfo
(
createtl
,
interface1W
,
TKIND_INTERFACE
,
&
createti
);
ok
(
hres
==
TYPE_E_NAMECONFLICT
,
"got %08x
\n
"
,
hres
);
hres
=
ICreateTypeLib_CreateTypeInfo
(
createtl
,
interface2W
,
TKIND_INTERFACE
,
&
createti
2
);
hres
=
ICreateTypeLib_CreateTypeInfo
(
createtl
,
interface2W
,
TKIND_INTERFACE
,
&
createti
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
hres
=
ICreateTypeInfo_QueryInterface
(
createti
2
,
&
IID_ITypeInfo
,
(
void
**
)
&
interface2
);
hres
=
ICreateTypeInfo_QueryInterface
(
createti
,
&
IID_ITypeInfo
,
(
void
**
)
&
interface2
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
hres
=
ICreateTypeInfo_AddRefTypeInfo
(
createti
2
,
interface1
,
&
hreftype
);
hres
=
ICreateTypeInfo_AddRefTypeInfo
(
createti
,
interface1
,
&
hreftype
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
hres
=
ITypeInfo_GetRefTypeInfo
(
interface2
,
0
,
&
ti
);
...
...
@@ -1178,10 +1179,36 @@ static void test_CreateTypeLib(void) {
ITypeInfo_Release
(
ti
);
hres
=
ICreateTypeInfo_AddImplType
(
createti2
,
0
,
hreftype
);
hres
=
ICreateTypeInfo_AddImplType
(
createti
,
0
,
hreftype
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
ICreateTypeInfo_Release
(
createti
);
hres
=
ICreateTypeLib_CreateTypeInfo
(
createtl
,
coclassW
,
TKIND_COCLASS
,
&
createti
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
hres
=
ICreateTypeInfo_AddRefTypeInfo
(
createti
,
interface1
,
&
hreftype
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
ICreateTypeInfo_Release
(
createti2
);
hres
=
ICreateTypeInfo_AddImplType
(
createti
,
0
,
hreftype
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
hres
=
ICreateTypeInfo_AddImplType
(
createti
,
0
,
hreftype
);
ok
(
hres
==
TYPE_E_ELEMENTNOTFOUND
,
"got %08x
\n
"
,
hres
);
hres
=
ICreateTypeInfo_AddRefTypeInfo
(
createti
,
unknown
,
&
hreftype
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
hres
=
ICreateTypeInfo_AddImplType
(
createti
,
1
,
hreftype
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
hres
=
ICreateTypeInfo_AddImplType
(
createti
,
1
,
hreftype
);
ok
(
hres
==
TYPE_E_ELEMENTNOTFOUND
,
"got %08x
\n
"
,
hres
);
hres
=
ICreateTypeInfo_AddImplType
(
createti
,
2
,
hreftype
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
ICreateTypeInfo_Release
(
createti
);
hres
=
ITypeInfo_GetTypeAttr
(
interface1
,
&
typeattr
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
...
...
dlls/oleaut32/typelib2.c
View file @
ea6b690f
...
...
@@ -1799,12 +1799,12 @@ static HRESULT WINAPI ICreateTypeInfo2_fnAddImplType(
if
(
index
!=
0
)
return
TYPE_E_ELEMENTNOTFOUND
;
This
->
typeinfo
->
datatype1
=
hRefType
;
This
->
typeinfo
->
cImplTypes
++
;
}
else
{
FIXME
(
"AddImplType unsupported on typekind %d
\n
"
,
This
->
typeinfo
->
typekind
&
15
);
return
E_OUTOFMEMORY
;
}
This
->
typeinfo
->
cImplTypes
++
;
return
S_OK
;
}
...
...
@@ -2254,6 +2254,9 @@ static HRESULT WINAPI ICreateTypeInfo2_fnLayOut(
TRACE
(
"(%p)
\n
"
,
iface
);
if
((
This
->
typeinfo
->
typekind
&
0xf
)
==
TKIND_COCLASS
)
return
S_OK
;
/* Validate inheritance */
This
->
typeinfo
->
datatype2
=
0
;
hreftype
=
This
->
typeinfo
->
datatype1
;
...
...
@@ -3933,9 +3936,9 @@ static HRESULT WINAPI ICreateTypeLib2_fnSaveAllChanges(ICreateTypeLib2 * iface)
filepos
+=
ctl2_finalize_segment
(
This
,
filepos
,
MSFT_SEG_TYPEINFO
);
filepos
+=
ctl2_finalize_segment
(
This
,
filepos
,
MSFT_SEG_GUIDHASH
);
filepos
+=
ctl2_finalize_segment
(
This
,
filepos
,
MSFT_SEG_GUID
);
filepos
+=
ctl2_finalize_segment
(
This
,
filepos
,
MSFT_SEG_REFERENCES
);
filepos
+=
ctl2_finalize_segment
(
This
,
filepos
,
MSFT_SEG_IMPORTINFO
);
filepos
+=
ctl2_finalize_segment
(
This
,
filepos
,
MSFT_SEG_IMPORTFILES
);
filepos
+=
ctl2_finalize_segment
(
This
,
filepos
,
MSFT_SEG_REFERENCES
);
filepos
+=
ctl2_finalize_segment
(
This
,
filepos
,
MSFT_SEG_NAMEHASH
);
filepos
+=
ctl2_finalize_segment
(
This
,
filepos
,
MSFT_SEG_NAME
);
filepos
+=
ctl2_finalize_segment
(
This
,
filepos
,
MSFT_SEG_STRING
);
...
...
@@ -3958,9 +3961,9 @@ static HRESULT WINAPI ICreateTypeLib2_fnSaveAllChanges(ICreateTypeLib2 * iface)
if
(
!
ctl2_write_segment
(
This
,
hFile
,
MSFT_SEG_TYPEINFO
))
return
retval
;
if
(
!
ctl2_write_segment
(
This
,
hFile
,
MSFT_SEG_GUIDHASH
))
return
retval
;
if
(
!
ctl2_write_segment
(
This
,
hFile
,
MSFT_SEG_GUID
))
return
retval
;
if
(
!
ctl2_write_segment
(
This
,
hFile
,
MSFT_SEG_REFERENCES
))
return
retval
;
if
(
!
ctl2_write_segment
(
This
,
hFile
,
MSFT_SEG_IMPORTINFO
))
return
retval
;
if
(
!
ctl2_write_segment
(
This
,
hFile
,
MSFT_SEG_IMPORTFILES
))
return
retval
;
if
(
!
ctl2_write_segment
(
This
,
hFile
,
MSFT_SEG_REFERENCES
))
return
retval
;
if
(
!
ctl2_write_segment
(
This
,
hFile
,
MSFT_SEG_NAMEHASH
))
return
retval
;
if
(
!
ctl2_write_segment
(
This
,
hFile
,
MSFT_SEG_NAME
))
return
retval
;
if
(
!
ctl2_write_segment
(
This
,
hFile
,
MSFT_SEG_STRING
))
return
retval
;
...
...
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