ReactOS  0.4.13-dev-455-g28ed234
dinput_main.c File Reference
#include "config.h"
#include <assert.h>
#include <stdarg.h>
#include <string.h>
#include "wine/debug.h"
#include "wine/unicode.h"
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winerror.h"
#include "objbase.h"
#include "rpcproxy.h"
#include "initguid.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 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 38 of file dinput_main.c.

◆ enum_callback_wrapper

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

Definition at line 439 of file dinput_main.c.

◆ FE

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

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 39 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 678 of file dinput_main.c.

Function Documentation

◆ _copy_diactionformatAtoW()

void _copy_diactionformatAtoW ( LPDIACTIONFORMATW  to,
LPDIACTIONFORMATA  from 
)

Definition at line 323 of file dinput_main.c.

324 {
325  int i;
326 
327  to->dwSize = sizeof(DIACTIONFORMATW);
328  to->dwActionSize = sizeof(DIACTIONW);
329  to->dwDataSize = from->dwDataSize;
330  to->dwNumActions = from->dwNumActions;
331  to->guidActionMap = from->guidActionMap;
332  to->dwGenre = from->dwGenre;
333  to->dwBufferSize = from->dwBufferSize;
334  to->lAxisMin = from->lAxisMin;
335  to->lAxisMax = from->lAxisMax;
336  to->dwCRC = from->dwCRC;
337  to->ftTimeStamp = from->ftTimeStamp;
338 
339  for (i=0; i < to->dwNumActions; i++)
340  {
341  to->rgoAction[i].uAppData = from->rgoAction[i].uAppData;
342  to->rgoAction[i].dwSemantic = from->rgoAction[i].dwSemantic;
343  to->rgoAction[i].dwFlags = from->rgoAction[i].dwFlags;
344  to->rgoAction[i].guidInstance = from->rgoAction[i].guidInstance;
345  to->rgoAction[i].dwObjID = from->rgoAction[i].dwObjID;
346  to->rgoAction[i].dwHow = from->rgoAction[i].dwHow;
347  }
348 }
DWORD dwObjID
Definition: dinput.h:1286
GUID guidInstance
Definition: dinput.h:1285
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:1339
struct _DIACTIONFORMATW DIACTIONFORMATW
DWORD dwDataSize
Definition: dinput.h:1330
LPDIACTIONW rgoAction
Definition: dinput.h:1332
DWORD dwBufferSize
Definition: dinput.h:1335
DWORD dwFlags
Definition: dinput.h:1280
GUID guidActionMap
Definition: dinput.h:1333
UINT_PTR uAppData
Definition: dinput.h:1278
DWORD dwHow
Definition: dinput.h:1287
DWORD dwNumActions
Definition: dinput.h:1331
CardRegion * from
Definition: spigame.cpp:19
DWORD dwActionSize
Definition: dinput.h:1329
DWORD dwSemantic
Definition: dinput.h:1279

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 350 of file dinput_main.c.

351 {
352  int i;
353 
354  to->dwSize = sizeof(DIACTIONFORMATA);
355  to->dwActionSize = sizeof(DIACTIONA);
356  to->dwDataSize = from->dwDataSize;
357  to->dwNumActions = from->dwNumActions;
358  to->guidActionMap = from->guidActionMap;
359  to->dwGenre = from->dwGenre;
360  to->dwBufferSize = from->dwBufferSize;
361  to->lAxisMin = from->lAxisMin;
362  to->lAxisMax = from->lAxisMax;
363  to->dwCRC = from->dwCRC;
364  to->ftTimeStamp = from->ftTimeStamp;
365 
366  for (i=0; i < to->dwNumActions; i++)
367  {
368  to->rgoAction[i].uAppData = from->rgoAction[i].uAppData;
369  to->rgoAction[i].dwSemantic = from->rgoAction[i].dwSemantic;
370  to->rgoAction[i].dwFlags = from->rgoAction[i].dwFlags;
371  to->rgoAction[i].guidInstance = from->rgoAction[i].guidInstance;
372  to->rgoAction[i].dwObjID = from->rgoAction[i].dwObjID;
373  to->rgoAction[i].dwHow = from->rgoAction[i].dwHow;
374  }
375 }
DWORD dwBufferSize
Definition: dinput.h:1317
DWORD dwObjID
Definition: dinput.h:1272
DWORD dwFlags
Definition: dinput.h:1266
DWORD dwNumActions
Definition: dinput.h:1313
struct _DIACTIONFORMATA DIACTIONFORMATA
UINT_PTR uAppData
Definition: dinput.h:1264
DWORD dwDataSize
Definition: dinput.h:1312
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:1271
struct _DIACTIONA DIACTIONA
FILETIME ftTimeStamp
Definition: dinput.h:1321
DWORD dwHow
Definition: dinput.h:1273
DWORD dwActionSize
Definition: dinput.h:1311
LPDIACTIONA rgoAction
Definition: dinput.h:1314
DWORD dwSemantic
Definition: dinput.h:1265
CardRegion * from
Definition: spigame.cpp:19
GUID guidActionMap
Definition: dinput.h:1315

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

◆ _dump_diactionformatA()

static void _dump_diactionformatA ( LPDIACTIONFORMATA  lpdiActionFormat)
static

Definition at line 292 of file dinput_main.c.

293 {
294  unsigned int i;
295 
296  TRACE("diaf.dwSize = %d\n", lpdiActionFormat->dwSize);
297  TRACE("diaf.dwActionSize = %d\n", lpdiActionFormat->dwActionSize);
298  TRACE("diaf.dwDataSize = %d\n", lpdiActionFormat->dwDataSize);
299  TRACE("diaf.dwNumActions = %d\n", lpdiActionFormat->dwNumActions);
300  TRACE("diaf.rgoAction = %p\n", lpdiActionFormat->rgoAction);
301  TRACE("diaf.guidActionMap = %s\n", debugstr_guid(&lpdiActionFormat->guidActionMap));
302  TRACE("diaf.dwGenre = 0x%08x\n", lpdiActionFormat->dwGenre);
303  TRACE("diaf.dwBufferSize = %d\n", lpdiActionFormat->dwBufferSize);
304  TRACE("diaf.lAxisMin = %d\n", lpdiActionFormat->lAxisMin);
305  TRACE("diaf.lAxisMax = %d\n", lpdiActionFormat->lAxisMax);
306  TRACE("diaf.hInstString = %p\n", lpdiActionFormat->hInstString);
307  TRACE("diaf.ftTimeStamp ...\n");
308  TRACE("diaf.dwCRC = 0x%x\n", lpdiActionFormat->dwCRC);
309  TRACE("diaf.tszActionMap = %s\n", debugstr_a(lpdiActionFormat->tszActionMap));
310  for (i = 0; i < lpdiActionFormat->dwNumActions; i++)
311  {
312  TRACE("diaf.rgoAction[%u]:\n", i);
313  TRACE("\tuAppData=0x%lx\n", lpdiActionFormat->rgoAction[i].uAppData);
314  TRACE("\tdwSemantic=0x%08x\n", lpdiActionFormat->rgoAction[i].dwSemantic);
315  TRACE("\tdwFlags=0x%x\n", lpdiActionFormat->rgoAction[i].dwFlags);
316  TRACE("\tszActionName=%s\n", debugstr_a(lpdiActionFormat->rgoAction[i].u.lptszActionName));
317  TRACE("\tguidInstance=%s\n", debugstr_guid(&lpdiActionFormat->rgoAction[i].guidInstance));
318  TRACE("\tdwObjID=0x%x\n", lpdiActionFormat->rgoAction[i].dwObjID);
319  TRACE("\tdwHow=0x%x\n", lpdiActionFormat->rgoAction[i].dwHow);
320  }
321 }
DWORD dwBufferSize
Definition: dinput.h:1317
DWORD dwObjID
Definition: dinput.h:1272
CHAR tszActionMap[MAX_PATH]
Definition: dinput.h:1323
DWORD dwFlags
Definition: dinput.h:1266
DWORD dwNumActions
Definition: dinput.h:1313
UINT_PTR uAppData
Definition: dinput.h:1264
DWORD dwDataSize
Definition: dinput.h:1312
HINSTANCE hInstString
Definition: dinput.h:1320
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:1271
LPCSTR lptszActionName
Definition: dinput.h:1268
#define debugstr_guid
Definition: kernel32.h:35
DWORD dwHow
Definition: dinput.h:1273
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
DWORD dwActionSize
Definition: dinput.h:1311
LPDIACTIONA rgoAction
Definition: dinput.h:1314
DWORD dwSemantic
Definition: dinput.h:1265
GUID guidActionMap
Definition: dinput.h:1315

Referenced by IDirectInput8AImpl_EnumDevicesBySemantics().

◆ _dump_DIDEVTYPE_value()

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

Definition at line 240 of file dinput_main.c.

241 {
242  if (dwVersion < 0x0800) {
243  switch (dwDevType) {
244  case 0: return "All devices";
245  case DIDEVTYPE_MOUSE: return "DIDEVTYPE_MOUSE";
246  case DIDEVTYPE_KEYBOARD: return "DIDEVTYPE_KEYBOARD";
247  case DIDEVTYPE_JOYSTICK: return "DIDEVTYPE_JOYSTICK";
248  case DIDEVTYPE_DEVICE: return "DIDEVTYPE_DEVICE";
249  default: return "Unknown";
250  }
251  } else {
252  switch (dwDevType) {
253  case DI8DEVCLASS_ALL: return "All devices";
254  case DI8DEVCLASS_POINTER: return "DI8DEVCLASS_POINTER";
255  case DI8DEVCLASS_KEYBOARD: return "DI8DEVCLASS_KEYBOARD";
256  case DI8DEVCLASS_DEVICE: return "DI8DEVCLASS_DEVICE";
257  case DI8DEVCLASS_GAMECTRL: return "DI8DEVCLASS_GAMECTRL";
258  default: return "Unknown";
259  }
260  }
261 }
#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 263 of file dinput_main.c.

