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
5e677bee
Commit
5e677bee
authored
Jan 17, 2019
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 17, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw/tests: Add a test for the "GDI" surface.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
26db17e9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
364 additions
and
0 deletions
+364
-0
ddraw1.c
dlls/ddraw/tests/ddraw1.c
+91
-0
ddraw2.c
dlls/ddraw/tests/ddraw2.c
+91
-0
ddraw4.c
dlls/ddraw/tests/ddraw4.c
+91
-0
ddraw7.c
dlls/ddraw/tests/ddraw7.c
+91
-0
No files found.
dlls/ddraw/tests/ddraw1.c
View file @
5e677bee
...
...
@@ -12013,6 +12013,96 @@ static void test_killfocus(void)
UnregisterClassA
(
"ddraw_killfocus_wndproc_wc"
,
GetModuleHandleA
(
NULL
));
}
static
void
test_gdi_surface
(
void
)
{
IDirectDrawSurface
*
primary
,
*
backbuffer
,
*
gdi_surface
;
DDSCAPS
caps
=
{
DDSCAPS_BACKBUFFER
};
DDSURFACEDESC
surface_desc
;
IDirectDraw
*
ddraw
;
ULONG
refcount
;
HWND
window
;
HRESULT
hr
;
window
=
create_window
();
ddraw
=
create_ddraw
();
ok
(
!!
ddraw
,
"Failed to create a ddraw object.
\n
"
);
hr
=
IDirectDraw_SetCooperativeLevel
(
ddraw
,
window
,
DDSCL_NORMAL
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
/* Retrieving the GDI surface requires a primary surface to exist. */
gdi_surface
=
(
void
*
)
0xc0dec0de
;
hr
=
IDirectDraw_GetGDISurface
(
ddraw
,
&
gdi_surface
);
ok
(
hr
==
DDERR_NOTFOUND
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
gdi_surface
,
"Got unexpected surface %p.
\n
"
,
gdi_surface
);
hr
=
IDirectDraw_FlipToGDISurface
(
ddraw
);
todo_wine
ok
(
hr
==
DDERR_NOTFOUND
,
"Got unexpected hr %#x.
\n
"
,
hr
);
memset
(
&
surface_desc
,
0
,
sizeof
(
surface_desc
));
surface_desc
.
dwSize
=
sizeof
(
surface_desc
);
surface_desc
.
dwFlags
=
DDSD_CAPS
;
surface_desc
.
ddsCaps
.
dwCaps
=
DDSCAPS_PRIMARYSURFACE
;
hr
=
IDirectDraw_CreateSurface
(
ddraw
,
&
surface_desc
,
&
primary
,
NULL
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw_GetGDISurface
(
ddraw
,
&
gdi_surface
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
gdi_surface
==
primary
,
"Got unexpected surface %p, expected %p.
\n
"
,
gdi_surface
,
primary
);
IDirectDrawSurface_Release
(
gdi_surface
);
/* Flipping to the GDI surface requires the primary surface to be
* flippable. */
hr
=
IDirectDraw_FlipToGDISurface
(
ddraw
);
todo_wine
ok
(
hr
==
DDERR_NOTFLIPPABLE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
IDirectDrawSurface_Release
(
primary
);
hr
=
IDirectDraw_SetCooperativeLevel
(
ddraw
,
window
,
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
memset
(
&
surface_desc
,
0
,
sizeof
(
surface_desc
));
surface_desc
.
dwSize
=
sizeof
(
surface_desc
);
surface_desc
.
dwFlags
=
DDSD_CAPS
|
DDSD_BACKBUFFERCOUNT
;
surface_desc
.
ddsCaps
.
dwCaps
=
DDSCAPS_PRIMARYSURFACE
|
DDSCAPS_COMPLEX
|
DDSCAPS_FLIP
;
U5
(
surface_desc
).
dwBackBufferCount
=
1
;
hr
=
IDirectDraw_CreateSurface
(
ddraw
,
&
surface_desc
,
&
primary
,
NULL
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface_GetAttachedSurface
(
primary
,
&
caps
,
&
backbuffer
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
backbuffer
!=
primary
,
"Got unexpected backbuffer %p.
\n
"
,
backbuffer
);
hr
=
IDirectDraw_GetGDISurface
(
ddraw
,
&
gdi_surface
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
gdi_surface
==
primary
,
"Got unexpected surface %p, expected %p.
\n
"
,
gdi_surface
,
primary
);
IDirectDrawSurface_Release
(
gdi_surface
);
hr
=
IDirectDrawSurface_Flip
(
primary
,
NULL
,
DDFLIP_WAIT
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw_GetGDISurface
(
ddraw
,
&
gdi_surface
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
gdi_surface
==
backbuffer
||
broken
(
gdi_surface
==
primary
),
"Got unexpected surface %p, expected %p.
\n
"
,
gdi_surface
,
backbuffer
);
IDirectDrawSurface_Release
(
gdi_surface
);
hr
=
IDirectDraw_FlipToGDISurface
(
ddraw
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw_GetGDISurface
(
ddraw
,
&
gdi_surface
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
gdi_surface
==
primary
,
"Got unexpected surface %p, expected %p.
\n
"
,
gdi_surface
,
primary
);
IDirectDrawSurface_Release
(
gdi_surface
);
hr
=
IDirectDraw_FlipToGDISurface
(
ddraw
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
IDirectDrawSurface_Release
(
backbuffer
);
IDirectDrawSurface_Release
(
primary
);
refcount
=
IDirectDraw_Release
(
ddraw
);
ok
(
!
refcount
,
"%u references left.
\n
"
,
refcount
);
DestroyWindow
(
window
);
}
START_TEST
(
ddraw1
)
{
DDDEVICEIDENTIFIER
identifier
;
...
...
@@ -12119,4 +12209,5 @@ START_TEST(ddraw1)
test_viewport
();
test_find_device
();
test_killfocus
();
test_gdi_surface
();
}
dlls/ddraw/tests/ddraw2.c
View file @
5e677bee
...
...
@@ -13314,6 +13314,96 @@ static void test_killfocus(void)
UnregisterClassA
(
"ddraw_killfocus_wndproc_wc"
,
GetModuleHandleA
(
NULL
));
}
static
void
test_gdi_surface
(
void
)
{
IDirectDrawSurface
*
primary
,
*
backbuffer
,
*
gdi_surface
;
DDSCAPS
caps
=
{
DDSCAPS_BACKBUFFER
};
DDSURFACEDESC
surface_desc
;
IDirectDraw2
*
ddraw
;
ULONG
refcount
;
HWND
window
;
HRESULT
hr
;
window
=
create_window
();
ddraw
=
create_ddraw
();
ok
(
!!
ddraw
,
"Failed to create a ddraw object.
\n
"
);
hr
=
IDirectDraw2_SetCooperativeLevel
(
ddraw
,
window
,
DDSCL_NORMAL
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
/* Retrieving the GDI surface requires a primary surface to exist. */
gdi_surface
=
(
void
*
)
0xc0dec0de
;
hr
=
IDirectDraw2_GetGDISurface
(
ddraw
,
&
gdi_surface
);
ok
(
hr
==
DDERR_NOTFOUND
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
gdi_surface
,
"Got unexpected surface %p.
\n
"
,
gdi_surface
);
hr
=
IDirectDraw2_FlipToGDISurface
(
ddraw
);
todo_wine
ok
(
hr
==
DDERR_NOTFOUND
,
"Got unexpected hr %#x.
\n
"
,
hr
);
memset
(
&
surface_desc
,
0
,
sizeof
(
surface_desc
));
surface_desc
.
dwSize
=
sizeof
(
surface_desc
);
surface_desc
.
dwFlags
=
DDSD_CAPS
;
surface_desc
.
ddsCaps
.
dwCaps
=
DDSCAPS_PRIMARYSURFACE
;
hr
=
IDirectDraw2_CreateSurface
(
ddraw
,
&
surface_desc
,
&
primary
,
NULL
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw2_GetGDISurface
(
ddraw
,
&
gdi_surface
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
gdi_surface
==
primary
,
"Got unexpected surface %p, expected %p.
\n
"
,
gdi_surface
,
primary
);
IDirectDrawSurface_Release
(
gdi_surface
);
/* Flipping to the GDI surface requires the primary surface to be
* flippable. */
hr
=
IDirectDraw2_FlipToGDISurface
(
ddraw
);
todo_wine
ok
(
hr
==
DDERR_NOTFLIPPABLE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
IDirectDrawSurface_Release
(
primary
);
hr
=
IDirectDraw2_SetCooperativeLevel
(
ddraw
,
window
,
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
memset
(
&
surface_desc
,
0
,
sizeof
(
surface_desc
));
surface_desc
.
dwSize
=
sizeof
(
surface_desc
);
surface_desc
.
dwFlags
=
DDSD_CAPS
|
DDSD_BACKBUFFERCOUNT
;
surface_desc
.
ddsCaps
.
dwCaps
=
DDSCAPS_PRIMARYSURFACE
|
DDSCAPS_COMPLEX
|
DDSCAPS_FLIP
;
U5
(
surface_desc
).
dwBackBufferCount
=
1
;
hr
=
IDirectDraw2_CreateSurface
(
ddraw
,
&
surface_desc
,
&
primary
,
NULL
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface_GetAttachedSurface
(
primary
,
&
caps
,
&
backbuffer
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
backbuffer
!=
primary
,
"Got unexpected backbuffer %p.
\n
"
,
backbuffer
);
hr
=
IDirectDraw2_GetGDISurface
(
ddraw
,
&
gdi_surface
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
gdi_surface
==
primary
,
"Got unexpected surface %p, expected %p.
\n
"
,
gdi_surface
,
primary
);
IDirectDrawSurface_Release
(
gdi_surface
);
hr
=
IDirectDrawSurface_Flip
(
primary
,
NULL
,
DDFLIP_WAIT
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw2_GetGDISurface
(
ddraw
,
&
gdi_surface
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
gdi_surface
==
backbuffer
||
broken
(
gdi_surface
==
primary
),
"Got unexpected surface %p, expected %p.
\n
"
,
gdi_surface
,
backbuffer
);
IDirectDrawSurface_Release
(
gdi_surface
);
hr
=
IDirectDraw2_FlipToGDISurface
(
ddraw
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw2_GetGDISurface
(
ddraw
,
&
gdi_surface
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
gdi_surface
==
primary
,
"Got unexpected surface %p, expected %p.
\n
"
,
gdi_surface
,
primary
);
IDirectDrawSurface_Release
(
gdi_surface
);
hr
=
IDirectDraw2_FlipToGDISurface
(
ddraw
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
IDirectDrawSurface_Release
(
backbuffer
);
IDirectDrawSurface_Release
(
primary
);
refcount
=
IDirectDraw2_Release
(
ddraw
);
ok
(
!
refcount
,
"%u references left.
\n
"
,
refcount
);
DestroyWindow
(
window
);
}
START_TEST
(
ddraw2
)
{
DDDEVICEIDENTIFIER
identifier
;
...
...
@@ -13428,4 +13518,5 @@ START_TEST(ddraw2)
test_viewport
();
test_find_device
();
test_killfocus
();
test_gdi_surface
();
}
dlls/ddraw/tests/ddraw4.c
View file @
5e677bee
...
...
@@ -15519,6 +15519,96 @@ static void test_sysmem_draw(void)
DestroyWindow
(
window
);
}
static
void
test_gdi_surface
(
void
)
{
IDirectDrawSurface4
*
primary
,
*
backbuffer
,
*
gdi_surface
;
DDSCAPS2
caps
=
{
DDSCAPS_BACKBUFFER
,
0
,
0
,
{
0
}};
DDSURFACEDESC2
surface_desc
;
IDirectDraw4
*
ddraw
;
ULONG
refcount
;
HWND
window
;
HRESULT
hr
;
window
=
create_window
();
ddraw
=
create_ddraw
();
ok
(
!!
ddraw
,
"Failed to create a ddraw object.
\n
"
);
hr
=
IDirectDraw4_SetCooperativeLevel
(
ddraw
,
window
,
DDSCL_NORMAL
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
/* Retrieving the GDI surface requires a primary surface to exist. */
gdi_surface
=
(
void
*
)
0xc0dec0de
;
hr
=
IDirectDraw4_GetGDISurface
(
ddraw
,
&
gdi_surface
);
ok
(
hr
==
DDERR_NOTFOUND
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
gdi_surface
,
"Got unexpected surface %p.
\n
"
,
gdi_surface
);
hr
=
IDirectDraw4_FlipToGDISurface
(
ddraw
);
todo_wine
ok
(
hr
==
DDERR_NOTFOUND
,
"Got unexpected hr %#x.
\n
"
,
hr
);
memset
(
&
surface_desc
,
0
,
sizeof
(
surface_desc
));
surface_desc
.
dwSize
=
sizeof
(
surface_desc
);
surface_desc
.
dwFlags
=
DDSD_CAPS
;
surface_desc
.
ddsCaps
.
dwCaps
=
DDSCAPS_PRIMARYSURFACE
;
hr
=
IDirectDraw4_CreateSurface
(
ddraw
,
&
surface_desc
,
&
primary
,
NULL
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw4_GetGDISurface
(
ddraw
,
&
gdi_surface
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
gdi_surface
==
primary
,
"Got unexpected surface %p, expected %p.
\n
"
,
gdi_surface
,
primary
);
IDirectDrawSurface4_Release
(
gdi_surface
);
/* Flipping to the GDI surface requires the primary surface to be
* flippable. */
hr
=
IDirectDraw4_FlipToGDISurface
(
ddraw
);
todo_wine
ok
(
hr
==
DDERR_NOTFLIPPABLE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
IDirectDrawSurface4_Release
(
primary
);
hr
=
IDirectDraw4_SetCooperativeLevel
(
ddraw
,
window
,
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
memset
(
&
surface_desc
,
0
,
sizeof
(
surface_desc
));
surface_desc
.
dwSize
=
sizeof
(
surface_desc
);
surface_desc
.
dwFlags
=
DDSD_CAPS
|
DDSD_BACKBUFFERCOUNT
;
surface_desc
.
ddsCaps
.
dwCaps
=
DDSCAPS_PRIMARYSURFACE
|
DDSCAPS_COMPLEX
|
DDSCAPS_FLIP
;
U5
(
surface_desc
).
dwBackBufferCount
=
1
;
hr
=
IDirectDraw4_CreateSurface
(
ddraw
,
&
surface_desc
,
&
primary
,
NULL
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface4_GetAttachedSurface
(
primary
,
&
caps
,
&
backbuffer
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
backbuffer
!=
primary
,
"Got unexpected backbuffer %p.
\n
"
,
backbuffer
);
hr
=
IDirectDraw4_GetGDISurface
(
ddraw
,
&
gdi_surface
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
gdi_surface
==
primary
,
"Got unexpected surface %p, expected %p.
\n
"
,
gdi_surface
,
primary
);
IDirectDrawSurface4_Release
(
gdi_surface
);
hr
=
IDirectDrawSurface4_Flip
(
primary
,
NULL
,
DDFLIP_WAIT
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw4_GetGDISurface
(
ddraw
,
&
gdi_surface
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
gdi_surface
==
backbuffer
||
broken
(
gdi_surface
==
primary
),
"Got unexpected surface %p, expected %p.
\n
"
,
gdi_surface
,
backbuffer
);
IDirectDrawSurface4_Release
(
gdi_surface
);
hr
=
IDirectDraw4_FlipToGDISurface
(
ddraw
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw4_GetGDISurface
(
ddraw
,
&
gdi_surface
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
gdi_surface
==
primary
,
"Got unexpected surface %p, expected %p.
\n
"
,
gdi_surface
,
primary
);
IDirectDrawSurface4_Release
(
gdi_surface
);
hr
=
IDirectDraw4_FlipToGDISurface
(
ddraw
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
IDirectDrawSurface4_Release
(
backbuffer
);
IDirectDrawSurface4_Release
(
primary
);
refcount
=
IDirectDraw4_Release
(
ddraw
);
ok
(
!
refcount
,
"%u references left.
\n
"
,
refcount
);
DestroyWindow
(
window
);
}
START_TEST
(
ddraw4
)
{
DDDEVICEIDENTIFIER
identifier
;
...
...
@@ -15648,4 +15738,5 @@ START_TEST(ddraw4)
test_find_device
();
test_killfocus
();
test_sysmem_draw
();
test_gdi_surface
();
}
dlls/ddraw/tests/ddraw7.c
View file @
5e677bee
...
...
@@ -15227,6 +15227,96 @@ static void test_sysmem_draw(void)
DestroyWindow
(
window
);
}
static
void
test_gdi_surface
(
void
)
{
IDirectDrawSurface7
*
primary
,
*
backbuffer
,
*
gdi_surface
;
DDSCAPS2
caps
=
{
DDSCAPS_BACKBUFFER
,
0
,
0
,
{
0
}};
DDSURFACEDESC2
surface_desc
;
IDirectDraw7
*
ddraw
;
ULONG
refcount
;
HWND
window
;
HRESULT
hr
;
window
=
create_window
();
ddraw
=
create_ddraw
();
ok
(
!!
ddraw
,
"Failed to create a ddraw object.
\n
"
);
hr
=
IDirectDraw7_SetCooperativeLevel
(
ddraw
,
window
,
DDSCL_NORMAL
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
/* Retrieving the GDI surface requires a primary surface to exist. */
gdi_surface
=
(
void
*
)
0xc0dec0de
;
hr
=
IDirectDraw7_GetGDISurface
(
ddraw
,
&
gdi_surface
);
ok
(
hr
==
DDERR_NOTFOUND
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
gdi_surface
,
"Got unexpected surface %p.
\n
"
,
gdi_surface
);
hr
=
IDirectDraw7_FlipToGDISurface
(
ddraw
);
todo_wine
ok
(
hr
==
DDERR_NOTFOUND
,
"Got unexpected hr %#x.
\n
"
,
hr
);
memset
(
&
surface_desc
,
0
,
sizeof
(
surface_desc
));
surface_desc
.
dwSize
=
sizeof
(
surface_desc
);
surface_desc
.
dwFlags
=
DDSD_CAPS
;
surface_desc
.
ddsCaps
.
dwCaps
=
DDSCAPS_PRIMARYSURFACE
;
hr
=
IDirectDraw7_CreateSurface
(
ddraw
,
&
surface_desc
,
&
primary
,
NULL
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw7_GetGDISurface
(
ddraw
,
&
gdi_surface
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
gdi_surface
==
primary
,
"Got unexpected surface %p, expected %p.
\n
"
,
gdi_surface
,
primary
);
IDirectDrawSurface7_Release
(
gdi_surface
);
/* Flipping to the GDI surface requires the primary surface to be
* flippable. */
hr
=
IDirectDraw7_FlipToGDISurface
(
ddraw
);
todo_wine
ok
(
hr
==
DDERR_NOTFLIPPABLE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
IDirectDrawSurface7_Release
(
primary
);
hr
=
IDirectDraw7_SetCooperativeLevel
(
ddraw
,
window
,
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
memset
(
&
surface_desc
,
0
,
sizeof
(
surface_desc
));
surface_desc
.
dwSize
=
sizeof
(
surface_desc
);
surface_desc
.
dwFlags
=
DDSD_CAPS
|
DDSD_BACKBUFFERCOUNT
;
surface_desc
.
ddsCaps
.
dwCaps
=
DDSCAPS_PRIMARYSURFACE
|
DDSCAPS_COMPLEX
|
DDSCAPS_FLIP
;
U5
(
surface_desc
).
dwBackBufferCount
=
1
;
hr
=
IDirectDraw7_CreateSurface
(
ddraw
,
&
surface_desc
,
&
primary
,
NULL
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface7_GetAttachedSurface
(
primary
,
&
caps
,
&
backbuffer
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
backbuffer
!=
primary
,
"Got unexpected backbuffer %p.
\n
"
,
backbuffer
);
hr
=
IDirectDraw7_GetGDISurface
(
ddraw
,
&
gdi_surface
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
gdi_surface
==
primary
,
"Got unexpected surface %p, expected %p.
\n
"
,
gdi_surface
,
primary
);
IDirectDrawSurface7_Release
(
gdi_surface
);
hr
=
IDirectDrawSurface7_Flip
(
primary
,
NULL
,
DDFLIP_WAIT
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw7_GetGDISurface
(
ddraw
,
&
gdi_surface
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
gdi_surface
==
backbuffer
||
broken
(
gdi_surface
==
primary
),
"Got unexpected surface %p, expected %p.
\n
"
,
gdi_surface
,
backbuffer
);
IDirectDrawSurface7_Release
(
gdi_surface
);
hr
=
IDirectDraw7_FlipToGDISurface
(
ddraw
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw7_GetGDISurface
(
ddraw
,
&
gdi_surface
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
gdi_surface
==
primary
,
"Got unexpected surface %p, expected %p.
\n
"
,
gdi_surface
,
primary
);
IDirectDrawSurface7_Release
(
gdi_surface
);
hr
=
IDirectDraw7_FlipToGDISurface
(
ddraw
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
IDirectDrawSurface7_Release
(
backbuffer
);
IDirectDrawSurface7_Release
(
primary
);
refcount
=
IDirectDraw7_Release
(
ddraw
);
ok
(
!
refcount
,
"%u references left.
\n
"
,
refcount
);
DestroyWindow
(
window
);
}
START_TEST
(
ddraw7
)
{
DDDEVICEIDENTIFIER2
identifier
;
...
...
@@ -15367,4 +15457,5 @@ START_TEST(ddraw7)
test_color_vertex
();
test_killfocus
();
test_sysmem_draw
();
test_gdi_surface
();
}
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