[PATCH] LockDisplay/UnlockDisplay in libXi

Jamey Sharp jamey at minilop.net
Sun Oct 15 00:54:25 PDT 2006


Thanks for another fine locking bug report, Magnus! We should probably
be discussing these issues on the xorg list, since they're not XCB bugs.
So I'm moving discussion there. Your message is quoted below for the
benefit of xorg readers.

I didn't want to have to reason about whether it was OK to drop the
Display lock in _XiGetExtensionVersion. Chances are good it isn't OK. Of
course you're finding that XInput_find_display was dropping the display
lock there anyway and nobody noticed before, but that doesn't make it
OK. :-)

So instead I moved calls to XInput_find_display outside of the Display
lock. It turned out that on these code paths it was being called
sometimes three or four times when once should suffice, so I just added
parameters to _XiGetExtensionVersion and _XiCheckExtInit to pass the
XExtDisplayInfo structure to where it was needed.

I'd like review before I push: would libXi hackers (Daniel Stone?)
please tell me whether this is a reasonable change? And Magnus, would
you confirm that it fixes the bug for you?

I've attached the patches.

--Jamey

On Fri, Oct 13, 2006 at 08:49:30AM +0100, Magnus Kessler wrote:
> Here's a patch for a locking bug in libXi. It was discovered through a crash 
> of the LastFM player (media-sound/lastfmplayer-1.0.0.1_p2113 on gentoo).
> 
> The function XInput_find_display() must not be called with a lock being 
> held. The function _XiGetExtensionVersion() therefore only applies the lock 
> afterwards. However, throughout the code base before 
> _XiGetExtensionVersion() is called the callers have the lock set. 
> 
> This is further complicated by the fact that _XiGetExtensionVersion() calls 
> into _XiCheckInit() which then in turn calls _XiGetExtensionVersion() with 
> a different parameter. _XiCheckInit() may have some nasty side effects 
> because it releases the lock under certain conditions.
> 
> This patch tries to address the immediate issue by releasing the lock in 
> _XiGetExtensionVersion() before calling XInput_find_display(). libXi's lock 
> handling would benefit from a closer review, though.
> 
> Could you please review and apply?
> 
> Many thanks,
> 
> Magnus Kessler
> 
> 
> diff -u libXi-1.0.1.old/src/XGetVers.c libXi-1.0.1.new/src/XGetVers.c
> --- libXi-1.0.1.old/src/XGetVers.c	2006-03-31 15:50:24.000000000 +0100
> +++ libXi-1.0.1.new/src/XGetVers.c	2006-10-13 00:47:56.000000000 +0100
> @@ -80,8 +80,11 @@
>      xGetExtensionVersionReq *req;
>      xGetExtensionVersionReply rep;
>      XExtensionVersion *ext;
> -    XExtDisplayInfo *info = XInput_find_display(dpy);
> +    XExtDisplayInfo *info;
> +    UnlockDisplay(dpy);
> +    info = XInput_find_display(dpy);
>  
> +    LockDisplay(dpy);
>      if (_XiCheckExtInit(dpy, Dont_Check) == -1)
>  	return ((XExtensionVersion *) NoSuchExtension);
-------------- next part --------------
From 5dda1e1509d40ef64ebc816ce538cef462a4fa51 Mon Sep 17 00:00:00 2001
From: Jamey Sharp <jamey at minilop.net>
Date: Sun, 15 Oct 2006 00:03:57 -0700
Subject: [PATCH] Don't call XInput_find_display in _XiGetExtensionVersion, while the Display lock is held.

_XiGetExtensionVersion has two callers. One had already called
XInput_find_display, and the other could easily do so outside the
Display lock. So I change the _XiGetExtensionVersion interface to
accept a previously-computed XExtDisplayInfo from the caller.
Besides being more correct, this should be slightly faster. :-)

Thanks to Magnus Kessler <Magnus.Kessler at gmx.net> for identifying
the bug and proposing a workaround.
---
 src/XExtInt.c  |    2 +-
 src/XGetVers.c |    6 +++---
 src/XIint.h    |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/XExtInt.c b/src/XExtInt.c
