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
fe04dd2a
Commit
fe04dd2a
authored
Sep 15, 2016
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Use GetDIBits to retrieve the bitmap header when synthesizing a DIB.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
08aa64e3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
clipboard.c
dlls/user32/clipboard.c
+17
-17
No files found.
dlls/user32/clipboard.c
View file @
fe04dd2a
...
...
@@ -290,33 +290,33 @@ static HANDLE render_synthesized_dib( HANDLE data, UINT format, UINT from )
if
(
from
==
CF_BITMAP
)
{
BITMAP
bmp
;
BITMAP
V5HEADER
header
;
if
(
!
GetObjectW
(
data
,
sizeof
(
bmp
),
&
bmp
))
goto
done
;
memset
(
&
header
,
0
,
sizeof
(
header
)
);
header
.
bV5Size
=
(
format
==
CF_DIBV5
)
?
sizeof
(
BITMAPV5HEADER
)
:
sizeof
(
BITMAPINFOHEADER
);
if
(
!
GetDIBits
(
hdc
,
data
,
0
,
0
,
NULL
,
(
BITMAPINFO
*
)
&
header
,
DIB_RGB_COLORS
))
goto
done
;
bits_size
=
abs
(
bmp
.
bmHeight
)
*
(((
bmp
.
bmWidth
*
bmp
.
bmBitsPixel
+
31
)
/
8
)
&
~
3
);
if
(
bmp
.
bmBitsPixel
<=
8
)
header_size
=
offsetof
(
BITMAPINFO
,
bmiColors
[
1
<<
bmp
.
bmBitsPixel
]
);
else
header_size
=
(
format
==
CF_DIBV5
)
?
sizeof
(
BITMAPV5HEADER
)
:
sizeof
(
BITMAPINFOHEADER
);
if
(
!
(
ret
=
GlobalAlloc
(
GMEM_FIXED
,
header_size
+
bits_size
)))
goto
done
;
header_size
=
bitmap_info_size
(
(
BITMAPINFO
*
)
&
header
,
DIB_RGB_COLORS
);
if
(
!
(
ret
=
GlobalAlloc
(
GMEM_FIXED
,
header_size
+
header
.
bV5SizeImage
)))
goto
done
;
bmi
=
(
BITMAPINFO
*
)
ret
;
memset
(
bmi
,
0
,
header_size
);
bmi
->
bmiHeader
.
biSize
=
header_size
;
bmi
->
bmiHeader
.
biWidth
=
bmp
.
bmWidth
;
bmi
->
bmiHeader
.
biHeight
=
bmp
.
bmHeight
;
bmi
->
bmiHeader
.
biPlanes
=
1
;
bmi
->
bmiHeader
.
biBitCount
=
bmp
.
bmBitsPixel
;
bmi
->
bmiHeader
.
biCompression
=
BI_RGB
;
GetDIBits
(
hdc
,
data
,
0
,
bmp
.
bmHeight
,
(
char
*
)
bmi
+
header_size
,
bmi
,
DIB_RGB_COLORS
);
memcpy
(
bmi
,
&
header
,
header
.
bV5Size
);
GetDIBits
(
hdc
,
data
,
0
,
abs
(
header
.
bV5Height
),
(
char
*
)
bmi
+
header_size
,
bmi
,
DIB_RGB_COLORS
);
}
else
{
SIZE_T
size
=
GlobalSize
(
data
);
if
(
size
<
sizeof
(
*
bmi
))
goto
done
;
if
(
!
(
src
=
GlobalLock
(
data
)))
goto
done
;
src_size
=
bitmap_info_size
(
src
,
DIB_RGB_COLORS
);
bits_size
=
GlobalSize
(
data
)
-
src_size
;
if
(
size
<=
src_size
)
{
GlobalUnlock
(
data
);
goto
done
;
}
bits_size
=
size
-
src_size
;
header_size
=
(
format
==
CF_DIBV5
)
?
sizeof
(
BITMAPV5HEADER
)
:
offsetof
(
BITMAPINFO
,
bmiColors
[
src
->
bmiHeader
.
biCompression
==
BI_BITFIELDS
?
3
:
0
]
);
...
...
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