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
9d0ebc13
Commit
9d0ebc13
authored
Mar 24, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 24, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/tooltips: Allow NULL hinst value when fetching text from resources.
parent
75fc8913
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
3 deletions
+29
-3
tooltips.c
dlls/comctl32/tests/tooltips.c
+26
-0
tooltips.c
dlls/comctl32/tooltips.c
+3
-3
No files found.
dlls/comctl32/tests/tooltips.c
View file @
9d0ebc13
...
...
@@ -20,6 +20,8 @@
#include <windows.h>
#include <commctrl.h>
#include "resources.h"
#include "wine/test.h"
#define expect(expected, got) ok(got == expected, "Expected %d, got %d\n", expected, got)
...
...
@@ -326,6 +328,30 @@ static void test_gettext(void)
SendMessageA
(
hwnd
,
TTM_GETTOOLINFOA
,
0
,
(
LPARAM
)
&
toolinfoA
);
ok
(
toolinfoA
.
lpszText
==
NULL
,
"expected NULL, got %p
\n
"
,
toolinfoA
.
lpszText
);
/* NULL hinst, valid resource id for text */
toolinfoA
.
cbSize
=
sizeof
(
TTTOOLINFOA
);
toolinfoA
.
hwnd
=
NULL
;
toolinfoA
.
hinst
=
NULL
;
toolinfoA
.
uFlags
=
0
;
toolinfoA
.
uId
=
0x1233ABCD
;
toolinfoA
.
lpszText
=
MAKEINTRESOURCEA
(
IDS_TBADD1
);
toolinfoA
.
lParam
=
0xdeadbeef
;
GetClientRect
(
hwnd
,
&
toolinfoA
.
rect
);
r
=
SendMessageA
(
hwnd
,
TTM_ADDTOOLA
,
0
,
(
LPARAM
)
&
toolinfoA
);
ok
(
r
,
"failed to add a tool
\n
"
);
toolinfoA
.
hwnd
=
NULL
;
toolinfoA
.
uId
=
0x1233ABCD
;
toolinfoA
.
lpszText
=
bufA
;
SendMessageA
(
hwnd
,
TTM_GETTEXTA
,
0
,
(
LPARAM
)
&
toolinfoA
);
ok
(
strcmp
(
toolinfoA
.
lpszText
,
"abc"
)
==
0
,
"lpszText should be an empty string
\n
"
);
toolinfoA
.
hinst
=
(
HINSTANCE
)
0xdeadbee
;
SendMessageA
(
hwnd
,
TTM_GETTOOLINFOA
,
0
,
(
LPARAM
)
&
toolinfoA
);
ok
(
toolinfoA
.
hinst
==
NULL
,
"expected NULL, got %p
\n
"
,
toolinfoA
.
hinst
);
SendMessageA
(
hwnd
,
TTM_DELTOOLA
,
0
,
(
LPARAM
)
&
toolinfoA
);
}
else
{
...
...
dlls/comctl32/tooltips.c
View file @
9d0ebc13
...
...
@@ -484,12 +484,12 @@ TOOLTIPS_GetTipText (const TOOLTIPS_INFO *infoPtr, INT nTool, WCHAR *buffer)
{
TTTOOL_INFO
*
toolPtr
=
&
infoPtr
->
tools
[
nTool
];
if
(
IS_INTRESOURCE
(
toolPtr
->
lpszText
)
&&
toolPtr
->
hinst
)
{
if
(
IS_INTRESOURCE
(
toolPtr
->
lpszText
))
{
/* load a resource */
TRACE
(
"load res string %p %x
\n
"
,
toolPtr
->
hinst
,
LOWORD
(
toolPtr
->
lpszText
));
LoadStringW
(
toolPtr
->
hinst
,
LOWORD
(
toolPtr
->
lpszText
),
buffer
,
INFOTIPSIZE
)
;
if
(
!
LoadStringW
(
toolPtr
->
hinst
,
LOWORD
(
toolPtr
->
lpszText
),
buffer
,
INFOTIPSIZE
))
buffer
[
0
]
=
'\0'
;
}
else
if
(
toolPtr
->
lpszText
)
{
if
(
toolPtr
->
lpszText
==
LPSTR_TEXTCALLBACKW
)
{
...
...
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