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
1d2860e5
Commit
1d2860e5
authored
May 18, 2017
by
Huw Davies
Committed by
Alexandre Julliard
May 18, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Fix up the dib's resolution on loading.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e7bb4ba2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
3 deletions
+31
-3
datacache.c
dlls/ole32/datacache.c
+13
-0
ole2.c
dlls/ole32/tests/ole2.c
+18
-3
No files found.
dlls/ole32/datacache.c
View file @
1d2860e5
...
...
@@ -635,6 +635,7 @@ static HRESULT load_dib( DataCacheEntry *cache_entry, IStream *stm )
HGLOBAL
hglobal
;
ULONG
read
,
info_size
,
bi_size
;
BITMAPFILEHEADER
file
;
BITMAPINFOHEADER
*
info
;
if
(
cache_entry
->
stream_type
!=
contents_stream
)
{
...
...
@@ -685,6 +686,18 @@ static HRESULT load_dib( DataCacheEntry *cache_entry, IStream *stm )
hr
=
IStream_Read
(
stm
,
(
char
*
)
dib
+
info_size
,
stat
.
cbSize
.
u
.
LowPart
,
&
read
);
if
(
hr
!=
S_OK
||
read
!=
stat
.
cbSize
.
QuadPart
)
goto
fail
;
if
(
bi_size
>=
sizeof
(
*
info
))
{
info
=
(
BITMAPINFOHEADER
*
)
dib
;
if
(
info
->
biXPelsPerMeter
==
0
||
info
->
biYPelsPerMeter
==
0
)
{
HDC
hdc
=
GetDC
(
0
);
info
->
biXPelsPerMeter
=
MulDiv
(
GetDeviceCaps
(
hdc
,
LOGPIXELSX
),
10000
,
254
);
info
->
biYPelsPerMeter
=
MulDiv
(
GetDeviceCaps
(
hdc
,
LOGPIXELSY
),
10000
,
254
);
ReleaseDC
(
0
,
hdc
);
}
}
GlobalUnlock
(
hglobal
);
cache_entry
->
data_cf
=
cache_entry
->
fmtetc
.
cfFormat
;
...
...
dlls/ole32/tests/ole2.c
View file @
1d2860e5
...
...
@@ -1972,6 +1972,8 @@ static void test_data_cache_dib_contents_stream(int num)
STGMEDIUM
med
;
CLSID
cls
;
SIZEL
sz
;
BYTE
*
ptr
;
BITMAPINFOHEADER
expect_info
;
hr
=
CreateDataCache
(
NULL
,
&
CLSID_Picture_Metafile
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
ok
(
SUCCEEDED
(
hr
),
"got %08x
\n
"
,
hr
);
...
...
@@ -1994,11 +1996,24 @@ static void test_data_cache_dib_contents_stream(int num)
hr
=
IDataObject_GetData
(
data
,
&
fmt
,
&
med
);
ok
(
SUCCEEDED
(
hr
),
"got %08x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
ok
(
med
.
tymed
==
TYMED_HGLOBAL
,
"got %x
\n
"
,
med
.
tymed
);
ok
(
GlobalSize
(
U
(
med
).
hGlobal
)
>=
sizeof
(
dib
)
-
sizeof
(
BITMAPFILEHEADER
),
"got %lu
\n
"
,
GlobalSize
(
U
(
med
).
hGlobal
)
);
ptr
=
GlobalLock
(
U
(
med
).
hGlobal
);
expect_info
=
*
(
BITMAPINFOHEADER
*
)(
dib
+
sizeof
(
BITMAPFILEHEADER
));
if
(
expect_info
.
biXPelsPerMeter
==
0
||
expect_info
.
biYPelsPerMeter
==
0
)
{
ok
(
med
.
tymed
==
TYMED_HGLOBAL
,
"got %x
\n
"
,
med
.
tymed
);
ReleaseStgMedium
(
&
med
);
HDC
hdc
=
GetDC
(
0
);
expect_info
.
biXPelsPerMeter
=
MulDiv
(
GetDeviceCaps
(
hdc
,
LOGPIXELSX
),
10000
,
254
);
expect_info
.
biYPelsPerMeter
=
MulDiv
(
GetDeviceCaps
(
hdc
,
LOGPIXELSY
),
10000
,
254
);
ReleaseDC
(
0
,
hdc
);
}
ok
(
!
memcmp
(
ptr
,
&
expect_info
,
sizeof
(
expect_info
)
),
"mismatch
\n
"
);
ok
(
!
memcmp
(
ptr
+
sizeof
(
expect_info
),
dib
+
sizeof
(
BITMAPFILEHEADER
)
+
sizeof
(
expect_info
),
sizeof
(
dib
)
-
sizeof
(
BITMAPFILEHEADER
)
-
sizeof
(
expect_info
)
),
"mismatch
\n
"
);
GlobalUnlock
(
U
(
med
).
hGlobal
);
ReleaseStgMedium
(
&
med
);
hr
=
IViewObject2_GetExtent
(
view
,
DVASPECT_CONTENT
,
-
1
,
NULL
,
&
sz
);
ok
(
SUCCEEDED
(
hr
),
"got %08x
\n
"
,
hr
);
...
...
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