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
611ebb53
Commit
611ebb53
authored
Nov 10, 2008
by
Andrew Fenn
Committed by
Alexandre Julliard
Nov 11, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xinput: Added XInputGetCapabilities function with test case.
parent
29789a8e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
1 deletion
+40
-1
xinput.c
dlls/xinput1_3/tests/xinput.c
+27
-0
xinput1_3.spec
dlls/xinput1_3/xinput1_3.spec
+1
-1
xinput1_3_main.c
dlls/xinput1_3/xinput1_3_main.c
+12
-0
No files found.
dlls/xinput1_3/tests/xinput.c
View file @
611ebb53
...
...
@@ -24,6 +24,7 @@
#include "wine/test.h"
static
DWORD
(
WINAPI
*
pXInputGetState
)(
DWORD
,
XINPUT_STATE
*
);
static
DWORD
(
WINAPI
*
pXInputGetCapabilities
)(
DWORD
,
DWORD
,
XINPUT_CAPABILITIES
*
);
static
void
test_get_state
(
void
)
{
...
...
@@ -64,6 +65,30 @@ static void test_get_state(void)
ok
(
result
==
ERROR_BAD_ARGUMENTS
,
"XInputGetState returned (%d)
\n
"
,
result
);
}
static
void
test_get_capabilities
(
void
)
{
XINPUT_CAPABILITIES
capabilities
;
DWORD
controllerNum
;
DWORD
result
;
for
(
controllerNum
=
0
;
controllerNum
<
XUSER_MAX_COUNT
;
controllerNum
++
)
{
ZeroMemory
(
&
capabilities
,
sizeof
(
XINPUT_CAPABILITIES
));
result
=
pXInputGetCapabilities
(
controllerNum
,
XINPUT_FLAG_GAMEPAD
,
&
capabilities
);
ok
(
result
==
ERROR_SUCCESS
||
result
==
ERROR_DEVICE_NOT_CONNECTED
,
"XInputGetCapabilities failed with (%d)
\n
"
,
result
);
if
(
ERROR_DEVICE_NOT_CONNECTED
==
result
)
{
skip
(
"Controller %d is not connected
\n
"
,
controllerNum
);
}
}
ZeroMemory
(
&
capabilities
,
sizeof
(
XINPUT_CAPABILITIES
));
result
=
pXInputGetCapabilities
(
XUSER_MAX_COUNT
+
1
,
XINPUT_FLAG_GAMEPAD
,
&
capabilities
);
ok
(
result
==
ERROR_BAD_ARGUMENTS
,
"XInputGetCapabilities returned (%d)
\n
"
,
result
);
}
START_TEST
(
xinput
)
{
HMODULE
hXinput
;
...
...
@@ -72,7 +97,9 @@ START_TEST(xinput)
if
(
hXinput
)
{
pXInputGetState
=
(
void
*
)
GetProcAddress
(
hXinput
,
"XInputGetState"
);
pXInputGetCapabilities
=
(
void
*
)
GetProcAddress
(
hXinput
,
"XInputGetCapabilities"
);
test_get_state
();
test_get_capabilities
();
}
else
{
...
...
dlls/xinput1_3/xinput1_3.spec
View file @
611ebb53
...
...
@@ -2,6 +2,6 @@
@ stub XInputSetState #(long ptr)
@ stdcall XInputGetState(long ptr)
@ stub XInputGetKeystroke #(long long ptr)
@ st
ub XInputGetCapabilities #
(long long ptr)
@ st
dcall XInputGetCapabilities
(long long ptr)
@ stub XInputGetDSoundAudioDeviceGuids #(long ptr ptr)
@ stub XInputGetBatteryInformation
dlls/xinput1_3/xinput1_3_main.c
View file @
611ebb53
...
...
@@ -57,3 +57,15 @@ DWORD WINAPI XInputGetState(DWORD dwUserIndex, XINPUT_STATE* pState)
}
return
ERROR_BAD_ARGUMENTS
;
}
DWORD
WINAPI
XInputGetCapabilities
(
DWORD
dwUserIndex
,
DWORD
dwFlags
,
XINPUT_CAPABILITIES
*
pCapabilities
)
{
FIXME
(
"(%d %d %p)
\n
"
,
dwUserIndex
,
dwFlags
,
pCapabilities
);
if
(
dwUserIndex
<
XUSER_MAX_COUNT
)
{
return
ERROR_DEVICE_NOT_CONNECTED
;
/* If controller exists then return ERROR_SUCCESS */
}
return
ERROR_BAD_ARGUMENTS
;
}
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