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
29789a8e
Commit
29789a8e
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 the function XInputGetState with test case.
parent
85a4a1dd
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
119 additions
and
1 deletion
+119
-1
configure
configure
+9
-0
configure.ac
configure.ac
+1
-0
Makefile.in
dlls/xinput1_3/tests/Makefile.in
+13
-0
xinput.c
dlls/xinput1_3/tests/xinput.c
+81
-0
xinput1_3.spec
dlls/xinput1_3/xinput1_3.spec
+1
-1
xinput1_3_main.c
dlls/xinput1_3/xinput1_3_main.c
+14
-0
No files found.
configure
View file @
29789a8e
...
...
@@ -26858,6 +26858,14 @@ dlls/xinput1_3/Makefile: dlls/xinput1_3/Makefile.in dlls/Makedll.rules"
ac_config_files
=
"
$ac_config_files
dlls/xinput1_3/Makefile"
ALL_MAKEFILES
=
"
$ALL_MAKEFILES
\\
dlls/xinput1_3/tests/Makefile"
test
"x
$enable_xinput1_3_tests
"
!=
xno
&&
ALL_TEST_DIRS
=
"
$ALL_TEST_DIRS
\\
xinput1_3/tests"
ALL_MAKEFILE_DEPENDS
=
"
$ALL_MAKEFILE_DEPENDS
dlls/xinput1_3/tests/Makefile: dlls/xinput1_3/tests/Makefile.in dlls/Maketest.rules"
ac_config_files
=
"
$ac_config_files
dlls/xinput1_3/tests/Makefile"
ALL_MAKEFILES
=
"
$ALL_MAKEFILES
\\
dlls/xinput9_1_0/Makefile"
test
"x
$enable_xinput9_1_0
"
!=
xno
&&
ALL_DLL_DIRS
=
"
$ALL_DLL_DIRS
\\
xinput9_1_0"
...
...
@@ -28400,6 +28408,7 @@ do
"dlls/xinput1_1/Makefile") CONFIG_FILES="
$CONFIG_FILES
dlls/xinput1_1/Makefile" ;;
"dlls/xinput1_2/Makefile") CONFIG_FILES="
$CONFIG_FILES
dlls/xinput1_2/Makefile" ;;
"dlls/xinput1_3/Makefile") CONFIG_FILES="
$CONFIG_FILES
dlls/xinput1_3/Makefile" ;;
"dlls/xinput1_3/tests/Makefile") CONFIG_FILES="
$CONFIG_FILES
dlls/xinput1_3/tests/Makefile" ;;
"dlls/xinput9_1_0/Makefile") CONFIG_FILES="
$CONFIG_FILES
dlls/xinput9_1_0/Makefile" ;;
"documentation/Makefile") CONFIG_FILES="
$CONFIG_FILES
documentation/Makefile" ;;
"fonts/Makefile") CONFIG_FILES="
$CONFIG_FILES
fonts/Makefile" ;;
...
...
configure.ac
View file @
29789a8e
...
...
@@ -2097,6 +2097,7 @@ WINE_CONFIG_MAKEFILE([dlls/wtsapi32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_D
WINE_CONFIG_MAKEFILE([dlls/xinput1_1/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
WINE_CONFIG_MAKEFILE([dlls/xinput1_2/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
WINE_CONFIG_MAKEFILE([dlls/xinput1_3/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
WINE_CONFIG_MAKEFILE([dlls/xinput1_3/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS])
WINE_CONFIG_MAKEFILE([dlls/xinput9_1_0/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
WINE_CONFIG_MAKEFILE([documentation/Makefile],[Make.rules],[],[ALL_TOP_DIRS])
WINE_CONFIG_MAKEFILE([fonts/Makefile],[Make.rules],[],[ALL_TOP_DIRS])
...
...
dlls/xinput1_3/tests/Makefile.in
0 → 100644
View file @
29789a8e
TOPSRCDIR
=
@top_srcdir@
TOPOBJDIR
=
../../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
TESTDLL
=
xinput1_3.dll
IMPORTS
=
user32 kernel32
CTESTS
=
\
xinput.c
@MAKE_TEST_RULES@
@DEPENDENCIES@
# everything below this line is overwritten by make depend
dlls/xinput1_3/tests/xinput.c
0 → 100644
View file @
29789a8e
/*
* The Wine project - Xinput Joystick Library
* Copyright 2008 Andrew Fenn
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <windows.h>
#include <stdio.h>
#include "xinput.h"
#include "wine/test.h"
static
DWORD
(
WINAPI
*
pXInputGetState
)(
DWORD
,
XINPUT_STATE
*
);
static
void
test_get_state
(
void
)
{
XINPUT_STATE
controllerState
;
DWORD
controllerNum
;
DWORD
result
;
for
(
controllerNum
=
0
;
controllerNum
<
XUSER_MAX_COUNT
;
controllerNum
++
)
{
ZeroMemory
(
&
controllerState
,
sizeof
(
XINPUT_STATE
));
result
=
pXInputGetState
(
controllerNum
,
&
controllerState
);
ok
(
result
==
ERROR_SUCCESS
||
result
==
ERROR_DEVICE_NOT_CONNECTED
,
"XInputGetState failed with (%d)
\n
"
,
result
);
if
(
ERROR_DEVICE_NOT_CONNECTED
==
result
)
{
skip
(
"Controller %d is not connected
\n
"
,
controllerNum
);
}
else
{
trace
(
"-- Results for controller %d --
\n
"
,
controllerNum
);
trace
(
"XInputGetState: %d
\n
"
,
result
);
trace
(
"State->dwPacketNumber: %d
\n
"
,
controllerState
.
dwPacketNumber
);
trace
(
"Gamepad Variables --
\n
"
);
trace
(
"Gamepad.wButtons: %#x
\n
"
,
controllerState
.
Gamepad
.
wButtons
);
trace
(
"Gamepad.bLeftTrigger: 0x%08x
\n
"
,
controllerState
.
Gamepad
.
bLeftTrigger
);
trace
(
"Gamepad.bRightTrigger: 0x%08x
\n
"
,
controllerState
.
Gamepad
.
bRightTrigger
);
trace
(
"Gamepad.sThumbLX: %d
\n
"
,
controllerState
.
Gamepad
.
sThumbLX
);
trace
(
"Gamepad.sThumbLY: %d
\n
"
,
controllerState
.
Gamepad
.
sThumbLY
);
trace
(
"Gamepad.sThumbRX: %d
\n
"
,
controllerState
.
Gamepad
.
sThumbRX
);
trace
(
"Gamepad.sThumbRY: %d
\n
"
,
controllerState
.
Gamepad
.
sThumbRY
);
}
}
ZeroMemory
(
&
controllerState
,
sizeof
(
XINPUT_STATE
));
result
=
pXInputGetState
(
XUSER_MAX_COUNT
+
1
,
&
controllerState
);
ok
(
result
==
ERROR_BAD_ARGUMENTS
,
"XInputGetState returned (%d)
\n
"
,
result
);
}
START_TEST
(
xinput
)
{
HMODULE
hXinput
;
hXinput
=
LoadLibraryA
(
"xinput1_3.dll"
);
if
(
hXinput
)
{
pXInputGetState
=
(
void
*
)
GetProcAddress
(
hXinput
,
"XInputGetState"
);
test_get_state
();
}
else
{
skip
(
"Could not load xinput1_3.dll
\n
"
);
}
}
dlls/xinput1_3/xinput1_3.spec
View file @
29789a8e
@ stub XInputEnable #(long)
@ stub XInputSetState #(long ptr)
@ st
ub XInputGetState #
(long ptr)
@ st
dcall XInputGetState
(long ptr)
@ stub XInputGetKeystroke #(long long ptr)
@ stub XInputGetCapabilities #(long long ptr)
@ stub XInputGetDSoundAudioDeviceGuids #(long ptr ptr)
...
...
dlls/xinput1_3/xinput1_3_main.c
View file @
29789a8e
...
...
@@ -27,6 +27,8 @@
#include "winbase.h"
#include "winerror.h"
#include "xinput.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
xinput
);
BOOL
WINAPI
DllMain
(
HINSTANCE
inst
,
DWORD
reason
,
LPVOID
reserved
)
...
...
@@ -43,3 +45,15 @@ BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved)
}
return
TRUE
;
}
DWORD
WINAPI
XInputGetState
(
DWORD
dwUserIndex
,
XINPUT_STATE
*
pState
)
{
FIXME
(
"(%u %p)
\n
"
,
dwUserIndex
,
pState
);
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