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
0e37ee61
Commit
0e37ee61
authored
May 01, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
May 03, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Use ntdll for Unicode conversion.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
12326097
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
11 deletions
+45
-11
clipboard.c
dlls/winex11.drv/clipboard.c
+45
-11
No files found.
dlls/winex11.drv/clipboard.c
View file @
0e37ee61
...
...
@@ -672,6 +672,35 @@ char *get_unix_file_name( const WCHAR *dosW )
}
static
CPTABLEINFO
*
get_xstring_cp
(
void
)
{
static
CPTABLEINFO
cp
;
if
(
!
cp
.
CodePage
)
{
USHORT
*
ptr
;
SIZE_T
nls_size
;
if
(
NtGetNlsSectionPtr
(
11
,
28591
,
NULL
,
(
void
**
)
&
ptr
,
&
nls_size
))
return
NULL
;
RtlInitCodePageTable
(
ptr
,
&
cp
);
}
return
&
cp
;
}
static
CPTABLEINFO
*
get_ansi_cp
(
void
)
{
USHORT
utf8_hdr
[
2
]
=
{
0
,
CP_UTF8
};
static
CPTABLEINFO
cp
;
if
(
!
cp
.
CodePage
)
{
if
(
NtCurrentTeb
()
->
Peb
->
AnsiCodePageData
)
RtlInitCodePageTable
(
NtCurrentTeb
()
->
Peb
->
AnsiCodePageData
,
&
cp
);
else
RtlInitCodePageTable
(
utf8_hdr
,
&
cp
);
}
return
&
cp
;
}
/***********************************************************************
* uri_to_dos
*
...
...
@@ -788,8 +817,8 @@ static void *import_string( Atom type, const void *data, size_t size, size_t *re
WCHAR
*
ret
;
if
(
!
(
ret
=
malloc
(
(
size
*
2
+
1
)
*
sizeof
(
WCHAR
)
)))
return
NULL
;
str_size
=
MultiByteToWideChar
(
28591
,
0
,
data
,
size
,
ret
+
size
,
size
);
return
unicode_text_from_string
(
ret
,
ret
+
size
,
str_size
,
ret_size
);
RtlCustomCPToUnicodeN
(
get_xstring_cp
(),
ret
+
size
,
size
*
sizeof
(
WCHAR
),
&
str_size
,
data
,
size
);
return
unicode_text_from_string
(
ret
,
ret
+
size
,
str_size
/
sizeof
(
WCHAR
)
,
ret_size
);
}
...
...
@@ -1301,7 +1330,7 @@ static BOOL export_string( Display *display, Window win, Atom prop, Atom target,
char
*
text
;
if
(
!
(
text
=
malloc
(
size
)))
return
FALSE
;
len
=
WideCharToMultiByte
(
28591
,
0
,
data
,
size
/
sizeof
(
WCHAR
),
text
,
size
,
NULL
,
NULL
);
RtlUnicodeToCustomCPN
(
get_xstring_cp
(),
text
,
size
,
&
len
,
data
,
size
);
string_from_unicode_text
(
text
,
len
,
&
len
);
put_property
(
display
,
win
,
prop
,
target
,
8
,
text
,
len
);
...
...
@@ -1476,14 +1505,19 @@ static BOOL export_hdrop( Display *display, Window win, Atom prop, Atom target,
if
(
!
drop_files
->
fWide
)
{
char
*
p
,
*
files
=
(
char
*
)
data
+
drop_files
->
pFiles
;
p
=
files
;
while
(
*
p
)
p
+=
strlen
(
p
)
+
1
;
p
++
;
if
(
!
(
unicode_data
=
malloc
(
(
p
-
files
)
*
sizeof
(
WCHAR
)
)))
goto
failed
;
MultiByteToWideChar
(
CP_ACP
,
0
,
files
,
p
-
files
,
unicode_data
,
p
-
files
);
ptr
=
unicode_data
;
char
*
files
=
(
char
*
)
data
+
drop_files
->
pFiles
;
CPTABLEINFO
*
cp
=
get_ansi_cp
();
DWORD
len
=
0
;
while
(
files
[
len
])
len
+=
strlen
(
files
+
len
)
+
1
;
len
++
;
if
(
!
(
ptr
=
unicode_data
=
malloc
(
len
*
sizeof
(
WCHAR
)
)))
goto
failed
;
if
(
cp
->
CodePage
==
CP_UTF8
)
RtlUTF8ToUnicodeN
(
unicode_data
,
len
*
sizeof
(
WCHAR
),
&
len
,
files
,
len
);
else
RtlCustomCPToUnicodeN
(
cp
,
unicode_data
,
len
*
sizeof
(
WCHAR
),
&
len
,
files
,
len
);
}
else
ptr
=
(
const
WCHAR
*
)((
char
*
)
data
+
drop_files
->
pFiles
);
...
...
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