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
db678080
Commit
db678080
authored
Oct 16, 2011
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Oct 17, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Add buffer overflow check.
parent
e9399800
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
mouse.c
dlls/dinput/tests/mouse.c
+13
-1
No files found.
dlls/dinput/tests/mouse.c
View file @
db678080
...
...
@@ -75,6 +75,7 @@ static void test_acquire(LPDIRECTINPUT pDI, HWND hwnd)
DIPROPDWORD
di_op
;
DIDEVICEOBJECTDATA
mouse_state
;
DWORD
cnt
;
int
i
;
if
(
!
SetForegroundWindow
(
hwnd
))
{
...
...
@@ -90,7 +91,7 @@ static void test_acquire(LPDIRECTINPUT pDI, HWND hwnd)
ok
(
hr
==
S_OK
,
"SetCooperativeLevel: %08x
\n
"
,
hr
);
memset
(
&
di_op
,
0
,
sizeof
(
di_op
));
di_op
.
dwData
=
20
;
di_op
.
dwData
=
5
;
di_op
.
diph
.
dwHow
=
DIPH_DEVICE
;
di_op
.
diph
.
dwSize
=
sizeof
(
DIPROPDWORD
);
di_op
.
diph
.
dwHeaderSize
=
sizeof
(
DIPROPHEADER
);
...
...
@@ -143,6 +144,17 @@ static void test_acquire(LPDIRECTINPUT pDI, HWND hwnd)
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
);
/* Check for buffer owerflow */
for
(
i
=
0
;
i
<
6
;
i
++
)
mouse_event
(
MOUSEEVENTF_MOVE
,
10
+
i
,
10
+
i
,
0
,
0
);
cnt
=
1
;
hr
=
IDirectInputDevice_GetDeviceData
(
pMouse
,
sizeof
(
mouse_state
),
&
mouse_state
,
&
cnt
,
0
);
ok
(
hr
==
DI_OK
,
"GetDeviceData() failed: %08x cnt:%d
\n
"
,
hr
,
cnt
);
cnt
=
1
;
hr
=
IDirectInputDevice_GetDeviceData
(
pMouse
,
sizeof
(
mouse_state
),
&
mouse_state
,
&
cnt
,
0
);
ok
(
hr
==
DI_OK
&&
cnt
==
1
,
"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