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
1d9ff5c4
Commit
1d9ff5c4
authored
Mar 16, 2014
by
Stefan Dösinger
Committed by
Alexandre Julliard
Mar 17, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw/tests: Test GetPrivateData size behavior.
parent
7d793715
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
0 deletions
+52
-0
ddraw4.c
dlls/ddraw/tests/ddraw4.c
+26
-0
ddraw7.c
dlls/ddraw/tests/ddraw7.c
+26
-0
No files found.
dlls/ddraw/tests/ddraw4.c
View file @
1d9ff5c4
...
@@ -6122,13 +6122,39 @@ static void test_private_data(void)
...
@@ -6122,13 +6122,39 @@ static void test_private_data(void)
hr
=
IDirectDrawSurface4_SetPrivateData
(
surface
,
&
IID_IDirect3D
,
ddraw
,
hr
=
IDirectDrawSurface4_SetPrivateData
(
surface
,
&
IID_IDirect3D
,
ddraw
,
sizeof
(
ddraw
),
DDSPD_IUNKNOWNPOINTER
);
sizeof
(
ddraw
),
DDSPD_IUNKNOWNPOINTER
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set private data, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set private data, hr %#x.
\n
"
,
hr
);
size
=
2
*
sizeof
(
ptr
);
hr
=
IDirectDrawSurface4_GetPrivateData
(
surface
,
&
IID_IDirect3D
,
&
ptr
,
&
size
);
hr
=
IDirectDrawSurface4_GetPrivateData
(
surface
,
&
IID_IDirect3D
,
&
ptr
,
&
size
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get private data, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get private data, hr %#x.
\n
"
,
hr
);
ok
(
size
==
sizeof
(
ddraw
),
"Got unexpected size %u.
\n
"
,
size
);
refcount2
=
get_refcount
(
ptr
);
refcount2
=
get_refcount
(
ptr
);
/* Object is NOT addref'ed by the getter. */
/* Object is NOT addref'ed by the getter. */
ok
(
ptr
==
(
IUnknown
*
)
ddraw
,
"Returned interface pointer is %p, expected %p.
\n
"
,
ptr
,
ddraw
);
ok
(
ptr
==
(
IUnknown
*
)
ddraw
,
"Returned interface pointer is %p, expected %p.
\n
"
,
ptr
,
ddraw
);
ok
(
refcount2
==
refcount
+
1
,
"Got unexpected refcount %u.
\n
"
,
refcount2
);
ok
(
refcount2
==
refcount
+
1
,
"Got unexpected refcount %u.
\n
"
,
refcount2
);
ptr
=
(
IUnknown
*
)
0xdeadbeef
;
size
=
1
;
hr
=
IDirectDrawSurface4_GetPrivateData
(
surface
,
&
IID_IDirect3D
,
NULL
,
&
size
);
ok
(
hr
==
DDERR_MOREDATA
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
size
==
sizeof
(
ddraw
),
"Got unexpected size %u.
\n
"
,
size
);
size
=
2
*
sizeof
(
ptr
);
hr
=
IDirectDrawSurface4_GetPrivateData
(
surface
,
&
IID_IDirect3D
,
NULL
,
&
size
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
size
==
2
*
sizeof
(
ptr
),
"Got unexpected size %u.
\n
"
,
size
);
size
=
1
;
hr
=
IDirectDrawSurface4_GetPrivateData
(
surface
,
&
IID_IDirect3D
,
&
ptr
,
&
size
);
ok
(
hr
==
DDERR_MOREDATA
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
size
==
sizeof
(
ddraw
),
"Got unexpected size %u.
\n
"
,
size
);
ok
(
ptr
==
(
IUnknown
*
)
0xdeadbeef
,
"Got unexpected pointer %p.
\n
"
,
ptr
);
hr
=
IDirectDrawSurface4_GetPrivateData
(
surface
,
&
IID_IDirect3DViewport
,
NULL
,
NULL
);
ok
(
hr
==
DDERR_NOTFOUND
,
"Got unexpected hr %#x.
\n
"
,
hr
);
size
=
0xdeadbabe
;
hr
=
IDirectDrawSurface4_GetPrivateData
(
surface
,
&
IID_IDirect3DViewport
,
&
ptr
,
&
size
);
ok
(
hr
==
DDERR_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
);
hr
=
IDirectDrawSurface4_GetPrivateData
(
surface
,
&
IID_IDirect3D
,
NULL
,
NULL
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"Got unexpected hr %#x.
\n
"
,
hr
);
refcount3
=
IDirectDrawSurface4_Release
(
surface
);
refcount3
=
IDirectDrawSurface4_Release
(
surface
);
ok
(
!
refcount3
,
"Got unexpected refcount %u.
\n
"
,
refcount3
);
ok
(
!
refcount3
,
"Got unexpected refcount %u.
\n
"
,
refcount3
);
...
...
dlls/ddraw/tests/ddraw7.c
View file @
1d9ff5c4
...
@@ -5977,13 +5977,39 @@ static void test_private_data(void)
...
@@ -5977,13 +5977,39 @@ static void test_private_data(void)
hr
=
IDirectDrawSurface7_SetPrivateData
(
surface
,
&
IID_IDirect3D
,
ddraw
,
hr
=
IDirectDrawSurface7_SetPrivateData
(
surface
,
&
IID_IDirect3D
,
ddraw
,
sizeof
(
ddraw
),
DDSPD_IUNKNOWNPOINTER
);
sizeof
(
ddraw
),
DDSPD_IUNKNOWNPOINTER
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set private data, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set private data, hr %#x.
\n
"
,
hr
);
size
=
2
*
sizeof
(
ptr
);
hr
=
IDirectDrawSurface7_GetPrivateData
(
surface
,
&
IID_IDirect3D
,
&
ptr
,
&
size
);
hr
=
IDirectDrawSurface7_GetPrivateData
(
surface
,
&
IID_IDirect3D
,
&
ptr
,
&
size
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get private data, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get private data, hr %#x.
\n
"
,
hr
);
ok
(
size
==
sizeof
(
ddraw
),
"Got unexpected size %u.
\n
"
,
size
);
refcount2
=
get_refcount
(
ptr
);
refcount2
=
get_refcount
(
ptr
);
/* Object is NOT addref'ed by the getter. */
/* Object is NOT addref'ed by the getter. */
ok
(
ptr
==
(
IUnknown
*
)
ddraw
,
"Returned interface pointer is %p, expected %p.
\n
"
,
ptr
,
ddraw
);
ok
(
ptr
==
(
IUnknown
*
)
ddraw
,
"Returned interface pointer is %p, expected %p.
\n
"
,
ptr
,
ddraw
);
ok
(
refcount2
==
refcount
+
1
,
"Got unexpected refcount %u.
\n
"
,
refcount2
);
ok
(
refcount2
==
refcount
+
1
,
"Got unexpected refcount %u.
\n
"
,
refcount2
);
ptr
=
(
IUnknown
*
)
0xdeadbeef
;
size
=
1
;
hr
=
IDirectDrawSurface7_GetPrivateData
(
surface
,
&
IID_IDirect3D
,
NULL
,
&
size
);
ok
(
hr
==
DDERR_MOREDATA
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
size
==
sizeof
(
ddraw
),
"Got unexpected size %u.
\n
"
,
size
);
size
=
2
*
sizeof
(
ptr
);
hr
=
IDirectDrawSurface7_GetPrivateData
(
surface
,
&
IID_IDirect3D
,
NULL
,
&
size
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
size
==
2
*
sizeof
(
ptr
),
"Got unexpected size %u.
\n
"
,
size
);
size
=
1
;
hr
=
IDirectDrawSurface7_GetPrivateData
(
surface
,
&
IID_IDirect3D
,
&
ptr
,
&
size
);
ok
(
hr
==
DDERR_MOREDATA
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
size
==
sizeof
(
ddraw
),
"Got unexpected size %u.
\n
"
,
size
);
ok
(
ptr
==
(
IUnknown
*
)
0xdeadbeef
,
"Got unexpected pointer %p.
\n
"
,
ptr
);
hr
=
IDirectDrawSurface7_GetPrivateData
(
surface
,
&
IID_IDirect3DViewport
,
NULL
,
NULL
);
ok
(
hr
==
DDERR_NOTFOUND
,
"Got unexpected hr %#x.
\n
"
,
hr
);
size
=
0xdeadbabe
;
hr
=
IDirectDrawSurface7_GetPrivateData
(
surface
,
&
IID_IDirect3DViewport
,
&
ptr
,
&
size
);
ok
(
hr
==
DDERR_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
);
hr
=
IDirectDrawSurface7_GetPrivateData
(
surface
,
&
IID_IDirect3D
,
NULL
,
NULL
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"Got unexpected hr %#x.
\n
"
,
hr
);
refcount3
=
IDirectDrawSurface7_Release
(
surface
);
refcount3
=
IDirectDrawSurface7_Release
(
surface
);
ok
(
!
refcount3
,
"Got unexpected refcount %u.
\n
"
,
refcount3
);
ok
(
!
refcount3
,
"Got unexpected refcount %u.
\n
"
,
refcount3
);
...
...
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