dinput: Rename IDirectInputDeviceImpl to struct dinput_device.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2021-10-27 09:40:59 +02:00 committed by Alexandre Julliard
parent 69c9631081
commit dac2e0b187
8 changed files with 244 additions and 258 deletions

View File

@ -33,12 +33,12 @@
#include "wine/debug.h" #include "wine/debug.h"
static IDirectInputDeviceImpl *impl_from_IDirectInputDevice8A( IDirectInputDevice8A *iface ) static struct dinput_device *impl_from_IDirectInputDevice8A( IDirectInputDevice8A *iface )
{ {
return CONTAINING_RECORD( iface, IDirectInputDeviceImpl, IDirectInputDevice8A_iface ); return CONTAINING_RECORD( iface, struct dinput_device, IDirectInputDevice8A_iface );
} }
static IDirectInputDevice8W *IDirectInputDevice8W_from_impl( IDirectInputDeviceImpl *impl ) static IDirectInputDevice8W *IDirectInputDevice8W_from_impl( struct dinput_device *impl )
{ {
return &impl->IDirectInputDevice8W_iface; return &impl->IDirectInputDevice8W_iface;
} }
@ -46,7 +46,7 @@ static IDirectInputDevice8W *IDirectInputDevice8W_from_impl( IDirectInputDeviceI
static inline IDirectInputDevice8A *IDirectInputDevice8A_from_IDirectInputDevice8W( IDirectInputDevice8W *iface ) static inline IDirectInputDevice8A *IDirectInputDevice8A_from_IDirectInputDevice8W( IDirectInputDevice8W *iface )
{ {
if (!iface) return NULL; if (!iface) return NULL;
return &CONTAINING_RECORD( iface, IDirectInputDeviceImpl, IDirectInputDevice8W_iface )->IDirectInputDevice8A_iface; return &CONTAINING_RECORD( iface, struct dinput_device, IDirectInputDevice8W_iface )->IDirectInputDevice8A_iface;
} }
static inline IDirectInputDeviceA *IDirectInputDeviceA_from_IDirectInputDeviceW( IDirectInputDeviceW *iface ) static inline IDirectInputDeviceA *IDirectInputDeviceA_from_IDirectInputDeviceW( IDirectInputDeviceW *iface )
@ -269,28 +269,28 @@ static HRESULT diconfiguredevicesparams_atow( const DICONFIGUREDEVICESPARAMSA *i
static HRESULT WINAPI dinput_device_a_QueryInterface( IDirectInputDevice8A *iface_a, REFIID iid, void **out ) static HRESULT WINAPI dinput_device_a_QueryInterface( IDirectInputDevice8A *iface_a, REFIID iid, void **out )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8A( iface_a ); struct dinput_device *impl = impl_from_IDirectInputDevice8A( iface_a );
IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl ); IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl );
return IDirectInputDevice8_QueryInterface( iface_w, iid, out ); return IDirectInputDevice8_QueryInterface( iface_w, iid, out );
} }
static ULONG WINAPI dinput_device_a_AddRef( IDirectInputDevice8A *iface_a ) static ULONG WINAPI dinput_device_a_AddRef( IDirectInputDevice8A *iface_a )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8A( iface_a ); struct dinput_device *impl = impl_from_IDirectInputDevice8A( iface_a );
IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl ); IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl );
return IDirectInputDevice8_AddRef( iface_w ); return IDirectInputDevice8_AddRef( iface_w );
} }
static ULONG WINAPI dinput_device_a_Release( IDirectInputDevice8A *iface_a ) static ULONG WINAPI dinput_device_a_Release( IDirectInputDevice8A *iface_a )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8A( iface_a ); struct dinput_device *impl = impl_from_IDirectInputDevice8A( iface_a );
IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl ); IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl );
return IDirectInputDevice8_Release( iface_w ); return IDirectInputDevice8_Release( iface_w );
} }
static HRESULT WINAPI dinput_device_a_GetCapabilities( IDirectInputDevice8A *iface_a, DIDEVCAPS *caps ) static HRESULT WINAPI dinput_device_a_GetCapabilities( IDirectInputDevice8A *iface_a, DIDEVCAPS *caps )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8A( iface_a ); struct dinput_device *impl = impl_from_IDirectInputDevice8A( iface_a );
IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl ); IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl );
return IDirectInputDevice8_GetCapabilities( iface_w, caps ); return IDirectInputDevice8_GetCapabilities( iface_w, caps );
} }
@ -314,7 +314,7 @@ static HRESULT WINAPI dinput_device_a_EnumObjects( IDirectInputDevice8A *iface_a
void *ref, DWORD flags ) void *ref, DWORD flags )
{ {
struct enum_objects_wtoa_params params = {callback, ref}; struct enum_objects_wtoa_params params = {callback, ref};
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8A( iface_a ); struct dinput_device *impl = impl_from_IDirectInputDevice8A( iface_a );
IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl ); IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl );
if (!callback) return DIERR_INVALIDPARAM; if (!callback) return DIERR_INVALIDPARAM;
@ -324,35 +324,35 @@ static HRESULT WINAPI dinput_device_a_EnumObjects( IDirectInputDevice8A *iface_a
static HRESULT WINAPI dinput_device_a_GetProperty( IDirectInputDevice8A *iface_a, REFGUID guid, DIPROPHEADER *header ) static HRESULT WINAPI dinput_device_a_GetProperty( IDirectInputDevice8A *iface_a, REFGUID guid, DIPROPHEADER *header )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8A( iface_a ); struct dinput_device *impl = impl_from_IDirectInputDevice8A( iface_a );
IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl ); IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl );
return IDirectInputDevice8_GetProperty( iface_w, guid, header ); return IDirectInputDevice8_GetProperty( iface_w, guid, header );
} }
static HRESULT WINAPI dinput_device_a_SetProperty( IDirectInputDevice8A *iface_a, REFGUID guid, const DIPROPHEADER *header ) static HRESULT WINAPI dinput_device_a_SetProperty( IDirectInputDevice8A *iface_a, REFGUID guid, const DIPROPHEADER *header )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8A( iface_a ); struct dinput_device *impl = impl_from_IDirectInputDevice8A( iface_a );
IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl ); IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl );
return IDirectInputDevice8_SetProperty( iface_w, guid, header ); return IDirectInputDevice8_SetProperty( iface_w, guid, header );
} }
static HRESULT WINAPI dinput_device_a_Acquire( IDirectInputDevice8A *iface_a ) static HRESULT WINAPI dinput_device_a_Acquire( IDirectInputDevice8A *iface_a )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8A( iface_a ); struct dinput_device *impl = impl_from_IDirectInputDevice8A( iface_a );
IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl ); IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl );
return IDirectInputDevice8_Acquire( iface_w ); return IDirectInputDevice8_Acquire( iface_w );
} }
static HRESULT WINAPI dinput_device_a_Unacquire( IDirectInputDevice8A *iface_a ) static HRESULT WINAPI dinput_device_a_Unacquire( IDirectInputDevice8A *iface_a )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8A( iface_a ); struct dinput_device *impl = impl_from_IDirectInputDevice8A( iface_a );
IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl ); IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl );
return IDirectInputDevice8_Unacquire( iface_w ); return IDirectInputDevice8_Unacquire( iface_w );
} }
static HRESULT WINAPI dinput_device_a_GetDeviceState( IDirectInputDevice8A *iface_a, DWORD count, void *data ) static HRESULT WINAPI dinput_device_a_GetDeviceState( IDirectInputDevice8A *iface_a, DWORD count, void *data )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8A( iface_a ); struct dinput_device *impl = impl_from_IDirectInputDevice8A( iface_a );
IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl ); IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl );
return IDirectInputDevice8_GetDeviceState( iface_w, count, data ); return IDirectInputDevice8_GetDeviceState( iface_w, count, data );
} }
@ -360,28 +360,28 @@ static HRESULT WINAPI dinput_device_a_GetDeviceState( IDirectInputDevice8A *ifac
static HRESULT WINAPI dinput_device_a_GetDeviceData( IDirectInputDevice8A *iface_a, DWORD data_size, DIDEVICEOBJECTDATA *data, static HRESULT WINAPI dinput_device_a_GetDeviceData( IDirectInputDevice8A *iface_a, DWORD data_size, DIDEVICEOBJECTDATA *data,
DWORD *entries, DWORD flags ) DWORD *entries, DWORD flags )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8A( iface_a ); struct dinput_device *impl = impl_from_IDirectInputDevice8A( iface_a );
IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl ); IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl );
return IDirectInputDevice8_GetDeviceData( iface_w, data_size, data, entries, flags ); return IDirectInputDevice8_GetDeviceData( iface_w, data_size, data, entries, flags );
} }
static HRESULT WINAPI dinput_device_a_SetDataFormat( IDirectInputDevice8A *iface_a, const DIDATAFORMAT *format ) static HRESULT WINAPI dinput_device_a_SetDataFormat( IDirectInputDevice8A *iface_a, const DIDATAFORMAT *format )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8A( iface_a ); struct dinput_device *impl = impl_from_IDirectInputDevice8A( iface_a );
IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl ); IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl );
return IDirectInputDevice8_SetDataFormat( iface_w, format ); return IDirectInputDevice8_SetDataFormat( iface_w, format );
} }
static HRESULT WINAPI dinput_device_a_SetEventNotification( IDirectInputDevice8A *iface_a, HANDLE event ) static HRESULT WINAPI dinput_device_a_SetEventNotification( IDirectInputDevice8A *iface_a, HANDLE event )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8A( iface_a ); struct dinput_device *impl = impl_from_IDirectInputDevice8A( iface_a );
IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl ); IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl );
return IDirectInputDevice8_SetEventNotification( iface_w, event ); return IDirectInputDevice8_SetEventNotification( iface_w, event );
} }
static HRESULT WINAPI dinput_device_a_SetCooperativeLevel( IDirectInputDevice8A *iface_a, HWND window, DWORD flags ) static HRESULT WINAPI dinput_device_a_SetCooperativeLevel( IDirectInputDevice8A *iface_a, HWND window, DWORD flags )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8A( iface_a ); struct dinput_device *impl = impl_from_IDirectInputDevice8A( iface_a );
IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl ); IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl );
return IDirectInputDevice8_SetCooperativeLevel( iface_w, window, flags ); return IDirectInputDevice8_SetCooperativeLevel( iface_w, window, flags );
} }
@ -389,7 +389,7 @@ static HRESULT WINAPI dinput_device_a_SetCooperativeLevel( IDirectInputDevice8A
static HRESULT WINAPI dinput_device_a_GetObjectInfo( IDirectInputDevice8A *iface_a, DIDEVICEOBJECTINSTANCEA *instance_a, static HRESULT WINAPI dinput_device_a_GetObjectInfo( IDirectInputDevice8A *iface_a, DIDEVICEOBJECTINSTANCEA *instance_a,
DWORD obj, DWORD how ) DWORD obj, DWORD how )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8A( iface_a ); struct dinput_device *impl = impl_from_IDirectInputDevice8A( iface_a );
IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl ); IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl );
DIDEVICEOBJECTINSTANCEW instance_w = {sizeof(instance_w)}; DIDEVICEOBJECTINSTANCEW instance_w = {sizeof(instance_w)};
HRESULT hr; HRESULT hr;
@ -407,7 +407,7 @@ static HRESULT WINAPI dinput_device_a_GetObjectInfo( IDirectInputDevice8A *iface
static HRESULT WINAPI dinput_device_a_GetDeviceInfo( IDirectInputDevice8A *iface_a, DIDEVICEINSTANCEA *instance_a ) static HRESULT WINAPI dinput_device_a_GetDeviceInfo( IDirectInputDevice8A *iface_a, DIDEVICEINSTANCEA *instance_a )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8A( iface_a ); struct dinput_device *impl = impl_from_IDirectInputDevice8A( iface_a );
IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl ); IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl );
DIDEVICEINSTANCEW instance_w = {sizeof(instance_w)}; DIDEVICEINSTANCEW instance_w = {sizeof(instance_w)};
HRESULT hr; HRESULT hr;
@ -424,14 +424,14 @@ static HRESULT WINAPI dinput_device_a_GetDeviceInfo( IDirectInputDevice8A *iface
static HRESULT WINAPI dinput_device_a_RunControlPanel( IDirectInputDevice8A *iface_a, HWND owner, DWORD flags ) static HRESULT WINAPI dinput_device_a_RunControlPanel( IDirectInputDevice8A *iface_a, HWND owner, DWORD flags )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8A( iface_a ); struct dinput_device *impl = impl_from_IDirectInputDevice8A( iface_a );
IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl ); IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl );
return IDirectInputDevice8_RunControlPanel( iface_w, owner, flags ); return IDirectInputDevice8_RunControlPanel( iface_w, owner, flags );
} }
static HRESULT WINAPI dinput_device_a_Initialize( IDirectInputDevice8A *iface_a, HINSTANCE instance, DWORD version, REFGUID guid ) static HRESULT WINAPI dinput_device_a_Initialize( IDirectInputDevice8A *iface_a, HINSTANCE instance, DWORD version, REFGUID guid )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8A( iface_a ); struct dinput_device *impl = impl_from_IDirectInputDevice8A( iface_a );
IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl ); IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl );
return IDirectInputDevice8_Initialize( iface_w, instance, version, guid ); return IDirectInputDevice8_Initialize( iface_w, instance, version, guid );
} }
@ -439,7 +439,7 @@ static HRESULT WINAPI dinput_device_a_Initialize( IDirectInputDevice8A *iface_a,
static HRESULT WINAPI dinput_device_a_CreateEffect( IDirectInputDevice8A *iface_a, REFGUID guid, const DIEFFECT *effect, static HRESULT WINAPI dinput_device_a_CreateEffect( IDirectInputDevice8A *iface_a, REFGUID guid, const DIEFFECT *effect,
IDirectInputEffect **out, IUnknown *outer ) IDirectInputEffect **out, IUnknown *outer )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8A( iface_a ); struct dinput_device *impl = impl_from_IDirectInputDevice8A( iface_a );
IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl ); IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl );
return IDirectInputDevice8_CreateEffect( iface_w, guid, effect, out, outer ); return IDirectInputDevice8_CreateEffect( iface_w, guid, effect, out, outer );
} }
@ -463,7 +463,7 @@ static HRESULT WINAPI dinput_device_a_EnumEffects( IDirectInputDevice8A *iface_a
void *ref, DWORD type ) void *ref, DWORD type )
{ {
struct enum_effects_wtoa_params params = {callback, ref}; struct enum_effects_wtoa_params params = {callback, ref};
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8A( iface_a ); struct dinput_device *impl = impl_from_IDirectInputDevice8A( iface_a );
IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl ); IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl );
if (!callback) return DIERR_INVALIDPARAM; if (!callback) return DIERR_INVALIDPARAM;
@ -473,7 +473,7 @@ static HRESULT WINAPI dinput_device_a_EnumEffects( IDirectInputDevice8A *iface_a
static HRESULT WINAPI dinput_device_a_GetEffectInfo( IDirectInputDevice8A *iface_a, DIEFFECTINFOA *info_a, REFGUID guid ) static HRESULT WINAPI dinput_device_a_GetEffectInfo( IDirectInputDevice8A *iface_a, DIEFFECTINFOA *info_a, REFGUID guid )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8A( iface_a ); struct dinput_device *impl = impl_from_IDirectInputDevice8A( iface_a );
IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl ); IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl );
DIEFFECTINFOW info_w = {sizeof(info_w)}; DIEFFECTINFOW info_w = {sizeof(info_w)};
HRESULT hr; HRESULT hr;
@ -489,14 +489,14 @@ static HRESULT WINAPI dinput_device_a_GetEffectInfo( IDirectInputDevice8A *iface
static HRESULT WINAPI dinput_device_a_GetForceFeedbackState( IDirectInputDevice8A *iface_a, DWORD *state ) static HRESULT WINAPI dinput_device_a_GetForceFeedbackState( IDirectInputDevice8A *iface_a, DWORD *state )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8A( iface_a ); struct dinput_device *impl = impl_from_IDirectInputDevice8A( iface_a );
IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl ); IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl );
return IDirectInputDevice8_GetForceFeedbackState( iface_w, state ); return IDirectInputDevice8_GetForceFeedbackState( iface_w, state );
} }
static HRESULT WINAPI dinput_device_a_SendForceFeedbackCommand( IDirectInputDevice8A *iface_a, DWORD flags ) static HRESULT WINAPI dinput_device_a_SendForceFeedbackCommand( IDirectInputDevice8A *iface_a, DWORD flags )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8A( iface_a ); struct dinput_device *impl = impl_from_IDirectInputDevice8A( iface_a );
IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl ); IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl );
return IDirectInputDevice8_SendForceFeedbackCommand( iface_w, flags ); return IDirectInputDevice8_SendForceFeedbackCommand( iface_w, flags );
} }
@ -504,21 +504,21 @@ static HRESULT WINAPI dinput_device_a_SendForceFeedbackCommand( IDirectInputDevi
static HRESULT WINAPI dinput_device_a_EnumCreatedEffectObjects( IDirectInputDevice8A *iface_a, LPDIENUMCREATEDEFFECTOBJECTSCALLBACK callback, static HRESULT WINAPI dinput_device_a_EnumCreatedEffectObjects( IDirectInputDevice8A *iface_a, LPDIENUMCREATEDEFFECTOBJECTSCALLBACK callback,
void *ref, DWORD flags ) void *ref, DWORD flags )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8A( iface_a ); struct dinput_device *impl = impl_from_IDirectInputDevice8A( iface_a );
IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl ); IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl );
return IDirectInputDevice8_EnumCreatedEffectObjects( iface_w, callback, ref, flags ); return IDirectInputDevice8_EnumCreatedEffectObjects( iface_w, callback, ref, flags );
} }
static HRESULT WINAPI dinput_device_a_Escape( IDirectInputDevice8A *iface_a, DIEFFESCAPE *escape ) static HRESULT WINAPI dinput_device_a_Escape( IDirectInputDevice8A *iface_a, DIEFFESCAPE *escape )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8A( iface_a ); struct dinput_device *impl = impl_from_IDirectInputDevice8A( iface_a );
IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl ); IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl );
return IDirectInputDevice8_Escape( iface_w, escape ); return IDirectInputDevice8_Escape( iface_w, escape );
} }
static HRESULT WINAPI dinput_device_a_Poll( IDirectInputDevice8A *iface_a ) static HRESULT WINAPI dinput_device_a_Poll( IDirectInputDevice8A *iface_a )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8A( iface_a ); struct dinput_device *impl = impl_from_IDirectInputDevice8A( iface_a );
IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl ); IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl );
return IDirectInputDevice8_Poll( iface_w ); return IDirectInputDevice8_Poll( iface_w );
} }
@ -526,7 +526,7 @@ static HRESULT WINAPI dinput_device_a_Poll( IDirectInputDevice8A *iface_a )
static HRESULT WINAPI dinput_device_a_SendDeviceData( IDirectInputDevice8A *iface_a, DWORD count, const DIDEVICEOBJECTDATA *data, static HRESULT WINAPI dinput_device_a_SendDeviceData( IDirectInputDevice8A *iface_a, DWORD count, const DIDEVICEOBJECTDATA *data,
DWORD *inout, DWORD flags ) DWORD *inout, DWORD flags )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8A( iface_a ); struct dinput_device *impl = impl_from_IDirectInputDevice8A( iface_a );
IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl ); IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl );
return IDirectInputDevice8_SendDeviceData( iface_w, count, data, inout, flags ); return IDirectInputDevice8_SendDeviceData( iface_w, count, data, inout, flags );
} }
@ -534,7 +534,7 @@ static HRESULT WINAPI dinput_device_a_SendDeviceData( IDirectInputDevice8A *ifac
static HRESULT WINAPI dinput_device_a_EnumEffectsInFile( IDirectInputDevice8A *iface_a, const char *filename_a, LPDIENUMEFFECTSINFILECALLBACK callback, static HRESULT WINAPI dinput_device_a_EnumEffectsInFile( IDirectInputDevice8A *iface_a, const char *filename_a, LPDIENUMEFFECTSINFILECALLBACK callback,
void *ref, DWORD flags ) void *ref, DWORD flags )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8A( iface_a ); struct dinput_device *impl = impl_from_IDirectInputDevice8A( iface_a );
IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl ); IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl );
WCHAR buffer[MAX_PATH], *filename_w = buffer; WCHAR buffer[MAX_PATH], *filename_w = buffer;
@ -547,7 +547,7 @@ static HRESULT WINAPI dinput_device_a_EnumEffectsInFile( IDirectInputDevice8A *i
static HRESULT WINAPI dinput_device_a_WriteEffectToFile( IDirectInputDevice8A *iface_a, const char *filename_a, DWORD entries, static HRESULT WINAPI dinput_device_a_WriteEffectToFile( IDirectInputDevice8A *iface_a, const char *filename_a, DWORD entries,
DIFILEEFFECT *file_effect, DWORD flags ) DIFILEEFFECT *file_effect, DWORD flags )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8A( iface_a ); struct dinput_device *impl = impl_from_IDirectInputDevice8A( iface_a );
IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl ); IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl );
WCHAR buffer[MAX_PATH], *filename_w = buffer; WCHAR buffer[MAX_PATH], *filename_w = buffer;
@ -560,7 +560,7 @@ static HRESULT WINAPI dinput_device_a_WriteEffectToFile( IDirectInputDevice8A *i
static HRESULT WINAPI dinput_device_a_BuildActionMap( IDirectInputDevice8A *iface_a, DIACTIONFORMATA *format_a, static HRESULT WINAPI dinput_device_a_BuildActionMap( IDirectInputDevice8A *iface_a, DIACTIONFORMATA *format_a,
const char *username_a, DWORD flags ) const char *username_a, DWORD flags )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8A( iface_a ); struct dinput_device *impl = impl_from_IDirectInputDevice8A( iface_a );
IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl ); IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl );
DIACTIONFORMATW format_w = {sizeof(format_w), sizeof(DIACTIONW)}; DIACTIONFORMATW format_w = {sizeof(format_w), sizeof(DIACTIONW)};
HRESULT hr; HRESULT hr;
@ -589,7 +589,7 @@ static HRESULT WINAPI dinput_device_a_BuildActionMap( IDirectInputDevice8A *ifac
static HRESULT WINAPI dinput_device_a_SetActionMap( IDirectInputDevice8A *iface_a, DIACTIONFORMATA *format_a, static HRESULT WINAPI dinput_device_a_SetActionMap( IDirectInputDevice8A *iface_a, DIACTIONFORMATA *format_a,
const char *username_a, DWORD flags ) const char *username_a, DWORD flags )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8A( iface_a ); struct dinput_device *impl = impl_from_IDirectInputDevice8A( iface_a );
IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl ); IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl );
DIACTIONFORMATW format_w = {sizeof(format_w), sizeof(DIACTIONW)}; DIACTIONFORMATW format_w = {sizeof(format_w), sizeof(DIACTIONW)};
HRESULT hr; HRESULT hr;
@ -617,7 +617,7 @@ static HRESULT WINAPI dinput_device_a_SetActionMap( IDirectInputDevice8A *iface_
static HRESULT WINAPI dinput_device_a_GetImageInfo( IDirectInputDevice8A *iface_a, DIDEVICEIMAGEINFOHEADERA *header_a ) static HRESULT WINAPI dinput_device_a_GetImageInfo( IDirectInputDevice8A *iface_a, DIDEVICEIMAGEINFOHEADERA *header_a )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8A( iface_a ); struct dinput_device *impl = impl_from_IDirectInputDevice8A( iface_a );
IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl ); IDirectInputDevice8W *iface_w = IDirectInputDevice8W_from_impl( impl );
DIDEVICEIMAGEINFOHEADERW header_w = {sizeof(header_w), sizeof(DIDEVICEIMAGEINFOW)}; DIDEVICEIMAGEINFOHEADERW header_w = {sizeof(header_w), sizeof(DIDEVICEIMAGEINFOW)};
HRESULT hr; HRESULT hr;

