[DINPUT] Implemented GetProperty method for keyboard device.

Christian Costa titan.costa at wanadoo.fr
Mon Feb 14 16:40:27 CST 2005


Hi,

Changelog:
Implemented GetProperty method for keyboard device.

Christian Costa   titan.costa at wanadoo.fr

-------------- next part --------------
Index: dlls/dinput/joystick_linuxinput.c
===================================================================
RCS file: /home/wine/wine/dlls/dinput/joystick_linuxinput.c,v
retrieving revision 1.15
diff -u -r1.15 joystick_linuxinput.c
--- dlls/dinput/joystick_linuxinput.c	23 Dec 2004 18:33:44 -0000	1.15
+++ dlls/dinput/joystick_linuxinput.c	14 Feb 2005 21:27:45 -0000
@@ -978,7 +978,7 @@
 {
   JoystickImpl *This = (JoystickImpl *)iface;
 
-  TRACE("(this=%p,%s,%p): stub!\n",
+  TRACE("(this=%p,%s,%p)\n",
 	iface, debugstr_guid(rguid), pdiph);
 
   if (TRACE_ON(dinput))
Index: dlls/dinput/keyboard.c
===================================================================
RCS file: /home/wine/wine/dlls/dinput/keyboard.c,v
retrieving revision 1.12
diff -u -r1.12 keyboard.c
--- dlls/dinput/keyboard.c	23 Dec 2004 18:33:44 -0000	1.12
+++ dlls/dinput/keyboard.c	14 Feb 2005 21:27:48 -0000
@@ -356,6 +356,37 @@
 	return DI_OK;
 }
 
+static HRESULT WINAPI SysKeyboardAImpl_GetProperty(
+	LPDIRECTINPUTDEVICE8A iface,REFGUID rguid,LPDIPROPHEADER ph
+)
+{
+	SysKeyboardImpl *This = (SysKeyboardImpl *)iface;
+
+	TRACE("(this=%p,%s,%p)\n",This,debugstr_guid(rguid),ph);
+	TRACE("(size=%ld,headersize=%ld,obj=%ld,how=%ld\n",
+            ph->dwSize,ph->dwHeaderSize,ph->dwObj,ph->dwHow);
+	if (!HIWORD(rguid)) {
+		switch ((DWORD)rguid) {
+		case (DWORD) DIPROP_BUFFERSIZE: {
+			LPDIPROPDWORD	pd = (LPDIPROPDWORD)ph;
+
+			TRACE("(buffersize=%ld)\n",pd->dwData);
+
+                        if (This->acquired)
+                           return DIERR_INVALIDPARAM;
+
+                        pd->dwData = This->buffersize;
+
+			break;
+		}
+		default:
+			WARN("Unknown type %ld\n",(DWORD)rguid);
+			break;
+		}
+	}
+	return DI_OK;
+}
+
 static HRESULT WINAPI SysKeyboardAImpl_GetDeviceState(
 	LPDIRECTINPUTDEVICE8A iface,DWORD len,LPVOID ptr
 )
@@ -712,7 +743,7 @@
 	SysKeyboardAImpl_Release,
 	SysKeyboardAImpl_GetCapabilities,
 	SysKeyboardAImpl_EnumObjects,
-	IDirectInputDevice2AImpl_GetProperty,
+	SysKeyboardAImpl_GetProperty,
 	SysKeyboardAImpl_SetProperty,
 	SysKeyboardAImpl_Acquire,
 	SysKeyboardAImpl_Unacquire,
@@ -754,7 +785,7 @@
 	XCAST(Release)SysKeyboardAImpl_Release,
 	XCAST(GetCapabilities)SysKeyboardAImpl_GetCapabilities,
 	SysKeyboardWImpl_EnumObjects,
-	XCAST(GetProperty)IDirectInputDevice2AImpl_GetProperty,
+	XCAST(GetProperty)SysKeyboardAImpl_GetProperty,
 	XCAST(SetProperty)SysKeyboardAImpl_SetProperty,
 	XCAST(Acquire)SysKeyboardAImpl_Acquire,
 	XCAST(Unacquire)SysKeyboardAImpl_Unacquire,
Index: dlls/dinput/mouse.c
===================================================================
RCS file: /home/wine/wine/dlls/dinput/mouse.c,v
retrieving revision 1.17
diff -u -r1.17 mouse.c
--- dlls/dinput/mouse.c	25 Jan 2005 20:05:12 -0000	1.17
+++ dlls/dinput/mouse.c	14 Feb 2005 21:27:49 -0000
@@ -845,7 +845,7 @@
 {
     SysMouseImpl *This = (SysMouseImpl *)iface;
     
-    TRACE("(this=%p,%s,%p): stub!\n",
+    TRACE("(this=%p,%s,%p)\n",
 	  iface, debugstr_guid(rguid), pdiph);
     
     if (TRACE_ON(dinput))


More information about the wine-patches mailing list