ReactOS  0.4.13-dev-259-g5ca9c9c
dinput_private.h File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "dinput.h"
#include "dinputd.h"
#include "wine/list.h"
Include dependency graph for dinput_private.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  IDirectInputImpl
 
struct  dinput_device
 
struct  DevicePlayer
 

Macros

#define IS_DIPROP(x)   (((ULONG_PTR)(x) >> 16) == 0)
 
#define DIKEYBOARD_MASK   0x81000000
 
#define DIMOUSE_MASK   0x82000000
 
#define DIGENRE_ANY   0xFF000000
 

Typedefs

typedef struct IDirectInputImpl IDirectInputImpl
 
typedef int(* DI_EVENT_PROC) (LPDIRECTINPUTDEVICE8A, WPARAM, LPARAM)
 

Functions

void check_dinput_hooks (LPDIRECTINPUTDEVICE8W, BOOL) DECLSPEC_HIDDEN
 
void check_dinput_events (void) DECLSPEC_HIDDEN
 
void _copy_diactionformatAtoW (LPDIACTIONFORMATW, LPDIACTIONFORMATA) DECLSPEC_HIDDEN
 
void _copy_diactionformatWtoA (LPDIACTIONFORMATA, LPDIACTIONFORMATW) DECLSPEC_HIDDEN
 
HRESULT _configure_devices (IDirectInput8W *iface, LPDICONFIGUREDEVICESCALLBACK lpdiCallback, LPDICONFIGUREDEVICESPARAMSW lpdiCDParams, DWORD dwFlags, LPVOID pvRefData) DECLSPEC_HIDDEN
 
WCHARget_mapping_path (const WCHAR *device, const WCHAR *username) DECLSPEC_HIDDEN
 

Variables

HINSTANCE DINPUT_instance
 
const struct dinput_device mouse_device DECLSPEC_HIDDEN
 

Macro Definition Documentation

◆ DIGENRE_ANY

#define DIGENRE_ANY   0xFF000000

Definition at line 89 of file dinput_private.h.

◆ DIKEYBOARD_MASK

#define DIKEYBOARD_MASK   0x81000000

Definition at line 87 of file dinput_private.h.

◆ DIMOUSE_MASK

#define DIMOUSE_MASK   0x82000000

Definition at line 88 of file dinput_private.h.

◆ IS_DIPROP

#define IS_DIPROP (   x)    (((ULONG_PTR)(x) >> 16) == 0)

Definition at line 85 of file dinput_private.h.

Typedef Documentation

◆ DI_EVENT_PROC

typedef int(* DI_EVENT_PROC) (LPDIRECTINPUTDEVICE8A, WPARAM, LPARAM)

Definition at line 76 of file dinput_private.h.

◆ IDirectInputImpl

Definition at line 33 of file dinput_private.h.

Function Documentation

◆ _configure_devices()

HRESULT _configure_devices ( IDirectInput8W *  iface,
LPDICONFIGUREDEVICESCALLBACK  lpdiCallback,
LPDICONFIGUREDEVICESPARAMSW  lpdiCDParams,
DWORD  dwFlags,
LPVOID  pvRefData 
)

Definition at line 441 of file config.c.

447 {
449  data.lpDI = iface;
450  data.lpdiaf = lpdiCDParams->lprgFormats;
451  data.display_only = !(dwFlags & DICD_EDIT);
452 
454 
456  lpdiCDParams->hwnd, ConfigureDevicesDlgProc, (LPARAM)&data);
457 
458  return DI_OK;
459 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
HINSTANCE DINPUT_instance
Definition: dinput_main.c:96
LONG_PTR LPARAM
Definition: windef.h:208
__wchar_t WCHAR
Definition: xmlstorage.h:180
LPDIACTIONFORMATW lprgFormats
Definition: dinput.h:1401
#define DICD_EDIT
Definition: dinput.h:1364
#define IDD_CONFIGUREDEVICES
Definition: resource.h:23
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
static INT_PTR CALLBACK ConfigureDevicesDlgProc(HWND dialog, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: config.c:351
#define DI_OK
Definition: dinput.h:128
VOID WINAPI InitCommonControls(void)
Definition: commctrl.c:863

Referenced by IDirectInput8WImpl_ConfigureDevices().

◆ _copy_diactionformatAtoW()

void _copy_diactionformatAtoW ( LPDIACTIONFORMATW  ,
LPDIACTIONFORMATA   
)

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 }
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
struct _DIACTIONFORMATW DIACTIONFORMATW
CardRegion * from
Definition: spigame.cpp:19

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

◆ _copy_diactionformatWtoA()

void _copy_diactionformatWtoA ( LPDIACTIONFORMATA  ,
LPDIACTIONFORMATW   
)

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 }
struct _DIACTIONFORMATA DIACTIONFORMATA
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
struct _DIACTIONA DIACTIONA
CardRegion * from
Definition: spigame.cpp:19

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

◆ 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  ,
BOOL   
)

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().

◆ get_mapping_path()

WCHAR* get_mapping_path ( const WCHAR device,
const WCHAR username 
)

Variable Documentation

◆ DECLSPEC_HIDDEN

Definition at line 69 of file dinput_private.h.

◆ DINPUT_instance