Commit 1b3fab9b authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

dinput: Remove outdated and superfluous comments.

parent e091a7b8
...@@ -19,12 +19,6 @@ ...@@ -19,12 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
/* This file contains all the Device specific functions that can be used as stubs
by real device implementations.
It also contains all the helper functions.
*/
#include <stdarg.h> #include <stdarg.h>
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
...@@ -87,9 +81,6 @@ static inline BOOL is_exclusively_acquired( struct dinput_device *device ) ...@@ -87,9 +81,6 @@ static inline BOOL is_exclusively_acquired( struct dinput_device *device )
return device->status == STATUS_ACQUIRED && (device->dwCoopLevel & DISCL_EXCLUSIVE); return device->status == STATUS_ACQUIRED && (device->dwCoopLevel & DISCL_EXCLUSIVE);
} }
/******************************************************************************
* Various debugging tools
*/
static void _dump_cooperativelevel_DI(DWORD dwFlags) { static void _dump_cooperativelevel_DI(DWORD dwFlags) {
if (TRACE_ON(dinput)) { if (TRACE_ON(dinput)) {
unsigned int i; unsigned int i;
...@@ -113,9 +104,6 @@ static void _dump_cooperativelevel_DI(DWORD dwFlags) { ...@@ -113,9 +104,6 @@ static void _dump_cooperativelevel_DI(DWORD dwFlags) {
} }
} }
/******************************************************************************
* Get the default and the app-specific config keys.
*/
BOOL get_app_key(HKEY *defkey, HKEY *appkey) BOOL get_app_key(HKEY *defkey, HKEY *appkey)
{ {
char buffer[MAX_PATH+16]; char buffer[MAX_PATH+16];
...@@ -148,9 +136,6 @@ BOOL get_app_key(HKEY *defkey, HKEY *appkey) ...@@ -148,9 +136,6 @@ BOOL get_app_key(HKEY *defkey, HKEY *appkey)
return *defkey || *appkey; return *defkey || *appkey;
} }
/******************************************************************************
* Get a config key from either the app-specific or the default config
*/
DWORD get_config_key( HKEY defkey, HKEY appkey, const WCHAR *name, WCHAR *buffer, DWORD size ) DWORD get_config_key( HKEY defkey, HKEY appkey, const WCHAR *name, WCHAR *buffer, DWORD size )
{ {
if (appkey && !RegQueryValueExW( appkey, name, 0, NULL, (LPBYTE)buffer, &size )) return 0; if (appkey && !RegQueryValueExW( appkey, name, 0, NULL, (LPBYTE)buffer, &size )) return 0;
...@@ -507,10 +492,6 @@ static BOOL set_app_data( struct dinput_device *dev, int offset, UINT_PTR app_da ...@@ -507,10 +492,6 @@ static BOOL set_app_data( struct dinput_device *dev, int offset, UINT_PTR app_da
return TRUE; return TRUE;
} }
/******************************************************************************
* queue_event - add new event to the ring queue
*/
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;
...@@ -561,10 +542,6 @@ void queue_event( IDirectInputDevice8W *iface, int inst_id, DWORD data, DWORD ti ...@@ -561,10 +542,6 @@ void queue_event( IDirectInputDevice8W *iface, int inst_id, DWORD data, DWORD ti
/* Send event if asked */ /* Send event if asked */
} }
/******************************************************************************
* Acquire
*/
static HRESULT WINAPI dinput_device_Acquire( IDirectInputDevice8W *iface ) static HRESULT WINAPI dinput_device_Acquire( IDirectInputDevice8W *iface )
{ {
struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface ); struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface );
...@@ -593,10 +570,6 @@ static HRESULT WINAPI dinput_device_Acquire( IDirectInputDevice8W *iface ) ...@@ -593,10 +570,6 @@ static HRESULT WINAPI dinput_device_Acquire( IDirectInputDevice8W *iface )
return hr; return hr;
} }
/******************************************************************************
* Unacquire
*/
static HRESULT WINAPI dinput_device_Unacquire( IDirectInputDevice8W *iface ) static HRESULT WINAPI dinput_device_Unacquire( IDirectInputDevice8W *iface )
{ {
struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface ); struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface );
...@@ -617,10 +590,6 @@ static HRESULT WINAPI dinput_device_Unacquire( IDirectInputDevice8W *iface ) ...@@ -617,10 +590,6 @@ static HRESULT WINAPI dinput_device_Unacquire( IDirectInputDevice8W *iface )
return hr; return hr;
} }
/******************************************************************************
* IDirectInputDeviceA
*/
static HRESULT WINAPI dinput_device_SetDataFormat( IDirectInputDevice8W *iface, const DIDATAFORMAT *format ) static HRESULT WINAPI dinput_device_SetDataFormat( IDirectInputDevice8W *iface, const DIDATAFORMAT *format )
{ {
struct dinput_device *This = impl_from_IDirectInputDevice8W( iface ); struct dinput_device *This = impl_from_IDirectInputDevice8W( iface );
...@@ -653,11 +622,6 @@ static HRESULT WINAPI dinput_device_SetDataFormat( IDirectInputDevice8W *iface, ...@@ -653,11 +622,6 @@ static HRESULT WINAPI dinput_device_SetDataFormat( IDirectInputDevice8W *iface,
return res; return res;
} }
/******************************************************************************
* SetCooperativeLevel
*
* Set cooperative level and the source window for the events.
*/
static HRESULT WINAPI dinput_device_SetCooperativeLevel( IDirectInputDevice8W *iface, HWND hwnd, DWORD flags ) static HRESULT WINAPI dinput_device_SetCooperativeLevel( IDirectInputDevice8W *iface, HWND hwnd, DWORD flags )
{ {
struct dinput_device *This = impl_from_IDirectInputDevice8W( iface ); struct dinput_device *This = impl_from_IDirectInputDevice8W( iface );
...@@ -685,7 +649,6 @@ static HRESULT WINAPI dinput_device_SetCooperativeLevel( IDirectInputDevice8W *i ...@@ -685,7 +649,6 @@ static HRESULT WINAPI dinput_device_SetCooperativeLevel( IDirectInputDevice8W *i
(IsEqualGUID( &This->guid, &GUID_SysMouse ) || IsEqualGUID( &This->guid, &GUID_SysKeyboard ))) (IsEqualGUID( &This->guid, &GUID_SysMouse ) || IsEqualGUID( &This->guid, &GUID_SysKeyboard )))
return DIERR_UNSUPPORTED; return DIERR_UNSUPPORTED;
/* Store the window which asks for the mouse */
EnterCriticalSection(&This->crit); EnterCriticalSection(&This->crit);
if (This->status == STATUS_ACQUIRED) hr = DIERR_ACQUIRED; if (This->status == STATUS_ACQUIRED) hr = DIERR_ACQUIRED;
else else
...@@ -718,9 +681,6 @@ static HRESULT WINAPI dinput_device_GetDeviceInfo( IDirectInputDevice8W *iface, ...@@ -718,9 +681,6 @@ static HRESULT WINAPI dinput_device_GetDeviceInfo( IDirectInputDevice8W *iface,
return S_OK; return S_OK;
} }
/******************************************************************************
* SetEventNotification : specifies event to be sent on state change
*/
static HRESULT WINAPI dinput_device_SetEventNotification( IDirectInputDevice8W *iface, HANDLE event ) static HRESULT WINAPI dinput_device_SetEventNotification( IDirectInputDevice8W *iface, HANDLE event )
{ {
struct dinput_device *This = impl_from_IDirectInputDevice8W( iface ); struct dinput_device *This = impl_from_IDirectInputDevice8W( iface );
...@@ -742,11 +702,9 @@ void dinput_device_destroy( IDirectInputDevice8W *iface ) ...@@ -742,11 +702,9 @@ void dinput_device_destroy( IDirectInputDevice8W *iface )
free( This->object_properties ); free( This->object_properties );
free( This->data_queue ); free( This->data_queue );
/* Free data format */
free( This->device_format.rgodf ); free( This->device_format.rgodf );
dinput_device_release_user_format( This ); dinput_device_release_user_format( This );
/* Free action mapping */
free( This->action_map ); free( This->action_map );
IDirectInput_Release(&This->dinput->IDirectInput7A_iface); IDirectInput_Release(&This->dinput->IDirectInput7A_iface);
......
...@@ -77,7 +77,6 @@ enum device_status ...@@ -77,7 +77,6 @@ enum device_status
STATUS_UNPLUGGED, STATUS_UNPLUGGED,
}; };
/* Device implementation */
struct dinput_device struct dinput_device
{ {
IDirectInputDevice8W IDirectInputDevice8W_iface; IDirectInputDevice8W IDirectInputDevice8W_iface;
...@@ -132,8 +131,6 @@ extern void dinput_device_destroy( IDirectInputDevice8W *iface ); ...@@ -132,8 +131,6 @@ 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;
extern BOOL device_instance_is_disabled( DIDEVICEINSTANCEW *instance, BOOL *override ) DECLSPEC_HIDDEN; extern BOOL device_instance_is_disabled( DIDEVICEINSTANCEW *instance, BOOL *override ) DECLSPEC_HIDDEN;
/* Routines to do DataFormat / WineFormat conversions */
extern void queue_event( IDirectInputDevice8W *iface, int inst_id, DWORD data, DWORD time, DWORD seq ) DECLSPEC_HIDDEN; extern void queue_event( IDirectInputDevice8W *iface, int inst_id, DWORD data, DWORD time, DWORD seq ) DECLSPEC_HIDDEN;
extern const GUID dinput_pidvid_guid DECLSPEC_HIDDEN; extern const GUID dinput_pidvid_guid DECLSPEC_HIDDEN;
......
...@@ -20,15 +20,6 @@ ...@@ -20,15 +20,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
/* Status:
*
* - Tomb Raider 2 Demo:
* Playable using keyboard only.
* - WingCommander Prophecy Demo:
* Doesn't get Input Focus.
*
* - Fallout : works great in X and DGA mode
*/
#include <assert.h> #include <assert.h>
#include <stdarg.h> #include <stdarg.h>
...@@ -157,9 +148,6 @@ static HRESULT dinput_create( IUnknown **out ) ...@@ -157,9 +148,6 @@ static HRESULT dinput_create( IUnknown **out )
return DI_OK; return DI_OK;
} }
/******************************************************************************
* DirectInputCreateEx (DINPUT.@)
*/
HRESULT WINAPI DirectInputCreateEx( HINSTANCE hinst, DWORD version, REFIID iid, void **out, IUnknown *outer ) HRESULT WINAPI DirectInputCreateEx( HINSTANCE hinst, DWORD version, REFIID iid, void **out, IUnknown *outer )
{ {
IUnknown *unknown; IUnknown *unknown;
...@@ -190,9 +178,6 @@ HRESULT WINAPI DirectInputCreateEx( HINSTANCE hinst, DWORD version, REFIID iid, ...@@ -190,9 +178,6 @@ HRESULT WINAPI DirectInputCreateEx( HINSTANCE hinst, DWORD version, REFIID iid,
return DI_OK; return DI_OK;
} }
/******************************************************************************
* DirectInput8Create (DINPUT8.@)
*/
HRESULT WINAPI DECLSPEC_HOTPATCH DirectInput8Create( HINSTANCE hinst, DWORD version, REFIID iid, void **out, IUnknown *outer ) HRESULT WINAPI DECLSPEC_HOTPATCH DirectInput8Create( HINSTANCE hinst, DWORD version, REFIID iid, void **out, IUnknown *outer )
{ {
IUnknown *unknown; IUnknown *unknown;
...@@ -225,17 +210,11 @@ HRESULT WINAPI DECLSPEC_HOTPATCH DirectInput8Create( HINSTANCE hinst, DWORD vers ...@@ -225,17 +210,11 @@ HRESULT WINAPI DECLSPEC_HOTPATCH DirectInput8Create( HINSTANCE hinst, DWORD vers
return S_OK; return S_OK;
} }
/******************************************************************************
* DirectInputCreateA (DINPUT.@)
*/
HRESULT WINAPI DECLSPEC_HOTPATCH DirectInputCreateA( HINSTANCE hinst, DWORD version, IDirectInputA **out, IUnknown *outer ) HRESULT WINAPI DECLSPEC_HOTPATCH DirectInputCreateA( HINSTANCE hinst, DWORD version, IDirectInputA **out, IUnknown *outer )
{ {
return DirectInputCreateEx( hinst, version, &IID_IDirectInput7A, (void **)out, outer ); return DirectInputCreateEx( hinst, version, &IID_IDirectInput7A, (void **)out, outer );
} }
/******************************************************************************
* DirectInputCreateW (DINPUT.@)
*/
HRESULT WINAPI DECLSPEC_HOTPATCH DirectInputCreateW( HINSTANCE hinst, DWORD version, IDirectInputW **out, IUnknown *outer ) HRESULT WINAPI DECLSPEC_HOTPATCH DirectInputCreateW( HINSTANCE hinst, DWORD version, IDirectInputW **out, IUnknown *outer )
{ {
return DirectInputCreateEx( hinst, version, &IID_IDirectInput7W, (void **)out, outer ); return DirectInputCreateEx( hinst, version, &IID_IDirectInput7W, (void **)out, outer );
...@@ -287,9 +266,6 @@ __ASM_GLOBAL_FUNC( enum_callback_wrapper, ...@@ -287,9 +266,6 @@ __ASM_GLOBAL_FUNC( enum_callback_wrapper,
#define enum_callback_wrapper(callback, instance, ref) (callback)((instance), (ref)) #define enum_callback_wrapper(callback, instance, ref) (callback)((instance), (ref))
#endif #endif
/******************************************************************************
* IDirectInputW_EnumDevices
*/
static HRESULT WINAPI dinput7_EnumDevices( IDirectInput7W *iface, DWORD type, LPDIENUMDEVICESCALLBACKW callback, static HRESULT WINAPI dinput7_EnumDevices( IDirectInput7W *iface, DWORD type, LPDIENUMDEVICESCALLBACKW callback,
void *context, DWORD flags ) void *context, DWORD flags )
{ {
...@@ -563,10 +539,6 @@ static HRESULT WINAPI dinput7_CreateDevice( IDirectInput7W *iface, const GUID *g ...@@ -563,10 +539,6 @@ static HRESULT WINAPI dinput7_CreateDevice( IDirectInput7W *iface, const GUID *g
return IDirectInput7_CreateDeviceEx( iface, guid, &IID_IDirectInputDeviceW, (void **)out, outer ); return IDirectInput7_CreateDeviceEx( iface, guid, &IID_IDirectInputDeviceW, (void **)out, outer );
} }
/*******************************************************************************
* DirectInput8
*/
static ULONG WINAPI dinput8_AddRef( IDirectInput8W *iface ) static ULONG WINAPI dinput8_AddRef( IDirectInput8W *iface )
{ {
struct dinput *impl = impl_from_IDirectInput8W( iface ); struct dinput *impl = impl_from_IDirectInput8W( iface );
...@@ -842,10 +814,6 @@ static HRESULT WINAPI dinput8_ConfigureDevices( IDirectInput8W *iface, LPDICONFI ...@@ -842,10 +814,6 @@ static HRESULT WINAPI dinput8_ConfigureDevices( IDirectInput8W *iface, LPDICONFI
return _configure_devices( iface, callback, params, flags, context ); return _configure_devices( iface, callback, params, flags, context );
} }
/*****************************************************************************
* IDirectInputJoyConfig8 interface
*/
static inline struct dinput *impl_from_IDirectInputJoyConfig8( IDirectInputJoyConfig8 *iface ) static inline struct dinput *impl_from_IDirectInputJoyConfig8( IDirectInputJoyConfig8 *iface )
{ {
return CONTAINING_RECORD( iface, struct dinput, IDirectInputJoyConfig8_iface ); return CONTAINING_RECORD( iface, struct dinput, IDirectInputJoyConfig8_iface );
...@@ -1124,9 +1092,6 @@ static const IClassFactoryVtbl class_factory_vtbl = ...@@ -1124,9 +1092,6 @@ static const IClassFactoryVtbl class_factory_vtbl =
static struct class_factory class_factory = {{&class_factory_vtbl}}; static struct class_factory class_factory = {{&class_factory_vtbl}};
/***********************************************************************
* DllGetClassObject (DINPUT.@)
*/
HRESULT WINAPI DllGetClassObject( REFCLSID clsid, REFIID iid, void **out ) HRESULT WINAPI DllGetClassObject( REFCLSID clsid, REFIID iid, void **out )
{ {
TRACE( "clsid %s, iid %s, out %p.\n", debugstr_guid( clsid ), debugstr_guid( iid ), out ); TRACE( "clsid %s, iid %s, out %p.\n", debugstr_guid( clsid ), debugstr_guid( iid ), out );
...@@ -1143,10 +1108,6 @@ HRESULT WINAPI DllGetClassObject( REFCLSID clsid, REFIID iid, void **out ) ...@@ -1143,10 +1108,6 @@ HRESULT WINAPI DllGetClassObject( REFCLSID clsid, REFIID iid, void **out )
return CLASS_E_CLASSNOTAVAILABLE; return CLASS_E_CLASSNOTAVAILABLE;
} }
/******************************************************************************
* DInput hook thread
*/
static LRESULT CALLBACK LL_hook_proc( int code, WPARAM wparam, LPARAM lparam ) static LRESULT CALLBACK LL_hook_proc( int code, WPARAM wparam, LPARAM lparam )
{ {
struct dinput_device *impl; struct dinput_device *impl;
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
extern HINSTANCE DINPUT_instance; extern HINSTANCE DINPUT_instance;
/* Implementation specification */
struct dinput struct dinput
{ {
IDirectInput7A IDirectInput7A_iface; IDirectInput7A IDirectInput7A_iface;
......
...@@ -256,7 +256,6 @@ void dinput_mouse_rawinput_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPA ...@@ -256,7 +256,6 @@ void dinput_mouse_rawinput_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPA
LeaveCriticalSection( &impl->base.crit ); LeaveCriticalSection( &impl->base.crit );
} }
/* low-level mouse hook */
int dinput_mouse_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPARAM lparam ) int dinput_mouse_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPARAM lparam )
{ {
MSLLHOOKSTRUCT *hook = (MSLLHOOKSTRUCT *)lparam; MSLLHOOKSTRUCT *hook = (MSLLHOOKSTRUCT *)lparam;
...@@ -416,7 +415,6 @@ static HRESULT mouse_acquire( IDirectInputDevice8W *iface ) ...@@ -416,7 +415,6 @@ static HRESULT mouse_acquire( IDirectInputDevice8W *iface )
DIMOUSESTATE2 *state = (DIMOUSESTATE2 *)impl->base.device_state; DIMOUSESTATE2 *state = (DIMOUSESTATE2 *)impl->base.device_state;
POINT point; POINT point;
/* Init the mouse state */
GetCursorPos( &point ); GetCursorPos( &point );
if (impl->base.user_format.dwFlags & DIDF_ABSAXIS) if (impl->base.user_format.dwFlags & DIDF_ABSAXIS)
{ {
...@@ -436,7 +434,7 @@ static HRESULT mouse_acquire( IDirectInputDevice8W *iface ) ...@@ -436,7 +434,7 @@ static HRESULT mouse_acquire( IDirectInputDevice8W *iface )
if (impl->base.dwCoopLevel & DISCL_EXCLUSIVE) if (impl->base.dwCoopLevel & DISCL_EXCLUSIVE)
{ {
ShowCursor( FALSE ); /* hide cursor */ ShowCursor( FALSE );
warp_check( impl, TRUE ); warp_check( impl, TRUE );
} }
else if (impl->warp_override == WARP_FORCE_ON) else if (impl->warp_override == WARP_FORCE_ON)
...@@ -461,7 +459,7 @@ static HRESULT mouse_unacquire( IDirectInputDevice8W *iface ) ...@@ -461,7 +459,7 @@ static HRESULT mouse_unacquire( IDirectInputDevice8W *iface )
if (impl->base.dwCoopLevel & DISCL_EXCLUSIVE) if (impl->base.dwCoopLevel & DISCL_EXCLUSIVE)
{ {
ClipCursor( NULL ); ClipCursor( NULL );
ShowCursor( TRUE ); /* show cursor */ ShowCursor( TRUE );
impl->clipped = FALSE; impl->clipped = FALSE;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment