ReactOS  0.4.14-dev-606-g14ebc0b
dinput_main.c File Reference
#include <assert.h>
#include <stdarg.h>
#include <string.h>
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/unicode.h"
#include "wine/asm.h"
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winerror.h"
#include "objbase.h"
#include "rpcproxy.h"
#include "initguid.h"
#include "devguid.h"
#include "dinput_private.h"
#include "device_private.h"
#include "dinputd.h"
Include dependency graph for dinput_main.c:

Go to the source code of this file.

Classes

struct  IClassFactoryImpl
 

Macros

#define COBJMACROS
 
#define NONAMELESSUNION
 
#define FE(x)   { x, #x}
 
#define enum_callback_wrapper(callback, instance, ref)   (callback)((instance), (ref))
 
#define X(x)   if (dwFlags & x) FIXME("\tdwFlags |= "#x"\n");
 
#define X(x)   if (flags & x) FIXME("\tflags |= "#x"\n");
 

Enumerations

enum  directinput_versions {
  DIRECTINPUT_VERSION_300 = 0x0300, DIRECTINPUT_VERSION_500 = 0x0500, DIRECTINPUT_VERSION_50A = 0x050A, DIRECTINPUT_VERSION_5B2 = 0x05B2,
  DIRECTINPUT_VERSION_602 = 0x0602, DIRECTINPUT_VERSION_61A = 0x061A, DIRECTINPUT_VERSION_700 = 0x0700, DIRECTINPUT_VERSION_300 = 0x0300,
  DIRECTINPUT_VERSION_500 = 0x0500, DIRECTINPUT_VERSION_50A = 0x050A, DIRECTINPUT_VERSION_5B2 = 0x05B2, DIRECTINPUT_VERSION_602 = 0x0602,
  DIRECTINPUT_VERSION_61A = 0x061A, DIRECTINPUT_VERSION_700 = 0x0700
}
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (dinput)
 
static IDirectInputImplimpl_from_IDirectInput7A (IDirectInput7A *iface)
 
static IDirectInputImplimpl_from_IDirectInput7W (IDirectInput7W *iface)
 
static IDirectInputImplimpl_from_IDirectInput8A (IDirectInput8A *iface)
 
static IDirectInputImplimpl_from_IDirectInput8W (IDirectInput8W *iface)
 
static IDirectInputDeviceImplimpl_from_IDirectInputDevice8W (IDirectInputDevice8W *iface)
 
static BOOL check_hook_thread (void)
 
static HRESULT initialize_directinput_instance (IDirectInputImpl *This, DWORD dwVersion)
 
static void uninitialize_directinput_instance (IDirectInputImpl *This)
 
static HRESULT create_directinput_instance (REFIID riid, LPVOID *ppDI, IDirectInputImpl **out)
 
HRESULT WINAPI DirectInputCreateEx (HINSTANCE hinst, DWORD dwVersion, REFIID riid, LPVOID *ppDI, LPUNKNOWN punkOuter)
 
HRESULT WINAPI DECLSPEC_HOTPATCH DirectInput8Create (HINSTANCE hinst, DWORD version, REFIID iid, void **out, IUnknown *outer)
 
HRESULT WINAPI DECLSPEC_HOTPATCH DirectInputCreateA (HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUTA *ppDI, LPUNKNOWN punkOuter)
 
HRESULT WINAPI DECLSPEC_HOTPATCH DirectInputCreateW (HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUTW *ppDI, LPUNKNOWN punkOuter)
 
static const char_dump_DIDEVTYPE_value (DWORD dwDevType, DWORD dwVersion)
 
static void _dump_EnumDevices_dwFlags (DWORD dwFlags)
 
static const chardump_semantic (DWORD semantic)
 
static void _dump_diactionformatA (LPDIACTIONFORMATA lpdiActionFormat)
 
void _copy_diactionformatAtoW (LPDIACTIONFORMATW to, LPDIACTIONFORMATA from)
 
void _copy_diactionformatWtoA (LPDIACTIONFORMATA to, LPDIACTIONFORMATW from)
 
static DWORD diactionformat_priorityA (LPDIACTIONFORMATA lpdiaf, DWORD genre)
 
static DWORD diactionformat_priorityW (LPDIACTIONFORMATW lpdiaf, DWORD genre)
 
static HRESULT WINAPI IDirectInputAImpl_EnumDevices (LPDIRECTINPUT7A iface, DWORD dwDevType, LPDIENUMDEVICESCALLBACKA lpCallback, LPVOID pvRef, DWORD dwFlags)
 
static HRESULT WINAPI IDirectInputWImpl_EnumDevices (LPDIRECTINPUT7W iface, DWORD dwDevType, LPDIENUMDEVICESCALLBACKW lpCallback, LPVOID pvRef, DWORD dwFlags)
 
static ULONG WINAPI IDirectInputAImpl_AddRef (LPDIRECTINPUT7A iface)
 
static ULONG WINAPI IDirectInputWImpl_AddRef (LPDIRECTINPUT7W iface)
 
static ULONG WINAPI IDirectInputAImpl_Release (LPDIRECTINPUT7A iface)
 
static ULONG WINAPI IDirectInputWImpl_Release (LPDIRECTINPUT7W iface)
 
static HRESULT WINAPI IDirectInputAImpl_QueryInterface (LPDIRECTINPUT7A iface, REFIID riid, LPVOID *ppobj)
 
static HRESULT WINAPI IDirectInputWImpl_QueryInterface (LPDIRECTINPUT7W iface, REFIID riid, LPVOID *ppobj)
 
static HRESULT WINAPI IDirectInputAImpl_Initialize (LPDIRECTINPUT7A iface, HINSTANCE hinst, DWORD version)
 
static HRESULT WINAPI IDirectInputWImpl_Initialize (LPDIRECTINPUT7W iface, HINSTANCE hinst, DWORD x)
 
static HRESULT WINAPI IDirectInputAImpl_GetDeviceStatus (LPDIRECTINPUT7A iface, REFGUID rguid)
 
static HRESULT WINAPI IDirectInputWImpl_GetDeviceStatus (LPDIRECTINPUT7W iface, REFGUID rguid)
 
static HRESULT WINAPI IDirectInputAImpl_RunControlPanel (LPDIRECTINPUT7A iface, HWND hwndOwner, DWORD dwFlags)
 
static HRESULT WINAPI IDirectInputWImpl_RunControlPanel (LPDIRECTINPUT7W iface, HWND hwndOwner, DWORD dwFlags)
 
static HRESULT WINAPI IDirectInput2AImpl_FindDevice (LPDIRECTINPUT7A iface, REFGUID rguid, LPCSTR pszName, LPGUID pguidInstance)
 
static HRESULT WINAPI IDirectInput2WImpl_FindDevice (LPDIRECTINPUT7W iface, REFGUID rguid, LPCWSTR pszName, LPGUID pguidInstance)
 
static HRESULT create_device (IDirectInputImpl *This, REFGUID rguid, REFIID riid, LPVOID *pvOut, BOOL unicode)
 
static HRESULT WINAPI IDirectInput7AImpl_CreateDeviceEx (LPDIRECTINPUT7A iface, REFGUID rguid, REFIID riid, LPVOID *pvOut, LPUNKNOWN lpUnknownOuter)
 
static HRESULT WINAPI IDirectInput7WImpl_CreateDeviceEx (LPDIRECTINPUT7W iface, REFGUID rguid, REFIID riid, LPVOID *pvOut, LPUNKNOWN lpUnknownOuter)
 
static HRESULT WINAPI IDirectInputAImpl_CreateDevice (LPDIRECTINPUT7A iface, REFGUID rguid, LPDIRECTINPUTDEVICEA *pdev, LPUNKNOWN punk)
 
static HRESULT WINAPI IDirectInputWImpl_CreateDevice (LPDIRECTINPUT7W iface, REFGUID rguid, LPDIRECTINPUTDEVICEW *pdev, LPUNKNOWN punk)
 
static ULONG WINAPI IDirectInput8AImpl_AddRef (LPDIRECTINPUT8A iface)
 
static ULONG WINAPI IDirectInput8WImpl_AddRef (LPDIRECTINPUT8W iface)
 
static HRESULT WINAPI IDirectInput8AImpl_QueryInterface (LPDIRECTINPUT8A iface, REFIID riid, LPVOID *ppobj)
 
static HRESULT WINAPI IDirectInput8WImpl_QueryInterface (LPDIRECTINPUT8W iface, REFIID riid, LPVOID *ppobj)
 
static ULONG WINAPI IDirectInput8AImpl_Release (LPDIRECTINPUT8A iface)
 
static ULONG WINAPI IDirectInput8WImpl_Release (LPDIRECTINPUT8W iface)
 
static HRESULT WINAPI IDirectInput8AImpl_CreateDevice (LPDIRECTINPUT8A iface, REFGUID rguid, LPDIRECTINPUTDEVICE8A *pdev, LPUNKNOWN punk)
 
static HRESULT WINAPI IDirectInput8WImpl_CreateDevice (LPDIRECTINPUT8W iface, REFGUID rguid, LPDIRECTINPUTDEVICE8W *pdev, LPUNKNOWN punk)
 
static HRESULT WINAPI IDirectInput8AImpl_EnumDevices (LPDIRECTINPUT8A iface, DWORD dwDevType, LPDIENUMDEVICESCALLBACKA lpCallback, LPVOID pvRef, DWORD dwFlags)
 
static HRESULT WINAPI IDirectInput8WImpl_EnumDevices (LPDIRECTINPUT8W iface, DWORD dwDevType, LPDIENUMDEVICESCALLBACKW lpCallback, LPVOID pvRef, DWORD dwFlags)
 
static HRESULT WINAPI IDirectInput8AImpl_GetDeviceStatus (LPDIRECTINPUT8A iface, REFGUID rguid)
 
static HRESULT WINAPI IDirectInput8WImpl_GetDeviceStatus (LPDIRECTINPUT8W iface, REFGUID rguid)
 
static HRESULT WINAPI IDirectInput8AImpl_RunControlPanel (LPDIRECTINPUT8A iface, HWND hwndOwner, DWORD dwFlags)
 
static HRESULT WINAPI IDirectInput8WImpl_RunControlPanel (LPDIRECTINPUT8W iface, HWND hwndOwner, DWORD dwFlags)
 
static HRESULT WINAPI IDirectInput8AImpl_Initialize (LPDIRECTINPUT8A iface, HINSTANCE hinst, DWORD version)
 
static HRESULT WINAPI IDirectInput8WImpl_Initialize (LPDIRECTINPUT8W iface, HINSTANCE hinst, DWORD version)
 
static HRESULT WINAPI IDirectInput8AImpl_FindDevice (LPDIRECTINPUT8A iface, REFGUID rguid, LPCSTR pszName, LPGUID pguidInstance)
 
static HRESULT WINAPI IDirectInput8WImpl_FindDevice (LPDIRECTINPUT8W iface, REFGUID rguid, LPCWSTR pszName, LPGUID pguidInstance)
 
static BOOL should_enumerate_device (const WCHAR *username, DWORD dwFlags, struct list *device_players, REFGUID guid)
 
static HRESULT WINAPI IDirectInput8AImpl_EnumDevicesBySemantics (LPDIRECTINPUT8A iface, LPCSTR ptszUserName, LPDIACTIONFORMATA lpdiActionFormat, LPDIENUMDEVICESBYSEMANTICSCBA lpCallback, LPVOID pvRef, DWORD dwFlags)
 
static HRESULT WINAPI IDirectInput8WImpl_EnumDevicesBySemantics (LPDIRECTINPUT8W iface, LPCWSTR ptszUserName, LPDIACTIONFORMATW lpdiActionFormat, LPDIENUMDEVICESBYSEMANTICSCBW lpCallback, LPVOID pvRef, DWORD dwFlags)
 
static HRESULT WINAPI IDirectInput8WImpl_ConfigureDevices (LPDIRECTINPUT8W iface, LPDICONFIGUREDEVICESCALLBACK lpdiCallback, LPDICONFIGUREDEVICESPARAMSW lpdiCDParams, DWORD dwFlags, LPVOID pvRefData)
 
static HRESULT WINAPI IDirectInput8AImpl_ConfigureDevices (LPDIRECTINPUT8A iface, LPDICONFIGUREDEVICESCALLBACK lpdiCallback, LPDICONFIGUREDEVICESPARAMSA lpdiCDParams, DWORD dwFlags, LPVOID pvRefData)
 
static IDirectInputImplimpl_from_IDirectInputJoyConfig8 (IDirectInputJoyConfig8 *iface)
 
static HRESULT WINAPI JoyConfig8Impl_QueryInterface (IDirectInputJoyConfig8 *iface, REFIID riid, void **ppobj)
 
static ULONG WINAPI JoyConfig8Impl_AddRef (IDirectInputJoyConfig8 *iface)
 
static ULONG WINAPI JoyConfig8Impl_Release (IDirectInputJoyConfig8 *iface)
 
static HRESULT WINAPI JoyConfig8Impl_Acquire (IDirectInputJoyConfig8 *iface)
 
static HRESULT WINAPI JoyConfig8Impl_Unacquire (IDirectInputJoyConfig8 *iface)
 
static HRESULT WINAPI JoyConfig8Impl_SetCooperativeLevel (IDirectInputJoyConfig8 *iface, HWND hwnd, DWORD flags)
 
static HRESULT WINAPI JoyConfig8Impl_SendNotify (IDirectInputJoyConfig8 *iface)
 
static HRESULT WINAPI JoyConfig8Impl_EnumTypes (IDirectInputJoyConfig8 *iface, LPDIJOYTYPECALLBACK cb, void *ref)
 
static HRESULT WINAPI JoyConfig8Impl_GetTypeInfo (IDirectInputJoyConfig8 *iface, LPCWSTR name, LPDIJOYTYPEINFO info, DWORD flags)
 
static HRESULT WINAPI JoyConfig8Impl_SetTypeInfo (IDirectInputJoyConfig8 *iface, LPCWSTR name, LPCDIJOYTYPEINFO info, DWORD flags, LPWSTR new_name)
 
static HRESULT WINAPI JoyConfig8Impl_DeleteType (IDirectInputJoyConfig8 *iface, LPCWSTR name)
 
static HRESULT WINAPI JoyConfig8Impl_GetConfig (IDirectInputJoyConfig8 *iface, UINT id, LPDIJOYCONFIG info, DWORD flags)
 
static HRESULT WINAPI JoyConfig8Impl_SetConfig (IDirectInputJoyConfig8 *iface, UINT id, LPCDIJOYCONFIG info, DWORD flags)
 
static HRESULT WINAPI JoyConfig8Impl_DeleteConfig (IDirectInputJoyConfig8 *iface, UINT id)
 
static HRESULT WINAPI JoyConfig8Impl_GetUserValues (IDirectInputJoyConfig8 *iface, LPDIJOYUSERVALUES info, DWORD flags)
 
static HRESULT WINAPI JoyConfig8Impl_SetUserValues (IDirectInputJoyConfig8 *iface, LPCDIJOYUSERVALUES info, DWORD flags)
 
static HRESULT WINAPI JoyConfig8Impl_AddNewHardware (IDirectInputJoyConfig8 *iface, HWND hwnd, REFGUID guid)
 
static HRESULT WINAPI JoyConfig8Impl_OpenTypeKey (IDirectInputJoyConfig8 *iface, LPCWSTR name, DWORD security, PHKEY key)
 
static HRESULT WINAPI JoyConfig8Impl_OpenAppStatusKey (IDirectInputJoyConfig8 *iface, PHKEY key)
 
static IClassFactoryImplimpl_from_IClassFactory (IClassFactory *iface)
 
static HRESULT WINAPI DICF_QueryInterface (LPCLASSFACTORY iface, REFIID riid, LPVOID *ppobj)
 
static ULONG WINAPI DICF_AddRef (LPCLASSFACTORY iface)
 
static ULONG WINAPI DICF_Release (LPCLASSFACTORY iface)
 
static HRESULT WINAPI DICF_CreateInstance (LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
 
static HRESULT WINAPI DICF_LockServer (LPCLASSFACTORY iface, BOOL dolock)
 
HRESULT WINAPI DllCanUnloadNow (void)
 
HRESULT WINAPI DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI DllRegisterServer (void)
 
HRESULT WINAPI DllUnregisterServer (void)
 
static LRESULT CALLBACK LL_hook_proc (int code, WPARAM wparam, LPARAM lparam)
 
static LRESULT CALLBACK callwndproc_proc (int code, WPARAM wparam, LPARAM lparam)
 
static DWORD WINAPI hook_thread_proc (void *param)
 
void check_dinput_hooks (LPDIRECTINPUTDEVICE8W iface, BOOL acquired)
 
void check_dinput_events (void)
 
BOOL WINAPI DllMain (HINSTANCE inst, DWORD reason, LPVOID reserved)
 

Variables

static const IDirectInput7AVtbl ddi7avt
 
static const IDirectInput7WVtbl ddi7wvt
 
static const IDirectInput8AVtbl ddi8avt
 
static const IDirectInput8WVtbl ddi8wvt
 
static const IDirectInputJoyConfig8Vtbl JoyConfig8vt
 
static const struct dinput_devicedinput_devices []
 
HINSTANCE DINPUT_instance
 
static CRITICAL_SECTION dinput_hook_crit = { &dinput_critsect_debug, -1, 0, 0, 0, 0 }
 
static struct list direct_input_list = LIST_INIT( direct_input_list )
 
enum directinput_versions helpstring
 
static const IClassFactoryVtbl DICF_Vtbl
 
static IClassFactoryImpl DINPUT_CF = {{&DICF_Vtbl}, 1 }
 
static DWORD hook_thread_id
 
static HANDLE hook_thread_event
 
static CRITICAL_SECTION_DEBUG dinput_critsect_debug
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 37 of file dinput_main.c.

◆ enum_callback_wrapper

#define enum_callback_wrapper (   callback,
  instance,
  ref 
)    (callback)((instance), (ref))

Definition at line 455 of file dinput_main.c.

