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
f097399a
Commit
f097399a
authored
Aug 31, 2016
by
Bruno Jesus
Committed by
Alexandre Julliard
Sep 01, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xinput1_3: Better handle input parameters.
Signed-off-by:
Bruno Jesus
<
00cpxxx@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
309fed23
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
30 deletions
+35
-30
xinput1_3_main.c
dlls/xinput1_3/xinput1_3_main.c
+35
-30
No files found.
dlls/xinput1_3/xinput1_3_main.c
View file @
f097399a
...
...
@@ -31,6 +31,11 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
xinput
);
struct
{
BOOL
connected
;
}
controllers
[
XUSER_MAX_COUNT
];
BOOL
WINAPI
DllMain
(
HINSTANCE
inst
,
DWORD
reason
,
LPVOID
reserved
)
{
switch
(
reason
)
...
...
@@ -57,12 +62,12 @@ DWORD WINAPI XInputSetState(DWORD index, XINPUT_VIBRATION* vibration)
{
FIXME
(
"(index %u, vibration %p) Stub!
\n
"
,
index
,
vibration
);
if
(
index
<
XUSER_MAX_COUNT
)
{
return
ERROR_DEVICE_NOT_CONNECTED
;
/* If controller exists then return ERROR_SUCCESS */
}
if
(
index
>=
XUSER_MAX_COUNT
)
return
ERROR_BAD_ARGUMENTS
;
if
(
!
controllers
[
index
].
connected
)
return
ERROR_DEVICE_NOT_CONNECTED
;
return
ERROR_NOT_SUPPORTED
;
}
DWORD
WINAPI
DECLSPEC_HOTPATCH
XInputGetState
(
DWORD
index
,
XINPUT_STATE
*
state
)
...
...
@@ -72,24 +77,24 @@ DWORD WINAPI DECLSPEC_HOTPATCH XInputGetState(DWORD index, XINPUT_STATE* state)
if
(
!
warn_once
++
)
FIXME
(
"(index %u, state %p) Stub!
\n
"
,
index
,
state
);
if
(
index
<
XUSER_MAX_COUNT
)
{
return
ERROR_DEVICE_NOT_CONNECTED
;
/* If controller exists then return ERROR_SUCCESS */
}
if
(
index
>=
XUSER_MAX_COUNT
)
return
ERROR_BAD_ARGUMENTS
;
if
(
!
controllers
[
index
].
connected
)
return
ERROR_DEVICE_NOT_CONNECTED
;
return
ERROR_NOT_SUPPORTED
;
}
DWORD
WINAPI
XInputGetKeystroke
(
DWORD
index
,
DWORD
reserved
,
PXINPUT_KEYSTROKE
keystroke
)
{
FIXME
(
"(index %u, reserved %u, keystroke %p) Stub!
\n
"
,
index
,
reserved
,
keystroke
);
if
(
index
<
XUSER_MAX_COUNT
)
{
return
ERROR_DEVICE_NOT_CONNECTED
;
/* If controller exists then return ERROR_SUCCESS */
}
if
(
index
>=
XUSER_MAX_COUNT
)
return
ERROR_BAD_ARGUMENTS
;
if
(
!
controllers
[
index
].
connected
)
return
ERROR_DEVICE_NOT_CONNECTED
;
return
ERROR_NOT_SUPPORTED
;
}
DWORD
WINAPI
XInputGetCapabilities
(
DWORD
index
,
DWORD
flags
,
XINPUT_CAPABILITIES
*
capabilities
)
...
...
@@ -99,34 +104,34 @@ DWORD WINAPI XInputGetCapabilities(DWORD index, DWORD flags, XINPUT_CAPABILITIES
if
(
!
warn_once
++
)
FIXME
(
"(index %u, flags 0x%x, capabilities %p) Stub!
\n
"
,
index
,
flags
,
capabilities
);
if
(
index
<
XUSER_MAX_COUNT
)
{
return
ERROR_DEVICE_NOT_CONNECTED
;
/* If controller exists then return ERROR_SUCCESS */
}
if
(
index
>=
XUSER_MAX_COUNT
)
return
ERROR_BAD_ARGUMENTS
;
if
(
!
controllers
[
index
].
connected
)
return
ERROR_DEVICE_NOT_CONNECTED
;
return
ERROR_NOT_SUPPORTED
;
}
DWORD
WINAPI
XInputGetDSoundAudioDeviceGuids
(
DWORD
index
,
GUID
*
render_guid
,
GUID
*
capture_guid
)
{
FIXME
(
"(index %u, render guid %p, capture guid %p) Stub!
\n
"
,
index
,
render_guid
,
capture_guid
);
if
(
index
<
XUSER_MAX_COUNT
)
{
return
ERROR_DEVICE_NOT_CONNECTED
;
/* If controller exists then return ERROR_SUCCESS */
}
if
(
index
>=
XUSER_MAX_COUNT
)
return
ERROR_BAD_ARGUMENTS
;
if
(
!
controllers
[
index
].
connected
)
return
ERROR_DEVICE_NOT_CONNECTED
;
return
ERROR_NOT_SUPPORTED
;
}
DWORD
WINAPI
XInputGetBatteryInformation
(
DWORD
index
,
BYTE
type
,
XINPUT_BATTERY_INFORMATION
*
battery
)
{
FIXME
(
"(index %u, type %u, battery %p) Stub!
\n
"
,
index
,
type
,
battery
);
if
(
index
<
XUSER_MAX_COUNT
)
{
return
ERROR_DEVICE_NOT_CONNECTED
;
/* If controller exists then return ERROR_SUCCESS */
}
if
(
index
>=
XUSER_MAX_COUNT
)
return
ERROR_BAD_ARGUMENTS
;
if
(
!
controllers
[
index
].
connected
)
return
ERROR_DEVICE_NOT_CONNECTED
;
return
ERROR_NOT_SUPPORTED
;
}
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