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
e0ba6d8f
Commit
e0ba6d8f
authored
May 26, 2015
by
Bruno Jesus
Committed by
Alexandre Julliard
May 27, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Set the expected errors in GetRawInputDeviceList.
parent
530d269e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
7 deletions
+20
-7
input.c
dlls/user32/input.c
+12
-1
input.c
dlls/user32/tests/input.c
+8
-6
No files found.
dlls/user32/input.c
View file @
e0ba6d8f
...
...
@@ -496,7 +496,17 @@ UINT WINAPI GetRawInputDeviceList(RAWINPUTDEVICELIST *devices, UINT *device_coun
{
TRACE
(
"devices %p, device_count %p, size %u.
\n
"
,
devices
,
device_count
,
size
);
if
(
size
!=
sizeof
(
*
devices
)
||
!
device_count
)
return
~
0U
;
if
(
size
!=
sizeof
(
*
devices
))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
~
0U
;
}
if
(
!
device_count
)
{
SetLastError
(
ERROR_NOACCESS
);
return
~
0U
;
}
if
(
!
devices
)
{
...
...
@@ -506,6 +516,7 @@ UINT WINAPI GetRawInputDeviceList(RAWINPUTDEVICELIST *devices, UINT *device_coun
if
(
*
device_count
<
2
)
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
*
device_count
=
2
;
return
~
0U
;
}
...
...
dlls/user32/tests/input.c
View file @
e0ba6d8f
...
...
@@ -1491,21 +1491,19 @@ static void test_GetMouseMovePointsEx(void)
static
void
test_GetRawInputDeviceList
(
void
)
{
RAWINPUTDEVICELIST
devices
[
32
];
UINT
ret
,
devcount
,
odevcount
;
UINT
ret
,
oret
,
devcount
,
odevcount
;
DWORD
err
;
SetLastError
(
0xdeadbeef
);
ret
=
pGetRawInputDeviceList
(
NULL
,
NULL
,
0
);
err
=
GetLastError
();
ok
(
ret
==
-
1
,
"expected -1, got %d
\n
"
,
ret
);
todo_wine
ok
(
err
==
ERROR_INVALID_PARAMETER
,
"expected 87, got %d
\n
"
,
err
);
SetLastError
(
0xdeadbeef
);
ret
=
pGetRawInputDeviceList
(
NULL
,
NULL
,
sizeof
(
devices
[
0
]));
err
=
GetLastError
();
ok
(
ret
==
-
1
,
"expected -1, got %d
\n
"
,
ret
);
todo_wine
ok
(
err
==
ERROR_NOACCESS
,
"expected 998, got %d
\n
"
,
err
);
devcount
=
0
;
...
...
@@ -1518,19 +1516,23 @@ todo_wine
ret
=
pGetRawInputDeviceList
(
devices
,
&
devcount
,
sizeof
(
devices
[
0
]));
err
=
GetLastError
();
ok
(
ret
==
-
1
,
"expected -1, got %d
\n
"
,
ret
);
todo_wine
ok
(
err
==
ERROR_INSUFFICIENT_BUFFER
,
"expected 122, got %d
\n
"
,
err
);
ok
(
devcount
>
0
,
"expected non-zero
\n
"
);
/* devcount contain now the correct number of devices */
/* devcount contain
s
now the correct number of devices */
ret
=
pGetRawInputDeviceList
(
devices
,
&
devcount
,
sizeof
(
devices
[
0
]));
ok
(
ret
>
0
,
"expected non-zero
\n
"
);
/* check if variable changes from larger to smaller value */
devcount
=
odevcount
=
sizeof
(
devices
)
/
sizeof
(
devices
[
0
]);
ret
=
pGetRawInputDeviceList
(
devices
,
&
odevcount
,
sizeof
(
devices
[
0
]));
oret
=
ret
=
pGetRawInputDeviceList
(
devices
,
&
odevcount
,
sizeof
(
devices
[
0
]));
ok
(
ret
>
0
,
"expected non-zero
\n
"
);
ok
(
devcount
==
odevcount
,
"expected %d, got %d
\n
"
,
devcount
,
odevcount
);
devcount
=
odevcount
;
odevcount
=
sizeof
(
devices
)
/
sizeof
(
devices
[
0
]);
ret
=
pGetRawInputDeviceList
(
NULL
,
&
odevcount
,
sizeof
(
devices
[
0
]));
ok
(
ret
==
0
,
"expected 0, got %d
\n
"
,
ret
);
ok
(
odevcount
==
oret
,
"expected %d, got %d
\n
"
,
oret
,
odevcount
);
}
static
void
test_key_map
(
void
)
...
...
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