summaryrefslogtreecommitdiff
path: root/dix/resource.c
diff options
context:
space:
mode:
Diffstat (limited to 'dix/resource.c')
-rw-r--r--dix/resource.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/dix/resource.c b/dix/resource.c
index dc6945dd1..73bc3a998 100644
--- a/dix/resource.c
+++ b/dix/resource.c
@@ -392,13 +392,16 @@ unsigned int
GetXIDList(ClientPtr pClient, unsigned count, XID *pids)
{
unsigned int found = 0;
- XID id = pClient->clientAsMask;
+ XID rc, id = pClient->clientAsMask;
XID maxid;
+ pointer val;
maxid = id | RESOURCE_ID_MASK;
while ( (found < count) && (id <= maxid) )
{
- if (!LookupIDByClass(id, RC_ANY))
+ rc = dixLookupResourceByClass(&val, id, RC_ANY, serverClient,
+ DixGetAttrAccess);
+ if (rc == BadValue)
{
pids[found++] = id;
}
@@ -826,6 +829,8 @@ FreeAllResources(void)
Bool
LegalNewID(XID id, ClientPtr client)
{
+ pointer val;
+ int rc;
#ifdef PANORAMIX
XID minid, maxid;
@@ -838,9 +843,16 @@ LegalNewID(XID id, ClientPtr client)
return TRUE;
}
#endif /* PANORAMIX */
- return ((client->clientAsMask == (id & ~RESOURCE_ID_MASK)) &&
- ((clientTable[client->index].expectID <= id) ||
- !LookupIDByClass(id, RC_ANY)));
+ if (client->clientAsMask == (id & ~RESOURCE_ID_MASK))
+ {
+ if (clientTable[client->index].expectID <= id)
+ return TRUE;
+
+ rc = dixLookupResourceByClass(&val, id, RC_ANY, serverClient,
+ DixGetAttrAccess);
+ return (rc == BadValue);
+ }
+ return FALSE;
}
int