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
ddd18823
Commit
ddd18823
authored
Nov 21, 2017
by
Huw Davies
Committed by
Alexandre Julliard
Nov 21, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32/tests: Use a separate data source for the file dib to avoid confusion.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5e3cf758
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
22 deletions
+29
-22
ole2.c
dlls/ole32/tests/ole2.c
+29
-22
No files found.
dlls/ole32/tests/ole2.c
View file @
ddd18823
...
...
@@ -199,19 +199,14 @@ static void inline check_expected_method_fmt(const char *method_name, const FORM
} while (0)
/* 2 x 1 x 32 bpp dib. PelsPerMeter = 200x400 */
static
BYTE
dib
[]
=
{
0x42
,
0x4d
,
0x3e
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x36
,
0x00
,
0x00
,
0x00
,
0x28
,
0x00
,
0x00
,
0x00
,
0x02
,
0x00
,
0x00
,
0x00
,
0x01
,
0x00
,
0x00
,
0x00
,
0x01
,
0x00
,
0x20
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0xc8
,
0x00
,
0x00
,
0x00
,
0x90
,
0x01
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
static
const
BYTE
dib
[]
=
{
0x28
,
0x00
,
0x00
,
0x00
,
0x02
,
0x00
,
0x00
,
0x00
,
0x01
,
0x00
,
0x00
,
0x00
,
0x01
,
0x00
,
0x20
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0xc8
,
0x00
,
0x00
,
0x00
,
0x90
,
0x01
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
};
static
void
create_dib
(
STGMEDIUM
*
med
)
...
...
@@ -219,9 +214,9 @@ static void create_dib( STGMEDIUM *med )
void
*
ptr
;
med
->
tymed
=
TYMED_HGLOBAL
;
U
(
med
)
->
hGlobal
=
GlobalAlloc
(
GMEM_MOVEABLE
,
sizeof
(
dib
)
-
sizeof
(
BITMAPFILEHEADER
)
);
U
(
med
)
->
hGlobal
=
GlobalAlloc
(
GMEM_MOVEABLE
,
sizeof
(
dib
)
);
ptr
=
GlobalLock
(
U
(
med
)
->
hGlobal
);
memcpy
(
ptr
,
dib
+
sizeof
(
BITMAPFILEHEADER
),
sizeof
(
dib
)
-
sizeof
(
BITMAPFILEHEADER
)
);
memcpy
(
ptr
,
dib
,
sizeof
(
dib
)
);
GlobalUnlock
(
U
(
med
)
->
hGlobal
);
med
->
pUnkForRelease
=
NULL
;
}
...
...
@@ -2038,9 +2033,21 @@ static void test_data_cache(void)
IStorage_Release
(
pStorage
);
}
static
const
WCHAR
CONTENTS
[]
=
{
'C'
,
'O'
,
'N'
,
'T'
,
'E'
,
'N'
,
'T'
,
'S'
,
0
};
/* 2 x 1 x 32 bpp dib. PelsPerMeter = 200x400 */
static
BYTE
file_dib
[]
=
{
0x42
,
0x4d
,
0x3e
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x36
,
0x00
,
0x00
,
0x00
,
0x28
,
0x00
,
0x00
,
0x00
,
0x02
,
0x00
,
0x00
,
0x00
,
0x01
,
0x00
,
0x00
,
0x00
,
0x01
,
0x00
,
0x20
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0xc8
,
0x00
,
0x00
,
0x00
,
0x90
,
0x01
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
};
static
IStorage
*
create_storage
(
int
num
)
{
IStorage
*
stg
;
...
...
@@ -2056,10 +2063,10 @@ static IStorage *create_storage( int num )
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
if
(
num
==
1
)
/* Set biXPelsPerMeter = 0 */
{
dib
[
0x26
]
=
0
;
dib
[
0x27
]
=
0
;
file_
dib
[
0x26
]
=
0
;
file_
dib
[
0x27
]
=
0
;
}
hr
=
IStream_Write
(
stm
,
dib
,
sizeof
(
dib
),
&
written
);
hr
=
IStream_Write
(
stm
,
file_dib
,
sizeof
(
file_
dib
),
&
written
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
IStream_Release
(
stm
);
return
stg
;
...
...
@@ -2114,7 +2121,7 @@ static void test_data_cache_dib_contents_stream(int num)
"got %lu
\n
"
,
GlobalSize
(
U
(
med
).
hGlobal
)
);
ptr
=
GlobalLock
(
U
(
med
).
hGlobal
);
expect_info
=
*
(
BITMAPINFOHEADER
*
)(
dib
+
sizeof
(
BITMAPFILEHEADER
));
expect_info
=
*
(
BITMAPINFOHEADER
*
)(
file_
dib
+
sizeof
(
BITMAPFILEHEADER
));
if
(
expect_info
.
biXPelsPerMeter
==
0
||
expect_info
.
biYPelsPerMeter
==
0
)
{
HDC
hdc
=
GetDC
(
0
);
...
...
@@ -2123,8 +2130,8 @@ static void test_data_cache_dib_contents_stream(int num)
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
"
);
ok
(
!
memcmp
(
ptr
+
sizeof
(
expect_info
),
file_
dib
+
sizeof
(
BITMAPFILEHEADER
)
+
sizeof
(
expect_info
),
sizeof
(
file_
dib
)
-
sizeof
(
BITMAPFILEHEADER
)
-
sizeof
(
expect_info
)
),
"mismatch
\n
"
);
GlobalUnlock
(
U
(
med
).
hGlobal
);
ReleaseStgMedium
(
&
med
);
...
...
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