summaryrefslogtreecommitdiff
path: root/xfixes/xfixes.h
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2009-04-14 14:24:31 -0400
committerKristian Høgsberg <krh@redhat.com>2009-04-14 14:24:40 -0400
commite7785e8af3e34f9d1089d8499d16802984ab9823 (patch)
tree9d159db4cc2f1c27d5ef38b1fcdd2ef05239b227 /xfixes/xfixes.h
parent0eb19f9437b7d8c19592e49eedb028771d300d80 (diff)
xfixes: Fix a couple of resource lookups
Diffstat (limited to 'xfixes/xfixes.h')
-rw-r--r--xfixes/xfixes.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/xfixes/xfixes.h b/xfixes/xfixes.h
index ade2f8236..69d162ffe 100644
--- a/xfixes/xfixes.h
+++ b/xfixes/xfixes.h
@@ -32,13 +32,19 @@
extern _X_EXPORT RESTYPE RegionResType;
extern _X_EXPORT int XFixesErrorBase;
-#define VERIFY_REGION(pRegion, rid, client, mode) { \
- pRegion = SecurityLookupIDByType (client, rid, RegionResType, mode); \
- if (!pRegion) { \
- client->errorValue = rid; \
- return XFixesErrorBase + BadRegion; \
- } \
-}
+#define VERIFY_REGION(pRegion, rid, client, mode) \
+ do { \
+ int err; \
+ err = dixLookupResourceByType((pointer *) &pRegion, rid, \
+ RegionResType, client, mode); \
+ if (err == BadValue) { \
+ client->errorValue = rid; \
+ return XFixesErrorBase + BadRegion; \
+ } else if (err != Success) { \
+ client->errorValue = rid; \
+ return err; \
+ } \
+ } while (0)
#define VERIFY_REGION_OR_NONE(pRegion, rid, client, mode) { \
pRegion = 0; \