aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/resource.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-09-02 19:53:35 +0000
committermarha <marha@users.sourceforge.net>2009-09-02 19:53:35 +0000
commit6f25a23db1df27e992c34f6fd4c82e83c44fc2e2 (patch)
treea49e113cbab862b959559a047afef689df50e492 /xorg-server/dix/resource.c
parent78b8aacf420184834a24f11d138b88c2f3ed09d1 (diff)
downloadvcxsrv-6f25a23db1df27e992c34f6fd4c82e83c44fc2e2.tar.gz
vcxsrv-6f25a23db1df27e992c34f6fd4c82e83c44fc2e2.tar.bz2
vcxsrv-6f25a23db1df27e992c34f6fd4c82e83c44fc2e2.zip
Switched to xorg-server-1.6.3.901.tar.gz
Diffstat (limited to 'xorg-server/dix/resource.c')
-rw-r--r--xorg-server/dix/resource.c39
1 files changed, 34 insertions, 5 deletions
diff --git a/xorg-server/dix/resource.c b/xorg-server/dix/resource.c
index 7b0441ee9..7b133cae4 100644
--- a/xorg-server/dix/resource.c
+++ b/xorg-server/dix/resource.c
@@ -846,11 +846,10 @@ LegalNewID(XID id, ClientPtr client)
}
_X_EXPORT int
-dixLookupResource(pointer *result, XID id, RESTYPE rtype,
- ClientPtr client, Mask mode)
+dixLookupResourceByType(pointer *result, XID id, RESTYPE rtype,
+ ClientPtr client, Mask mode)
{
int cid = CLIENT_ID(id);
- int istype = (rtype & TypeMask) && (rtype != RC_ANY);
ResourcePtr res = NULL;
*result = NULL;
@@ -859,8 +858,38 @@ dixLookupResource(pointer *result, XID id, RESTYPE rtype,
res = clientTable[cid].resources[Hash(cid, id)];
for (; res; res = res->next)
- if ((res->id == id) && ((istype && res->type == rtype) ||
- (!istype && res->type & rtype)))
+ if (res->id == id && res->type == rtype)
+ break;
+ }
+ if (!res)
+ return BadValue;
+
+ if (client) {
+ client->errorValue = id;
+ cid = XaceHook(XACE_RESOURCE_ACCESS, client, id, res->type,
+ res->value, RT_NONE, NULL, mode);
+ if (cid != Success)
+ return cid;
+ }
+
+ *result = res->value;
+ return Success;
+}
+
+_X_EXPORT int
+dixLookupResourceByClass(pointer *result, XID id, RESTYPE rclass,
+ ClientPtr client, Mask mode)
+{
+ int cid = CLIENT_ID(id);
+ ResourcePtr res = NULL;
+
+ *result = NULL;
+
+ if ((cid < MAXCLIENTS) && clientTable[cid].buckets) {
+ res = clientTable[cid].resources[Hash(cid, id)];
+
+ for (; res; res = res->next)
+ if (res->id == id && (res->type & rclass))
break;
}
if (!res)