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
861541c5
Commit
861541c5
authored
Oct 23, 2016
by
Ken Thomases
Committed by
Alexandre Julliard
Oct 24, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Allocate clipboard data as GMEM_FIXED.
Signed-off-by:
Ken Thomases
<
ken@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
96c46b1c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
clipboard.c
dlls/winemac.drv/clipboard.c
+10
-10
No files found.
dlls/winemac.drv/clipboard.c
View file @
861541c5
...
@@ -461,7 +461,7 @@ static HANDLE convert_text(const void *src, int src_len, UINT src_cp, UINT dest_
...
@@ -461,7 +461,7 @@ static HANDLE convert_text(const void *src, int src_len, UINT src_cp, UINT dest_
if
(
dest_cp
==
(
UINT
)
-
1
)
if
(
dest_cp
==
(
UINT
)
-
1
)
{
{
handle
=
GlobalAlloc
(
GMEM_
MOVEABLE
|
GMEM_DDESHARE
,
wstr_len
*
sizeof
(
WCHAR
));
handle
=
GlobalAlloc
(
GMEM_
FIXED
,
wstr_len
*
sizeof
(
WCHAR
));
if
(
handle
&&
(
p
=
GlobalLock
(
handle
)))
if
(
handle
&&
(
p
=
GlobalLock
(
handle
)))
{
{
memcpy
(
p
,
wstr
,
wstr_len
*
sizeof
(
WCHAR
));
memcpy
(
p
,
wstr
,
wstr_len
*
sizeof
(
WCHAR
));
...
@@ -475,7 +475,7 @@ static HANDLE convert_text(const void *src, int src_len, UINT src_cp, UINT dest_
...
@@ -475,7 +475,7 @@ static HANDLE convert_text(const void *src, int src_len, UINT src_cp, UINT dest_
len
=
WideCharToMultiByte
(
dest_cp
,
0
,
wstr
,
wstr_len
,
NULL
,
0
,
NULL
,
NULL
);
len
=
WideCharToMultiByte
(
dest_cp
,
0
,
wstr
,
wstr_len
,
NULL
,
0
,
NULL
,
NULL
);
if
(
!
wstr_len
||
wstr
[
wstr_len
-
1
])
len
+=
1
;
if
(
!
wstr_len
||
wstr
[
wstr_len
-
1
])
len
+=
1
;
handle
=
GlobalAlloc
(
GMEM_
MOVEABLE
|
GMEM_DDESHARE
,
len
);
handle
=
GlobalAlloc
(
GMEM_
FIXED
,
len
);
if
(
handle
&&
(
p
=
GlobalLock
(
handle
)))
if
(
handle
&&
(
p
=
GlobalLock
(
handle
)))
{
{
...
@@ -568,7 +568,7 @@ static HGLOBAL create_dib_from_bitmap(HBITMAP hBmp)
...
@@ -568,7 +568,7 @@ static HGLOBAL create_dib_from_bitmap(HBITMAP hBmp)
/* Allocate the packed DIB */
/* Allocate the packed DIB */
TRACE
(
"
\t
Allocating packed DIB of size %d
\n
"
,
cPackedSize
);
TRACE
(
"
\t
Allocating packed DIB of size %d
\n
"
,
cPackedSize
);
hPackedDIB
=
GlobalAlloc
(
GMEM_
MOVEABLE
|
GMEM_DDESHARE
,
cPackedSize
);
hPackedDIB
=
GlobalAlloc
(
GMEM_
FIXED
,
cPackedSize
);
if
(
!
hPackedDIB
)
if
(
!
hPackedDIB
)
{
{
WARN
(
"Could not allocate packed DIB!
\n
"
);
WARN
(
"Could not allocate packed DIB!
\n
"
);
...
@@ -660,7 +660,7 @@ static HANDLE import_clipboard_data(CFDataRef data)
...
@@ -660,7 +660,7 @@ static HANDLE import_clipboard_data(CFDataRef data)
LPVOID
p
;
LPVOID
p
;
/* Turn on the DDESHARE flag to enable shared 32 bit memory */
/* Turn on the DDESHARE flag to enable shared 32 bit memory */
data_handle
=
GlobalAlloc
(
GMEM_
MOVEABLE
|
GMEM_DDESHARE
,
len
);
data_handle
=
GlobalAlloc
(
GMEM_
FIXED
,
len
);
if
(
!
data_handle
)
if
(
!
data_handle
)
return
NULL
;
return
NULL
;
...
@@ -716,7 +716,7 @@ static HANDLE import_bmp_to_dib(CFDataRef data)
...
@@ -716,7 +716,7 @@ static HANDLE import_bmp_to_dib(CFDataRef data)
BYTE
*
p
;
BYTE
*
p
;
len
-=
sizeof
(
*
bfh
);
len
-=
sizeof
(
*
bfh
);
ret
=
GlobalAlloc
(
GMEM_
MOVEABLE
|
GMEM_DDESHARE
,
len
);
ret
=
GlobalAlloc
(
GMEM_
FIXED
,
len
);
if
(
!
ret
||
!
(
p
=
GlobalLock
(
ret
)))
if
(
!
ret
||
!
(
p
=
GlobalLock
(
ret
)))
{
{
GlobalFree
(
ret
);
GlobalFree
(
ret
);
...
@@ -779,7 +779,7 @@ static HANDLE import_enhmetafile_to_metafilepict(CFDataRef data)
...
@@ -779,7 +779,7 @@ static HANDLE import_enhmetafile_to_metafilepict(CFDataRef data)
HANDLE
hemf
;
HANDLE
hemf
;
METAFILEPICT
*
mfp
;
METAFILEPICT
*
mfp
;
if
((
hmf
=
GlobalAlloc
(
0
,
sizeof
(
*
mfp
)))
&&
(
hemf
=
import_enhmetafile
(
data
)))
if
((
hmf
=
GlobalAlloc
(
GMEM_FIXED
,
sizeof
(
*
mfp
)))
&&
(
hemf
=
import_enhmetafile
(
data
)))
{
{
ENHMETAHEADER
header
;
ENHMETAHEADER
header
;
HDC
hdc
=
CreateCompatibleDC
(
0
);
HDC
hdc
=
CreateCompatibleDC
(
0
);
...
@@ -823,7 +823,7 @@ static HANDLE import_metafilepict(CFDataRef data)
...
@@ -823,7 +823,7 @@ static HANDLE import_metafilepict(CFDataRef data)
TRACE
(
"data %s
\n
"
,
debugstr_cf
(
data
));
TRACE
(
"data %s
\n
"
,
debugstr_cf
(
data
));
if
(
len
>=
sizeof
(
*
mfp
)
&&
(
ret
=
GlobalAlloc
(
0
,
sizeof
(
*
mfp
))))
if
(
len
>=
sizeof
(
*
mfp
)
&&
(
ret
=
GlobalAlloc
(
GMEM_FIXED
,
sizeof
(
*
mfp
))))
{
{
const
BYTE
*
bytes
=
(
const
BYTE
*
)
CFDataGetBytePtr
(
data
);
const
BYTE
*
bytes
=
(
const
BYTE
*
)
CFDataGetBytePtr
(
data
);
...
@@ -940,7 +940,7 @@ static HANDLE import_nsfilenames_to_hdrop(CFDataRef data)
...
@@ -940,7 +940,7 @@ static HANDLE import_nsfilenames_to_hdrop(CFDataRef data)
for
(
i
=
0
;
i
<
count
;
i
++
)
for
(
i
=
0
;
i
<
count
;
i
++
)
len
+=
strlenW
(
paths
[
i
])
+
1
;
len
+=
strlenW
(
paths
[
i
])
+
1
;
hdrop
=
GlobalAlloc
(
GMEM_
MOVEABLE
|
GMEM_DDESHARE
,
sizeof
(
*
dropfiles
)
+
len
*
sizeof
(
WCHAR
));
hdrop
=
GlobalAlloc
(
GMEM_
FIXED
,
sizeof
(
*
dropfiles
)
+
len
*
sizeof
(
WCHAR
));
if
(
!
hdrop
||
!
(
dropfiles
=
GlobalLock
(
hdrop
)))
if
(
!
hdrop
||
!
(
dropfiles
=
GlobalLock
(
hdrop
)))
{
{
WARN
(
"failed to allocate HDROP
\n
"
);
WARN
(
"failed to allocate HDROP
\n
"
);
...
@@ -1110,7 +1110,7 @@ static HANDLE import_utf8_to_unicodetext(CFDataRef data)
...
@@ -1110,7 +1110,7 @@ static HANDLE import_utf8_to_unicodetext(CFDataRef data)
dst
[
j
]
=
0
;
dst
[
j
]
=
0
;
count
=
MultiByteToWideChar
(
CP_UTF8
,
0
,
dst
,
-
1
,
NULL
,
0
);
count
=
MultiByteToWideChar
(
CP_UTF8
,
0
,
dst
,
-
1
,
NULL
,
0
);
unicode_handle
=
GlobalAlloc
(
GMEM_
MOVEABLE
|
GMEM_DDESHARE
,
count
*
sizeof
(
WCHAR
));
unicode_handle
=
GlobalAlloc
(
GMEM_
FIXED
,
count
*
sizeof
(
WCHAR
));
if
(
unicode_handle
)
if
(
unicode_handle
)
{
{
...
@@ -1178,7 +1178,7 @@ static HANDLE import_utf16_to_unicodetext(CFDataRef data)
...
@@ -1178,7 +1178,7 @@ static HANDLE import_utf16_to_unicodetext(CFDataRef data)
new_lines
++
;
new_lines
++
;
}
}
if
((
unicode_handle
=
GlobalAlloc
(
GMEM_
MOVEABLE
|
GMEM_DDESHARE
,
(
src_len
+
new_lines
+
1
)
*
sizeof
(
WCHAR
))))
if
((
unicode_handle
=
GlobalAlloc
(
GMEM_
FIXED
,
(
src_len
+
new_lines
+
1
)
*
sizeof
(
WCHAR
))))
{
{
dst
=
GlobalLock
(
unicode_handle
);
dst
=
GlobalLock
(
unicode_handle
);
...
...
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