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

Go to the source code of this file.

Classes

struct  DataTransform
 
struct  DataFormat
 
struct  ActionMap
 
struct  IDirectInputDeviceImpl
 
struct  ObjProps
 
struct  effect_list_item
 

Typedefs

typedef struct IDirectInputDeviceImpl IDirectInputDeviceImpl
 

Functions

BOOL get_app_key (HKEY *, HKEY *) DECLSPEC_HIDDEN
 
DWORD get_config_key (HKEY, HKEY, const char *, char *, DWORD) DECLSPEC_HIDDEN
 
void fill_DataFormat (void *out, DWORD size, const void *in, const DataFormat *df) DECLSPEC_HIDDEN
 
void release_DataFormat (DataFormat *df) DECLSPEC_HIDDEN
 
void queue_event (LPDIRECTINPUTDEVICE8A iface, int inst_id, DWORD data, DWORD time, DWORD seq) DECLSPEC_HIDDEN
 
int id_to_object (LPCDIDATAFORMAT df, int id) DECLSPEC_HIDDEN
 
int find_property (const DataFormat *df, LPCDIPROPHEADER ph) DECLSPEC_HIDDEN
 
DWORD joystick_map_pov (const POINTL *p) DECLSPEC_HIDDEN
 
LONG joystick_map_axis (ObjProps *props, int val) DECLSPEC_HIDDEN
 
void _dump_DIPROPHEADER (LPCDIPROPHEADER diph) DECLSPEC_HIDDEN
 
void _dump_OBJECTINSTANCEA (const DIDEVICEOBJECTINSTANCEA *ddoi) DECLSPEC_HIDDEN
 
void _dump_OBJECTINSTANCEW (const DIDEVICEOBJECTINSTANCEW *ddoi) DECLSPEC_HIDDEN
 
void _dump_DIDATAFORMAT (const DIDATAFORMAT *df) DECLSPEC_HIDDEN
 
const char_dump_dinput_GUID (const GUID *guid) DECLSPEC_HIDDEN
 
LPDIOBJECTDATAFORMAT dataformat_to_odf_by_type (LPCDIDATAFORMAT df, int n, DWORD type) DECLSPEC_HIDDEN
 
HRESULT _build_action_map (LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUserName, DWORD dwFlags, DWORD devMask, LPCDIDATAFORMAT df) DECLSPEC_HIDDEN
 
HRESULT _set_action_map (LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUserName, DWORD dwFlags, LPCDIDATAFORMAT df) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2AImpl_Acquire (LPDIRECTINPUTDEVICE8A iface) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2WImpl_Acquire (LPDIRECTINPUTDEVICE8W iface) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2AImpl_Unacquire (LPDIRECTINPUTDEVICE8A iface) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2WImpl_Unacquire (LPDIRECTINPUTDEVICE8W iface) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2AImpl_SetDataFormat (LPDIRECTINPUTDEVICE8A iface, LPCDIDATAFORMAT df) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2WImpl_SetDataFormat (LPDIRECTINPUTDEVICE8W iface, LPCDIDATAFORMAT df) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2AImpl_SetCooperativeLevel (LPDIRECTINPUTDEVICE8A iface, HWND hwnd, DWORD dwflags) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2WImpl_SetCooperativeLevel (LPDIRECTINPUTDEVICE8W iface, HWND hwnd, DWORD dwflags) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2AImpl_SetEventNotification (LPDIRECTINPUTDEVICE8A iface, HANDLE hnd) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2WImpl_SetEventNotification (LPDIRECTINPUTDEVICE8W iface, HANDLE hnd) DECLSPEC_HIDDEN
 
ULONG WINAPI IDirectInputDevice2AImpl_Release (LPDIRECTINPUTDEVICE8A iface) DECLSPEC_HIDDEN
 
ULONG WINAPI IDirectInputDevice2WImpl_Release (LPDIRECTINPUTDEVICE8W iface) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2AImpl_QueryInterface (LPDIRECTINPUTDEVICE8A iface, REFIID riid, LPVOID *ppobj) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2WImpl_QueryInterface (LPDIRECTINPUTDEVICE8W iface, REFIID riid, LPVOID *ppobj) DECLSPEC_HIDDEN
 
ULONG WINAPI IDirectInputDevice2AImpl_AddRef (LPDIRECTINPUTDEVICE8A iface) DECLSPEC_HIDDEN
 
ULONG WINAPI IDirectInputDevice2WImpl_AddRef (LPDIRECTINPUTDEVICE8W iface) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2AImpl_EnumObjects (LPDIRECTINPUTDEVICE8A iface, LPDIENUMDEVICEOBJECTSCALLBACKA lpCallback, LPVOID lpvRef, DWORD dwFlags) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2WImpl_EnumObjects (LPDIRECTINPUTDEVICE8W iface, LPDIENUMDEVICEOBJECTSCALLBACKW lpCallback, LPVOID lpvRef, DWORD dwFlags) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2AImpl_GetProperty (LPDIRECTINPUTDEVICE8A iface, REFGUID rguid, LPDIPROPHEADER pdiph) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2WImpl_GetProperty (LPDIRECTINPUTDEVICE8W iface, REFGUID rguid, LPDIPROPHEADER pdiph) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2AImpl_SetProperty (LPDIRECTINPUTDEVICE8A iface, REFGUID rguid, LPCDIPROPHEADER pdiph) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2WImpl_SetProperty (LPDIRECTINPUTDEVICE8W iface, REFGUID rguid, LPCDIPROPHEADER pdiph) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2AImpl_GetObjectInfo (LPDIRECTINPUTDEVICE8A iface, LPDIDEVICEOBJECTINSTANCEA pdidoi, DWORD dwObj, DWORD dwHow) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2WImpl_GetObjectInfo (LPDIRECTINPUTDEVICE8W iface, LPDIDEVICEOBJECTINSTANCEW pdidoi, DWORD dwObj, DWORD dwHow) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2AImpl_GetDeviceData (LPDIRECTINPUTDEVICE8A iface, DWORD dodsize, LPDIDEVICEOBJECTDATA dod, LPDWORD entries, DWORD flags) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2WImpl_GetDeviceData (LPDIRECTINPUTDEVICE8W iface, DWORD dodsize, LPDIDEVICEOBJECTDATA dod, LPDWORD entries, DWORD flags) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2AImpl_RunControlPanel (LPDIRECTINPUTDEVICE8A iface, HWND hwndOwner, DWORD dwFlags) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2WImpl_RunControlPanel (LPDIRECTINPUTDEVICE8W iface, HWND hwndOwner, DWORD dwFlags) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2AImpl_Initialize (LPDIRECTINPUTDEVICE8A iface, HINSTANCE hinst, DWORD dwVersion, REFGUID rguid) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2WImpl_Initialize (LPDIRECTINPUTDEVICE8W iface, HINSTANCE hinst, DWORD dwVersion, REFGUID rguid) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2AImpl_CreateEffect (LPDIRECTINPUTDEVICE8A iface, REFGUID rguid, LPCDIEFFECT lpeff, LPDIRECTINPUTEFFECT *ppdef, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2WImpl_CreateEffect (LPDIRECTINPUTDEVICE8W iface, REFGUID rguid, LPCDIEFFECT lpeff, LPDIRECTINPUTEFFECT *ppdef, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2AImpl_EnumEffects (LPDIRECTINPUTDEVICE8A iface, LPDIENUMEFFECTSCALLBACKA lpCallback, LPVOID lpvRef, DWORD dwFlags) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2WImpl_EnumEffects (LPDIRECTINPUTDEVICE8W iface, LPDIENUMEFFECTSCALLBACKW lpCallback, LPVOID lpvRef, DWORD dwFlags) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2AImpl_GetEffectInfo (LPDIRECTINPUTDEVICE8A iface, LPDIEFFECTINFOA lpdei, REFGUID rguid) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2WImpl_GetEffectInfo (LPDIRECTINPUTDEVICE8W iface, LPDIEFFECTINFOW lpdei, REFGUID rguid) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2AImpl_GetForceFeedbackState (LPDIRECTINPUTDEVICE8A iface, LPDWORD pdwOut) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2WImpl_GetForceFeedbackState (LPDIRECTINPUTDEVICE8W iface, LPDWORD pdwOut) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2AImpl_SendForceFeedbackCommand (LPDIRECTINPUTDEVICE8A iface, DWORD dwFlags) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2WImpl_SendForceFeedbackCommand (LPDIRECTINPUTDEVICE8W iface, DWORD dwFlags) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2AImpl_EnumCreatedEffectObjects (LPDIRECTINPUTDEVICE8A iface, LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback, LPVOID lpvRef, DWORD dwFlags) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2WImpl_EnumCreatedEffectObjects (LPDIRECTINPUTDEVICE8W iface, LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback, LPVOID lpvRef, DWORD dwFlags) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2AImpl_Escape (LPDIRECTINPUTDEVICE8A iface, LPDIEFFESCAPE lpDIEEsc) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2WImpl_Escape (LPDIRECTINPUTDEVICE8W iface, LPDIEFFESCAPE lpDIEEsc) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2AImpl_Poll (LPDIRECTINPUTDEVICE8A iface) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2WImpl_Poll (LPDIRECTINPUTDEVICE8W iface) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2AImpl_SendDeviceData (LPDIRECTINPUTDEVICE8A iface, DWORD cbObjectData, LPCDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD dwFlags) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice2WImpl_SendDeviceData (LPDIRECTINPUTDEVICE8W iface, DWORD cbObjectData, LPCDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD dwFlags) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice7AImpl_EnumEffectsInFile (LPDIRECTINPUTDEVICE8A iface, LPCSTR lpszFileName, LPDIENUMEFFECTSINFILECALLBACK pec, LPVOID pvRef, DWORD dwFlags) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice7WImpl_EnumEffectsInFile (LPDIRECTINPUTDEVICE8W iface, LPCWSTR lpszFileName, LPDIENUMEFFECTSINFILECALLBACK pec, LPVOID pvRef, DWORD dwFlags) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice7AImpl_WriteEffectToFile (LPDIRECTINPUTDEVICE8A iface, LPCSTR lpszFileName, DWORD dwEntries, LPDIFILEEFFECT rgDiFileEft, DWORD dwFlags) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice7WImpl_WriteEffectToFile (LPDIRECTINPUTDEVICE8W iface, LPCWSTR lpszFileName, DWORD dwEntries, LPDIFILEEFFECT rgDiFileEft, DWORD dwFlags) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice8WImpl_BuildActionMap (LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUserName, DWORD dwFlags) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice8AImpl_GetImageInfo (LPDIRECTINPUTDEVICE8A iface, LPDIDEVICEIMAGEINFOHEADERA lpdiDevImageInfoHeader) DECLSPEC_HIDDEN
 
HRESULT WINAPI IDirectInputDevice8WImpl_GetImageInfo (LPDIRECTINPUTDEVICE8W iface, LPDIDEVICEIMAGEINFOHEADERW lpdiDevImageInfoHeader) DECLSPEC_HIDDEN
 

Typedef Documentation

◆ IDirectInputDeviceImpl

Function Documentation

◆ _build_action_map()

HRESULT _build_action_map ( LPDIRECTINPUTDEVICE8W  iface,
LPDIACTIONFORMATW  lpdiaf,
LPCWSTR  lpszUserName,
DWORD  dwFlags,
DWORD  devMask,
LPCDIDATAFORMAT  df 
)

Definition at line 762 of file device.c.

763 {
766  DWORD username_size = MAX_PATH;
767  int i;
768  BOOL load_success = FALSE, has_actions = FALSE;
769 
770  /* Unless asked the contrary by these flags, try to load a previous mapping */
771  if (!(dwFlags & DIDBAM_HWDEFAULTS))
772  {
773  /* Retrieve logged user name if necessary */
774  if (lpszUserName == NULL)
775  GetUserNameW(username, &username_size);
776  else
777  lstrcpynW(username, lpszUserName, MAX_PATH);
778 
779  load_success = load_mapping_settings(This, lpdiaf, username);
780  }
781 
782  if (load_success) return DI_OK;
783 
784  for (i=0; i < lpdiaf->dwNumActions; i++)
785  {
786  /* Don't touch a user configured action */
787  if (lpdiaf->rgoAction[i].dwHow == DIAH_USERCONFIG) continue;
788 
789  if ((lpdiaf->rgoAction[i].dwSemantic & devMask) == devMask)
790  {
791  DWORD obj_id = semantic_to_obj_id(This, lpdiaf->rgoAction[i].dwSemantic);
792  DWORD type = DIDFT_GETTYPE(obj_id);
793  DWORD inst = DIDFT_GETINSTANCE(obj_id);
794 
796 
798  if (type == DIDFT_RELAXIS) type = DIDFT_AXIS;
799 
800  /* Make sure the object exists */
801  odf = dataformat_to_odf_by_type(df, inst, type);
802 
803  if (odf != NULL)
804  {
805  lpdiaf->rgoAction[i].dwObjID = obj_id;
806  lpdiaf->rgoAction[i].guidInstance = This->guid;
807  lpdiaf->rgoAction[i].dwHow = DIAH_DEFAULT;
808  has_actions = TRUE;
809  }
810  }
811  else if (!(dwFlags & DIDBAM_PRESERVE))
812  {
813  /* We must clear action data belonging to other devices */
814  memset(&lpdiaf->rgoAction[i].guidInstance, 0, sizeof(GUID));
815  lpdiaf->rgoAction[i].dwHow = DIAH_UNMAPPED;
816  }
817  }
818 
819  if (!has_actions) return DI_NOEFFECT;
820 
821  return IDirectInputDevice8WImpl_BuildActionMap(iface, lpdiaf, lpszUserName, dwFlags);
822 }
#define DIDBAM_PRESERVE
Definition: dinput.h:1355
LPDIOBJECTDATAFORMAT dataformat_to_odf_by_type(LPCDIDATAFORMAT df, int n, DWORD type)
Definition: device.c:411
#define TRUE
Definition: types.h:120
DWORD dwObjID
Definition: dinput.h:1286
#define DIDFT_PSHBUTTON
Definition: dinput.h:754
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GUID guidInstance
Definition: dinput.h:1285
HRESULT WINAPI IDirectInputDevice8WImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUserName, DWORD dwFlags)
Definition: device.c:1817
#define DIDFT_GETINSTANCE(n)
Definition: dinput.h:764
#define lstrcpynW
Definition: compat.h:397
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 int BOOL
Definition: ntddk_ex.h:94
#define DIDFT_BUTTON
Definition: dinput.h:756
smooth NULL
Definition: ftsmooth.c:416
static WCHAR username[]
Definition: url.c:32
#define DIAH_UNMAPPED
Definition: dinput.h:1301
BOOL WINAPI GetUserNameW(LPWSTR lpszName, LPDWORD lpSize)
Definition: misc.c:291
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface)
Definition: device.c:50
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
#define DIDBAM_HWDEFAULTS
Definition: dinput.h:1357
#define DIDFT_AXIS
Definition: dinput.h:753
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define DI_NOEFFECT
Definition: dinput.h:132
LPDIACTIONW rgoAction
Definition: dinput.h:1332
#define DIAH_USERCONFIG
Definition: dinput.h:1302
#define DIAH_DEFAULT
Definition: dinput.h:1306
#define DI_OK
Definition: dinput.h:128
static DWORD semantic_to_obj_id(IDirectInputDeviceImpl *This, DWORD dwSemantic)
Definition: device.c:618
DWORD dwHow
Definition: dinput.h:1287
static BOOL load_mapping_settings(IDirectInputDeviceImpl *This, LPDIACTIONFORMATW lpdiaf, const WCHAR *username)
Definition: device.c:717
DWORD dwNumActions
Definition: dinput.h:1331
#define DIDFT_GETTYPE(n)
Definition: dinput.h:763
#define memset(x, y, z)
Definition: compat.h:39
#define DIDFT_RELAXIS
Definition: dinput.h:751
DWORD dwSemantic
Definition: dinput.h:1279

