From: Rémi Bernon rbernon@codeweavers.com
--- dlls/dinput/device.c | 42 ------------------------------------ dlls/dinput/device_private.h | 3 --- dlls/dinput/dinput_main.c | 39 --------------------------------- dlls/dinput/dinput_private.h | 1 - dlls/dinput/mouse.c | 6 ++---- 5 files changed, 2 insertions(+), 89 deletions(-)
diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index 590151483c9..e53940a2e3b 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -19,12 +19,6 @@ * 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 <string.h> #include <math.h> @@ -87,9 +81,6 @@ static inline BOOL is_exclusively_acquired( struct dinput_device *device ) return device->status == STATUS_ACQUIRED && (device->dwCoopLevel & DISCL_EXCLUSIVE); }
-/****************************************************************************** - * Various debugging tools - */ static void _dump_cooperativelevel_DI(DWORD dwFlags) { if (TRACE_ON(dinput)) { unsigned int i; @@ -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) { char buffer[MAX_PATH+16]; @@ -148,9 +136,6 @@ BOOL get_app_key(HKEY *defkey, HKEY *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 ) { 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 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 ) { static ULONGLONG notify_ms = 0; @@ -561,10 +542,6 @@ void queue_event( IDirectInputDevice8W *iface, int inst_id, DWORD data, DWORD ti /* Send event if asked */ }
-/****************************************************************************** - * Acquire - */ - static HRESULT WINAPI dinput_device_Acquire( IDirectInputDevice8W *iface ) { struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface ); @@ -593,10 +570,6 @@ static HRESULT WINAPI dinput_device_Acquire( IDirectInputDevice8W *iface ) return hr; }
-/****************************************************************************** - * Unacquire - */ - static HRESULT WINAPI dinput_device_Unacquire( IDirectInputDevice8W *iface ) { struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface ); @@ -617,10 +590,6 @@ static HRESULT WINAPI dinput_device_Unacquire( IDirectInputDevice8W *iface ) return hr; }
-/****************************************************************************** - * IDirectInputDeviceA - */ - static HRESULT WINAPI dinput_device_SetDataFormat( IDirectInputDevice8W *iface, const DIDATAFORMAT *format ) { struct dinput_device *This = impl_from_IDirectInputDevice8W( iface ); @@ -653,11 +622,6 @@ static HRESULT WINAPI dinput_device_SetDataFormat( IDirectInputDevice8W *iface, 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 ) { struct dinput_device *This = impl_from_IDirectInputDevice8W( iface ); @@ -685,7 +649,6 @@ static HRESULT WINAPI dinput_device_SetCooperativeLevel( IDirectInputDevice8W *i (IsEqualGUID( &This->guid, &GUID_SysMouse ) || IsEqualGUID( &This->guid, &GUID_SysKeyboard ))) return DIERR_UNSUPPORTED;
- /* Store the window which asks for the mouse */ EnterCriticalSection(&This->crit); if (This->status == STATUS_ACQUIRED) hr = DIERR_ACQUIRED; else @@ -718,9 +681,6 @@ static HRESULT WINAPI dinput_device_GetDeviceInfo( IDirectInputDevice8W *iface, return S_OK; }
-/****************************************************************************** - * SetEventNotification : specifies event to be sent on state change - */ static HRESULT WINAPI dinput_device_SetEventNotification( IDirectInputDevice8W *iface, HANDLE event ) { struct dinput_device *This = impl_from_IDirectInputDevice8W( iface ); @@ -742,11 +702,9 @@ void dinput_device_destroy( IDirectInputDevice8W *iface ) free( This->object_properties ); free( This->data_queue );
- /* Free data format */ free( This->device_format.rgodf ); dinput_device_release_user_format( This );
- /* Free action mapping */ free( This->action_map );
IDirectInput_Release(&This->dinput->IDirectInput7A_iface); diff --git a/dlls/dinput/device_private.h b/dlls/dinput/device_private.h index be5d7861fd1..45250ed082b 100644 --- a/dlls/dinput/device_private.h +++ b/dlls/dinput/device_private.h @@ -77,7 +77,6 @@ enum device_status STATUS_UNPLUGGED, };
-/* Device implementation */ struct dinput_device { IDirectInputDevice8W IDirectInputDevice8W_iface; @@ -132,8 +131,6 @@ extern void dinput_device_destroy( IDirectInputDevice8W *iface ); extern BOOL get_app_key(HKEY*, HKEY*) 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; - -/* Routines to do DataFormat / WineFormat conversions */ 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; diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c index d3db22c70b5..9130c0480b7 100644 --- a/dlls/dinput/dinput_main.c +++ b/dlls/dinput/dinput_main.c @@ -20,15 +20,6 @@ * License along with this library; if not, write to the Free Software * 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 <stdarg.h> @@ -157,9 +148,6 @@ static HRESULT dinput_create( IUnknown **out ) return DI_OK; }
-/****************************************************************************** - * DirectInputCreateEx (DINPUT.@) - */ HRESULT WINAPI DirectInputCreateEx( HINSTANCE hinst, DWORD version, REFIID iid, void **out, IUnknown *outer ) { IUnknown *unknown; @@ -190,9 +178,6 @@ HRESULT WINAPI DirectInputCreateEx( HINSTANCE hinst, DWORD version, REFIID iid, return DI_OK; }
-/****************************************************************************** - * DirectInput8Create (DINPUT8.@) - */ HRESULT WINAPI DECLSPEC_HOTPATCH DirectInput8Create( HINSTANCE hinst, DWORD version, REFIID iid, void **out, IUnknown *outer ) { IUnknown *unknown; @@ -225,17 +210,11 @@ HRESULT WINAPI DECLSPEC_HOTPATCH DirectInput8Create( HINSTANCE hinst, DWORD vers return S_OK; }
-/****************************************************************************** - * DirectInputCreateA (DINPUT.@) - */ HRESULT WINAPI DECLSPEC_HOTPATCH DirectInputCreateA( HINSTANCE hinst, DWORD version, IDirectInputA **out, IUnknown *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 ) { return DirectInputCreateEx( hinst, version, &IID_IDirectInput7W, (void **)out, outer ); @@ -287,9 +266,6 @@ __ASM_GLOBAL_FUNC( enum_callback_wrapper, #define enum_callback_wrapper(callback, instance, ref) (callback)((instance), (ref)) #endif
-/****************************************************************************** - * IDirectInputW_EnumDevices - */ static HRESULT WINAPI dinput7_EnumDevices( IDirectInput7W *iface, DWORD type, LPDIENUMDEVICESCALLBACKW callback, void *context, DWORD flags ) { @@ -563,10 +539,6 @@ static HRESULT WINAPI dinput7_CreateDevice( IDirectInput7W *iface, const GUID *g return IDirectInput7_CreateDeviceEx( iface, guid, &IID_IDirectInputDeviceW, (void **)out, outer ); }
-/******************************************************************************* - * DirectInput8 - */ - static ULONG WINAPI dinput8_AddRef( IDirectInput8W *iface ) { struct dinput *impl = impl_from_IDirectInput8W( iface ); @@ -842,10 +814,6 @@ static HRESULT WINAPI dinput8_ConfigureDevices( IDirectInput8W *iface, LPDICONFI return _configure_devices( iface, callback, params, flags, context ); }
-/***************************************************************************** - * IDirectInputJoyConfig8 interface - */ - static inline struct dinput *impl_from_IDirectInputJoyConfig8( IDirectInputJoyConfig8 *iface ) { return CONTAINING_RECORD( iface, struct dinput, IDirectInputJoyConfig8_iface ); @@ -1124,9 +1092,6 @@ static const IClassFactoryVtbl class_factory_vtbl =
static struct class_factory class_factory = {{&class_factory_vtbl}};
-/*********************************************************************** - * DllGetClassObject (DINPUT.@) - */ HRESULT WINAPI DllGetClassObject( REFCLSID clsid, REFIID iid, void **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 ) return CLASS_E_CLASSNOTAVAILABLE; }
-/****************************************************************************** - * DInput hook thread - */ - static LRESULT CALLBACK LL_hook_proc( int code, WPARAM wparam, LPARAM lparam ) { struct dinput_device *impl; diff --git a/dlls/dinput/dinput_private.h b/dlls/dinput/dinput_private.h index de48c4c5298..e48357e9ffc 100644 --- a/dlls/dinput/dinput_private.h +++ b/dlls/dinput/dinput_private.h @@ -29,7 +29,6 @@
extern HINSTANCE DINPUT_instance;
-/* Implementation specification */ struct dinput { IDirectInput7A IDirectInput7A_iface; diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c index ee172547a30..6aab20a631c 100644 --- a/dlls/dinput/mouse.c +++ b/dlls/dinput/mouse.c @@ -256,7 +256,6 @@ void dinput_mouse_rawinput_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPA LeaveCriticalSection( &impl->base.crit ); }
-/* low-level mouse hook */ int dinput_mouse_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPARAM lparam ) { MSLLHOOKSTRUCT *hook = (MSLLHOOKSTRUCT *)lparam; @@ -416,7 +415,6 @@ static HRESULT mouse_acquire( IDirectInputDevice8W *iface ) DIMOUSESTATE2 *state = (DIMOUSESTATE2 *)impl->base.device_state; POINT point;
- /* Init the mouse state */ GetCursorPos( &point ); if (impl->base.user_format.dwFlags & DIDF_ABSAXIS) { @@ -436,7 +434,7 @@ static HRESULT mouse_acquire( IDirectInputDevice8W *iface )
if (impl->base.dwCoopLevel & DISCL_EXCLUSIVE) { - ShowCursor( FALSE ); /* hide cursor */ + ShowCursor( FALSE ); warp_check( impl, TRUE ); } else if (impl->warp_override == WARP_FORCE_ON) @@ -461,7 +459,7 @@ static HRESULT mouse_unacquire( IDirectInputDevice8W *iface ) if (impl->base.dwCoopLevel & DISCL_EXCLUSIVE) { ClipCursor( NULL ); - ShowCursor( TRUE ); /* show cursor */ + ShowCursor( TRUE ); impl->clipped = FALSE; }