264 {
265  if (TRACE_ON(dinput)) {
266  unsigned int i;
267  static const struct {
268  DWORD mask;
269  const char *name;
270  } flags[] = {
271 #define FE(x) { x, #x}
278 #undef FE
279  };
280  TRACE(" flags: ");
281  if (dwFlags == 0) {
282  TRACE("DIEDFL_ALLDEVICES\n");
283  return;
284  }
285  for (i = 0; i < ARRAY_SIZE(flags); i++)
286  if (flags[i].mask & dwFlags)
287  TRACE("%s ",flags[i].name);
288  }
289  TRACE("\n");
290 }
#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:36
#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 1675 of file dinput_main.c.

1676 {
1677  CWPSTRUCT *msg = (CWPSTRUCT *)lparam;
1678  IDirectInputImpl *dinput;
1679  HWND foreground;
1680 
1681  if (code != HC_ACTION || (msg->message != WM_KILLFOCUS &&
1682  msg->message != WM_ACTIVATEAPP && msg->message != WM_ACTIVATE))
1683  return CallNextHookEx( 0, code, wparam, lparam );
1684 
1685  foreground = GetForegroundWindow();
1686 
1688 
1690  {
1692 
1693  EnterCriticalSection( &dinput->crit );
1695  {
1696  if (!dev->acquired) continue;
1697 
1698  if (msg->hwnd == dev->win && msg->hwnd != foreground)
1699  {
1700  TRACE( "%p window is not foreground - unacquiring %p\n", dev->win, dev );
1701  IDirectInputDevice_Unacquire( &dev->IDirectInputDevice8A_iface );
1702  }
1703  }
1704  LeaveCriticalSection( &dinput->crit );
1705  }
1707 
1708  return CallNextHookEx( 0, code, wparam, lparam );
1709 }
static CRITICAL_SECTION dinput_hook_crit
Definition: dinput_main.c:99
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:1611
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static struct list direct_input_list
Definition: dinput_main.c:100
static UINT WPARAM wparam
Definition: combo.c:716

Referenced by check_dinput_hooks().

◆ check_dinput_events()

void check_dinput_events ( void  )

Definition at line 1870 of file dinput_main.c.

1871 {
1872  /* Windows does not do that, but our current implementation of winex11
1873  * requires periodic event polling to forward events to the wineserver.
1874  *
1875  * We have to call this function from multiple places, because:
1876  * - some games do not explicitly poll for mouse events
1877  * (for example Culpa Innata)
1878  * - some games only poll the device, and neither keyboard nor mouse
1879  * (for example Civilization: Call to Power 2)
1880  */
1881 #ifndef __REACTOS__
1883 #endif
1884 }
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 1833 of file dinput_main.c.

1834 {
1835  static HHOOK callwndproc_hook;
1836  static ULONG foreground_cnt;
1838 
1840 
1841  if (dev->dwCoopLevel & DISCL_FOREGROUND)
1842  {
1843  if (acquired)
1844  foreground_cnt++;
1845  else
1846  foreground_cnt--;
1847  }
1848 
1849  if (foreground_cnt && !callwndproc_hook)
1850  callwndproc_hook = SetWindowsHookExW( WH_CALLWNDPROC, callwndproc_proc,
1852  else if (!foreground_cnt && callwndproc_hook)
1853  {
1854  UnhookWindowsHookEx( callwndproc_hook );
1855  callwndproc_hook = NULL;
1856  }
1857 
1858  if (hook_thread_event) /* if thread is not started yet */
1859  {
1863  }
1864 
1865  PostThreadMessageW( hook_thread_id, WM_USER+0x10, 1, 0 );
1866 
1868 }
#define CloseHandle
Definition: compat.h:398
static CRITICAL_SECTION dinput_hook_crit
Definition: dinput_main.c:99
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
HINSTANCE DINPUT_instance
Definition: dinput_main.c:96
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:1783
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:420
#define DISCL_FOREGROUND
Definition: dinput.h:967
#define WH_CALLWNDPROC
Definition: winuser.h:34
#define WM_USER
Definition: winuser.h:1856
BOOL WINAPI UnhookWindowsHookEx(_In_ HHOOK)
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface)
Definition: dinput_main.c:82
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:1784
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:1675

Referenced by IDirectInputDevice2WImpl_Acquire(), and IDirectInputDevice2WImpl_Unacquire().

◆ check_hook_thread()

static BOOL check_hook_thread ( void  )
static

Definition at line 1794 of file dinput_main.c.

1795 {
1796  static HANDLE hook_thread;
1797 
1799 
1800  TRACE("IDirectInputs left: %d\n", list_count(&direct_input_list));
1801  if (!list_empty(&direct_input_list) && !hook_thread)
1802  {
1806  }
1807  else if (list_empty(&direct_input_list) && hook_thread)
1808  {
1810 
1811  if (hook_thread_event) /* if thread is not started yet */
1812  {
1816  }
1817 
1818  hook_thread_id = 0;
1819  PostThreadMessageW(tid, WM_USER+0x10, 0, 0);
1821 
1822  /* wait for hook thread to exit */
1823  WaitForSingleObject(hook_thread, INFINITE);
1824  CloseHandle(hook_thread);
1825  hook_thread = NULL;
1826  }
1827  else
1829 
1830  return hook_thread_id != 0;
1831 }
#define CloseHandle
Definition: compat.h:398
static CRITICAL_SECTION dinput_hook_crit
Definition: dinput_main.c:99
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:597
static DWORD WINAPI hook_thread_proc(void *param)
Definition: dinput_main.c:1711
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:111
smooth NULL
Definition: ftsmooth.c:416
static DWORD hook_thread_id
Definition: dinput_main.c:1783
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WM_USER
Definition: winuser.h:1856
__WINE_SERVER_LIST_INLINE int list_empty(const struct list *list)
Definition: list.h:143
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static struct list direct_input_list
Definition: dinput_main.c:100
#define INFINITE
Definition: serial.h:102
static HANDLE hook_thread_event
Definition: dinput_main.c:1784
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 795 of file dinput_main.c.

796 {
797  unsigned int i;
798 
799  if (pvOut)
800  *pvOut = NULL;
801 
802  if (!rguid || !pvOut)
803  return E_POINTER;
804 
805  if (!This->initialized)
806  return DIERR_NOTINITIALIZED;
807 
808  /* Loop on all the devices to see if anyone matches the given GUID */
809  for (i = 0; i < ARRAY_SIZE(dinput_devices); i++)
810  {
811  HRESULT ret;
812 
813  if (!dinput_devices[i]->create_device) continue;
814  if ((ret = dinput_devices[i]->create_device(This, rguid, riid, pvOut, unicode)) == DI_OK)
815  return DI_OK;
816  }
817 
818  WARN("invalid device GUID %s\n", debugstr_guid(rguid));
819  return DIERR_DEVICENOTREG;
820 }
#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:87
#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:795

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 105 of file dinput_main.c.

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

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

◆ diactionformat_priorityA()

static DWORD diactionformat_priorityA ( LPDIACTIONFORMATA  lpdiaf,
DWORD  genre 
)
static

Definition at line 383 of file dinput_main.c.

384 {
385  int i;
386  DWORD priorityFlags = 0;
387 
388  /* If there's at least one action for the device it's priority 1 */
389  for(i=0; i < lpdiaf->dwNumActions; i++)
390  if ((lpdiaf->rgoAction[i].dwSemantic & genre) == genre)
391  priorityFlags |= DIEDBS_MAPPEDPRI1;
392 
393  return priorityFlags;
394 }
DWORD dwNumActions
Definition: dinput.h:1313
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:1314
DWORD dwSemantic
Definition: dinput.h:1265

Referenced by IDirectInput8AImpl_EnumDevicesBySemantics().

◆ diactionformat_priorityW()

static DWORD diactionformat_priorityW ( LPDIACTIONFORMATW  lpdiaf,
DWORD  genre 
)
static

Definition at line 396 of file dinput_main.c.

397 {
398  int i;
399  DWORD priorityFlags = 0;
400 
401  /* If there's at least one action for the device it's priority 1 */
402  for(i=0; i < lpdiaf->dwNumActions; i++)
403  if ((lpdiaf->rgoAction[i].dwSemantic & genre) == genre)
404  priorityFlags |= DIEDBS_MAPPEDPRI1;
405 
406  return priorityFlags;
407 }
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:1332
#define DIEDBS_MAPPEDPRI1
Definition: dinput.h:445
DWORD dwNumActions
Definition: dinput.h:1331
DWORD dwSemantic
Definition: dinput.h:1279

Referenced by IDirectInput8WImpl_EnumDevicesBySemantics().

◆ DICF_AddRef()

static ULONG WINAPI DICF_AddRef ( LPCLASSFACTORY  iface)
static

Definition at line 1556 of file dinput_main.c.

1556  {
1558  return InterlockedIncrement(&(This->ref));
1559 }
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: dinput_main.c:1544
#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 1567 of file dinput_main.c.