Referenced by SysKeyboardWImpl_BuildActionMap(), and SysMouseWImpl_BuildActionMap().

◆ _dump_DIDATAFORMAT()

void _dump_DIDATAFORMAT ( const DIDATAFORMAT df)

Definition at line 241 of file device.c.

241  {
242  unsigned int i;
243 
244  TRACE("Dumping DIDATAFORMAT structure:\n");
245  TRACE(" - dwSize: %d\n", df->dwSize);
246  if (df->dwSize != sizeof(DIDATAFORMAT)) {
247  WARN("Non-standard DIDATAFORMAT structure size %d\n", df->dwSize);
248  }
249  TRACE(" - dwObjsize: %d\n", df->dwObjSize);
250  if (df->dwObjSize != sizeof(DIOBJECTDATAFORMAT)) {
251  WARN("Non-standard DIOBJECTDATAFORMAT structure size %d\n", df->dwObjSize);
252  }
253  TRACE(" - dwFlags: 0x%08x (", df->dwFlags);
254  switch (df->dwFlags) {
255  case DIDF_ABSAXIS: TRACE("DIDF_ABSAXIS"); break;
256  case DIDF_RELAXIS: TRACE("DIDF_RELAXIS"); break;
257  default: TRACE("unknown"); break;
258  }
259  TRACE(")\n");
260  TRACE(" - dwDataSize: %d\n", df->dwDataSize);
261  TRACE(" - dwNumObjs: %d\n", df->dwNumObjs);
262 
263  for (i = 0; i < df->dwNumObjs; i++) {
264  TRACE(" - Object %d:\n", i);
265  TRACE(" * GUID: %s ('%s')\n", debugstr_guid(df->rgodf[i].pguid), _dump_dinput_GUID(df->rgodf[i].pguid));
266  TRACE(" * dwOfs: %d\n", df->rgodf[i].dwOfs);
267  TRACE(" * dwType: 0x%08x\n", df->rgodf[i].dwType);
268  TRACE(" "); _dump_EnumObjects_flags(df->rgodf[i].dwType); TRACE("\n");
269  TRACE(" * dwFlags: 0x%08x\n", df->rgodf[i].dwFlags);
271  }
272 }
#define DIDF_ABSAXIS
Definition: dinput.h:775
DWORD dwSize
Definition: dinput.h:808
const char * _dump_dinput_GUID(const GUID *guid)
Definition: device.c:196
DWORD dwNumObjs
Definition: dinput.h:812
#define WARN(fmt,...)
Definition: debug.h:111
DWORD dwObjSize
Definition: dinput.h:809
static void _dump_EnumObjects_flags(DWORD dwFlags)
Definition: device.c:126
static void _dump_ObjectDataFormat_flags(DWORD dwFlags)
Definition: device.c:90
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 DIDF_RELAXIS
Definition: dinput.h:776
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
DWORD dwFlags
Definition: dinput.h:810
LPDIOBJECTDATAFORMAT rgodf
Definition: dinput.h:813
const GUID * pguid
Definition: dinput.h:800
DWORD dwDataSize
Definition: dinput.h:811

Referenced by IDirectInputDevice2WImpl_SetDataFormat().

◆ _dump_dinput_GUID()

const char* _dump_dinput_GUID ( const GUID guid)

Definition at line 196 of file device.c.

196  {
197  unsigned int i;
198  static const struct {
199  const GUID *guid;
200  const char *name;
201  } guids[] = {
202 #define FE(x) { &x, #x}
203  FE(GUID_XAxis),
204  FE(GUID_YAxis),
205  FE(GUID_ZAxis),
206  FE(GUID_RxAxis),
207  FE(GUID_RyAxis),
208  FE(GUID_RzAxis),
209  FE(GUID_Slider),
210  FE(GUID_Button),
211  FE(GUID_Key),
212  FE(GUID_POV),
213  FE(GUID_Unknown),
214  FE(GUID_SysMouse),
215  FE(GUID_SysKeyboard),
216  FE(GUID_Joystick),
217  FE(GUID_ConstantForce),
218  FE(GUID_RampForce),
219  FE(GUID_Square),
220  FE(GUID_Sine),
221  FE(GUID_Triangle),
222  FE(GUID_SawtoothUp),
223  FE(GUID_SawtoothDown),
224  FE(GUID_Spring),
225  FE(GUID_Damper),
226  FE(GUID_Inertia),
227  FE(GUID_Friction),
228  FE(GUID_CustomForce)
229 #undef FE
230  };
231  if (guid == NULL)
232  return "null GUID";
233  for (i = 0; i < ARRAY_SIZE(guids); i++) {
234  if (IsEqualGUID(guids[i].guid, guid)) {
235  return guids[i].name;
236  }
237  }
238  return debugstr_guid(guid);
239 }
char * name
Definition: wpp.c:36
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
const GUID * guid
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define ARRAY_SIZE(a)
Definition: main.h:24
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
#define FE(x)
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by _dump_DIDATAFORMAT(), _dump_OBJECTINSTANCEA(), _dump_OBJECTINSTANCEW(), create_DataFormat(), and typeFromGUID().

◆ _dump_DIPROPHEADER()

void _dump_DIPROPHEADER ( LPCDIPROPHEADER  diph)

Definition at line 175 of file device.c.

175  {
176  if (TRACE_ON(dinput)) {
177  TRACE(" - dwObj = 0x%08x\n", diph->dwObj);
178  TRACE(" - dwHow = %s\n",
179  ((diph->dwHow == DIPH_DEVICE) ? "DIPH_DEVICE" :
180  ((diph->dwHow == DIPH_BYOFFSET) ? "DIPH_BYOFFSET" :
181  ((diph->dwHow == DIPH_BYID)) ? "DIPH_BYID" : "unknown")));
182  }
183 }
#define DIPH_BYID
Definition: dinput.h:837
DWORD dwHow
Definition: dinput.h:831
#define DIPH_DEVICE
Definition: dinput.h:835
#define DIPH_BYOFFSET
Definition: dinput.h:836
#define TRACE(s)
Definition: solgame.cpp:4
DWORD dwObj
Definition: dinput.h:830
#define TRACE_ON(x)
Definition: compat.h:65

Referenced by IDirectInputDevice2WImpl_GetProperty(), IDirectInputDevice2WImpl_SetProperty(), JoystickWGenericImpl_GetProperty(), JoystickWGenericImpl_SetProperty(), SysKeyboardWImpl_GetProperty(), and SysMouseWImpl_GetProperty().

◆ _dump_OBJECTINSTANCEA()

void _dump_OBJECTINSTANCEA ( const DIDEVICEOBJECTINSTANCEA ddoi)

Definition at line 185 of file device.c.

185  {
186  TRACE(" - enumerating : %s ('%s') - %2d - 0x%08x - %s - 0x%x\n",
187  debugstr_guid(&ddoi->guidType), _dump_dinput_GUID(&ddoi->guidType), ddoi->dwOfs, ddoi->dwType, ddoi->tszName, ddoi->dwFlags);
188 }
const char * _dump_dinput_GUID(const GUID *guid)
Definition: device.c:196
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
CHAR tszName[MAX_PATH]
Definition: dinput.h:352

Referenced by SysKeyboardAImpl_GetObjectInfo().

◆ _dump_OBJECTINSTANCEW()

void _dump_OBJECTINSTANCEW ( const DIDEVICEOBJECTINSTANCEW ddoi)

Definition at line 190 of file device.c.

190  {
191  TRACE(" - enumerating : %s ('%s'), - %2d - 0x%08x - %s - 0x%x\n",
192  debugstr_guid(&ddoi->guidType), _dump_dinput_GUID(&ddoi->guidType), ddoi->dwOfs, ddoi->dwType, debugstr_w(ddoi->tszName), ddoi->dwFlags);
193 }
const char * _dump_dinput_GUID(const GUID *guid)
Definition: device.c:196
WCHAR tszName[MAX_PATH]
Definition: dinput.h:371
#define debugstr_w
Definition: kernel32.h:32
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by JoystickWGenericImpl_GetObjectInfo(), SysKeyboardWImpl_GetObjectInfo(), and SysMouseWImpl_GetObjectInfo().

◆ _set_action_map()

HRESULT _set_action_map ( LPDIRECTINPUTDEVICE8W  iface,
LPDIACTIONFORMATW  lpdiaf,
LPCWSTR  lpszUserName,
DWORD  dwFlags,
LPCDIDATAFORMAT  df 
)

Definition at line 824 of file device.c.

