diff options
Diffstat (limited to 'Xext/mbuf.c')
-rw-r--r-- | Xext/mbuf.c | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/Xext/mbuf.c b/Xext/mbuf.c index e0361dda4..ed352e21b 100644 --- a/Xext/mbuf.c +++ b/Xext/mbuf.c @@ -448,16 +448,15 @@ ProcCreateImageBuffers (client) register int n; WindowPtr pWin; XID *ids; - int len, nbuf; - int i; - int err; + int len, nbuf, i, err, rc; REQUEST_AT_LEAST_SIZE (xMbufCreateImageBuffersReq); len = stuff->length - (sizeof(xMbufCreateImageBuffersReq) >> 2); if (len == 0) return BadLength; - if (!(pWin = LookupWindow (stuff->window, client))) - return BadWindow; + rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess); + if (rc != Success) + return rc; if (pWin->drawable.class == InputOnly) return BadMatch; switch (stuff->updateAction) @@ -584,10 +583,12 @@ ProcDestroyImageBuffers (client) { REQUEST (xMbufDestroyImageBuffersReq); WindowPtr pWin; + int rc; REQUEST_SIZE_MATCH (xMbufDestroyImageBuffersReq); - if (!(pWin = LookupWindow (stuff->window, client))) - return BadWindow; + rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess); + if (rc != Success) + return rc; DestroyImageBuffers (pWin); return Success; } @@ -599,16 +600,16 @@ ProcSetMBufferAttributes (client) REQUEST (xMbufSetMBufferAttributesReq); WindowPtr pWin; MultibuffersPtr pMultibuffers; - int len; + int len, rc; Mask vmask; Mask index2; CARD32 updateHint; XID *vlist; REQUEST_AT_LEAST_SIZE (xMbufSetMBufferAttributesReq); - pWin = LookupWindow (stuff->window, client); - if (!pWin) - return BadWindow; + rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess); + if (rc != Success) + return rc; pMultibuffers = (MultibuffersPtr)LookupIDByType (pWin->drawable.id, MultibuffersResType); if (!pMultibuffers) return BadMatch; @@ -655,12 +656,12 @@ ProcGetMBufferAttributes (client) MultibuffersPtr pMultibuffers; XID *ids; xMbufGetMBufferAttributesReply rep; - int i, n; + int i, n, rc; REQUEST_SIZE_MATCH (xMbufGetMBufferAttributesReq); - pWin = LookupWindow (stuff->window, client); - if (!pWin) - return BadWindow; + rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess); + if (rc != Success) + return rc; pMultibuffers = (MultibuffersPtr)LookupIDByType (pWin->drawable.id, MultibuffersResType); if (!pMultibuffers) return BadAccess; @@ -785,15 +786,15 @@ ProcGetBufferInfo (client) DrawablePtr pDrawable; xMbufGetBufferInfoReply rep; ScreenPtr pScreen; - int i, j, k; - int n; + int i, j, k, n, rc; xMbufBufferInfo *pInfo; int nInfo; DepthPtr pDepth; - pDrawable = (DrawablePtr) LookupDrawable (stuff->drawable, client); - if (!pDrawable) - return BadDrawable; + rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0, + DixUnknownAccess); + if (rc != Success) + return rc; pScreen = pDrawable->pScreen; nInfo = 0; for (i = 0; i < pScreen->numDepths; i++) |