summaryrefslogtreecommitdiff
path: root/Xi/grabdev.c
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2007-09-28 08:02:00 -0400
committerEamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil>2007-09-28 08:02:00 -0400
commit5c03d131815cfe2f78792277ab8352e69e830196 (patch)
treed321abc400033fce3978558ce9186d89febcdbef /Xi/grabdev.c
parent27612748e0ec20f3a23839f0a12e39f598dd722c (diff)
xace: add new hooks + access controls: XInput extension.
Introduces new dix API to lookup a device, dixLookupDevice(), which replaces LookupDeviceIntRec and LookupDevice.
Diffstat (limited to 'Xi/grabdev.c')
-rw-r--r--Xi/grabdev.c15
1 files changed, 8 insertions, 7 deletions
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 <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h>
-#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++)