825 {
828  DIOBJECTDATAFORMAT *obj_df = NULL;
829  DIPROPDWORD dp;
830  DIPROPRANGE dpr;
831  DIPROPSTRING dps;
833  DWORD username_size = MAX_PATH;
834  int i, action = 0, num_actions = 0;
835  unsigned int offset = 0;
836 
837  if (This->acquired) return DIERR_ACQUIRED;
838 
839  data_format.dwSize = sizeof(data_format);
843 
844  /* Count the actions */
845  for (i=0; i < lpdiaf->dwNumActions; i++)
846  if (IsEqualGUID(&This->guid, &lpdiaf->rgoAction[i].guidInstance))
847  num_actions++;
848 
849  if (num_actions == 0) return DI_NOEFFECT;
850 
851  This->num_actions = num_actions;
852 
853  /* Construct the dataformat and actionmap */
854  obj_df = HeapAlloc(GetProcessHeap(), 0, sizeof(DIOBJECTDATAFORMAT)*num_actions);
856  data_format.dwNumObjs = num_actions;
857 
858  HeapFree(GetProcessHeap(), 0, This->action_map);
859  This->action_map = HeapAlloc(GetProcessHeap(), 0, sizeof(ActionMap)*num_actions);
860 
861  for (i = 0; i < lpdiaf->dwNumActions; i++)
862  {
863  if (IsEqualGUID(&This->guid, &lpdiaf->rgoAction[i].guidInstance))
864  {
865  DWORD inst = DIDFT_GETINSTANCE(lpdiaf->rgoAction[i].dwObjID);
868 
870  if (type == DIDFT_RELAXIS) type = DIDFT_AXIS;
871 
872  obj = dataformat_to_odf_by_type(df, inst, type);
873 
874  memcpy(&obj_df[action], obj, df->dwObjSize);
875 
876  This->action_map[action].uAppData = lpdiaf->rgoAction[i].uAppData;
877  This->action_map[action].offset = offset;
878  obj_df[action].dwOfs = offset;
879  offset += (type & DIDFT_BUTTON) ? 1 : 4;
880 
881  action++;
882  }
883  }
884 
886 
887  HeapFree(GetProcessHeap(), 0, obj_df);
888 
889  /* Set the device properties according to the action format */
890  dpr.diph.dwSize = sizeof(DIPROPRANGE);
891  dpr.lMin = lpdiaf->lAxisMin;
892  dpr.lMax = lpdiaf->lAxisMax;
893  dpr.diph.dwHeaderSize = sizeof(DIPROPHEADER);
894  dpr.diph.dwHow = DIPH_DEVICE;
896 
897  if (lpdiaf->dwBufferSize > 0)
898  {
899  dp.diph.dwSize = sizeof(DIPROPDWORD);
900  dp.dwData = lpdiaf->dwBufferSize;
901  dp.diph.dwHeaderSize = sizeof(DIPROPHEADER);
902  dp.diph.dwHow = DIPH_DEVICE;
904  }
905 
906  /* Retrieve logged user name if necessary */
907  if (lpszUserName == NULL)
908  GetUserNameW(username, &username_size);
909  else
910  lstrcpynW(username, lpszUserName, MAX_PATH);
911 
912  dps.diph.dwSize = sizeof(dps);
913  dps.diph.dwHeaderSize = sizeof(DIPROPHEADER);
914  dps.diph.dwObj = 0;
915  dps.diph.dwHow = DIPH_DEVICE;
916  if (dwFlags & DIDSAM_NOUSER)
917  dps.wsz[0] = '\0';
918  else
919  lstrcpynW(dps.wsz, username, ARRAY_SIZE(dps.wsz));
921 
922  /* Save the settings to disk */
923  save_mapping_settings(iface, lpdiaf, username);
924 
925  return DI_OK;
926 }
LPDIOBJECTDATAFORMAT dataformat_to_odf_by_type(LPCDIDATAFORMAT df, int n, DWORD type)
Definition: device.c:411
DWORD dwSize
Definition: dinput.h:828
DWORD dwObjID
Definition: dinput.h:1286
DWORD dwSize
Definition: dinput.h:808
#define DIDFT_PSHBUTTON
Definition: dinput.h:754
DWORD dwNumObjs
Definition: dinput.h:812
GLintptr offset
Definition: glext.h:5920
DWORD dwObjSize
Definition: dinput.h:809
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static HRESULT save_mapping_settings(IDirectInputDevice8W *iface, LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUsername)
Definition: device.c:674
GUID guidInstance
Definition: dinput.h:1285
#define DIPROP_RANGE
Definition: dinput.h:892
DWORD dwHow
Definition: dinput.h:831
#define DIDFT_GETINSTANCE(n)
Definition: dinput.h:764
#define DIPH_DEVICE
Definition: dinput.h:835
#define lstrcpynW
Definition: compat.h:397
GLsizei GLsizei GLuint * obj
Definition: glext.h:6042
struct _DIOBJECTDATAFORMAT * LPDIOBJECTDATAFORMAT
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
DIPROPHEADER diph
Definition: dinput.h:843
struct DIPROPRANGE DIPROPRANGE
#define DIDFT_BUTTON
Definition: dinput.h:756
#define DIDF_RELAXIS
Definition: dinput.h:776
smooth NULL
Definition: ftsmooth.c:416
#define DIDSAM_NOUSER
Definition: dinput.h:1360
static const DIDATAFORMAT data_format
Definition: device.c:49
static WCHAR username[]
Definition: url.c:32
#define DIPROP_BUFFERSIZE
Definition: dinput.h:885
DWORD dwDataSize
Definition: dinput.h:1330
BOOL WINAPI GetUserNameW(LPWSTR lpszName, LPDWORD lpSize)
Definition: misc.c:291
DIPROPHEADER diph
Definition: dinput.h:849
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface)
Definition: device.c:50
#define DIERR_ACQUIRED
Definition: dinput.h:165
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
WCHAR wsz[MAX_PATH]
Definition: dinput.h:875
DWORD dwFlags
Definition: dinput.h:810
struct _DIOBJECTDATAFORMAT DIOBJECTDATAFORMAT
#define DIDFT_AXIS
Definition: dinput.h:753
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
DWORD dwData
Definition: dinput.h:844
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define DI_NOEFFECT
Definition: dinput.h:132
LPDIOBJECTDATAFORMAT rgodf
Definition: dinput.h:813
LPDIACTIONW rgoAction
Definition: dinput.h:1332
DWORD dwBufferSize
Definition: dinput.h:1335
struct DIPROPHEADER DIPROPHEADER
const WCHAR * action
Definition: action.c:7783
DWORD dwDataSize
Definition: dinput.h:811
#define ARRAY_SIZE(a)
Definition: main.h:24
DWORD dwObj
Definition: dinput.h:830
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
#define IDirectInputDevice8_SetDataFormat(p, a)
Definition: dinput.h:2048
UINT_PTR uAppData
Definition: dinput.h:1278
#define DIPROP_USERNAME
Definition: dinput.h:921
LONG lMin
Definition: dinput.h:850
#define DI_OK
Definition: dinput.h:128
DWORD dwHeaderSize
Definition: dinput.h:829
LONG lMax
Definition: dinput.h:851
DWORD dwNumActions
Definition: dinput.h:1331
#define DIDFT_GETTYPE(n)
Definition: dinput.h:763
struct DIPROPDWORD DIPROPDWORD
DIPROPHEADER diph
Definition: dinput.h:874
#define HeapFree(x, y, z)
Definition: compat.h:394
#define IDirectInputDevice8_SetProperty(p, a, b)
Definition: dinput.h:2043
#define DIDFT_RELAXIS
Definition: dinput.h:751

Referenced by JoystickWGenericImpl_SetActionMap(), SysKeyboardWImpl_SetActionMap(), and SysMouseWImpl_SetActionMap().

◆ dataformat_to_odf_by_type()

LPDIOBJECTDATAFORMAT dataformat_to_odf_by_type ( LPCDIDATAFORMAT  df,
int  n,
DWORD  type 
)

Definition at line 411 of file device.c.

412 {
413  int i, nfound = 0;
414 
415  for (i=0; i < df->dwNumObjs; i++)
416  {
418 
419  if (odf->dwType & type)
420  {
421  if (n == nfound)
422  return odf;
423 
424  nfound++;
425  }
426  }
427 
428  return NULL;
429 }
DWORD dwNumObjs
Definition: dinput.h:812
GLdouble n
Definition: glext.h:7729
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static LPDIOBJECTDATAFORMAT dataformat_to_odf(LPCDIDATAFORMAT df, int idx)
Definition: device.c:402
smooth NULL
Definition: ftsmooth.c:416

Referenced by _build_action_map(), _set_action_map(), and JoystickWGenericImpl_BuildActionMap().

◆ fill_DataFormat()

void fill_DataFormat ( void out,
DWORD  size,
const void in,
const DataFormat df 
)

Definition at line 325 of file device.c.

326 {
327  int i;
328  const char *in_c = in;
329  char *out_c = out;
330 
331  memset(out, 0, size);
332  if (df->dt == NULL) {
333  /* This means that the app uses Wine's internal data format */
335  } else {
336  for (i = 0; i < df->size; i++) {
337  if (df->dt[i].offset_in >= 0) {
338  switch (df->dt[i].size) {
339  case 1:
340  TRACE("Copying (c) to %d from %d (value %d)\n",
341  df->dt[i].offset_out, df->dt[i].offset_in, *(in_c + df->dt[i].offset_in));
342  *(out_c + df->dt[i].offset_out) = *(in_c + df->dt[i].offset_in);
343  break;
344 
345  case 2:
346  TRACE("Copying (s) to %d from %d (value %d)\n",
347  df->dt[i].offset_out, df->dt[i].offset_in, *((const short *)(in_c + df->dt[i].offset_in)));
348  *((short *)(out_c + df->dt[i].offset_out)) = *((const short *)(in_c + df->dt[i].offset_in));
349  break;
350 
351  case 4:
352  TRACE("Copying (i) to %d from %d (value %d)\n",
353  df->dt[i].offset_out, df->dt[i].offset_in, *((const int *)(in_c + df->dt[i].offset_in)));
354  *((int *)(out_c + df->dt[i].offset_out)) = *((const int *)(in_c + df->dt[i].offset_in));
355  break;
356 
357  default:
358  memcpy((out_c + df->dt[i].offset_out), (in_c + df->dt[i].offset_in), df->dt[i].size);
359  break;
360  }
361  } else {
362  switch (df->dt[i].size) {
363  case 1:
364  TRACE("Copying (c) to %d default value %d\n",
365  df->dt[i].offset_out, df->dt[i].value);
366  *(out_c + df->dt[i].offset_out) = (char) df->dt[i].value;
367  break;
368 
369  case 2:
370  TRACE("Copying (s) to %d default value %d\n",
371  df->dt[i].offset_out, df->dt[i].value);
372  *((short *) (out_c + df->dt[i].offset_out)) = (short) df->dt[i].value;
373  break;
374 
375  case 4:
376  TRACE("Copying (i) to %d default value %d\n",
377  df->dt[i].offset_out, df->dt[i].value);
378  *((int *) (out_c + df->dt[i].offset_out)) = df->dt[i].value;
379  break;
380 
381  default:
382  memset((out_c + df->dt[i].offset_out), 0, df->dt[i].size);
383  break;
384  }
385  }
386  }
387  }
388 }
int internal_format_size
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 TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
static FILE * out
Definition: regtests2xml.c:44
DataTransform * dt
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLuint in
Definition: glext.h:9616
#define min(a, b)
Definition: monoChain.cc:55
#define memset(x, y, z)
Definition: compat.h:39

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

◆ find_property()

int find_property ( const DataFormat df,
LPCDIPROPHEADER  ph 
)

Definition at line 606 of file device.c.

607 {
608  switch (ph->dwHow)
609  {
610  case DIPH_BYID: return id_to_object(df->wine_df, ph->dwObj);
611  case DIPH_BYOFFSET: return offset_to_object(df, ph->dwObj);
612  }
613  FIXME("Unhandled ph->dwHow=='%04X'\n", (unsigned int)ph->dwHow);
614 
615  return -1;
616 }
#define DIPH_BYID
Definition: dinput.h:837
DWORD dwHow
Definition: dinput.h:831
LPDIDATAFORMAT wine_df
#define DIPH_BYOFFSET
Definition: dinput.h:836
#define FIXME(fmt,...)
Definition: debug.h:110
static int offset_to_object(const DataFormat *df, int offset)
Definition: device.c:575
DWORD dwObj
Definition: dinput.h:830
int id_to_object(LPCDIDATAFORMAT df, int id)
Definition: device.c:587

Referenced by JoystickWGenericImpl_GetProperty(), and JoystickWGenericImpl_SetProperty().

◆ get_app_key()

BOOL get_app_key ( HKEY ,
HKEY  
)

Definition at line 277 of file device.c.

278 {
279  char buffer[MAX_PATH+16];
280  DWORD len;
281 
282  *appkey = 0;
283 
284  /* @@ Wine registry key: HKCU\Software\Wine\DirectInput */
285  if (RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\DirectInput", defkey))
286  *defkey = 0;
287 
289  if (len && len < MAX_PATH)
290  {
291  HKEY tmpkey;
292 
293  /* @@ Wine registry key: HKCU\Software\Wine\AppDefaults\app.exe\DirectInput */
294  if (!RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\AppDefaults", &tmpkey))
295  {
296  char *p, *appname = buffer;
297  if ((p = strrchr(appname, '/'))) appname = p + 1;
298  if ((p = strrchr(appname, '\\'))) appname = p + 1;
299  strcat(appname, "\\DirectInput");
300 
301  if (RegOpenKeyA(tmpkey, appname, appkey)) *appkey = 0;
302  RegCloseKey(tmpkey);
303  }
304  }
305 
306  return *defkey || *appkey;
307 }
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3272
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
#define HKEY_CURRENT_USER
Definition: winreg.h:11
GLuint buffer
Definition: glext.h:5915
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
Definition: loader.c:546
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by alloc_device(), device_disabled_registry(), and setup_dinput_options().

◆ get_config_key()

DWORD get_config_key ( HKEY  ,
HKEY  ,
const char ,
char ,
DWORD   
)

Definition at line 312 of file device.c.

314 {
315  if (appkey && !RegQueryValueExA( appkey, name, 0, NULL, (LPBYTE)buffer, &size ))
316  return 0;
317 
318  if (defkey && !RegQueryValueExA( defkey, name, 0, NULL, (LPBYTE)buffer, &size ))
319  return 0;
320 
321  return ERROR_FILE_NOT_FOUND;
322 }
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4041
GLuint buffer
Definition: glext.h:5915
unsigned char * LPBYTE
Definition: typedefs.h:52
smooth NULL
Definition: ftsmooth.c:416
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
GLsizeiptr size
Definition: glext.h:5919
Definition: name.c:36

Referenced by alloc_device(), device_disabled_registry(), and setup_dinput_options().

◆ id_to_object()

int id_to_object ( LPCDIDATAFORMAT  df,
int  id 
)

Definition at line 587 of file device.c.

588 {
589  int i;
590 
591  id &= 0x00ffffff;
592  for (i = 0; i < df->dwNumObjs; i++)
593  if ((dataformat_to_odf(df, i)->dwType & 0x00ffffff) == id)
594  return i;
595 
596  return -1;
597 }
DWORD dwNumObjs
Definition: dinput.h:812
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
static LPDIOBJECTDATAFORMAT dataformat_to_odf(LPCDIDATAFORMAT df, int idx)
Definition: device.c:402

Referenced by find_property(), and id_to_offset().

◆ IDirectInputDevice2AImpl_Acquire()

HRESULT WINAPI IDirectInputDevice2AImpl_Acquire ( LPDIRECTINPUTDEVICE8A  iface)

Definition at line 1004 of file device.c.

1005 {
1008 }
static IDirectInputDevice8W * IDirectInputDevice8W_from_impl(IDirectInputDeviceImpl *This)
Definition: device.c:59
HRESULT WINAPI IDirectInputDevice2WImpl_Acquire(LPDIRECTINPUTDEVICE8W iface)
Definition: device.c:983
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface)
Definition: device.c:46

◆ IDirectInputDevice2AImpl_AddRef()

ULONG WINAPI IDirectInputDevice2AImpl_AddRef ( LPDIRECTINPUTDEVICE8A  iface)

Definition at line 1221 of file device.c.

1222 {
1225 }
static IDirectInputDevice8W * IDirectInputDevice8W_from_impl(IDirectInputDeviceImpl *This)
Definition: device.c:59
ULONG WINAPI IDirectInputDevice2WImpl_AddRef(LPDIRECTINPUTDEVICE8W iface)
Definition: device.c:1215
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface)
Definition: device.c:46

◆ IDirectInputDevice2AImpl_CreateEffect()

HRESULT WINAPI IDirectInputDevice2AImpl_CreateEffect ( LPDIRECTINPUTDEVICE8A  iface,
REFGUID  rguid,
LPCDIEFFECT  lpeff,
LPDIRECTINPUTEFFECT ppdef,
LPUNKNOWN  pUnkOuter 
)

