diff options
author | Eamon Walsh <ewalsh@tycho.nsa.gov> | 2009-04-29 01:04:37 -0400 |
---|---|---|
committer | Eamon Walsh <ewalsh@tycho.nsa.gov> | 2009-04-29 01:04:37 -0400 |
commit | 57aff88c7d0761e590806d07bee1c9410680c89f (patch) | |
tree | 48f05f58a72183556af3b0a7f3f286959d7e096a /dbe/dbe.c | |
parent | 1abe0ee3da5e1268c7315f841d31337ea6524cf0 (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/dbe.c')
-rw-r--r-- | dbe/dbe.c | 33 |
1 files changed, 19 insertions, 14 deletions
@@ -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; |