Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
ab44b312
Commit
ab44b312
authored
Sep 28, 2016
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Fix METAFILEPICT marshalling for 64-bit.
Spotted by Sebastian Lackner. Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c2150301
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
7 deletions
+24
-7
clipboard.c
dlls/user32/clipboard.c
+24
-7
No files found.
dlls/user32/clipboard.c
View file @
ab44b312
...
@@ -74,6 +74,15 @@ static CRITICAL_SECTION_DEBUG critsect_debug =
...
@@ -74,6 +74,15 @@ static CRITICAL_SECTION_DEBUG critsect_debug =
};
};
static
CRITICAL_SECTION
clipboard_cs
=
{
&
critsect_debug
,
-
1
,
0
,
0
,
0
,
0
};
static
CRITICAL_SECTION
clipboard_cs
=
{
&
critsect_debug
,
-
1
,
0
,
0
,
0
,
0
};
/* platform-independent version of METAFILEPICT */
struct
metafile_pict
{
LONG
mm
;
LONG
xExt
;
LONG
yExt
;
BYTE
bits
[
1
];
};
/* get a debug string for a format id */
/* get a debug string for a format id */
static
const
char
*
debugstr_format
(
UINT
id
)
static
const
char
*
debugstr_format
(
UINT
id
)
{
{
...
@@ -155,21 +164,24 @@ static HANDLE marshal_data( UINT format, HANDLE handle, data_size_t *ret_size )
...
@@ -155,21 +164,24 @@ static HANDLE marshal_data( UINT format, HANDLE handle, data_size_t *ret_size )
case
CF_METAFILEPICT
:
case
CF_METAFILEPICT
:
case
CF_DSPMETAFILEPICT
:
case
CF_DSPMETAFILEPICT
:
{
{
METAFILEPICT
*
mf
,
*
mfbits
;
METAFILEPICT
*
mf
;
struct
metafile_pict
*
mfbits
;
if
(
!
(
mf
=
GlobalLock
(
handle
)))
return
0
;
if
(
!
(
mf
=
GlobalLock
(
handle
)))
return
0
;
if
(
!
(
size
=
GetMetaFileBitsEx
(
mf
->
hMF
,
0
,
NULL
)))
if
(
!
(
size
=
GetMetaFileBitsEx
(
mf
->
hMF
,
0
,
NULL
)))
{
{
GlobalUnlock
(
handle
);
GlobalUnlock
(
handle
);
return
0
;
return
0
;
}
}
*
ret_size
=
sizeof
(
*
mf
)
+
size
;
*
ret_size
=
offsetof
(
struct
metafile_pict
,
bits
[
size
]
)
;
if
(
!
(
mfbits
=
GlobalAlloc
(
GMEM_FIXED
,
*
ret_size
)))
if
(
!
(
mfbits
=
GlobalAlloc
(
GMEM_FIXED
,
*
ret_size
)))
{
{
GlobalUnlock
(
handle
);
GlobalUnlock
(
handle
);
return
0
;
return
0
;
}
}
*
mfbits
=
*
mf
;
mfbits
->
mm
=
mf
->
mm
;
GetMetaFileBitsEx
(
mf
->
hMF
,
size
,
mfbits
+
1
);
mfbits
->
xExt
=
mf
->
xExt
;
mfbits
->
yExt
=
mf
->
yExt
;
GetMetaFileBitsEx
(
mf
->
hMF
,
size
,
mfbits
->
bits
);
GlobalUnlock
(
handle
);
GlobalUnlock
(
handle
);
return
mfbits
;
return
mfbits
;
}
}
...
@@ -235,9 +247,14 @@ static HANDLE unmarshal_data( UINT format, void *data, data_size_t size )
...
@@ -235,9 +247,14 @@ static HANDLE unmarshal_data( UINT format, void *data, data_size_t size )
case
CF_METAFILEPICT
:
case
CF_METAFILEPICT
:
case
CF_DSPMETAFILEPICT
:
case
CF_DSPMETAFILEPICT
:
{
{
METAFILEPICT
*
mf
=
handle
;
METAFILEPICT
mf
;
if
(
size
<=
sizeof
(
*
mf
))
break
;
struct
metafile_pict
*
mfbits
=
handle
;
mf
->
hMF
=
SetMetaFileBitsEx
(
size
-
sizeof
(
*
mf
),
(
BYTE
*
)(
mf
+
1
)
);
if
(
size
<=
sizeof
(
*
mfbits
))
break
;
mf
.
mm
=
mfbits
->
mm
;
mf
.
xExt
=
mfbits
->
xExt
;
mf
.
yExt
=
mfbits
->
yExt
;
mf
.
hMF
=
SetMetaFileBitsEx
(
size
-
offsetof
(
struct
metafile_pict
,
bits
),
mfbits
->
bits
);
*
(
METAFILEPICT
*
)
handle
=
mf
;
return
handle
;
return
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