Sync to Wine-20050310:
Alexandre Julliard <julliard@winehq.org>
- Make sure to always pass valid QS_* flags to
  MsgWaitForMultipleObjects.
Christian Costa <titan.costa@wanadoo.fr>
- Implemented GetProperty method for keyboard device.
Modified: trunk/reactos/lib/dinput/joystick_linuxinput.c
Modified: trunk/reactos/lib/dinput/keyboard.c
Modified: trunk/reactos/lib/dinput/mouse.c

Modified: trunk/reactos/lib/dinput/joystick_linuxinput.c
--- trunk/reactos/lib/dinput/joystick_linuxinput.c	2005-03-14 22:21:18 UTC (rev 14077)
+++ trunk/reactos/lib/dinput/joystick_linuxinput.c	2005-03-14 22:24:35 UTC (rev 14078)
@@ -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))

Modified: trunk/reactos/lib/dinput/keyboard.c
--- trunk/reactos/lib/dinput/keyboard.c	2005-03-14 22:21:18 UTC (rev 14077)
+++ trunk/reactos/lib/dinput/keyboard.c	2005-03-14 22:24:35 UTC (rev 14078)
@@ -426,7 +426,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
 )
@@ -441,7 +471,7 @@
     if (len != 256)
       return DIERR_INVALIDPARAM;
 
-    MsgWaitForMultipleObjectsEx(0, NULL, 0, 0, 0);
+    MsgWaitForMultipleObjectsEx(0, NULL, 0, QS_ALLINPUT, 0);
 
     if (TRACE_ON(dinput)) {
 	int i;
@@ -480,7 +510,7 @@
         if (dodsize < sizeof(DIDEVICEOBJECTDATA_DX3))
           return DIERR_INVALIDPARAM;
 
-        MsgWaitForMultipleObjectsEx(0, NULL, 0, 0, 0);
+        MsgWaitForMultipleObjectsEx(0, NULL, 0, QS_ALLINPUT, 0);
 
         EnterCriticalSection(&(This->crit));
 
@@ -792,7 +822,7 @@
 	SysKeyboardAImpl_Release,
 	SysKeyboardAImpl_GetCapabilities,
 	SysKeyboardAImpl_EnumObjects,
-	IDirectInputDevice2AImpl_GetProperty,
+	SysKeyboardAImpl_GetProperty,
 	SysKeyboardAImpl_SetProperty,
 	SysKeyboardAImpl_Acquire,
 	SysKeyboardAImpl_Unacquire,
@@ -834,7 +864,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,

Modified: trunk/reactos/lib/dinput/mouse.c
--- trunk/reactos/lib/dinput/mouse.c	2005-03-14 22:21:18 UTC (rev 14077)
+++ trunk/reactos/lib/dinput/mouse.c	2005-03-14 22:24:35 UTC (rev 14078)
@@ -1136,7 +1136,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))