Definition at line 1638 of file device.c.

1640 {
1642  return IDirectInputDevice2WImpl_CreateEffect(IDirectInputDevice8W_from_impl(This), rguid, lpeff, ppdef, pUnkOuter);
1643 }
HRESULT WINAPI IDirectInputDevice2WImpl_CreateEffect(LPDIRECTINPUTDEVICE8W iface, REFGUID rguid, LPCDIEFFECT lpeff, LPDIRECTINPUTEFFECT *ppdef, LPUNKNOWN pUnkOuter)
Definition: device.c:1628
static IDirectInputDevice8W * IDirectInputDevice8W_from_impl(IDirectInputDeviceImpl *This)
Definition: device.c:59
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface)
Definition: device.c:46

◆ IDirectInputDevice2AImpl_EnumCreatedEffectObjects()

HRESULT WINAPI IDirectInputDevice2AImpl_EnumCreatedEffectObjects ( LPDIRECTINPUTDEVICE8A  iface,
LPDIENUMCREATEDEFFECTOBJECTSCALLBACK  lpCallback,
LPVOID  lpvRef,
DWORD  dwFlags 
)

Definition at line 1720 of file device.c.

1722 {
1725 }
static IDirectInputDevice8W * IDirectInputDevice8W_from_impl(IDirectInputDeviceImpl *This)
Definition: device.c:59
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface)
Definition: device.c:46
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
HRESULT WINAPI IDirectInputDevice2WImpl_EnumCreatedEffectObjects(LPDIRECTINPUTDEVICE8W iface, LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback, LPVOID lpvRef, DWORD dwFlags)
Definition: device.c:1713

◆ IDirectInputDevice2AImpl_EnumEffects()

HRESULT WINAPI IDirectInputDevice2AImpl_EnumEffects ( LPDIRECTINPUTDEVICE8A  iface,
LPDIENUMEFFECTSCALLBACKA  lpCallback,
LPVOID  lpvRef,
DWORD  dwFlags 
)

Definition at line 1645 of file device.c.

1650 {
1651  FIXME("(this=%p,%p,%p,0x%08x): stub!\n",
1652  iface, lpCallback, lpvRef, dwFlags);
1653 
1654  return DI_OK;
1655 }
#define FIXME(fmt,...)
Definition: debug.h:110
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define DI_OK
Definition: dinput.h:128

◆ IDirectInputDevice2AImpl_EnumObjects()

HRESULT WINAPI IDirectInputDevice2AImpl_EnumObjects ( LPDIRECTINPUTDEVICE8A  iface,
LPDIENUMDEVICEOBJECTSCALLBACKA  lpCallback,
LPVOID  lpvRef,
DWORD  dwFlags 
)

Definition at line 1227 of file device.c.

1229 {
1232  int i;
1233 
1234  TRACE("(%p) %p,%p flags:%08x)\n", iface, lpCallback, lpvRef, dwFlags);
1235  TRACE(" - flags = ");
1237  TRACE("\n");
1238 
1239  /* Only the fields till dwFFMaxForce are relevant */
1240  memset(&ddoi, 0, sizeof(ddoi));
1241  ddoi.dwSize = FIELD_OFFSET(DIDEVICEOBJECTINSTANCEA, dwFFMaxForce);
1242 
1243  for (i = 0; i < This->data_format.wine_df->dwNumObjs; i++)
1244  {
1245  LPDIOBJECTDATAFORMAT odf = dataformat_to_odf(This->data_format.wine_df, i);
1246 
1247  if (dwFlags != DIDFT_ALL && !(dwFlags & DIDFT_GETTYPE(odf->dwType))) continue;
1248  if (IDirectInputDevice_GetObjectInfo(iface, &ddoi, odf->dwType, DIPH_BYID) != DI_OK)
1249  continue;
1250 
1251  if (lpCallback(&ddoi, lpvRef) != DIENUM_CONTINUE) break;
1252  }
1253 
1254  return DI_OK;
1255 }
#define DIPH_BYID
Definition: dinput.h:837
static void _dump_EnumObjects_flags(DWORD dwFlags)
Definition: device.c:126
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface)
Definition: device.c:46
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
static LPDIOBJECTDATAFORMAT dataformat_to_odf(LPCDIDATAFORMAT df, int idx)
Definition: device.c:402
#define IDirectInputDevice_GetObjectInfo(p, a, b, c)
Definition: dinput.h:1617
#define TRACE(s)
Definition: solgame.cpp:4
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
#define DI_OK
Definition: dinput.h:128
#define DIENUM_CONTINUE
Definition: dinput.h:188
#define DIDFT_ALL
Definition: dinput.h:750
#define DIDFT_GETTYPE(n)
Definition: dinput.h:763
#define memset(x, y, z)
Definition: compat.h:39

◆ IDirectInputDevice2AImpl_Escape()

HRESULT WINAPI IDirectInputDevice2AImpl_Escape ( LPDIRECTINPUTDEVICE8A  iface,
LPDIEFFESCAPE  lpDIEEsc 
)

Definition at line 1733 of file device.c.

1734 {
1737 }
static IDirectInputDevice8W * IDirectInputDevice8W_from_impl(IDirectInputDeviceImpl *This)
Definition: device.c:59
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface)
Definition: device.c:46
HRESULT WINAPI IDirectInputDevice2WImpl_Escape(LPDIRECTINPUTDEVICE8W iface, LPDIEFFESCAPE lpDIEEsc)
Definition: device.c:1727

◆ IDirectInputDevice2AImpl_GetDeviceData()

HRESULT WINAPI IDirectInputDevice2AImpl_GetDeviceData ( LPDIRECTINPUTDEVICE8A  iface,
DWORD  dodsize,
LPDIDEVICEOBJECTDATA  dod,
LPDWORD  entries,
DWORD  flags 
)

Definition at line 1590 of file device.c.

1592 {
1595 }
static IDirectInputDevice8W * IDirectInputDevice8W_from_impl(IDirectInputDeviceImpl *This)
Definition: device.c:59
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface)
Definition: device.c:46
HRESULT WINAPI IDirectInputDevice2WImpl_GetDeviceData(LPDIRECTINPUTDEVICE8W iface, DWORD dodsize, LPDIDEVICEOBJECTDATA dod, LPDWORD entries, DWORD flags)
Definition: device.c:1534
GLbitfield flags
Definition: glext.h:7161

◆ IDirectInputDevice2AImpl_GetEffectInfo()

HRESULT WINAPI IDirectInputDevice2AImpl_GetEffectInfo ( LPDIRECTINPUTDEVICE8A  iface,
LPDIEFFECTINFOA  lpdei,
REFGUID  rguid 
)

Definition at line 1669 of file device.c.

1673 {
1674  FIXME("(this=%p,%p,%s): stub!\n",
1675  iface, lpdei, debugstr_guid(rguid));
1676  return DI_OK;
1677 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_guid
Definition: kernel32.h:35
#define DI_OK
Definition: dinput.h:128

◆ IDirectInputDevice2AImpl_GetForceFeedbackState()

HRESULT WINAPI IDirectInputDevice2AImpl_GetForceFeedbackState ( LPDIRECTINPUTDEVICE8A  iface,
LPDWORD  pdwOut 
)

Definition at line 1695 of file device.c.

1696 {
1699 }
static IDirectInputDevice8W * IDirectInputDevice8W_from_impl(IDirectInputDeviceImpl *This)
Definition: device.c:59
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface)
Definition: device.c:46
_Out_ PDWORD pdwOut
Definition: ntgdi.h:1813
HRESULT WINAPI IDirectInputDevice2WImpl_GetForceFeedbackState(LPDIRECTINPUTDEVICE8W iface, LPDWORD pdwOut)
Definition: device.c:1689

◆ IDirectInputDevice2AImpl_GetObjectInfo()

HRESULT WINAPI IDirectInputDevice2AImpl_GetObjectInfo ( LPDIRECTINPUTDEVICE8A  iface,
LPDIDEVICEOBJECTINSTANCEA  pdidoi,
DWORD  dwObj,
DWORD  dwHow 
)

Definition at line 1449 of file device.c.

1454 {
1456  DIDEVICEOBJECTINSTANCEW didoiW;
1457  HRESULT res;
1458 
1459  if (!pdidoi ||
1460  (pdidoi->dwSize != sizeof(DIDEVICEOBJECTINSTANCEA) &&
1461  pdidoi->dwSize != sizeof(DIDEVICEOBJECTINSTANCE_DX3A)))
1462  return DIERR_INVALIDPARAM;
1463 
1464  didoiW.dwSize = sizeof(didoiW);
1466  if (res == DI_OK)
1467  {
1468  DWORD dwSize = pdidoi->dwSize;
1469 
1470  memset(pdidoi, 0, pdidoi->dwSize);
1471  pdidoi->dwSize = dwSize;
1472  pdidoi->guidType = didoiW.guidType;
1473  pdidoi->dwOfs = didoiW.dwOfs;
1474  pdidoi->dwType = didoiW.dwType;
1475  pdidoi->dwFlags = didoiW.dwFlags;
1476  }
1477 
1478  return res;
1479 }
static IDirectInputDevice8W * IDirectInputDevice8W_from_impl(IDirectInputDeviceImpl *This)
Definition: device.c:59
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface)
Definition: device.c:46
#define DIERR_INVALIDPARAM
Definition: dinput.h:152
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
HRESULT WINAPI IDirectInputDevice2WImpl_GetObjectInfo(LPDIRECTINPUTDEVICE8W iface, LPDIDEVICEOBJECTINSTANCEW pdidoi, DWORD dwObj, DWORD dwHow)
Definition: device.c:1481
GLuint res
Definition: glext.h:9613
#define DI_OK
Definition: dinput.h:128
#define memset(x, y, z)
Definition: compat.h:39
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54

Referenced by SysKeyboardAImpl_GetObjectInfo().

◆ IDirectInputDevice2AImpl_GetProperty()

HRESULT WINAPI IDirectInputDevice2AImpl_GetProperty ( LPDIRECTINPUTDEVICE8A  iface,
REFGUID  rguid,
LPDIPROPHEADER  pdiph 
)

Definition at line 1345 of file device.c.

1346 {
1349 }
static IDirectInputDevice8W * IDirectInputDevice8W_from_impl(IDirectInputDeviceImpl *This)
Definition: device.c:59
HRESULT WINAPI IDirectInputDevice2WImpl_GetProperty(LPDIRECTINPUTDEVICE8W iface, REFGUID rguid, LPDIPROPHEADER pdiph)
Definition: device.c:1291
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface)
Definition: device.c:46

Referenced by SysKeyboardWImpl_GetProperty().

◆ IDirectInputDevice2AImpl_Initialize()

HRESULT WINAPI IDirectInputDevice2AImpl_Initialize ( LPDIRECTINPUTDEVICE8A  iface,
HINSTANCE  hinst,
DWORD  dwVersion,
REFGUID  rguid 
)

Definition at line 1617 of file device.c.

1619 {
1622 }
static IDirectInputDevice8W * IDirectInputDevice8W_from_impl(IDirectInputDeviceImpl *This)
Definition: device.c:59
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface)
Definition: device.c:46
HRESULT WINAPI IDirectInputDevice2WImpl_Initialize(LPDIRECTINPUTDEVICE8W iface, HINSTANCE hinst, DWORD dwVersion, REFGUID rguid)
Definition: device.c:1610
static HINSTANCE hinst
Definition: edit.c:551

◆ IDirectInputDevice2AImpl_Poll()

HRESULT WINAPI IDirectInputDevice2AImpl_Poll ( LPDIRECTINPUTDEVICE8A  iface)

Definition at line 1749 of file device.c.

1750 {
1753 }
static IDirectInputDevice8W * IDirectInputDevice8W_from_impl(IDirectInputDeviceImpl *This)
Definition: device.c:59
HRESULT WINAPI IDirectInputDevice2WImpl_Poll(LPDIRECTINPUTDEVICE8W iface)
Definition: device.c:1739
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface)
Definition: device.c:46

◆ IDirectInputDevice2AImpl_QueryInterface()

HRESULT WINAPI IDirectInputDevice2AImpl_QueryInterface ( LPDIRECTINPUTDEVICE8A  iface,
REFIID  riid,
LPVOID ppobj 
)

Definition at line 1209 of file device.c.

1210 {
1213 }
static IDirectInputDevice8W * IDirectInputDevice8W_from_impl(IDirectInputDeviceImpl *This)
Definition: device.c:59
REFIID riid
Definition: precomp.h:44
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface)
Definition: device.c:46
HRESULT WINAPI IDirectInputDevice2WImpl_QueryInterface(LPDIRECTINPUTDEVICE8W iface, REFIID riid, LPVOID *ppobj)
Definition: device.c:1180

◆ IDirectInputDevice2AImpl_Release()

ULONG WINAPI IDirectInputDevice2AImpl_Release ( LPDIRECTINPUTDEVICE8A  iface)

Definition at line 1174 of file device.c.

1175 {
1178 }
static IDirectInputDevice8W * IDirectInputDevice8W_from_impl(IDirectInputDeviceImpl *This)
Definition: device.c:59
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface)
Definition: device.c:46
ULONG WINAPI IDirectInputDevice2WImpl_Release(LPDIRECTINPUTDEVICE8W iface)
Definition: device.c:1138

◆ IDirectInputDevice2AImpl_RunControlPanel()

HRESULT WINAPI IDirectInputDevice2AImpl_RunControlPanel ( LPDIRECTINPUTDEVICE8A  iface,
HWND  hwndOwner,
DWORD  dwFlags 
)

Definition at line 1604 of file device.c.

