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
8b95d95e
Commit
8b95d95e
authored
Dec 23, 2006
by
Alex Villacís Lasso
Committed by
Alexandre Julliard
Dec 24, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Fix tests for redundant headers in OLEPicture load from IStream.
parent
7d95f0c4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
27 deletions
+27
-27
olepicture.c
dlls/oleaut32/tests/olepicture.c
+27
-27
No files found.
dlls/oleaut32/tests/olepicture.c
View file @
8b95d95e
...
@@ -191,12 +191,13 @@ test_pic(const unsigned char *imgdata, unsigned int imgsize)
...
@@ -191,12 +191,13 @@ test_pic(const unsigned char *imgdata, unsigned int imgsize)
LARGE_INTEGER
seekto
;
LARGE_INTEGER
seekto
;
ULARGE_INTEGER
newpos1
;
ULARGE_INTEGER
newpos1
;
DWORD
*
header
;
DWORD
*
header
;
unsigned
int
i
;
unsigned
int
i
,
j
;
/* Let the fun begin */
/* Let the fun begin */
hglob
=
GlobalAlloc
(
0
,
imgsize
);
hglob
=
GlobalAlloc
(
0
,
imgsize
);
data
=
GlobalLock
(
hglob
);
data
=
GlobalLock
(
hglob
);
memcpy
(
data
,
imgdata
,
imgsize
);
memcpy
(
data
,
imgdata
,
imgsize
);
GlobalUnlock
(
hglob
);
data
=
NULL
;
hres
=
CreateStreamOnHGlobal
(
hglob
,
FALSE
,
&
stream
);
hres
=
CreateStreamOnHGlobal
(
hglob
,
FALSE
,
&
stream
);
ok
(
hres
==
S_OK
,
"createstreamonhglobal failed? doubt it... hres 0x%08x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"createstreamonhglobal failed? doubt it... hres 0x%08x
\n
"
,
hres
);
...
@@ -210,34 +211,29 @@ test_pic(const unsigned char *imgdata, unsigned int imgsize)
...
@@ -210,34 +211,29 @@ test_pic(const unsigned char *imgdata, unsigned int imgsize)
/* again with Non Statable and Non Seekable stream */
/* again with Non Statable and Non Seekable stream */
stream
=
(
LPSTREAM
)
NoStatStreamImpl_Construct
(
hglob
);
stream
=
(
LPSTREAM
)
NoStatStreamImpl_Construct
(
hglob
);
hglob
=
0
;
/* Non-statable impl always deletes on release */
test_pic_with_stream
(
stream
,
0
);
test_pic_with_stream
(
stream
,
0
);
IStream_Release
(
stream
);
IStream_Release
(
stream
);
/* free memory */
GlobalUnlock
(
hglob
);
GlobalFree
(
hglob
);
/* more fun!!! */
hglob
=
GlobalAlloc
(
0
,
imgsize
+
8
*
(
2
*
sizeof
(
DWORD
)));
data
=
GlobalLock
(
hglob
);
header
=
(
DWORD
*
)
data
;
/* multiple copies of header */
memcpy
(
data
,
"lt
\0\0
"
,
4
);
header
[
1
]
=
imgsize
;
memcpy
(
&
(
header
[
2
]),
header
,
2
*
sizeof
(
DWORD
));
memcpy
(
&
(
header
[
4
]),
header
,
4
*
sizeof
(
DWORD
));
memcpy
(
&
(
header
[
8
]),
header
,
8
*
sizeof
(
DWORD
));
memcpy
(
data
+
8
*
(
2
*
sizeof
(
DWORD
)),
imgdata
,
imgsize
);
for
(
i
=
1
;
i
<=
8
;
i
++
)
{
for
(
i
=
1
;
i
<=
8
;
i
++
)
{
/* more fun!!! */
hglob
=
GlobalAlloc
(
0
,
imgsize
+
i
*
(
2
*
sizeof
(
DWORD
)));
data
=
GlobalLock
(
hglob
);
header
=
(
DWORD
*
)
data
;
/* multiple copies of header */
memcpy
(
data
,
"lt
\0\0
"
,
4
);
header
[
1
]
=
imgsize
;
for
(
j
=
2
;
j
<=
i
;
j
++
)
{
memcpy
(
&
(
header
[
2
*
(
j
-
1
)]),
header
,
2
*
sizeof
(
DWORD
));
}
memcpy
(
data
+
i
*
(
2
*
sizeof
(
DWORD
)),
imgdata
,
imgsize
);
GlobalUnlock
(
hglob
);
data
=
NULL
;
hres
=
CreateStreamOnHGlobal
(
hglob
,
FALSE
,
&
stream
);
hres
=
CreateStreamOnHGlobal
(
hglob
,
FALSE
,
&
stream
);
ok
(
hres
==
S_OK
,
"createstreamonhglobal failed? doubt it... hres 0x%08x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"createstreamonhglobal failed? doubt it... hres 0x%08x
\n
"
,
hres
);
memset
(
&
seekto
,
0
,
sizeof
(
seekto
));
memset
(
&
seekto
,
0
,
sizeof
(
seekto
));
seekto
.
u
.
LowPart
=
(
8
-
i
)
*
(
2
*
sizeof
(
DWORD
));
hres
=
IStream_Seek
(
stream
,
seekto
,
SEEK_CUR
,
&
newpos1
);
hres
=
IStream_Seek
(
stream
,
seekto
,
SEEK_CUR
,
&
newpos1
);
ok
(
hres
==
S_OK
,
"istream seek failed? doubt it... hres 0x%08x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"istream seek failed? doubt it... hres 0x%08x
\n
"
,
hres
);
test_pic_with_stream
(
stream
,
imgsize
);
test_pic_with_stream
(
stream
,
imgsize
);
...
@@ -246,14 +242,11 @@ test_pic(const unsigned char *imgdata, unsigned int imgsize)
...
@@ -246,14 +242,11 @@ test_pic(const unsigned char *imgdata, unsigned int imgsize)
/* again with Non Statable and Non Seekable stream */
/* again with Non Statable and Non Seekable stream */
stream
=
(
LPSTREAM
)
NoStatStreamImpl_Construct
(
hglob
);
stream
=
(
LPSTREAM
)
NoStatStreamImpl_Construct
(
hglob
);
hglob
=
0
;
/* Non-statable impl always deletes on release */
test_pic_with_stream
(
stream
,
0
);
test_pic_with_stream
(
stream
,
0
);
IStream_Release
(
stream
);
IStream_Release
(
stream
);
}
}
/* free memory */
GlobalUnlock
(
hglob
);
GlobalFree
(
hglob
);
}
}
static
void
test_empty_image
(
void
)
{
static
void
test_empty_image
(
void
)
{
...
@@ -670,6 +663,13 @@ static HRESULT WINAPI NoStatStreamImpl_Clone(
...
@@ -670,6 +663,13 @@ static HRESULT WINAPI NoStatStreamImpl_Clone(
}
}
static
const
IStreamVtbl
NoStatStreamImpl_Vtbl
;
static
const
IStreamVtbl
NoStatStreamImpl_Vtbl
;
/*
Build an object that implements IStream, without IStream_Stat capabilities.
Receives a memory handle with data buffer. If memory handle is non-null,
it is assumed to be unlocked, otherwise an internal memory handle is allocated.
In any case the object takes ownership of memory handle and will free it on
object release.
*/
static
NoStatStreamImpl
*
NoStatStreamImpl_Construct
(
HGLOBAL
hGlobal
)
static
NoStatStreamImpl
*
NoStatStreamImpl_Construct
(
HGLOBAL
hGlobal
)
{
{
NoStatStreamImpl
*
newStream
;
NoStatStreamImpl
*
newStream
;
...
@@ -678,7 +678,7 @@ static NoStatStreamImpl* NoStatStreamImpl_Construct(HGLOBAL hGlobal)
...
@@ -678,7 +678,7 @@ static NoStatStreamImpl* NoStatStreamImpl_Construct(HGLOBAL hGlobal)
if
(
newStream
!=
0
)
if
(
newStream
!=
0
)
{
{
newStream
->
lpVtbl
=
&
NoStatStreamImpl_Vtbl
;
newStream
->
lpVtbl
=
&
NoStatStreamImpl_Vtbl
;
newStream
->
ref
=
0
;
newStream
->
ref
=
1
;
newStream
->
supportHandle
=
hGlobal
;
newStream
->
supportHandle
=
hGlobal
;
if
(
!
newStream
->
supportHandle
)
if
(
!
newStream
->
supportHandle
)
...
...
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