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
55f160db
Commit
55f160db
authored
Jun 27, 2012
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jun 28, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Add a test for image stream refcount.
parent
3cd0834a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
image.c
dlls/gdiplus/tests/image.c
+19
-1
No files found.
dlls/gdiplus/tests/image.c
View file @
55f160db
...
@@ -2656,6 +2656,12 @@ static void test_dispose(void)
...
@@ -2656,6 +2656,12 @@ static void test_dispose(void)
expect
(
ObjectBusy
,
stat
);
expect
(
ObjectBusy
,
stat
);
}
}
static
LONG
obj_refcount
(
void
*
obj
)
{
IUnknown_AddRef
((
IUnknown
*
)
obj
);
return
IUnknown_Release
((
IUnknown
*
)
obj
);
}
static
GpImage
*
load_image
(
const
BYTE
*
image_data
,
UINT
image_size
)
static
GpImage
*
load_image
(
const
BYTE
*
image_data
,
UINT
image_size
)
{
{
IStream
*
stream
;
IStream
*
stream
;
...
@@ -2664,6 +2670,8 @@ static GpImage *load_image(const BYTE *image_data, UINT image_size)
...
@@ -2664,6 +2670,8 @@ static GpImage *load_image(const BYTE *image_data, UINT image_size)
HRESULT
hr
;
HRESULT
hr
;
GpStatus
status
;
GpStatus
status
;
GpImage
*
image
=
NULL
;
GpImage
*
image
=
NULL
;
ImageType
image_type
;
LONG
refcount
;
hmem
=
GlobalAlloc
(
0
,
image_size
);
hmem
=
GlobalAlloc
(
0
,
image_size
);
data
=
GlobalLock
(
hmem
);
data
=
GlobalLock
(
hmem
);
...
@@ -2674,10 +2682,20 @@ static GpImage *load_image(const BYTE *image_data, UINT image_size)
...
@@ -2674,10 +2682,20 @@ static GpImage *load_image(const BYTE *image_data, UINT image_size)
ok
(
hr
==
S_OK
,
"CreateStreamOnHGlobal error %#x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"CreateStreamOnHGlobal error %#x
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
return
NULL
;
if
(
hr
!=
S_OK
)
return
NULL
;
refcount
=
obj_refcount
(
stream
);
ok
(
refcount
==
1
,
"expected stream refcount 1, got %d
\n
"
,
refcount
);
status
=
GdipLoadImageFromStream
(
stream
,
&
image
);
status
=
GdipLoadImageFromStream
(
stream
,
&
image
);
ok
(
status
==
Ok
,
"GdipLoadImageFromStream error %d
\n
"
,
status
);
ok
(
status
==
Ok
,
"GdipLoadImageFromStream error %d
\n
"
,
status
);
IStream_Release
(
stream
);
status
=
GdipGetImageType
(
image
,
&
image_type
);
ok
(
status
==
Ok
,
"GdipGetImageType error %d
\n
"
,
status
);
refcount
=
IStream_Release
(
stream
);
if
(
image_type
==
ImageTypeBitmap
)
todo_wine
ok
(
refcount
>=
1
,
"expected stream refcount != 0
\n
"
);
else
ok
(
refcount
==
0
,
"expected stream refcount 0, got %d
\n
"
,
refcount
);
return
image
;
return
image
;
}
}
...
...
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