◆ FE

#define FE (   x)    { x, #x}

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 38 of file dinput_main.c.

◆ X [1/2]

#define X (   x)    if (dwFlags & x) FIXME("\tdwFlags |= "#x"\n");

◆ X [2/2]

#define X (   x)    if (flags & x) FIXME("\tflags |= "#x"\n");

Enumeration Type Documentation

◆ directinput_versions

Enumerator
DIRECTINPUT_VERSION_300 
DIRECTINPUT_VERSION_500 
DIRECTINPUT_VERSION_50A 
DIRECTINPUT_VERSION_5B2 
DIRECTINPUT_VERSION_602 
DIRECTINPUT_VERSION_61A 
DIRECTINPUT_VERSION_700 
DIRECTINPUT_VERSION_300 
DIRECTINPUT_VERSION_500 
DIRECTINPUT_VERSION_50A 
DIRECTINPUT_VERSION_5B2 
DIRECTINPUT_VERSION_602 
DIRECTINPUT_VERSION_61A 
DIRECTINPUT_VERSION_700 

Definition at line 681 of file dinput_main.c.

Function Documentation

◆ _copy_diactionformatAtoW()

void _copy_diactionformatAtoW ( LPDIACTIONFORMATW  to,
LPDIACTIONFORMATA  from 
)

Definition at line 339 of file dinput_main.c.

340 {
341  int i;
342 
343  to->dwSize = sizeof(DIACTIONFORMATW);
344  to->dwActionSize = sizeof(DIACTIONW);
345  to->dwDataSize = from->dwDataSize;
346  to->dwNumActions = from->dwNumActions;
347  to->guidActionMap = from->guidActionMap;
348  to->dwGenre = from->dwGenre;
349  to->dwBufferSize = from->dwBufferSize;
350  to->lAxisMin = from->lAxisMin;
351  to->lAxisMax = from->lAxisMax;
352  to->dwCRC = from->dwCRC;
353  to->ftTimeStamp = from->ftTimeStamp;
354 
355  for (i=0; i < to->dwNumActions; i++)
356  {
357  to->rgoAction[i].uAppData = from->rgoAction[i].uAppData;
358  to->rgoAction[i].dwSemantic = from->rgoAction[i].dwSemantic;
359  to->rgoAction[i].dwFlags = from->rgoAction[i].dwFlags;
360  to->rgoAction[i].guidInstance = from->rgoAction[i].guidInstance;
361  to->rgoAction[i].dwObjID = from->rgoAction[i].dwObjID;
362  to->rgoAction[i].dwHow = from->rgoAction[i].dwHow;
363  }
364 }
DWORD dwObjID
Definition: dinput.h:1284
GUID guidInstance
Definition: dinput.h:1283
struct _DIACTIONW DIACTIONW
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
FILETIME ftTimeStamp
Definition: dinput.h:1337
struct _DIACTIONFORMATW DIACTIONFORMATW
DWORD dwDataSize
Definition: dinput.h:1328
LPDIACTIONW rgoAction
Definition: dinput.h:1330
DWORD dwBufferSize
Definition: dinput.h:1333
DWORD dwFlags
Definition: dinput.h:1278
GUID guidActionMap
Definition: dinput.h:1331
UINT_PTR uAppData
Definition: dinput.h:1276
DWORD dwHow
Definition: dinput.h:1285
DWORD dwNumActions
Definition: dinput.h:1329
CardRegion * from
Definition: spigame.cpp:19
DWORD dwActionSize
Definition: dinput.h:1327
DWORD dwSemantic
Definition: dinput.h:1277

Referenced by IDirectInput8AImpl_ConfigureDevices(), JoystickAGenericImpl_BuildActionMap(), JoystickAGenericImpl_SetActionMap(), SysKeyboardAImpl_BuildActionMap(), SysKeyboardAImpl_SetActionMap(), SysMouseAImpl_BuildActionMap(), and SysMouseAImpl_SetActionMap().

◆ _copy_diactionformatWtoA()

void _copy_diactionformatWtoA ( LPDIACTIONFORMATA  to,
LPDIACTIONFORMATW  from 
)

Definition at line 366 of file dinput_main.c.

367 {
368  int i;
369 
370  to->dwSize = sizeof(DIACTIONFORMATA);
371  to->dwActionSize = sizeof(DIACTIONA);
372  to->dwDataSize = from->dwDataSize;
373  to->dwNumActions = from->dwNumActions;
374  to->guidActionMap = from->guidActionMap;
375  to->dwGenre = from->dwGenre;
376  to->dwBufferSize = from->dwBufferSize;
377  to->lAxisMin = from->lAxisMin;
378  to->lAxisMax = from->lAxisMax;
379  to->dwCRC = from->dwCRC;
380  to->ftTimeStamp = from->ftTimeStamp;
381 
382  for (i=0; i < to->dwNumActions; i++)
383  {
384  to->rgoAction[i].uAppData = from->rgoAction[i].uAppData;
385  to->rgoAction[i].dwSemantic = from->rgoAction[i].dwSemantic;
386  to->rgoAction[i].dwFlags = from->rgoAction[i].dwFlags;
387  to->rgoAction[i].guidInstance = from->rgoAction[i].guidInstance;
388  to->rgoAction[i].dwObjID = from->rgoAction[i].dwObjID;
389  to->rgoAction[i].dwHow = from->rgoAction[i].dwHow;
390  }
391 }
DWORD dwBufferSize
Definition: dinput.h:1315
DWORD dwObjID
Definition: dinput.h:1270
DWORD dwFlags
Definition: dinput.h:1264
DWORD dwNumActions
Definition: dinput.h:1311
struct _DIACTIONFORMATA DIACTIONFORMATA
UINT_PTR uAppData
Definition: dinput.h:1262
DWORD dwDataSize
Definition: dinput.h:1310
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GUID guidInstance
Definition: dinput.h:1269
struct _DIACTIONA DIACTIONA
FILETIME ftTimeStamp
Definition: dinput.h:1319
DWORD dwHow
Definition: dinput.h:1271
DWORD dwActionSize
Definition: dinput.h:1309
LPDIACTIONA rgoAction
Definition: dinput.h:1312
DWORD dwSemantic
Definition: dinput.h:1263
CardRegion * from
Definition: spigame.cpp:19
GUID guidActionMap
Definition: dinput.h:1313

Referenced by IDirectInput8AImpl_ConfigureDevices(), JoystickAGenericImpl_BuildActionMap(), SysKeyboardAImpl_BuildActionMap(), and SysMouseAImpl_BuildActionMap().

◆ _dump_diactionformatA()

static void _dump_diactionformatA ( LPDIACTIONFORMATA  lpdiActionFormat)
static

Definition at line 308 of file dinput_main.c.

309 {
310  unsigned int i;
311 
312  TRACE("diaf.dwSize = %d\n", lpdiActionFormat->dwSize);
313  TRACE("diaf.dwActionSize = %d\n", lpdiActionFormat->dwActionSize);
314  TRACE("diaf.dwDataSize = %d\n", lpdiActionFormat->dwDataSize);
315  TRACE("diaf.dwNumActions = %d\n", lpdiActionFormat->dwNumActions);
316  TRACE("diaf.rgoAction = %p\n", lpdiActionFormat->rgoAction);
317  TRACE("diaf.guidActionMap = %s\n", debugstr_guid(&lpdiActionFormat->guidActionMap));
318  TRACE("diaf.dwGenre = 0x%08x\n", lpdiActionFormat->dwGenre);
319  TRACE("diaf.dwBufferSize = %d\n", lpdiActionFormat->dwBufferSize);
320  TRACE("diaf.lAxisMin = %d\n", lpdiActionFormat->lAxisMin);
321  TRACE("diaf.lAxisMax = %d\n", lpdiActionFormat->lAxisMax);
322  TRACE("diaf.hInstString = %p\n", lpdiActionFormat->hInstString);
323  TRACE("diaf.ftTimeStamp ...\n");
324  TRACE("diaf.dwCRC = 0x%x\n", lpdiActionFormat->dwCRC);
325  TRACE("diaf.tszActionMap = %s\n", debugstr_a(lpdiActionFormat->tszActionMap));
326  for (i = 0; i < lpdiActionFormat->dwNumActions; i++)
327  {
328  TRACE("diaf.rgoAction[%u]:\n", i);
329  TRACE("\tuAppData=0x%lx\n", lpdiActionFormat->rgoAction[i].uAppData);
330  TRACE("\tdwSemantic=0x%08x (%s)\n", lpdiActionFormat->rgoAction[i].dwSemantic, dump_semantic(lpdiActionFormat->rgoAction[i].dwSemantic));
331  TRACE("\tdwFlags=0x%x\n", lpdiActionFormat->rgoAction[i].dwFlags);
332  TRACE("\tszActionName=%s\n", debugstr_a(lpdiActionFormat->rgoAction[i].u.lptszActionName));
333  TRACE("\tguidInstance=%s\n", debugstr_guid(&lpdiActionFormat->rgoAction[i].guidInstance));
334  TRACE("\tdwObjID=0x%x\n", lpdiActionFormat->rgoAction[i].dwObjID);
335  TRACE("\tdwHow=0x%x\n", lpdiActionFormat->rgoAction[i].dwHow);
336  }
337 }
DWORD dwBufferSize
Definition: dinput.h:1315
DWORD dwObjID
Definition: dinput.h:1270
CHAR tszActionMap[MAX_PATH]
Definition: dinput.h:1321
DWORD dwFlags
Definition: dinput.h:1264
DWORD dwNumActions
Definition: dinput.h:1311
UINT_PTR uAppData
Definition: dinput.h:1262
DWORD dwDataSize
Definition: dinput.h:1310
HINSTANCE hInstString
Definition: dinput.h:1318
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GUID guidInstance
Definition: dinput.h:1269
LPCSTR lptszActionName
Definition: dinput.h:1266
#define debugstr_guid
Definition: kernel32.h:35
DWORD dwHow
Definition: dinput.h:1271
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
static const char * dump_semantic(DWORD semantic)
Definition: dinput_main.c:294
DWORD dwActionSize
Definition: dinput.h:1309
LPDIACTIONA rgoAction
Definition: dinput.h:1312
DWORD dwSemantic
Definition: dinput.h:1263
GUID guidActionMap
Definition: dinput.h:1313

Referenced by IDirectInput8AImpl_EnumDevicesBySemantics().

◆ _dump_DIDEVTYPE_value()

static const char* _dump_DIDEVTYPE_value ( DWORD  dwDevType,
DWORD  dwVersion 
)
static

Definition at line 242 of file dinput_main.c.

243 {
244  if (dwVersion < 0x0800) {
245  switch (dwDevType) {
246  case 0: return "All devices";
247  case DIDEVTYPE_MOUSE: return "DIDEVTYPE_MOUSE";
248  case DIDEVTYPE_KEYBOARD: return "DIDEVTYPE_KEYBOARD";
249  case DIDEVTYPE_JOYSTICK: return "DIDEVTYPE_JOYSTICK";
250  case DIDEVTYPE_DEVICE: return "DIDEVTYPE_DEVICE";
251  default: return "Unknown";
252  }
253  } else {
254  switch (dwDevType) {
255  case DI8DEVCLASS_ALL: return "All devices";
256  case DI8DEVCLASS_POINTER: return "DI8DEVCLASS_POINTER";
257  case DI8DEVCLASS_KEYBOARD: return "DI8DEVCLASS_KEYBOARD";
258  case DI8DEVCLASS_DEVICE: return "DI8DEVCLASS_DEVICE";
259  case DI8DEVCLASS_GAMECTRL: return "DI8DEVCLASS_GAMECTRL";
260  default: return "Unknown";
261  }
262  }
263 }
#define DIDEVTYPE_DEVICE
Definition: dinput.h:197
#define DIDEVTYPE_MOUSE
Definition: dinput.h:198
#define DI8DEVCLASS_POINTER
Definition: dinput.h:205
#define DI8DEVCLASS_ALL
Definition: dinput.h:203
#define DIDEVTYPE_JOYSTICK
Definition: dinput.h:200
#define DI8DEVCLASS_KEYBOARD
Definition: dinput.h:206
#define DIDEVTYPE_KEYBOARD
Definition: dinput.h:199
#define DI8DEVCLASS_DEVICE
Definition: dinput.h:204
#define DI8DEVCLASS_GAMECTRL
Definition: dinput.h:207

Referenced by IDirectInputAImpl_EnumDevices(), and IDirectInputWImpl_EnumDevices().

◆ _dump_EnumDevices_dwFlags()

static void _dump_EnumDevices_dwFlags ( DWORD  dwFlags)
static

Definition at line 265 of file dinput_main.c.

266 {
267  if (TRACE_ON(dinput)) {
268  unsigned int i;
269  static const struct {
270  DWORD mask;
271  const char *name;
272  } flags[] = {
273 #define FE(x) { x, #x}
280 #undef FE
281  };
282  TRACE(" flags: ");
283  if (dwFlags == 0) {
284  TRACE("DIEDFL_ALLDEVICES\n");
285  return;
286  }
287  for (i = 0; i < ARRAY_SIZE(flags); i++)
288  if (flags[i].mask & dwFlags)
289  TRACE("%s ",flags[i].name);
290  }
291  TRACE("\n");
292 }
#define DIEDFL_FORCEFEEDBACK
Definition: dinput.h:192
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLenum GLint GLuint mask
Definition: glext.h:6028
#define DIEDFL_ATTACHEDONLY
Definition: dinput.h:191
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
#define DIEDFL_INCLUDEPHANTOMS
Definition: dinput.h:194
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define DIEDFL_INCLUDEALIASES
Definition: dinput.h:193
#define DIEDFL_ALLDEVICES
Definition: dinput.h:190
#define DIEDFL_INCLUDEHIDDEN
Definition: dinput.h:195
#define ARRAY_SIZE(a)
Definition: main.h:24
#define FE(x)
Definition: name.c:38
#define TRACE_ON(x)
Definition: compat.h:65
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by IDirectInputAImpl_EnumDevices(), and IDirectInputWImpl_EnumDevices().

◆ callwndproc_proc()

static LRESULT CALLBACK callwndproc_proc ( int  code,
WPARAM  wparam,
LPARAM  lparam 
)
static

Definition at line 1709 of file dinput_main.c.

1710 {
1711  CWPSTRUCT *msg = (CWPSTRUCT *)lparam;
1712  IDirectInputImpl *dinput;
1713  HWND foreground;
1714 
1715  if (code != HC_ACTION || (msg->message != WM_KILLFOCUS &&
1716  msg->message != WM_ACTIVATEAPP && msg->message != WM_ACTIVATE))
1717  return CallNextHookEx( 0, code, wparam, lparam );
1718 
1719  foreground = GetForegroundWindow();
1720 
1722 
1724  {
1726 
1727  EnterCriticalSection( &dinput->crit );
1729  {
1730  if (!dev->acquired) continue;
1731 
1732  if (msg->hwnd == dev->win && msg->hwnd != foreground)
1733  {
1734  TRACE( "%p window is not foreground - unacquiring %p\n", dev->win, dev );
1735  IDirectInputDevice_Unacquire( &dev->IDirectInputDevice8A_iface );
1736  }
1737  }
1738  LeaveCriticalSection( &dinput->crit );
1739  }
1741 
1742  return CallNextHookEx( 0, code, wparam, lparam );
1743 }
static CRITICAL_SECTION dinput_hook_crit
Definition: dinput_main.c:101
struct list devices_list
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static int dev
Definition: mkdosfs.c:536
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define TRACE(s)
Definition: solgame.cpp:4
#define WM_KILLFOCUS
Definition: winuser.h:1596
uint32_t entry
Definition: isohybrid.c:63
LRESULT WINAPI CallNextHookEx(_In_opt_ HHOOK, _In_ int, _In_ WPARAM, _In_ LPARAM)
CRITICAL_SECTION crit
#define WM_ACTIVATEAPP
Definition: winuser.h:1614
#define WM_ACTIVATE
Definition: winuser.h:1594
#define HC_ACTION
Definition: winuser.h:48
HWND WINAPI GetForegroundWindow(void)
Definition: ntwrapper.h:392
#define msg(x)
Definition: auth_time.c:54
#define IDirectInputDevice_Unacquire(p)
Definition: dinput.h:1609
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static struct list direct_input_list
Definition: dinput_main.c:102
static UINT WPARAM wparam
Definition: combo.c:716

Referenced by check_dinput_hooks().

◆ check_dinput_events()

void check_dinput_events ( void  )

Definition at line 1900 of file dinput_main.c.

1901 {
1902  /* Windows does not do that, but our current implementation of winex11
1903  * requires periodic event polling to forward events to the wineserver.
1904  *
1905  * We have to call this function from multiple places, because:
1906  * - some games do not explicitly poll for mouse events
1907  * (for example Culpa Innata)
1908  * - some games only poll the device, and neither keyboard nor mouse
1909  * (for example Civilization: Call to Power 2)
1910  */
1911 #ifndef __REACTOS__
1913 #endif
1914 }
DWORD WINAPI MsgWaitForMultipleObjectsEx(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask, _In_ DWORD dwFlags)
smooth NULL
Definition: ftsmooth.c:416
#define QS_ALLINPUT
Definition: winuser.h:874

Referenced by IDirectInputDevice2WImpl_Poll(), SysKeyboardWImpl_GetDeviceState(), and SysMouseWImpl_GetDeviceState().

◆ check_dinput_hooks()

void check_dinput_hooks ( LPDIRECTINPUTDEVICE8W  iface,
BOOL  acquired 
)

Definition at line 1863 of file dinput_main.c.

