2008-11-10 17:22:35 +01:00
|
|
|
/*
|
|
|
|
* 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 "config.h"
|
|
|
|
#include <assert.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winerror.h"
|
|
|
|
|
2008-11-10 17:32:33 +01:00
|
|
|
#include "xinput.h"
|
|
|
|
|
2008-11-10 17:22:35 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(xinput);
|
|
|
|
|
|
|
|
BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved)
|
|
|
|
{
|
|
|
|
switch(reason)
|
|
|
|
{
|
|
|
|
case DLL_WINE_PREATTACH:
|
|
|
|
return FALSE; /* prefer native version */
|
|
|
|
case DLL_PROCESS_ATTACH:
|
|
|
|
DisableThreadLibraryCalls(inst);
|
|
|
|
break;
|
|
|
|
case DLL_PROCESS_DETACH:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
2008-11-10 17:32:33 +01:00
|
|
|
|
2008-12-28 19:01:24 +01:00
|
|
|
void WINAPI XInputEnable(BOOL enable)
|
|
|
|
{
|
|
|
|
/* Setting to false will stop messages from XInputSetState being sent
|
|
|
|
to the controllers. Setting to true will send the last vibration
|
|
|
|
value (sent to XInputSetState) to the controller and allow messages to
|
|
|
|
be sent */
|
|
|
|
FIXME("(%d) Stub!\n", enable);
|
|
|
|
}
|
|
|
|
|
2008-11-10 17:32:33 +01:00
|
|
|
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;
|
|
|
|
}
|
2008-11-10 17:33:15 +01:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|