From 5c03d131815cfe2f78792277ab8352e69e830196 Mon Sep 17 00:00:00 2001 From: Eamon Walsh Date: Fri, 28 Sep 2007 08:02:00 -0400 Subject: xace: add new hooks + access controls: XInput extension. Introduces new dix API to lookup a device, dixLookupDevice(), which replaces LookupDeviceIntRec and LookupDevice. --- Xi/grabdev.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'Xi/grabdev.c') diff --git a/Xi/grabdev.c b/Xi/grabdev.c index b303695fd..110fc6b5f 100644 --- a/Xi/grabdev.c +++ b/Xi/grabdev.c @@ -60,7 +60,6 @@ SOFTWARE. #include "windowstr.h" /* window structure */ #include #include -#include "extinit.h" /* LookupDeviceIntRec */ #include "exglobals.h" #include "dixevents.h" /* GrabDevice */ @@ -122,9 +121,9 @@ ProcXGrabDevice(ClientPtr client) rep.sequenceNumber = client->sequence; rep.length = 0; - dev = LookupDeviceIntRec(stuff->deviceid); - if (dev == NULL) - return BadDevice; + rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess); + if (rc != Success) + return rc; if ((rc = CreateMaskFromList(client, (XEventClass *) & stuff[1], stuff->event_count, tmp, dev, @@ -153,7 +152,7 @@ int CreateMaskFromList(ClientPtr client, XEventClass * list, int count, struct tmask *mask, DeviceIntPtr dev, int req) { - int i, j; + int rc, i, j; int device; DeviceIntPtr tdev; @@ -167,8 +166,10 @@ CreateMaskFromList(ClientPtr client, XEventClass * list, int count, if (device > 255) return BadClass; - tdev = LookupDeviceIntRec(device); - if (tdev == NULL || (dev != NULL && tdev != dev)) + rc = dixLookupDevice(&tdev, device, client, DixReadAccess); + if (rc != BadDevice && rc != Success) + return rc; + if (rc == BadDevice || (dev != NULL && tdev != dev)) return BadClass; for (j = 0; j < ExtEventIndex; j++) -- cgit v1.2.3