1864 {
1865  static HHOOK callwndproc_hook;
1866  static ULONG foreground_cnt;
1868 
1870 
1871  if (dev->dwCoopLevel & DISCL_FOREGROUND)
1872  {
1873  if (acquired)
1874  foreground_cnt++;
1875  else
1876  foreground_cnt--;
1877  }
1878 
1879  if (foreground_cnt && !callwndproc_hook)
1880  callwndproc_hook = SetWindowsHookExW( WH_CALLWNDPROC, callwndproc_proc,
1882  else if (!foreground_cnt && callwndproc_hook)
1883  {
1884  UnhookWindowsHookEx( callwndproc_hook );
1885  callwndproc_hook = NULL;
1886  }
1887 
1888  if (hook_thread_event) /* if thread is not started yet */
1889  {
1893  }
1894 
1895  PostThreadMessageW( hook_thread_id, WM_USER+0x10, 1, 0 );
1896 
1898 }
#define CloseHandle
Definition: compat.h:406
static CRITICAL_SECTION dinput_hook_crit
Definition: dinput_main.c:101
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
HINSTANCE DINPUT_instance
Definition: dinput_main.c:98
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
smooth NULL
Definition: ftsmooth.c:416
static DWORD hook_thread_id
Definition: dinput_main.c:1817
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
#define DISCL_FOREGROUND
Definition: dinput.h:965
#define WH_CALLWNDPROC
Definition: winuser.h:34
#define WM_USER
Definition: winuser.h:1877
BOOL WINAPI UnhookWindowsHookEx(_In_ HHOOK)
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface)
Definition: dinput_main.c:84
HHOOK WINAPI SetWindowsHookExW(_In_ int, _In_ HOOKPROC, _In_opt_ HINSTANCE, _In_ DWORD)
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define INFINITE
Definition: serial.h:102
static HANDLE hook_thread_event
Definition: dinput_main.c:1818
BOOL WINAPI PostThreadMessageW(_In_ DWORD, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static LRESULT CALLBACK callwndproc_proc(int code, WPARAM wparam, LPARAM lparam)
Definition: dinput_main.c:1709

Referenced by IDirectInputDevice2WImpl_Acquire(), and IDirectInputDevice2WImpl_Unacquire().

◆ check_hook_thread()

static BOOL check_hook_thread ( void  )
static

Definition at line 1828 of file dinput_main.c.

1829 {
1830  static HANDLE hook_thread;
1831  HMODULE module;
1832 
1834 
1835  TRACE("IDirectInputs left: %d\n", list_count(&direct_input_list));
1836  if (!list_empty(&direct_input_list) && !hook_thread)
1837  {
1838  GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, (const WCHAR*)DINPUT_instance, &module);
1841  }
1842  else if (list_empty(&direct_input_list) && hook_thread)
1843  {
1845 
1846  if (hook_thread_event) /* if thread is not started yet */
1847  {
1851  }
1852 
1853  hook_thread_id = 0;
1854  PostThreadMessageW(tid, WM_USER+0x10, 0, 0);
1855  CloseHandle(hook_thread);
1856  hook_thread = NULL;
1857  }
1858 
1860  return hook_thread_id != 0;
1861 }
#define CloseHandle
Definition: compat.h:406
HMODULE module
Definition: main.cpp:47
static CRITICAL_SECTION dinput_hook_crit
Definition: dinput_main.c:101
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
HINSTANCE DINPUT_instance
Definition: dinput_main.c:98
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651
static DWORD WINAPI hook_thread_proc(void *param)
Definition: dinput_main.c:1745
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
__WINE_SERVER_LIST_INLINE unsigned int list_count(const struct list *list)
Definition: list.h:155
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
smooth NULL
Definition: ftsmooth.c:416
static DWORD hook_thread_id
Definition: dinput_main.c:1817
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WM_USER
Definition: winuser.h:1877
__WINE_SERVER_LIST_INLINE int list_empty(const struct list *list)
Definition: list.h:143
BOOL WINAPI GetModuleHandleExW(IN DWORD dwFlags, IN LPCWSTR lpwModuleName OPTIONAL, OUT HMODULE *phModule)
Definition: loader.c:875
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static struct list direct_input_list
Definition: dinput_main.c:102
#define INFINITE
Definition: serial.h:102
static HANDLE hook_thread_event
Definition: dinput_main.c:1818
BOOL WINAPI PostThreadMessageW(_In_ DWORD, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static TfClientId tid

Referenced by initialize_directinput_instance(), and uninitialize_directinput_instance().

◆ create_device()

static HRESULT create_device ( IDirectInputImpl This,
REFGUID  rguid,
REFIID  riid,
LPVOID pvOut,
BOOL  unicode 
)
static

Definition at line 798 of file dinput_main.c.

799 {
800  unsigned int i;
801 
802  if (pvOut)
803  *pvOut = NULL;
804 
805  if (!rguid || !pvOut)
806  return E_POINTER;
807 
808  if (!This->initialized)
809  return DIERR_NOTINITIALIZED;
810 
811  /* Loop on all the devices to see if anyone matches the given GUID */
812  for (i = 0; i < ARRAY_SIZE(dinput_devices); i++)
813  {
814  HRESULT ret;
815 
816  if (!dinput_devices[i]->create_device) continue;
817  if ((ret = dinput_devices[i]->create_device(This, rguid, riid, pvOut, unicode)) == DI_OK)
818  return DI_OK;
819  }
820 
821  WARN("invalid device GUID %s\n", debugstr_guid(rguid));
822  return DIERR_DEVICENOTREG;
823 }
#define DIERR_NOTINITIALIZED
Definition: dinput.h:157
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:111
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
LONG HRESULT
Definition: typedefs.h:77
#define DIERR_DEVICENOTREG
Definition: dinput.h:147
int ret
static const struct dinput_device * dinput_devices[]
Definition: dinput_main.c:89
#define ARRAY_SIZE(a)
Definition: main.h:24
#define DI_OK
Definition: dinput.h:128
#define E_POINTER
Definition: winerror.h:2365
static HRESULT create_device(IDirectInputImpl *This, REFGUID rguid, REFIID riid, LPVOID *pvOut, BOOL unicode)
Definition: dinput_main.c:798

Referenced by IDirectInput7AImpl_CreateDeviceEx(), and IDirectInput7WImpl_CreateDeviceEx().

◆ create_directinput_instance()

static HRESULT create_directinput_instance ( REFIID  riid,
LPVOID ppDI,
IDirectInputImpl **  out 
)
static

Definition at line 107 of file dinput_main.c.

108 {
110  HRESULT hr;
111 
112  if (!This)
113  return E_OUTOFMEMORY;
114 
115  This->IDirectInput7A_iface.lpVtbl = &ddi7avt;
116  This->IDirectInput7W_iface.lpVtbl = &ddi7wvt;
117  This->IDirectInput8A_iface.lpVtbl = &ddi8avt;
118  This->IDirectInput8W_iface.lpVtbl = &ddi8wvt;
119  This->IDirectInputJoyConfig8_iface.lpVtbl = &JoyConfig8vt;
120 
121  hr = IDirectInput_QueryInterface( &This->IDirectInput7A_iface, riid, ppDI );
122  if (FAILED(hr))
123  {
124  HeapFree( GetProcessHeap(), 0, This );
125  return hr;
126  }
127 
128  if (out) *out = This;
129  return DI_OK;
130 }
static const IDirectInput7AVtbl ddi7avt
Definition: dinput_main.c:58
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
#define IDirectInput_QueryInterface(p, a, b)
Definition: dinput.h:2292
static const IDirectInput7WVtbl ddi7wvt
Definition: dinput_main.c:59
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static const IDirectInput8WVtbl ddi8wvt
Definition: dinput_main.c:61
LONG HRESULT
Definition: typedefs.h:77
static FILE * out
Definition: regtests2xml.c:44
static const IDirectInputJoyConfig8Vtbl JoyConfig8vt
Definition: dinput_main.c:62
static const IDirectInput8AVtbl ddi8avt
Definition: dinput_main.c:60
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define DI_OK
Definition: dinput.h:128
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by DICF_CreateInstance(), DirectInput8Create(), and DirectInputCreateEx().

◆ diactionformat_priorityA()

static DWORD diactionformat_priorityA ( LPDIACTIONFORMATA  lpdiaf,
DWORD  genre 
)
static

Definition at line 399 of file dinput_main.c.

400 {
401  int i;
402  DWORD priorityFlags = 0;
403 
404  /* If there's at least one action for the device it's priority 1 */
405  for(i=0; i < lpdiaf->dwNumActions; i++)
406  if ((lpdiaf->rgoAction[i].dwSemantic & genre) == genre)
407  priorityFlags |= DIEDBS_MAPPEDPRI1;
408 
409  return priorityFlags;
410 }
DWORD dwNumActions
Definition: dinput.h:1311
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned long DWORD
Definition: ntddk_ex.h:95
#define DIEDBS_MAPPEDPRI1
Definition: dinput.h:445
LPDIACTIONA rgoAction
Definition: dinput.h:1312
DWORD dwSemantic
Definition: dinput.h:1263

Referenced by IDirectInput8AImpl_EnumDevicesBySemantics().

◆ diactionformat_priorityW()

static DWORD diactionformat_priorityW ( LPDIACTIONFORMATW  lpdiaf,
DWORD  genre 
)
static

Definition at line 412 of file dinput_main.c.

413 {
414  int i;
415  DWORD priorityFlags = 0;
416 
417  /* If there's at least one action for the device it's priority 1 */
418  for(i=0; i < lpdiaf->dwNumActions; i++)
419  if ((lpdiaf->rgoAction[i].dwSemantic & genre) == genre)
420  priorityFlags |= DIEDBS_MAPPEDPRI1;
421 
422  return priorityFlags;
423 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned long DWORD
Definition: ntddk_ex.h:95
LPDIACTIONW rgoAction
Definition: dinput.h:1330
#define DIEDBS_MAPPEDPRI1
Definition: dinput.h:445
DWORD dwNumActions
Definition: dinput.h:1329
DWORD dwSemantic
Definition: dinput.h:1277

Referenced by IDirectInput8WImpl_EnumDevicesBySemantics().

◆ DICF_AddRef()

static ULONG WINAPI DICF_AddRef ( LPCLASSFACTORY  iface)
static

Definition at line 1590 of file dinput_main.c.

1590  {
1592  return InterlockedIncrement(&(This->ref));
1593 }
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: dinput_main.c:1578
#define InterlockedIncrement
Definition: armddk.h:53

◆ DICF_CreateInstance()

static HRESULT WINAPI DICF_CreateInstance ( LPCLASSFACTORY  iface,
LPUNKNOWN  pOuter,
REFIID  riid,
LPVOID ppobj 
)
static

Definition at line 1601 of file dinput_main.c.

1603  {
1605 
1606  TRACE("(%p)->(%p,%s,%p)\n",This,pOuter,debugstr_guid(riid),ppobj);
1607  if ( IsEqualGUID( &IID_IUnknown, riid ) ||
1608  IsEqualGUID( &IID_IDirectInputA, riid ) ||
1609  IsEqualGUID( &IID_IDirectInputW, riid ) ||
1610  IsEqualGUID( &IID_IDirectInput2A, riid ) ||
1611  IsEqualGUID( &IID_IDirectInput2W, riid ) ||
1612  IsEqualGUID( &IID_IDirectInput7A, riid ) ||
1613  IsEqualGUID( &IID_IDirectInput7W, riid ) ||
1614  IsEqualGUID( &IID_IDirectInput8A, riid ) ||
1615  IsEqualGUID( &IID_IDirectInput8W, riid ) )
1616  {
1617  return create_directinput_instance(riid, ppobj, NULL);
1618  }
1619 
1620  FIXME("(%p,%p,%s,%p) Interface not found!\n",This,pOuter,debugstr_guid(riid),ppobj);
1621  return E_NOINTERFACE;
1622 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: dinput_main.c:1578
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
static HRESULT create_directinput_instance(REFIID riid, LPVOID *ppDI, IDirectInputImpl **out)
Definition: dinput_main.c:107
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ DICF_LockServer()

static HRESULT WINAPI DICF_LockServer ( LPCLASSFACTORY  iface,
BOOL  dolock 
)
static

Definition at line 1624 of file dinput_main.c.

1624  {
1626  FIXME("(%p)->(%d),stub!\n",This,dolock);
1627  return S_OK;
1628 }
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: dinput_main.c:1578
#define FIXME(fmt,...)
Definition: debug.h:110
#define S_OK
Definition: intsafe.h:59

◆ DICF_QueryInterface()

static HRESULT WINAPI DICF_QueryInterface ( LPCLASSFACTORY  iface,
REFIID  riid,
LPVOID ppobj 
)
static

Definition at line 1583 of file dinput_main.c.

1583  {
1585 
1586  FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
1587  return E_NOINTERFACE;
1588 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: dinput_main.c:1578
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_guid
Definition: kernel32.h:35

◆ DICF_Release()

static ULONG WINAPI DICF_Release ( LPCLASSFACTORY  iface)
static

Definition at line 1595 of file dinput_main.c.

1595  {
1597  /* static class, won't be freed */
1598  return InterlockedDecrement(&(This->ref));
1599 }
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: dinput_main.c:1578
#define InterlockedDecrement
Definition: armddk.h:52

◆ DirectInput8Create()

HRESULT WINAPI DECLSPEC_HOTPATCH DirectInput8Create ( HINSTANCE  hinst,
DWORD  version,
REFIID  iid,
void **  out,
IUnknown outer 
)

Definition at line 172 of file dinput_main.c.

174 {
176  HRESULT hr;
177 
178  TRACE("hinst %p, version %#x, iid %s, out %p, outer %p.\n",
179  hinst, version, debugstr_guid(iid), out, outer);
180 
181  if (!out)
182  return E_POINTER;
183 
184  if (!IsEqualGUID(&IID_IDirectInput8A, iid) &&
185  !IsEqualGUID(&IID_IDirectInput8W, iid) &&
186  !IsEqualGUID(&IID_IUnknown, iid))
187  {
188  *out = NULL;
189  return DIERR_NOINTERFACE;
190  }
191 
193 
194  if (FAILED(hr))
195  {
196  ERR("Failed to create DirectInput, hr %#x.\n", hr);
197  return hr;
198  }
199 
200  /* When aggregation is used, the application needs to manually call Initialize(). */
201  if (!outer && IsEqualGUID(&IID_IDirectInput8A, iid))
202  {
203  hr = IDirectInput8_Initialize(&This->IDirectInput8A_iface, hinst, version);
204  if (FAILED(hr))
205  {
206  IDirectInput8_Release(&This->IDirectInput8A_iface);
207  *out = NULL;
208  return hr;
209  }
210  }
211 
212  if (!outer && IsEqualGUID(&IID_IDirectInput8W, iid))
213  {
214  hr = IDirectInput8_Initialize(&This->IDirectInput8W_iface, hinst, version);
215  if (FAILED(hr))
216  {
217  IDirectInput8_Release(&This->IDirectInput8W_iface);
218  *out = NULL;
219  return hr;
220  }
221  }
222 
223  return S_OK;
224 }
HRESULT hr
Definition: shlfolder.c:183
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR version[]
Definition: asmname.c:66
#define IDirectInput8_Initialize(p, a, b)
Definition: dinput.h:2517
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IUnknown
static FILE * out
Definition: regtests2xml.c:44
static HRESULT create_directinput_instance(REFIID riid, LPVOID *ppDI, IDirectInputImpl **out)
Definition: dinput_main.c:107
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
#define DIERR_NOINTERFACE
Definition: dinput.h:153
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static HINSTANCE hinst
Definition: edit.c:551
#define E_POINTER
Definition: winerror.h:2365
#define IDirectInput8_Release(p)
Definition: dinput.h:2511

Referenced by InitializeDirectInputDialog(), test_CreateDevice(), test_DirectInput8Create(), test_EnumDevices(), test_EnumDevicesBySemantics(), test_GetDeviceStatus(), test_Initialize(), test_QueryInterface(), and test_RunControlPanel().

◆ DirectInputCreateA()

HRESULT WINAPI DECLSPEC_HOTPATCH DirectInputCreateA ( HINSTANCE  hinst,
DWORD  dwVersion,
LPDIRECTINPUTA ppDI,
LPUNKNOWN  punkOuter 
)

Definition at line 229 of file dinput_main.c.

230 {
231  return DirectInputCreateEx(hinst, dwVersion, &IID_IDirectInput7A, (LPVOID *)ppDI, punkOuter);
232 }
HRESULT WINAPI DirectInputCreateEx(HINSTANCE hinst, DWORD dwVersion, REFIID riid, LPVOID *ppDI, LPUNKNOWN punkOuter)
Definition: dinput_main.c:135
static HINSTANCE hinst
Definition: edit.c:551

Referenced by joystick_tests(), mouse_tests(), test_CreateDevice(), test_DirectInputJoyConfig8(), test_enum_feedback(), test_EnumDevices(), test_GetDeviceStatus(), test_QueryInterface(), and test_RunControlPanel().

◆ DirectInputCreateEx()

HRESULT WINAPI DirectInputCreateEx ( HINSTANCE  hinst,
DWORD  dwVersion,
REFIID  riid,
LPVOID ppDI,
LPUNKNOWN  punkOuter 
)

Definition at line 135 of file dinput_main.c.

138 {
140  HRESULT hr;
141 
142  TRACE("(%p,%04x,%s,%p,%p)\n", hinst, dwVersion, debugstr_guid(riid), ppDI, punkOuter);
143 
144  if (IsEqualGUID( &IID_IDirectInputA, riid ) ||
145  IsEqualGUID( &IID_IDirectInput2A, riid ) ||
146  IsEqualGUID( &IID_IDirectInput7A, riid ) ||
147  IsEqualGUID( &IID_IDirectInputW, riid ) ||
148  IsEqualGUID( &IID_IDirectInput2W, riid ) ||
149  IsEqualGUID( &IID_IDirectInput7W, riid ))
150  {
152  if (FAILED(hr))
153  return hr;
154  }
155  else
156  return DIERR_NOINTERFACE;
157 
158  hr = IDirectInput_Initialize( &This->IDirectInput7A_iface, hinst, dwVersion );
159  if (FAILED(hr))
160  {
161  IDirectInput_Release( &This->IDirectInput7A_iface );
162  *ppDI = NULL;
163  return hr;
164  }
165 
166  return DI_OK;
167 }
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
#define IDirectInput_Release(p)
Definition: dinput.h:2294
LONG HRESULT
Definition: typedefs.h:77
static HRESULT create_directinput_instance(REFIID riid, LPVOID *ppDI, IDirectInputImpl **out)
Definition: dinput_main.c:107
#define DIERR_NOINTERFACE
Definition: dinput.h:153
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
#define DI_OK
Definition: dinput.h:128
static HINSTANCE hinst
Definition: edit.c:551
#define IDirectInput_Initialize(p, a, b)
Definition: dinput.h:2300

Referenced by DirectInputCreateA(), and DirectInputCreateW().

◆ DirectInputCreateW()

HRESULT WINAPI DECLSPEC_HOTPATCH DirectInputCreateW ( HINSTANCE  hinst,
DWORD  dwVersion,
LPDIRECTINPUTW ppDI,
LPUNKNOWN  punkOuter 
)

Definition at line 237 of file dinput_main.c.

238 {
239  return DirectInputCreateEx(hinst, dwVersion, &IID_IDirectInput7W, (LPVOID *)ppDI, punkOuter);
240 }
HRESULT WINAPI DirectInputCreateEx(HINSTANCE hinst, DWORD dwVersion, REFIID riid, LPVOID *ppDI, LPUNKNOWN punkOuter)
Definition: dinput_main.c:135
static HINSTANCE hinst
Definition: edit.c:551

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 1642 of file dinput_main.c.

1643 {
1644  return S_FALSE;
1645 }
#define S_FALSE
Definition: winerror.h:2357

◆ DllGetClassObject()

HRESULT WINAPI DllGetClassObject ( REFCLSID  rclsid,
REFIID  riid,
LPVOID ppv 
)

Definition at line 1650 of file dinput_main.c.

1651 {
1652  TRACE("(%s,%s,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
1653  if ( IsEqualCLSID( &IID_IClassFactory, riid ) ) {
1654  *ppv = &DINPUT_CF;
1655  IClassFactory_AddRef((IClassFactory*)*ppv);
1656  return S_OK;
1657  }
1658 
1659  FIXME("(%s,%s,%p): no interface found.\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
1661 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663
#define FIXME(fmt,...)
Definition: debug.h:110
static IClassFactoryImpl DINPUT_CF
Definition: dinput_main.c:1637
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
const GUID IID_IClassFactory
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:96

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  inst,
DWORD  reason,
LPVOID  reserved 
)

Definition at line 1916 of file dinput_main.c.

1917 {
1918  switch(reason)
1919  {
1920  case DLL_PROCESS_ATTACH:
1922  DINPUT_instance = inst;
1923  break;
1924  case DLL_PROCESS_DETACH:
1925  if (reserved) break;
1927  break;
1928  }
1929  return TRUE;
1930 }
#define TRUE
Definition: types.h:120
static CRITICAL_SECTION dinput_hook_crit
Definition: dinput_main.c:101
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
HINSTANCE DINPUT_instance
Definition: dinput_main.c:98
r reserved
Definition: btrfs.c:2865
#define DLL_PROCESS_DETACH
Definition: compat.h:119
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1904

◆ DllRegisterServer()

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 1666 of file dinput_main.c.

1667 {
1669 }
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98
HINSTANCE DINPUT_instance
Definition: dinput_main.c:98

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 1674 of file dinput_main.c.

1675 {
1677 }
HINSTANCE DINPUT_instance
Definition: dinput_main.c:98
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:110

◆ dump_semantic()

static const char* dump_semantic ( DWORD  semantic)
static

Definition at line 294 of file dinput_main.c.

295 {
296  if((semantic & 0xff000000) == 0xff000000)
297  return "Any AXIS";
298  else if((semantic & 0x82000000) == 0x82000000)
299  return "Mouse";
300  else if((semantic & 0x81000000) == 0x81000000)
301  return "Keybaord";
303  return "Helicopter";
304 
305  return "Unknown";
306 }
#define DIVIRTUAL_FLYING_HELICOPTER
Definition: dinput.h:2196

Referenced by _dump_diactionformatA().

◆ hook_thread_proc()

static DWORD WINAPI hook_thread_proc ( void param)
static

Definition at line 1745 of file dinput_main.c.

1746 {
1747  static HHOOK kbd_hook, mouse_hook;
1748  MSG msg;
1749 
1750  /* Force creation of the message queue */
1751  PeekMessageW( &msg, 0, 0, 0, PM_NOREMOVE );
1752  SetEvent(param);
1753 
1754  while (GetMessageW( &msg, 0, 0, 0 ))
1755  {
1756  UINT kbd_cnt = 0, mice_cnt = 0;
1757 
1758  if (msg.message == WM_USER+0x10)
1759  {
1760  IDirectInputImpl *dinput;
1761 
1762  TRACE( "Processing hook change notification lp:%ld\n", msg.lParam );
1763 
1764  if (!msg.wParam && !msg.lParam)
1765  {
1767  if (mouse_hook) UnhookWindowsHookEx( mouse_hook );
1768  kbd_hook = mouse_hook = NULL;
1769  break;
1770  }
1771 
1773 
1774  /* Count acquired keyboards and mice*/
1776  {
1778 
1779  EnterCriticalSection( &dinput->crit );
1781  {
1782  if (!dev->acquired || !dev->event_proc) continue;
1783 
1784  if (IsEqualGUID( &dev->guid, &GUID_SysKeyboard ))
1785  kbd_cnt++;
1786  else
1787  if (IsEqualGUID( &dev->guid, &GUID_SysMouse ))
1788  mice_cnt++;
1789  }
1790  LeaveCriticalSection( &dinput->crit );
1791  }
1793 
1794  if (kbd_cnt && !kbd_hook)
1796  else if (!kbd_cnt && kbd_hook)
1797  {
1799  kbd_hook = NULL;
1800  }
1801 
1802  if (mice_cnt && !mouse_hook)
1804  else if (!mice_cnt && mouse_hook)
1805  {
1806  UnhookWindowsHookEx( mouse_hook );
1807  mouse_hook = NULL;
1808  }
1809  }
1812  }
1813 
1815 }
BOOL WINAPI TranslateMessage(_In_ const MSG *)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
static CRITICAL_SECTION dinput_hook_crit
Definition: dinput_main.c:101
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
struct list devices_list
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
HINSTANCE DINPUT_instance
Definition: dinput_main.c:98
static int dev
Definition: mkdosfs.c:536
#define PM_NOREMOVE
Definition: winuser.h:1181
VOID WINAPI FreeLibraryAndExitThread(HMODULE hLibModule, DWORD dwExitCode)
Definition: loader.c:516
#define WH_MOUSE_LL
Definition: winuser.h:44
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define WH_KEYBOARD_LL
Definition: winuser.h:43
GLfloat param
Definition: glext.h:5796
uint32_t entry
Definition: isohybrid.c:63
#define WM_USER
Definition: winuser.h:1877
BOOL WINAPI UnhookWindowsHookEx(_In_ HHOOK)
Definition: msg.c:151
CRITICAL_SECTION crit
unsigned int UINT
Definition: ndis.h:50
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
static LRESULT CALLBACK LL_hook_proc(int code, WPARAM wparam, LPARAM lparam)
Definition: dinput_main.c:1683
#define msg(x)
Definition: auth_time.c:54
HHOOK WINAPI SetWindowsHookExW(_In_ int, _In_ HOOKPROC, _In_opt_ HINSTANCE, _In_ DWORD)
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static struct list direct_input_list
Definition: dinput_main.c:102

Referenced by check_hook_thread().

◆ IDirectInput2AImpl_FindDevice()

static HRESULT WINAPI IDirectInput2AImpl_FindDevice ( LPDIRECTINPUT7A  iface,
REFGUID  rguid,
LPCSTR  pszName,
LPGUID  pguidInstance 
)
static

Definition at line 778 of file dinput_main.c.

780 {
782 
783  FIXME( "(%p)->(%s, %s, %p): stub\n", This, debugstr_guid(rguid), pszName, pguidInstance );
784 
785  return DI_OK;
786 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_guid
Definition: kernel32.h:35
static IDirectInputImpl * impl_from_IDirectInput7A(IDirectInput7A *iface)
Definition: dinput_main.c:64
#define DI_OK
Definition: dinput.h:128

Referenced by IDirectInput8AImpl_FindDevice().

◆ IDirectInput2WImpl_FindDevice()

static HRESULT WINAPI IDirectInput2WImpl_FindDevice ( LPDIRECTINPUT7W  iface,
REFGUID  rguid,
LPCWSTR  pszName,
LPGUID  pguidInstance 
)
static

Definition at line 788 of file dinput_main.c.

790 {
792 
793  FIXME( "(%p)->(%s, %s, %p): stub\n", This, debugstr_guid(rguid), debugstr_w(pszName), pguidInstance );
794 
795  return DI_OK;
796 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_guid
Definition: kernel32.h:35
static IDirectInputImpl * impl_from_IDirectInput7W(IDirectInput7W *iface)
Definition: dinput_main.c:69
#define DI_OK
Definition: dinput.h:128

Referenced by IDirectInput8WImpl_FindDevice().

◆ IDirectInput7AImpl_CreateDeviceEx()

static HRESULT WINAPI IDirectInput7AImpl_CreateDeviceEx ( LPDIRECTINPUT7A  iface,
REFGUID  rguid,
REFIID  riid,
LPVOID pvOut,
LPUNKNOWN  lpUnknownOuter 
)
static

Definition at line 825 of file dinput_main.c.

827 {
829 
830  TRACE("(%p)->(%s, %s, %p, %p)\n", This, debugstr_guid(rguid), debugstr_guid(riid), pvOut, lpUnknownOuter);
831 
832  return create_device(This, rguid, riid, pvOut, FALSE);
833 }
REFIID riid
Definition: precomp.h:44
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
static IDirectInputImpl * impl_from_IDirectInput7A(IDirectInput7A *iface)
Definition: dinput_main.c:64
static HRESULT create_device(IDirectInputImpl *This, REFGUID rguid, REFIID riid, LPVOID *pvOut, BOOL unicode)
Definition: dinput_main.c:798

Referenced by IDirectInput8AImpl_CreateDevice(), and IDirectInputAImpl_CreateDevice().

◆ IDirectInput7WImpl_CreateDeviceEx()

static HRESULT WINAPI IDirectInput7WImpl_CreateDeviceEx ( LPDIRECTINPUT7W  iface,
REFGUID  rguid,
REFIID  riid,
LPVOID pvOut,
LPUNKNOWN  lpUnknownOuter 
)
static

Definition at line 835 of file dinput_main.c.

837 {
839 
840  TRACE("(%p)->(%s, %s, %p, %p)\n", This, debugstr_guid(rguid), debugstr_guid(riid), pvOut, lpUnknownOuter);
841 
842  return create_device(This, rguid, riid, pvOut, TRUE);
843 }
#define TRUE
Definition: types.h:120
REFIID riid
Definition: precomp.h:44
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
static IDirectInputImpl * impl_from_IDirectInput7W(IDirectInput7W *iface)
Definition: dinput_main.c:69
static HRESULT create_device(IDirectInputImpl *This, REFGUID rguid, REFIID riid, LPVOID *pvOut, BOOL unicode)
Definition: dinput_main.c:798

Referenced by IDirectInput8WImpl_CreateDevice(), and IDirectInputWImpl_CreateDevice().

◆ IDirectInput8AImpl_AddRef()

static ULONG WINAPI IDirectInput8AImpl_AddRef ( LPDIRECTINPUT8A  iface)
static

Definition at line 861 of file dinput_main.c.

862 {
864  return IDirectInputAImpl_AddRef( &This->IDirectInput7A_iface );
865 }
static IDirectInputImpl * impl_from_IDirectInput8A(IDirectInput8A *iface)
Definition: dinput_main.c:74
static ULONG WINAPI IDirectInputAImpl_AddRef(LPDIRECTINPUT7A iface)
Definition: dinput_main.c:540

◆ IDirectInput8AImpl_ConfigureDevices()

static HRESULT WINAPI IDirectInput8AImpl_ConfigureDevices ( LPDIRECTINPUT8A  iface,
LPDICONFIGUREDEVICESCALLBACK  lpdiCallback,
LPDICONFIGUREDEVICESPARAMSA  lpdiCDParams,
DWORD  dwFlags,
LPVOID  pvRefData 
)
static

Definition at line 1255 of file dinput_main.c.

1259 {
1261  DIACTIONFORMATW diafW;
1262  DICONFIGUREDEVICESPARAMSW diCDParamsW;
1263  HRESULT hr;
1264  int i;
1265 
1266  FIXME("(this=%p,%p,%p,%04x,%p): stub\n", This, lpdiCallback, lpdiCDParams, dwFlags, pvRefData);
1267 
1268  /* Copy parameters */
1269  diCDParamsW.dwSize = sizeof(DICONFIGUREDEVICESPARAMSW);
1270  diCDParamsW.dwcUsers = lpdiCDParams->dwcUsers;
1271  diCDParamsW.dwcFormats = lpdiCDParams->dwcFormats;
1272  diCDParamsW.lprgFormats = &diafW;
1273  diCDParamsW.hwnd = lpdiCDParams->hwnd;
1274  diCDParamsW.lptszUserNames = NULL;
1275 
1276  if (lpdiCDParams->lptszUserNames) {
1277  char *start = lpdiCDParams->lptszUserNames;
1278  WCHAR *to = NULL;
1279  int total_len = 0;
1280  for (i = 0; i < lpdiCDParams->dwcUsers; i++)
1281  {
1282  char *end = start + 1;
1283  int len;
1284  while (*(end++));
1286  total_len += len + 2; /* length of string and two null char */
1287  if (to)
1288  to = HeapReAlloc(GetProcessHeap(), 0, to, sizeof(WCHAR) * total_len);
1289  else
1290  to = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR) * total_len);
1291 
1292  MultiByteToWideChar(CP_ACP, 0, start, end - start, to + (total_len - len - 2), len);
1293  to[total_len] = 0;
1294  to[total_len - 1] = 0;
1295  }
1296  diCDParamsW.lptszUserNames = to;
1297  }
1298 
1299  diafW.rgoAction = HeapAlloc(GetProcessHeap(), 0, sizeof(DIACTIONW)*lpdiCDParams->lprgFormats->dwNumActions);
1300  _copy_diactionformatAtoW(&diafW, lpdiCDParams->lprgFormats);
1301 
1302  /* Copy action names */
1303  for (i=0; i < diafW.dwNumActions; i++)
1304  {
1305  const char* from = lpdiCDParams->lprgFormats->rgoAction[i].u.lptszActionName;
1306  int len = MultiByteToWideChar(CP_ACP, 0, from , -1, NULL , 0);
1307  WCHAR *to = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*len);
1308 
1309  MultiByteToWideChar(CP_ACP, 0, from , -1, to , len);
1310  diafW.rgoAction[i].u.lptszActionName = to;
1311  }
1312 
1313  hr = IDirectInput8WImpl_ConfigureDevices(&This->IDirectInput8W_iface, lpdiCallback, &diCDParamsW, dwFlags, pvRefData);
1314 
1315  /* Copy back configuration */
1316  if (SUCCEEDED(hr))
1317  _copy_diactionformatWtoA(lpdiCDParams->lprgFormats, &diafW);
1318 
1319  /* Free memory */
1320  for (i=0; i < diafW.dwNumActions; i++)
1321  HeapFree(GetProcessHeap(), 0, (void*) diafW.rgoAction[i].u.lptszActionName);
1322 
1323  HeapFree(GetProcessHeap(), 0, diafW.rgoAction);
1324 
1325  heap_free((void*) diCDParamsW.lptszUserNames);
1326 
1327  return hr;
1328 }
HRESULT hr
Definition: shlfolder.c:183
#define CP_ACP
Definition: compat.h:99
static IDirectInputImpl * impl_from_IDirectInput8A(IDirectInput8A *iface)
Definition: dinput_main.c:74
DWORD dwNumActions
Definition: dinput.h:1311
GLuint GLuint end
Definition: gl.h:1545
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
LPCSTR lptszActionName
Definition: dinput.h:1266
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
LPDIACTIONFORMATA lprgFormats
Definition: dinput.h:1387
LPDIACTIONFORMATW lprgFormats
Definition: dinput.h:1399
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
GLenum GLsizei len
Definition: glext.h:6722
LPDIACTIONW rgoAction
Definition: dinput.h:1330
static HRESULT WINAPI IDirectInput8WImpl_ConfigureDevices(LPDIRECTINPUT8W iface, LPDICONFIGUREDEVICESCALLBACK lpdiCallback, LPDICONFIGUREDEVICESPARAMSW lpdiCDParams, DWORD dwFlags, LPVOID pvRefData)
Definition: dinput_main.c:1242
void _copy_diactionformatAtoW(LPDIACTIONFORMATW to, LPDIACTIONFORMATA from)
Definition: dinput_main.c:339
struct _DICONFIGUREDEVICESPARAMSW DICONFIGUREDEVICESPARAMSW
GLuint start
Definition: gl.h:1545
#define HeapReAlloc
Definition: compat.h:401
void _copy_diactionformatWtoA(LPDIACTIONFORMATA to, LPDIACTIONFORMATW from)
Definition: dinput_main.c:366
LPDIACTIONA rgoAction
Definition: dinput.h:1312
#define MultiByteToWideChar
Definition: compat.h:100
DWORD dwNumActions
Definition: dinput.h:1329
CardRegion * from
Definition: spigame.cpp:19
#define HeapFree(x, y, z)
Definition: compat.h:402
#define SUCCEEDED(hr)
Definition: intsafe.h:57
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
LPCWSTR lptszActionName
Definition: dinput.h:1280

◆ IDirectInput8AImpl_CreateDevice()

static HRESULT WINAPI IDirectInput8AImpl_CreateDevice ( LPDIRECTINPUT8A  iface,
REFGUID  rguid,
LPDIRECTINPUTDEVICE8A pdev,
LPUNKNOWN  punk 
)
static

Definition at line 897 of file dinput_main.c.

899 {
901  return IDirectInput7AImpl_CreateDeviceEx( &This->IDirectInput7A_iface, rguid, NULL, (LPVOID*)pdev, punk );
902 }
static IDirectInputImpl * impl_from_IDirectInput8A(IDirectInput8A *iface)
Definition: dinput_main.c:74
static HRESULT WINAPI IDirectInput7AImpl_CreateDeviceEx(LPDIRECTINPUT7A iface, REFGUID rguid, REFIID riid, LPVOID *pvOut, LPUNKNOWN lpUnknownOuter)
Definition: dinput_main.c:825
smooth NULL
Definition: ftsmooth.c:416

◆ IDirectInput8AImpl_EnumDevices()

static HRESULT WINAPI IDirectInput8AImpl_EnumDevices ( LPDIRECTINPUT8A  iface,
DWORD  dwDevType,
LPDIENUMDEVICESCALLBACKA  lpCallback,
LPVOID  pvRef,
DWORD  dwFlags 
)
static

Definition at line 911 of file dinput_main.c.

913 {
915  return IDirectInputAImpl_EnumDevices( &This->IDirectInput7A_iface, dwDevType, lpCallback, pvRef, dwFlags );
916 }
static IDirectInputImpl * impl_from_IDirectInput8A(IDirectInput8A *iface)
Definition: dinput_main.c:74
static HRESULT WINAPI IDirectInputAImpl_EnumDevices(LPDIRECTINPUT7A iface, DWORD dwDevType, LPDIENUMDEVICESCALLBACKA lpCallback, LPVOID pvRef, DWORD dwFlags)
Definition: dinput_main.c:461
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175

◆ IDirectInput8AImpl_EnumDevicesBySemantics()

static HRESULT WINAPI IDirectInput8AImpl_EnumDevicesBySemantics ( LPDIRECTINPUT8A  iface,
LPCSTR  ptszUserName,
LPDIACTIONFORMATA  lpdiActionFormat,
LPDIENUMDEVICESBYSEMANTICSCBA  lpCallback,
LPVOID  pvRef,
DWORD  dwFlags 
)
static

Definition at line 1026 of file dinput_main.c.

1031 {
1032  static REFGUID guids[2] = { &GUID_SysKeyboard, &GUID_SysMouse };
1033  static const DWORD actionMasks[] = { DIKEYBOARD_MASK, DIMOUSE_MASK };
1035  DIDEVICEINSTANCEA didevi;
1036  LPDIRECTINPUTDEVICE8A lpdid;
1037  DWORD callbackFlags;
1038  int i, j;
1039  int device_count = 0;
1040  int remain;
1041  DIDEVICEINSTANCEA *didevis = 0;
1042  WCHAR *username_w = 0;
1043 
1044  FIXME("(this=%p,%s,%p,%p,%p,%04x): semi-stub\n", This, debugstr_a(ptszUserName), lpdiActionFormat,
1045  lpCallback, pvRef, dwFlags);
1046 #define X(x) if (dwFlags & x) FIXME("\tdwFlags |= "#x"\n");
1053 #undef X
1054 
1055  _dump_diactionformatA(lpdiActionFormat);
1056 
1057  didevi.dwSize = sizeof(didevi);
1058 
1059  if (ptszUserName)
1060  {
1061  int len = MultiByteToWideChar(CP_ACP, 0, ptszUserName, -1, 0, 0);
1062 
1063  username_w = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*len);
1064  MultiByteToWideChar(CP_ACP, 0, ptszUserName, -1, username_w, len);
1065  }
1066 
1067  /* Enumerate all the joysticks */
1068  for (i = 0; i < ARRAY_SIZE(dinput_devices); i++)
1069  {
1070  HRESULT enumSuccess;
1071 
1072  if (!dinput_devices[i]->enum_deviceA) continue;
1073 
1074  for (j = 0, enumSuccess = S_OK; SUCCEEDED(enumSuccess); j++)
1075  {
1076  TRACE(" - checking device %u ('%s')\n", i, dinput_devices[i]->name);
1077 
1078  /* Default behavior is to enumerate attached game controllers */
1079  enumSuccess = dinput_devices[i]->enum_deviceA(DI8DEVCLASS_GAMECTRL, DIEDFL_ATTACHEDONLY | dwFlags, &didevi, This->dwVersion, j);
1080  if (enumSuccess == S_OK &&
1081  should_enumerate_device(username_w, dwFlags, &This->device_players, &didevi.guidInstance))
1082  {
1083  if (device_count++)
1084  didevis = HeapReAlloc(GetProcessHeap(), 0, didevis, sizeof(DIDEVICEINSTANCEA)*device_count);
1085  else
1086  didevis = HeapAlloc(GetProcessHeap(), 0, sizeof(DIDEVICEINSTANCEA)*device_count);
1087  didevis[device_count-1] = didevi;
1088  }
1089  }
1090  }
1091 
1092  remain = device_count;
1093  /* Add keyboard and mouse to remaining device count */
1095  {
1096  for (i = 0; i < ARRAY_SIZE(guids); i++)
1097  {
1098  if (should_enumerate_device(username_w, dwFlags, &This->device_players, guids[i]))
1099  remain++;
1100  }
1101  }
1102 
1103  for (i = 0; i < device_count; i++)
1104  {
1105  callbackFlags = diactionformat_priorityA(lpdiActionFormat, lpdiActionFormat->dwGenre);
1106  IDirectInput_CreateDevice(iface, &didevis[i].guidInstance, &lpdid, NULL);
1107 
1108  if (lpCallback(&didevis[i], lpdid, callbackFlags, --remain, pvRef) == DIENUM_STOP)
1109  {
1111  HeapFree(GetProcessHeap(), 0, didevis);
1112  HeapFree(GetProcessHeap(), 0, username_w);
1113  return DI_OK;
1114  }
1116  }
1117 
1118  HeapFree(GetProcessHeap(), 0, didevis);
1119 
1121  {
1122  HeapFree(GetProcessHeap(), 0, username_w);
1123  return DI_OK;
1124  }
1125 
1126  /* Enumerate keyboard and mouse */
1127  for (i = 0; i < ARRAY_SIZE(guids); i++)
1128  {
1129  if (should_enumerate_device(username_w, dwFlags, &This->device_players, guids[i]))
1130  {
1131  callbackFlags = diactionformat_priorityA(lpdiActionFormat, actionMasks[i]);
1132 
1133  IDirectInput_CreateDevice(iface, guids[i], &lpdid, NULL);
1134  IDirectInputDevice_GetDeviceInfo(lpdid, &didevi);
1135 
1136  if (lpCallback(&didevi, lpdid, callbackFlags, --remain, pvRef) == DIENUM_STOP)
1137  {
1139  HeapFree(GetProcessHeap(), 0, username_w);
1140  return DI_OK;
1141  }
1143  }
1144  }
1145 
1146  HeapFree(GetProcessHeap(), 0, username_w);
1147  return DI_OK;
1148 }
GUID guidInstance
Definition: dinput.h:413
Definition: scsiwmi.h:51
#define IDirectInput_CreateDevice(p, a, b, c)
Definition: dinput.h:2296
#define CP_ACP
Definition: compat.h:99
#define DIEDBSFL_MULTIMICEKEYBOARDS
Definition: dinput.h:454
static IDirectInputImpl * impl_from_IDirectInput8A(IDirectInput8A *iface)
Definition: dinput_main.c:74
static BOOL should_enumerate_device(const WCHAR *username, DWORD dwFlags, struct list *device_players, REFGUID guid)
Definition: dinput_main.c:985
#define DIEDBSFL_FORCEFEEDBACK
Definition: dinput.h:452
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define X(x)
#define FIXME(fmt,...)
Definition: debug.h:110
#define DIENUM_STOP
Definition: dinput.h:187
smooth NULL
Definition: ftsmooth.c:416
#define IDirectInputDevice_Release(p)
Definition: dinput.h:1602
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define DIEDFL_ATTACHEDONLY
Definition: dinput.h:191
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
static const struct dinput_device * dinput_devices[]
Definition: dinput_main.c:89
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define DIEDBSFL_NONGAMINGDEVICES
Definition: dinput.h:455
GLenum GLsizei len
Definition: glext.h:6722
#define DIKEYBOARD_MASK
#define DIMOUSE_MASK
#define S_OK
Definition: intsafe.h:59
#define ARRAY_SIZE(a)
Definition: main.h:24
#define HeapReAlloc
Definition: compat.h:401
#define DIEDBSFL_AVAILABLEDEVICES
Definition: dinput.h:453
#define IDirectInputDevice_GetDeviceInfo(p, a)
Definition: dinput.h:1616
#define DIEDBSFL_THISUSER
Definition: dinput.h:451
#define MultiByteToWideChar
Definition: compat.h:100
static DWORD diactionformat_priorityA(LPDIACTIONFORMATA lpdiaf, DWORD genre)
Definition: dinput_main.c:399
struct IDirectInputDevice8A * LPDIRECTINPUTDEVICE8A
Definition: dinput.h:105
Definition: name.c:38
#define DI_OK
Definition: dinput.h:128
#define DI8DEVCLASS_GAMECTRL
Definition: dinput.h:207
static void _dump_diactionformatA(LPDIACTIONFORMATA lpdiActionFormat)
Definition: dinput_main.c:308
#define DIEDBSFL_ATTACHEDONLY
Definition: dinput.h:450
#define HeapFree(x, y, z)
Definition: compat.h:402
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ IDirectInput8AImpl_FindDevice()

static HRESULT WINAPI IDirectInput8AImpl_FindDevice ( LPDIRECTINPUT8A  iface,
REFGUID  rguid,
LPCSTR  pszName,
LPGUID  pguidInstance 
)
static

Definition at line 973 of file dinput_main.c.

974 {
976  return IDirectInput2AImpl_FindDevice( &This->IDirectInput7A_iface, rguid, pszName, pguidInstance );
977 }
static HRESULT WINAPI IDirectInput2AImpl_FindDevice(LPDIRECTINPUT7A iface, REFGUID rguid, LPCSTR pszName, LPGUID pguidInstance)
Definition: dinput_main.c:778
static IDirectInputImpl * impl_from_IDirectInput8A(IDirectInput8A *iface)
Definition: dinput_main.c:74

◆ IDirectInput8AImpl_GetDeviceStatus()

static HRESULT WINAPI IDirectInput8AImpl_GetDeviceStatus ( LPDIRECTINPUT8A  iface,
REFGUID  rguid 
)
static

Definition at line 925 of file dinput_main.c.

926 {
928  return IDirectInputAImpl_GetDeviceStatus( &This->IDirectInput7A_iface, rguid );
929 }
static HRESULT WINAPI IDirectInputAImpl_GetDeviceStatus(LPDIRECTINPUT7A iface, REFGUID rguid)
Definition: dinput_main.c:719
static IDirectInputImpl * impl_from_IDirectInput8A(IDirectInput8A *iface)
Definition: dinput_main.c:74

◆ IDirectInput8AImpl_Initialize()

static HRESULT WINAPI IDirectInput8AImpl_Initialize ( LPDIRECTINPUT8A  iface,
HINSTANCE  hinst,
DWORD  version 
)
static

Definition at line 949 of file dinput_main.c.

950 {
952 
953  TRACE("(%p)->(%p, 0x%04x)\n", This, hinst, version);
954 
955  if (!hinst)
956  return DIERR_INVALIDPARAM;
957  else if (version == 0)
958  return DIERR_NOTINITIALIZED;
959  else if (version < DIRECTINPUT_VERSION)
961  else if (version > DIRECTINPUT_VERSION)
963 
965 }
#define DIERR_NOTINITIALIZED
Definition: dinput.h:157
static IDirectInputImpl * impl_from_IDirectInput8A(IDirectInput8A *iface)
Definition: dinput_main.c:74
static HRESULT initialize_directinput_instance(IDirectInputImpl *This, DWORD dwVersion)
Definition: dinput_main.c:628
static const WCHAR version[]
Definition: asmname.c:66
#define DIERR_INVALIDPARAM
Definition: dinput.h:152
#define TRACE(s)
Definition: solgame.cpp:4
#define DIERR_OLDDIRECTINPUTVERSION
Definition: dinput.h:141
#define DIRECTINPUT_VERSION
Definition: precomp.h:4
static HINSTANCE hinst
Definition: edit.c:551
#define DIERR_BETADIRECTINPUTVERSION
Definition: dinput.h:143

Referenced by IDirectInput8WImpl_Initialize().

◆ IDirectInput8AImpl_QueryInterface()

static HRESULT WINAPI IDirectInput8AImpl_QueryInterface ( LPDIRECTINPUT8A  iface,
REFIID  riid,
LPVOID ppobj 
)
static

Definition at line 873 of file dinput_main.c.

874 {
876  return IDirectInputAImpl_QueryInterface( &This->IDirectInput7A_iface, riid, ppobj );
877 }
REFIID riid
Definition: precomp.h:44
static IDirectInputImpl * impl_from_IDirectInput8A(IDirectInput8A *iface)
Definition: dinput_main.c:74
static HRESULT WINAPI IDirectInputAImpl_QueryInterface(LPDIRECTINPUT7A iface, REFIID riid, LPVOID *ppobj)
Definition: dinput_main.c:577

◆ IDirectInput8AImpl_Release()

static ULONG WINAPI IDirectInput8AImpl_Release ( LPDIRECTINPUT8A  iface)
static

Definition at line 885 of file dinput_main.c.

886 {
888  return IDirectInputAImpl_Release( &This->IDirectInput7A_iface );
889 }
static IDirectInputImpl * impl_from_IDirectInput8A(IDirectInput8A *iface)
Definition: dinput_main.c:74
static ULONG WINAPI IDirectInputAImpl_Release(LPDIRECTINPUT7A iface)
Definition: dinput_main.c:555

◆ IDirectInput8AImpl_RunControlPanel()

static HRESULT WINAPI IDirectInput8AImpl_RunControlPanel ( LPDIRECTINPUT8A  iface,
HWND  hwndOwner,
DWORD  dwFlags 
)
static

Definition at line 937 of file dinput_main.c.

938 {
940  return IDirectInputAImpl_RunControlPanel( &This->IDirectInput7A_iface, hwndOwner, dwFlags );
941 }
static IDirectInputImpl * impl_from_IDirectInput8A(IDirectInput8A *iface)
Definition: dinput_main.c:74
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
static HRESULT WINAPI IDirectInputAImpl_RunControlPanel(LPDIRECTINPUT7A iface, HWND hwndOwner, DWORD dwFlags)
Definition: dinput_main.c:745

◆ IDirectInput8WImpl_AddRef()

static ULONG WINAPI IDirectInput8WImpl_AddRef ( LPDIRECTINPUT8W  iface)
static

Definition at line 867 of file dinput_main.c.

868 {
870  return IDirectInputAImpl_AddRef( &This->IDirectInput7A_iface );
871 }
static IDirectInputImpl * impl_from_IDirectInput8W(IDirectInput8W *iface)
Definition: dinput_main.c:79
static ULONG WINAPI IDirectInputAImpl_AddRef(LPDIRECTINPUT7A iface)
Definition: dinput_main.c:540

◆ IDirectInput8WImpl_ConfigureDevices()

static HRESULT WINAPI IDirectInput8WImpl_ConfigureDevices ( LPDIRECTINPUT8W  iface,
LPDICONFIGUREDEVICESCALLBACK  lpdiCallback,
LPDICONFIGUREDEVICESPARAMSW  lpdiCDParams,
DWORD  dwFlags,
LPVOID  pvRefData 
)
static

Definition at line 1242 of file dinput_main.c.

1246 {
1248 
1249  FIXME("(this=%p,%p,%p,%04x,%p): stub\n", This, lpdiCallback, lpdiCDParams, dwFlags, pvRefData);
1250 
1251  /* Call helper function in config.c to do the real work */
1252  return _configure_devices(iface, lpdiCallback, lpdiCDParams, dwFlags, pvRefData);
1253 }
HRESULT _configure_devices(IDirectInput8W *iface, LPDICONFIGUREDEVICESCALLBACK lpdiCallback, LPDICONFIGUREDEVICESPARAMSW lpdiCDParams, DWORD dwFlags, LPVOID pvRefData)
Definition: config.c:493
#define FIXME(fmt,...)
Definition: debug.h:110
static IDirectInputImpl * impl_from_IDirectInput8W(IDirectInput8W *iface)
Definition: dinput_main.c:79
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175

Referenced by IDirectInput8AImpl_ConfigureDevices().

◆ IDirectInput8WImpl_CreateDevice()

static HRESULT WINAPI IDirectInput8WImpl_CreateDevice ( LPDIRECTINPUT8W  iface,
REFGUID  rguid,
LPDIRECTINPUTDEVICE8W pdev,
LPUNKNOWN  punk 
)
static

Definition at line 904 of file dinput_main.c.

906 {
908  return IDirectInput7WImpl_CreateDeviceEx( &This->IDirectInput7W_iface, rguid, NULL, (LPVOID*)pdev, punk );
909 }
smooth NULL
Definition: ftsmooth.c:416
static IDirectInputImpl * impl_from_IDirectInput8W(IDirectInput8W *iface)
Definition: dinput_main.c:79
static HRESULT WINAPI IDirectInput7WImpl_CreateDeviceEx(LPDIRECTINPUT7W iface, REFGUID rguid, REFIID riid, LPVOID *pvOut, LPUNKNOWN lpUnknownOuter)
Definition: dinput_main.c:835

◆ IDirectInput8WImpl_EnumDevices()

static HRESULT WINAPI IDirectInput8WImpl_EnumDevices ( LPDIRECTINPUT8W  iface,
DWORD  dwDevType,
LPDIENUMDEVICESCALLBACKW  lpCallback,
LPVOID  pvRef,
DWORD  dwFlags 
)
static

Definition at line 918 of file dinput_main.c.

920 {
922  return IDirectInputWImpl_EnumDevices( &This->IDirectInput7W_iface, dwDevType, lpCallback, pvRef, dwFlags );
923 }
static HRESULT WINAPI IDirectInputWImpl_EnumDevices(LPDIRECTINPUT7W iface, DWORD dwDevType, LPDIENUMDEVICESCALLBACKW lpCallback, LPVOID pvRef, DWORD dwFlags)
Definition: dinput_main.c:502
static IDirectInputImpl * impl_from_IDirectInput8W(IDirectInput8W *iface)
Definition: dinput_main.c:79
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175

◆ IDirectInput8WImpl_EnumDevicesBySemantics()

static HRESULT WINAPI IDirectInput8WImpl_EnumDevicesBySemantics ( LPDIRECTINPUT8W  iface,
LPCWSTR  ptszUserName,
LPDIACTIONFORMATW  lpdiActionFormat,
LPDIENUMDEVICESBYSEMANTICSCBW  lpCallback,
LPVOID  pvRef,
DWORD  dwFlags 
)
static

Definition at line 1150 of file dinput_main.c.

1155 {
1156  static REFGUID guids[2] = { &GUID_SysKeyboard, &GUID_SysMouse };
1157  static const DWORD actionMasks[] = { DIKEYBOARD_MASK, DIMOUSE_MASK };
1159  DIDEVICEINSTANCEW didevi;
1160  LPDIRECTINPUTDEVICE8W lpdid;
1161  DWORD callbackFlags;
1162  int i, j;
1163  int device_count = 0;
1164  int remain;
1165  DIDEVICEINSTANCEW *didevis = 0;
1166 
1167  FIXME("(this=%p,%s,%p,%p,%p,%04x): semi-stub\n", This, debugstr_w(ptszUserName), lpdiActionFormat,
1168  lpCallback, pvRef, dwFlags);
1169 
1170  didevi.dwSize = sizeof(didevi);
1171 
1172  /* Enumerate all the joysticks */
1173  for (i = 0; i < ARRAY_SIZE(dinput_devices); i++)
1174  {
1175  HRESULT enumSuccess;
1176 
1177  if (!dinput_devices[i]->enum_deviceW) continue;
1178 
1179  for (j = 0, enumSuccess = S_OK; SUCCEEDED(enumSuccess); j++)
1180  {
1181  TRACE(" - checking device %u ('%s')\n", i, dinput_devices[i]->name);
1182 
1183  /* Default behavior is to enumerate attached game controllers */
1184  enumSuccess = dinput_devices[i]->enum_deviceW(DI8DEVCLASS_GAMECTRL, DIEDFL_ATTACHEDONLY | dwFlags, &didevi, This->dwVersion, j);
1185  if (enumSuccess == S_OK &&
1186  should_enumerate_device(ptszUserName, dwFlags, &This->device_players, &didevi.guidInstance))
1187  {
1188  if (device_count++)
1189  didevis = HeapReAlloc(GetProcessHeap(), 0, didevis, sizeof(DIDEVICEINSTANCEW)*device_count);
1190  else
1191  didevis = HeapAlloc(GetProcessHeap(), 0, sizeof(DIDEVICEINSTANCEW)*device_count);
1192  didevis[device_count-1] = didevi;
1193  }
1194  }
1195  }
1196 
1197  remain = device_count;
1198  /* Add keyboard and mouse to remaining device count */
1200  {
1201  for (i = 0; i < ARRAY_SIZE(guids); i++)
1202  {
1203  if (should_enumerate_device(ptszUserName, dwFlags, &This->device_players, guids[i]))
1204  remain++;
1205  }
1206  }
1207 
1208  for (i = 0; i < device_count; i++)
1209  {
1210  callbackFlags = diactionformat_priorityW(lpdiActionFormat, lpdiActionFormat->dwGenre);
1211  IDirectInput_CreateDevice(iface, &didevis[i].guidInstance, &lpdid, NULL);
1212 
1213  if (lpCallback(&didevis[i], lpdid, callbackFlags, --remain, pvRef) == DIENUM_STOP)
1214  {
1215  HeapFree(GetProcessHeap(), 0, didevis);
1216  return DI_OK;
1217  }
1218  }
1219 
1220  HeapFree(GetProcessHeap(), 0, didevis);
1221 
1222  if (dwFlags & DIEDBSFL_FORCEFEEDBACK) return DI_OK;
1223 
1224  /* Enumerate keyboard and mouse */
1225  for (i = 0; i < ARRAY_SIZE(guids); i++)
1226  {
1227  if (should_enumerate_device(ptszUserName, dwFlags, &This->device_players, guids[i]))
1228  {
1229  callbackFlags = diactionformat_priorityW(lpdiActionFormat, actionMasks[i]);
1230 
1231  IDirectInput_CreateDevice(iface, guids[i], &lpdid, NULL);
1232  IDirectInputDevice_GetDeviceInfo(lpdid, &didevi);
1233 
1234  if (lpCallback(&didevi, lpdid, callbackFlags, --remain, pvRef) == DIENUM_STOP)
1235  return DI_OK;
1236  }
1237  }
1238 
1239  return DI_OK;
1240 }
Definition: scsiwmi.h:51
#define IDirectInput_CreateDevice(p, a, b, c)
Definition: dinput.h:2296
static BOOL should_enumerate_device(const WCHAR *username, DWORD dwFlags, struct list *device_players, REFGUID guid)
Definition: dinput_main.c:985
#define DIEDBSFL_FORCEFEEDBACK
Definition: dinput.h:452
static DWORD diactionformat_priorityW(LPDIACTIONFORMATW lpdiaf, DWORD genre)
Definition: dinput_main.c:412
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define DIENUM_STOP
Definition: dinput.h:187
smooth NULL
Definition: ftsmooth.c:416
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define DIEDFL_ATTACHEDONLY
Definition: dinput.h:191
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
static const struct dinput_device * dinput_devices[]
Definition: dinput_main.c:89
static IDirectInputImpl * impl_from_IDirectInput8W(IDirectInput8W *iface)
Definition: dinput_main.c:79
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define DIKEYBOARD_MASK
#define DIMOUSE_MASK
#define S_OK
Definition: intsafe.h:59
struct IDirectInputDevice8W * LPDIRECTINPUTDEVICE8W
Definition: dinput.h:106
#define ARRAY_SIZE(a)
Definition: main.h:24
#define HeapReAlloc
Definition: compat.h:401
#define IDirectInputDevice_GetDeviceInfo(p, a)
Definition: dinput.h:1616
GUID guidInstance
Definition: dinput.h:426
Definition: name.c:38
#define DI_OK
Definition: dinput.h:128
#define DI8DEVCLASS_GAMECTRL
Definition: dinput.h:207
#define HeapFree(x, y, z)
Definition: compat.h:402
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ IDirectInput8WImpl_FindDevice()

static HRESULT WINAPI IDirectInput8WImpl_FindDevice ( LPDIRECTINPUT8W  iface,
REFGUID  rguid,
LPCWSTR  pszName,
LPGUID  pguidInstance 
)
static

Definition at line 979 of file dinput_main.c.

980 {
982  return IDirectInput2WImpl_FindDevice( &This->IDirectInput7W_iface, rguid, pszName, pguidInstance );
983 }
static IDirectInputImpl * impl_from_IDirectInput8W(IDirectInput8W *iface)
Definition: dinput_main.c:79
static HRESULT WINAPI IDirectInput2WImpl_FindDevice(LPDIRECTINPUT7W iface, REFGUID rguid, LPCWSTR pszName, LPGUID pguidInstance)
Definition: dinput_main.c:788

◆ IDirectInput8WImpl_GetDeviceStatus()

static HRESULT WINAPI IDirectInput8WImpl_GetDeviceStatus ( LPDIRECTINPUT8W  iface,
REFGUID  rguid 
)
static

Definition at line 931 of file dinput_main.c.

932 {
934  return IDirectInputAImpl_GetDeviceStatus( &This->IDirectInput7A_iface, rguid );
935 }
static HRESULT WINAPI IDirectInputAImpl_GetDeviceStatus(LPDIRECTINPUT7A iface, REFGUID rguid)
Definition: dinput_main.c:719
static IDirectInputImpl * impl_from_IDirectInput8W(IDirectInput8W *iface)
Definition: dinput_main.c:79

◆ IDirectInput8WImpl_Initialize()

static HRESULT WINAPI IDirectInput8WImpl_Initialize ( LPDIRECTINPUT8W  iface,
HINSTANCE  hinst,
DWORD  version 
)
static

Definition at line 967 of file dinput_main.c.

968 {
970  return IDirectInput8AImpl_Initialize( &This->IDirectInput8A_iface, hinst, version );
971 }
static const WCHAR version[]
Definition: asmname.c:66
static HRESULT WINAPI IDirectInput8AImpl_Initialize(LPDIRECTINPUT8A iface, HINSTANCE hinst, DWORD version)
Definition: dinput_main.c:949
static IDirectInputImpl * impl_from_IDirectInput8W(IDirectInput8W *iface)
Definition: dinput_main.c:79
static HINSTANCE hinst
Definition: edit.c:551

◆ IDirectInput8WImpl_QueryInterface()

static HRESULT WINAPI IDirectInput8WImpl_QueryInterface ( LPDIRECTINPUT8W  iface,
REFIID  riid,
LPVOID ppobj 
)
static

Definition at line 879 of file dinput_main.c.

880 {
882  return IDirectInputAImpl_QueryInterface( &This->IDirectInput7A_iface, riid, ppobj );
883 }
REFIID riid
Definition: precomp.h:44
static HRESULT WINAPI IDirectInputAImpl_QueryInterface(LPDIRECTINPUT7A iface, REFIID riid, LPVOID *ppobj)
Definition: dinput_main.c:577
static IDirectInputImpl * impl_from_IDirectInput8W(IDirectInput8W *iface)
Definition: dinput_main.c:79

◆ IDirectInput8WImpl_Release()

static ULONG WINAPI IDirectInput8WImpl_Release ( LPDIRECTINPUT8W  iface)
static

Definition at line 891 of file dinput_main.c.

892 {
894  return IDirectInputAImpl_Release( &This->IDirectInput7A_iface );
895 }
static IDirectInputImpl * impl_from_IDirectInput8W(IDirectInput8W *iface)
Definition: dinput_main.c:79
static ULONG WINAPI IDirectInputAImpl_Release(LPDIRECTINPUT7A iface)
Definition: dinput_main.c:555

◆ IDirectInput8WImpl_RunControlPanel()

static HRESULT WINAPI IDirectInput8WImpl_RunControlPanel ( LPDIRECTINPUT8W  iface,
HWND  hwndOwner,
DWORD  dwFlags 
)
static

Definition at line 943 of file dinput_main.c.

944 {
946  return IDirectInputAImpl_RunControlPanel( &This->IDirectInput7A_iface, hwndOwner, dwFlags );
947 }
static IDirectInputImpl * impl_from_IDirectInput8W(IDirectInput8W *iface)
Definition: dinput_main.c:79
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
static HRESULT WINAPI IDirectInputAImpl_RunControlPanel(LPDIRECTINPUT7A iface, HWND hwndOwner, DWORD dwFlags)
Definition: dinput_main.c:745

◆ IDirectInputAImpl_AddRef()

static ULONG WINAPI IDirectInputAImpl_AddRef ( LPDIRECTINPUT7A  iface)
static

Definition at line 540 of file dinput_main.c.

541 {
544 
545  TRACE( "(%p) ref %d\n", This, ref );
546  return ref;
547 }
Definition: send.c:47
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
static IDirectInputImpl * impl_from_IDirectInput7A(IDirectInput7A *iface)
Definition: dinput_main.c:64
#define InterlockedIncrement
Definition: armddk.h:53
unsigned int ULONG
Definition: retypes.h:1

Referenced by IDirectInput8AImpl_AddRef(), IDirectInput8WImpl_AddRef(), IDirectInputWImpl_AddRef(), and JoyConfig8Impl_AddRef().

◆ IDirectInputAImpl_CreateDevice()

static HRESULT WINAPI IDirectInputAImpl_CreateDevice ( LPDIRECTINPUT7A  iface,
REFGUID  rguid,
LPDIRECTINPUTDEVICEA pdev,
LPUNKNOWN  punk 
)
static

Definition at line 845 of file dinput_main.c.

847 {
848  return IDirectInput7AImpl_CreateDeviceEx(iface, rguid, NULL, (LPVOID*)pdev, punk);
849 }
static HRESULT WINAPI IDirectInput7AImpl_CreateDeviceEx(LPDIRECTINPUT7A iface, REFGUID rguid, REFIID riid, LPVOID *pvOut, LPUNKNOWN lpUnknownOuter)
Definition: dinput_main.c:825
smooth NULL
Definition: ftsmooth.c:416

◆ IDirectInputAImpl_EnumDevices()

static HRESULT WINAPI IDirectInputAImpl_EnumDevices ( LPDIRECTINPUT7A  iface,
DWORD  dwDevType,
LPDIENUMDEVICESCALLBACKA  lpCallback,
LPVOID  pvRef,
DWORD  dwFlags 
)
static

Definition at line 461 of file dinput_main.c.

464 {
466  DIDEVICEINSTANCEA devInstance;
467  unsigned int i;
468  int j;
469  HRESULT r;
470 
471  TRACE("(this=%p,0x%04x '%s',%p,%p,0x%04x)\n",
472  This, dwDevType, _dump_DIDEVTYPE_value(dwDevType, This->dwVersion),
473  lpCallback, pvRef, dwFlags);
475 
476  if (!lpCallback ||
478  (dwDevType > DI8DEVCLASS_GAMECTRL && dwDevType < DI8DEVTYPE_DEVICE) || dwDevType > DI8DEVTYPE_SUPPLEMENTAL)
479  return DIERR_INVALIDPARAM;
480 
481  if (!This->initialized)
482  return DIERR_NOTINITIALIZED;
483 
484  for (i = 0; i < ARRAY_SIZE(dinput_devices); i++) {
485  if (!dinput_devices[i]->enum_deviceA) continue;
486 
487  TRACE(" Checking device %u ('%s')\n", i, dinput_devices[i]->name);
488  for (j = 0, r = S_OK; SUCCEEDED(r); j++) {
489  devInstance.dwSize = sizeof(devInstance);
490  r = dinput_devices[i]->enum_deviceA(dwDevType, dwFlags, &devInstance, This->dwVersion, j);
491  if (r == S_OK)
492  if (enum_callback_wrapper(lpCallback, &devInstance, pvRef) == DIENUM_STOP)
493  return S_OK;
494  }
495  }
496 
497  return S_OK;
498 }
#define DIERR_NOTINITIALIZED
Definition: dinput.h:157
static const char * _dump_DIDEVTYPE_value(DWORD dwDevType, DWORD dwVersion)
Definition: dinput_main.c:242
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define DIEDFL_FORCEFEEDBACK
Definition: dinput.h:192
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define DIENUM_STOP
Definition: dinput.h:187
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define DIEDFL_ATTACHEDONLY
Definition: dinput.h:191
#define DIERR_INVALIDPARAM
Definition: dinput.h:152
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define enum_callback_wrapper(callback, instance, ref)
Definition: dinput_main.c:455
static IDirectInputImpl * impl_from_IDirectInput7A(IDirectInput7A *iface)
Definition: dinput_main.c:64
#define DIEDFL_INCLUDEPHANTOMS
Definition: dinput.h:194
static const struct dinput_device * dinput_devices[]
Definition: dinput_main.c:89
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define DIEDFL_INCLUDEALIASES
Definition: dinput.h:193
static void _dump_EnumDevices_dwFlags(DWORD dwFlags)
Definition: dinput_main.c:265
#define DIEDFL_INCLUDEHIDDEN
Definition: dinput.h:195
#define S_OK
Definition: intsafe.h:59
#define ARRAY_SIZE(a)
Definition: main.h:24
#define DI8DEVTYPE_DEVICE
Definition: dinput.h:209
#define DI8DEVTYPE_SUPPLEMENTAL
Definition: dinput.h:220
Definition: name.c:38
#define DI8DEVCLASS_GAMECTRL
Definition: dinput.h:207
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by IDirectInput8AImpl_EnumDevices().

◆ IDirectInputAImpl_GetDeviceStatus()

static HRESULT WINAPI IDirectInputAImpl_GetDeviceStatus ( LPDIRECTINPUT7A  iface,
REFGUID  rguid 
)
static

Definition at line 719 of file dinput_main.c.

720 {
722  HRESULT hr;
724 
725  TRACE( "(%p)->(%s)\n", This, debugstr_guid(rguid) );
726 
727  if (!rguid) return E_POINTER;
728  if (!This->initialized)
729  return DIERR_NOTINITIALIZED;
730 
731  hr = IDirectInput_CreateDevice( iface, rguid, &device, NULL );
732  if (hr != DI_OK) return DI_NOTATTACHED;
733 
734  IUnknown_Release( device );
735 
736  return DI_OK;
737 }
#define DIERR_NOTINITIALIZED
Definition: dinput.h:157
HRESULT hr
Definition: shlfolder.c:183
#define IDirectInput_CreateDevice(p, a, b, c)
Definition: dinput.h:2296
#define DI_NOTATTACHED
Definition: dinput.h:129
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
struct IDirectInputDeviceA * LPDIRECTINPUTDEVICEA
Definition: dinput.h:99
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
static IDirectInputImpl * impl_from_IDirectInput7A(IDirectInput7A *iface)
Definition: dinput_main.c:64
#define DI_OK
Definition: dinput.h:128
#define E_POINTER
Definition: winerror.h:2365

Referenced by IDirectInput8AImpl_GetDeviceStatus(), IDirectInput8WImpl_GetDeviceStatus(), and IDirectInputWImpl_GetDeviceStatus().

◆ IDirectInputAImpl_Initialize()

static HRESULT WINAPI IDirectInputAImpl_Initialize ( LPDIRECTINPUT7A  iface,
HINSTANCE  hinst,
DWORD  version 
)
static

Definition at line 692 of file dinput_main.c.

693 {
695 
696  TRACE("(%p)->(%p, 0x%04x)\n", This, hinst, version);
697 
698  if (!hinst)
699  return DIERR_INVALIDPARAM;
700  else if (version == 0)
701  return DIERR_NOTINITIALIZED;
702  else if (version > DIRECTINPUT_VERSION_700)
709 
711 }
#define DIERR_NOTINITIALIZED
Definition: dinput.h:157
static HRESULT initialize_directinput_instance(IDirectInputImpl *This, DWORD dwVersion)
Definition: dinput_main.c:628
static const WCHAR version[]
Definition: asmname.c:66
#define DIERR_INVALIDPARAM
Definition: dinput.h:152
#define TRACE(s)
Definition: solgame.cpp:4
#define DIERR_OLDDIRECTINPUTVERSION
Definition: dinput.h:141
static IDirectInputImpl * impl_from_IDirectInput7A(IDirectInput7A *iface)
Definition: dinput_main.c:64
#define DIRECTINPUT_VERSION
Definition: precomp.h:4
static HINSTANCE hinst
Definition: edit.c:551
#define DIERR_BETADIRECTINPUTVERSION
Definition: dinput.h:143

Referenced by IDirectInputWImpl_Initialize().

◆ IDirectInputAImpl_QueryInterface()

static HRESULT WINAPI IDirectInputAImpl_QueryInterface ( LPDIRECTINPUT7A  iface,
REFIID  riid,
LPVOID ppobj 
)
static

Definition at line 577 of file dinput_main.c.

578 {
580 
581  TRACE( "(%p)->(%s,%p)\n", This, debugstr_guid(riid), ppobj );
582 
583  if (!riid || !ppobj)
584  return E_POINTER;
585 
586  *ppobj = NULL;
587 
588 #if DIRECTINPUT_VERSION == 0x0700
589  if (IsEqualGUID( &IID_IUnknown, riid ) ||
590  IsEqualGUID( &IID_IDirectInputA, riid ) ||
591  IsEqualGUID( &IID_IDirectInput2A, riid ) ||
592  IsEqualGUID( &IID_IDirectInput7A, riid ))
593  *ppobj = &This->IDirectInput7A_iface;
594  else if (IsEqualGUID( &IID_IDirectInputW, riid ) ||
595  IsEqualGUID( &IID_IDirectInput2W, riid ) ||
596  IsEqualGUID( &IID_IDirectInput7W, riid ))
597  *ppobj = &This->IDirectInput7W_iface;
598 
599 #else
600  if (IsEqualGUID( &IID_IUnknown, riid ) ||
601  IsEqualGUID( &IID_IDirectInput8A, riid ))
602  *ppobj = &This->IDirectInput8A_iface;
603 
604  else if (IsEqualGUID( &IID_IDirectInput8W, riid ))
605  *ppobj = &This->IDirectInput8W_iface;
606 
607 #endif
608 
609  if (IsEqualGUID( &IID_IDirectInputJoyConfig8, riid ))
610  *ppobj = &This->IDirectInputJoyConfig8_iface;
611 
612  if(*ppobj)
613  {
614  IUnknown_AddRef( (IUnknown*)*ppobj );
615  return DI_OK;
616  }
617 
618  WARN( "Unsupported interface: %s\n", debugstr_guid(riid));
619  return E_NOINTERFACE;
620 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
static IDirectInputImpl * impl_from_IDirectInput7A(IDirectInput7A *iface)
Definition: dinput_main.c:64
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
#define DI_OK
Definition: dinput.h:128
#define E_POINTER
Definition: winerror.h:2365

Referenced by IDirectInput8AImpl_QueryInterface(), IDirectInput8WImpl_QueryInterface(), IDirectInputWImpl_QueryInterface(), and JoyConfig8Impl_QueryInterface().

◆ IDirectInputAImpl_Release()

static ULONG WINAPI IDirectInputAImpl_Release ( LPDIRECTINPUT7A  iface)
static

Definition at line 555 of file dinput_main.c.

556 {
558  ULONG ref = InterlockedDecrement( &This->ref );
559 
560  TRACE( "(%p) ref %d\n", This, ref );
561 
562  if (ref == 0)
563  {
565  HeapFree( GetProcessHeap(), 0, This );
566  }
567 
568  return ref;
569 }
Definition: send.c:47
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
static IDirectInputImpl * impl_from_IDirectInput7A(IDirectInput7A *iface)
Definition: dinput_main.c:64
#define InterlockedDecrement
Definition: armddk.h:52
unsigned int ULONG
Definition: retypes.h:1
static void uninitialize_directinput_instance(IDirectInputImpl *This)
Definition: dinput_main.c:658
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by IDirectInput8AImpl_Release(), IDirectInput8WImpl_Release(), IDirectInputWImpl_Release(), and JoyConfig8Impl_Release().

◆ IDirectInputAImpl_RunControlPanel()

static HRESULT WINAPI IDirectInputAImpl_RunControlPanel ( LPDIRECTINPUT7A  iface,
HWND  hwndOwner,
DWORD  dwFlags 
)
static

Definition at line 745 of file dinput_main.c.

748 {
749  WCHAR control_exeW[] = {'c','o','n','t','r','o','l','.','e','x','e',0};
750  STARTUPINFOW si = {0};
752 
754 
755  TRACE( "(%p)->(%p, %08x)\n", This, hwndOwner, dwFlags );
756 
757  if (hwndOwner && !IsWindow(hwndOwner))
758  return E_HANDLE;
759 
760  if (dwFlags)
761  return DIERR_INVALIDPARAM;
762 
763  if (!This->initialized)
764  return DIERR_NOTINITIALIZED;
765 
766  if (!CreateProcessW(NULL, control_exeW, NULL, NULL, FALSE, DETACHED_PROCESS, NULL, NULL, &si, &pi))
768 
769  return DI_OK;
770 }
#define DIERR_NOTINITIALIZED
Definition: dinput.h:157
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define E_HANDLE
Definition: winerror.h:2850
BOOL WINAPI IsWindow(_In_opt_ HWND)
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4593
#define DIERR_INVALIDPARAM
Definition: dinput.h:152
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
static refpint_t pi[]
Definition: server.c:96
static IDirectInputImpl * impl_from_IDirectInput7A(IDirectInput7A *iface)
Definition: dinput_main.c:64
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define DETACHED_PROCESS
Definition: winbase.h:179
#define DI_OK
Definition: dinput.h:128

Referenced by IDirectInput8AImpl_RunControlPanel(), IDirectInput8WImpl_RunControlPanel(), and IDirectInputWImpl_RunControlPanel().

◆ IDirectInputWImpl_AddRef()

static ULONG WINAPI IDirectInputWImpl_AddRef ( LPDIRECTINPUT7W  iface)
static

Definition at line 549 of file dinput_main.c.

550 {
552  return IDirectInputAImpl_AddRef( &This->IDirectInput7A_iface );
553 }
static IDirectInputImpl * impl_from_IDirectInput7W(IDirectInput7W *iface)
Definition: dinput_main.c:69
static ULONG WINAPI IDirectInputAImpl_AddRef(LPDIRECTINPUT7A iface)
Definition: dinput_main.c:540

◆ IDirectInputWImpl_CreateDevice()

static HRESULT WINAPI IDirectInputWImpl_CreateDevice ( LPDIRECTINPUT7W  iface,
REFGUID  rguid,
LPDIRECTINPUTDEVICEW pdev,
LPUNKNOWN  punk 
)
static

Definition at line 851 of file dinput_main.c.

853 {
854  return IDirectInput7WImpl_CreateDeviceEx(iface, rguid, NULL, (LPVOID*)pdev, punk);
855 }
smooth NULL
Definition: ftsmooth.c:416
static HRESULT WINAPI IDirectInput7WImpl_CreateDeviceEx(LPDIRECTINPUT7W iface, REFGUID rguid, REFIID riid, LPVOID *pvOut, LPUNKNOWN lpUnknownOuter)
Definition: dinput_main.c:835

◆ IDirectInputWImpl_EnumDevices()

static HRESULT WINAPI IDirectInputWImpl_EnumDevices ( LPDIRECTINPUT7W  iface,
DWORD  dwDevType,
LPDIENUMDEVICESCALLBACKW  lpCallback,
LPVOID  pvRef,
DWORD  dwFlags 
)
static

Definition at line 502 of file dinput_main.c.

505 {
507  DIDEVICEINSTANCEW devInstance;
508  unsigned int i;
509  int j;
510  HRESULT r;
511 
512  TRACE("(this=%p,0x%04x '%s',%p,%p,0x%04x)\n",
513  This, dwDevType, _dump_DIDEVTYPE_value(dwDevType, This->dwVersion),
514  lpCallback, pvRef, dwFlags);
516 
517  if (!lpCallback ||
519  (dwDevType > DI8DEVCLASS_GAMECTRL && dwDevType < DI8DEVTYPE_DEVICE) || dwDevType > DI8DEVTYPE_SUPPLEMENTAL)
520  return DIERR_INVALIDPARAM;
521 
522  if (!This->initialized)
523  return DIERR_NOTINITIALIZED;
524 
525  for (i = 0; i < ARRAY_SIZE(dinput_devices); i++) {
526  if (!dinput_devices[i]->enum_deviceW) continue;
527  for (j = 0, r = S_OK; SUCCEEDED(r); j++) {
528  devInstance.dwSize = sizeof(devInstance);
529  TRACE(" - checking device %u ('%s')\n", i, dinput_devices[i]->name);
530  r = dinput_devices[i]->enum_deviceW(dwDevType, dwFlags, &devInstance, This->dwVersion, j);
531  if (r == S_OK)
532  if (enum_callback_wrapper(lpCallback, &devInstance, pvRef) == DIENUM_STOP)
533  return S_OK;
534  }
535  }
536 
537  return S_OK;
538 }
#define DIERR_NOTINITIALIZED
Definition: dinput.h:157
static const char * _dump_DIDEVTYPE_value(DWORD dwDevType, DWORD dwVersion)
Definition: dinput_main.c:242
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define DIEDFL_FORCEFEEDBACK
Definition: dinput.h:192
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define DIENUM_STOP
Definition: dinput.h:187
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define DIEDFL_ATTACHEDONLY
Definition: dinput.h:191
#define DIERR_INVALIDPARAM
Definition: dinput.h:152
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define enum_callback_wrapper(callback, instance, ref)
Definition: dinput_main.c:455
#define DIEDFL_INCLUDEPHANTOMS
Definition: dinput.h:194
static const struct dinput_device * dinput_devices[]
Definition: dinput_main.c:89
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define DIEDFL_INCLUDEALIASES
Definition: dinput.h:193
static IDirectInputImpl * impl_from_IDirectInput7W(IDirectInput7W *iface)
Definition: dinput_main.c:69
static void _dump_EnumDevices_dwFlags(DWORD dwFlags)
Definition: dinput_main.c:265
#define DIEDFL_INCLUDEHIDDEN
Definition: dinput.h:195
#define S_OK
Definition: intsafe.h:59
#define ARRAY_SIZE(a)
Definition: main.h:24
#define DI8DEVTYPE_DEVICE
Definition: dinput.h:209
#define DI8DEVTYPE_SUPPLEMENTAL
Definition: dinput.h:220
Definition: name.c:38
#define DI8DEVCLASS_GAMECTRL
Definition: dinput.h:207
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by IDirectInput8WImpl_EnumDevices().

◆ IDirectInputWImpl_GetDeviceStatus()

static HRESULT WINAPI IDirectInputWImpl_GetDeviceStatus ( LPDIRECTINPUT7W  iface,
REFGUID  rguid 
)
static

Definition at line 739 of file dinput_main.c.

740 {
742  return IDirectInputAImpl_GetDeviceStatus( &This->IDirectInput7A_iface, rguid );
743 }
static HRESULT WINAPI IDirectInputAImpl_GetDeviceStatus(LPDIRECTINPUT7A iface, REFGUID rguid)
Definition: dinput_main.c:719
static IDirectInputImpl * impl_from_IDirectInput7W(IDirectInput7W *iface)
Definition: dinput_main.c:69

◆ IDirectInputWImpl_Initialize()

static HRESULT WINAPI IDirectInputWImpl_Initialize ( LPDIRECTINPUT7W  iface,
HINSTANCE  hinst,
DWORD  x 
)
static

Definition at line 713 of file dinput_main.c.

714 {
716  return IDirectInputAImpl_Initialize( &This->IDirectInput7A_iface, hinst, x );
717 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
static HRESULT WINAPI IDirectInputAImpl_Initialize(LPDIRECTINPUT7A iface, HINSTANCE hinst, DWORD version)
Definition: dinput_main.c:692
static IDirectInputImpl * impl_from_IDirectInput7W(IDirectInput7W *iface)
Definition: dinput_main.c:69
static HINSTANCE hinst
Definition: edit.c:551

◆ IDirectInputWImpl_QueryInterface()

static HRESULT WINAPI IDirectInputWImpl_QueryInterface ( LPDIRECTINPUT7W  iface,
REFIID  riid,
LPVOID ppobj 
)
static

Definition at line 622 of file dinput_main.c.

623 {
625  return IDirectInputAImpl_QueryInterface( &This->IDirectInput7A_iface, riid, ppobj );
626 }
REFIID riid
Definition: precomp.h:44
static HRESULT WINAPI IDirectInputAImpl_QueryInterface(LPDIRECTINPUT7A iface, REFIID riid, LPVOID *ppobj)
Definition: dinput_main.c:577
static IDirectInputImpl * impl_from_IDirectInput7W(IDirectInput7W *iface)
Definition: dinput_main.c:69

◆ IDirectInputWImpl_Release()

static ULONG WINAPI IDirectInputWImpl_Release ( LPDIRECTINPUT7W  iface)
static

Definition at line 571 of file dinput_main.c.

572 {
574  return IDirectInputAImpl_Release( &This->IDirectInput7A_iface );
575 }
static IDirectInputImpl * impl_from_IDirectInput7W(IDirectInput7W *iface)
Definition: dinput_main.c:69
static ULONG WINAPI IDirectInputAImpl_Release(LPDIRECTINPUT7A iface)
Definition: dinput_main.c:555

◆ IDirectInputWImpl_RunControlPanel()

static HRESULT WINAPI IDirectInputWImpl_RunControlPanel ( LPDIRECTINPUT7W  iface,
HWND  hwndOwner,
DWORD  dwFlags 
)
static

Definition at line 772 of file dinput_main.c.

773 {
775  return IDirectInputAImpl_RunControlPanel( &This->IDirectInput7A_iface, hwndOwner, dwFlags );
776 }
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
static IDirectInputImpl * impl_from_IDirectInput7W(IDirectInput7W *iface)
Definition: dinput_main.c:69
static HRESULT WINAPI IDirectInputAImpl_RunControlPanel(LPDIRECTINPUT7A iface, HWND hwndOwner, DWORD dwFlags)
Definition: dinput_main.c:745

◆ impl_from_IClassFactory()

static IClassFactoryImpl* impl_from_IClassFactory ( IClassFactory iface)
inlinestatic

Definition at line 1578 of file dinput_main.c.

1579 {
1580  return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface);
1581 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by DICF_AddRef(), DICF_CreateInstance(), DICF_LockServer(), DICF_QueryInterface(), and DICF_Release().

◆ impl_from_IDirectInput7A()

static IDirectInputImpl* impl_from_IDirectInput7A ( IDirectInput7A *  iface)
inlinestatic

Definition at line 64 of file dinput_main.c.

65 {
66  return CONTAINING_RECORD( iface, IDirectInputImpl, IDirectInput7A_iface );
67 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by IDirectInput2AImpl_FindDevice(), IDirectInput7AImpl_CreateDeviceEx(), IDirectInputAImpl_AddRef(), IDirectInputAImpl_EnumDevices(), IDirectInputAImpl_GetDeviceStatus(), IDirectInputAImpl_Initialize(), IDirectInputAImpl_QueryInterface(), IDirectInputAImpl_Release(), and IDirectInputAImpl_RunControlPanel().

◆ impl_from_IDirectInput7W()

static IDirectInputImpl* impl_from_IDirectInput7W ( IDirectInput7W *  iface)
inlinestatic

Definition at line 69 of file dinput_main.c.

70 {
71  return CONTAINING_RECORD( iface, IDirectInputImpl, IDirectInput7W_iface );
72 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by IDirectInput2WImpl_FindDevice(), IDirectInput7WImpl_CreateDeviceEx(), IDirectInputWImpl_AddRef(), IDirectInputWImpl_EnumDevices(), IDirectInputWImpl_GetDeviceStatus(), IDirectInputWImpl_Initialize(), IDirectInputWImpl_QueryInterface(), IDirectInputWImpl_Release(), and IDirectInputWImpl_RunControlPanel().

◆ impl_from_IDirectInput8A()

static IDirectInputImpl* impl_from_IDirectInput8A ( IDirectInput8A *  iface)
inlinestatic

Definition at line 74 of file dinput_main.c.

75 {
76  return CONTAINING_RECORD( iface, IDirectInputImpl, IDirectInput8A_iface );
77 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by IDirectInput8AImpl_AddRef(), IDirectInput8AImpl_ConfigureDevices(), IDirectInput8AImpl_CreateDevice(), IDirectInput8AImpl_EnumDevices(), IDirectInput8AImpl_EnumDevicesBySemantics(), IDirectInput8AImpl_FindDevice(), IDirectInput8AImpl_GetDeviceStatus(), IDirectInput8AImpl_Initialize(), IDirectInput8AImpl_QueryInterface(), IDirectInput8AImpl_Release(), and IDirectInput8AImpl_RunControlPanel().

◆ impl_from_IDirectInput8W()

static IDirectInputImpl* impl_from_IDirectInput8W ( IDirectInput8W *  iface)
inlinestatic

Definition at line 79 of file dinput_main.c.

80 {
81  return CONTAINING_RECORD( iface, IDirectInputImpl, IDirectInput8W_iface );
82 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by IDirectInput8WImpl_AddRef(), IDirectInput8WImpl_ConfigureDevices(), IDirectInput8WImpl_CreateDevice(), IDirectInput8WImpl_EnumDevices(), IDirectInput8WImpl_EnumDevicesBySemantics(), IDirectInput8WImpl_FindDevice(), IDirectInput8WImpl_GetDeviceStatus(), IDirectInput8WImpl_Initialize(), IDirectInput8WImpl_QueryInterface(), IDirectInput8WImpl_Release(), and IDirectInput8WImpl_RunControlPanel().

◆ impl_from_IDirectInputDevice8W()

static IDirectInputDeviceImpl* impl_from_IDirectInputDevice8W ( IDirectInputDevice8W *  iface)
inlinestatic

Definition at line 84 of file dinput_main.c.

85 {
86  return CONTAINING_RECORD(iface, IDirectInputDeviceImpl, IDirectInputDevice8W_iface);
87 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by check_dinput_hooks().

◆ impl_from_IDirectInputJoyConfig8()

static IDirectInputImpl* impl_from_IDirectInputJoyConfig8 ( IDirectInputJoyConfig8 *  iface)
inlinestatic

Definition at line 1334 of file dinput_main.c.

1335 {
1336  return CONTAINING_RECORD( iface, IDirectInputImpl, IDirectInputJoyConfig8_iface );
1337 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by JoyConfig8Impl_AddRef(), JoyConfig8Impl_GetConfig(), JoyConfig8Impl_QueryInterface(), and JoyConfig8Impl_Release().

◆ initialize_directinput_instance()

static HRESULT initialize_directinput_instance ( IDirectInputImpl This,
DWORD  dwVersion 
)
static

Definition at line 628 of file dinput_main.c.

629 {
630  if (!This->initialized)
631  {
632  This->dwVersion = dwVersion;
633  This->evsequence = 1;
634 
636  This->crit.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": IDirectInputImpl*->crit");
637 
638  list_init( &This->devices_list );
639  list_init( &This->device_players );
640 
641  /* Add self to the list of the IDirectInputs */
643  list_add_head( &direct_input_list, &This->entry );
645 
646  This->initialized = TRUE;
647 
648  if (!check_hook_thread())
649  {
651  return DIERR_GENERIC;
652  }
653  }
654 
655  return DI_OK;
656 }
#define TRUE
Definition: types.h:120
#define DWORD_PTR
Definition: treelist.c:76
static CRITICAL_SECTION dinput_hook_crit
Definition: dinput_main.c:101
__WINE_SERVER_LIST_INLINE void list_add_head(struct list *list, struct list *elem)
Definition: list.h:96
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
static BOOL check_hook_thread(void)
Definition: dinput_main.c:1828
#define DIERR_GENERIC
Definition: dinput.h:154
#define DI_OK
Definition: dinput.h:128
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static struct list direct_input_list
Definition: dinput_main.c:102
static void uninitialize_directinput_instance(IDirectInputImpl *This)
Definition: dinput_main.c:658

Referenced by IDirectInput8AImpl_Initialize(), and IDirectInputAImpl_Initialize().

◆ JoyConfig8Impl_Acquire()

static HRESULT WINAPI JoyConfig8Impl_Acquire ( IDirectInputJoyConfig8 *  iface)
static

Definition at line 1357 of file dinput_main.c.

1358 {
1359  FIXME( "(%p): stub!\n", iface );
1360  return E_NOTIMPL;
1361 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ JoyConfig8Impl_AddNewHardware()

static HRESULT WINAPI JoyConfig8Impl_AddNewHardware ( IDirectInputJoyConfig8 *  iface,
HWND  hwnd,
REFGUID  guid 
)
static

Definition at line 1473 of file dinput_main.c.

1474 {
1475  FIXME( "(%p)->(%p, %s): stub!\n", iface, hwnd, debugstr_guid(guid) );
1476  return E_NOTIMPL;
1477 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
const GUID * guid
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_guid
Definition: kernel32.h:35
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ JoyConfig8Impl_AddRef()

static ULONG WINAPI JoyConfig8Impl_AddRef ( IDirectInputJoyConfig8 *  iface)
static

Definition at line 1345 of file dinput_main.c.

1346 {
1348  return IDirectInputAImpl_AddRef( &This->IDirectInput7A_iface );
1349 }
static IDirectInputImpl * impl_from_IDirectInputJoyConfig8(IDirectInputJoyConfig8 *iface)
Definition: dinput_main.c:1334
static ULONG WINAPI IDirectInputAImpl_AddRef(LPDIRECTINPUT7A iface)
Definition: dinput_main.c:540

◆ JoyConfig8Impl_DeleteConfig()

static HRESULT WINAPI JoyConfig8Impl_DeleteConfig ( IDirectInputJoyConfig8 *  iface,
UINT  id 
)
static

Definition at line 1455 of file dinput_main.c.

1456 {
1457  FIXME( "(%p)->(%d): stub!\n", iface, id );
1458  return E_NOTIMPL;
1459 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ JoyConfig8Impl_DeleteType()

static HRESULT WINAPI JoyConfig8Impl_DeleteType ( IDirectInputJoyConfig8 *  iface,
LPCWSTR  name 
)
static

Definition at line 1400 of file dinput_main.c.

1401 {
1402  FIXME( "(%p)->(%s): stub!\n", iface, debugstr_w(name) );
1403  return E_NOTIMPL;
1404 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
Definition: name.c:38

◆ JoyConfig8Impl_EnumTypes()

static HRESULT WINAPI JoyConfig8Impl_EnumTypes ( IDirectInputJoyConfig8 *  iface,
LPDIJOYTYPECALLBACK  cb,
void ref 
)
static

Definition at line 1381 of file dinput_main.c.

1382 {
1383  FIXME( "(%p)->(%p, %p): stub!\n", iface, cb, ref );
1384  return E_NOTIMPL;
1385 }
Definition: send.c:47
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
static HMODULE MODULEINFO DWORD cb
Definition: module.c:32

◆ JoyConfig8Impl_GetConfig()

static HRESULT WINAPI JoyConfig8Impl_GetConfig ( IDirectInputJoyConfig8 *  iface,
UINT  id,
LPDIJOYCONFIG  info,
DWORD  flags 
)
static

Definition at line 1406 of file dinput_main.c.

1407 {
1409  UINT found = 0;
1410  int i, j;
1411  HRESULT r;
1412 
1413  FIXME("(%p)->(%d, %p, 0x%08x): semi-stub!\n", iface, id, info, flags);
1414 
1415 #define X(x) if (flags & x) FIXME("\tflags |= "#x"\n");
1418  X(DIJC_GAIN)
1419  X(DIJC_CALLOUT)
1420 #undef X
1421 
1422  /* Enumerate all joysticks in order */
1423  for (i = 0; i < ARRAY_SIZE(dinput_devices); i++)
1424  {
1425  if (!dinput_devices[i]->enum_deviceA) continue;
1426 
1427  for (j = 0, r = S_OK; SUCCEEDED(r); j++)
1428  {
1430  dev.dwSize = sizeof(dev);
1431  if ((r = dinput_devices[i]->enum_deviceA(DI8DEVCLASS_GAMECTRL, 0, &dev, di->dwVersion, j)) == S_OK)
1432  {
1433  /* Only take into account the chosen id */
1434  if (found == id)
1435  {
1436  if (flags & DIJC_GUIDINSTANCE)
1437  info->guidInstance = dev.guidInstance;
1438 
1439  return DI_OK;
1440  }
1441  found += 1;
1442  }
1443  }
1444  }
1445 
1446  return DIERR_NOMOREITEMS;
1447 }
#define DIJC_CALLOUT
Definition: dinputd.h:133
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define DIERR_NOMOREITEMS
Definition: dinputd.h:47
static int dev
Definition: mkdosfs.c:536
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define X(x)
#define FIXME(fmt,...)
Definition: debug.h:110
static IDirectInputImpl * impl_from_IDirectInputJoyConfig8(IDirectInputJoyConfig8 *iface)
Definition: dinput_main.c:1334
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
LONG HRESULT
Definition: typedefs.h:77
#define DIJC_GUIDINSTANCE
Definition: dinputd.h:130
GLbitfield flags
Definition: glext.h:7161
static const struct dinput_device * dinput_devices[]
Definition: dinput_main.c:89
#define S_OK
Definition: intsafe.h:59
#define ARRAY_SIZE(a)
Definition: main.h:24
unsigned int UINT
Definition: ndis.h:50
#define DI_OK
Definition: dinput.h:128
#define DI8DEVCLASS_GAMECTRL
Definition: dinput.h:207
#define SUCCEEDED(hr)
Definition: intsafe.h:57
#define DIJC_GAIN
Definition: dinputd.h:132
#define DIJC_REGHWCONFIGTYPE
Definition: dinputd.h:131

◆ JoyConfig8Impl_GetTypeInfo()

static HRESULT WINAPI JoyConfig8Impl_GetTypeInfo ( IDirectInputJoyConfig8 *  iface,
LPCWSTR  name,
LPDIJOYTYPEINFO  info,
DWORD  flags 
)
static

Definition at line 1387 of file dinput_main.c.

1388 {
1389  FIXME( "(%p)->(%s, %p, 0x%08x): stub!\n", iface, debugstr_w(name), info, flags );
1390  return E_NOTIMPL;
1391 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
GLbitfield flags
Definition: glext.h:7161
#define E_NOTIMPL
Definition: ddrawi.h:99
Definition: name.c:38

◆ JoyConfig8Impl_GetUserValues()

static HRESULT WINAPI JoyConfig8Impl_GetUserValues ( IDirectInputJoyConfig8 *  iface,
LPDIJOYUSERVALUES  info,
DWORD  flags 
)
static

Definition at line 1461 of file dinput_main.c.

1462 {
1463  FIXME( "(%p)->(%p, 0x%08x): stub!\n", iface, info, flags );
1464  return E_NOTIMPL;
1465 }
#define FIXME(fmt,...)
Definition: debug.h:110
GLbitfield flags
Definition: glext.h:7161
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ JoyConfig8Impl_OpenAppStatusKey()

static HRESULT WINAPI JoyConfig8Impl_OpenAppStatusKey ( IDirectInputJoyConfig8 *  iface,
PHKEY  key 
)
static

Definition at line 1485 of file dinput_main.c.

1486 {
1487  FIXME( "(%p)->(%p): stub!\n", iface, key );
1488  return E_NOTIMPL;
1489 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
Definition: path.c:41

◆ JoyConfig8Impl_OpenTypeKey()

static HRESULT WINAPI JoyConfig8Impl_OpenTypeKey ( IDirectInputJoyConfig8 *  iface,
LPCWSTR  name,
DWORD  security,
PHKEY  key 
)
static

Definition at line 1479 of file dinput_main.c.

1480 {
1481  FIXME( "(%p)->(%s, 0x%08x, %p): stub!\n", iface, debugstr_w(name), security, key );
1482  return E_NOTIMPL;
1483 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
Definition: name.c:38
Definition: path.c:41

◆ JoyConfig8Impl_QueryInterface()

static HRESULT WINAPI JoyConfig8Impl_QueryInterface ( IDirectInputJoyConfig8 *  iface,
REFIID  riid,
void **  ppobj 
)
static

Definition at line 1339 of file dinput_main.c.

1340 {
1342  return IDirectInputAImpl_QueryInterface( &This->IDirectInput7A_iface, riid, ppobj );
1343 }
REFIID riid
Definition: precomp.h:44
static IDirectInputImpl * impl_from_IDirectInputJoyConfig8(IDirectInputJoyConfig8 *iface)
Definition: dinput_main.c:1334
static HRESULT WINAPI IDirectInputAImpl_QueryInterface(LPDIRECTINPUT7A iface, REFIID riid, LPVOID *ppobj)
Definition: dinput_main.c:577

◆ JoyConfig8Impl_Release()

static ULONG WINAPI JoyConfig8Impl_Release ( IDirectInputJoyConfig8 *  iface)
static

Definition at line 1351 of file dinput_main.c.

1352 {
1354  return IDirectInputAImpl_Release( &This->IDirectInput7A_iface );
1355 }
static IDirectInputImpl * impl_from_IDirectInputJoyConfig8(IDirectInputJoyConfig8 *iface)
Definition: dinput_main.c:1334
static ULONG WINAPI IDirectInputAImpl_Release(LPDIRECTINPUT7A iface)
Definition: dinput_main.c:555

◆ JoyConfig8Impl_SendNotify()

static HRESULT WINAPI JoyConfig8Impl_SendNotify ( IDirectInputJoyConfig8 *  iface)
static

Definition at line 1375 of file dinput_main.c.

1376 {
1377  FIXME( "(%p): stub!\n", iface );
1378  return E_NOTIMPL;
1379 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ JoyConfig8Impl_SetConfig()

static HRESULT WINAPI JoyConfig8Impl_SetConfig ( IDirectInputJoyConfig8 *  iface,
UINT  id,
LPCDIJOYCONFIG  info,
DWORD  flags 
)
static

Definition at line 1449 of file dinput_main.c.

1450 {
1451  FIXME( "(%p)->(%d, %p, 0x%08x): stub!\n", iface, id, info, flags );
1452  return E_NOTIMPL;
1453 }
#define FIXME(fmt,...)
Definition: debug.h:110
GLbitfield flags
Definition: glext.h:7161
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ JoyConfig8Impl_SetCooperativeLevel()

static HRESULT WINAPI JoyConfig8Impl_SetCooperativeLevel ( IDirectInputJoyConfig8 *  iface,
HWND  hwnd,
DWORD  flags 
)
static

Definition at line 1369 of file dinput_main.c.

1370 {
1371  FIXME( "(%p)->(%p, 0x%08x): stub!\n", iface, hwnd, flags );
1372  return E_NOTIMPL;
1373 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define FIXME(fmt,...)
Definition: debug.h:110
GLbitfield flags
Definition: glext.h:7161
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ JoyConfig8Impl_SetTypeInfo()

static HRESULT WINAPI JoyConfig8Impl_SetTypeInfo ( IDirectInputJoyConfig8 *  iface,
LPCWSTR  name,
LPCDIJOYTYPEINFO  info,
DWORD  flags,
LPWSTR  new_name 
)
static

Definition at line 1393 of file dinput_main.c.

1395 {
1396  FIXME( "(%p)->(%s, %p, 0x%08x, %s): stub!\n", iface, debugstr_w(name), info, flags, debugstr_w(new_name) );
1397  return E_NOTIMPL;
1398 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
GLbitfield flags
Definition: glext.h:7161
#define E_NOTIMPL
Definition: ddrawi.h:99
Definition: name.c:38

◆ JoyConfig8Impl_SetUserValues()

static HRESULT WINAPI JoyConfig8Impl_SetUserValues ( IDirectInputJoyConfig8 *  iface,
LPCDIJOYUSERVALUES  info,
DWORD  flags 
)
static

Definition at line 1467 of file dinput_main.c.

1468 {
1469  FIXME( "(%p)->(%p, 0x%08x): stub!\n", iface, info, flags );
1470  return E_NOTIMPL;
1471 }
#define FIXME(fmt,...)
Definition: debug.h:110
GLbitfield flags
Definition: glext.h:7161
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ JoyConfig8Impl_Unacquire()

static HRESULT WINAPI JoyConfig8Impl_Unacquire ( IDirectInputJoyConfig8 *  iface)
static

Definition at line 1363 of file dinput_main.c.

1364 {
1365  FIXME( "(%p): stub!\n", iface );
1366  return E_NOTIMPL;
1367 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ LL_hook_proc()

static LRESULT CALLBACK LL_hook_proc ( int  code,
WPARAM  wparam,
LPARAM  lparam 
)
static

Definition at line 1683 of file dinput_main.c.

1684 {
1685  IDirectInputImpl *dinput;
1686  int skip = 0;
1687 
1688  if (code != HC_ACTION) return CallNextHookEx( 0, code, wparam, lparam );
1689 
1692  {
1694 
1695  EnterCriticalSection( &dinput->crit );
1697  if (dev->acquired && dev->event_proc)
1698  {
1699  TRACE("calling %p->%p (%lx %lx)\n", dev, dev->event_proc, wparam, lparam);
1700  skip |= dev->event_proc( &dev->IDirectInputDevice8A_iface, wparam, lparam );
1701  }
1702  LeaveCriticalSection( &dinput->crit );
1703  }
1705 
1706  return skip ? 1 : CallNextHookEx( 0, code, wparam, lparam );
1707 }
static CRITICAL_SECTION dinput_hook_crit
Definition: dinput_main.c:101
struct list devices_list
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static int dev
Definition: mkdosfs.c:536
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define TRACE(s)
Definition: solgame.cpp:4
uint32_t entry
Definition: isohybrid.c:63
LRESULT WINAPI CallNextHookEx(_In_opt_ HHOOK, _In_ int, _In_ WPARAM, _In_ LPARAM)
CRITICAL_SECTION crit
#define HC_ACTION
Definition: winuser.h:48
#define skip(...)
Definition: atltest.h:64
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static struct list direct_input_list
Definition: dinput_main.c:102
static UINT WPARAM wparam
Definition: combo.c:716

Referenced by hook_thread_proc().

◆ should_enumerate_device()

static BOOL should_enumerate_device ( const WCHAR username,
DWORD  dwFlags,
struct list device_players,
REFGUID  guid 
)
static

Definition at line 985 of file dinput_main.c.

987 {
988  BOOL should_enumerate = TRUE;
989  struct DevicePlayer *device_player;
990 
991  /* Check if user owns this device */
993  {
994  should_enumerate = FALSE;
995  LIST_FOR_EACH_ENTRY(device_player, device_players, struct DevicePlayer, entry)
996  {
997  if (IsEqualGUID(&device_player->instance_guid, guid))
998  {
999  if (*device_player->username && !lstrcmpW(username, device_player->username))
1000  return TRUE; /* Device username matches */
1001  break;
1002  }
1003  }
1004  }
1005 
1006  /* Check if this device is not owned by anyone */
1008  BOOL found = FALSE;