summaryrefslogtreecommitdiff
path: root/dbe
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2009-04-29 01:04:37 -0400
committerEamon Walsh <ewalsh@tycho.nsa.gov>2009-04-29 01:04:37 -0400
commit57aff88c7d0761e590806d07bee1c9410680c89f (patch)
tree48f05f58a72183556af3b0a7f3f286959d7e096a /dbe
parent1abe0ee3da5e1268c7315f841d31337ea6524cf0 (diff)
Fix most remaining deprecated resource lookups.
Callsites updated to use dixLookupResourceBy{Type,Class}. TODO: Audit access modes to make sure they reflect the usage.
Diffstat (limited to 'dbe')
-rw-r--r--dbe/dbe.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/dbe/dbe.c b/dbe/dbe.c
index 3fd99dfc9..b8f61e742 100644
--- a/dbe/dbe.c
+++ b/dbe/dbe.c
@@ -411,20 +411,23 @@ ProcDbeDeallocateBackBufferName(ClientPtr client)
{
REQUEST(xDbeDeallocateBackBufferNameReq);
DbeWindowPrivPtr pDbeWindowPriv;
- int i;
+ int rc, i;
+ pointer val;
REQUEST_SIZE_MATCH(xDbeDeallocateBackBufferNameReq);
/* Buffer name must be valid */
- if (!(pDbeWindowPriv = (DbeWindowPrivPtr)SecurityLookupIDByType(client,
- stuff->buffer, dbeWindowPrivResType, DixDestroyAccess)) ||
- !(SecurityLookupIDByType(client, stuff->buffer, dbeDrawableResType,
- DixDestroyAccess)))
- {
- client->errorValue = stuff->buffer;
- return(dbeErrorBase + DbeBadBuffer);
- }
+ rc = dixLookupResourceByType((pointer *)&pDbeWindowPriv, stuff->buffer,
+ dbeWindowPrivResType, client,
+ DixDestroyAccess);
+ if (rc != Success)
+ return (rc == BadValue) ? dbeErrorBase + DbeBadBuffer : rc;
+
+ rc = dixLookupResourceByType(&val, stuff->buffer, dbeDrawableResType,
+ client, DixDestroyAccess);
+ if (rc != Success)
+ return (rc == BadValue) ? dbeErrorBase + DbeBadBuffer : rc;
/* Make sure that the id is valid for the window.
* This is paranoid code since we already looked up the ID by type
@@ -833,19 +836,21 @@ ProcDbeGetBackBufferAttributes(ClientPtr client)
REQUEST(xDbeGetBackBufferAttributesReq);
xDbeGetBackBufferAttributesReply rep;
DbeWindowPrivPtr pDbeWindowPriv;
- int n;
+ int rc, n;
REQUEST_SIZE_MATCH(xDbeGetBackBufferAttributesReq);
- if (!(pDbeWindowPriv = (DbeWindowPrivPtr)SecurityLookupIDByType(client,
- stuff->buffer, dbeWindowPrivResType, DixGetAttrAccess)))
+ rc = dixLookupResourceByType((pointer *)&pDbeWindowPriv, stuff->buffer,
+ dbeWindowPrivResType, client,
+ DixGetAttrAccess);
+ if (rc == Success)
{
- rep.attributes = None;
+ rep.attributes = pDbeWindowPriv->pWindow->drawable.id;
}
else
{
- rep.attributes = pDbeWindowPriv->pWindow->drawable.id;
+ rep.attributes = None;
}
rep.type = X_Reply;