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
63ad05bc
Commit
63ad05bc
authored
Apr 12, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Use character sizes in the codepage conversion functions.
For consistency with ntdll. Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
65ff9cac
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
10 deletions
+8
-10
font.c
dlls/win32u/font.c
+3
-3
freetype.c
dlls/win32u/freetype.c
+4
-6
win32u_private.h
dlls/win32u/win32u_private.h
+1
-1
No files found.
dlls/win32u/font.c
View file @
63ad05bc
...
...
@@ -3243,7 +3243,7 @@ DWORD win32u_wctomb( CPTABLEINFO *info, char *dst, DWORD dstlen, const WCHAR *sr
if
(
!
info
&&
!
(
info
=
get_cptable
(
get_acp
()
)))
return
0
;
RtlUnicodeToCustomCPN
(
info
,
dst
,
dstlen
,
&
ret
,
src
,
srclen
);
RtlUnicodeToCustomCPN
(
info
,
dst
,
dstlen
,
&
ret
,
src
,
srclen
*
sizeof
(
WCHAR
)
);
return
ret
;
}
...
...
@@ -3253,8 +3253,8 @@ DWORD win32u_mbtowc( CPTABLEINFO *info, WCHAR *dst, DWORD dstlen, const char *sr
if
(
!
info
&&
!
(
info
=
get_cptable
(
get_acp
()
)))
return
0
;
RtlCustomCPToUnicodeN
(
info
,
dst
,
dstlen
,
&
ret
,
src
,
srclen
);
return
ret
;
RtlCustomCPToUnicodeN
(
info
,
dst
,
dstlen
*
sizeof
(
WCHAR
)
,
&
ret
,
src
,
srclen
);
return
ret
/
sizeof
(
WCHAR
)
;
}
static
BOOL
wc_to_index
(
UINT
cp
,
WCHAR
wc
,
unsigned
char
*
dst
,
BOOL
allow_default
)
...
...
dlls/win32u/freetype.c
View file @
63ad05bc
...
...
@@ -782,9 +782,8 @@ static WCHAR *copy_name_table_string( const FT_SfntName *name )
case
TT_PLATFORM_MACINTOSH
:
if
(
!
(
cp
=
get_mac_code_page
(
name
)))
return
NULL
;
ret
=
malloc
(
(
name
->
string_len
+
1
)
*
sizeof
(
WCHAR
)
);
i
=
win32u_mbtowc
(
cp
,
ret
,
name
->
string_len
*
sizeof
(
WCHAR
),
(
char
*
)
name
->
string
,
name
->
string_len
);
ret
[
i
/
sizeof
(
WCHAR
)]
=
0
;
i
=
win32u_mbtowc
(
cp
,
ret
,
name
->
string_len
,
(
char
*
)
name
->
string
,
name
->
string_len
);
ret
[
i
]
=
0
;
return
ret
;
}
return
NULL
;
...
...
@@ -1142,8 +1141,7 @@ static WCHAR *decode_opentype_name( struct opentype_name *name )
{
CPTABLEINFO
*
cptable
=
get_cptable
(
name
->
codepage
);
if
(
!
cptable
)
return
NULL
;
len
=
win32u_mbtowc
(
cptable
,
buffer
,
sizeof
(
buffer
),
name
->
bytes
,
name
->
length
);
len
/=
sizeof
(
WCHAR
);
len
=
win32u_mbtowc
(
cptable
,
buffer
,
ARRAY_SIZE
(
buffer
),
name
->
bytes
,
name
->
length
);
}
buffer
[
ARRAY_SIZE
(
buffer
)
-
1
]
=
0
;
...
...
@@ -2526,7 +2524,7 @@ static BOOL freetype_get_glyph_index( struct gdi_font *font, UINT *glyph, BOOL u
DWORD
len
;
char
ch
;
len
=
win32u_wctomb
(
NULL
,
&
ch
,
1
,
&
wc
,
sizeof
(
wc
)
);
len
=
win32u_wctomb
(
NULL
,
&
ch
,
1
,
&
wc
,
1
);
if
(
len
)
*
glyph
=
get_glyph_index_symbol
(
font
,
(
unsigned
char
)
ch
);
}
return
TRUE
;
...
...
dlls/win32u/win32u_private.h
View file @
63ad05bc
...
...
@@ -593,7 +593,7 @@ static inline WCHAR *towstr( const char *str )
{
DWORD
len
=
strlen
(
str
)
+
1
;
WCHAR
*
ret
=
malloc
(
len
*
sizeof
(
WCHAR
)
);
if
(
ret
)
win32u_mbtowc
(
NULL
,
ret
,
len
*
sizeof
(
WCHAR
)
,
str
,
len
);
if
(
ret
)
win32u_mbtowc
(
NULL
,
ret
,
len
,
str
,
len
);
return
ret
;
}
...
...
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