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
2a95fa68
Commit
2a95fa68
authored
Mar 12, 2014
by
Stefan Dösinger
Committed by
Alexandre Julliard
Mar 12, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9/tests: Test GetPrivateData size behavior.
parent
6ffbfc7c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
2 deletions
+37
-2
device.c
dlls/d3d9/tests/device.c
+37
-2
No files found.
dlls/d3d9/tests/device.c
View file @
2a95fa68
...
...
@@ -5089,6 +5089,13 @@ static void test_private_data(void)
0x4edf
,
{
0xa3
,
0x7f
,
0x9b
,
0x1d
,
0xf4
,
0x88
,
0xc5
,
0xfc
}
};
static
const
GUID
d3d9_private_data_test_guid2
=
{
0x2e5afac2
,
0x87b5
,
0x4c10
,
{
0x9b
,
0x4b
,
0x89
,
0xd7
,
0xd1
,
0x12
,
0xe7
,
0x2b
}
};
window
=
CreateWindowA
(
"d3d9_test_wc"
,
"d3d9_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
...
...
@@ -5155,18 +5162,46 @@ static void test_private_data(void)
hr
=
IDirect3DSurface9_SetPrivateData
(
surface
,
&
d3d9_private_data_test_guid
,
device
,
sizeof
(
IUnknown
*
),
D3DSPD_IUNKNOWN
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
size
=
sizeof
(
ptr
);
size
=
2
*
sizeof
(
ptr
);
hr
=
IDirect3DSurface9_GetPrivateData
(
surface
,
&
d3d9_private_data_test_guid
,
&
ptr
,
&
size
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
size
==
sizeof
(
device
),
"Got unexpected size %u.
\n
"
,
size
);
expected_refcount
=
refcount
+
2
;
refcount
=
get_refcount
((
IUnknown
*
)
device
);
ok
(
refcount
==
expected_refcount
,
"Got unexpected refcount %u, expected %u.
\n
"
,
refcount
,
expected_refcount
);
ok
(
ptr
==
(
IUnknown
*
)
device
,
"Got unexpected ptr %p, expected %p.
\n
"
,
ptr
,
device
);
IUnknown_Release
(
ptr
);
expected_refcount
--
;
ptr
=
(
IUnknown
*
)
0xdeadbeef
;
size
=
1
;
hr
=
IDirect3DSurface9_GetPrivateData
(
surface
,
&
d3d9_private_data_test_guid
,
NULL
,
&
size
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
size
==
sizeof
(
device
),
"Got unexpected size %u.
\n
"
,
size
);
size
=
2
*
sizeof
(
ptr
);
hr
=
IDirect3DSurface9_GetPrivateData
(
surface
,
&
d3d9_private_data_test_guid
,
NULL
,
&
size
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
size
==
sizeof
(
device
),
"Got unexpected size %u.
\n
"
,
size
);
refcount
=
get_refcount
((
IUnknown
*
)
device
);
ok
(
refcount
==
expected_refcount
,
"Got unexpected refcount %u, expected %u.
\n
"
,
refcount
,
expected_refcount
);
size
=
1
;
hr
=
IDirect3DSurface9_GetPrivateData
(
surface
,
&
d3d9_private_data_test_guid
,
&
ptr
,
&
size
);
ok
(
hr
==
D3DERR_MOREDATA
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
size
==
sizeof
(
device
),
"Got unexpected size %u.
\n
"
,
size
);
ok
(
ptr
==
(
IUnknown
*
)
0xdeadbeef
,
"Got unexpected pointer %p.
\n
"
,
ptr
);
hr
=
IDirect3DSurface9_GetPrivateData
(
surface
,
&
d3d9_private_data_test_guid2
,
NULL
,
NULL
);
ok
(
hr
==
D3DERR_NOTFOUND
,
"Got unexpected hr %#x.
\n
"
,
hr
);
size
=
0xdeadbabe
;
hr
=
IDirect3DSurface9_GetPrivateData
(
surface
,
&
d3d9_private_data_test_guid2
,
&
ptr
,
&
size
);
ok
(
hr
==
D3DERR_NOTFOUND
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
ptr
==
(
IUnknown
*
)
0xdeadbeef
,
"Got unexpected pointer %p.
\n
"
,
ptr
);
ok
(
size
==
0xdeadbabe
,
"Got unexpected size %u.
\n
"
,
size
);
/* GetPrivateData with size = NULL causes an access violation on Windows if the
* requested data exists. */
/* Destroying the surface frees the held reference. */
IDirect3DSurface9_Release
(
surface
);
expected_refcount
=
refcount
-
3
;
expected_refcount
=
refcount
-
2
;
refcount
=
get_refcount
((
IUnknown
*
)
device
);
ok
(
refcount
==
expected_refcount
,
"Got unexpected refcount %u, expected %u.
\n
"
,
refcount
,
expected_refcount
);
...
...
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