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
8c5a4401
Commit
8c5a4401
authored
Nov 01, 2011
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Nov 02, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Window supplied to SetCooperativeLevel have to be top level window.
parent
e1b72917
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
0 deletions
+38
-0
device.c
dlls/dinput/device.c
+2
-0
keyboard.c
dlls/dinput/tests/keyboard.c
+18
-0
mouse.c
dlls/dinput/tests/mouse.c
+18
-0
No files found.
dlls/dinput/device.c
View file @
8c5a4401
...
@@ -882,6 +882,8 @@ HRESULT WINAPI IDirectInputDevice2WImpl_SetCooperativeLevel(LPDIRECTINPUTDEVICE8
...
@@ -882,6 +882,8 @@ HRESULT WINAPI IDirectInputDevice2WImpl_SetCooperativeLevel(LPDIRECTINPUTDEVICE8
(
dwflags
&
(
DISCL_FOREGROUND
|
DISCL_BACKGROUND
))
==
(
DISCL_FOREGROUND
|
DISCL_BACKGROUND
))
(
dwflags
&
(
DISCL_FOREGROUND
|
DISCL_BACKGROUND
))
==
(
DISCL_FOREGROUND
|
DISCL_BACKGROUND
))
return
DIERR_INVALIDPARAM
;
return
DIERR_INVALIDPARAM
;
if
(
hwnd
&&
GetWindowLongW
(
hwnd
,
GWL_STYLE
)
&
WS_CHILD
)
return
E_HANDLE
;
if
(
dwflags
==
(
DISCL_NONEXCLUSIVE
|
DISCL_BACKGROUND
))
if
(
dwflags
==
(
DISCL_NONEXCLUSIVE
|
DISCL_BACKGROUND
))
hwnd
=
GetDesktopWindow
();
hwnd
=
GetDesktopWindow
();
...
...
dlls/dinput/tests/keyboard.c
View file @
8c5a4401
...
@@ -106,11 +106,18 @@ static const HRESULT SetCoop_real_window[16] = {
...
@@ -106,11 +106,18 @@ static const HRESULT SetCoop_real_window[16] = {
E_INVALIDARG
,
E_NOTIMPL
,
S_OK
,
E_INVALIDARG
,
E_INVALIDARG
,
E_NOTIMPL
,
S_OK
,
E_INVALIDARG
,
E_INVALIDARG
,
E_INVALIDARG
,
E_INVALIDARG
,
E_INVALIDARG
};
E_INVALIDARG
,
E_INVALIDARG
,
E_INVALIDARG
,
E_INVALIDARG
};
static
const
HRESULT
SetCoop_child_window
[
16
]
=
{
E_INVALIDARG
,
E_INVALIDARG
,
E_INVALIDARG
,
E_INVALIDARG
,
E_INVALIDARG
,
E_HANDLE
,
E_HANDLE
,
E_INVALIDARG
,
E_INVALIDARG
,
E_HANDLE
,
E_HANDLE
,
E_INVALIDARG
,
E_INVALIDARG
,
E_INVALIDARG
,
E_INVALIDARG
,
E_INVALIDARG
};
static
void
test_set_coop
(
LPDIRECTINPUT
pDI
,
HWND
hwnd
)
static
void
test_set_coop
(
LPDIRECTINPUT
pDI
,
HWND
hwnd
)
{
{
HRESULT
hr
;
HRESULT
hr
;
LPDIRECTINPUTDEVICE
pKeyboard
=
NULL
;
LPDIRECTINPUTDEVICE
pKeyboard
=
NULL
;
int
i
;
int
i
;
HWND
child
;
hr
=
IDirectInput_CreateDevice
(
pDI
,
&
GUID_SysKeyboard
,
&
pKeyboard
,
NULL
);
hr
=
IDirectInput_CreateDevice
(
pDI
,
&
GUID_SysKeyboard
,
&
pKeyboard
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"IDirectInput_CreateDevice() failed: %08x
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"IDirectInput_CreateDevice() failed: %08x
\n
"
,
hr
);
...
@@ -127,6 +134,17 @@ static void test_set_coop(LPDIRECTINPUT pDI, HWND hwnd)
...
@@ -127,6 +134,17 @@ static void test_set_coop(LPDIRECTINPUT pDI, HWND hwnd)
ok
(
hr
==
SetCoop_real_window
[
i
],
"SetCooperativeLevel(hwnd, %d): %08x
\n
"
,
i
,
hr
);
ok
(
hr
==
SetCoop_real_window
[
i
],
"SetCooperativeLevel(hwnd, %d): %08x
\n
"
,
i
,
hr
);
}
}
child
=
CreateWindow
(
"static"
,
"Title"
,
WS_CHILD
|
WS_VISIBLE
,
10
,
10
,
50
,
50
,
hwnd
,
NULL
,
NULL
,
NULL
);
ok
(
child
!=
NULL
,
"err: %d
\n
"
,
GetLastError
());
for
(
i
=
0
;
i
<
16
;
i
++
)
{
hr
=
IDirectInputDevice_SetCooperativeLevel
(
pKeyboard
,
child
,
i
);
ok
(
hr
==
SetCoop_child_window
[
i
],
"SetCooperativeLevel(child, %d): %08x
\n
"
,
i
,
hr
);
}
DestroyWindow
(
child
);
if
(
pKeyboard
)
IUnknown_Release
(
pKeyboard
);
if
(
pKeyboard
)
IUnknown_Release
(
pKeyboard
);
}
}
...
...
dlls/dinput/tests/mouse.c
View file @
8c5a4401
...
@@ -42,11 +42,18 @@ static const HRESULT SetCoop_real_window[16] = {
...
@@ -42,11 +42,18 @@ static const HRESULT SetCoop_real_window[16] = {
E_INVALIDARG
,
E_NOTIMPL
,
S_OK
,
E_INVALIDARG
,
E_INVALIDARG
,
E_NOTIMPL
,
S_OK
,
E_INVALIDARG
,
E_INVALIDARG
,
E_INVALIDARG
,
E_INVALIDARG
,
E_INVALIDARG
};
E_INVALIDARG
,
E_INVALIDARG
,
E_INVALIDARG
,
E_INVALIDARG
};
static
const
HRESULT
SetCoop_child_window
[
16
]
=
{
E_INVALIDARG
,
E_INVALIDARG
,
E_INVALIDARG
,
E_INVALIDARG
,
E_INVALIDARG
,
E_HANDLE
,
E_HANDLE
,
E_INVALIDARG
,
E_INVALIDARG
,
E_HANDLE
,
E_HANDLE
,
E_INVALIDARG
,
E_INVALIDARG
,
E_INVALIDARG
,
E_INVALIDARG
,
E_INVALIDARG
};
static
void
test_set_coop
(
LPDIRECTINPUT
pDI
,
HWND
hwnd
)
static
void
test_set_coop
(
LPDIRECTINPUT
pDI
,
HWND
hwnd
)
{
{
HRESULT
hr
;
HRESULT
hr
;
LPDIRECTINPUTDEVICE
pMouse
=
NULL
;
LPDIRECTINPUTDEVICE
pMouse
=
NULL
;
int
i
;
int
i
;
HWND
child
;
hr
=
IDirectInput_CreateDevice
(
pDI
,
&
GUID_SysMouse
,
&
pMouse
,
NULL
);
hr
=
IDirectInput_CreateDevice
(
pDI
,
&
GUID_SysMouse
,
&
pMouse
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"IDirectInput_CreateDevice() failed: %08x
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"IDirectInput_CreateDevice() failed: %08x
\n
"
,
hr
);
...
@@ -63,6 +70,17 @@ static void test_set_coop(LPDIRECTINPUT pDI, HWND hwnd)
...
@@ -63,6 +70,17 @@ static void test_set_coop(LPDIRECTINPUT pDI, HWND hwnd)
ok
(
hr
==
SetCoop_real_window
[
i
],
"SetCooperativeLevel(hwnd, %d): %08x
\n
"
,
i
,
hr
);
ok
(
hr
==
SetCoop_real_window
[
i
],
"SetCooperativeLevel(hwnd, %d): %08x
\n
"
,
i
,
hr
);
}
}
child
=
CreateWindow
(
"static"
,
"Title"
,
WS_CHILD
|
WS_VISIBLE
,
10
,
10
,
50
,
50
,
hwnd
,
NULL
,
NULL
,
NULL
);
ok
(
child
!=
NULL
,
"err: %d
\n
"
,
GetLastError
());
for
(
i
=
0
;
i
<
16
;
i
++
)
{
hr
=
IDirectInputDevice_SetCooperativeLevel
(
pMouse
,
child
,
i
);
ok
(
hr
==
SetCoop_child_window
[
i
],
"SetCooperativeLevel(child, %d): %08x
\n
"
,
i
,
hr
);
}
DestroyWindow
(
child
);
if
(
pMouse
)
IUnknown_Release
(
pMouse
);
if
(
pMouse
)
IUnknown_Release
(
pMouse
);
}
}
...
...
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