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
8d4988a4
Commit
8d4988a4
authored
Jun 30, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Jun 30, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Improve ddraw7_TestCooperativeLevel().
parent
ee7eee55
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
15 deletions
+19
-15
ddraw.c
dlls/ddraw/ddraw.c
+10
-13
ddraw_private.h
dlls/ddraw/ddraw_private.h
+7
-0
ddraw4.c
dlls/ddraw/tests/ddraw4.c
+1
-1
ddraw7.c
dlls/ddraw/tests/ddraw7.c
+1
-1
No files found.
dlls/ddraw/ddraw.c
View file @
8d4988a4
...
...
@@ -2185,23 +2185,13 @@ static HRESULT WINAPI ddraw1_GetScanLine(IDirectDraw *iface, DWORD *line)
return
ddraw7_GetScanLine
(
&
ddraw
->
IDirectDraw7_iface
,
line
);
}
/*****************************************************************************
* IDirectDraw7::TestCooperativeLevel
*
* Informs the application about the state of the video adapter, depending
* on the cooperative level
*
* Returns:
* DD_OK if the device is in a sane state
* DDERR_NOEXCLUSIVEMODE or DDERR_EXCLUSIVEMODEALREADYSET
* if the state is not correct(See below)
*
*****************************************************************************/
static
HRESULT
WINAPI
ddraw7_TestCooperativeLevel
(
IDirectDraw7
*
iface
)
{
struct
ddraw
*
ddraw
=
impl_from_IDirectDraw7
(
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
return
DD_OK
;
return
ddraw
->
device_state
==
DDRAW_DEVICE_STATE_OK
?
DD_OK
:
DDERR_NOEXCLUSIVEMODE
;
}
static
HRESULT
WINAPI
ddraw4_TestCooperativeLevel
(
IDirectDraw4
*
iface
)
...
...
@@ -4724,7 +4714,14 @@ static void CDECL device_parent_mode_changed(struct wined3d_device_parent *devic
static
void
CDECL
device_parent_activate
(
struct
wined3d_device_parent
*
device_parent
,
BOOL
activate
)
{
struct
ddraw
*
ddraw
=
ddraw_from_device_parent
(
device_parent
);
TRACE
(
"device_parent %p, activate %#x.
\n
"
,
device_parent
,
activate
);
if
(
!
activate
)
InterlockedCompareExchange
(
&
ddraw
->
device_state
,
DDRAW_DEVICE_STATE_LOST
,
DDRAW_DEVICE_STATE_OK
);
else
InterlockedCompareExchange
(
&
ddraw
->
device_state
,
DDRAW_DEVICE_STATE_OK
,
DDRAW_DEVICE_STATE_LOST
);
}
static
HRESULT
CDECL
device_parent_surface_created
(
struct
wined3d_device_parent
*
device_parent
,
...
...
dlls/ddraw/ddraw_private.h
View file @
8d4988a4
...
...
@@ -58,6 +58,12 @@ struct FvfToDecl
#define DDRAW_STRIDE_ALIGNMENT 8
enum
ddraw_device_state
{
DDRAW_DEVICE_STATE_OK
,
DDRAW_DEVICE_STATE_LOST
,
};
struct
ddraw
{
/* Interfaces */
...
...
@@ -77,6 +83,7 @@ struct ddraw
struct
wined3d
*
wined3d
;
struct
wined3d_device
*
wined3d_device
;
DWORD
flags
;
LONG
device_state
;
struct
ddraw_surface
*
primary
;
RECT
primary_lock
;
...
...
dlls/ddraw/tests/ddraw4.c
View file @
8d4988a4
...
...
@@ -7644,7 +7644,7 @@ static void test_lost_device(void)
ret
=
SetForegroundWindow
(
GetDesktopWindow
());
ok
(
ret
,
"Failed to set foreground window.
\n
"
);
hr
=
IDirectDraw4_TestCooperativeLevel
(
ddraw
);
todo_wine
ok
(
hr
==
DDERR_NOEXCLUSIVEMODE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
DDERR_NOEXCLUSIVEMODE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface4_IsLost
(
surface
);
todo_wine
ok
(
hr
==
DDERR_SURFACELOST
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface4_Flip
(
surface
,
NULL
,
DDFLIP_WAIT
);
...
...
dlls/ddraw/tests/ddraw7.c
View file @
8d4988a4
...
...
@@ -7366,7 +7366,7 @@ static void test_lost_device(void)
ret
=
SetForegroundWindow
(
GetDesktopWindow
());
ok
(
ret
,
"Failed to set foreground window.
\n
"
);
hr
=
IDirectDraw7_TestCooperativeLevel
(
ddraw
);
todo_wine
ok
(
hr
==
DDERR_NOEXCLUSIVEMODE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
DDERR_NOEXCLUSIVEMODE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface7_IsLost
(
surface
);
todo_wine
ok
(
hr
==
DDERR_SURFACELOST
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface7_Flip
(
surface
,
NULL
,
DDFLIP_WAIT
);
...
...
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