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
0686815f
Commit
0686815f
authored
Sep 23, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Check acquired state in IDirectInputDevice2WImpl_SetCooperativeLevel.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0e757229
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
device.c
dlls/dinput/device.c
+9
-3
hid.c
dlls/dinput8/tests/hid.c
+0
-1
No files found.
dlls/dinput/device.c
View file @
0686815f
...
...
@@ -1118,6 +1118,7 @@ HRESULT WINAPI IDirectInputDevice2WImpl_SetDataFormat(LPDIRECTINPUTDEVICE8W ifac
HRESULT
WINAPI
IDirectInputDevice2WImpl_SetCooperativeLevel
(
LPDIRECTINPUTDEVICE8W
iface
,
HWND
hwnd
,
DWORD
dwflags
)
{
IDirectInputDeviceImpl
*
This
=
impl_from_IDirectInputDevice8W
(
iface
);
HRESULT
hr
;
TRACE
(
"(%p) %p,0x%08x
\n
"
,
This
,
hwnd
,
dwflags
);
_dump_cooperativelevel_DI
(
dwflags
);
...
...
@@ -1144,11 +1145,16 @@ HRESULT WINAPI IDirectInputDevice2WImpl_SetCooperativeLevel(LPDIRECTINPUTDEVICE8
/* Store the window which asks for the mouse */
EnterCriticalSection
(
&
This
->
crit
);
This
->
win
=
hwnd
;
This
->
dwCoopLevel
=
dwflags
;
if
(
This
->
acquired
)
hr
=
DIERR_ACQUIRED
;
else
{
This
->
win
=
hwnd
;
This
->
dwCoopLevel
=
dwflags
;
hr
=
DI_OK
;
}
LeaveCriticalSection
(
&
This
->
crit
);
return
DI_OK
;
return
hr
;
}
/******************************************************************************
...
...
dlls/dinput8/tests/hid.c
View file @
0686815f
...
...
@@ -4082,7 +4082,6 @@ static void test_simple_joystick(void)
hr
=
IDirectInputDevice8_Acquire
(
device
);
ok
(
hr
==
DI_OK
,
"IDirectInputDevice8_Acquire returned: %#x
\n
"
,
hr
);
hr
=
IDirectInputDevice8_SetCooperativeLevel
(
device
,
hwnd
,
DISCL_FOREGROUND
|
DISCL_EXCLUSIVE
);
todo_wine
ok
(
hr
==
DIERR_ACQUIRED
,
"IDirectInputDevice8_SetCooperativeLevel returned: %#x
\n
"
,
hr
);
hr
=
IDirectInputDevice8_Unacquire
(
device
);
ok
(
hr
==
DI_OK
,
"IDirectInputDevice8_Unacquire returned: %#x
\n
"
,
hr
);
...
...
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