diff options
Diffstat (limited to 'Xext/shape.c')
-rw-r--r-- | Xext/shape.c | 84 |
1 files changed, 44 insertions, 40 deletions
diff --git a/Xext/shape.c b/Xext/shape.c index 4d9d3fb5b..928eeee31 100644 --- a/Xext/shape.c +++ b/Xext/shape.c @@ -316,16 +316,16 @@ ProcShapeRectangles (client) ScreenPtr pScreen; REQUEST(xShapeRectanglesReq); xRectangle *prects; - int nrects, ctype; + int nrects, ctype, rc; RegionPtr srcRgn; RegionPtr *destRgn; CreateDftPtr createDefault; REQUEST_AT_LEAST_SIZE (xShapeRectanglesReq); UpdateCurrentTime(); - pWin = LookupWindow (stuff->dest, client); - if (!pWin) - return BadWindow; + rc = dixLookupWindow(&pWin, stuff->dest, client, DixUnknownAccess); + if (rc != Success) + return rc; switch (stuff->destKind) { case ShapeBounding: createDefault = CreateBoundingShape; @@ -390,7 +390,7 @@ ProcPanoramiXShapeRectangles( REQUEST_AT_LEAST_SIZE (xShapeRectanglesReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->dest, XRT_WINDOW, SecurityWriteAccess))) + client, stuff->dest, XRT_WINDOW, DixWriteAccess))) return BadWindow; FOR_NSCREENS(j) { @@ -419,12 +419,13 @@ ProcShapeMask (client) RegionPtr *destRgn; PixmapPtr pPixmap; CreateDftPtr createDefault; + int rc; REQUEST_SIZE_MATCH (xShapeMaskReq); UpdateCurrentTime(); - pWin = SecurityLookupWindow (stuff->dest, client, SecurityWriteAccess); - if (!pWin) - return BadWindow; + rc = dixLookupWindow(&pWin, stuff->dest, client, DixWriteAccess); + if (rc != Success) + return rc; switch (stuff->destKind) { case ShapeBounding: createDefault = CreateBoundingShape; @@ -444,7 +445,7 @@ ProcShapeMask (client) srcRgn = 0; else { pPixmap = (PixmapPtr) SecurityLookupIDByType(client, stuff->src, - RT_PIXMAP, SecurityReadAccess); + RT_PIXMAP, DixReadAccess); if (!pPixmap) return BadPixmap; if (pPixmap->drawable.pScreen != pScreen || @@ -488,12 +489,12 @@ ProcPanoramiXShapeMask( REQUEST_SIZE_MATCH (xShapeMaskReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->dest, XRT_WINDOW, SecurityWriteAccess))) + client, stuff->dest, XRT_WINDOW, DixWriteAccess))) return BadWindow; if(stuff->src != None) { if(!(pmap = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->src, XRT_PIXMAP, SecurityReadAccess))) + client, stuff->src, XRT_PIXMAP, DixReadAccess))) return BadPixmap; } else pmap = NULL; @@ -526,12 +527,13 @@ ProcShapeCombine (client) CreateDftPtr createDefault; CreateDftPtr createSrc; RegionPtr tmp; + int rc; REQUEST_SIZE_MATCH (xShapeCombineReq); UpdateCurrentTime(); - pDestWin = LookupWindow (stuff->dest, client); - if (!pDestWin) - return BadWindow; + rc = dixLookupWindow(&pDestWin, stuff->dest, client, DixUnknownAccess); + if (rc != Success) + return rc; if (!pDestWin->optional) MakeWindowOptional (pDestWin); switch (stuff->destKind) { @@ -550,9 +552,9 @@ ProcShapeCombine (client) } pScreen = pDestWin->drawable.pScreen; - pSrcWin = LookupWindow (stuff->src, client); - if (!pSrcWin) - return BadWindow; + rc = dixLookupWindow(&pSrcWin, stuff->src, client, DixUnknownAccess); + if (rc != Success) + return rc; switch (stuff->srcKind) { case ShapeBounding: srcRgn = wBoundingShape (pSrcWin); @@ -616,11 +618,11 @@ ProcPanoramiXShapeCombine( REQUEST_AT_LEAST_SIZE (xShapeCombineReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->dest, XRT_WINDOW, SecurityWriteAccess))) + client, stuff->dest, XRT_WINDOW, DixWriteAccess))) return BadWindow; if(!(win2 = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->src, XRT_WINDOW, SecurityReadAccess))) + client, stuff->src, XRT_WINDOW, DixReadAccess))) return BadWindow; FOR_NSCREENS(j) { @@ -645,12 +647,13 @@ ProcShapeOffset (client) ScreenPtr pScreen; REQUEST(xShapeOffsetReq); RegionPtr srcRgn; + int rc; REQUEST_SIZE_MATCH (xShapeOffsetReq); UpdateCurrentTime(); - pWin = LookupWindow (stuff->dest, client); - if (!pWin) - return BadWindow; + rc = dixLookupWindow(&pWin, stuff->dest, client, DixUnknownAccess); + if (rc != Success) + return rc; switch (stuff->destKind) { case ShapeBounding: srcRgn = wBoundingShape (pWin); @@ -688,7 +691,7 @@ ProcPanoramiXShapeOffset( REQUEST_AT_LEAST_SIZE (xShapeOffsetReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->dest, XRT_WINDOW, SecurityWriteAccess))) + client, stuff->dest, XRT_WINDOW, DixWriteAccess))) return BadWindow; FOR_NSCREENS(j) { @@ -709,13 +712,13 @@ ProcShapeQueryExtents (client) WindowPtr pWin; xShapeQueryExtentsReply rep; BoxRec extents, *pExtents; - register int n; + register int n, rc; RegionPtr region; REQUEST_SIZE_MATCH (xShapeQueryExtentsReq); - pWin = LookupWindow (stuff->window, client); - if (!pWin) - return BadWindow; + rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess); + if (rc != Success) + return rc; rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; @@ -820,13 +823,14 @@ ProcShapeSelectInput (client) WindowPtr pWin; ShapeEventPtr pShapeEvent, pNewShapeEvent, *pHead; XID clientResource; + int rc; REQUEST_SIZE_MATCH (xShapeSelectInputReq); - pWin = SecurityLookupWindow (stuff->window, client, SecurityWriteAccess); - if (!pWin) - return BadWindow; + rc = dixLookupWindow(&pWin, stuff->window, client, DixWriteAccess); + if (rc != Success) + return rc; pHead = (ShapeEventPtr *)SecurityLookupIDByType(client, - pWin->drawable.id, EventType, SecurityWriteAccess); + pWin->drawable.id, EventType, DixWriteAccess); switch (stuff->enable) { case xTrue: if (pHead) { @@ -990,16 +994,16 @@ ProcShapeInputSelected (client) REQUEST(xShapeInputSelectedReq); WindowPtr pWin; ShapeEventPtr pShapeEvent, *pHead; - int enabled; + int enabled, rc; xShapeInputSelectedReply rep; register int n; REQUEST_SIZE_MATCH (xShapeInputSelectedReq); - pWin = LookupWindow (stuff->window, client); - if (!pWin) - return BadWindow; + rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess); + if (rc != Success) + return rc; pHead = (ShapeEventPtr *) SecurityLookupIDByType(client, - pWin->drawable.id, EventType, SecurityReadAccess); + pWin->drawable.id, EventType, DixReadAccess); enabled = xFalse; if (pHead) { for (pShapeEvent = *pHead; @@ -1032,14 +1036,14 @@ ProcShapeGetRectangles (client) WindowPtr pWin; xShapeGetRectanglesReply rep; xRectangle *rects; - int nrects, i; + int nrects, i, rc; RegionPtr region; register int n; REQUEST_SIZE_MATCH(xShapeGetRectanglesReq); - pWin = LookupWindow (stuff->window, client); - if (!pWin) - return BadWindow; + rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess); + if (rc != Success) + return rc; switch (stuff->kind) { case ShapeBounding: region = wBoundingShape(pWin); |