1605 {
1608 }
static IDirectInputDevice8W * IDirectInputDevice8W_from_impl(IDirectInputDeviceImpl *This)
Definition: device.c:59
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface)
Definition: device.c:46
HRESULT WINAPI IDirectInputDevice2WImpl_RunControlPanel(LPDIRECTINPUTDEVICE8W iface, HWND hwndOwner, DWORD dwFlags)
Definition: device.c:1597
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175

◆ IDirectInputDevice2AImpl_SendDeviceData()

HRESULT WINAPI IDirectInputDevice2AImpl_SendDeviceData ( LPDIRECTINPUTDEVICE8A  iface,
DWORD  cbObjectData,
LPCDIDEVICEOBJECTDATA  rgdod,
LPDWORD  pdwInOut,
DWORD  dwFlags 
)

Definition at line 1764 of file device.c.

1767 {
1770  pdwInOut, dwFlags);
1771 }
static IDirectInputDevice8W * IDirectInputDevice8W_from_impl(IDirectInputDeviceImpl *This)
Definition: device.c:59
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface)
Definition: device.c:46
HRESULT WINAPI IDirectInputDevice2WImpl_SendDeviceData(LPDIRECTINPUTDEVICE8W iface, DWORD cbObjectData, LPCDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD dwFlags)
Definition: device.c:1755
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175

◆ IDirectInputDevice2AImpl_SendForceFeedbackCommand()

HRESULT WINAPI IDirectInputDevice2AImpl_SendForceFeedbackCommand ( LPDIRECTINPUTDEVICE8A  iface,
DWORD  dwFlags 
)

Definition at line 1707 of file device.c.

1708 {
1711 }
HRESULT WINAPI IDirectInputDevice2WImpl_SendForceFeedbackCommand(LPDIRECTINPUTDEVICE8W iface, DWORD dwFlags)
Definition: device.c:1701
static IDirectInputDevice8W * IDirectInputDevice8W_from_impl(IDirectInputDeviceImpl *This)
Definition: device.c:59
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface)
Definition: device.c:46
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175

◆ IDirectInputDevice2AImpl_SetCooperativeLevel()

HRESULT WINAPI IDirectInputDevice2AImpl_SetCooperativeLevel ( LPDIRECTINPUTDEVICE8A  iface,
HWND  hwnd,
DWORD  dwflags 
)

Definition at line 1110 of file device.c.

1111 {
1114 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static IDirectInputDevice8W * IDirectInputDevice8W_from_impl(IDirectInputDeviceImpl *This)
Definition: device.c:59
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface)
Definition: device.c:46
static _In_ DWORD dwflags
Definition: dispmode.c:64
HRESULT WINAPI IDirectInputDevice2WImpl_SetCooperativeLevel(LPDIRECTINPUTDEVICE8W iface, HWND hwnd, DWORD dwflags)
Definition: device.c:1074

◆ IDirectInputDevice2AImpl_SetDataFormat()

HRESULT WINAPI IDirectInputDevice2AImpl_SetDataFormat ( LPDIRECTINPUTDEVICE8A  iface,
LPCDIDATAFORMAT  df 
)

Definition at line 1063 of file device.c.

1064 {
1067 }
static IDirectInputDevice8W * IDirectInputDevice8W_from_impl(IDirectInputDeviceImpl *This)
Definition: device.c:59
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface)
Definition: device.c:46
HRESULT WINAPI IDirectInputDevice2WImpl_SetDataFormat(LPDIRECTINPUTDEVICE8W iface, LPCDIDATAFORMAT df)
Definition: device.c:1042

◆ IDirectInputDevice2AImpl_SetEventNotification()

HRESULT WINAPI IDirectInputDevice2AImpl_SetEventNotification ( LPDIRECTINPUTDEVICE8A  iface,
HANDLE  hnd 
)

Definition at line 1131 of file device.c.

1132 {
1135 }
static IDirectInputDevice8W * IDirectInputDevice8W_from_impl(IDirectInputDeviceImpl *This)
Definition: device.c:59
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface)
Definition: device.c:46
HRESULT WINAPI IDirectInputDevice2WImpl_SetEventNotification(LPDIRECTINPUTDEVICE8W iface, HANDLE event)
Definition: device.c:1119
struct _cl_event * event
Definition: glext.h:7739

◆ IDirectInputDevice2AImpl_SetProperty()

HRESULT WINAPI IDirectInputDevice2AImpl_SetProperty ( LPDIRECTINPUTDEVICE8A  iface,
REFGUID  rguid,
LPCDIPROPHEADER  pdiph 
)

Definition at line 1442 of file device.c.

1444 {
1447 }
static IDirectInputDevice8W * IDirectInputDevice8W_from_impl(IDirectInputDeviceImpl *This)
Definition: device.c:59
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface)
Definition: device.c:46
HRESULT WINAPI IDirectInputDevice2WImpl_SetProperty(LPDIRECTINPUTDEVICE8W iface, REFGUID rguid, LPCDIPROPHEADER pdiph)
Definition: device.c:1355

◆ IDirectInputDevice2AImpl_Unacquire()

HRESULT WINAPI IDirectInputDevice2AImpl_Unacquire ( LPDIRECTINPUTDEVICE8A  iface)

Definition at line 1032 of file device.c.

1033 {
1036 }
static IDirectInputDevice8W * IDirectInputDevice8W_from_impl(IDirectInputDeviceImpl *This)
Definition: device.c:59
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface)
Definition: device.c:46
HRESULT WINAPI IDirectInputDevice2WImpl_Unacquire(LPDIRECTINPUTDEVICE8W iface)
Definition: device.c:1015

◆ IDirectInputDevice2WImpl_Acquire()

HRESULT WINAPI IDirectInputDevice2WImpl_Acquire ( LPDIRECTINPUTDEVICE8W  iface)

Definition at line 983 of file device.c.

984 {
986  HRESULT res;
987 
988  TRACE("(%p)\n", This);
989 
990  if (!This->data_format.user_df) return DIERR_INVALIDPARAM;
991  if (This->dwCoopLevel & DISCL_FOREGROUND && This->win != GetForegroundWindow())
992  return DIERR_OTHERAPPHASPRIO;
993 
994  EnterCriticalSection(&This->crit);
995  res = This->acquired ? S_FALSE : DI_OK;
996  This->acquired = 1;
997  LeaveCriticalSection(&This->crit);
998  if (res == DI_OK)
999  check_dinput_hooks(iface, TRUE);
1000 
1001  return res;
1002 }
#define TRUE
Definition: types.h:120
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
void check_dinput_hooks(LPDIRECTINPUTDEVICE8W iface, BOOL acquired)
Definition: dinput_main.c:1833
#define S_FALSE
Definition: winerror.h:2357
#define DIERR_INVALIDPARAM
Definition: dinput.h:152
#define TRACE(s)
Definition: solgame.cpp:4
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface)
Definition: device.c:50
LONG HRESULT
Definition: typedefs.h:77
#define DISCL_FOREGROUND
Definition: dinput.h:967
#define DIERR_OTHERAPPHASPRIO
Definition: dinput.h:162
HWND WINAPI GetForegroundWindow(void)
Definition: ntwrapper.h:392
GLuint res
Definition: glext.h:9613
#define DI_OK
Definition: dinput.h:128
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

Referenced by IDirectInputDevice2AImpl_Acquire(), SysKeyboardWImpl_Acquire(), and SysMouseWImpl_Acquire().

◆ IDirectInputDevice2WImpl_AddRef()

ULONG WINAPI IDirectInputDevice2WImpl_AddRef ( LPDIRECTINPUTDEVICE8W  iface)

Definition at line 1215 of file device.c.

1216 {
1218  return InterlockedIncrement(&This->ref);
1219 }
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface)
Definition: device.c:50
#define InterlockedIncrement
Definition: armddk.h:53

Referenced by IDirectInputDevice2AImpl_AddRef().

◆ IDirectInputDevice2WImpl_CreateEffect()

HRESULT WINAPI IDirectInputDevice2WImpl_CreateEffect ( LPDIRECTINPUTDEVICE8W  iface,
REFGUID  rguid,
LPCDIEFFECT  lpeff,
LPDIRECTINPUTEFFECT ppdef,
LPUNKNOWN  pUnkOuter 
)

Definition at line 1628 of file device.c.

1630 {
1631  FIXME("(this=%p,%s,%p,%p,%p): stub!\n", iface, debugstr_guid(rguid), lpeff, ppdef, pUnkOuter);
1632 
1633  FIXME("not available in the generic implementation\n");
1634  *ppdef = NULL;
1635  return DIERR_UNSUPPORTED;
1636 }
#define DIERR_UNSUPPORTED
Definition: dinput.h:156
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35

Referenced by IDirectInputDevice2AImpl_CreateEffect().

◆ IDirectInputDevice2WImpl_EnumCreatedEffectObjects()

HRESULT WINAPI IDirectInputDevice2WImpl_EnumCreatedEffectObjects ( LPDIRECTINPUTDEVICE8W  iface,
LPDIENUMCREATEDEFFECTOBJECTSCALLBACK  lpCallback,
LPVOID  lpvRef,
DWORD  dwFlags 
)

Definition at line 1713 of file device.c.

1715 {
1716  FIXME("(this=%p,%p,%p,0x%08x): stub!\n", iface, lpCallback, lpvRef, dwFlags);
1717  return DI_OK;
1718 }
#define FIXME(fmt,...)
Definition: debug.h:110
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define DI_OK
Definition: dinput.h:128

Referenced by IDirectInputDevice2AImpl_EnumCreatedEffectObjects().

◆ IDirectInputDevice2WImpl_EnumEffects()

HRESULT WINAPI IDirectInputDevice2WImpl_EnumEffects ( LPDIRECTINPUTDEVICE8W  iface,
LPDIENUMEFFECTSCALLBACKW  lpCallback,
LPVOID  lpvRef,
DWORD  dwFlags 
)

Definition at line 1657 of file device.c.

1662 {
1663  FIXME("(this=%p,%p,%p,0x%08x): stub!\n",
1664  iface, lpCallback, lpvRef, dwFlags);
1665 
1666  return DI_OK;
1667 }
#define FIXME(fmt,...)
Definition: debug.h:110
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define DI_OK
Definition: dinput.h:128

◆ IDirectInputDevice2WImpl_EnumObjects()

HRESULT WINAPI IDirectInputDevice2WImpl_EnumObjects ( LPDIRECTINPUTDEVICE8W  iface,
LPDIENUMDEVICEOBJECTSCALLBACKW  lpCallback,
LPVOID  lpvRef,
DWORD  dwFlags 
)

Definition at line 1257 of file device.c.

1259 {
1262  int i;
1263 
1264  TRACE("(%p) %p,%p flags:%08x)\n", iface, lpCallback, lpvRef, dwFlags);
1265  TRACE(" - flags = ");
1267  TRACE("\n");
1268 
1269  /* Only the fields till dwFFMaxForce are relevant */
1270  memset(&ddoi, 0, sizeof(ddoi));
1271  ddoi.dwSize = FIELD_OFFSET(DIDEVICEOBJECTINSTANCEW, dwFFMaxForce);
1272 
1273  for (i = 0; i < This->data_format.wine_df->dwNumObjs; i++)
1274  {
1275  LPDIOBJECTDATAFORMAT odf = dataformat_to_odf(This->data_format.wine_df, i);
1276 
1277  if (dwFlags != DIDFT_ALL && !(dwFlags & DIDFT_GETTYPE(odf->dwType))) continue;
1278  if (IDirectInputDevice_GetObjectInfo(iface, &ddoi, odf->dwType, DIPH_BYID) != DI_OK)
1279  continue;
1280 
1281  if (lpCallback(&ddoi, lpvRef) != DIENUM_CONTINUE) break;
1282  }
1283 
1284  return DI_OK;
1285 }
#define DIPH_BYID
Definition: dinput.h:837
static void _dump_EnumObjects_flags(DWORD dwFlags)
Definition: device.c:126
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
static LPDIOBJECTDATAFORMAT dataformat_to_odf(LPCDIDATAFORMAT df, int idx)
Definition: device.c:402
#define IDirectInputDevice_GetObjectInfo(p, a, b, c)
Definition: dinput.h:1617
#define TRACE(s)
Definition: solgame.cpp:4
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface)
Definition: device.c:50
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
#define DI_OK
Definition: dinput.h:128
#define DIENUM_CONTINUE
Definition: dinput.h:188
#define DIDFT_ALL
Definition: dinput.h:750
#define DIDFT_GETTYPE(n)
Definition: dinput.h:763
#define memset(x, y, z)
Definition: compat.h:39

◆ IDirectInputDevice2WImpl_Escape()

HRESULT WINAPI IDirectInputDevice2WImpl_Escape ( LPDIRECTINPUTDEVICE8W  iface,
LPDIEFFESCAPE  lpDIEEsc 
)

Definition at line 1727 of file device.c.