index e5baccb..aa838ef 100644
--- a/src/XExtInt.c
+++ b/src/XExtInt.c
@@ -207,7 +207,7 @@ _XiCheckExtInit(dpy, version_index)
 	    return (-1);
 	}
 	((XInputData *) info->data)->vers =
-	    _XiGetExtensionVersion(dpy, "XInputExtension");
+	    _XiGetExtensionVersion(dpy, "XInputExtension", info);
     }
 
     if (versions[version_index].major_version > Dont_Check) {
diff --git a/src/XGetVers.c b/src/XGetVers.c
index 1f4fd7a..ef41fea 100644
--- a/src/XGetVers.c
+++ b/src/XGetVers.c
@@ -64,9 +64,10 @@ XExtensionVersion *
 XGetExtensionVersion(register Display * dpy, _Xconst char *name)
 {
     XExtensionVersion *ext;
+    XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    ext = _XiGetExtensionVersion(dpy, name);
+    ext = _XiGetExtensionVersion(dpy, name, info);
     if (ext != (XExtensionVersion *) NoSuchExtension) {
 	UnlockDisplay(dpy);
 	SyncHandle();
@@ -75,12 +76,11 @@ XGetExtensionVersion(register Display * 
 }
 
 XExtensionVersion *
-_XiGetExtensionVersion(register Display * dpy, _Xconst char *name)
+_XiGetExtensionVersion(register Display * dpy, _Xconst char *name, XExtDisplayInfo *info)
 {
     xGetExtensionVersionReq *req;
     xGetExtensionVersionReply rep;
     XExtensionVersion *ext;
-    XExtDisplayInfo *info = XInput_find_display(dpy);
 
     if (_XiCheckExtInit(dpy, Dont_Check) == -1)
 	return ((XExtensionVersion *) NoSuchExtension);
diff --git a/src/XIint.h b/src/XIint.h
index ba965a6..ae6d33f 100644
--- a/src/XIint.h
+++ b/src/XIint.h
@@ -12,6 +12,6 @@ extern XExtDisplayInfo *XInput_find_disp
 
 extern int _XiCheckExtInit(Display *, int);
 
-extern XExtensionVersion *_XiGetExtensionVersion(Display *, _Xconst char *);
+extern XExtensionVersion *_XiGetExtensionVersion(Display *, _Xconst char *, XExtDisplayInfo *);
 
 #endif
-- 
1.4.1.1

-------------- next part --------------
From c27e00ceceed3fea011c98c0e70ab568bf0687c6 Mon Sep 17 00:00:00 2001
From: Jamey Sharp <jamey at minilop.net>
Date: Sun, 15 Oct 2006 00:26:21 -0700
Subject: [PATCH] Don't call XInput_find_display in _XiCheckExtInit, while the Display lock is held.

All callers of _XiCheckExtInit have already called XInput_find_display
first outside the lock, so just pass their copy of the XExtDisplayInfo
structure down. Besides being more correct, this should be slightly
faster. :-)

Thanks to Magnus Kessler <Magnus.Kessler at gmx.net> for identifying
the bug and proposing a workaround.
---
 src/XAllowDv.c  |    2 +-
 src/XChgDCtl.c  |    2 +-
 src/XChgFCtl.c  |    2 +-
 src/XChgKMap.c  |    2 +-
 src/XChgKbd.c   |    2 +-
 src/XChgPnt.c   |    2 +-
 src/XChgProp.c  |    2 +-
 src/XCloseDev.c |    2 +-
 src/XDevBell.c  |    2 +-
 src/XExtInt.c   |    4 ++--
 src/XGMotion.c  |    2 +-
 src/XGetBMap.c  |    2 +-
 src/XGetDCtl.c  |    2 +-
 src/XGetFCtl.c  |    2 +-
 src/XGetKMap.c  |    2 +-
 src/XGetMMap.c  |    2 +-
 src/XGetProp.c  |    2 +-
 src/XGetVers.c  |    2 +-
 src/XGrDvBut.c  |    2 +-
 src/XGrDvKey.c  |    2 +-
 src/XGrabDev.c  |    2 +-
 src/XGtFocus.c  |    2 +-
 src/XGtSelect.c |    2 +-
 src/XIint.h     |    2 +-
 src/XListDev.c  |    2 +-
 src/XOpenDev.c  |    2 +-
 src/XQueryDv.c  |    2 +-
 src/XSelect.c   |    2 +-
 src/XSetBMap.c  |    2 +-
 src/XSetDVal.c  |    2 +-
 src/XSetMMap.c  |    2 +-
 src/XSetMode.c  |    2 +-
 src/XSndExEv.c  |    2 +-
 src/XUngrDev.c  |    2 +-
 src/XUngrDvB.c  |    2 +-
 src/XUngrDvK.c  |    2 +-
 36 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/src/XAllowDv.c b/src/XAllowDv.c
index 94a27ca..7fd2a07 100644
--- a/src/XAllowDv.c
+++ b/src/XAllowDv.c
@@ -71,7 +71,7 @@ XAllowDeviceEvents(dpy, dev, event_mode,
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
+    if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
 	return (NoSuchExtension);
 
     GetReq(AllowDeviceEvents, req);
diff --git a/src/XChgDCtl.c b/src/XChgDCtl.c
index a196523..9e71475 100644
--- a/src/XChgDCtl.c
+++ b/src/XChgDCtl.c
@@ -74,7 +74,7 @@ XChangeDeviceControl(dpy, dev, control, 
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_Add_XChangeDeviceControl) == -1)
+    if (_XiCheckExtInit(dpy, XInput_Add_XChangeDeviceControl, info) == -1)
 	return (NoSuchExtension);
 
     GetReq(ChangeDeviceControl, req);
diff --git a/src/XChgFCtl.c b/src/XChgFCtl.c
index 32c7b24..e499b41 100644
--- a/src/XChgFCtl.c
+++ b/src/XChgFCtl.c
@@ -73,7 +73,7 @@ XChangeFeedbackControl(dpy, dev, mask, f
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
+    if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
 	return (NoSuchExtension);
 
     GetReq(ChangeFeedbackControl, req);
diff --git a/src/XChgKMap.c b/src/XChgKMap.c
index d0a334f..73de754 100644
--- a/src/XChgKMap.c
+++ b/src/XChgKMap.c
@@ -74,7 +74,7 @@ XChangeDeviceKeyMapping(dpy, dev, first,
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
+    if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
 	return (NoSuchExtension);
 
     GetReq(ChangeDeviceKeyMapping, req);
diff --git a/src/XChgKbd.c b/src/XChgKbd.c
index feba239..1b01207 100644
--- a/src/XChgKbd.c
+++ b/src/XChgKbd.c
@@ -70,7 +70,7 @@ XChangeKeyboardDevice(dpy, dev)
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
+    if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
 	return (NoSuchExtension);
 
     GetReq(ChangeKeyboardDevice, req);
diff --git a/src/XChgPnt.c b/src/XChgPnt.c
index 9e0a617..6123398 100644
--- a/src/XChgPnt.c
+++ b/src/XChgPnt.c
@@ -72,7 +72,7 @@ XChangePointerDevice(dpy, dev, xaxis, ya
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
+    if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
 	return (NoSuchExtension);
 
     GetReq(ChangePointerDevice, req);
diff --git a/src/XChgProp.c b/src/XChgProp.c
index 6939cb3..0c7377f 100644
--- a/src/XChgProp.c
+++ b/src/XChgProp.c
@@ -73,7 +73,7 @@ XChangeDeviceDontPropagateList(dpy, wind
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
+    if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
 	return (NoSuchExtension);
 
     GetReq(ChangeDeviceDontPropagateList, req);
diff --git a/src/XCloseDev.c b/src/XCloseDev.c
index 71e792a..ca19860 100644
--- a/src/XCloseDev.c
+++ b/src/XCloseDev.c
@@ -69,7 +69,7 @@ XCloseDevice(dpy, dev)
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
+    if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
 	return (NoSuchExtension);
 
     GetReq(CloseDevice, req);
diff --git a/src/XDevBell.c b/src/XDevBell.c
index 276a1b8..73f2e35 100644
--- a/src/XDevBell.c
+++ b/src/XDevBell.c
@@ -71,7 +71,7 @@ XDeviceBell(dpy, dev, feedbackclass, fee
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_Add_XDeviceBell) == -1)
+    if (_XiCheckExtInit(dpy, XInput_Add_XDeviceBell, info) == -1)
 	return (NoSuchExtension);
 
     GetReq(DeviceBell, req);
diff --git a/src/XExtInt.c b/src/XExtInt.c
index aa838ef..b7297dc 100644
--- a/src/XExtInt.c
+++ b/src/XExtInt.c
@@ -191,12 +191,12 @@ _xidevicebusy(dpy, error)
  */
 
 int
-_XiCheckExtInit(dpy, version_index)
+_XiCheckExtInit(dpy, version_index, info)
     register Display *dpy;
     register int version_index;
+    XExtDisplayInfo *info;
 {
     XExtensionVersion *ext;
-    XExtDisplayInfo *info = XInput_find_display(dpy);
 
     XInputCheckExtension(dpy, info, -1);
 
diff --git a/src/XGMotion.c b/src/XGMotion.c
index abcc06a..daa8792 100644
--- a/src/XGMotion.c
+++ b/src/XGMotion.c
@@ -85,7 +85,7 @@ Time stop;
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
+    if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
 	return ((XDeviceTimeCoord *) NoSuchExtension);
 
     GetReq(GetDeviceMotionEvents, req);
diff --git a/src/XGetBMap.c b/src/XGetBMap.c
index 1eaaa23..15cad74 100644
--- a/src/XGetBMap.c
+++ b/src/XGetBMap.c
@@ -81,7 +81,7 @@ XGetDeviceButtonMapping(dpy, device, map
     xGetDeviceButtonMappingReply rep;
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
+    if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
 	return (NoSuchExtension);
     GetReq(GetDeviceButtonMapping, req);
 
diff --git a/src/XGetDCtl.c b/src/XGetDCtl.c
index 139f7e7..8d034bf 100644
--- a/src/XGetDCtl.c
+++ b/src/XGetDCtl.c
@@ -78,7 +78,7 @@ XGetDeviceControl(dpy, dev, control)
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_Add_XChangeDeviceControl) == -1)
+    if (_XiCheckExtInit(dpy, XInput_Add_XChangeDeviceControl, info) == -1)
 	return ((XDeviceControl *) NoSuchExtension);
 
     GetReq(GetDeviceControl, req);
diff --git a/src/XGetFCtl.c b/src/XGetFCtl.c
index 0101fc0..af4578c 100644
--- a/src/XGetFCtl.c
+++ b/src/XGetFCtl.c
@@ -78,7 +78,7 @@ XGetFeedbackControl(dpy, dev, num_feedba
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
+    if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
 	return ((XFeedbackState *) NoSuchExtension);
 
     GetReq(GetFeedbackControl, req);
diff --git a/src/XGetKMap.c b/src/XGetKMap.c
index 59f6f93..0381e86 100644
--- a/src/XGetKMap.c
+++ b/src/XGetKMap.c
@@ -76,7 +76,7 @@ #endif
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
+    if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
 	return ((KeySym *) NoSuchExtension);
 
     GetReq(GetDeviceKeyMapping, req);
diff --git a/src/XGetMMap.c b/src/XGetMMap.c
index 4a8c32f..ef92281 100644
--- a/src/XGetMMap.c
+++ b/src/XGetMMap.c
@@ -72,7 +72,7 @@ XGetDeviceModifierMapping(dpy, dev)
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
+    if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
 	return ((XModifierKeymap *) NoSuchExtension);
 
     GetReq(GetDeviceModifierMapping, req);
diff --git a/src/XGetProp.c b/src/XGetProp.c
index 0ea8ceb..71d844b 100644
--- a/src/XGetProp.c
+++ b/src/XGetProp.c
@@ -75,7 +75,7 @@ Window window;
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
+    if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
 	return ((XEventClass *) NoSuchExtension);
 
     GetReq(GetDeviceDontPropagateList, req);
diff --git a/src/XGetVers.c b/src/XGetVers.c
index ef41fea..d3c765a 100644
--- a/src/XGetVers.c
+++ b/src/XGetVers.c
@@ -82,7 +82,7 @@ _XiGetExtensionVersion(register Display 
     xGetExtensionVersionReply rep;
     XExtensionVersion *ext;
 
-    if (_XiCheckExtInit(dpy, Dont_Check) == -1)
+    if (_XiCheckExtInit(dpy, Dont_Check, info) == -1)
 	return ((XExtensionVersion *) NoSuchExtension);
 
     GetReq(GetExtensionVersion, req);
diff --git a/src/XGrDvBut.c b/src/XGrDvBut.c
index fbc26ba..6e35099 100644
--- a/src/XGrDvBut.c
+++ b/src/XGrDvBut.c
@@ -80,7 +80,7 @@ XGrabDeviceButton(dpy, dev, button, modi
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
+    if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
 	return (NoSuchExtension);
 
     GetReq(GrabDeviceButton, req);
diff --git a/src/XGrDvKey.c b/src/XGrDvKey.c
index 6731e2c..1389753 100644
--- a/src/XGrDvKey.c
+++ b/src/XGrDvKey.c
@@ -80,7 +80,7 @@ XGrabDeviceKey(dpy, dev, key, modifiers,
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
+    if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
 	return (NoSuchExtension);
 
     GetReq(GrabDeviceKey, req);
diff --git a/src/XGrabDev.c b/src/XGrabDev.c
index 536e369..92f1c11 100644
--- a/src/XGrabDev.c
+++ b/src/XGrabDev.c
@@ -78,7 +78,7 @@ XGrabDevice(dpy, dev, grab_window, owner
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
+    if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
 	return (NoSuchExtension);
 
     GetReq(GrabDevice, req);
diff --git a/src/XGtFocus.c b/src/XGtFocus.c
index 08cebd9..4e63918 100644
--- a/src/XGtFocus.c
+++ b/src/XGtFocus.c
@@ -73,7 +73,7 @@ XGetDeviceFocus(dpy, dev, focus, revert_
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
+    if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
 	return (NoSuchExtension);
 
     GetReq(GetDeviceFocus, req);
diff --git a/src/XGtSelect.c b/src/XGtSelect.c
index 0f63caf..9f596fd 100644
--- a/src/XGtSelect.c
+++ b/src/XGtSelect.c
@@ -76,7 +76,7 @@ XGetSelectedExtensionEvents(dpy, w, this
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
+    if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
 	return (NoSuchExtension);
     GetReq(GetSelectedExtensionEvents, req);
 
diff --git a/src/XIint.h b/src/XIint.h
index ae6d33f..f35619c 100644
--- a/src/XIint.h
+++ b/src/XIint.h
@@ -10,7 +10,7 @@ #define _XIINT_H_
 
 extern XExtDisplayInfo *XInput_find_display(Display *);
 
-extern int _XiCheckExtInit(Display *, int);
+extern int _XiCheckExtInit(Display *, int, XExtDisplayInfo *);
 
 extern XExtensionVersion *_XiGetExtensionVersion(Display *, _Xconst char *, XExtDisplayInfo *);
 
diff --git a/src/XListDev.c b/src/XListDev.c
index ea9aa62..b9a617d 100644
--- a/src/XListDev.c
+++ b/src/XListDev.c
@@ -82,7 +82,7 @@ XListInputDevices(dpy, ndevices)
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
+    if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
 	return ((XDeviceInfo *) NULL);
 
     GetReq(ListInputDevices, req);
diff --git a/src/XOpenDev.c b/src/XOpenDev.c
index ed168a6..d220330 100644
--- a/src/XOpenDev.c
+++ b/src/XOpenDev.c
@@ -72,7 +72,7 @@ XOpenDevice(dpy, id)
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
+    if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
 	return ((XDevice *) NoSuchExtension);
 
     GetReq(OpenDevice, req);
diff --git a/src/XQueryDv.c b/src/XQueryDv.c
index a3a75f2..540f224 100644
--- a/src/XQueryDv.c
+++ b/src/XQueryDv.c
@@ -76,7 +76,7 @@ XQueryDeviceState(dpy, dev)
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
+    if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
 	return ((XDeviceState *) NoSuchExtension);
 
     GetReq(QueryDeviceState, req);
diff --git a/src/XSelect.c b/src/XSelect.c
index b23829a..af0fb84 100644
--- a/src/XSelect.c
+++ b/src/XSelect.c
@@ -71,7 +71,7 @@ XSelectExtensionEvent(dpy, w, event_list
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
+    if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
 	return (NoSuchExtension);
     GetReq(SelectExtensionEvent, req);
 
diff --git a/src/XSetBMap.c b/src/XSetBMap.c
index bdfe501..cad6976 100644
--- a/src/XSetBMap.c
+++ b/src/XSetBMap.c
@@ -75,7 +75,7 @@ XSetDeviceButtonMapping(dpy, device, map
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
+    if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
 	return (NoSuchExtension);
     GetReq(SetDeviceButtonMapping, req);
     req->reqType = info->codes->major_opcode;
diff --git a/src/XSetDVal.c b/src/XSetDVal.c
index 6b382f1..43702b0 100644
--- a/src/XSetDVal.c
+++ b/src/XSetDVal.c
@@ -74,7 +74,7 @@ XSetDeviceValuators(dpy, dev, valuators,
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_Add_XSetDeviceValuators) == -1)
+    if (_XiCheckExtInit(dpy, XInput_Add_XSetDeviceValuators, info) == -1)
 	return (NoSuchExtension);
 
     GetReq(SetDeviceValuators, req);
diff --git a/src/XSetMMap.c b/src/XSetMMap.c
index b0838f6..1077433 100644
--- a/src/XSetMMap.c
+++ b/src/XSetMMap.c
@@ -72,7 +72,7 @@ XSetDeviceModifierMapping(dpy, dev, modm
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
+    if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
 	return (NoSuchExtension);
 
     GetReqExtra(SetDeviceModifierMapping, mapSize, req);
diff --git a/src/XSetMode.c b/src/XSetMode.c
index 278c4ff..94e2b3d 100644
--- a/src/XSetMode.c
+++ b/src/XSetMode.c
@@ -71,7 +71,7 @@ XSetDeviceMode(dpy, dev, mode)
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
+    if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
 	return (NoSuchExtension);
 
     GetReq(SetDeviceMode, req);
diff --git a/src/XSndExEv.c b/src/XSndExEv.c
index 6d65745..71431cd 100644
--- a/src/XSndExEv.c
+++ b/src/XSndExEv.c
@@ -81,7 +81,7 @@ XSendExtensionEvent(dpy, dev, dest, prop
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
+    if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
 	return (NoSuchExtension);
 
     /* call through display to find proper conversion routine */
diff --git a/src/XUngrDev.c b/src/XUngrDev.c
index ecc8887..70ba03d 100644
--- a/src/XUngrDev.c
+++ b/src/XUngrDev.c
@@ -70,7 +70,7 @@ XUngrabDevice(dpy, dev, time)
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
+    if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
 	return (NoSuchExtension);
 
     GetReq(UngrabDevice, req);
diff --git a/src/XUngrDvB.c b/src/XUngrDvB.c
index 07f2c3f..77dbe77 100644
--- a/src/XUngrDvB.c
+++ b/src/XUngrDvB.c
@@ -73,7 +73,7 @@ XUngrabDeviceButton(dpy, dev, button, mo
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
+    if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
 	return (NoSuchExtension);
     GetReq(UngrabDeviceButton, req);
 
diff --git a/src/XUngrDvK.c b/src/XUngrDvK.c
index e9e4cdf..0ae3178 100644
--- a/src/XUngrDvK.c
+++ b/src/XUngrDvK.c
@@ -73,7 +73,7 @@ XUngrabDeviceKey(dpy, dev, key, modifier
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
+    if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
 	return (NoSuchExtension);
     GetReq(UngrabDeviceKey, req);
 
-- 
1.4.1.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg/attachments/20061015/29ef1d0b/attachment.pgp>


More information about the xorg mailing list