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
3a475120
Commit
3a475120
authored
Nov 08, 2005
by
Vincent Béron
Committed by
Alexandre Julliard
Nov 08, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct some allocated buffer lengths while converting to Unicode.
parent
e9310da5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
12 deletions
+10
-12
font.c
dlls/gdi/font.c
+9
-11
hhctrl.c
dlls/hhctrl.ocx/hhctrl.c
+1
-1
No files found.
dlls/gdi/font.c
View file @
3a475120
...
...
@@ -344,15 +344,14 @@ static void FONT_NewTextMetricExWToA(const NEWTEXTMETRICEXW *ptmW, NEWTEXTMETRIC
/***********************************************************************
* FONT_mbtowc
*
* Returns a '\0' terminated Unicode translation of str using the
* charset of the currently selected font in hdc. If count is -1 then
* str is assumed to be '\0' terminated, otherwise it contains the
* number of bytes to convert. If plenW is non-NULL, on return it
* will point to the number of WCHARs (excluding the '\0') that have
* been written. If pCP is non-NULL, on return it will point to the
* codepage used in the conversion.
* The caller should free the returned LPWSTR from the process
* heap itself.
* Returns a Unicode translation of str using the charset of the
* currently selected font in hdc. If count is -1 then str is assumed
* to be '\0' terminated, otherwise it contains the number of bytes to
* convert. If plenW is non-NULL, on return it will point to the
* number of WCHARs that have been written. If pCP is non-NULL, on
* return it will point to the codepage used in the conversion. The
* caller should free the returned LPWSTR from the process heap
* itself.
*/
static
LPWSTR
FONT_mbtowc
(
HDC
hdc
,
LPCSTR
str
,
INT
count
,
INT
*
plenW
,
UINT
*
pCP
)
{
...
...
@@ -401,9 +400,8 @@ static LPWSTR FONT_mbtowc(HDC hdc, LPCSTR str, INT count, INT *plenW, UINT *pCP)
if
(
count
==
-
1
)
count
=
strlen
(
str
);
lenW
=
MultiByteToWideChar
(
cp
,
0
,
str
,
count
,
NULL
,
0
);
strW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lenW
+
1
)
*
sizeof
(
WCHAR
));
strW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
lenW
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
cp
,
0
,
str
,
count
,
strW
,
lenW
);
strW
[
lenW
]
=
'\0'
;
TRACE
(
"mapped %s -> %s
\n
"
,
debugstr_an
(
str
,
count
),
debugstr_wn
(
strW
,
lenW
));
if
(
plenW
)
*
plenW
=
lenW
;
if
(
pCP
)
*
pCP
=
cp
;
...
...
dlls/hhctrl.ocx/hhctrl.c
View file @
3a475120
...
...
@@ -111,7 +111,7 @@ HWND WINAPI HtmlHelpA(HWND caller, LPCSTR filename, UINT command, DWORD data)
{
DWORD
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
filename
,
-
1
,
NULL
,
0
);
wfile
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
wfile
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
filename
,
-
1
,
wfile
,
len
);
}
...
...
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