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
310859db
Commit
310859db
authored
Nov 26, 2011
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Nov 29, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Add more parameter checking to enum devices.
parent
a84d2fe2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
13 deletions
+14
-13
dinput_main.c
dlls/dinput/dinput_main.c
+8
-3
dinput.c
dlls/dinput/tests/dinput.c
+3
-5
dinput.c
dlls/dinput8/tests/dinput.c
+3
-5
No files found.
dlls/dinput/dinput_main.c
View file @
310859db
...
...
@@ -208,7 +208,8 @@ static void _dump_EnumDevices_dwFlags(DWORD dwFlags) {
FE
(
DIEDFL_ATTACHEDONLY
),
FE
(
DIEDFL_FORCEFEEDBACK
),
FE
(
DIEDFL_INCLUDEALIASES
),
FE
(
DIEDFL_INCLUDEPHANTOMS
)
FE
(
DIEDFL_INCLUDEPHANTOMS
),
FE
(
DIEDFL_INCLUDEHIDDEN
)
#undef FE
};
TRACE
(
" flags: "
);
...
...
@@ -356,7 +357,9 @@ static HRESULT WINAPI IDirectInputAImpl_EnumDevices(
lpCallback
,
pvRef
,
dwFlags
);
_dump_EnumDevices_dwFlags
(
dwFlags
);
if
(
!
lpCallback
)
if
(
!
lpCallback
||
dwFlags
&
~
(
DIEDFL_ATTACHEDONLY
|
DIEDFL_FORCEFEEDBACK
|
DIEDFL_INCLUDEALIASES
|
DIEDFL_INCLUDEPHANTOMS
|
DIEDFL_INCLUDEHIDDEN
)
||
dwDevType
>
4
)
return
DIERR_INVALIDPARAM
;
if
(
!
This
->
initialized
)
...
...
@@ -393,7 +396,9 @@ static HRESULT WINAPI IDirectInputWImpl_EnumDevices(
lpCallback
,
pvRef
,
dwFlags
);
_dump_EnumDevices_dwFlags
(
dwFlags
);
if
(
!
lpCallback
)
if
(
!
lpCallback
||
dwFlags
&
~
(
DIEDFL_ATTACHEDONLY
|
DIEDFL_FORCEFEEDBACK
|
DIEDFL_INCLUDEALIASES
|
DIEDFL_INCLUDEPHANTOMS
|
DIEDFL_INCLUDEHIDDEN
)
||
dwDevType
>
4
)
return
DIERR_INVALIDPARAM
;
if
(
!
This
->
initialized
)
...
...
dlls/dinput/tests/dinput.c
View file @
310859db
...
...
@@ -86,11 +86,11 @@ static void test_preinitialization(void)
{
0
,
NULL
,
0
,
DIERR_INVALIDPARAM
},
{
0
,
NULL
,
~
0u
,
DIERR_INVALIDPARAM
},
{
0
,
dummy_callback
,
0
,
DIERR_NOTINITIALIZED
},
{
0
,
dummy_callback
,
~
0u
,
DIERR_INVALIDPARAM
,
1
},
{
0
,
dummy_callback
,
~
0u
,
DIERR_INVALIDPARAM
},
{
0xdeadbeef
,
NULL
,
0
,
DIERR_INVALIDPARAM
},
{
0xdeadbeef
,
NULL
,
~
0u
,
DIERR_INVALIDPARAM
},
{
0xdeadbeef
,
dummy_callback
,
0
,
DIERR_INVALIDPARAM
,
1
},
{
0xdeadbeef
,
dummy_callback
,
~
0u
,
DIERR_INVALIDPARAM
,
1
},
{
0xdeadbeef
,
dummy_callback
,
0
,
DIERR_INVALIDPARAM
},
{
0xdeadbeef
,
dummy_callback
,
~
0u
,
DIERR_INVALIDPARAM
},
};
IDirectInputA
*
pDI
;
...
...
@@ -434,11 +434,9 @@ static void test_EnumDevices(void)
ok
(
hr
==
DIERR_INVALIDPARAM
,
"IDirectInput_EnumDevices returned 0x%08x
\n
"
,
hr
);
hr
=
IDirectInput_EnumDevices
(
pDI
,
0xdeadbeef
,
enum_devices_callback
,
NULL
,
0
);
todo_wine
ok
(
hr
==
DIERR_INVALIDPARAM
,
"IDirectInput_EnumDevices returned 0x%08x
\n
"
,
hr
);
hr
=
IDirectInput_EnumDevices
(
pDI
,
0xdeadbeef
,
enum_devices_callback
,
NULL
,
~
0u
);
todo_wine
ok
(
hr
==
DIERR_INVALIDPARAM
,
"IDirectInput_EnumDevices returned 0x%08x
\n
"
,
hr
);
enum_test
.
device_count
=
0
;
...
...
dlls/dinput8/tests/dinput.c
View file @
310859db
...
...
@@ -63,11 +63,11 @@ static void test_preinitialization(void)
{
0
,
NULL
,
0
,
DIERR_INVALIDPARAM
},
{
0
,
NULL
,
~
0u
,
DIERR_INVALIDPARAM
},
{
0
,
dummy_callback
,
0
,
DIERR_NOTINITIALIZED
},
{
0
,
dummy_callback
,
~
0u
,
DIERR_INVALIDPARAM
,
1
},
{
0
,
dummy_callback
,
~
0u
,
DIERR_INVALIDPARAM
},
{
0xdeadbeef
,
NULL
,
0
,
DIERR_INVALIDPARAM
},
{
0xdeadbeef
,
NULL
,
~
0u
,
DIERR_INVALIDPARAM
},
{
0xdeadbeef
,
dummy_callback
,
0
,
DIERR_INVALIDPARAM
,
1
},
{
0xdeadbeef
,
dummy_callback
,
~
0u
,
DIERR_INVALIDPARAM
,
1
},
{
0xdeadbeef
,
dummy_callback
,
0
,
DIERR_INVALIDPARAM
},
{
0xdeadbeef
,
dummy_callback
,
~
0u
,
DIERR_INVALIDPARAM
},
};
IDirectInput8A
*
pDI
;
...
...
@@ -404,11 +404,9 @@ static void test_EnumDevices(void)
ok
(
hr
==
DIERR_INVALIDPARAM
,
"IDirectInput8_EnumDevices returned 0x%08x
\n
"
,
hr
);
hr
=
IDirectInput8_EnumDevices
(
pDI
,
0xdeadbeef
,
enum_devices_callback
,
NULL
,
0
);
todo_wine
ok
(
hr
==
DIERR_INVALIDPARAM
,
"IDirectInput8_EnumDevices returned 0x%08x
\n
"
,
hr
);
hr
=
IDirectInput8_EnumDevices
(
pDI
,
0xdeadbeef
,
enum_devices_callback
,
NULL
,
~
0u
);
todo_wine
ok
(
hr
==
DIERR_INVALIDPARAM
,
"IDirectInput8_EnumDevices returned 0x%08x
\n
"
,
hr
);
enum_test
.
device_count
=
0
;
...
...
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