View File

@ -53,16 +53,16 @@ WINE_DEFAULT_DEBUG_CHANNEL(dinput);
*/ */
DEFINE_GUID( dinput_pidvid_guid, 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 'P', 'I', 'D', 'V', 'I', 'D' ); DEFINE_GUID( dinput_pidvid_guid, 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 'P', 'I', 'D', 'V', 'I', 'D' );
static inline IDirectInputDeviceImpl *impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface) static inline struct dinput_device *impl_from_IDirectInputDevice8W( IDirectInputDevice8W *iface )
{ {
return CONTAINING_RECORD(iface, IDirectInputDeviceImpl, IDirectInputDevice8W_iface); return CONTAINING_RECORD( iface, struct dinput_device, IDirectInputDevice8W_iface );
} }
static inline IDirectInputDevice8A *IDirectInputDevice8A_from_impl(IDirectInputDeviceImpl *This) static inline IDirectInputDevice8A *IDirectInputDevice8A_from_impl( struct dinput_device *This )
{ {
return &This->IDirectInputDevice8A_iface; return &This->IDirectInputDevice8A_iface;
} }
static inline IDirectInputDevice8W *IDirectInputDevice8W_from_impl(IDirectInputDeviceImpl *This) static inline IDirectInputDevice8W *IDirectInputDevice8W_from_impl( struct dinput_device *This )
{ {
return &This->IDirectInputDevice8W_iface; return &This->IDirectInputDevice8W_iface;
} }
@ -636,7 +636,7 @@ static int id_to_offset(const DataFormat *df, int id)
return obj >= 0 && df->offsets ? df->offsets[obj] : -1; return obj >= 0 && df->offsets ? df->offsets[obj] : -1;
} }
static DWORD semantic_to_obj_id(IDirectInputDeviceImpl* This, DWORD dwSemantic) static DWORD semantic_to_obj_id( struct dinput_device *This, DWORD dwSemantic )
{ {
DWORD type = (0x0000ff00 & dwSemantic) >> 8; DWORD type = (0x0000ff00 & dwSemantic) >> 8;
BOOL byofs = (dwSemantic & 0x80000000) != 0; BOOL byofs = (dwSemantic & 0x80000000) != 0;
@ -730,7 +730,7 @@ static HRESULT save_mapping_settings(IDirectInputDevice8W *iface, LPDIACTIONFORM
return DI_OK; return DI_OK;
} }
static BOOL load_mapping_settings(IDirectInputDeviceImpl *This, LPDIACTIONFORMATW lpdiaf, const WCHAR *username) static BOOL load_mapping_settings( struct dinput_device *This, LPDIACTIONFORMATW lpdiaf, const WCHAR *username )
{ {
HKEY hkey; HKEY hkey;
WCHAR *guid_str; WCHAR *guid_str;
@ -774,7 +774,7 @@ static BOOL load_mapping_settings(IDirectInputDeviceImpl *This, LPDIACTIONFORMAT
return mapped > 0; return mapped > 0;
} }
static BOOL set_app_data(IDirectInputDeviceImpl *dev, int offset, UINT_PTR app_data) static BOOL set_app_data( struct dinput_device *dev, int offset, UINT_PTR app_data )
{ {
int num_actions = dev->num_actions; int num_actions = dev->num_actions;
ActionMap *action_map = dev->action_map, *target_map = NULL; ActionMap *action_map = dev->action_map, *target_map = NULL;
@ -821,7 +821,7 @@ static BOOL set_app_data(IDirectInputDeviceImpl *dev, int offset, UINT_PTR app_d
void queue_event( IDirectInputDevice8W *iface, int inst_id, DWORD data, DWORD time, DWORD seq ) void queue_event( IDirectInputDevice8W *iface, int inst_id, DWORD data, DWORD time, DWORD seq )
{ {
static ULONGLONG notify_ms = 0; static ULONGLONG notify_ms = 0;
IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8W( iface ); struct dinput_device *This = impl_from_IDirectInputDevice8W( iface );
int next_pos, ofs = id_to_offset(&This->data_format, inst_id); int next_pos, ofs = id_to_offset(&This->data_format, inst_id);
ULONGLONG time_ms = GetTickCount64(); ULONGLONG time_ms = GetTickCount64();
@ -873,9 +873,9 @@ void queue_event( IDirectInputDevice8W *iface, int inst_id, DWORD data, DWORD ti
* Acquire * Acquire
*/ */
static HRESULT WINAPI IDirectInputDevice2WImpl_Acquire( IDirectInputDevice8W *iface ) static HRESULT WINAPI dinput_device_Acquire( IDirectInputDevice8W *iface )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8W( iface ); struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface );
HRESULT hr = DI_OK; HRESULT hr = DI_OK;
TRACE( "iface %p.\n", iface ); TRACE( "iface %p.\n", iface );
@ -905,9 +905,9 @@ static HRESULT WINAPI IDirectInputDevice2WImpl_Acquire( IDirectInputDevice8W *if
* Unacquire * Unacquire
*/ */
static HRESULT WINAPI IDirectInputDevice2WImpl_Unacquire( IDirectInputDevice8W *iface ) static HRESULT WINAPI dinput_device_Unacquire( IDirectInputDevice8W *iface )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8W( iface ); struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface );
HRESULT hr = DI_OK; HRESULT hr = DI_OK;
TRACE( "iface %p.\n", iface ); TRACE( "iface %p.\n", iface );
@ -929,9 +929,9 @@ static HRESULT WINAPI IDirectInputDevice2WImpl_Unacquire( IDirectInputDevice8W *
* IDirectInputDeviceA * IDirectInputDeviceA
*/ */
static HRESULT WINAPI IDirectInputDevice2WImpl_SetDataFormat( IDirectInputDevice8W *iface, const DIDATAFORMAT *format ) static HRESULT WINAPI dinput_device_SetDataFormat( IDirectInputDevice8W *iface, const DIDATAFORMAT *format )
{ {
IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8W(iface); struct dinput_device *This = impl_from_IDirectInputDevice8W( iface );
HRESULT res = DI_OK; HRESULT res = DI_OK;
TRACE( "iface %p, format %p.\n", iface, format ); TRACE( "iface %p, format %p.\n", iface, format );
@ -961,10 +961,9 @@ static HRESULT WINAPI IDirectInputDevice2WImpl_SetDataFormat( IDirectInputDevice
* *
* Set cooperative level and the source window for the events. * Set cooperative level and the source window for the events.
*/ */
static HRESULT WINAPI IDirectInputDevice2WImpl_SetCooperativeLevel( IDirectInputDevice8W *iface, static HRESULT WINAPI dinput_device_SetCooperativeLevel( IDirectInputDevice8W *iface, HWND hwnd, DWORD flags )
HWND hwnd, DWORD flags )
{ {
IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8W(iface); struct dinput_device *This = impl_from_IDirectInputDevice8W( iface );
HRESULT hr; HRESULT hr;
TRACE( "iface %p, hwnd %p, flags %#x.\n", iface, hwnd, flags ); TRACE( "iface %p, hwnd %p, flags %#x.\n", iface, hwnd, flags );
@ -1003,9 +1002,9 @@ static HRESULT WINAPI IDirectInputDevice2WImpl_SetCooperativeLevel( IDirectInput
return hr; return hr;
} }
static HRESULT WINAPI IDirectInputDevice2WImpl_GetDeviceInfo( IDirectInputDevice8W *iface, DIDEVICEINSTANCEW *instance ) static HRESULT WINAPI dinput_device_GetDeviceInfo( IDirectInputDevice8W *iface, DIDEVICEINSTANCEW *instance )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8W( iface ); struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface );
DWORD size; DWORD size;
TRACE( "iface %p, instance %p.\n", iface, instance ); TRACE( "iface %p, instance %p.\n", iface, instance );
@ -1025,9 +1024,9 @@ static HRESULT WINAPI IDirectInputDevice2WImpl_GetDeviceInfo( IDirectInputDevice
/****************************************************************************** /******************************************************************************
* SetEventNotification : specifies event to be sent on state change * SetEventNotification : specifies event to be sent on state change
*/ */
static HRESULT WINAPI IDirectInputDevice2WImpl_SetEventNotification( IDirectInputDevice8W *iface, HANDLE event ) static HRESULT WINAPI dinput_device_SetEventNotification( IDirectInputDevice8W *iface, HANDLE event )
{ {
IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8W(iface); struct dinput_device *This = impl_from_IDirectInputDevice8W( iface );
TRACE( "iface %p, event %p.\n", iface, event ); TRACE( "iface %p, event %p.\n", iface, event );
@ -1037,9 +1036,9 @@ static HRESULT WINAPI IDirectInputDevice2WImpl_SetEventNotification( IDirectInpu
return DI_OK; return DI_OK;
} }
void direct_input_device_destroy( IDirectInputDevice8W *iface ) void dinput_device_destroy( IDirectInputDevice8W *iface )
{ {
IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8W(iface); struct dinput_device *This = impl_from_IDirectInputDevice8W( iface );
TRACE( "iface %p.\n", iface ); TRACE( "iface %p.\n", iface );
@ -1064,9 +1063,9 @@ void direct_input_device_destroy( IDirectInputDevice8W *iface )
free( This ); free( This );
} }
static ULONG WINAPI IDirectInputDevice2WImpl_Release( IDirectInputDevice8W *iface ) static ULONG WINAPI dinput_device_Release( IDirectInputDevice8W *iface )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8W( iface ); struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface );
ULONG ref = InterlockedDecrement( &impl->ref ); ULONG ref = InterlockedDecrement( &impl->ref );
TRACE( "iface %p, ref %u.\n", iface, ref ); TRACE( "iface %p, ref %u.\n", iface, ref );
@ -1074,15 +1073,15 @@ static ULONG WINAPI IDirectInputDevice2WImpl_Release( IDirectInputDevice8W *ifac
if (!ref) if (!ref)
{ {
if (impl->vtbl->release) impl->vtbl->release( iface ); if (impl->vtbl->release) impl->vtbl->release( iface );
else direct_input_device_destroy( iface ); else dinput_device_destroy( iface );
} }
return ref; return ref;
} }
static HRESULT WINAPI IDirectInputDevice2WImpl_GetCapabilities( IDirectInputDevice8W *iface, DIDEVCAPS *caps ) static HRESULT WINAPI dinput_device_GetCapabilities( IDirectInputDevice8W *iface, DIDEVCAPS *caps )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8W( iface ); struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface );
DWORD size; DWORD size;
TRACE( "iface %p, caps %p.\n", iface, caps ); TRACE( "iface %p, caps %p.\n", iface, caps );
@ -1099,10 +1098,9 @@ static HRESULT WINAPI IDirectInputDevice2WImpl_GetCapabilities( IDirectInputDevi
return DI_OK; return DI_OK;
} }
static HRESULT WINAPI IDirectInputDevice2WImpl_QueryInterface( IDirectInputDevice8W *iface, static HRESULT WINAPI dinput_device_QueryInterface( IDirectInputDevice8W *iface, const GUID *iid, void **out )
const GUID *iid, void **out )
{ {
IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8W(iface); struct dinput_device *This = impl_from_IDirectInputDevice8W( iface );
TRACE( "iface %p, iid %s, out %p.\n", iface, debugstr_guid( iid ), out ); TRACE( "iface %p, iid %s, out %p.\n", iface, debugstr_guid( iid ), out );
@ -1131,17 +1129,17 @@ static HRESULT WINAPI IDirectInputDevice2WImpl_QueryInterface( IDirectInputDevic
return E_NOINTERFACE; return E_NOINTERFACE;
} }
static ULONG WINAPI IDirectInputDevice2WImpl_AddRef( IDirectInputDevice8W *iface ) static ULONG WINAPI dinput_device_AddRef( IDirectInputDevice8W *iface )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8W( iface ); struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface );
ULONG ref = InterlockedIncrement( &impl->ref ); ULONG ref = InterlockedIncrement( &impl->ref );
TRACE( "iface %p, ref %u.\n", iface, ref ); TRACE( "iface %p, ref %u.\n", iface, ref );
return ref; return ref;
} }
static HRESULT WINAPI IDirectInputDevice2WImpl_EnumObjects( IDirectInputDevice8W *iface, static HRESULT WINAPI dinput_device_EnumObjects( IDirectInputDevice8W *iface,
LPDIENUMDEVICEOBJECTSCALLBACKW callback, LPDIENUMDEVICEOBJECTSCALLBACKW callback,
void *context, DWORD flags ) void *context, DWORD flags )
{ {
static const DIPROPHEADER filter = static const DIPROPHEADER filter =
{ {
@ -1149,7 +1147,7 @@ static HRESULT WINAPI IDirectInputDevice2WImpl_EnumObjects( IDirectInputDevice8W
.dwHeaderSize = sizeof(filter), .dwHeaderSize = sizeof(filter),
.dwHow = DIPH_DEVICE, .dwHow = DIPH_DEVICE,
}; };
struct IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8W( iface ); struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface );
HRESULT hr; HRESULT hr;
TRACE( "iface %p, callback %p, context %p, flags %#x.\n", iface, callback, context, flags ); TRACE( "iface %p, callback %p, context %p, flags %#x.\n", iface, callback, context, flags );
@ -1186,7 +1184,7 @@ static HRESULT WINAPI IDirectInputDevice2WImpl_EnumObjects( IDirectInputDevice8W
return DI_OK; return DI_OK;
} }
static HRESULT enum_object_filter_init( IDirectInputDeviceImpl *impl, DIPROPHEADER *filter ) static HRESULT enum_object_filter_init( struct dinput_device *impl, DIPROPHEADER *filter )
{ {
DIDATAFORMAT *format = impl->data_format.wine_df; DIDATAFORMAT *format = impl->data_format.wine_df;
int i, *offsets = impl->data_format.offsets; int i, *offsets = impl->data_format.offsets;
@ -1210,10 +1208,9 @@ static BOOL CALLBACK find_object( const DIDEVICEOBJECTINSTANCEW *instance, void
return DIENUM_STOP; return DIENUM_STOP;
} }
static HRESULT WINAPI IDirectInputDevice2WImpl_GetProperty( IDirectInputDevice8W *iface, static HRESULT WINAPI dinput_device_GetProperty( IDirectInputDevice8W *iface, const GUID *guid, DIPROPHEADER *header )
const GUID *guid, DIPROPHEADER *header )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8W( iface ); struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface );
DWORD object_mask = DIDFT_AXIS | DIDFT_BUTTON | DIDFT_POV; DWORD object_mask = DIDFT_AXIS | DIDFT_BUTTON | DIDFT_POV;
DIDEVICEOBJECTINSTANCEW instance; DIDEVICEOBJECTINSTANCEW instance;
DIPROPHEADER filter; DIPROPHEADER filter;
@ -1329,16 +1326,16 @@ struct set_object_property_params
static BOOL CALLBACK set_object_property( const DIDEVICEOBJECTINSTANCEW *instance, void *context ) static BOOL CALLBACK set_object_property( const DIDEVICEOBJECTINSTANCEW *instance, void *context )
{ {
struct set_object_property_params *params = context; struct set_object_property_params *params = context;
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8W( params->iface ); struct dinput_device *impl = impl_from_IDirectInputDevice8W( params->iface );
impl->vtbl->set_property( params->iface, params->property, params->header, instance ); impl->vtbl->set_property( params->iface, params->property, params->header, instance );
return DIENUM_CONTINUE; return DIENUM_CONTINUE;
} }
static HRESULT WINAPI IDirectInputDevice2WImpl_SetProperty( IDirectInputDevice8W *iface, static HRESULT WINAPI dinput_device_SetProperty( IDirectInputDevice8W *iface, const GUID *guid,
const GUID *guid, const DIPROPHEADER *header ) const DIPROPHEADER *header )
{ {
struct set_object_property_params params = {.iface = iface, .header = header, .property = LOWORD( guid )}; struct set_object_property_params params = {.iface = iface, .header = header, .property = LOWORD( guid )};
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8W( iface ); struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface );
DIPROPHEADER filter; DIPROPHEADER filter;
HRESULT hr; HRESULT hr;
@ -1462,7 +1459,7 @@ static HRESULT WINAPI IDirectInputDevice2WImpl_SetProperty( IDirectInputDevice8W
return DI_OK; return DI_OK;
} }
static void dinput_device_set_username( IDirectInputDeviceImpl *impl, const DIPROPSTRING *value ) static void dinput_device_set_username( struct dinput_device *impl, const DIPROPSTRING *value )
{ {
struct DevicePlayer *device_player; struct DevicePlayer *device_player;
BOOL found = FALSE; BOOL found = FALSE;
@ -1495,11 +1492,10 @@ static BOOL CALLBACK get_object_info( const DIDEVICEOBJECTINSTANCEW *instance, v
return DIENUM_STOP; return DIENUM_STOP;
} }
static HRESULT WINAPI IDirectInputDevice2WImpl_GetObjectInfo( IDirectInputDevice8W *iface, static HRESULT WINAPI dinput_device_GetObjectInfo( IDirectInputDevice8W *iface,
DIDEVICEOBJECTINSTANCEW *instance, DIDEVICEOBJECTINSTANCEW *instance, DWORD obj, DWORD how )
DWORD obj, DWORD how )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8W( iface ); struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface );
DIPROPHEADER filter = DIPROPHEADER filter =
{ {
.dwSize = sizeof(filter), .dwSize = sizeof(filter),
@ -1529,9 +1525,9 @@ static BOOL CALLBACK reset_axis_data( const DIDEVICEOBJECTINSTANCEW *instance, v
return DIENUM_CONTINUE; return DIENUM_CONTINUE;
} }
static HRESULT WINAPI IDirectInputDevice2WImpl_GetDeviceState( IDirectInputDevice8W *iface, DWORD size, void *data ) static HRESULT WINAPI dinput_device_GetDeviceState( IDirectInputDevice8W *iface, DWORD size, void *data )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8W( iface ); struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface );
DIPROPHEADER filter = DIPROPHEADER filter =
{ {
.dwSize = sizeof(filter), .dwSize = sizeof(filter),
@ -1564,10 +1560,10 @@ static HRESULT WINAPI IDirectInputDevice2WImpl_GetDeviceState( IDirectInputDevic
return hr; return hr;
} }
static HRESULT WINAPI IDirectInputDevice2WImpl_GetDeviceData( IDirectInputDevice8W *iface, DWORD size, static HRESULT WINAPI dinput_device_GetDeviceData( IDirectInputDevice8W *iface, DWORD size, DIDEVICEOBJECTDATA *data,
DIDEVICEOBJECTDATA *data, DWORD *count, DWORD flags ) DWORD *count, DWORD flags )
{ {
IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8W(iface); struct dinput_device *This = impl_from_IDirectInputDevice8W( iface );
HRESULT ret = DI_OK; HRESULT ret = DI_OK;
int len; int len;
@ -1618,25 +1614,25 @@ static HRESULT WINAPI IDirectInputDevice2WImpl_GetDeviceData( IDirectInputDevice
return ret; return ret;
} }
static HRESULT WINAPI IDirectInputDevice2WImpl_RunControlPanel( IDirectInputDevice8W *iface, HWND hwnd, DWORD flags ) static HRESULT WINAPI dinput_device_RunControlPanel( IDirectInputDevice8W *iface, HWND hwnd, DWORD flags )
{ {
FIXME( "iface %p, hwnd %p, flags %#x stub!\n", iface, hwnd, flags ); FIXME( "iface %p, hwnd %p, flags %#x stub!\n", iface, hwnd, flags );
return DI_OK; return DI_OK;
} }
static HRESULT WINAPI IDirectInputDevice2WImpl_Initialize( IDirectInputDevice8W *iface, HINSTANCE instance, static HRESULT WINAPI dinput_device_Initialize( IDirectInputDevice8W *iface, HINSTANCE instance,
DWORD version, const GUID *guid ) DWORD version, const GUID *guid )
{ {
FIXME( "iface %p, instance %p, version %#x, guid %s stub!\n", iface, instance, version, FIXME( "iface %p, instance %p, version %#x, guid %s stub!\n", iface, instance, version,
debugstr_guid( guid ) ); debugstr_guid( guid ) );
return DI_OK; return DI_OK;
} }
static HRESULT WINAPI IDirectInputDevice2WImpl_CreateEffect( IDirectInputDevice8W *iface, static HRESULT WINAPI dinput_device_CreateEffect( IDirectInputDevice8W *iface, const GUID *guid,
const GUID *guid, const DIEFFECT *params, const DIEFFECT *params, IDirectInputEffect **out,
IDirectInputEffect **out, IUnknown *outer ) IUnknown *outer )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8W( iface ); struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface );
DWORD flags = DIEP_ALLPARAMS; DWORD flags = DIEP_ALLPARAMS;
HRESULT hr; HRESULT hr;
@ -1665,9 +1661,8 @@ failed:
return hr; return hr;
} }
static HRESULT WINAPI IDirectInputDevice2WImpl_EnumEffects( IDirectInputDevice8W *iface, static HRESULT WINAPI dinput_device_EnumEffects( IDirectInputDevice8W *iface, LPDIENUMEFFECTSCALLBACKW callback,
LPDIENUMEFFECTSCALLBACKW callback, void *context, DWORD type )
void *context, DWORD type )
{ {
DIEFFECTINFOW info = {.dwSize = sizeof(info)}; DIEFFECTINFOW info = {.dwSize = sizeof(info)};
HRESULT hr; HRESULT hr;
@ -1737,10 +1732,10 @@ static HRESULT WINAPI IDirectInputDevice2WImpl_EnumEffects( IDirectInputDevice8W
return DI_OK; return DI_OK;
} }
static HRESULT WINAPI IDirectInputDevice2WImpl_GetEffectInfo( IDirectInputDevice8W *iface, static HRESULT WINAPI dinput_device_GetEffectInfo( IDirectInputDevice8W *iface, DIEFFECTINFOW *info,
DIEFFECTINFOW *info, const GUID *guid ) const GUID *guid )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8W( iface ); struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface );
TRACE( "iface %p, info %p, guid %s.\n", iface, info, debugstr_guid( guid ) ); TRACE( "iface %p, info %p, guid %s.\n", iface, info, debugstr_guid( guid ) );
@ -1751,16 +1746,16 @@ static HRESULT WINAPI IDirectInputDevice2WImpl_GetEffectInfo( IDirectInputDevice
return impl->vtbl->get_effect_info( iface, info, guid ); return impl->vtbl->get_effect_info( iface, info, guid );
} }
static HRESULT WINAPI IDirectInputDevice2WImpl_GetForceFeedbackState( IDirectInputDevice8W *iface, DWORD *out ) static HRESULT WINAPI dinput_device_GetForceFeedbackState( IDirectInputDevice8W *iface, DWORD *out )
{ {
FIXME( "iface %p, out %p stub!\n", iface, out ); FIXME( "iface %p, out %p stub!\n", iface, out );
if (!out) return E_POINTER; if (!out) return E_POINTER;
return DIERR_UNSUPPORTED; return DIERR_UNSUPPORTED;
} }
static HRESULT WINAPI IDirectInputDevice2WImpl_SendForceFeedbackCommand( IDirectInputDevice8W *iface, DWORD command ) static HRESULT WINAPI dinput_device_SendForceFeedbackCommand( IDirectInputDevice8W *iface, DWORD command )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8W( iface ); struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface );
HRESULT hr; HRESULT hr;
TRACE( "iface %p, flags %x.\n", iface, command ); TRACE( "iface %p, flags %x.\n", iface, command );
@ -1787,11 +1782,11 @@ static HRESULT WINAPI IDirectInputDevice2WImpl_SendForceFeedbackCommand( IDirect
return hr; return hr;
} }
static HRESULT WINAPI IDirectInputDevice2WImpl_EnumCreatedEffectObjects( IDirectInputDevice8W *iface, static HRESULT WINAPI dinput_device_EnumCreatedEffectObjects( IDirectInputDevice8W *iface,
LPDIENUMCREATEDEFFECTOBJECTSCALLBACK callback, LPDIENUMCREATEDEFFECTOBJECTSCALLBACK callback,
void *context, DWORD flags ) void *context, DWORD flags )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8W( iface ); struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface );
TRACE( "iface %p, callback %p, context %p, flags %#x.\n", iface, callback, context, flags ); TRACE( "iface %p, callback %p, context %p, flags %#x.\n", iface, callback, context, flags );
@ -1803,15 +1798,15 @@ static HRESULT WINAPI IDirectInputDevice2WImpl_EnumCreatedEffectObjects( IDirect
return impl->vtbl->enum_created_effect_objects( iface, callback, context, flags ); return impl->vtbl->enum_created_effect_objects( iface, callback, context, flags );
} }
static HRESULT WINAPI IDirectInputDevice2WImpl_Escape( IDirectInputDevice8W *iface, DIEFFESCAPE *escape ) static HRESULT WINAPI dinput_device_Escape( IDirectInputDevice8W *iface, DIEFFESCAPE *escape )
{ {
FIXME( "iface %p, escape %p stub!\n", iface, escape ); FIXME( "iface %p, escape %p stub!\n", iface, escape );
return DI_OK; return DI_OK;
} }
static HRESULT WINAPI IDirectInputDevice2WImpl_Poll( IDirectInputDevice8W *iface ) static HRESULT WINAPI dinput_device_Poll( IDirectInputDevice8W *iface )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8W( iface ); struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface );
HRESULT hr = DI_NOEFFECT; HRESULT hr = DI_NOEFFECT;
EnterCriticalSection( &impl->crit ); EnterCriticalSection( &impl->crit );
@ -1823,38 +1818,34 @@ static HRESULT WINAPI IDirectInputDevice2WImpl_Poll( IDirectInputDevice8W *iface
return DI_OK; return DI_OK;
} }
static HRESULT WINAPI IDirectInputDevice2WImpl_SendDeviceData( IDirectInputDevice8W *iface, DWORD size, static HRESULT WINAPI dinput_device_SendDeviceData( IDirectInputDevice8W *iface, DWORD size,
const DIDEVICEOBJECTDATA *data, const DIDEVICEOBJECTDATA *data, DWORD *count, DWORD flags )
DWORD *count, DWORD flags )
{ {
FIXME( "iface %p, size %u, data %p, count %p, flags %#x stub!\n", iface, size, data, count, flags ); FIXME( "iface %p, size %u, data %p, count %p, flags %#x stub!\n", iface, size, data, count, flags );
return DI_OK; return DI_OK;
} }
static HRESULT WINAPI IDirectInputDevice7WImpl_EnumEffectsInFile( IDirectInputDevice8W *iface, static HRESULT WINAPI dinput_device_EnumEffectsInFile( IDirectInputDevice8W *iface, const WCHAR *filename,
const WCHAR *filename, LPDIENUMEFFECTSINFILECALLBACK callback,
LPDIENUMEFFECTSINFILECALLBACK callback, void *context, DWORD flags )
void *context, DWORD flags )
{ {
FIXME( "iface %p, filename %s, callback %p, context %p, flags %#x stub!\n", iface, FIXME( "iface %p, filename %s, callback %p, context %p, flags %#x stub!\n", iface,
debugstr_w(filename), callback, context, flags ); debugstr_w(filename), callback, context, flags );
return DI_OK; return DI_OK;
} }
static HRESULT WINAPI IDirectInputDevice7WImpl_WriteEffectToFile( IDirectInputDevice8W *iface, static HRESULT WINAPI dinput_device_WriteEffectToFile( IDirectInputDevice8W *iface, const WCHAR *filename,
const WCHAR *filename, DWORD count, DWORD count, DIFILEEFFECT *effects, DWORD flags )
DIFILEEFFECT *effects, DWORD flags )
{ {
FIXME( "iface %p, filename %s, count %u, effects %p, flags %#x stub!\n", iface, FIXME( "iface %p, filename %s, count %u, effects %p, flags %#x stub!\n", iface,
debugstr_w(filename), count, effects, flags ); debugstr_w(filename), count, effects, flags );
return DI_OK; return DI_OK;
} }
static HRESULT WINAPI IDirectInputDevice8WImpl_BuildActionMap( IDirectInputDevice8W *iface, static HRESULT WINAPI dinput_device_BuildActionMap( IDirectInputDevice8W *iface, DIACTIONFORMATW *format,
DIACTIONFORMATW *format, const WCHAR *username, DWORD flags )
const WCHAR *username, DWORD flags )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8W( iface ); struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface );
BOOL load_success = FALSE, has_actions = FALSE; BOOL load_success = FALSE, has_actions = FALSE;
DWORD genre, username_len = MAX_PATH; DWORD genre, username_len = MAX_PATH;
WCHAR username_buf[MAX_PATH]; WCHAR username_buf[MAX_PATH];
@ -1938,10 +1929,10 @@ static HRESULT WINAPI IDirectInputDevice8WImpl_BuildActionMap( IDirectInputDevic
return DI_OK; return DI_OK;
} }
static HRESULT WINAPI IDirectInputDevice8WImpl_SetActionMap( IDirectInputDevice8W *iface, DIACTIONFORMATW *format, static HRESULT WINAPI dinput_device_SetActionMap( IDirectInputDevice8W *iface, DIACTIONFORMATW *format,
const WCHAR *username, DWORD flags ) const WCHAR *username, DWORD flags )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8W( iface ); struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface );
DIDATAFORMAT data_format; DIDATAFORMAT data_format;
DIOBJECTDATAFORMAT *obj_df = NULL; DIOBJECTDATAFORMAT *obj_df = NULL;
DIPROPDWORD dp; DIPROPDWORD dp;
@ -2061,8 +2052,7 @@ static HRESULT WINAPI IDirectInputDevice8WImpl_SetActionMap( IDirectInputDevice8
return DI_OK; return DI_OK;
} }
static HRESULT WINAPI IDirectInputDevice8WImpl_GetImageInfo( IDirectInputDevice8W *iface, static HRESULT WINAPI dinput_device_GetImageInfo( IDirectInputDevice8W *iface, DIDEVICEIMAGEINFOHEADERW *header )
DIDEVICEIMAGEINFOHEADERW *header )
{ {
FIXME( "iface %p, header %p stub!\n", iface, header ); FIXME( "iface %p, header %p stub!\n", iface, header );
return DI_OK; return DI_OK;
@ -2072,48 +2062,48 @@ extern const IDirectInputDevice8AVtbl dinput_device_a_vtbl;
static const IDirectInputDevice8WVtbl dinput_device_w_vtbl = static const IDirectInputDevice8WVtbl dinput_device_w_vtbl =
{ {
/*** IUnknown methods ***/ /*** IUnknown methods ***/
IDirectInputDevice2WImpl_QueryInterface, dinput_device_QueryInterface,
IDirectInputDevice2WImpl_AddRef, dinput_device_AddRef,
IDirectInputDevice2WImpl_Release, dinput_device_Release,
/*** IDirectInputDevice methods ***/ /*** IDirectInputDevice methods ***/
IDirectInputDevice2WImpl_GetCapabilities, dinput_device_GetCapabilities,
IDirectInputDevice2WImpl_EnumObjects, dinput_device_EnumObjects,
IDirectInputDevice2WImpl_GetProperty, dinput_device_GetProperty,
IDirectInputDevice2WImpl_SetProperty, dinput_device_SetProperty,
IDirectInputDevice2WImpl_Acquire, dinput_device_Acquire,
IDirectInputDevice2WImpl_Unacquire, dinput_device_Unacquire,
IDirectInputDevice2WImpl_GetDeviceState, dinput_device_GetDeviceState,
IDirectInputDevice2WImpl_GetDeviceData, dinput_device_GetDeviceData,
IDirectInputDevice2WImpl_SetDataFormat, dinput_device_SetDataFormat,
IDirectInputDevice2WImpl_SetEventNotification, dinput_device_SetEventNotification,
IDirectInputDevice2WImpl_SetCooperativeLevel, dinput_device_SetCooperativeLevel,
IDirectInputDevice2WImpl_GetObjectInfo, dinput_device_GetObjectInfo,
IDirectInputDevice2WImpl_GetDeviceInfo, dinput_device_GetDeviceInfo,
IDirectInputDevice2WImpl_RunControlPanel, dinput_device_RunControlPanel,
IDirectInputDevice2WImpl_Initialize, dinput_device_Initialize,
/*** IDirectInputDevice2 methods ***/ /*** IDirectInputDevice2 methods ***/
IDirectInputDevice2WImpl_CreateEffect, dinput_device_CreateEffect,
IDirectInputDevice2WImpl_EnumEffects, dinput_device_EnumEffects,
IDirectInputDevice2WImpl_GetEffectInfo, dinput_device_GetEffectInfo,
IDirectInputDevice2WImpl_GetForceFeedbackState, dinput_device_GetForceFeedbackState,
IDirectInputDevice2WImpl_SendForceFeedbackCommand, dinput_device_SendForceFeedbackCommand,
IDirectInputDevice2WImpl_EnumCreatedEffectObjects, dinput_device_EnumCreatedEffectObjects,
IDirectInputDevice2WImpl_Escape, dinput_device_Escape,
IDirectInputDevice2WImpl_Poll, dinput_device_Poll,
IDirectInputDevice2WImpl_SendDeviceData, dinput_device_SendDeviceData,
/*** IDirectInputDevice7 methods ***/ /*** IDirectInputDevice7 methods ***/
IDirectInputDevice7WImpl_EnumEffectsInFile, dinput_device_EnumEffectsInFile,
IDirectInputDevice7WImpl_WriteEffectToFile, dinput_device_WriteEffectToFile,
/*** IDirectInputDevice8 methods ***/ /*** IDirectInputDevice8 methods ***/
IDirectInputDevice8WImpl_BuildActionMap, dinput_device_BuildActionMap,
IDirectInputDevice8WImpl_SetActionMap, dinput_device_SetActionMap,
IDirectInputDevice8WImpl_GetImageInfo, dinput_device_GetImageInfo,
}; };
HRESULT direct_input_device_alloc( SIZE_T size, const struct dinput_device_vtbl *vtbl, HRESULT dinput_device_alloc( SIZE_T size, const struct dinput_device_vtbl *vtbl,
const GUID *guid, IDirectInputImpl *dinput, void **out ) const GUID *guid, IDirectInputImpl *dinput, void **out )
{ {
IDirectInputDeviceImpl *This; struct dinput_device *This;
DIDATAFORMAT *format; DIDATAFORMAT *format;
if (!(This = calloc( 1, size ))) return DIERR_OUTOFMEMORY; if (!(This = calloc( 1, size ))) return DIERR_OUTOFMEMORY;
@ -2157,7 +2147,7 @@ static const GUID *object_instance_guid( const DIDEVICEOBJECTINSTANCEW *instance
static BOOL CALLBACK enum_objects_init( const DIDEVICEOBJECTINSTANCEW *instance, void *data ) static BOOL CALLBACK enum_objects_init( const DIDEVICEOBJECTINSTANCEW *instance, void *data )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8W( data ); struct dinput_device *impl = impl_from_IDirectInputDevice8W( data );
DIDATAFORMAT *format = impl->data_format.wine_df; DIDATAFORMAT *format = impl->data_format.wine_df;
DIOBJECTDATAFORMAT *obj_format; DIOBJECTDATAFORMAT *obj_format;
@ -2188,9 +2178,9 @@ static BOOL CALLBACK enum_objects_init( const DIDEVICEOBJECTINSTANCEW *instance,
return DIENUM_CONTINUE; return DIENUM_CONTINUE;
} }
HRESULT direct_input_device_init( IDirectInputDevice8W *iface ) HRESULT dinput_device_init( IDirectInputDevice8W *iface )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8W( iface ); struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface );
DIDATAFORMAT *format = impl->data_format.wine_df; DIDATAFORMAT *format = impl->data_format.wine_df;
ULONG size; ULONG size;

View File

@ -76,8 +76,7 @@ struct dinput_device_vtbl
#define DEVICE_STATE_MAX_SIZE 1024 #define DEVICE_STATE_MAX_SIZE 1024
/* Device implementation */ /* Device implementation */
typedef struct IDirectInputDeviceImpl IDirectInputDeviceImpl; struct dinput_device
struct IDirectInputDeviceImpl
{ {
IDirectInputDevice8W IDirectInputDevice8W_iface; IDirectInputDevice8W IDirectInputDevice8W_iface;
IDirectInputDevice8A IDirectInputDevice8A_iface; IDirectInputDevice8A IDirectInputDevice8A_iface;
@ -117,10 +116,10 @@ struct IDirectInputDeviceImpl
BYTE device_state[DEVICE_STATE_MAX_SIZE]; BYTE device_state[DEVICE_STATE_MAX_SIZE];
}; };
extern HRESULT direct_input_device_alloc( SIZE_T size, const struct dinput_device_vtbl *vtbl, extern HRESULT dinput_device_alloc( SIZE_T size, const struct dinput_device_vtbl *vtbl, const GUID *guid,
const GUID *guid, IDirectInputImpl *dinput, void **out ) DECLSPEC_HIDDEN; IDirectInputImpl *dinput, void **out ) DECLSPEC_HIDDEN;
extern HRESULT direct_input_device_init( IDirectInputDevice8W *iface ); extern HRESULT dinput_device_init( IDirectInputDevice8W *iface );
extern void direct_input_device_destroy( IDirectInputDevice8W *iface ); extern void dinput_device_destroy( IDirectInputDevice8W *iface );
extern BOOL get_app_key(HKEY*, HKEY*) DECLSPEC_HIDDEN; extern BOOL get_app_key(HKEY*, HKEY*) DECLSPEC_HIDDEN;
extern DWORD get_config_key( HKEY, HKEY, const WCHAR *, WCHAR *, DWORD ) DECLSPEC_HIDDEN; extern DWORD get_config_key( HKEY, HKEY, const WCHAR *, WCHAR *, DWORD ) DECLSPEC_HIDDEN;

View File

@ -69,9 +69,9 @@ static inline IDirectInputImpl *impl_from_IDirectInput8W( IDirectInput8W *iface
return CONTAINING_RECORD( iface, IDirectInputImpl, IDirectInput8W_iface ); return CONTAINING_RECORD( iface, IDirectInputImpl, IDirectInput8W_iface );
} }
static inline IDirectInputDeviceImpl *impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface) static inline struct dinput_device *impl_from_IDirectInputDevice8W( IDirectInputDevice8W *iface )
{ {
return CONTAINING_RECORD(iface, IDirectInputDeviceImpl, IDirectInputDevice8W_iface); return CONTAINING_RECORD( iface, struct dinput_device, IDirectInputDevice8W_iface );
} }
HINSTANCE DINPUT_instance; HINSTANCE DINPUT_instance;
@ -89,32 +89,32 @@ static struct list acquired_device_list = LIST_INIT( acquired_device_list );
static HRESULT initialize_directinput_instance(IDirectInputImpl *This, DWORD dwVersion); static HRESULT initialize_directinput_instance(IDirectInputImpl *This, DWORD dwVersion);
static void uninitialize_directinput_instance(IDirectInputImpl *This); static void uninitialize_directinput_instance(IDirectInputImpl *This);
void dinput_hooks_acquire_device(LPDIRECTINPUTDEVICE8W iface) void dinput_hooks_acquire_device( IDirectInputDevice8W *iface )
{ {
IDirectInputDeviceImpl *dev = impl_from_IDirectInputDevice8W(iface); struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface );
EnterCriticalSection( &dinput_hook_crit ); EnterCriticalSection( &dinput_hook_crit );
if (IsEqualGUID( &dev->guid, &GUID_SysMouse )) if (IsEqualGUID( &impl->guid, &GUID_SysMouse ))
list_add_tail( dev->use_raw_input ? &acquired_rawmouse_list : &acquired_mouse_list, &dev->entry ); list_add_tail( impl->use_raw_input ? &acquired_rawmouse_list : &acquired_mouse_list, &impl->entry );
else if (IsEqualGUID( &dev->guid, &GUID_SysKeyboard )) else if (IsEqualGUID( &impl->guid, &GUID_SysKeyboard ))
list_add_tail( &acquired_keyboard_list, &dev->entry ); list_add_tail( &acquired_keyboard_list, &impl->entry );
else else
list_add_tail( &acquired_device_list, &dev->entry ); list_add_tail( &acquired_device_list, &impl->entry );
LeaveCriticalSection( &dinput_hook_crit ); LeaveCriticalSection( &dinput_hook_crit );
} }
void dinput_hooks_unacquire_device(LPDIRECTINPUTDEVICE8W iface) void dinput_hooks_unacquire_device( IDirectInputDevice8W *iface )
{ {
IDirectInputDeviceImpl *dev = impl_from_IDirectInputDevice8W(iface); struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface );
EnterCriticalSection( &dinput_hook_crit ); EnterCriticalSection( &dinput_hook_crit );
list_remove( &dev->entry ); list_remove( &impl->entry );
LeaveCriticalSection( &dinput_hook_crit ); LeaveCriticalSection( &dinput_hook_crit );
} }
static void dinput_device_internal_unacquire( IDirectInputDevice8W *iface ) static void dinput_device_internal_unacquire( IDirectInputDevice8W *iface )
{ {
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8W( iface ); struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface );
TRACE( "iface %p.\n", iface ); TRACE( "iface %p.\n", iface );
@ -422,7 +422,7 @@ static HRESULT WINAPI IDirectInputWImpl_QueryInterface( IDirectInput7W *iface, R
static LRESULT WINAPI di_em_win_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) static LRESULT WINAPI di_em_win_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{ {
IDirectInputDeviceImpl *dev; struct dinput_device *impl;
RAWINPUT ri; RAWINPUT ri;
UINT size = sizeof(ri); UINT size = sizeof(ri);
int rim = GET_RAWINPUT_CODE_WPARAM( wparam ); int rim = GET_RAWINPUT_CODE_WPARAM( wparam );
@ -437,8 +437,8 @@ static LRESULT WINAPI di_em_win_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPAR
else if (ri.header.dwType == RIM_TYPEMOUSE) else if (ri.header.dwType == RIM_TYPEMOUSE)
{ {
EnterCriticalSection( &dinput_hook_crit ); EnterCriticalSection( &dinput_hook_crit );
LIST_FOR_EACH_ENTRY( dev, &acquired_rawmouse_list, IDirectInputDeviceImpl, entry ) LIST_FOR_EACH_ENTRY( impl, &acquired_rawmouse_list, struct dinput_device, entry )
dinput_mouse_rawinput_hook( &dev->IDirectInputDevice8W_iface, wparam, lparam, &ri ); dinput_mouse_rawinput_hook( &impl->IDirectInputDevice8W_iface, wparam, lparam, &ri );
LeaveCriticalSection( &dinput_hook_crit ); LeaveCriticalSection( &dinput_hook_crit );
} }
} }
@ -1132,22 +1132,22 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
static LRESULT CALLBACK LL_hook_proc( int code, WPARAM wparam, LPARAM lparam ) static LRESULT CALLBACK LL_hook_proc( int code, WPARAM wparam, LPARAM lparam )
{ {
IDirectInputDeviceImpl *dev; struct dinput_device *impl;
int skip = 0; int skip = 0;
if (code != HC_ACTION) return CallNextHookEx( 0, code, wparam, lparam ); if (code != HC_ACTION) return CallNextHookEx( 0, code, wparam, lparam );
EnterCriticalSection( &dinput_hook_crit ); EnterCriticalSection( &dinput_hook_crit );
LIST_FOR_EACH_ENTRY( dev, &acquired_mouse_list, IDirectInputDeviceImpl, entry ) LIST_FOR_EACH_ENTRY( impl, &acquired_mouse_list, struct dinput_device, entry )
{ {
TRACE("calling dinput_mouse_hook (%p %lx %lx)\n", dev, wparam, lparam); TRACE( "calling dinput_mouse_hook (%p %lx %lx)\n", impl, wparam, lparam );
skip |= dinput_mouse_hook( &dev->IDirectInputDevice8W_iface, wparam, lparam ); skip |= dinput_mouse_hook( &impl->IDirectInputDevice8W_iface, wparam, lparam );
} }
LIST_FOR_EACH_ENTRY( dev, &acquired_keyboard_list, IDirectInputDeviceImpl, entry ) LIST_FOR_EACH_ENTRY( impl, &acquired_keyboard_list, struct dinput_device, entry )
{ {
if (dev->use_raw_input) continue; if (impl->use_raw_input) continue;
TRACE("calling dinput_keyboard_hook (%p %lx %lx)\n", dev, wparam, lparam); TRACE( "calling dinput_keyboard_hook (%p %lx %lx)\n", impl, wparam, lparam );
skip |= dinput_keyboard_hook( &dev->IDirectInputDevice8W_iface, wparam, lparam ); skip |= dinput_keyboard_hook( &impl->IDirectInputDevice8W_iface, wparam, lparam );
} }
LeaveCriticalSection( &dinput_hook_crit ); LeaveCriticalSection( &dinput_hook_crit );
@ -1156,7 +1156,7 @@ static LRESULT CALLBACK LL_hook_proc( int code, WPARAM wparam, LPARAM lparam )
static LRESULT CALLBACK callwndproc_proc( int code, WPARAM wparam, LPARAM lparam ) static LRESULT CALLBACK callwndproc_proc( int code, WPARAM wparam, LPARAM lparam )
{ {
IDirectInputDeviceImpl *dev, *next; struct dinput_device *impl, *next;
CWPSTRUCT *msg = (CWPSTRUCT *)lparam; CWPSTRUCT *msg = (CWPSTRUCT *)lparam;
HWND foreground; HWND foreground;
@ -1167,36 +1167,36 @@ static LRESULT CALLBACK callwndproc_proc( int code, WPARAM wparam, LPARAM lparam
foreground = GetForegroundWindow(); foreground = GetForegroundWindow();
EnterCriticalSection( &dinput_hook_crit ); EnterCriticalSection( &dinput_hook_crit );
LIST_FOR_EACH_ENTRY_SAFE( dev, next, &acquired_device_list, IDirectInputDeviceImpl, entry ) LIST_FOR_EACH_ENTRY_SAFE( impl, next, &acquired_device_list, struct dinput_device, entry )
{ {
if (msg->hwnd == dev->win && msg->hwnd != foreground) if (msg->hwnd == impl->win && msg->hwnd != foreground)
{ {
TRACE( "%p window is not foreground - unacquiring %p\n", dev->win, dev ); TRACE( "%p window is not foreground - unacquiring %p\n", impl->win, impl );
dinput_device_internal_unacquire( &dev->IDirectInputDevice8W_iface ); dinput_device_internal_unacquire( &impl->IDirectInputDevice8W_iface );
} }
} }
LIST_FOR_EACH_ENTRY_SAFE( dev, next, &acquired_mouse_list, IDirectInputDeviceImpl, entry ) LIST_FOR_EACH_ENTRY_SAFE( impl, next, &acquired_mouse_list, struct dinput_device, entry )
{ {
if (msg->hwnd == dev->win && msg->hwnd != foreground) if (msg->hwnd == impl->win && msg->hwnd != foreground)
{ {
TRACE( "%p window is not foreground - unacquiring %p\n", dev->win, dev ); TRACE( "%p window is not foreground - unacquiring %p\n", impl->win, impl );
dinput_device_internal_unacquire( &dev->IDirectInputDevice8W_iface ); dinput_device_internal_unacquire( &impl->IDirectInputDevice8W_iface );
} }
} }
LIST_FOR_EACH_ENTRY_SAFE( dev, next, &acquired_rawmouse_list, IDirectInputDeviceImpl, entry ) LIST_FOR_EACH_ENTRY_SAFE( impl, next, &acquired_rawmouse_list, struct dinput_device, entry )
{ {
if (msg->hwnd == dev->win && msg->hwnd != foreground) if (msg->hwnd == impl->win && msg->hwnd != foreground)
{ {
TRACE( "%p window is not foreground - unacquiring %p\n", dev->win, dev ); TRACE( "%p window is not foreground - unacquiring %p\n", impl->win, impl );
dinput_device_internal_unacquire( &dev->IDirectInputDevice8W_iface ); dinput_device_internal_unacquire( &impl->IDirectInputDevice8W_iface );
} }
} }
LIST_FOR_EACH_ENTRY_SAFE( dev, next, &acquired_keyboard_list, IDirectInputDeviceImpl, entry ) LIST_FOR_EACH_ENTRY_SAFE( impl, next, &acquired_keyboard_list, struct dinput_device, entry )
{ {
if (msg->hwnd == dev->win && msg->hwnd != foreground) if (msg->hwnd == impl->win && msg->hwnd != foreground)
{ {
TRACE( "%p window is not foreground - unacquiring %p\n", dev->win, dev ); TRACE( "%p window is not foreground - unacquiring %p\n", impl->win, impl );
dinput_device_internal_unacquire( &dev->IDirectInputDevice8W_iface ); dinput_device_internal_unacquire( &impl->IDirectInputDevice8W_iface );
} }
} }
LeaveCriticalSection( &dinput_hook_crit ); LeaveCriticalSection( &dinput_hook_crit );
@ -1207,7 +1207,7 @@ static LRESULT CALLBACK callwndproc_proc( int code, WPARAM wparam, LPARAM lparam
static DWORD WINAPI hook_thread_proc(void *param) static DWORD WINAPI hook_thread_proc(void *param)
{ {
static HHOOK kbd_hook, mouse_hook; static HHOOK kbd_hook, mouse_hook;
IDirectInputDeviceImpl *impl, *next; struct dinput_device *impl, *next;
SIZE_T events_count = 0; SIZE_T events_count = 0;
HANDLE finished_event; HANDLE finished_event;
HANDLE events[128]; HANDLE events[128];
@ -1228,7 +1228,7 @@ static DWORD WINAPI hook_thread_proc(void *param)
if (ret < events_count) if (ret < events_count)
{ {
EnterCriticalSection( &dinput_hook_crit ); EnterCriticalSection( &dinput_hook_crit );
LIST_FOR_EACH_ENTRY_SAFE( impl, next, &acquired_device_list, IDirectInputDeviceImpl, entry ) LIST_FOR_EACH_ENTRY_SAFE( impl, next, &acquired_device_list, struct dinput_device, entry )
{ {
if (impl->read_event == events[ret]) if (impl->read_event == events[ret])
{ {
@ -1265,7 +1265,7 @@ static DWORD WINAPI hook_thread_proc(void *param)
EnterCriticalSection( &dinput_hook_crit ); EnterCriticalSection( &dinput_hook_crit );
kbd_cnt = list_count( &acquired_keyboard_list ); kbd_cnt = list_count( &acquired_keyboard_list );
mice_cnt = list_count( &acquired_mouse_list ); mice_cnt = list_count( &acquired_mouse_list );
LIST_FOR_EACH_ENTRY( impl, &acquired_device_list, IDirectInputDeviceImpl, entry ) LIST_FOR_EACH_ENTRY( impl, &acquired_device_list, struct dinput_device, entry )
{ {
if (!impl->read_event || !impl->vtbl->read) continue; if (!impl->read_event || !impl->vtbl->read) continue;
if (events_count >= ARRAY_SIZE(events)) break; if (events_count >= ARRAY_SIZE(events)) break;
@ -1353,16 +1353,16 @@ static BOOL check_hook_thread(void)
return hook_thread_id != 0; return hook_thread_id != 0;
} }
void check_dinput_hooks(LPDIRECTINPUTDEVICE8W iface, BOOL acquired) void check_dinput_hooks( IDirectInputDevice8W *iface, BOOL acquired )
{ {
static HHOOK callwndproc_hook; static HHOOK callwndproc_hook;
static ULONG foreground_cnt; static ULONG foreground_cnt;
IDirectInputDeviceImpl *dev = impl_from_IDirectInputDevice8W(iface); struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface );
HANDLE hook_change_finished_event = NULL; HANDLE hook_change_finished_event = NULL;
EnterCriticalSection(&dinput_hook_crit); EnterCriticalSection(&dinput_hook_crit);
if (dev->dwCoopLevel & DISCL_FOREGROUND) if (impl->dwCoopLevel & DISCL_FOREGROUND)
{ {
if (acquired) if (acquired)
foreground_cnt++; foreground_cnt++;
@ -1386,29 +1386,29 @@ void check_dinput_hooks(LPDIRECTINPUTDEVICE8W iface, BOOL acquired)
hook_thread_event = NULL; hook_thread_event = NULL;
} }
if (dev->use_raw_input) if (impl->use_raw_input)
{ {
if (acquired) if (acquired)
{ {
dev->raw_device.dwFlags = 0; impl->raw_device.dwFlags = 0;
if (dev->dwCoopLevel & DISCL_BACKGROUND) if (impl->dwCoopLevel & DISCL_BACKGROUND)
dev->raw_device.dwFlags |= RIDEV_INPUTSINK; impl->raw_device.dwFlags |= RIDEV_INPUTSINK;
if (dev->dwCoopLevel & DISCL_EXCLUSIVE) if (impl->dwCoopLevel & DISCL_EXCLUSIVE)
dev->raw_device.dwFlags |= RIDEV_NOLEGACY; impl->raw_device.dwFlags |= RIDEV_NOLEGACY;
if ((dev->dwCoopLevel & DISCL_EXCLUSIVE) && dev->raw_device.usUsage == 2) if ((impl->dwCoopLevel & DISCL_EXCLUSIVE) && impl->raw_device.usUsage == 2)
dev->raw_device.dwFlags |= RIDEV_CAPTUREMOUSE; impl->raw_device.dwFlags |= RIDEV_CAPTUREMOUSE;
if ((dev->dwCoopLevel & DISCL_EXCLUSIVE) && dev->raw_device.usUsage == 6) if ((impl->dwCoopLevel & DISCL_EXCLUSIVE) && impl->raw_device.usUsage == 6)
dev->raw_device.dwFlags |= RIDEV_NOHOTKEYS; impl->raw_device.dwFlags |= RIDEV_NOHOTKEYS;
dev->raw_device.hwndTarget = di_em_win; impl->raw_device.hwndTarget = di_em_win;
} }
else else
{ {
dev->raw_device.dwFlags = RIDEV_REMOVE; impl->raw_device.dwFlags = RIDEV_REMOVE;
dev->raw_device.hwndTarget = NULL; impl->raw_device.hwndTarget = NULL;
} }
if (!RegisterRawInputDevices( &dev->raw_device, 1, sizeof(RAWINPUTDEVICE) )) if (!RegisterRawInputDevices( &impl->raw_device, 1, sizeof(RAWINPUTDEVICE) ))
WARN( "Unable to (un)register raw device %x:%x\n", dev->raw_device.usUsagePage, dev->raw_device.usUsage ); WARN( "Unable to (un)register raw device %x:%x\n", impl->raw_device.usUsagePage, impl->raw_device.usUsage );
} }
hook_change_finished_event = CreateEventW( NULL, FALSE, FALSE, NULL ); hook_change_finished_event = CreateEventW( NULL, FALSE, FALSE, NULL );

View File

@ -65,14 +65,14 @@ struct DevicePlayer {
struct list entry; struct list entry;
}; };
extern void dinput_hooks_acquire_device(LPDIRECTINPUTDEVICE8W iface); extern void dinput_hooks_acquire_device( IDirectInputDevice8W *iface );
extern void dinput_hooks_unacquire_device(LPDIRECTINPUTDEVICE8W iface); extern void dinput_hooks_unacquire_device( IDirectInputDevice8W *iface );
extern int dinput_mouse_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPARAM lparam ); extern int dinput_mouse_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPARAM lparam );
extern int dinput_keyboard_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPARAM lparam ); extern int dinput_keyboard_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPARAM lparam );
extern void dinput_mouse_rawinput_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPARAM lparam, extern void dinput_mouse_rawinput_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPARAM lparam,
RAWINPUT *raw ); RAWINPUT *raw );
extern void check_dinput_hooks(LPDIRECTINPUTDEVICE8W, BOOL) DECLSPEC_HIDDEN; extern void check_dinput_hooks( IDirectInputDevice8W *iface, BOOL acquired ) DECLSPEC_HIDDEN;
extern void check_dinput_events(void) DECLSPEC_HIDDEN; extern void check_dinput_events(void) DECLSPEC_HIDDEN;
extern HRESULT _configure_devices(IDirectInput8W *iface, LPDICONFIGUREDEVICESCALLBACK lpdiCallback, LPDICONFIGUREDEVICESPARAMSW lpdiCDParams, DWORD dwFlags, LPVOID pvRefData) DECLSPEC_HIDDEN; extern HRESULT _configure_devices(IDirectInput8W *iface, LPDICONFIGUREDEVICESCALLBACK lpdiCallback, LPDICONFIGUREDEVICESPARAMSW lpdiCDParams, DWORD dwFlags, LPVOID pvRefData) DECLSPEC_HIDDEN;

View File

@ -157,7 +157,7 @@ struct pid_set_ramp_force
struct hid_joystick struct hid_joystick
{ {
IDirectInputDeviceImpl base; struct dinput_device base;
LONG internal_ref; LONG internal_ref;
HANDLE device; HANDLE device;
@ -189,7 +189,7 @@ struct hid_joystick
static inline struct hid_joystick *impl_from_IDirectInputDevice8W( IDirectInputDevice8W *iface ) static inline struct hid_joystick *impl_from_IDirectInputDevice8W( IDirectInputDevice8W *iface )
{ {
return CONTAINING_RECORD( CONTAINING_RECORD( iface, IDirectInputDeviceImpl, IDirectInputDevice8W_iface ), return CONTAINING_RECORD( CONTAINING_RECORD( iface, struct dinput_device, IDirectInputDevice8W_iface ),
struct hid_joystick, base ); struct hid_joystick, base );
} }
@ -630,7 +630,7 @@ static void hid_joystick_release( IDirectInputDevice8W *iface )
HidD_FreePreparsedData( impl->preparsed ); HidD_FreePreparsedData( impl->preparsed );
CloseHandle( impl->base.read_event ); CloseHandle( impl->base.read_event );
CloseHandle( impl->device ); CloseHandle( impl->device );
direct_input_device_destroy( iface ); dinput_device_destroy( iface );
} }
} }
@ -1781,8 +1781,7 @@ HRESULT hid_joystick_create_device( IDirectInputImpl *dinput, const GUID *guid,
else else
return DIERR_DEVICENOTREG; return DIERR_DEVICENOTREG;
hr = direct_input_device_alloc( sizeof(struct hid_joystick), &hid_joystick_vtbl, hr = dinput_device_alloc( sizeof(struct hid_joystick), &hid_joystick_vtbl, guid, dinput, (void **)&impl );
guid, dinput, (void **)&impl );
if (FAILED(hr)) return hr; if (FAILED(hr)) return hr;
impl->base.crit.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": hid_joystick.base.crit"); impl->base.crit.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": hid_joystick.base.crit");
impl->base.dwCoopLevel = DISCL_NONEXCLUSIVE | DISCL_BACKGROUND; impl->base.dwCoopLevel = DISCL_NONEXCLUSIVE | DISCL_BACKGROUND;
@ -1856,8 +1855,7 @@ HRESULT hid_joystick_create_device( IDirectInputImpl *dinput, const GUID *guid,
impl->base.caps.dwFFDriverVersion = 1; impl->base.caps.dwFFDriverVersion = 1;
} }
if (FAILED(hr = direct_input_device_init( &impl->base.IDirectInputDevice8W_iface ))) if (FAILED(hr = dinput_device_init( &impl->base.IDirectInputDevice8W_iface ))) goto failed;
goto failed;
*out = &impl->base.IDirectInputDevice8W_iface; *out = &impl->base.IDirectInputDevice8W_iface;
return DI_OK; return DI_OK;

View File

@ -39,12 +39,13 @@ static const struct dinput_device_vtbl keyboard_vtbl;
typedef struct SysKeyboardImpl SysKeyboardImpl; typedef struct SysKeyboardImpl SysKeyboardImpl;
struct SysKeyboardImpl struct SysKeyboardImpl
{ {
struct IDirectInputDeviceImpl base; struct dinput_device base;
}; };
static inline SysKeyboardImpl *impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface) static inline SysKeyboardImpl *impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface)
{ {
return CONTAINING_RECORD(CONTAINING_RECORD(iface, IDirectInputDeviceImpl, IDirectInputDevice8W_iface), SysKeyboardImpl, base); return CONTAINING_RECORD( CONTAINING_RECORD( iface, struct dinput_device, IDirectInputDevice8W_iface ),
SysKeyboardImpl, base );
} }
static BYTE map_dik_code(DWORD scanCode, DWORD vkCode, DWORD subType, DWORD version) static BYTE map_dik_code(DWORD scanCode, DWORD vkCode, DWORD subType, DWORD version)
@ -184,8 +185,7 @@ HRESULT keyboard_create_device( IDirectInputImpl *dinput, const GUID *guid, IDir
*out = NULL; *out = NULL;
if (!IsEqualGUID( &GUID_SysKeyboard, guid )) return DIERR_DEVICENOTREG; if (!IsEqualGUID( &GUID_SysKeyboard, guid )) return DIERR_DEVICENOTREG;
if (FAILED(hr = direct_input_device_alloc( sizeof(SysKeyboardImpl), &keyboard_vtbl, if (FAILED(hr = dinput_device_alloc( sizeof(SysKeyboardImpl), &keyboard_vtbl, guid, dinput, (void **)&impl )))
guid, dinput, (void **)&impl )))
return hr; return hr;
impl->base.crit.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": SysKeyboardImpl*->base.crit"); impl->base.crit.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": SysKeyboardImpl*->base.crit");
@ -194,7 +194,7 @@ HRESULT keyboard_create_device( IDirectInputImpl *dinput, const GUID *guid, IDir
impl->base.caps.dwFirmwareRevision = 100; impl->base.caps.dwFirmwareRevision = 100;
impl->base.caps.dwHardwareRevision = 100; impl->base.caps.dwHardwareRevision = 100;
if (FAILED(hr = direct_input_device_init( &impl->base.IDirectInputDevice8W_iface ))) if (FAILED(hr = dinput_device_init( &impl->base.IDirectInputDevice8W_iface )))
{ {
IDirectInputDevice_Release( &impl->base.IDirectInputDevice8W_iface ); IDirectInputDevice_Release( &impl->base.IDirectInputDevice8W_iface );
return hr; return hr;

View File

@ -56,7 +56,7 @@ typedef enum
struct SysMouseImpl struct SysMouseImpl
{ {
struct IDirectInputDeviceImpl base; struct dinput_device base;
/* SysMouseAImpl */ /* SysMouseAImpl */
/* These are used in case of relative -> absolute transitions */ /* These are used in case of relative -> absolute transitions */
@ -72,7 +72,7 @@ struct SysMouseImpl
static inline SysMouseImpl *impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface) static inline SysMouseImpl *impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface)
{ {
return CONTAINING_RECORD(CONTAINING_RECORD(iface, IDirectInputDeviceImpl, IDirectInputDevice8W_iface), SysMouseImpl, base); return CONTAINING_RECORD( CONTAINING_RECORD( iface, struct dinput_device, IDirectInputDevice8W_iface ), SysMouseImpl, base );
} }
HRESULT mouse_enum_device( DWORD type, DWORD flags, DIDEVICEINSTANCEW *instance, DWORD version, int index ) HRESULT mouse_enum_device( DWORD type, DWORD flags, DIDEVICEINSTANCEW *instance, DWORD version, int index )
@ -116,8 +116,7 @@ HRESULT mouse_create_device( IDirectInputImpl *dinput, const GUID *guid, IDirect
*out = NULL; *out = NULL;
if (!IsEqualGUID( &GUID_SysMouse, guid )) return DIERR_DEVICENOTREG; if (!IsEqualGUID( &GUID_SysMouse, guid )) return DIERR_DEVICENOTREG;
if (FAILED(hr = direct_input_device_alloc( sizeof(SysMouseImpl), &mouse_vtbl, if (FAILED(hr = dinput_device_alloc( sizeof(SysMouseImpl), &mouse_vtbl, guid, dinput, (void **)&impl )))
guid, dinput, (void **)&impl )))
return hr; return hr;
impl->base.crit.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": SysMouseImpl*->base.crit"); impl->base.crit.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": SysMouseImpl*->base.crit");
@ -136,7 +135,7 @@ HRESULT mouse_create_device( IDirectInputImpl *dinput, const GUID *guid, IDirect
if (appkey) RegCloseKey(appkey); if (appkey) RegCloseKey(appkey);
if (hkey) RegCloseKey(hkey); if (hkey) RegCloseKey(hkey);
if (FAILED(hr = direct_input_device_init( &impl->base.IDirectInputDevice8W_iface ))) if (FAILED(hr = dinput_device_init( &impl->base.IDirectInputDevice8W_iface )))
{ {
IDirectInputDevice_Release( &impl->base.IDirectInputDevice8W_iface ); IDirectInputDevice_Release( &impl->base.IDirectInputDevice8W_iface );
return hr; return hr;