1728 {
1729  FIXME("(this=%p,%p): stub!\n", iface, lpDIEEsc);
1730  return DI_OK;
1731 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define DI_OK
Definition: dinput.h:128

Referenced by IDirectInputDevice2AImpl_Escape().

◆ IDirectInputDevice2WImpl_GetDeviceData()

HRESULT WINAPI IDirectInputDevice2WImpl_GetDeviceData ( LPDIRECTINPUTDEVICE8W  iface,
DWORD  dodsize,
LPDIDEVICEOBJECTDATA  dod,
LPDWORD  entries,
DWORD  flags 
)

Definition at line 1534 of file device.c.

1536 {
1538  HRESULT ret = DI_OK;
1539  int len;
1540 
1541  TRACE("(%p) %p -> %p(%d) x%d, 0x%08x\n",
1542  This, dod, entries, entries ? *entries : 0, dodsize, flags);
1543 
1544  if (This->dinput->dwVersion == 0x0800 || dodsize == sizeof(DIDEVICEOBJECTDATA_DX3))
1545  {
1546  if (!This->queue_len) return DIERR_NOTBUFFERED;
1547  if (!This->acquired) return DIERR_NOTACQUIRED;
1548  }
1549 
1550  if (!This->queue_len)
1551  return DI_OK;
1552  if (dodsize < sizeof(DIDEVICEOBJECTDATA_DX3))
1553  return DIERR_INVALIDPARAM;
1554 
1555  IDirectInputDevice2_Poll(iface);
1556  EnterCriticalSection(&This->crit);
1557 
1558  len = This->queue_head - This->queue_tail;
1559  if (len < 0) len += This->queue_len;
1560 
1561  if ((*entries != INFINITE) && (len > *entries)) len = *entries;
1562 
1563  if (dod)
1564  {
1565  int i;
1566  for (i = 0; i < len; i++)
1567  {
1568  int n = (This->queue_tail + i) % This->queue_len;
1569  memcpy((char *)dod + dodsize * i, This->data_queue + n, dodsize);
1570  }
1571  }
1572  *entries = len;
1573 
1574  if (This->overflow && This->dinput->dwVersion == 0x0800)
1576 
1577  if (!(flags & DIGDD_PEEK))
1578  {
1579  /* Advance reading position */
1580  This->queue_tail = (This->queue_tail + len) % This->queue_len;
1581  This->overflow = FALSE;
1582  }
1583 
1584  LeaveCriticalSection(&This->crit);
1585 
1586  TRACE("Returning %d events queued\n", *entries);
1587  return ret;
1588 }
#define DIERR_NOTACQUIRED
Definition: dinput.h:167
GLdouble n
Definition: glext.h:7729
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define DI_BUFFEROVERFLOW
Definition: dinput.h:130
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 DIERR_INVALIDPARAM
Definition: dinput.h:152
#define TRACE(s)
Definition: solgame.cpp:4
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface)
Definition: device.c:50
LONG HRESULT
Definition: typedefs.h:77
#define DIGDD_PEEK
Definition: dinput.h:778
#define IDirectInputDevice2_Poll(p)
Definition: dinput.h:1752
GLbitfield flags
Definition: glext.h:7161
int ret
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
#define DIERR_NOTBUFFERED
Definition: dinput.h:181
#define DI_OK
Definition: dinput.h:128
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define INFINITE
Definition: serial.h:102

Referenced by IDirectInputDevice2AImpl_GetDeviceData(), and SysMouseWImpl_GetDeviceData().

◆ IDirectInputDevice2WImpl_GetEffectInfo()

HRESULT WINAPI IDirectInputDevice2WImpl_GetEffectInfo ( LPDIRECTINPUTDEVICE8W  iface,
LPDIEFFECTINFOW  lpdei,
REFGUID  rguid 
)

Definition at line 1679 of file device.c.

1683 {
1684  FIXME("(this=%p,%p,%s): stub!\n",
1685  iface, lpdei, debugstr_guid(rguid));
1686  return DI_OK;
1687 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_guid
Definition: kernel32.h:35
#define DI_OK
Definition: dinput.h:128

◆ IDirectInputDevice2WImpl_GetForceFeedbackState()

HRESULT WINAPI IDirectInputDevice2WImpl_GetForceFeedbackState ( LPDIRECTINPUTDEVICE8W  iface,
LPDWORD  pdwOut 
)

Definition at line 1689 of file device.c.

1690 {
1691  FIXME("(this=%p,%p): stub!\n", iface, pdwOut);
1692  return DI_OK;
1693 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define DI_OK
Definition: dinput.h:128
_Out_ PDWORD pdwOut
Definition: ntgdi.h:1813

Referenced by IDirectInputDevice2AImpl_GetForceFeedbackState().

◆ IDirectInputDevice2WImpl_GetObjectInfo()

HRESULT WINAPI IDirectInputDevice2WImpl_GetObjectInfo ( LPDIRECTINPUTDEVICE8W  iface,
LPDIDEVICEOBJECTINSTANCEW  pdidoi,
DWORD  dwObj,
DWORD  dwHow 
)

Definition at line 1481 of file device.c.

1486 {
1488  DWORD dwSize;
1490  int idx = -1;
1491 
1492  TRACE("(%p) %d(0x%08x) -> %p\n", This, dwHow, dwObj, pdidoi);
1493 
1494  if (!pdidoi ||
1495  (pdidoi->dwSize != sizeof(DIDEVICEOBJECTINSTANCEW) &&
1496  pdidoi->dwSize != sizeof(DIDEVICEOBJECTINSTANCE_DX3W)))
1497  return DIERR_INVALIDPARAM;
1498 
1499  switch (dwHow)
1500  {
1501  case DIPH_BYOFFSET:
1502  if (!This->data_format.offsets) break;
1503  for (idx = This->data_format.wine_df->dwNumObjs - 1; idx >= 0; idx--)
1504  if (This->data_format.offsets[idx] == dwObj) break;
1505  break;
1506  case DIPH_BYID:
1507  dwObj &= 0x00ffffff;
1508  for (idx = This->data_format.wine_df->dwNumObjs - 1; idx >= 0; idx--)
1509  if ((dataformat_to_odf(This->data_format.wine_df, idx)->dwType & 0x00ffffff) == dwObj)
1510  break;
1511  break;
1512 
1513  case DIPH_BYUSAGE:
1514  FIXME("dwHow = DIPH_BYUSAGE not implemented\n");
1515  break;
1516  default:
1517  WARN("invalid parameter: dwHow = %08x\n", dwHow);
1518  return DIERR_INVALIDPARAM;
1519  }
1520  if (idx < 0) return DIERR_OBJECTNOTFOUND;
1521 
1522  odf = dataformat_to_odf(This->data_format.wine_df, idx);
1523  dwSize = pdidoi->dwSize; /* save due to memset below */
1524  memset(pdidoi, 0, pdidoi->dwSize);
1525  pdidoi->dwSize = dwSize;
1526  if (odf->pguid) pdidoi->guidType = *odf->pguid;
1527  pdidoi->dwOfs = This->data_format.offsets ? This->data_format.offsets[idx] : odf->dwOfs;
1528  pdidoi->dwType = odf->dwType;
1529  pdidoi->dwFlags = odf->dwFlags;
1530 
1531  return DI_OK;
1532 }
#define DIPH_BYUSAGE
Definition: dinput.h:838
#define DIPH_BYID
Definition: dinput.h:837
#define WARN(fmt,...)
Definition: debug.h:111
static LPDIOBJECTDATAFORMAT dataformat_to_odf(LPCDIDATAFORMAT df, int idx)
Definition: device.c:402
#define DIPH_BYOFFSET
Definition: dinput.h:836
#define FIXME(fmt,...)
Definition: debug.h:110
unsigned int idx
Definition: utils.c:41
#define DIERR_INVALIDPARAM
Definition: dinput.h:152
#define TRACE(s)
Definition: solgame.cpp:4
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface)
Definition: device.c:50
unsigned long DWORD
Definition: ntddk_ex.h:95
const GUID * pguid
Definition: dinput.h:800
#define DI_OK
Definition: dinput.h:128
#define memset(x, y, z)
Definition: compat.h:39
#define DIERR_OBJECTNOTFOUND
Definition: dinput.h:150
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54

Referenced by IDirectInputDevice2AImpl_GetObjectInfo(), JoystickWGenericImpl_GetObjectInfo(), SysKeyboardWImpl_GetObjectInfo(), and SysMouseWImpl_GetObjectInfo().

◆ IDirectInputDevice2WImpl_GetProperty()

HRESULT WINAPI IDirectInputDevice2WImpl_GetProperty ( LPDIRECTINPUTDEVICE8W  iface,
REFGUID  rguid,
LPDIPROPHEADER  pdiph 
)

Definition at line 1291 of file device.c.

1292 {
1294 
1295  TRACE("(%p) %s,%p\n", iface, debugstr_guid(rguid), pdiph);
1296  _dump_DIPROPHEADER(pdiph);
1297 
1298  if (!IS_DIPROP(rguid)) return DI_OK;
1299 
1300  switch (LOWORD(rguid))
1301  {
1303  {
1304  LPDIPROPDWORD pd = (LPDIPROPDWORD)pdiph;
1305 
1306  if (pdiph->dwSize != sizeof(DIPROPDWORD)) return DIERR_INVALIDPARAM;
1307 
1308  pd->dwData = This->queue_len;
1309  TRACE("buffersize = %d\n", pd->dwData);
1310  break;
1311  }
1312  case (DWORD_PTR) DIPROP_USERNAME:
1313  {
1314  LPDIPROPSTRING ps = (LPDIPROPSTRING)pdiph;
1315  struct DevicePlayer *device_player;
1316 
1317  if (pdiph->dwSize != sizeof(DIPROPSTRING)) return DIERR_INVALIDPARAM;
1318 
1319  LIST_FOR_EACH_ENTRY(device_player, &This->dinput->device_players,
1320  struct DevicePlayer, entry)
1321  {
1322  if (IsEqualGUID(&device_player->instance_guid, &This->guid))
1323  {
1324  if (*device_player->username)
1325  {
1326  lstrcpynW(ps->wsz, device_player->username, ARRAY_SIZE(ps->wsz));
1327  return DI_OK;
1328  }
1329  else break;
1330  }
1331  }
1332  return S_FALSE;
1333  }
1334  case (DWORD_PTR) DIPROP_VIDPID:
1335  FIXME("DIPROP_VIDPID not implemented\n");
1336  return DIERR_UNSUPPORTED;
1337  default:
1338  FIXME("Unknown property %s\n", debugstr_guid(rguid));
1339  return DIERR_INVALIDPARAM;
1340  }
1341 
1342  return DI_OK;
1343 }
struct DIPROPSTRING * LPDIPROPSTRING
DWORD dwSize
Definition: dinput.h:828
WCHAR username[MAX_PATH]
#define lstrcpynW
Definition: compat.h:397
#define DIERR_UNSUPPORTED
Definition: dinput.h:156
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
#define FIXME(fmt,...)
Definition: debug.h:110
#define S_FALSE
Definition: winerror.h:2357
#define debugstr_guid
Definition: kernel32.h:35
#define DIPROP_BUFFERSIZE
Definition: dinput.h:885
#define DIERR_INVALIDPARAM
Definition: dinput.h:152
#define TRACE(s)
Definition: solgame.cpp:4
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface)
Definition: device.c:50
void _dump_DIPROPHEADER(LPCDIPROPHEADER diph)
Definition: device.c:175
WCHAR wsz[MAX_PATH]
Definition: dinput.h:875
uint32_t entry
Definition: isohybrid.c:63
DWORD dwData
Definition: dinput.h:844
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define ARRAY_SIZE(a)
Definition: main.h:24
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
#define DIPROP_USERNAME
Definition: dinput.h:921
#define DI_OK
Definition: dinput.h:128
#define IS_DIPROP(x)
#define DIPROP_VIDPID
Definition: dinput.h:920
struct DIPROPDWORD * LPDIPROPDWORD
#define LOWORD(l)
Definition: pedump.c:82

Referenced by IDirectInputDevice2AImpl_GetProperty(), JoystickWGenericImpl_GetProperty(), and SysMouseWImpl_GetProperty().

◆ IDirectInputDevice2WImpl_Initialize()

HRESULT WINAPI IDirectInputDevice2WImpl_Initialize ( LPDIRECTINPUTDEVICE8W  iface,
HINSTANCE  hinst,
DWORD  dwVersion,
REFGUID  rguid 
)

Definition at line 1610 of file device.c.

1612 {
1613  FIXME("(this=%p,%p,%d,%s): stub!\n", iface, hinst, dwVersion, debugstr_guid(rguid));
1614  return DI_OK;
1615 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_guid
Definition: kernel32.h:35
#define DI_OK
Definition: dinput.h:128
static HINSTANCE hinst
Definition: edit.c:551

Referenced by IDirectInputDevice2AImpl_Initialize().

◆ IDirectInputDevice2WImpl_Poll()

HRESULT WINAPI IDirectInputDevice2WImpl_Poll ( LPDIRECTINPUTDEVICE8W  iface)

Definition at line 1739 of file device.c.

1740 {
1742 
1743  if (!This->acquired) return DIERR_NOTACQUIRED;
1744 
1746  return DI_OK;
1747 }
void check_dinput_events(void)
Definition: dinput_main.c:1870
#define DIERR_NOTACQUIRED
Definition: dinput.h:167
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface)
Definition: device.c:50
#define DI_OK
Definition: dinput.h:128

Referenced by IDirectInputDevice2AImpl_Poll().

◆ IDirectInputDevice2WImpl_QueryInterface()

HRESULT WINAPI IDirectInputDevice2WImpl_QueryInterface ( LPDIRECTINPUTDEVICE8W  iface,
REFIID  riid,
LPVOID ppobj 
)

Definition at line 1180 of file device.c.

1181 {
1183 
1184  TRACE("(%p this=%p,%s,%p)\n", iface, This, debugstr_guid(riid), ppobj);
1185  if (IsEqualGUID(&IID_IUnknown, riid) ||
1186  IsEqualGUID(&IID_IDirectInputDeviceA, riid) ||
1187  IsEqualGUID(&IID_IDirectInputDevice2A, riid) ||
1188  IsEqualGUID(&IID_IDirectInputDevice7A, riid) ||
1189  IsEqualGUID(&IID_IDirectInputDevice8A, riid))
1190  {
1193  return DI_OK;
1194  }
1195  if (IsEqualGUID(&IID_IDirectInputDeviceW, riid) ||
1196  IsEqualGUID(&IID_IDirectInputDevice2W, riid) ||
1197  IsEqualGUID(&IID_IDirectInputDevice7W, riid) ||
1198  IsEqualGUID(&IID_IDirectInputDevice8W, riid))
1199  {
1202  return DI_OK;
1203  }
1204 
1205  WARN("Unsupported interface!\n");
1206  return E_FAIL;
1207 }
static IDirectInputDevice8W * IDirectInputDevice8W_from_impl(IDirectInputDeviceImpl *This)
Definition: device.c:59
#define IDirectInputDevice2_AddRef(p)
Definition: dinput.h:1726
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:111
#define E_FAIL
Definition: ddrawi.h:102
static IDirectInputDevice8A * IDirectInputDevice8A_from_impl(IDirectInputDeviceImpl *This)
Definition: device.c:55
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface)
Definition: device.c:50
const GUID IID_IUnknown
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
#define DI_OK
Definition: dinput.h:128

