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
d8153e53
Commit
d8153e53
authored
Dec 22, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Dec 23, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Properly handle DDSCL_CREATEDEVICEWINDOW.
parent
a5af10e1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
38 deletions
+43
-38
ddraw.c
dlls/ddraw/ddraw.c
+31
-26
ddraw1.c
dlls/ddraw/tests/ddraw1.c
+3
-3
ddraw2.c
dlls/ddraw/tests/ddraw2.c
+3
-3
ddraw4.c
dlls/ddraw/tests/ddraw4.c
+3
-3
ddraw7.c
dlls/ddraw/tests/ddraw7.c
+3
-3
No files found.
dlls/ddraw/ddraw.c
View file @
d8153e53
...
...
@@ -812,14 +812,42 @@ static HRESULT WINAPI ddraw7_SetCooperativeLevel(IDirectDraw7 *iface, HWND hwnd,
return
hr
;
}
if
(
cooplevel
&
DDSCL_EXCLUSIVE
)
if
(
cooplevel
&
DDSCL_EXCLUSIVE
)
{
if
(
!
(
cooplevel
&
DDSCL_FULLSCREEN
)
||
!
hwnd
)
if
(
!
(
cooplevel
&
DDSCL_FULLSCREEN
)
||
!
(
hwnd
||
(
cooplevel
&
DDSCL_CREATEDEVICEWINDOW
))
)
{
TRACE
(
"(%p) DDSCL_EXCLUSIVE needs DDSCL_FULLSCREEN and a window
\n
"
,
This
);
WARN
(
"DDSCL_EXCLUSIVE requires DDSCL_FULLSCREEN and a window.
\n
"
);
wined3d_mutex_unlock
();
return
DDERR_INVALIDPARAMS
;
}
if
(
cooplevel
&
DDSCL_CREATEDEVICEWINDOW
)
{
HWND
device_window
;
if
(
!
This
->
focuswindow
&&
!
(
cooplevel
&
DDSCL_SETFOCUSWINDOW
))
{
WARN
(
"No focus window set.
\n
"
);
wined3d_mutex_unlock
();
return
DDERR_NOFOCUSWINDOW
;
}
device_window
=
CreateWindowExA
(
0
,
DDRAW_WINDOW_CLASS_NAME
,
"DDraw device window"
,
WS_POPUP
,
0
,
0
,
GetSystemMetrics
(
SM_CXSCREEN
),
GetSystemMetrics
(
SM_CYSCREEN
),
NULL
,
NULL
,
NULL
,
NULL
);
if
(
!
device_window
)
{
ERR
(
"Failed to create window, last error %#x.
\n
"
,
GetLastError
());
wined3d_mutex_unlock
();
return
E_FAIL
;
}
ShowWindow
(
device_window
,
SW_SHOW
);
TRACE
(
"Created a device window %p.
\n
"
,
device_window
);
This
->
devicewindow
=
device_window
;
hwnd
=
device_window
;
}
}
else
{
...
...
@@ -864,29 +892,6 @@ static HRESULT WINAPI ddraw7_SetCooperativeLevel(IDirectDraw7 *iface, HWND hwnd,
if
(
hwnd
&&
!
This
->
focuswindow
&&
!
This
->
devicewindow
&&
(
hwnd
!=
window
))
This
->
dest_window
=
hwnd
;
if
(
cooplevel
&
DDSCL_CREATEDEVICEWINDOW
)
{
/* Don't create a device window if a focus window is set */
if
(
!
(
This
->
focuswindow
)
)
{
HWND
devicewindow
=
CreateWindowExA
(
0
,
DDRAW_WINDOW_CLASS_NAME
,
"DDraw device window"
,
WS_POPUP
,
0
,
0
,
GetSystemMetrics
(
SM_CXSCREEN
),
GetSystemMetrics
(
SM_CYSCREEN
),
NULL
,
NULL
,
NULL
,
NULL
);
if
(
!
devicewindow
)
{
ERR
(
"Failed to create window, last error %#x.
\n
"
,
GetLastError
());
wined3d_mutex_unlock
();
return
E_FAIL
;
}
ShowWindow
(
devicewindow
,
SW_SHOW
);
/* Just to be sure */
TRACE
(
"(%p) Created a DDraw device window. HWND=%p
\n
"
,
This
,
devicewindow
);
This
->
devicewindow
=
devicewindow
;
This
->
dest_window
=
devicewindow
;
}
}
if
(
cooplevel
&
DDSCL_MULTITHREADED
&&
!
(
This
->
cooperative_level
&
DDSCL_MULTITHREADED
))
wined3d_device_set_multithreaded
(
This
->
wined3d_device
);
...
...
dlls/ddraw/tests/ddraw1.c
View file @
d8153e53
...
...
@@ -61,7 +61,7 @@ static void test_coop_level_create_device_window(void)
device_window
=
FindWindowA
(
"DirectDrawDeviceWnd"
,
"DirectDrawDeviceWnd"
);
ok
(
!
device_window
,
"Unexpected device window found.
\n
"
);
hr
=
IDirectDraw_SetCooperativeLevel
(
ddraw
,
NULL
,
DDSCL_CREATEDEVICEWINDOW
|
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
todo_wine
ok
(
hr
==
DDERR_NOFOCUSWINDOW
||
broken
(
hr
==
DDERR_INVALIDPARAMS
),
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
DDERR_NOFOCUSWINDOW
||
broken
(
hr
==
DDERR_INVALIDPARAMS
),
"Got unexpected hr %#x.
\n
"
,
hr
);
device_window
=
FindWindowA
(
"DirectDrawDeviceWnd"
,
"DirectDrawDeviceWnd"
);
ok
(
!
device_window
,
"Unexpected device window found.
\n
"
);
...
...
@@ -108,7 +108,7 @@ static void test_coop_level_create_device_window(void)
device_window
=
FindWindowA
(
"DirectDrawDeviceWnd"
,
"DirectDrawDeviceWnd"
);
ok
(
!
device_window
,
"Unexpected device window found.
\n
"
);
hr
=
IDirectDraw_SetCooperativeLevel
(
ddraw
,
NULL
,
DDSCL_CREATEDEVICEWINDOW
|
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
todo_wine
ok
(
hr
==
DDERR_NOFOCUSWINDOW
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
DDERR_NOFOCUSWINDOW
,
"Got unexpected hr %#x.
\n
"
,
hr
);
device_window
=
FindWindowA
(
"DirectDrawDeviceWnd"
,
"DirectDrawDeviceWnd"
);
ok
(
!
device_window
,
"Unexpected device window found.
\n
"
);
hr
=
IDirectDraw_SetCooperativeLevel
(
ddraw
,
focus_window
,
DDSCL_SETFOCUSWINDOW
);
...
...
@@ -116,7 +116,7 @@ static void test_coop_level_create_device_window(void)
device_window
=
FindWindowA
(
"DirectDrawDeviceWnd"
,
"DirectDrawDeviceWnd"
);
ok
(
!
device_window
,
"Unexpected device window found.
\n
"
);
hr
=
IDirectDraw_SetCooperativeLevel
(
ddraw
,
NULL
,
DDSCL_CREATEDEVICEWINDOW
|
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
todo_wine
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
device_window
=
FindWindowA
(
"DirectDrawDeviceWnd"
,
"DirectDrawDeviceWnd"
);
todo_wine
ok
(
!!
device_window
,
"Device window not found.
\n
"
);
...
...
dlls/ddraw/tests/ddraw2.c
View file @
d8153e53
...
...
@@ -68,7 +68,7 @@ static void test_coop_level_create_device_window(void)
device_window
=
FindWindowA
(
"DirectDrawDeviceWnd"
,
"DirectDrawDeviceWnd"
);
ok
(
!
device_window
,
"Unexpected device window found.
\n
"
);
hr
=
IDirectDraw2_SetCooperativeLevel
(
ddraw
,
NULL
,
DDSCL_CREATEDEVICEWINDOW
|
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
todo_wine
ok
(
hr
==
DDERR_NOFOCUSWINDOW
||
broken
(
hr
==
DDERR_INVALIDPARAMS
),
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
DDERR_NOFOCUSWINDOW
||
broken
(
hr
==
DDERR_INVALIDPARAMS
),
"Got unexpected hr %#x.
\n
"
,
hr
);
device_window
=
FindWindowA
(
"DirectDrawDeviceWnd"
,
"DirectDrawDeviceWnd"
);
ok
(
!
device_window
,
"Unexpected device window found.
\n
"
);
...
...
@@ -115,7 +115,7 @@ static void test_coop_level_create_device_window(void)
device_window
=
FindWindowA
(
"DirectDrawDeviceWnd"
,
"DirectDrawDeviceWnd"
);
ok
(
!
device_window
,
"Unexpected device window found.
\n
"
);
hr
=
IDirectDraw2_SetCooperativeLevel
(
ddraw
,
NULL
,
DDSCL_CREATEDEVICEWINDOW
|
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
todo_wine
ok
(
hr
==
DDERR_NOFOCUSWINDOW
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
DDERR_NOFOCUSWINDOW
,
"Got unexpected hr %#x.
\n
"
,
hr
);
device_window
=
FindWindowA
(
"DirectDrawDeviceWnd"
,
"DirectDrawDeviceWnd"
);
ok
(
!
device_window
,
"Unexpected device window found.
\n
"
);
hr
=
IDirectDraw2_SetCooperativeLevel
(
ddraw
,
focus_window
,
DDSCL_SETFOCUSWINDOW
);
...
...
@@ -123,7 +123,7 @@ static void test_coop_level_create_device_window(void)
device_window
=
FindWindowA
(
"DirectDrawDeviceWnd"
,
"DirectDrawDeviceWnd"
);
ok
(
!
device_window
,
"Unexpected device window found.
\n
"
);
hr
=
IDirectDraw2_SetCooperativeLevel
(
ddraw
,
NULL
,
DDSCL_CREATEDEVICEWINDOW
|
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
todo_wine
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
device_window
=
FindWindowA
(
"DirectDrawDeviceWnd"
,
"DirectDrawDeviceWnd"
);
todo_wine
ok
(
!!
device_window
,
"Device window not found.
\n
"
);
...
...
dlls/ddraw/tests/ddraw4.c
View file @
d8153e53
...
...
@@ -364,7 +364,7 @@ static void test_coop_level_create_device_window(void)
device_window
=
FindWindowA
(
"DirectDrawDeviceWnd"
,
"DirectDrawDeviceWnd"
);
ok
(
!
device_window
,
"Unexpected device window found.
\n
"
);
hr
=
IDirectDraw4_SetCooperativeLevel
(
ddraw
,
NULL
,
DDSCL_CREATEDEVICEWINDOW
|
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
todo_wine
ok
(
hr
==
DDERR_NOFOCUSWINDOW
||
broken
(
hr
==
DDERR_INVALIDPARAMS
),
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
DDERR_NOFOCUSWINDOW
||
broken
(
hr
==
DDERR_INVALIDPARAMS
),
"Got unexpected hr %#x.
\n
"
,
hr
);
device_window
=
FindWindowA
(
"DirectDrawDeviceWnd"
,
"DirectDrawDeviceWnd"
);
ok
(
!
device_window
,
"Unexpected device window found.
\n
"
);
...
...
@@ -411,7 +411,7 @@ static void test_coop_level_create_device_window(void)
device_window
=
FindWindowA
(
"DirectDrawDeviceWnd"
,
"DirectDrawDeviceWnd"
);
ok
(
!
device_window
,
"Unexpected device window found.
\n
"
);
hr
=
IDirectDraw4_SetCooperativeLevel
(
ddraw
,
NULL
,
DDSCL_CREATEDEVICEWINDOW
|
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
todo_wine
ok
(
hr
==
DDERR_NOFOCUSWINDOW
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
DDERR_NOFOCUSWINDOW
,
"Got unexpected hr %#x.
\n
"
,
hr
);
device_window
=
FindWindowA
(
"DirectDrawDeviceWnd"
,
"DirectDrawDeviceWnd"
);
ok
(
!
device_window
,
"Unexpected device window found.
\n
"
);
hr
=
IDirectDraw4_SetCooperativeLevel
(
ddraw
,
focus_window
,
DDSCL_SETFOCUSWINDOW
);
...
...
@@ -419,7 +419,7 @@ static void test_coop_level_create_device_window(void)
device_window
=
FindWindowA
(
"DirectDrawDeviceWnd"
,
"DirectDrawDeviceWnd"
);
ok
(
!
device_window
,
"Unexpected device window found.
\n
"
);
hr
=
IDirectDraw4_SetCooperativeLevel
(
ddraw
,
NULL
,
DDSCL_CREATEDEVICEWINDOW
|
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
todo_wine
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
device_window
=
FindWindowA
(
"DirectDrawDeviceWnd"
,
"DirectDrawDeviceWnd"
);
todo_wine
ok
(
!!
device_window
,
"Device window not found.
\n
"
);
...
...
dlls/ddraw/tests/ddraw7.c
View file @
d8153e53
...
...
@@ -357,7 +357,7 @@ static void test_coop_level_create_device_window(void)
device_window
=
FindWindowA
(
"DirectDrawDeviceWnd"
,
"DirectDrawDeviceWnd"
);
ok
(
!
device_window
,
"Unexpected device window found.
\n
"
);
hr
=
IDirectDraw7_SetCooperativeLevel
(
ddraw
,
NULL
,
DDSCL_CREATEDEVICEWINDOW
|
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
todo_wine
ok
(
hr
==
DDERR_NOFOCUSWINDOW
||
broken
(
hr
==
DDERR_INVALIDPARAMS
),
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
DDERR_NOFOCUSWINDOW
||
broken
(
hr
==
DDERR_INVALIDPARAMS
),
"Got unexpected hr %#x.
\n
"
,
hr
);
device_window
=
FindWindowA
(
"DirectDrawDeviceWnd"
,
"DirectDrawDeviceWnd"
);
ok
(
!
device_window
,
"Unexpected device window found.
\n
"
);
...
...
@@ -404,7 +404,7 @@ static void test_coop_level_create_device_window(void)
device_window
=
FindWindowA
(
"DirectDrawDeviceWnd"
,
"DirectDrawDeviceWnd"
);
ok
(
!
device_window
,
"Unexpected device window found.
\n
"
);
hr
=
IDirectDraw7_SetCooperativeLevel
(
ddraw
,
NULL
,
DDSCL_CREATEDEVICEWINDOW
|
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
todo_wine
ok
(
hr
==
DDERR_NOFOCUSWINDOW
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
DDERR_NOFOCUSWINDOW
,
"Got unexpected hr %#x.
\n
"
,
hr
);
device_window
=
FindWindowA
(
"DirectDrawDeviceWnd"
,
"DirectDrawDeviceWnd"
);
ok
(
!
device_window
,
"Unexpected device window found.
\n
"
);
hr
=
IDirectDraw7_SetCooperativeLevel
(
ddraw
,
focus_window
,
DDSCL_SETFOCUSWINDOW
);
...
...
@@ -412,7 +412,7 @@ static void test_coop_level_create_device_window(void)
device_window
=
FindWindowA
(
"DirectDrawDeviceWnd"
,
"DirectDrawDeviceWnd"
);
ok
(
!
device_window
,
"Unexpected device window found.
\n
"
);
hr
=
IDirectDraw7_SetCooperativeLevel
(
ddraw
,
NULL
,
DDSCL_CREATEDEVICEWINDOW
|
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
todo_wine
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
device_window
=
FindWindowA
(
"DirectDrawDeviceWnd"
,
"DirectDrawDeviceWnd"
);
todo_wine
ok
(
!!
device_window
,
"Device window not found.
\n
"
);
...
...
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