diff options
Diffstat (limited to 'Xext/shape.c')
-rw-r--r-- | Xext/shape.c | 89 |
1 files changed, 45 insertions, 44 deletions
diff --git a/Xext/shape.c b/Xext/shape.c index c5bb4e38c..928eeee31 100644 --- a/Xext/shape.c +++ b/Xext/shape.c @@ -1,5 +1,3 @@ -/* $XdotOrg: xserver/xorg/Xext/shape.c,v 1.9 2005/07/03 08:53:36 daniels Exp $ */ -/* $XFree86: xc/programs/Xserver/Xext/shape.c,v 3.18 2003/10/28 23:08:43 tsi Exp $ */ /************************************************************ Copyright 1989, 1998 The Open Group @@ -26,7 +24,6 @@ in this Software without prior written authorization from The Open Group. ********************************************************/ -/* $Xorg: shape.c,v 1.4 2001/02/09 02:04:32 xorgcvs Exp $ */ #define NEED_REPLIES #define NEED_EVENTS #ifdef HAVE_DIX_CONFIG_H @@ -146,7 +143,7 @@ typedef struct _ShapeEvent { ****************/ void -ShapeExtensionInit(INITARGS) +ShapeExtensionInit(void) { ExtensionEntry *extEntry; @@ -319,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; @@ -393,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) { @@ -422,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; @@ -447,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 || @@ -491,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; @@ -529,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) { @@ -553,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); @@ -619,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) { @@ -648,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); @@ -691,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) { @@ -712,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; @@ -823,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) { @@ -993,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; @@ -1035,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); |