Referenced by IDirectInputDevice2AImpl_QueryInterface().

◆ IDirectInputDevice2WImpl_Release()

ULONG WINAPI IDirectInputDevice2WImpl_Release ( LPDIRECTINPUTDEVICE8W  iface)

Definition at line 1138 of file device.c.

1139 {
1141  ULONG ref = InterlockedDecrement(&(This->ref));
1142 
1143  TRACE("(%p) releasing from %d\n", This, ref + 1);
1144 
1145  if (ref) return ref;
1146 
1148  /* Reset the FF state, free all effects, etc */
1150 
1151  HeapFree(GetProcessHeap(), 0, This->data_queue);
1152 
1153  /* Free data format */
1154  HeapFree(GetProcessHeap(), 0, This->data_format.wine_df->rgodf);
1155  HeapFree(GetProcessHeap(), 0, This->data_format.wine_df);
1156  release_DataFormat(&This->data_format);
1157 
1158  /* Free action mapping */
1159  HeapFree(GetProcessHeap(), 0, This->action_map);
1160 
1161  EnterCriticalSection( &This->dinput->crit );
1162  list_remove( &This->entry );
1163  LeaveCriticalSection( &This->dinput->crit );
1164 
1165  IDirectInput_Release(&This->dinput->IDirectInput7A_iface);
1166  This->crit.DebugInfo->Spare[0] = 0;
1167  DeleteCriticalSection(&This->crit);
1168 
1169  HeapFree(GetProcessHeap(), 0, This);
1170 
1171  return DI_OK;
1172 }
#define IDirectInputDevice8_SendForceFeedbackCommand(p, a)
Definition: dinput.h:2060
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
Definition: send.c:47
GLenum GLint ref
Definition: glext.h:6028
#define DISFFC_RESET
Definition: dinput.h:972
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
#define TRACE(s)
Definition: solgame.cpp:4
#define IDirectInput_Release(p)
Definition: dinput.h:2241
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface)
Definition: device.c:50
#define GetProcessHeap()
Definition: compat.h:395
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
#define InterlockedDecrement
Definition: armddk.h:52
void release_DataFormat(DataFormat *format)
Definition: device.c:390
#define DI_OK
Definition: dinput.h:128
#define IDirectInputDevice_Unacquire(p)
Definition: dinput.h:1611
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by IDirectInputDevice2AImpl_Release().

◆ IDirectInputDevice2WImpl_RunControlPanel()

HRESULT WINAPI IDirectInputDevice2WImpl_RunControlPanel ( LPDIRECTINPUTDEVICE8W  iface,
HWND  hwndOwner,
DWORD  dwFlags 
)

Definition at line 1597 of file device.c.

1598 {
1599  FIXME("(this=%p,%p,0x%08x): stub!\n", iface, hwndOwner, dwFlags);
1600 
1601  return DI_OK;
1602 }
#define FIXME(fmt,...)
Definition: debug.h:110
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define DI_OK
Definition: dinput.h:128

Referenced by IDirectInputDevice2AImpl_RunControlPanel().

◆ IDirectInputDevice2WImpl_SendDeviceData()

HRESULT WINAPI IDirectInputDevice2WImpl_SendDeviceData ( LPDIRECTINPUTDEVICE8W  iface,
DWORD  cbObjectData,
LPCDIDEVICEOBJECTDATA  rgdod,
LPDWORD  pdwInOut,
DWORD  dwFlags 
)

Definition at line 1755 of file device.c.

1758 {
1759  FIXME("(this=%p,0x%08x,%p,%p,0x%08x): stub!\n", iface, cbObjectData, rgdod, pdwInOut, dwFlags);
1760 
1761  return DI_OK;
1762 }
#define FIXME(fmt,...)
Definition: debug.h:110
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define DI_OK
Definition: dinput.h:128

Referenced by IDirectInputDevice2AImpl_SendDeviceData().

◆ IDirectInputDevice2WImpl_SendForceFeedbackCommand()

HRESULT WINAPI IDirectInputDevice2WImpl_SendForceFeedbackCommand ( LPDIRECTINPUTDEVICE8W  iface,
DWORD  dwFlags 
)

Definition at line 1701 of file device.c.

1702 {
1703  TRACE("(%p) 0x%08x:\n", iface, dwFlags);
1704  return DI_NOEFFECT;
1705 }
#define TRACE(s)
Definition: solgame.cpp:4
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define DI_NOEFFECT
Definition: dinput.h:132

Referenced by IDirectInputDevice2AImpl_SendForceFeedbackCommand().

◆ IDirectInputDevice2WImpl_SetCooperativeLevel()

HRESULT WINAPI IDirectInputDevice2WImpl_SetCooperativeLevel ( LPDIRECTINPUTDEVICE8W  iface,
HWND  hwnd,
DWORD  dwflags 
)

Definition at line 1074 of file device.c.

1075 {
1077 
1078  TRACE("(%p) %p,0x%08x\n", This, hwnd, dwflags);
1080 
1081  if ((dwflags & (DISCL_EXCLUSIVE | DISCL_NONEXCLUSIVE)) == 0 ||
1083  (dwflags & (DISCL_FOREGROUND | DISCL_BACKGROUND)) == 0 ||
1085  return DIERR_INVALIDPARAM;
1086 
1087  if (hwnd && GetWindowLongW(hwnd, GWL_STYLE) & WS_CHILD) return E_HANDLE;
1088 
1090  hwnd = GetDesktopWindow();
1091 
1092  if (!IsWindow(hwnd)) return E_HANDLE;
1093 
1094  /* For security reasons native does not allow exclusive background level
1095  for mouse and keyboard only */
1097  (IsEqualGUID(&This->guid, &GUID_SysMouse) ||
1098  IsEqualGUID(&This->guid, &GUID_SysKeyboard)))
1099  return DIERR_UNSUPPORTED;
1100 
1101  /* Store the window which asks for the mouse */
1102  EnterCriticalSection(&This->crit);
1103  This->win = hwnd;
1104  This->dwCoopLevel = dwflags;
1105  LeaveCriticalSection(&This->crit);
1106 
1107  return DI_OK;
1108 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define E_HANDLE
Definition: winerror.h:2850
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define WS_CHILD
Definition: pedump.c:617
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define DIERR_UNSUPPORTED
Definition: dinput.h:156
#define DISCL_NONEXCLUSIVE
Definition: dinput.h:966
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:622
static void _dump_cooperativelevel_DI(DWORD dwFlags)
Definition: device.c:67
#define DIERR_INVALIDPARAM
Definition: dinput.h:152
#define DISCL_BACKGROUND
Definition: dinput.h:968
#define TRACE(s)
Definition: solgame.cpp:4
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface)
Definition: device.c:50
#define DISCL_FOREGROUND
Definition: dinput.h:967
static _In_ DWORD dwflags
Definition: dispmode.c:64
#define GWL_STYLE
Definition: winuser.h:846
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
#define DI_OK
Definition: dinput.h:128
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define DISCL_EXCLUSIVE
Definition: dinput.h:965

Referenced by IDirectInputDevice2AImpl_SetCooperativeLevel().

◆ IDirectInputDevice2WImpl_SetDataFormat()

HRESULT WINAPI IDirectInputDevice2WImpl_SetDataFormat ( LPDIRECTINPUTDEVICE8W  iface,
LPCDIDATAFORMAT  df 
)

Definition at line 1042 of file device.c.

1043 {
1045  HRESULT res = DI_OK;
1046 
1047  if (!df) return E_POINTER;
1048  TRACE("(%p) %p\n", This, df);
1049  _dump_DIDATAFORMAT(df);
1050 
1051  if (df->dwSize != sizeof(DIDATAFORMAT)) return DIERR_INVALIDPARAM;
1052  if (This->acquired) return DIERR_ACQUIRED;
1053 
1054  EnterCriticalSection(&This->crit);
1055 
1056  release_DataFormat(&This->data_format);
1057  res = create_DataFormat(df, &This->data_format);
1058 
1059  LeaveCriticalSection(&This->crit);
1060  return res;
1061 }
DWORD dwSize
Definition: dinput.h:808
static HRESULT create_DataFormat(LPCDIDATAFORMAT asked_format, DataFormat *format)
Definition: device.c:431
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define DIERR_INVALIDPARAM
Definition: dinput.h:152
void _dump_DIDATAFORMAT(const DIDATAFORMAT *df)
Definition: device.c:241
#define TRACE(s)
Definition: solgame.cpp:4
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface)
Definition: device.c:50
#define DIERR_ACQUIRED
Definition: dinput.h:165
LONG HRESULT
Definition: typedefs.h:77
void release_DataFormat(DataFormat *format)
Definition: device.c:390
GLuint res
Definition: glext.h:9613
#define DI_OK
Definition: dinput.h:128
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define E_POINTER
Definition: winerror.h:2365

Referenced by IDirectInputDevice2AImpl_SetDataFormat().

◆ IDirectInputDevice2WImpl_SetEventNotification()

HRESULT WINAPI IDirectInputDevice2WImpl_SetEventNotification ( LPDIRECTINPUTDEVICE8W  iface,
HANDLE  hnd 
)

Definition at line 1119 of file device.c.

1120 {
1122 
1123  TRACE("(%p) %p\n", This, event);
1124 
1125  EnterCriticalSection(&This->crit);
1126  This->hEvent = event;
1127  LeaveCriticalSection(&This->crit);
1128  return DI_OK;
1129 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define TRACE(s)
Definition: solgame.cpp:4
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface)
Definition: device.c:50
struct _cl_event * event
Definition: glext.h:7739
#define DI_OK
Definition: dinput.h:128
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

Referenced by IDirectInputDevice2AImpl_SetEventNotification().

◆ IDirectInputDevice2WImpl_SetProperty()

HRESULT WINAPI IDirectInputDevice2WImpl_SetProperty ( LPDIRECTINPUTDEVICE8W  iface,
REFGUID  rguid,
LPCDIPROPHEADER  pdiph 
)

Definition at line 1355 of file device.c.

1357 {
1359 
1360  TRACE("(%p) %s,%p\n", iface, debugstr_guid(rguid), pdiph);
1361  _dump_DIPROPHEADER(pdiph);
1362 
1363  if (!IS_DIPROP(rguid)) return DI_OK;
1364 
1365  switch (LOWORD(rguid))
1366  {
1367  case (DWORD_PTR) DIPROP_AXISMODE:
1368  {
1369  LPCDIPROPDWORD pd = (LPCDIPROPDWORD)pdiph;
1370 
1371  if (pdiph->dwSize != sizeof(DIPROPDWORD)) return DIERR_INVALIDPARAM;
1372  if (pdiph->dwHow == DIPH_DEVICE && pdiph->dwObj) return DIERR_INVALIDPARAM;
1373  if (This->acquired) return DIERR_ACQUIRED;
1374  if (pdiph->dwHow != DIPH_DEVICE) return DIERR_UNSUPPORTED;
1375  if (!This->data_format.user_df) return DI_OK;
1376 
1377  TRACE("Axis mode: %s\n", pd->dwData == DIPROPAXISMODE_ABS ? "absolute" :
1378  "relative");
1379 
1380  EnterCriticalSection(&This->crit);
1381  This->data_format.user_df->dwFlags &= ~DIDFT_AXIS;
1382  This->data_format.user_df->dwFlags |= pd->dwData == DIPROPAXISMODE_ABS ?
1384  LeaveCriticalSection(&This->crit);
1385  break;
1386  }
1388  {
1389  LPCDIPROPDWORD pd = (LPCDIPROPDWORD)pdiph;
1390 
1391  if (pdiph->dwSize != sizeof(DIPROPDWORD)) return DIERR_INVALIDPARAM;
1392  if (This->acquired) return DIERR_ACQUIRED;
1393 
1394  TRACE("buffersize = %d\n", pd->dwData);
1395 
1396  EnterCriticalSection(&This->crit);
1397  HeapFree(GetProcessHeap(), 0, This->data_queue);
1398 
1399  This->data_queue = !pd->dwData ? NULL : HeapAlloc(GetProcessHeap(), 0,
1400  pd->dwData * sizeof(DIDEVICEOBJECTDATA));
1401  This->queue_head = This->queue_tail = This->overflow = 0;
1402  This->queue_len = pd->dwData;
1403 
1404  LeaveCriticalSection(&This->crit);
1405  break;
1406  }
1407  case (DWORD_PTR) DIPROP_USERNAME:
1408  {
1409  LPCDIPROPSTRING ps = (LPCDIPROPSTRING)pdiph;
1410  struct DevicePlayer *device_player;
1411  BOOL found = FALSE;
1412 
1413  if (pdiph->dwSize != sizeof(DIPROPSTRING)) return DIERR_INVALIDPARAM;
1414 
1415  LIST_FOR_EACH_ENTRY(device_player, &This->dinput->device_players,
1416  struct DevicePlayer, entry)
1417  {
1418  if (IsEqualGUID(&device_player->instance_guid, &This->guid))
1419  {
1420  found = TRUE;
1421  break;
1422  }
1423  }
1424  if (!found && (device_player =
1425  HeapAlloc(GetProcessHeap(), 0, sizeof(struct DevicePlayer))))
1426  {
1427  list_add_tail(&This->dinput->device_players, &device_player->entry);
1428  device_player->instance_guid = This->guid;
1429  }
1430  if (device_player)
1431  lstrcpynW(device_player->username, ps->wsz, ARRAY_SIZE(device_player->username));
1432  break;
1433  }
1434  default:
1435  WARN("Unknown property %s\n", debugstr_guid(rguid));
1436  return DIERR_UNSUPPORTED;
1437  }
1438 
1439  return DI_OK;
1440 }
#define TRUE
Definition: types.h:120
DWORD dwSize
Definition: dinput.h:828
#define DIDF_ABSAXIS
Definition: dinput.h:775
#define DIPROPAXISMODE_ABS
Definition: dinput.h:888
#define WARN(fmt,...)
Definition: debug.h:111
WCHAR username[MAX_PATH]
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
DWORD dwHow
Definition: dinput.h:831
struct list entry
#define DIPH_DEVICE
Definition: dinput.h:835
#define lstrcpynW
Definition: compat.h:397
const DIPROPSTRING * LPCDIPROPSTRING
Definition: dinput.h:877
#define DIERR_UNSUPPORTED
Definition: dinput.h:156
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
const DIPROPDWORD * LPCDIPROPDWORD
Definition: dinput.h:846
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
unsigned int BOOL
Definition: ntddk_ex.h:94
#define DIDF_RELAXIS
Definition: dinput.h:776
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define DIPROP_BUFFERSIZE
Definition: dinput.h:885
#define DIERR_INVALIDPARAM
Definition: dinput.h:152
#define TRACE(s)
Definition: solgame.cpp:4
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface)
Definition: device.c:50
#define DIERR_ACQUIRED
Definition: dinput.h:165
void _dump_DIPROPHEADER(LPCDIPROPHEADER diph)
Definition: device.c:175
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
WCHAR wsz[MAX_PATH]
Definition: dinput.h:875
#define DIDFT_AXIS
Definition: dinput.h:753
uint32_t entry
Definition: isohybrid.c:63
DWORD dwData
Definition: dinput.h:844
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define DIPROP_AXISMODE
Definition: dinput.h:886
#define ARRAY_SIZE(a)
Definition: main.h:24
DWORD dwObj
Definition: dinput.h:830
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
#define DIPROP_USERNAME
Definition: dinput.h:921
#define DI_OK
Definition: dinput.h:128
#define IS_DIPROP(x)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by IDirectInputDevice2AImpl_SetProperty(), and JoystickWGenericImpl_SetProperty().

