summaryrefslogtreecommitdiff
path: root/Xext
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2006-12-15 14:11:40 -0500
committerEamon Walsh <ewalsh@moss-huskies.epoch.ncsc.mil>2006-12-15 14:19:54 -0500
commit04c721854fbf1bd6379c165a53fab2bdc09961c0 (patch)
treebb190574a3aaeb80d141d3d7c47d2ddd87afc5b2 /Xext
parent670bbb87310503fcc17203cecfa6f4f2f5db51d2 (diff)
Convert callers of LookupWindow() to dixLookupWindow().
Diffstat (limited to 'Xext')
-rw-r--r--Xext/appgroup.c8
-rw-r--r--Xext/mbuf.c31
-rw-r--r--Xext/panoramiX.c27
-rw-r--r--Xext/shape.c52
-rw-r--r--Xext/xtest.c19
-rw-r--r--Xext/xvdisp.c12
6 files changed, 76 insertions, 73 deletions
diff --git a/Xext/appgroup.c b/Xext/appgroup.c
index 4f3000569..134b172f9 100644
--- a/Xext/appgroup.c
+++ b/Xext/appgroup.c
@@ -355,13 +355,15 @@ int AttrValidate(
AppGroupPtr pAppGrp)
{
WindowPtr pWin;
- int idepth, ivids, found;
+ int idepth, ivids, found, rc;
ScreenPtr pScreen;
DepthPtr pDepth;
ColormapPtr pColormap;
- pWin = LookupWindow (pAppGrp->default_root, client);
- /* XXX check that pWin is not NULL */
+ rc = dixLookupWindow(&pWin, pAppGrp->default_root, client,
+ DixUnknownAccess);
+ if (rc != Success)
+ return rc;
pScreen = pWin->drawable.pScreen;
if (WindowTable[pScreen->myNum]->drawable.id != pAppGrp->default_root)
return BadWindow;
diff --git a/Xext/mbuf.c b/Xext/mbuf.c
index e0361dda4..43e2cc107 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;
diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index 6b8b5f2f7..85f591356 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -958,12 +958,13 @@ ProcPanoramiXGetState(ClientPtr client)
REQUEST(xPanoramiXGetStateReq);
WindowPtr pWin;
xPanoramiXGetStateReply rep;
- register int n;
+ register int n, rc;
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
- 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;
@@ -984,12 +985,13 @@ ProcPanoramiXGetScreenCount(ClientPtr client)
REQUEST(xPanoramiXGetScreenCountReq);
WindowPtr pWin;
xPanoramiXGetScreenCountReply rep;
- register int n;
+ register int n, rc;
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
- 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;
@@ -1009,12 +1011,13 @@ ProcPanoramiXGetScreenSize(ClientPtr client)
REQUEST(xPanoramiXGetScreenSizeReq);
WindowPtr pWin;
xPanoramiXGetScreenSizeReply rep;
- register int n;
+ register int n, rc;
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
- 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;
diff --git a/Xext/shape.c b/Xext/shape.c
index 4a798da7c..58e3a69b3 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;
@@ -526,12 +526,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 +551,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);
@@ -645,12 +646,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);
@@ -709,13 +711,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;
@@ -990,14 +992,14 @@ 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, DixReadAccess);
enabled = xFalse;
@@ -1032,14 +1034,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);
diff --git a/Xext/xtest.c b/Xext/xtest.c
index 83f8b8cc6..c9b511e69 100644
--- a/Xext/xtest.c
+++ b/Xext/xtest.c
@@ -139,12 +139,12 @@ ProcXTestCompareCursor(client)
xXTestCompareCursorReply rep;
WindowPtr pWin;
CursorPtr pCursor;
- register int n;
+ register int n, rc;
REQUEST_SIZE_MATCH(xXTestCompareCursorReq);
- pWin = (WindowPtr)LookupWindow(stuff->window, client);
- if (!pWin)
- return(BadWindow);
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
+ if (rc != Success)
+ return rc;
if (stuff->cursor == None)
pCursor = NullCursor;
else if (stuff->cursor == XTestCurrentCursor)
@@ -173,12 +173,10 @@ ProcXTestFakeInput(client)
register ClientPtr client;
{
REQUEST(xXTestFakeInputReq);
- int nev;
- int n;
+ int nev, n, type, rc;
xEvent *ev;
DeviceIntPtr dev = NULL;
WindowPtr root;
- int type;
#ifdef XINPUT
Bool extension = FALSE;
deviceValuator *dv = NULL;
@@ -367,9 +365,10 @@ ProcXTestFakeInput(client)
root = GetCurrentRootWindow();
else
{
- root = LookupWindow(ev->u.keyButtonPointer.root, client);
- if (!root)
- return BadWindow;
+ rc = dixLookupWindow(&root, ev->u.keyButtonPointer.root, client,
+ DixUnknownAccess);
+ if (rc != Success)
+ return rc;
if (root->parent)
{
client->errorValue = ev->u.keyButtonPointer.root;
diff --git a/Xext/xvdisp.c b/Xext/xvdisp.c
index 2afb7c687..21d00aa7f 100644
--- a/Xext/xvdisp.c
+++ b/Xext/xvdisp.c
@@ -373,10 +373,8 @@ ProcXvQueryAdaptors(ClientPtr client)
xvFormat format;
xvAdaptorInfo ainfo;
xvQueryAdaptorsReply rep;
- int totalSize;
- int na;
+ int totalSize, na, nf, rc;
XvAdaptorPtr pa;
- int nf;
XvFormatPtr pf;
WindowPtr pWin;
ScreenPtr pScreen;
@@ -385,11 +383,9 @@ ProcXvQueryAdaptors(ClientPtr client)
REQUEST(xvQueryAdaptorsReq);
REQUEST_SIZE_MATCH(xvQueryAdaptorsReq);
- if(!(pWin = (WindowPtr)LookupWindow(stuff->window, client) ))
- {
- client->errorValue = stuff->window;
- return (BadWindow);
- }
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
+ if (rc != Success)
+ return rc;
pScreen = pWin->drawable.pScreen;
pxvs = (XvScreenPtr)pScreen->devPrivates[XvScreenIndex].ptr;