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
f53e3141
Commit
f53e3141
authored
Jul 19, 2007
by
Mikołaj Zalewski
Committed by
Alexandre Julliard
Jul 20, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: tooltips: Remove broken support for non-NULL-terminated strings in…
comctl32: tooltips: Remove broken support for non-NULL-terminated strings in TOOLTIPS_GetDispInfo[AW].
parent
31be5005
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
15 deletions
+48
-15
comctl32.h
dlls/comctl32/comctl32.h
+1
-0
comctl32undoc.c
dlls/comctl32/comctl32undoc.c
+41
-0
tooltips.c
dlls/comctl32/tooltips.c
+6
-15
No files found.
dlls/comctl32/comctl32.h
View file @
f53e3141
...
...
@@ -148,6 +148,7 @@ VOID COMCTL32_RefreshSysColors(void);
void
COMCTL32_DrawInsertMark
(
HDC
hDC
,
const
RECT
*
lpRect
,
COLORREF
clrInsertMark
,
BOOL
bHorizontal
);
void
COMCTL32_EnsureBitmapSize
(
HBITMAP
*
pBitmap
,
int
cxMinWidth
,
int
cyMinHeight
,
COLORREF
crBackground
);
INT
Str_GetPtrWtoA
(
LPCWSTR
lpSrc
,
LPSTR
lpDest
,
INT
nMaxLen
);
INT
Str_GetPtrAtoW
(
LPCSTR
lpSrc
,
LPWSTR
lpDest
,
INT
nMaxLen
);
BOOL
Str_SetPtrAtoW
(
LPWSTR
*
lppDest
,
LPCSTR
lpSrc
);
BOOL
Str_SetPtrWtoA
(
LPSTR
*
lppDest
,
LPCWSTR
lpSrc
);
...
...
dlls/comctl32/comctl32undoc.c
View file @
f53e3141
...
...
@@ -922,6 +922,47 @@ INT Str_GetPtrWtoA (LPCWSTR lpSrc, LPSTR lpDest, INT nMaxLen)
return
len
;
}
/**************************************************************************
* Str_GetPtrAtoW [internal]
*
* Converts a multibyte string into a unicode string
*
* PARAMS
* lpSrc [I] Pointer to the multibyte source string
* lpDest [O] Pointer to caller supplied storage for the unicode string
* nMaxLen [I] Size, in characters, of the destination buffer
*
* RETURNS
* Length, in characters, of the converted string.
*/
INT
Str_GetPtrAtoW
(
LPCSTR
lpSrc
,
LPWSTR
lpDest
,
INT
nMaxLen
)
{
INT
len
;
TRACE
(
"(%s %p %d)
\n
"
,
debugstr_a
(
lpSrc
),
lpDest
,
nMaxLen
);
if
(
!
lpDest
&&
lpSrc
)
return
MultiByteToWideChar
(
CP_ACP
,
0
,
lpSrc
,
-
1
,
0
,
0
);
if
(
nMaxLen
==
0
)
return
0
;
if
(
lpSrc
==
NULL
)
{
lpDest
[
0
]
=
'\0'
;
return
0
;
}
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lpSrc
,
-
1
,
0
,
0
);
if
(
len
>=
nMaxLen
)
len
=
nMaxLen
-
1
;
MultiByteToWideChar
(
CP_ACP
,
0
,
lpSrc
,
-
1
,
lpDest
,
len
);
lpDest
[
len
]
=
'\0'
;
return
len
;
}
/**************************************************************************
* Str_SetPtrAtoW [internal]
...
...
dlls/comctl32/tooltips.c
View file @
f53e3141
...
...
@@ -336,17 +336,11 @@ static void TOOLTIPS_GetDispInfoA(HWND hwnd, TOOLTIPS_INFO *infoPtr, TTTOOL_INFO
infoPtr
->
szTipText
[
0
]
=
'\0'
;
}
else
if
(
ttnmdi
.
lpszText
!=
LPSTR_TEXTCALLBACKA
)
{
INT
max_len
=
(
ttnmdi
.
lpszText
==
&
ttnmdi
.
szText
[
0
])
?
sizeof
(
ttnmdi
.
szText
)
/
sizeof
(
ttnmdi
.
szText
[
0
])
:
-
1
;
MultiByteToWideChar
(
CP_ACP
,
0
,
ttnmdi
.
lpszText
,
max_len
,
infoPtr
->
szTipText
,
INFOTIPSIZE
);
Str_GetPtrAtoW
(
ttnmdi
.
lpszText
,
infoPtr
->
szTipText
,
INFOTIPSIZE
);
if
(
ttnmdi
.
uFlags
&
TTF_DI_SETITEM
)
{
INT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
ttnmdi
.
lpszText
,
max_len
,
NULL
,
0
);
toolPtr
->
hinst
=
0
;
toolPtr
->
lpszText
=
Alloc
(
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
ttnmdi
.
lpszText
,
-
1
,
toolPtr
->
lpszText
,
len
);
toolPtr
->
lpszText
=
NULL
;
Str_SetPtrW
(
&
toolPtr
->
lpszText
,
infoPtr
->
szTipText
);
}
}
else
{
...
...
@@ -385,14 +379,11 @@ static void TOOLTIPS_GetDispInfoW(HWND hwnd, TOOLTIPS_INFO *infoPtr, TTTOOL_INFO
infoPtr
->
szTipText
[
0
]
=
'\0'
;
}
else
if
(
ttnmdi
.
lpszText
!=
LPSTR_TEXTCALLBACKW
)
{
INT
max_len
=
(
ttnmdi
.
lpszText
==
&
ttnmdi
.
szText
[
0
])
?
sizeof
(
ttnmdi
.
szText
)
/
sizeof
(
ttnmdi
.
szText
[
0
])
:
INFOTIPSIZE
-
1
;
lstrcpynW
(
infoPtr
->
szTipText
,
ttnmdi
.
lpszText
,
max_len
);
Str_GetPtrW
(
ttnmdi
.
lpszText
,
infoPtr
->
szTipText
,
INFOTIPSIZE
);
if
(
ttnmdi
.
uFlags
&
TTF_DI_SETITEM
)
{
INT
len
=
max
(
strlenW
(
ttnmdi
.
lpszText
),
max_len
);
toolPtr
->
hinst
=
0
;
toolPtr
->
lpszText
=
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
))
;
memcpy
(
toolPtr
->
lpszText
,
ttnmdi
.
lpszText
,
(
len
+
1
)
*
sizeof
(
WCHAR
)
);
toolPtr
->
lpszText
=
NULL
;
Str_SetPtrW
(
&
toolPtr
->
lpszText
,
infoPtr
->
szTipText
);
}
}
else
{
...
...
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