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
b4025a3e
Commit
b4025a3e
authored
May 17, 2010
by
Andrey Turkin
Committed by
Alexandre Julliard
May 17, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Fix ICreateTypeLib2::SetFuncAndParamNames.
Getters and setters for same property can have an identical name
parent
57c784e2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
10 deletions
+28
-10
typelib.c
dlls/oleaut32/tests/typelib.c
+12
-0
typelib2.c
dlls/oleaut32/typelib2.c
+16
-10
No files found.
dlls/oleaut32/tests/typelib.c
View file @
b4025a3e
...
...
@@ -982,10 +982,12 @@ static void test_CreateTypeLib(void) {
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
prop1W
[]
=
{
'P'
,
'r'
,
'o'
,
'p'
,
'1'
,
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
};
static
OLECHAR
*
propname
[]
=
{
prop1W
,
param1W
};
static
const
GUID
custguid
=
{
0xbf611abe
,
0x5b38
,
0x11df
,{
0x91
,
0x5c
,
0x08
,
0x02
,
0x79
,
0x79
,
0x94
,
0x70
}};
char
filename
[
MAX_PATH
];
...
...
@@ -1171,6 +1173,16 @@ static void test_CreateTypeLib(void) {
hres
=
ICreateTypeInfo_SetFuncHelpContext
(
createti
,
1
,
0xabcdefab
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
hres
=
ICreateTypeInfo_SetFuncAndParamNames
(
createti
,
0
,
propname
,
1
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
hres
=
ICreateTypeInfo_SetFuncAndParamNames
(
createti
,
1
,
propname
,
1
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
hres
=
ICreateTypeInfo_SetFuncAndParamNames
(
createti
,
1
,
propname
,
2
);
ok
(
hres
==
TYPE_E_ELEMENTNOTFOUND
,
"got %08x
\n
"
,
hres
);
funcdesc
.
invkind
=
INVOKE_PROPERTYPUTREF
;
hres
=
ICreateTypeInfo_AddFuncDesc
(
createti
,
0
,
&
funcdesc
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
...
...
dlls/oleaut32/typelib2.c
View file @
b4025a3e
...
...
@@ -2132,21 +2132,27 @@ static HRESULT WINAPI ICreateTypeInfo2_fnSetFuncAndParamNames(
if
(
index
>=
This
->
typeinfo
->
cElement
||
!
cNames
)
return
TYPE_E_ELEMENTNOTFOUND
;
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
++
;
}
for
(
iter
=
This
->
typedata
->
next
->
next
,
i
=
0
;
i
<
index
;
i
++
)
iter
=
iter
->
next
;
/* cNames == cParams for put or putref accessor, cParams+1 otherwise */
if
(
cNames
!=
iter
->
u
.
data
[
5
]
+
((
iter
->
u
.
data
[
4
]
>>
3
)
&
(
INVOKE_PROPERTYPUT
|
INVOKE_PROPERTYPUTREF
)
?
0
:
1
))
return
TYPE_E_ELEMENTNOTFOUND
;
len
=
ctl2_encode_name
(
This
->
typelib
,
rgszNames
[
0
],
&
namedata
);
for
(
iter2
=
This
->
typedata
->
next
->
next
;
iter2
!=
This
->
typedata
->
next
;
iter2
=
iter2
->
next
)
{
if
(
iter2
->
name
!=-
1
&&
!
memcmp
(
namedata
,
This
->
typelib
->
typelib_segment_data
[
MSFT_SEG_NAME
]
+
iter2
->
name
+
8
,
len
))
{
/* getters/setters can have a same name */
INT
inv1
=
iter2
->
u
.
data
[
4
]
>>
3
;
INT
inv2
=
iter
->
u
.
data
[
4
]
>>
3
;
if
(
!
((
inv1
&
(
INVOKE_PROPERTYPUT
|
INVOKE_PROPERTYPUTREF
))
&&
(
inv2
&
INVOKE_PROPERTYGET
))
&&
!
((
inv2
&
(
INVOKE_PROPERTYPUT
|
INVOKE_PROPERTYPUTREF
))
&&
(
inv1
&
INVOKE_PROPERTYGET
)))
return
TYPE_E_AMBIGUOUSNAME
;
}
}
offset
=
ctl2_alloc_name
(
This
->
typelib
,
rgszNames
[
0
]);
if
(
offset
==
-
1
)
return
E_OUTOFMEMORY
;
...
...
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