◆ IDirectInputDevice2WImpl_Unacquire()

HRESULT WINAPI IDirectInputDevice2WImpl_Unacquire ( LPDIRECTINPUTDEVICE8W  iface)

Definition at line 1015 of file device.c.

1016 {
1018  HRESULT res;
1019 
1020  TRACE("(%p)\n", This);
1021 
1022  EnterCriticalSection(&This->crit);
1023  res = !This->acquired ? DI_NOEFFECT : DI_OK;
1024  This->acquired = 0;
1025  LeaveCriticalSection(&This->crit);
1026  if (res == DI_OK)
1027  check_dinput_hooks(iface, FALSE);
1028 
1029  return res;
1030 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
void check_dinput_hooks(LPDIRECTINPUTDEVICE8W iface, BOOL acquired)
Definition: dinput_main.c:1833
#define TRACE(s)
Definition: solgame.cpp:4
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface)
Definition: device.c:50
LONG HRESULT
Definition: typedefs.h:77
#define DI_NOEFFECT
Definition: dinput.h:132
GLuint res
Definition: glext.h:9613
#define DI_OK
Definition: dinput.h:128
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

Referenced by IDirectInputDevice2AImpl_Unacquire(), and SysMouseWImpl_Unacquire().

◆ IDirectInputDevice7AImpl_EnumEffectsInFile()

HRESULT WINAPI IDirectInputDevice7AImpl_EnumEffectsInFile ( LPDIRECTINPUTDEVICE8A  iface,
LPCSTR  lpszFileName,
LPDIENUMEFFECTSINFILECALLBACK  pec,
LPVOID  pvRef,
DWORD  dwFlags 
)

Definition at line 1773 of file device.c.

1778 {
1779  FIXME("(%p)->(%s,%p,%p,%08x): stub !\n", iface, lpszFileName, pec, pvRef, dwFlags);
1780 
1781  return DI_OK;
1782 }
#define FIXME(fmt,...)
Definition: debug.h:110
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define DI_OK
Definition: dinput.h:128

◆ IDirectInputDevice7AImpl_WriteEffectToFile()

HRESULT WINAPI IDirectInputDevice7AImpl_WriteEffectToFile ( LPDIRECTINPUTDEVICE8A  iface,
LPCSTR  lpszFileName,
DWORD  dwEntries,
LPDIFILEEFFECT  rgDiFileEft,
DWORD  dwFlags 
)

Definition at line 1795 of file device.c.

1800 {
1801  FIXME("(%p)->(%s,%08x,%p,%08x): stub !\n", iface, lpszFileName, dwEntries, rgDiFileEft, dwFlags);
1802 
1803  return DI_OK;
1804 }
#define FIXME(fmt,...)
Definition: debug.h:110
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define DI_OK
Definition: dinput.h:128

◆ IDirectInputDevice7WImpl_EnumEffectsInFile()

HRESULT WINAPI IDirectInputDevice7WImpl_EnumEffectsInFile ( LPDIRECTINPUTDEVICE8W  iface,
LPCWSTR  lpszFileName,
LPDIENUMEFFECTSINFILECALLBACK  pec,
LPVOID  pvRef,
DWORD  dwFlags 
)

Definition at line 1784 of file device.c.

1789 {
1790  FIXME("(%p)->(%s,%p,%p,%08x): stub !\n", iface, debugstr_w(lpszFileName), pec, pvRef, dwFlags);
1791 
1792  return DI_OK;
1793 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define DI_OK
Definition: dinput.h:128

◆ IDirectInputDevice7WImpl_WriteEffectToFile()

HRESULT WINAPI IDirectInputDevice7WImpl_WriteEffectToFile ( LPDIRECTINPUTDEVICE8W  iface,
LPCWSTR  lpszFileName,
DWORD  dwEntries,
LPDIFILEEFFECT  rgDiFileEft,
DWORD  dwFlags 
)

Definition at line 1806 of file device.c.

1811 {
1812  FIXME("(%p)->(%s,%08x,%p,%08x): stub !\n", iface, debugstr_w(lpszFileName), dwEntries, rgDiFileEft, dwFlags);
1813 
1814  return DI_OK;
1815 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define DI_OK
Definition: dinput.h:128

◆ IDirectInputDevice8AImpl_GetImageInfo()

HRESULT WINAPI IDirectInputDevice8AImpl_GetImageInfo ( LPDIRECTINPUTDEVICE8A  iface,
LPDIDEVICEIMAGEINFOHEADERA  lpdiDevImageInfoHeader 
)

Definition at line 1833 of file device.c.

1835 {
1836  FIXME("(%p)->(%p): stub !\n", iface, lpdiDevImageInfoHeader);
1837 
1838  return DI_OK;
1839 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define DI_OK
Definition: dinput.h:128

◆ IDirectInputDevice8WImpl_BuildActionMap()

HRESULT WINAPI IDirectInputDevice8WImpl_BuildActionMap ( LPDIRECTINPUTDEVICE8W  iface,
LPDIACTIONFORMATW  lpdiaf,
LPCWSTR  lpszUserName,
DWORD  dwFlags 
)

Definition at line 1817 of file device.c.

1821 {
1822  FIXME("(%p)->(%p,%s,%08x): semi-stub !\n", iface, lpdiaf, debugstr_w(lpszUserName), dwFlags);
1823 #define X(x) if (dwFlags & x) FIXME("\tdwFlags =|"#x"\n");
1824  X(DIDBAM_DEFAULT)
1828 #undef X
1829 
1830  return DI_OK;
1831 }
#define DIDBAM_PRESERVE
Definition: dinput.h:1355
#define DIDBAM_INITIALIZE
Definition: dinput.h:1356
#define DIDBAM_DEFAULT
Definition: dinput.h:1354
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define DIDBAM_HWDEFAULTS
Definition: dinput.h:1357
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define X(x)
#define DI_OK
Definition: dinput.h:128

Referenced by _build_action_map(), and JoystickWGenericImpl_BuildActionMap().

◆ IDirectInputDevice8WImpl_GetImageInfo()

HRESULT WINAPI IDirectInputDevice8WImpl_GetImageInfo ( LPDIRECTINPUTDEVICE8W  iface,
LPDIDEVICEIMAGEINFOHEADERW  lpdiDevImageInfoHeader 
)

Definition at line 1841 of file device.c.

1843 {
1844  FIXME("(%p)->(%p): stub !\n", iface, lpdiDevImageInfoHeader);
1845 
1846  return DI_OK;
1847 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define DI_OK
Definition: dinput.h:128

◆ joystick_map_axis()

LONG joystick_map_axis ( ObjProps props,
int  val 
)

Definition at line 893 of file joystick.c.

894 {
895  LONG ret;
896  LONG dead_zone = MulDiv( props->lDeadZone, props->lDevMax - props->lDevMin, 10000 );
897  LONG dev_range = props->lDevMax - props->lDevMin - dead_zone;
898 
899  /* Center input */
900  val -= (props->lDevMin + props->lDevMax) / 2;
901 
902  /* Remove dead zone */
903  if (abs( val ) <= dead_zone / 2)
904  val = 0;
905  else
906  val = val < 0 ? val + dead_zone / 2 : val - dead_zone / 2;
907 
908  /* Scale and map the value from the device range into the required range */
909  ret = MulDiv( val, props->lMax - props->lMin, dev_range ) +
910  (props->lMin + props->lMax) / 2;
911 
912  /* Clamp in case or rounding errors */
913  if (ret > props->lMax) ret = props->lMax;
914  else if (ret < props->lMin) ret = props->lMin;
915 
916  TRACE( "(%d <%d> %d) -> (%d <%d> %d): val=%d ret=%d\n",
917  props->lDevMin, dead_zone, props->lDevMax,
918  props->lMin, props->lDeadZone, props->lMax,
919  val, ret );
920 
921  return ret;
922 }
#define abs(i)
Definition: fconv.c:206
long LONG
Definition: pedump.c:60
GLuint GLfloat * val
Definition: glext.h:7180
#define TRACE(s)
Definition: solgame.cpp:4
int ret
static const WCHAR props[]
Definition: wbemdisp.c:288
#define MulDiv(x, y, z)
Definition: gdifloat.h:86

◆ joystick_map_pov()

DWORD joystick_map_pov ( const POINTL p)

Definition at line 932 of file joystick.c.

933 {
934  if (p->x > 0)
935  return p->y < 0 ? 4500 : !p->y ? 9000 : 13500;
936  else if (p->x < 0)
937  return p->y < 0 ? 31500 : !p->y ? 27000 : 22500;
938  else
939  return p->y < 0 ? 0 : !p->y ? -1 : 18000;
940 }
GLfloat GLfloat p
Definition: glext.h:8902

◆ queue_event()

void queue_event ( LPDIRECTINPUTDEVICE8A  iface,
int  inst_id,
DWORD  data,
DWORD  time,
DWORD  seq 
)

Definition at line 932 of file device.c.

933 {
935  int next_pos, ofs = id_to_offset(&This->data_format, inst_id);
936 
937  /* Event is being set regardless of the queue state */
938  if (This->hEvent) SetEvent(This->hEvent);
939 
941 
942  if (!This->queue_len || This->overflow || ofs < 0) return;
943 
944  next_pos = (This->queue_head + 1) % This->queue_len;
945  if (next_pos == This->queue_tail)
946  {
947  TRACE(" queue overflowed\n");
948  This->overflow = TRUE;
949  return;
950  }
951 
952  TRACE(" queueing %d at offset %d (queue head %d / size %d)\n",
953  data, ofs, This->queue_head, This->queue_len);
954 
955  This->data_queue[This->queue_head].dwOfs = ofs;
956  This->data_queue[This->queue_head].dwData = data;
957  This->data_queue[This->queue_head].dwTimeStamp = time;
958  This->data_queue[This->queue_head].dwSequence = seq;
959 
960  /* Set uAppData by means of action mapping */
961  if (This->num_actions > 0)
962  {
963  int i;
964  for (i=0; i < This->num_actions; i++)
965  {
966  if (This->action_map[i].offset == ofs)
967  {
968  TRACE("Offset %d mapped to uAppData %lu\n", ofs, This->action_map[i].uAppData);
969  This->data_queue[This->queue_head].uAppData = This->action_map[i].uAppData;
970  break;
971  }
972  }
973  }
974 
975  This->queue_head = next_pos;
976  /* Send event if asked */
977 }
#define TRUE
Definition: types.h:120
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:679
__u16 time
Definition: mkdosfs.c:366
static IDirectInputDeviceImpl * impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface)
Definition: device.c:46
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
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:622
static int id_to_offset(const DataFormat *df, int id)
Definition: device.c:599
#define TRACE(s)
Definition: solgame.cpp:4
if(!(yy_init))
Definition: macro.lex.yy.c:714
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_WINE_NOTIFY_ACTIVITY
Definition: device.c:42

Referenced by dinput_mouse_hook(), and KeyboardCallback().

◆ release_DataFormat()

void release_DataFormat ( DataFormat df)

Definition at line 390 of file device.c.

391 {
392  TRACE("Deleting DataFormat: %p\n", format);
393 
394  HeapFree(GetProcessHeap(), 0, format->dt);
395  format->dt = NULL;
396  HeapFree(GetProcessHeap(), 0, format->offsets);
397  format->offsets = NULL;
398  HeapFree(GetProcessHeap(), 0, format->user_df);
399  format->user_df = NULL;
400 }
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by IDirectInputDevice2WImpl_Release(), and IDirectInputDevice2WImpl_SetDataFormat().