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
36e2d7e9
Commit
36e2d7e9
authored
May 26, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
May 27, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Use ntdll for Unicode conversion in export_hdrop_to_filenames.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
parent
6e7701ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
12 deletions
+28
-12
clipboard.c
dlls/winemac.drv/clipboard.c
+28
-12
No files found.
dlls/winemac.drv/clipboard.c
View file @
36e2d7e9
...
...
@@ -567,6 +567,21 @@ static void *import_html(CFDataRef data, size_t *ret_size)
}
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
;
}
/* based on wine_get_dos_file_name */
static
WCHAR
*
get_dos_file_name
(
const
char
*
path
)
{
...
...
@@ -942,21 +957,22 @@ static CFDataRef export_hdrop_to_filenames(void *data, size_t size)
unixname
=
get_unix_file_name
(
p
);
else
{
int
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
p
,
-
1
,
NULL
,
0
);
if
(
len
)
{
if
(
len
>
buffer_len
)
{
free
(
buffer
);
buffer_len
=
len
*
2
;
buffer
=
malloc
(
buffer_len
*
sizeof
(
*
buffer
));
}
CPTABLEINFO
*
cp
=
get_ansi_cp
();
DWORD
len
=
strlen
(
p
)
+
1
;
MultiByteToWideChar
(
CP_ACP
,
0
,
p
,
-
1
,
buffer
,
buffer_len
);
unixname
=
get_unix_file_name
(
buffer
);
if
(
len
*
3
>
buffer_len
)
{
free
(
buffer
);
buffer_len
=
len
*
3
;
buffer
=
malloc
(
buffer_len
*
sizeof
(
*
buffer
));
}
if
(
cp
->
CodePage
==
CP_UTF8
)
RtlUTF8ToUnicodeN
(
buffer
,
buffer_len
*
sizeof
(
WCHAR
),
&
len
,
p
,
len
);
else
unixname
=
NULL
;
RtlCustomCPToUnicodeN
(
cp
,
buffer
,
buffer_len
*
sizeof
(
WCHAR
),
&
len
,
p
,
len
);
unixname
=
get_unix_file_name
(
buffer
);
}
if
(
!
unixname
)
{
...
...
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