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
069b8e50
Commit
069b8e50
authored
Dec 25, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 27, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Allow all property methods to have the same name.
parent
b6313c70
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
7 deletions
+79
-7
typelib.c
dlls/oleaut32/tests/typelib.c
+70
-0
typelib2.c
dlls/oleaut32/typelib2.c
+9
-7
No files found.
dlls/oleaut32/tests/typelib.c
View file @
069b8e50
...
...
@@ -2929,6 +2929,75 @@ static void test_SetVarHelpContext(void)
DeleteFileA
(
filenameA
);
}
static
void
test_SetFuncAndParamNames
(
void
)
{
static
OLECHAR
nameW
[]
=
{
'n'
,
'a'
,
'm'
,
'e'
,
0
};
static
OLECHAR
prop
[]
=
{
'p'
,
'r'
,
'o'
,
'p'
,
0
};
static
OLECHAR
*
propW
[]
=
{
prop
};
CHAR
filenameA
[
MAX_PATH
];
WCHAR
filenameW
[
MAX_PATH
];
ICreateTypeLib2
*
ctl
;
ICreateTypeInfo
*
cti
;
FUNCDESC
funcdesc
;
ELEMDESC
edesc
;
HRESULT
hr
;
GetTempFileNameA
(
"."
,
"tlb"
,
0
,
filenameA
);
MultiByteToWideChar
(
CP_ACP
,
0
,
filenameA
,
-
1
,
filenameW
,
MAX_PATH
);
hr
=
CreateTypeLib2
(
SYS_WIN32
,
filenameW
,
&
ctl
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
ICreateTypeLib2_CreateTypeInfo
(
ctl
,
nameW
,
TKIND_DISPATCH
,
&
cti
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
/* get method */
memset
(
&
funcdesc
,
0
,
sizeof
(
FUNCDESC
));
funcdesc
.
funckind
=
FUNC_DISPATCH
;
funcdesc
.
callconv
=
CC_STDCALL
;
funcdesc
.
elemdescFunc
.
tdesc
.
vt
=
VT_VOID
;
funcdesc
.
wFuncFlags
=
FUNCFLAG_FBINDABLE
;
/* put method */
memset
(
&
edesc
,
0
,
sizeof
(
edesc
));
edesc
.
tdesc
.
vt
=
VT_BSTR
;
U
(
edesc
).
idldesc
.
dwReserved
=
0
;
U
(
edesc
).
idldesc
.
wIDLFlags
=
IDLFLAG_FIN
;
funcdesc
.
lprgelemdescParam
=
&
edesc
;
funcdesc
.
invkind
=
INVOKE_PROPERTYPUT
;
funcdesc
.
cParams
=
1
;
hr
=
ICreateTypeInfo_AddFuncDesc
(
cti
,
0
,
&
funcdesc
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
/* setter name */
hr
=
ICreateTypeInfo_SetFuncAndParamNames
(
cti
,
0
,
propW
,
1
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
/* putref method */
funcdesc
.
invkind
=
INVOKE_PROPERTYPUTREF
;
hr
=
ICreateTypeInfo_AddFuncDesc
(
cti
,
1
,
&
funcdesc
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
/* putref name */
hr
=
ICreateTypeInfo_SetFuncAndParamNames
(
cti
,
1
,
propW
,
1
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
funcdesc
.
invkind
=
INVOKE_PROPERTYGET
;
funcdesc
.
cParams
=
0
;
hr
=
ICreateTypeInfo_AddFuncDesc
(
cti
,
2
,
&
funcdesc
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
/* getter name */
hr
=
ICreateTypeInfo_SetFuncAndParamNames
(
cti
,
2
,
propW
,
1
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ICreateTypeInfo_Release
(
cti
);
ICreateTypeLib2_Release
(
ctl
);
DeleteFileA
(
filenameA
);
}
START_TEST
(
typelib
)
{
const
char
*
filename
;
...
...
@@ -2946,6 +3015,7 @@ START_TEST(typelib)
test_inheritance
();
test_CreateTypeLib
();
test_SetVarHelpContext
();
test_SetFuncAndParamNames
();
if
((
filename
=
create_test_typelib
(
2
)))
{
...
...
dlls/oleaut32/typelib2.c
View file @
069b8e50
...
...
@@ -2361,15 +2361,17 @@ static HRESULT WINAPI ICreateTypeInfo2_fnSetFuncAndParamNames(
TRACE
(
"function name %s
\n
"
,
debugstr_w
(
names
[
0
]));
len
=
ctl2_encode_name
(
This
->
typelib
,
names
[
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
cmp
=
memcmp
(
namedata
,
This
->
typelib
->
typelib_segment_data
[
MSFT_SEG_NAME
]
+
iter2
->
name
+
8
,
len
);
if
(
iter2
->
name
!=
-
1
&&
cmp
==
0
)
{
if
(
iter2
->
type
==
CyclicListFunc
)
{
INVOKEKIND
inv1
=
ctl2_get_invokekind
(
iter
2
);
INVOKEKIND
inv2
=
ctl2_get_invokekind
(
iter
);
INVOKEKIND
inv1
=
ctl2_get_invokekind
(
iter
);
INVOKEKIND
inv2
=
ctl2_get_invokekind
(
iter
2
);
if
(((
inv1
&
(
INVOKE_PROPERTYPUT
|
INVOKE_PROPERTYPUTREF
))
&&
(
inv2
&
INVOKE_PROPERTYGET
))
||
((
inv2
&
(
INVOKE_PROPERTYPUT
|
INVOKE_PROPERTYPUTREF
))
&&
(
inv1
&
INVOKE_PROPERTYGET
)))
/* it's allowed to have PUT, PUTREF and GET methods with the same name */
if
((
inv1
!=
inv2
)
&&
(
inv1
&
(
INVOKE_PROPERTYPUT
|
INVOKE_PROPERTYPUTREF
|
INVOKE_PROPERTYGET
))
&&
(
inv2
&
(
INVOKE_PROPERTYPUT
|
INVOKE_PROPERTYPUTREF
|
INVOKE_PROPERTYGET
)))
continue
;
}
...
...
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