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
3102176c
Commit
3102176c
authored
Feb 22, 2010
by
Piotr Caban
Committed by
Alexandre Julliard
Feb 23, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Improved ICreateTypeInfo2_SetFuncAndParamNames implementation.
parent
e68c7cf7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
15 deletions
+60
-15
typelib.c
dlls/oleaut32/tests/typelib.c
+27
-0
typelib2.c
dlls/oleaut32/typelib2.c
+33
-15
No files found.
dlls/oleaut32/tests/typelib.c
View file @
3102176c
...
@@ -971,6 +971,12 @@ if(use_midl_tlb) {
...
@@ -971,6 +971,12 @@ if(use_midl_tlb) {
static
void
test_CreateTypeLib
(
void
)
{
static
void
test_CreateTypeLib
(
void
)
{
static
OLECHAR
interface1W
[]
=
{
'i'
,
'n'
,
't'
,
'e'
,
'r'
,
'f'
,
'a'
,
'c'
,
'e'
,
'1'
,
0
};
static
OLECHAR
interface1W
[]
=
{
'i'
,
'n'
,
't'
,
'e'
,
'r'
,
'f'
,
'a'
,
'c'
,
'e'
,
'1'
,
0
};
static
WCHAR
defaultW
[]
=
{
'd'
,
'e'
,
'f'
,
'a'
,
'u'
,
'l'
,
't'
,
0x3213
,
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
};
static
OLECHAR
param1W
[]
=
{
'p'
,
'a'
,
'r'
,
'a'
,
'm'
,
'1'
,
0
};
static
OLECHAR
param2W
[]
=
{
'p'
,
'a'
,
'r'
,
'a'
,
'm'
,
'2'
,
0
};
static
OLECHAR
*
names1
[]
=
{
func1W
,
param1W
,
param2W
};
static
OLECHAR
*
names2
[]
=
{
func2W
,
param1W
,
param2W
};
char
filename
[
MAX_PATH
];
char
filename
[
MAX_PATH
];
WCHAR
filenameW
[
MAX_PATH
];
WCHAR
filenameW
[
MAX_PATH
];
...
@@ -1083,6 +1089,27 @@ static void test_CreateTypeLib(void) {
...
@@ -1083,6 +1089,27 @@ static void test_CreateTypeLib(void) {
hres
=
ICreateTypeInfo_AddFuncDesc
(
createti
,
3
,
&
funcdesc
);
hres
=
ICreateTypeInfo_AddFuncDesc
(
createti
,
3
,
&
funcdesc
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
hres
=
ICreateTypeInfo_SetFuncAndParamNames
(
createti
,
1000
,
NULL
,
1
);
ok
(
hres
==
E_INVALIDARG
,
"got %08x
\n
"
,
hres
);
hres
=
ICreateTypeInfo_SetFuncAndParamNames
(
createti
,
1000
,
names1
,
1
);
ok
(
hres
==
TYPE_E_ELEMENTNOTFOUND
,
"got %08x
\n
"
,
hres
);
hres
=
ICreateTypeInfo_SetFuncAndParamNames
(
createti
,
0
,
names1
,
2
);
ok
(
hres
==
TYPE_E_ELEMENTNOTFOUND
,
"got %08x
\n
"
,
hres
);
hres
=
ICreateTypeInfo_SetFuncAndParamNames
(
createti
,
0
,
names2
,
1
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
hres
=
ICreateTypeInfo_SetFuncAndParamNames
(
createti
,
0
,
names1
,
1
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
hres
=
ICreateTypeInfo_SetFuncAndParamNames
(
createti
,
3
,
names2
,
3
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
hres
=
ICreateTypeInfo_SetFuncAndParamNames
(
createti
,
3
,
names1
,
3
);
ok
(
hres
==
TYPE_E_AMBIGUOUSNAME
,
"got %08x
\n
"
,
hres
);
ICreateTypeInfo_Release
(
createti
);
ICreateTypeInfo_Release
(
createti
);
hres
=
ICreateTypeLib_CreateTypeInfo
(
createtl
,
interface1W
,
TKIND_INTERFACE
,
&
createti
);
hres
=
ICreateTypeLib_CreateTypeInfo
(
createtl
,
interface1W
,
TKIND_INTERFACE
,
&
createti
);
...
...
dlls/oleaut32/typelib2.c
View file @
3102176c
...
@@ -1914,32 +1914,50 @@ static HRESULT WINAPI ICreateTypeInfo2_fnSetFuncAndParamNames(
...
@@ -1914,32 +1914,50 @@ static HRESULT WINAPI ICreateTypeInfo2_fnSetFuncAndParamNames(
UINT
cNames
)
UINT
cNames
)
{
{
ICreateTypeInfo2Impl
*
This
=
(
ICreateTypeInfo2Impl
*
)
iface
;
ICreateTypeInfo2Impl
*
This
=
(
ICreateTypeInfo2Impl
*
)
iface
;
CyclicList
*
iter
=
NULL
,
*
iter2
;
CyclicList
*
iter
;
int
offset
,
len
,
i
=
0
;
UINT
i
;
int
offset
;
char
*
namedata
;
char
*
namedata
;
FIXME
(
"(%p,%d,%s,%d), stub!
\n
"
,
iface
,
index
,
debugstr_w
(
*
rgszNames
)
,
cNames
);
TRACE
(
"(%p %d %p %d)
\n
"
,
iface
,
index
,
rgszNames
,
cNames
);
offset
=
ctl2_alloc_name
(
This
->
typelib
,
rgszNames
[
0
]);
if
(
!
rgszNames
)
return
E_INVALIDARG
;
namedata
=
This
->
typelib
->
typelib_segment_data
[
MSFT_SEG_NAME
]
+
offset
;
if
(
index
>=
This
->
typeinfo
->
cElement
||
!
cNames
)
namedata
[
9
]
&=
~
0x10
;
return
TYPE_E_ELEMENTNOTFOUND
;
if
(
*
((
INT
*
)
namedata
)
==
-
1
)
{
*
((
INT
*
)
namedata
)
=
This
->
typelib
->
typelib_typeinfo_offsets
[
This
->
typeinfo
->
typekind
>>
16
];
len
=
ctl2_encode_name
(
This
->
typelib
,
rgszNames
[
0
],
&
namedata
);
for
(
iter2
=
This
->
typedata
->
next
->
next
;
iter2
!=
This
->
typedata
->
next
;
iter2
=
iter2
->
next
)
{
if
(
i
==
index
)
iter
=
iter2
;
else
if
(
iter2
->
name
!=-
1
&&
!
memcmp
(
namedata
,
This
->
typelib
->
typelib_segment_data
[
MSFT_SEG_NAME
]
+
iter2
->
name
+
8
,
len
))
return
TYPE_E_AMBIGUOUSNAME
;
i
++
;
}
}
iter
=
This
->
typedata
->
next
->
next
;
/* cNames == cParams for put or putref accessor, cParams+1 otherwise */
for
(
i
=
0
;
i
<
index
;
i
++
)
if
(
cNames
!=
iter
->
u
.
data
[
5
]
+
((
iter
->
u
.
data
[
4
]
>>
3
)
&
(
INVOKE_PROPERTYPUT
|
INVOKE_PROPERTYPUTREF
)
?
0
:
1
))
iter
=
iter
->
next
;
return
TYPE_E_ELEMENTNOTFOUND
;
offset
=
ctl2_alloc_name
(
This
->
typelib
,
rgszNames
[
0
]);
if
(
offset
==
-
1
)
return
E_OUTOFMEMORY
;
iter
->
name
=
offset
;
iter
->
name
=
offset
;
namedata
=
This
->
typelib
->
typelib_segment_data
[
MSFT_SEG_NAME
]
+
offset
;
*
((
INT
*
)
namedata
)
=
This
->
typelib
->
typelib_typeinfo_offsets
[
This
->
typeinfo
->
typekind
>>
16
];
if
(
iter
->
u
.
data
[
4
]
&
0x1000
)
len
=
iter
->
u
.
data
[
5
];
else
len
=
0
;
for
(
i
=
1
;
i
<
cNames
;
i
++
)
{
for
(
i
=
1
;
i
<
cNames
;
i
++
)
{
/* FIXME: Almost certainly easy to break */
offset
=
ctl2_alloc_name
(
This
->
typelib
,
rgszNames
[
i
]);
offset
=
ctl2_alloc_name
(
This
->
typelib
,
rgszNames
[
i
]);
iter
->
u
.
data
[(
i
*
3
)
+
5
]
=
offset
;
iter
->
u
.
data
[(
i
*
3
)
+
4
+
len
]
=
offset
;
}
}
return
S_OK
;
return
S_OK
;
...
...
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