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
8305abda
Commit
8305abda
authored
Dec 24, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 24, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Fix ICreateTypeInfo2::SetVarHelpContext() to iterate properly.
parent
a22b2c56
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
1 deletion
+51
-1
typelib.c
dlls/oleaut32/tests/typelib.c
+50
-0
typelib2.c
dlls/oleaut32/typelib2.c
+1
-1
No files found.
dlls/oleaut32/tests/typelib.c
View file @
8305abda
...
...
@@ -2874,6 +2874,55 @@ static void test_LoadTypeLib(void)
ok
(
hres
==
TYPE_E_CANTLOADLIBRARY
,
"LoadTypeLib returned: %08x, expected TYPE_E_CANTLOADLIBRARY
\n
"
,
hres
);
}
static
void
test_SetVarHelpContext
(
void
)
{
static
OLECHAR
nameW
[]
=
{
'n'
,
'a'
,
'm'
,
'e'
,
0
};
CHAR
filenameA
[
MAX_PATH
];
WCHAR
filenameW
[
MAX_PATH
];
ICreateTypeLib2
*
ctl
;
ICreateTypeInfo
*
cti
;
VARDESC
desc
;
HRESULT
hr
;
VARIANT
v
;
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_ENUM
,
&
cti
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
ICreateTypeInfo_SetVarHelpContext
(
cti
,
0
,
0
);
ok
(
hr
==
TYPE_E_ELEMENTNOTFOUND
,
"got %08x
\n
"
,
hr
);
memset
(
&
desc
,
0
,
sizeof
(
desc
));
desc
.
elemdescVar
.
tdesc
.
vt
=
VT_INT
;
desc
.
varkind
=
VAR_CONST
;
V_VT
(
&
v
)
=
VT_INT
;
V_INT
(
&
v
)
=
1
;
U
(
desc
).
lpvarValue
=
&
v
;
hr
=
ICreateTypeInfo2_AddVarDesc
(
cti
,
0
,
&
desc
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
ICreateTypeInfo2_SetVarHelpContext
(
cti
,
0
,
0
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
/* another time */
hr
=
ICreateTypeInfo2_SetVarHelpContext
(
cti
,
0
,
1
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
/* wrong index now */
hr
=
ICreateTypeInfo2_SetVarHelpContext
(
cti
,
1
,
0
);
ok
(
hr
==
TYPE_E_ELEMENTNOTFOUND
,
"got %08x
\n
"
,
hr
);
ICreateTypeInfo_Release
(
cti
);
ICreateTypeLib2_Release
(
ctl
);
DeleteFileA
(
filenameA
);
}
START_TEST
(
typelib
)
{
const
char
*
filename
;
...
...
@@ -2890,6 +2939,7 @@ START_TEST(typelib)
test_QueryPathOfRegTypeLib
(
64
);
test_inheritance
();
test_CreateTypeLib
();
test_SetVarHelpContext
();
if
((
filename
=
create_test_typelib
(
2
)))
{
...
...
dlls/oleaut32/typelib2.c
View file @
8305abda
...
...
@@ -2553,7 +2553,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnSetVarHelpContext(
if
((
This
->
typeinfo
->
cElement
>>
16
)
<=
index
)
return
TYPE_E_ELEMENTNOTFOUND
;
for
(
iter
=
This
->
typedata
->
next
->
next
;
iter
!=
This
->
typedata
;
iter
=
iter
->
next
)
for
(
iter
=
This
->
typedata
->
next
->
next
;
iter
!=
This
->
typedata
->
next
;
iter
=
iter
->
next
)
if
(
iter
->
type
==
CyclicListVar
)
{
if
(
index
--
==
0
)
...
...
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