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
1a56be85
Commit
1a56be85
authored
Oct 13, 2011
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Oct 14, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Acquire should not reset buffer position.
parent
157528eb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
3 deletions
+30
-3
device.c
dlls/dinput/device.c
+0
-3
mouse.c
dlls/dinput/tests/mouse.c
+30
-0
No files found.
dlls/dinput/device.c
View file @
1a56be85
...
...
@@ -791,10 +791,7 @@ HRESULT WINAPI IDirectInputDevice2WImpl_Acquire(LPDIRECTINPUTDEVICE8W iface)
res
=
This
->
acquired
?
S_FALSE
:
DI_OK
;
This
->
acquired
=
1
;
if
(
res
==
DI_OK
)
{
This
->
queue_head
=
This
->
queue_tail
=
This
->
overflow
=
0
;
check_dinput_hooks
(
iface
);
}
LeaveCriticalSection
(
&
This
->
crit
);
return
res
;
...
...
dlls/dinput/tests/mouse.c
View file @
1a56be85
...
...
@@ -72,6 +72,9 @@ static void test_acquire(LPDIRECTINPUT pDI, HWND hwnd)
LPDIRECTINPUTDEVICE
pMouse
=
NULL
;
DIMOUSESTATE
m_state
;
HWND
hwnd2
;
DIPROPDWORD
di_op
;
DIDEVICEOBJECTDATA
mouse_state
;
DWORD
cnt
;
if
(
!
SetForegroundWindow
(
hwnd
))
{
...
...
@@ -86,6 +89,14 @@ static void test_acquire(LPDIRECTINPUT pDI, HWND hwnd)
hr
=
IDirectInputDevice_SetCooperativeLevel
(
pMouse
,
hwnd
,
DISCL_NONEXCLUSIVE
|
DISCL_FOREGROUND
);
ok
(
hr
==
S_OK
,
"SetCooperativeLevel: %08x
\n
"
,
hr
);
memset
(
&
di_op
,
0
,
sizeof
(
di_op
));
di_op
.
dwData
=
20
;
di_op
.
diph
.
dwHow
=
DIPH_DEVICE
;
di_op
.
diph
.
dwSize
=
sizeof
(
DIPROPDWORD
);
di_op
.
diph
.
dwHeaderSize
=
sizeof
(
DIPROPHEADER
);
hr
=
IDirectInputDevice_SetProperty
(
pMouse
,
DIPROP_BUFFERSIZE
,
(
LPCDIPROPHEADER
)
&
di_op
);
ok
(
hr
==
S_OK
,
"SetProperty() failed: %08x
\n
"
,
hr
);
hr
=
IDirectInputDevice_SetDataFormat
(
pMouse
,
&
c_dfDIMouse
);
ok
(
SUCCEEDED
(
hr
),
"IDirectInputDevice_SetDataFormat() failed: %08x
\n
"
,
hr
);
hr
=
IDirectInputDevice_Unacquire
(
pMouse
);
...
...
@@ -113,6 +124,25 @@ static void test_acquire(LPDIRECTINPUT pDI, HWND hwnd)
hr
=
IDirectInputDevice_Acquire
(
pMouse
);
ok
(
hr
==
S_OK
,
"Acquire() failed: %08x
\n
"
,
hr
);
mouse_event
(
MOUSEEVENTF_MOVE
,
10
,
10
,
0
,
0
);
cnt
=
1
;
hr
=
IDirectInputDevice_GetDeviceData
(
pMouse
,
sizeof
(
mouse_state
),
&
mouse_state
,
&
cnt
,
0
);
ok
(
hr
==
S_OK
&&
cnt
>
0
,
"GetDeviceData() failed: %08x cnt:%d
\n
"
,
hr
,
cnt
);
mouse_event
(
MOUSEEVENTF_MOVE
,
10
,
10
,
0
,
0
);
IDirectInputDevice_Unacquire
(
pMouse
);
cnt
=
1
;
hr
=
IDirectInputDevice_GetDeviceData
(
pMouse
,
sizeof
(
mouse_state
),
&
mouse_state
,
&
cnt
,
0
);
ok
(
hr
==
S_OK
&&
cnt
>
0
,
"GetDeviceData() failed: %08x cnt:%d
\n
"
,
hr
,
cnt
);
IDirectInputDevice_Acquire
(
pMouse
);
mouse_event
(
MOUSEEVENTF_MOVE
,
10
,
10
,
0
,
0
);
IDirectInputDevice_Unacquire
(
pMouse
);
IDirectInputDevice_Acquire
(
pMouse
);
cnt
=
1
;
hr
=
IDirectInputDevice_GetDeviceData
(
pMouse
,
sizeof
(
mouse_state
),
&
mouse_state
,
&
cnt
,
0
);
ok
(
hr
==
S_OK
&&
cnt
>
0
,
"GetDeviceData() failed: %08x cnt:%d
\n
"
,
hr
,
cnt
);
if
(
pMouse
)
IUnknown_Release
(
pMouse
);
DestroyWindow
(
hwnd2
);
...
...
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