1569  {
1571 
1572  TRACE("(%p)->(%p,%s,%p)\n",This,pOuter,debugstr_guid(riid),ppobj);
1573  if ( IsEqualGUID( &IID_IUnknown, riid ) ||
1574  IsEqualGUID( &IID_IDirectInputA, riid ) ||
1575  IsEqualGUID( &IID_IDirectInputW, riid ) ||
1576  IsEqualGUID( &IID_IDirectInput2A, riid ) ||
1577  IsEqualGUID( &IID_IDirectInput2W, riid ) ||
1578  IsEqualGUID( &IID_IDirectInput7A, riid ) ||
1579  IsEqualGUID( &IID_IDirectInput7W, riid ) ||
1580  IsEqualGUID( &IID_IDirectInput8A, riid ) ||
1581  IsEqualGUID( &IID_IDirectInput8W, riid ) )
1582  {
1583  return create_directinput_instance(riid, ppobj, NULL);
1584  }
1585 
1586  FIXME("(%p,%p,%s,%p) Interface not found!\n",This,pOuter,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:1544
#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:105
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

◆ DICF_LockServer()

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

Definition at line 1590 of file dinput_main.c.

1590  {
1592  FIXME("(%p)->(%d),stub!\n",This,dolock);
1593  return S_OK;
1594 }
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: dinput_main.c:1544
#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 1549 of file dinput_main.c.

1549  {
1551 
1552  FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
1553  return E_NOINTERFACE;
1554 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: dinput_main.c:1544
#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 1561 of file dinput_main.c.

1561  {
1563  /* static class, won't be freed */
1564  return InterlockedDecrement(&(This->ref));
1565 }
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: dinput_main.c:1544
#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 170 of file dinput_main.c.

172 {
174  HRESULT hr;
175 
176  TRACE("hinst %p, version %#x, iid %s, out %p, outer %p.\n",
177  hinst, version, debugstr_guid(iid), out, outer);
178 
179  if (!out)
180  return E_POINTER;
181 
182  if (!IsEqualGUID(&IID_IDirectInput8A, iid) &&
183  !IsEqualGUID(&IID_IDirectInput8W, iid) &&
184  !IsEqualGUID(&IID_IUnknown, iid))
185  {
186  *out = NULL;
187  return DIERR_NOINTERFACE;
188  }
189 
191 
192  if (FAILED(hr))
193  {
194  ERR("Failed to create DirectInput, hr %#x.\n", hr);
195  return hr;
196  }
197 
198  /* When aggregation is used, the application needs to manually call Initialize(). */
199  if (!outer && IsEqualGUID(&IID_IDirectInput8A, iid))
200  {
201  hr = IDirectInput8_Initialize(&This->IDirectInput8A_iface, hinst, version);
202  if (FAILED(hr))
203  {
204  IDirectInput8_Release(&This->IDirectInput8A_iface);
205  *out = NULL;
206  return hr;
207  }
208  }
209 
210  if (!outer && IsEqualGUID(&IID_IDirectInput8W, iid))
211  {
212  hr = IDirectInput8_Initialize(&This->IDirectInput8W_iface, hinst, version);
213  if (FAILED(hr))
214  {
215  IDirectInput8_Release(&This->IDirectInput8W_iface);
216  *out = NULL;
217  return hr;
218  }
219  }
220 
221  return S_OK;
222 }
HRESULT hr
Definition: shlfolder.c:183
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR version[]
Definition: asmname.c:64
#define IDirectInput8_Initialize(p, a, b)
Definition: dinput.h:2464
#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:105
#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:4021
static HINSTANCE hinst
Definition: edit.c:551
#define E_POINTER
Definition: winerror.h:2365
#define IDirectInput8_Release(p)
Definition: dinput.h:2458

Referenced by InitializeDirectInputDialog().

◆ DirectInputCreateA()

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

Definition at line 227 of file dinput_main.c.

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

Referenced by joystick_tests(), mouse_tests(), test_CreateDevice(), test_DirectInputJoyConfig8(), 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 133 of file dinput_main.c.

136 {
138  HRESULT hr;
139 
140  TRACE("(%p,%04x,%s,%p,%p)\n", hinst, dwVersion, debugstr_guid(riid), ppDI, punkOuter);
141 
142  if (IsEqualGUID( &IID_IDirectInputA, riid ) ||
143  IsEqualGUID( &IID_IDirectInput2A, riid ) ||
144  IsEqualGUID( &IID_IDirectInput7A, riid ) ||
145  IsEqualGUID( &IID_IDirectInputW, riid ) ||
146  IsEqualGUID( &IID_IDirectInput2W, riid ) ||
147  IsEqualGUID( &IID_IDirectInput7W, riid ))
148  {
150  if (FAILED(hr))
151  return hr;
152  }
153  else
154  return DIERR_NOINTERFACE;
155 
156  hr = IDirectInput_Initialize( &This->IDirectInput7A_iface, hinst, dwVersion );
157  if (FAILED(hr))
158  {
159  IDirectInput_Release( &This->IDirectInput7A_iface );
160  *ppDI = NULL;
161  return hr;
162  }
163 
164  return DI_OK;
165 }
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:2241
LONG HRESULT
Definition: typedefs.h:77
static HRESULT create_directinput_instance(REFIID riid, LPVOID *ppDI, IDirectInputImpl **out)
Definition: dinput_main.c:105
#define DIERR_NOINTERFACE
Definition: dinput.h:153
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
#define DI_OK
Definition: dinput.h:128
static HINSTANCE hinst
Definition: edit.c:551
#define IDirectInput_Initialize(p, a, b)
Definition: dinput.h:2247

Referenced by DirectInputCreateA(), and DirectInputCreateW().

◆ DirectInputCreateW()

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

Definition at line 235 of file dinput_main.c.

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

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 1608 of file dinput_main.c.

1609 {
1610  return S_FALSE;
1611 }
#define S_FALSE
Definition: winerror.h:2357

◆ DllGetClassObject()

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

Definition at line 1616 of file dinput_main.c.

1617 {
1618  TRACE("(%s,%s,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
1619  if ( IsEqualCLSID( &IID_IClassFactory, riid ) ) {
1620  *ppv = &DINPUT_CF;
1621  IClassFactory_AddRef((IClassFactory*)*ppv);
1622  return S_OK;
1623  }
1624 
1625  FIXME("(%s,%s,%p): no interface found.\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
1627 }
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:1603
#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:91

◆ DllMain()

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

Definition at line 1886 of file dinput_main.c.

1887 {
1888  switch(reason)
1889  {
1890  case DLL_PROCESS_ATTACH:
1892  DINPUT_instance = inst;
1893  break;
1894  case DLL_PROCESS_DETACH:
1895  if (reserved) break;
1897  break;
1898  }
1899  return TRUE;
1900 }
#define TRUE
Definition: types.h:120
static CRITICAL_SECTION dinput_hook_crit
Definition: dinput_main.c:99
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:96
r reserved
Definition: btrfs.c:2704
#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 1632 of file dinput_main.c.

1633 {
1635 }
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98
HINSTANCE DINPUT_instance
Definition: dinput_main.c:96

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 1640 of file dinput_main.c.

1641 {
1643 }
HINSTANCE DINPUT_instance
Definition: dinput_main.c:96
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:110

◆ hook_thread_proc()

static DWORD WINAPI hook_thread_proc ( void param)
static

Definition at line 1711 of file dinput_main.c.

1712 {
1713  static HHOOK kbd_hook, mouse_hook;
1714  MSG msg;
1715 
1716  /* Force creation of the message queue */
1717  PeekMessageW( &msg, 0, 0, 0, PM_NOREMOVE );
1718  SetEvent(param);
1719 
1720  while (GetMessageW( &msg, 0, 0, 0 ))
1721  {
1722  UINT kbd_cnt = 0, mice_cnt = 0;
1723 
1724  if (msg.message == WM_USER+0x10)
1725  {
1726  IDirectInputImpl *dinput;
1727 
1728  TRACE( "Processing hook change notification lp:%ld\n", msg.lParam );
1729 
1730  if (!msg.wParam && !msg.lParam)
1731  {
1733  if (mouse_hook) UnhookWindowsHookEx( mouse_hook );
1734  kbd_hook = mouse_hook = NULL;
1735  break;
1736  }
1737 
1739 
1740  /* Count acquired keyboards and mice*/
1742  {
1744 
1745  EnterCriticalSection( &dinput->crit );
1747  {
1748  if (!dev->acquired || !dev->event_proc) continue;
1749 
1750  if (IsEqualGUID( &dev->guid, &GUID_SysKeyboard ))
1751  kbd_cnt++;
1752  else
1753  if (IsEqualGUID( &dev->guid, &GUID_SysMouse ))
1754  mice_cnt++;
1755  }
1756  LeaveCriticalSection( &dinput->crit );
1757  }
1759 
1760  if (kbd_cnt && !kbd_hook)
1762  else if (!kbd_cnt && kbd_hook)
1763  {
1765  kbd_hook = NULL;
1766  }
1767 
1768  if (mice_cnt && !mouse_hook)
1770  else if (!mice_cnt && mouse_hook)
1771  {
1772  UnhookWindowsHookEx( mouse_hook );
1773  mouse_hook = NULL;
1774  }
1775  }
1778  }
1779 
1780  return 0;
1781 }
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:99
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:679
struct list devices_list
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
HINSTANCE DINPUT_instance
Definition: dinput_main.c:96
static int dev
Definition: mkdosfs.c:536
#define PM_NOREMOVE
Definition: winuser.h:1181
#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:1856
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:4021
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:1649
#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:100

Referenced by check_hook_thread().

◆ IDirectInput2AImpl_FindDevice()

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

Definition at line 775 of file dinput_main.c.

777 {
779 
780  FIXME( "(%p)->(%s, %s, %p): stub\n", This, debugstr_guid(rguid), pszName, pguidInstance );
781 
782  return DI_OK;
783 }
#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:62
#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 785 of file dinput_main.c.

787 {
789 
790  FIXME( "(%p)->(%s, %s, %p): stub\n", This, debugstr_guid(rguid), debugstr_w(pszName), pguidInstance );
791 
792  return DI_OK;
793 }
#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:67
#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 822 of file dinput_main.c.

824 {
826 
827  TRACE("(%p)->(%s, %s, %p, %p)\n", This, debugstr_guid(rguid), debugstr_guid(riid), pvOut, lpUnknownOuter);
828 
829  return create_device(This, rguid, riid, pvOut, FALSE);
830 }
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:62
static HRESULT create_device(IDirectInputImpl *This, REFGUID rguid, REFIID riid, LPVOID *pvOut, BOOL unicode)
Definition: dinput_main.c:795

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 832 of file dinput_main.c.

834 {
836 
837  TRACE("(%p)->(%s, %s, %p, %p)\n", This, debugstr_guid(rguid), debugstr_guid(riid), pvOut, lpUnknownOuter);
838 
839  return create_device(This, rguid, riid, pvOut, TRUE);
840 }
#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:67
static HRESULT create_device(IDirectInputImpl *This, REFGUID rguid, REFIID riid, LPVOID *pvOut, BOOL unicode)
Definition: dinput_main.c:795

Referenced by IDirectInput8WImpl_CreateDevice(), and IDirectInputWImpl_CreateDevice().

◆ IDirectInput8AImpl_AddRef()

static ULONG WINAPI IDirectInput8AImpl_AddRef ( LPDIRECTINPUT8A  iface)
static

Definition at line 858 of file dinput_main.c.

859 {
861  return IDirectInputAImpl_AddRef( &This->IDirectInput7A_iface );
862 }
static IDirectInputImpl * impl_from_IDirectInput8A(IDirectInput8A *iface)
Definition: dinput_main.c:72
static ULONG WINAPI IDirectInputAImpl_AddRef(LPDIRECTINPUT7A iface)
Definition: dinput_main.c:523

◆ IDirectInput8AImpl_ConfigureDevices()

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

Definition at line 1248 of file dinput_main.c.

1252 {
1254  DIACTIONFORMATW diafW;
1255  DICONFIGUREDEVICESPARAMSW diCDParamsW;
1256  HRESULT hr;
1257  int i;
1258 
1259  FIXME("(this=%p,%p,%p,%04x,%p): stub\n", This, lpdiCallback, lpdiCDParams, dwFlags, pvRefData);
1260 
1261  /* Copy parameters */
1262  diCDParamsW.dwSize = sizeof(DICONFIGUREDEVICESPARAMSW);
1263  diCDParamsW.dwcFormats = lpdiCDParams->dwcFormats;
1264  diCDParamsW.lprgFormats = &diafW;
1265  diCDParamsW.hwnd = lpdiCDParams->hwnd;
1266 
1267  diafW.rgoAction = HeapAlloc(GetProcessHeap(), 0, sizeof(DIACTIONW)*lpdiCDParams->lprgFormats->dwNumActions);
1268  _copy_diactionformatAtoW(&diafW, lpdiCDParams->lprgFormats);
1269 
1270  /* Copy action names */
1271  for (i=0; i < diafW.dwNumActions; i++)
1272  {
1273  const char* from = lpdiCDParams->lprgFormats->rgoAction[i].u.lptszActionName;
1274  int len = MultiByteToWideChar(CP_ACP, 0, from , -1, NULL , 0);
1275  WCHAR *to = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*len);
1276 
1277  MultiByteToWideChar(CP_ACP, 0, from , -1, to , len);
1278  diafW.rgoAction[i].u.lptszActionName = to;
1279  }
1280 
1281  hr = IDirectInput8WImpl_ConfigureDevices(&This->IDirectInput8W_iface, lpdiCallback, &diCDParamsW, dwFlags, pvRefData);
1282 
1283  /* Copy back configuration */
1284  if (SUCCEEDED(hr))
1285  _copy_diactionformatWtoA(lpdiCDParams->lprgFormats, &diafW);
1286 
1287  /* Free memory */
1288  for (i=0; i < diafW.dwNumActions; i++)
1289  HeapFree(GetProcessHeap(), 0, (void*) diafW.rgoAction[i].u.lptszActionName);
1290 
1291  HeapFree(GetProcessHeap(), 0, diafW.rgoAction);
1292 
1293  return hr;
1294 }
HRESULT hr
Definition: shlfolder.c:183
#define CP_ACP
Definition: compat.h:99
static IDirectInputImpl * impl_from_IDirectInput8A(IDirectInput8A *iface)
Definition: dinput_main.c:72
DWORD dwNumActions
Definition: dinput.h:1313
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:1268
#define GetProcessHeap()
Definition: compat.h:395
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:1389
LPDIACTIONFORMATW lprgFormats
Definition: dinput.h:1401
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
GLenum GLsizei len
Definition: glext.h:6722
LPDIACTIONW rgoAction
Definition: dinput.h:1332
static HRESULT WINAPI IDirectInput8WImpl_ConfigureDevices(LPDIRECTINPUT8W iface, LPDICONFIGUREDEVICESCALLBACK lpdiCallback, LPDICONFIGUREDEVICESPARAMSW lpdiCDParams, DWORD dwFlags, LPVOID pvRefData)
Definition: dinput_main.c:1235
void _copy_diactionformatAtoW(LPDIACTIONFORMATW to, LPDIACTIONFORMATA from)
Definition: dinput_main.c:323
struct _DICONFIGUREDEVICESPARAMSW DICONFIGUREDEVICESPARAMSW
void _copy_diactionformatWtoA(LPDIACTIONFORMATA to, LPDIACTIONFORMATW from)
Definition: dinput_main.c:350
LPDIACTIONA rgoAction
Definition: dinput.h:1314
#define MultiByteToWideChar
Definition: compat.h:100
DWORD dwNumActions
Definition: dinput.h:1331
CardRegion * from
Definition: spigame.cpp:19
#define HeapFree(x, y, z)
Definition: compat.h:394
#define SUCCEEDED(hr)
Definition: intsafe.h:57
LPCWSTR lptszActionName
Definition: dinput.h:1282

◆ IDirectInput8AImpl_CreateDevice()

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

Definition at line 894 of file dinput_main.c.

896 {
898  return IDirectInput7AImpl_CreateDeviceEx( &This->IDirectInput7A_iface, rguid, NULL, (LPVOID*)pdev, punk );
899 }
static IDirectInputImpl * impl_from_IDirectInput8A(IDirectInput8A *iface)
Definition: dinput_main.c:72
static HRESULT WINAPI IDirectInput7AImpl_CreateDeviceEx(LPDIRECTINPUT7A iface, REFGUID rguid, REFIID riid, LPVOID *pvOut, LPUNKNOWN lpUnknownOuter)
Definition: dinput_main.c:822
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 908 of file dinput_main.c.

910 {
912  return IDirectInputAImpl_EnumDevices( &This->IDirectInput7A_iface, dwDevType, lpCallback, pvRef, dwFlags );
913 }
static IDirectInputImpl * impl_from_IDirectInput8A(IDirectInput8A *iface)
Definition: dinput_main.c:72
static HRESULT WINAPI IDirectInputAImpl_EnumDevices(LPDIRECTINPUT7A iface, DWORD dwDevType, LPDIENUMDEVICESCALLBACKA lpCallback, LPVOID pvRef, DWORD dwFlags)
Definition: dinput_main.c:445
_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 1023 of file dinput_main.c.

1028 {
1029  static REFGUID guids[2] = { &GUID_SysKeyboard, &GUID_SysMouse };
1030  static const DWORD actionMasks[] = { DIKEYBOARD_MASK, DIMOUSE_MASK };
1032  DIDEVICEINSTANCEA didevi;
1033  LPDIRECTINPUTDEVICE8A lpdid;
1034  DWORD callbackFlags;
1035  int i, j;
1036  int device_count = 0;
1037  int remain;
1038  DIDEVICEINSTANCEA *didevis = 0;
1039  WCHAR *username_w = 0;
1040 
1041  FIXME("(this=%p,%s,%p,%p,%p,%04x): semi-stub\n", This, debugstr_a(ptszUserName), lpdiActionFormat,
1042  lpCallback, pvRef, dwFlags);
1043 #define X(x) if (dwFlags & x) FIXME("\tdwFlags |= "#x"\n");
1050 #undef X
1051 
1052  _dump_diactionformatA(lpdiActionFormat);
1053 
1054  didevi.dwSize = sizeof(didevi);
1055 
1056  if (ptszUserName)
1057  {
1058  int len = MultiByteToWideChar(CP_ACP, 0, ptszUserName, -1, 0, 0);
1059 
1060  username_w = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*len);
1061  MultiByteToWideChar(CP_ACP, 0, ptszUserName, -1, username_w, len);
1062  }
1063 
1064  /* Enumerate all the joysticks */
1065  for (i = 0; i < ARRAY_SIZE(dinput_devices); i++)
1066  {
1067  HRESULT enumSuccess;
1068 
1069  if (!dinput_devices[i]->enum_deviceA) continue;
1070 
1071  for (j = 0, enumSuccess = S_OK; SUCCEEDED(enumSuccess); j++)
1072  {
1073  TRACE(" - checking device %u ('%s')\n", i, dinput_devices[i]->name);
1074 
1075  /* Default behavior is to enumerate attached game controllers */
1076  enumSuccess = dinput_devices[i]->enum_deviceA(DI8DEVCLASS_GAMECTRL, DIEDFL_ATTACHEDONLY | dwFlags, &didevi, This->dwVersion, j);
1077  if (enumSuccess == S_OK &&
1078  should_enumerate_device(username_w, dwFlags, &This->device_players, &didevi.guidInstance))
1079  {
1080  if (device_count++)
1081  didevis = HeapReAlloc(GetProcessHeap(), 0, didevis, sizeof(DIDEVICEINSTANCEA)*device_count);
1082  else
1083  didevis = HeapAlloc(GetProcessHeap(), 0, sizeof(DIDEVICEINSTANCEA)*device_count);
1084  didevis[device_count-1] = didevi;
1085  }
1086  }
1087  }
1088 
1089  remain = device_count;
1090  /* Add keyboard and mouse to remaining device count */
1092  {
1093  for (i = 0; i < ARRAY_SIZE(guids); i++)
1094  {
1095  if (should_enumerate_device(username_w, dwFlags, &This->device_players, guids[i]))
1096  remain++;
1097  }
1098  }
1099 
1100  for (i = 0; i < device_count; i++)
1101  {
1102  callbackFlags = diactionformat_priorityA(lpdiActionFormat, lpdiActionFormat->dwGenre);
1103  IDirectInput_CreateDevice(iface, &didevis[i].guidInstance, &lpdid, NULL);
1104 
1105  if (lpCallback(&didevis[i], lpdid, callbackFlags, --remain, pvRef) == DIENUM_STOP)
1106  {
1107  HeapFree(GetProcessHeap(), 0, didevis);
1108  HeapFree(GetProcessHeap(), 0, username_w);
1109  return DI_OK;
1110  }
1111  }
1112 
1113  HeapFree(GetProcessHeap(), 0, didevis);
1114 
1116  {
1117  HeapFree(GetProcessHeap(), 0, username_w);
1118  return DI_OK;
1119  }
1120 
1121  /* Enumerate keyboard and mouse */
1122  for (i = 0; i < ARRAY_SIZE(guids); i++)
1123  {
1124  if (should_enumerate_device(username_w, dwFlags, &This->device_players, guids[i]))
1125  {
1126  callbackFlags = diactionformat_priorityA(lpdiActionFormat, actionMasks[i]);
1127 
1128  IDirectInput_CreateDevice(iface, guids[i], &lpdid, NULL);
1129  IDirectInputDevice_GetDeviceInfo(lpdid, &didevi);
1130 
1131  if (lpCallback(&didevi, lpdid, callbackFlags, --remain, pvRef) == DIENUM_STOP)
1132  {
1133  HeapFree(GetProcessHeap(), 0, username_w);
1134  return DI_OK;
1135  }
1136  }
1137  }
1138 
1139  HeapFree(GetProcessHeap(), 0, username_w);
1140  return DI_OK;
1141 }
GUID guidInstance
Definition: dinput.h:413
Definition: scsiwmi.h:51
#define IDirectInput_CreateDevice(p, a, b, c)
Definition: dinput.h:2243
#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:72
static BOOL should_enumerate_device(const WCHAR *username, DWORD dwFlags, struct list *device_players, REFGUID guid)
Definition: dinput_main.c:982
#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
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:395
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:87
_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:393
#define DIEDBSFL_AVAILABLEDEVICES
Definition: dinput.h:453
#define IDirectInputDevice_GetDeviceInfo(p, a)
Definition: dinput.h:1618
#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:383
struct IDirectInputDevice8A * LPDIRECTINPUTDEVICE8A
Definition: dinput.h:105
Definition: name.c:36
#define DI_OK
Definition: dinput.h:128
#define DI8DEVCLASS_GAMECTRL
Definition: dinput.h:207
static void _dump_diactionformatA(LPDIACTIONFORMATA lpdiActionFormat)
Definition: dinput_main.c:292
#define DIEDBSFL_ATTACHEDONLY
Definition: dinput.h:450
#define HeapFree(x, y, z)
Definition: compat.h:394
#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 970 of file dinput_main.c.

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

◆ IDirectInput8AImpl_GetDeviceStatus()

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

Definition at line 922 of file dinput_main.c.

923 {
925  return IDirectInputAImpl_GetDeviceStatus( &This->IDirectInput7A_iface, rguid );
926 }
static HRESULT WINAPI IDirectInputAImpl_GetDeviceStatus(LPDIRECTINPUT7A iface, REFGUID rguid)
Definition: dinput_main.c:716
static IDirectInputImpl * impl_from_IDirectInput8A(IDirectInput8A *iface)
Definition: dinput_main.c:72

◆ IDirectInput8AImpl_Initialize()

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

Definition at line 946 of file dinput_main.c.

947 {
949 
950  TRACE("(%p)->(%p, 0x%04x)\n", iface, hinst, version);
951 
952  if (!hinst)
953  return DIERR_INVALIDPARAM;
954  else if (version == 0)
955  return DIERR_NOTINITIALIZED;
956  else if (version < DIRECTINPUT_VERSION)
958  else if (version > DIRECTINPUT_VERSION)
960 
962 }
#define DIERR_NOTINITIALIZED
Definition: dinput.h:157
static IDirectInputImpl * impl_from_IDirectInput8A(IDirectInput8A *iface)
Definition: dinput_main.c:72
static HRESULT initialize_directinput_instance(IDirectInputImpl *This, DWORD dwVersion)
Definition: dinput_main.c:625
static const WCHAR version[]
Definition: asmname.c:64
#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 870 of file dinput_main.c.

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

◆ IDirectInput8AImpl_Release()

static ULONG WINAPI IDirectInput8AImpl_Release ( LPDIRECTINPUT8A  iface)
static

Definition at line 882 of file dinput_main.c.

883 {
885  return IDirectInputAImpl_Release( &This->IDirectInput7A_iface );
886 }
static IDirectInputImpl * impl_from_IDirectInput8A(IDirectInput8A *iface)
Definition: dinput_main.c:72
static ULONG WINAPI IDirectInputAImpl_Release(LPDIRECTINPUT7A iface)
Definition: dinput_main.c:538

◆ IDirectInput8AImpl_RunControlPanel()

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

Definition at line 934 of file dinput_main.c.

935 {
937  return IDirectInputAImpl_RunControlPanel( &This->IDirectInput7A_iface, hwndOwner, dwFlags );
938 }
static IDirectInputImpl * impl_from_IDirectInput8A(IDirectInput8A *iface)
Definition: dinput_main.c:72
_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:742

◆ IDirectInput8WImpl_AddRef()

static ULONG WINAPI IDirectInput8WImpl_AddRef ( LPDIRECTINPUT8W  iface)
static

Definition at line 864 of file dinput_main.c.

865 {
867  return IDirectInputAImpl_AddRef( &This->IDirectInput7A_iface );
868 }
static IDirectInputImpl * impl_from_IDirectInput8W(IDirectInput8W *iface)
Definition: dinput_main.c:77
static ULONG WINAPI IDirectInputAImpl_AddRef(LPDIRECTINPUT7A iface)
Definition: dinput_main.c:523

◆ IDirectInput8WImpl_ConfigureDevices()

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

Definition at line 1235 of file dinput_main.c.

1239 {
1241 
1242  FIXME("(this=%p,%p,%p,%04x,%p): stub\n", This, lpdiCallback, lpdiCDParams, dwFlags, pvRefData);
1243 
1244  /* Call helper function in config.c to do the real work */
1245  return _configure_devices(iface, lpdiCallback, lpdiCDParams, dwFlags, pvRefData);
1246 }
HRESULT _configure_devices(IDirectInput8W *iface, LPDICONFIGUREDEVICESCALLBACK lpdiCallback, LPDICONFIGUREDEVICESPARAMSW lpdiCDParams, DWORD dwFlags, LPVOID pvRefData)
Definition: config.c:441
#define FIXME(fmt,...)
Definition: debug.h:110
static IDirectInputImpl * impl_from_IDirectInput8W(IDirectInput8W *iface)
Definition: dinput_main.c:77
_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 901 of file dinput_main.c.

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

◆ IDirectInput8WImpl_EnumDevices()

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

Definition at line 915 of file dinput_main.c.

917 {
919  return IDirectInputWImpl_EnumDevices( &This->IDirectInput7W_iface, dwDevType, lpCallback, pvRef, dwFlags );
920 }
static HRESULT WINAPI IDirectInputWImpl_EnumDevices(LPDIRECTINPUT7W iface, DWORD dwDevType, LPDIENUMDEVICESCALLBACKW lpCallback, LPVOID pvRef, DWORD dwFlags)
Definition: dinput_main.c:485
static IDirectInputImpl * impl_from_IDirectInput8W(IDirectInput8W *iface)
Definition: dinput_main.c:77
_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 1143 of file dinput_main.c.

1148 {
1149  static REFGUID guids[2] = { &GUID_SysKeyboard, &GUID_SysMouse };
1150  static const DWORD actionMasks[] = { DIKEYBOARD_MASK, DIMOUSE_MASK };
1152  DIDEVICEINSTANCEW didevi;
1153  LPDIRECTINPUTDEVICE8W lpdid;
1154  DWORD callbackFlags;
1155  int i, j;
1156  int device_count = 0;
1157  int remain;
1158  DIDEVICEINSTANCEW *didevis = 0;
1159 
1160  FIXME("(this=%p,%s,%p,%p,%p,%04x): semi-stub\n", This, debugstr_w(ptszUserName), lpdiActionFormat,
1161  lpCallback, pvRef, dwFlags);
1162 
1163  didevi.dwSize = sizeof(didevi);
1164 
1165  /* Enumerate all the joysticks */
1166  for (i = 0; i < ARRAY_SIZE(dinput_devices); i++)
1167  {
1168  HRESULT enumSuccess;
1169 
1170  if (!dinput_devices[i]->enum_deviceW) continue;
1171 
1172  for (j = 0, enumSuccess = S_OK; SUCCEEDED(enumSuccess); j++)
1173  {
1174  TRACE(" - checking device %u ('%s')\n", i, dinput_devices[i]->name);
1175 
1176  /* Default behavior is to enumerate attached game controllers */
1177  enumSuccess = dinput_devices[i]->enum_deviceW(DI8DEVCLASS_GAMECTRL, DIEDFL_ATTACHEDONLY | dwFlags, &didevi, This->dwVersion, j);
1178  if (enumSuccess == S_OK &&
1179  should_enumerate_device(ptszUserName, dwFlags, &This->device_players, &didevi.guidInstance))
1180  {
1181  if (device_count++)
1182  didevis = HeapReAlloc(GetProcessHeap(), 0, didevis, sizeof(DIDEVICEINSTANCEW)*device_count);
1183  else
1184  didevis = HeapAlloc(GetProcessHeap(), 0, sizeof(DIDEVICEINSTANCEW)*device_count);
1185  didevis[device_count-1] = didevi;
1186  }
1187  }
1188  }
1189 
1190  remain = device_count;
1191  /* Add keyboard and mouse to remaining device count */
1193  {
1194  for (i = 0; i < ARRAY_SIZE(guids); i++)
1195  {
1196  if (should_enumerate_device(ptszUserName, dwFlags, &This->device_players, guids[i]))
1197  remain++;
1198  }
1199  }
1200 
1201  for (i = 0; i < device_count; i++)
1202  {
1203  callbackFlags = diactionformat_priorityW(lpdiActionFormat, lpdiActionFormat->dwGenre);
1204  IDirectInput_CreateDevice(iface, &didevis[i].guidInstance, &lpdid, NULL);
1205 
1206  if (lpCallback(&didevis[i], lpdid, callbackFlags, --remain, pvRef) == DIENUM_STOP)
1207  {
1208  HeapFree(GetProcessHeap(), 0, didevis);
1209  return DI_OK;
1210  }
1211  }
1212 
1213  HeapFree(GetProcessHeap(), 0, didevis);
1214 
1215  if (dwFlags & DIEDBSFL_FORCEFEEDBACK) return DI_OK;
1216 
1217  /* Enumerate keyboard and mouse */
1218  for (i = 0; i < ARRAY_SIZE(guids); i++)
1219  {
1220  if (should_enumerate_device(ptszUserName, dwFlags, &This->device_players, guids[i]))
1221  {
1222  callbackFlags = diactionformat_priorityW(lpdiActionFormat, actionMasks[i]);
1223 
1224  IDirectInput_CreateDevice(iface, guids[i], &lpdid, NULL);
1225  IDirectInputDevice_GetDeviceInfo(lpdid, &didevi);
1226 
1227  if (lpCallback(&didevi, lpdid, callbackFlags, --remain, pvRef) == DIENUM_STOP)
1228  return DI_OK;
1229  }
1230  }
1231 
1232  return DI_OK;
1233 }
Definition: scsiwmi.h:51
#define IDirectInput_CreateDevice(p, a, b, c)
Definition: dinput.h:2243
static BOOL should_enumerate_device(const WCHAR *username, DWORD dwFlags, struct list *device_players, REFGUID guid)
Definition: dinput_main.c:982
#define DIEDBSFL_FORCEFEEDBACK
Definition: dinput.h:452
static DWORD diactionformat_priorityW(LPDIACTIONFORMATW lpdiaf, DWORD genre)
Definition: dinput_main.c:396
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:395
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:87
static IDirectInputImpl * impl_from_IDirectInput8W(IDirectInput8W *iface)
Definition: dinput_main.c:77
_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:393
#define IDirectInputDevice_GetDeviceInfo(p, a)
Definition: dinput.h:1618
GUID guidInstance
Definition: dinput.h:426
Definition: name.c:36
#define DI_OK
Definition: dinput.h:128
#define DI8DEVCLASS_GAMECTRL
Definition: dinput.h:207
#define HeapFree(x, y, z)
Definition: compat.h:394
#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 976 of file dinput_main.c.

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

◆ IDirectInput8WImpl_GetDeviceStatus()

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

Definition at line 928 of file dinput_main.c.

929 {
931  return IDirectInputAImpl_GetDeviceStatus( &This->IDirectInput7A_iface, rguid );
932 }
static HRESULT WINAPI IDirectInputAImpl_GetDeviceStatus(LPDIRECTINPUT7A iface, REFGUID rguid)
Definition: dinput_main.c:716
static IDirectInputImpl * impl_from_IDirectInput8W(IDirectInput8W *iface)
Definition: dinput_main.c:77

◆ IDirectInput8WImpl_Initialize()

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

Definition at line 964 of file dinput_main.c.

965 {
967  return IDirectInput8AImpl_Initialize( &This->IDirectInput8A_iface, hinst, version );
968 }
static const WCHAR version[]
Definition: asmname.c:64
static HRESULT WINAPI IDirectInput8AImpl_Initialize(LPDIRECTINPUT8A iface, HINSTANCE hinst, DWORD version)
Definition: dinput_main.c:946
static IDirectInputImpl * impl_from_IDirectInput8W(IDirectInput8W *iface)
Definition: dinput_main.c:77
static HINSTANCE hinst
Definition: edit.c:551

◆ IDirectInput8WImpl_QueryInterface()

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

Definition at line 876 of file dinput_main.c.

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

◆ IDirectInput8WImpl_Release()

static ULONG WINAPI IDirectInput8WImpl_Release ( LPDIRECTINPUT8W  iface)
static

Definition at line 888 of file dinput_main.c.

889 {
891  return IDirectInputAImpl_Release( &This->IDirectInput7A_iface );
892 }
static IDirectInputImpl * impl_from_IDirectInput8W(IDirectInput8W *iface)
Definition: dinput_main.c:77
static ULONG WINAPI IDirectInputAImpl_Release(LPDIRECTINPUT7A iface)
Definition: dinput_main.c:538

◆ IDirectInput8WImpl_RunControlPanel()

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

Definition at line 940 of file dinput_main.c.

941 {
943  return IDirectInputAImpl_RunControlPanel( &This->IDirectInput7A_iface, hwndOwner, dwFlags );
944 }
static IDirectInputImpl * impl_from_IDirectInput8W(IDirectInput8W *iface)
Definition: dinput_main.c:77
_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:742

◆ IDirectInputAImpl_AddRef()

static ULONG WINAPI IDirectInputAImpl_AddRef ( LPDIRECTINPUT7A  iface)
static

Definition at line 523 of file dinput_main.c.

524 {
527 
528  TRACE( "(%p) incrementing from %d\n", This, ref - 1);
529  return ref;
530 }
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:62
#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 842 of file dinput_main.c.

844 {
845  return IDirectInput7AImpl_CreateDeviceEx(iface, rguid, NULL, (LPVOID*)pdev, punk);
846 }
static HRESULT WINAPI IDirectInput7AImpl_CreateDeviceEx(LPDIRECTINPUT7A iface, REFGUID rguid, REFIID riid, LPVOID *pvOut, LPUNKNOWN lpUnknownOuter)
Definition: dinput_main.c:822
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 445 of file dinput_main.c.

448 {
450  DIDEVICEINSTANCEA devInstance;
451  unsigned int i;
452  int j;
453  HRESULT r;
454 
455  TRACE("(this=%p,0x%04x '%s',%p,%p,0x%04x)\n",
456  This, dwDevType, _dump_DIDEVTYPE_value(dwDevType, This->dwVersion),
457  lpCallback, pvRef, dwFlags);
459 
460  if (!lpCallback ||
462  (dwDevType > DI8DEVCLASS_GAMECTRL && dwDevType < DI8DEVTYPE_DEVICE) || dwDevType > DI8DEVTYPE_SUPPLEMENTAL)
463  return DIERR_INVALIDPARAM;
464 
465  if (!This->initialized)
466  return DIERR_NOTINITIALIZED;
467 
468  for (i = 0; i < ARRAY_SIZE(dinput_devices); i++) {
469  if (!dinput_devices[i]->enum_deviceA) continue;
470  for (j = 0, r = S_OK; SUCCEEDED(r); j++) {
471  devInstance.dwSize = sizeof(devInstance);
472  TRACE(" - checking device %u ('%s')\n", i, dinput_devices[i]->name);
473  r = dinput_devices[i]->enum_deviceA(dwDevType, dwFlags, &devInstance, This->dwVersion, j);
474  if (r == S_OK)
475  if (enum_callback_wrapper(lpCallback, &devInstance, pvRef) == DIENUM_STOP)
476  return S_OK;
477  }
478  }
479 
480  return S_OK;
481 }
#define DIERR_NOTINITIALIZED
Definition: dinput.h:157
static const char * _dump_DIDEVTYPE_value(DWORD dwDevType, DWORD dwVersion)
Definition: dinput_main.c:240
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:439
static IDirectInputImpl * impl_from_IDirectInput7A(IDirectInput7A *iface)
Definition: dinput_main.c:62
#define DIEDFL_INCLUDEPHANTOMS
Definition: dinput.h:194
static const struct dinput_device * dinput_devices[]
Definition: dinput_main.c:87
_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:263
#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:36
#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 716 of file dinput_main.c.

717 {
719  HRESULT hr;
721 
722  TRACE( "(%p)->(%s)\n", This, debugstr_guid(rguid) );
723 
724  if (!rguid) return E_POINTER;
725  if (!This->initialized)
726  return DIERR_NOTINITIALIZED;
727 
728  hr = IDirectInput_CreateDevice( iface, rguid, &device, NULL );
729  if (hr != DI_OK) return DI_NOTATTACHED;
730 
731  IUnknown_Release( device );
732 
733  return DI_OK;
734 }
#define DIERR_NOTINITIALIZED
Definition: dinput.h:157
HRESULT hr
Definition: shlfolder.c:183
#define IDirectInput_CreateDevice(p, a, b, c)
Definition: dinput.h:2243
#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:62
#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 689 of file dinput_main.c.

690 {
692 
693  TRACE("(%p)->(%p, 0x%04x)\n", iface, hinst, version);
694 
695  if (!hinst)
696  return DIERR_INVALIDPARAM;
697  else if (version == 0)
698  return DIERR_NOTINITIALIZED;
699  else if (version > DIRECTINPUT_VERSION_700)
706 
708 }
#define DIERR_NOTINITIALIZED
Definition: dinput.h:157
static HRESULT initialize_directinput_instance(IDirectInputImpl *This, DWORD dwVersion)
Definition: dinput_main.c:625
static const WCHAR version[]
Definition: asmname.c:64
#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:62
#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 560 of file dinput_main.c.

561 {
563 
564  TRACE( "(%p)->(%s,%p)\n", This, debugstr_guid(riid), ppobj );
565 
566  if (!riid || !ppobj)
567  return E_POINTER;
568 
569  if (IsEqualGUID( &IID_IUnknown, riid ) ||
570  IsEqualGUID( &IID_IDirectInputA, riid ) ||
571  IsEqualGUID( &IID_IDirectInput2A, riid ) ||
572  IsEqualGUID( &IID_IDirectInput7A, riid ))
573  {
574  *ppobj = &This->IDirectInput7A_iface;
575  IUnknown_AddRef( (IUnknown*)*ppobj );
576 
577  return DI_OK;
578  }
579 
580  if (IsEqualGUID( &IID_IDirectInputW, riid ) ||
581  IsEqualGUID( &IID_IDirectInput2W, riid ) ||
582  IsEqualGUID( &IID_IDirectInput7W, riid ))
583  {
584  *ppobj = &This->IDirectInput7W_iface;
585  IUnknown_AddRef( (IUnknown*)*ppobj );
586 
587  return DI_OK;
588  }
589 
590  if (IsEqualGUID( &IID_IDirectInput8A, riid ))
591  {
592  *ppobj = &This->IDirectInput8A_iface;
593  IUnknown_AddRef( (IUnknown*)*ppobj );
594 
595  return DI_OK;
596  }
597 
598  if (IsEqualGUID( &IID_IDirectInput8W, riid ))
599  {
600  *ppobj = &This->IDirectInput8W_iface;
601  IUnknown_AddRef( (IUnknown*)*ppobj );
602 
603  return DI_OK;
604  }
605 
606  if (IsEqualGUID( &IID_IDirectInputJoyConfig8, riid ))
607  {
608  *ppobj = &This->IDirectInputJoyConfig8_iface;
609  IUnknown_AddRef( (IUnknown*)*ppobj );
610 
611  return DI_OK;
612  }
613 
614  FIXME( "Unsupported interface: %s\n", debugstr_guid(riid));
615  *ppobj = NULL;
616  return E_NOINTERFACE;
617 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#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 IDirectInputImpl * impl_from_IDirectInput7A(IDirectInput7A *iface)
Definition: dinput_main.c:62
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
#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 538 of file dinput_main.c.

539 {
541  ULONG ref = InterlockedDecrement( &This->ref );
542 
543  TRACE( "(%p) releasing from %d\n", This, ref + 1 );
544 
545  if (ref == 0)
546  {
548  HeapFree( GetProcessHeap(), 0, This );
549  }
550 
551  return ref;
552 }
Definition: send.c:47
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
static IDirectInputImpl * impl_from_IDirectInput7A(IDirectInput7A *iface)
Definition: dinput_main.c:62
#define InterlockedDecrement
Definition: armddk.h:52
unsigned int ULONG
Definition: retypes.h:1
static void uninitialize_directinput_instance(IDirectInputImpl *This)
Definition: dinput_main.c:655
#define HeapFree(x, y, z)
Definition: compat.h:394

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 742 of file dinput_main.c.

745 {
746  WCHAR control_exeW[] = {'c','o','n','t','r','o','l','.','e','x','e',0};
747  STARTUPINFOW si = {0};
749 
751 
752  TRACE( "(%p)->(%p, %08x)\n", This, hwndOwner, dwFlags );
753 
754  if (hwndOwner && !IsWindow(hwndOwner))
755  return E_HANDLE;
756 
757  if (dwFlags)
758  return DIERR_INVALIDPARAM;
759 
760  if (!This->initialized)
761  return DIERR_NOTINITIALIZED;
762 
763  if (!CreateProcessW(NULL, control_exeW, NULL, NULL, FALSE, DETACHED_PROCESS, NULL, NULL, &si, &pi))
765 
766  return DI_OK;
767 }
#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:4623
#define DIERR_INVALIDPARAM
Definition: dinput.h:152
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
static IDirectInputImpl * impl_from_IDirectInput7A(IDirectInput7A *iface)
Definition: dinput_main.c:62
static DWORD pi
Definition: protocol.c:150
_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 532 of file dinput_main.c.

533 {
535  return IDirectInputAImpl_AddRef( &This->IDirectInput7A_iface );
536 }
static IDirectInputImpl * impl_from_IDirectInput7W(IDirectInput7W *iface)
Definition: dinput_main.c:67
static ULONG WINAPI IDirectInputAImpl_AddRef(LPDIRECTINPUT7A iface)
Definition: dinput_main.c:523

◆ IDirectInputWImpl_CreateDevice()

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

Definition at line 848 of file dinput_main.c.

850 {
851  return IDirectInput7WImpl_CreateDeviceEx(iface, rguid, NULL, (LPVOID*)pdev, punk);
852 }
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:832

◆ IDirectInputWImpl_EnumDevices()

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

Definition at line 485 of file dinput_main.c.

488 {
490  DIDEVICEINSTANCEW devInstance;
491  unsigned int i;
492  int j;
493  HRESULT r;
494 
495  TRACE("(this=%p,0x%04x '%s',%p,%p,0x%04x)\n",
496  This, dwDevType, _dump_DIDEVTYPE_value(dwDevType, This->dwVersion),
497  lpCallback, pvRef, dwFlags);
499 
500  if (!lpCallback ||
502  (dwDevType > DI8DEVCLASS_GAMECTRL && dwDevType < DI8DEVTYPE_DEVICE) || dwDevType > DI8DEVTYPE_SUPPLEMENTAL)
503  return DIERR_INVALIDPARAM;
504 
505  if (!This->initialized)
506  return DIERR_NOTINITIALIZED;
507 
508  for (i = 0; i < ARRAY_SIZE(dinput_devices); i++) {
509  if (!dinput_devices[i]->enum_deviceW) continue;
510  for (j = 0, r = S_OK; SUCCEEDED(r); j++) {
511  devInstance.dwSize = sizeof(devInstance);
512  TRACE(" - checking device %u ('%s')\n", i, dinput_devices[i]->name);
513  r = dinput_devices[i]->enum_deviceW(dwDevType, dwFlags, &devInstance, This->dwVersion, j);
514  if (r == S_OK)
515  if (enum_callback_wrapper(lpCallback, &devInstance, pvRef) == DIENUM_STOP)
516  return S_OK;
517  }
518  }
519 
520  return S_OK;
521 }
#define DIERR_NOTINITIALIZED
Definition: dinput.h:157
static const char * _dump_DIDEVTYPE_value(DWORD dwDevType, DWORD dwVersion)
Definition: dinput_main.c:240
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:439
#define DIEDFL_INCLUDEPHANTOMS
Definition: dinput.h:194
static const struct dinput_device * dinput_devices[]
Definition: dinput_main.c:87
_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:67
static void _dump_EnumDevices_dwFlags(DWORD dwFlags)
Definition: dinput_main.c:263
#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:36
#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 736 of file dinput_main.c.

737 {
739  return IDirectInputAImpl_GetDeviceStatus( &This->IDirectInput7A_iface, rguid );
740 }
static HRESULT WINAPI IDirectInputAImpl_GetDeviceStatus(LPDIRECTINPUT7A iface, REFGUID rguid)
Definition: dinput_main.c:716
static IDirectInputImpl * impl_from_IDirectInput7W(IDirectInput7W *iface)
Definition: dinput_main.c:67

◆ IDirectInputWImpl_Initialize()

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

Definition at line 710 of file dinput_main.c.

711 {
713  return IDirectInputAImpl_Initialize( &This->IDirectInput7A_iface, hinst, x );
714 }
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:689
static IDirectInputImpl * impl_from_IDirectInput7W(IDirectInput7W *iface)
Definition: dinput_main.c:67
static HINSTANCE hinst
Definition: edit.c:551

◆ IDirectInputWImpl_QueryInterface()

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

Definition at line 619 of file dinput_main.c.

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

◆ IDirectInputWImpl_Release()

static ULONG WINAPI IDirectInputWImpl_Release ( LPDIRECTINPUT7W  iface)
static

Definition at line 554 of file dinput_main.c.

555 {
557  return IDirectInputAImpl_Release( &This->IDirectInput7A_iface );
558 }
static IDirectInputImpl * impl_from_IDirectInput7W(IDirectInput7W *iface)
Definition: dinput_main.c:67
static ULONG WINAPI IDirectInputAImpl_Release(LPDIRECTINPUT7A iface)
Definition: dinput_main.c:538

◆ IDirectInputWImpl_RunControlPanel()

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

Definition at line 769 of file dinput_main.c.

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

◆ impl_from_IClassFactory()

static IClassFactoryImpl* impl_from_IClassFactory ( IClassFactory iface)
inlinestatic

Definition at line 1544 of file dinput_main.c.

1545 {
1546  return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface);
1547 }
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 62 of file dinput_main.c.

63 {
64  return CONTAINING_RECORD( iface, IDirectInputImpl, IDirectInput7A_iface );
65 }
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 67 of file dinput_main.c.

68 {
69  return CONTAINING_RECORD( iface, IDirectInputImpl, IDirectInput7W_iface );
70 }
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 72 of file dinput_main.c.

73 {
74  return CONTAINING_RECORD( iface, IDirectInputImpl, IDirectInput8A_iface );
75 }
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 77 of file dinput_main.c.

78 {
79  return CONTAINING_RECORD( iface, IDirectInputImpl, IDirectInput8W_iface );
80 }
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 82 of file dinput_main.c.

83 {
84  return CONTAINING_RECORD(iface, IDirectInputDeviceImpl, IDirectInputDevice8W_iface);
85 }
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 1300 of file dinput_main.c.

1301 {
1302  return CONTAINING_RECORD( iface, IDirectInputImpl, IDirectInputJoyConfig8_iface );
1303 }
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 625 of file dinput_main.c.

626 {
627  if (!This->initialized)
628  {
629  This->dwVersion = dwVersion;
630  This->evsequence = 1;
631 
633  This->crit.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": IDirectInputImpl*->crit");
634 
635  list_init( &This->devices_list );
636  list_init( &This->device_players );
637 
638  /* Add self to the list of the IDirectInputs */
640  list_add_head( &direct_input_list, &This->entry );
642 
643  This->initialized = TRUE;
644 
645  if (!check_hook_thread())
646  {
648  return DIERR_GENERIC;
649  }
650  }
651 
652  return DI_OK;
653 }
#define TRUE
Definition: types.h:120
#define DWORD_PTR
Definition: treelist.c:76
static CRITICAL_SECTION dinput_hook_crit
Definition: dinput_main.c:99
__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:697
static BOOL check_hook_thread(void)
Definition: dinput_main.c:1794
#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:100
static void uninitialize_directinput_instance(IDirectInputImpl *This)
Definition: dinput_main.c:655

Referenced by IDirectInput8AImpl_Initialize(), and IDirectInputAImpl_Initialize().

◆ JoyConfig8Impl_Acquire()

static HRESULT WINAPI JoyConfig8Impl_Acquire ( IDirectInputJoyConfig8 *  iface)
static

Definition at line 1323 of file dinput_main.c.

1324 {
1325  FIXME( "(%p): stub!\n", iface );
1326  return E_NOTIMPL;
1327 }
#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 1439 of file dinput_main.c.

1440 {
1441  FIXME( "(%p)->(%p, %s): stub!\n", iface, hwnd, debugstr_guid(guid) );
1442  return E_NOTIMPL;
1443 }
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 1311 of file dinput_main.c.

1312 {
1314  return IDirectInputAImpl_AddRef( &This->IDirectInput7A_iface );
1315 }
static IDirectInputImpl * impl_from_IDirectInputJoyConfig8(IDirectInputJoyConfig8 *iface)
Definition: dinput_main.c:1300
static ULONG WINAPI IDirectInputAImpl_AddRef(LPDIRECTINPUT7A iface)
Definition: dinput_main.c:523

◆ JoyConfig8Impl_DeleteConfig()

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

Definition at line 1421 of file dinput_main.c.

1422 {
1423  FIXME( "(%p)->(%d): stub!\n", iface, id );
1424  return E_NOTIMPL;
1425 }
#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 1366 of file dinput_main.c.

1367 {
1368  FIXME( "(%p)->(%s): stub!\n", iface, debugstr_w(name) );
1369  return E_NOTIMPL;
1370 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
Definition: name.c:36

◆ JoyConfig8Impl_EnumTypes()

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

Definition at line 1347 of file dinput_main.c.

1348 {
1349  FIXME( "(%p)->(%p, %p): stub!\n", iface, cb, ref );
1350  return E_NOTIMPL;
1351 }
Definition: send.c:47
#define FIXME(fmt,...)
Definition: debug.h:110
static DWORD cb
Definition: integrity.c:41
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ JoyConfig8Impl_GetConfig()

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

Definition at line 1372 of file dinput_main.c.

1373 {
1375  UINT found = 0;
1376  int i, j;
1377  HRESULT r;
1378 
1379  FIXME("(%p)->(%d, %p, 0x%08x): semi-stub!\n", iface, id, info, flags);
1380 
1381 #define X(x) if (flags & x) FIXME("\tflags |= "#x"\n");
1384  X(DIJC_GAIN)
1385  X(DIJC_CALLOUT)
1386 #undef X
1387 
1388  /* Enumerate all joysticks in order */
1389  for (i = 0; i < ARRAY_SIZE(dinput_devices); i++)
1390  {
1391  if (!dinput_devices[i]->enum_deviceA) continue;
1392 
1393  for (j = 0, r = S_OK; SUCCEEDED(r); j++)
1394  {
1396  dev.dwSize = sizeof(dev);
1397  if ((r = dinput_devices[i]->enum_deviceA(DI8DEVCLASS_GAMECTRL, 0, &dev, di->dwVersion, j)) == S_OK)
1398  {
1399  /* Only take into account the chosen id */
1400  if (found == id)
1401  {
1402  if (flags & DIJC_GUIDINSTANCE)
1403  info->guidInstance = dev.guidInstance;
1404 
1405  return DI_OK;
1406  }
1407  found += 1;
1408  }
1409  }
1410  }
1411 
1412  return DIERR_NOMOREITEMS;
1413 }
#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:1300
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:87
#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 1353 of file dinput_main.c.

1354 {
1355  FIXME( "(%p)->(%s, %p, 0x%08x): stub!\n", iface, debugstr_w(name), info, flags );
1356  return E_NOTIMPL;
1357 }
#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:36

◆ JoyConfig8Impl_GetUserValues()

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

Definition at line 1427 of file dinput_main.c.

1428 {
1429  FIXME( "(%p)->(%p, 0x%08x): stub!\n", iface, info, flags );
1430  return E_NOTIMPL;
1431 }
#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 1451 of file dinput_main.c.

1452 {
1453  FIXME( "(%p)->(%p): stub!\n", iface, key );
1454  return E_NOTIMPL;
1455 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
Definition: path.c:42

◆ JoyConfig8Impl_OpenTypeKey()

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

Definition at line 1445 of file dinput_main.c.

1446 {
1447  FIXME( "(%p)->(%s, 0x%08x, %p): stub!\n", iface, debugstr_w(name), security, key );
1448  return E_NOTIMPL;
1449 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
Definition: name.c:36
Definition: path.c:42

◆ JoyConfig8Impl_QueryInterface()

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

Definition at line 1305 of file dinput_main.c.

1306 {
1308  return IDirectInputAImpl_QueryInterface( &This->IDirectInput7A_iface, riid, ppobj );
1309 }
REFIID riid
Definition: precomp.h:44
static IDirectInputImpl * impl_from_IDirectInputJoyConfig8(IDirectInputJoyConfig8 *iface)
Definition: dinput_main.c:1300
static HRESULT WINAPI IDirectInputAImpl_QueryInterface(LPDIRECTINPUT7A iface, REFIID riid, LPVOID *ppobj)
Definition: dinput_main.c:560

◆ JoyConfig8Impl_Release()

static ULONG WINAPI JoyConfig8Impl_Release ( IDirectInputJoyConfig8 *  iface)
static

Definition at line 1317 of file dinput_main.c.

1318 {
1320  return IDirectInputAImpl_Release( &This->IDirectInput7A_iface );
1321 }
static IDirectInputImpl * impl_from_IDirectInputJoyConfig8(IDirectInputJoyConfig8 *iface)
Definition: dinput_main.c:1300
static ULONG WINAPI IDirectInputAImpl_Release(LPDIRECTINPUT7A iface)
Definition: dinput_main.c:538

◆ JoyConfig8Impl_SendNotify()

static HRESULT WINAPI JoyConfig8Impl_SendNotify ( IDirectInputJoyConfig8 *  iface)
static

Definition at line 1341 of file dinput_main.c.

1342 {
1343  FIXME( "(%p): stub!\n", iface );
1344  return E_NOTIMPL;
1345 }
#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 1415 of file dinput_main.c.

1416 {
1417  FIXME( "(%p)->(%d, %p, 0x%08x): stub!\n", iface, id, info, flags );
1418  return E_NOTIMPL;
1419 }
#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 1335 of file dinput_main.c.

1336 {
1337  FIXME( "(%p)->(%p, 0x%08x): stub!\n", iface, hwnd, flags );
1338  return E_NOTIMPL;
1339 }
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 1359 of file dinput_main.c.

1361 {
1362  FIXME( "(%p)->(%s, %p, 0x%08x, %s): stub!\n", iface, debugstr_w(name), info, flags, debugstr_w(new_name) );
1363  return E_NOTIMPL;
1364 }
#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:36

◆ JoyConfig8Impl_SetUserValues()

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

Definition at line 1433 of file dinput_main.c.

1434 {
1435  FIXME( "(%p)->(%p, 0x%08x): stub!\n", iface, info, flags );
1436  return E_NOTIMPL;
1437 }
#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 1329 of file dinput_main.c.

1330 {
1331  FIXME( "(%p): stub!\n", iface );
1332  return E_NOTIMPL;
1333 }
#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 1649 of file dinput_main.c.

1650 {
1651  IDirectInputImpl *dinput;
1652  int skip = 0;
1653 
1654  if (code != HC_ACTION) return CallNextHookEx( 0, code, wparam, lparam );
1655 
1658  {
1660 
1661  EnterCriticalSection( &dinput->crit );
1663  if (dev->acquired && dev->event_proc)
1664  {
1665  TRACE("calling %p->%p (%lx %lx)\n", dev, dev->event_proc, wparam, lparam);
1666  skip |= dev->event_proc( &dev->IDirectInputDevice8A_iface, wparam, lparam );
1667  }
1668  LeaveCriticalSection( &dinput->crit );
1669  }
1671 
1672  return skip ? 1 : CallNextHookEx( 0, code, wparam, lparam );
1673 }
static CRITICAL_SECTION dinput_hook_crit
Definition: dinput_main.c:99
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(...)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static struct list direct_input_list
Definition: dinput_main.c:100
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 982 of file dinput_main.c.

984 {
985  BOOL should_enumerate = TRUE;
986  struct DevicePlayer *device_player;
987 
988  /* Check if user owns this device */
990  {
991  should_enumerate = FALSE;
992  LIST_FOR_EACH_ENTRY(device_player, device_players, struct DevicePlayer, entry)
993  {
994  if (IsEqualGUID(&device_player->instance_guid, guid))
995  {
996  if (*device_player->username && !lstrcmpW(username, device_player->username))
997  return TRUE; /* Device username matches */
998  break;
999  }
1000  }
1001  }
1002 
1003  /* Check if this device is not owned by anyone */
1005  BOOL found = FALSE;
1006  should_enumerate = FALSE;
1007  LIST_FOR_EACH_ENTRY(device_player, device_players, struct DevicePlayer, entry)
1008  {
1009  if (IsEqualGUID(&device_player->instance_guid, guid))
1010  {
1011  if (*device_player->username)
1012  found = TRUE;
1013  break;
1014  }
1015  }
1016  if (!found)
1017  return TRUE; /* Device does not have a username */
1018  }
1019 
1020  return should_enumerate;
1021 }
#define TRUE
Definition: types.h:120
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
WCHAR username[MAX_PATH]
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
const GUID * guid
unsigned int BOOL
Definition: ntddk_ex.h:94
static WCHAR username[]
Definition: url.c:32
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
uint32_t entry
Definition: isohybrid.c:63
#define DIEDBSFL_AVAILABLEDEVICES
Definition: dinput.h:453
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
#define DIEDBSFL_THISUSER
Definition: dinput.h:451

Referenced by IDirectInput8AImpl_EnumDevicesBySemantics(), and IDirectInput8WImpl_EnumDevicesBySemantics().

◆ uninitialize_directinput_instance()

static void uninitialize_directinput_instance ( IDirectInputImpl This)
static

Definition at line 655 of file dinput_main.c.

656 {
657  if (This->initialized)
658  {
659  struct DevicePlayer *device_player, *device_player2;
660  /* Remove self from the list of the IDirectInputs */
662  list_remove( &This->entry );
664 
665  LIST_FOR_EACH_ENTRY_SAFE( device_player, device_player2,
666  &This->device_players, struct DevicePlayer, entry )
667  HeapFree(GetProcessHeap(), 0, device_player);
668 
670 
671  This->crit.DebugInfo->Spare[0] = 0;
672  DeleteCriticalSection( &This->crit );
673 
674  This->initialized = FALSE;
675  }
676 }
static CRITICAL_SECTION dinput_hook_crit
Definition: dinput_main.c:99
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static BOOL check_hook_thread(void)
Definition: dinput_main.c:1794
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
#define GetProcessHeap()
Definition: compat.h:395
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
uint32_t entry
Definition: isohybrid.c:63
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by IDirectInputAImpl_Release(), and initialize_directinput_instance().

◆ WINE_DEFAULT_DEBUG_CHANNEL()