summaryrefslogtreecommitdiff
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
parent670bbb87310503fcc17203cecfa6f4f2f5db51d2 (diff)
Convert callers of LookupWindow() to dixLookupWindow().
-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
-rw-r--r--Xi/chgprop.c9
-rw-r--r--Xi/exevents.c22
-rw-r--r--Xi/getprop.c9
-rw-r--r--Xi/getselev.c8
-rw-r--r--Xi/selectev.c8
-rw-r--r--Xi/ungrdevb.c7
-rw-r--r--Xi/ungrdevk.c7
-rw-r--r--composite/compwindow.c6
-rw-r--r--hw/darwin/quartz/pseudoramiX.c27
-rw-r--r--randr/rrxinerama.c21
16 files changed, 141 insertions, 132 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;
diff --git a/Xi/chgprop.c b/Xi/chgprop.c
index 52c38838d..bab4597b8 100644
--- a/Xi/chgprop.c
+++ b/Xi/chgprop.c
@@ -106,7 +106,7 @@ SProcXChangeDeviceDontPropagateList(register ClientPtr client)
int
ProcXChangeDeviceDontPropagateList(register ClientPtr client)
{
- int i;
+ int i, rc;
WindowPtr pWin;
struct tmask tmp[EMASKSIZE];
OtherInputMasks *others;
@@ -121,11 +121,10 @@ ProcXChangeDeviceDontPropagateList(register ClientPtr client)
return Success;
}
- pWin = (WindowPtr) LookupWindow(stuff->window, client);
- if (!pWin) {
- client->errorValue = stuff->window;
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
+ if (rc != Success) {
SendErrorToClient(client, IReqCode, X_ChangeDeviceDontPropagateList, 0,
- BadWindow);
+ rc);
return Success;
}
diff --git a/Xi/exevents.c b/Xi/exevents.c
index 92a5f0599..b7645f443 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -505,6 +505,7 @@ GrabButton(ClientPtr client, DeviceIntPtr dev, BYTE this_device_mode,
WindowPtr pWin, confineTo;
CursorPtr cursor;
GrabPtr grab;
+ int rc;
if ((this_device_mode != GrabModeSync) &&
(this_device_mode != GrabModeAsync)) {
@@ -524,15 +525,15 @@ GrabButton(ClientPtr client, DeviceIntPtr dev, BYTE this_device_mode,
client->errorValue = ownerEvents;
return BadValue;
}
- pWin = LookupWindow(grabWindow, client);
- if (!pWin)
- return BadWindow;
+ rc = dixLookupWindow(&pWin, grabWindow, client, DixUnknownAccess);
+ if (rc != Success)
+ return rc;
if (rconfineTo == None)
confineTo = NullWindow;
else {
- confineTo = LookupWindow(rconfineTo, client);
- if (!confineTo)
- return BadWindow;
+ rc = dixLookupWindow(&confineTo, rconfineTo, client, DixUnknownAccess);
+ if (rc != Success)
+ return rc;
}
if (rcursor == None)
cursor = NullCursor;
@@ -562,6 +563,7 @@ GrabKey(ClientPtr client, DeviceIntPtr dev, BYTE this_device_mode,
WindowPtr pWin;
GrabPtr grab;
KeyClassPtr k = dev->key;
+ int rc;
if (k == NULL)
return BadMatch;
@@ -588,9 +590,9 @@ GrabKey(ClientPtr client, DeviceIntPtr dev, BYTE this_device_mode,
client->errorValue = ownerEvents;
return BadValue;
}
- pWin = LookupWindow(grabWindow, client);
- if (!pWin)
- return BadWindow;
+ rc = dixLookupWindow(&pWin, grabWindow, client, DixUnknownAccess);
+ if (rc != Success)
+ return rc;
grab = CreateGrab(client->index, dev, pWin,
mask, ownerEvents, this_device_mode, other_devices_mode,
@@ -810,7 +812,7 @@ SendEvent(ClientPtr client, DeviceIntPtr d, Window dest, Bool propagate,
} else
effectiveFocus = pWin = inputFocus;
} else
- pWin = LookupWindow(dest, client);
+ dixLookupWindow(&pWin, dest, client, DixUnknownAccess);
if (!pWin)
return BadWindow;
if ((propagate != xFalse) && (propagate != xTrue)) {
diff --git a/Xi/getprop.c b/Xi/getprop.c
index 530841032..058c59514 100644
--- a/Xi/getprop.c
+++ b/Xi/getprop.c
@@ -100,7 +100,7 @@ int
ProcXGetDeviceDontPropagateList(register ClientPtr client)
{
CARD16 count = 0;
- int i;
+ int i, rc;
XEventClass *buf = NULL, *tbuf;
WindowPtr pWin;
xGetDeviceDontPropagateListReply rep;
@@ -115,11 +115,10 @@ ProcXGetDeviceDontPropagateList(register ClientPtr client)
rep.length = 0;
rep.count = 0;
- pWin = (WindowPtr) LookupWindow(stuff->window, client);
- if (!pWin) {
- client->errorValue = stuff->window;
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
+ if (rc != Success) {
SendErrorToClient(client, IReqCode, X_GetDeviceDontPropagateList, 0,
- BadWindow);
+ rc);
return Success;
}
diff --git a/Xi/getselev.c b/Xi/getselev.c
index a84c33d23..533c66cd7 100644
--- a/Xi/getselev.c
+++ b/Xi/getselev.c
@@ -98,8 +98,7 @@ SProcXGetSelectedExtensionEvents(register ClientPtr client)
int
ProcXGetSelectedExtensionEvents(register ClientPtr client)
{
- int i;
- int total_length = 0;
+ int i, rc, total_length = 0;
xGetSelectedExtensionEventsReply rep;
WindowPtr pWin;
XEventClass *buf = NULL;
@@ -118,9 +117,10 @@ ProcXGetSelectedExtensionEvents(register ClientPtr client)
rep.this_client_count = 0;
rep.all_clients_count = 0;
- if (!(pWin = LookupWindow(stuff->window, client))) {
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
+ if (rc != Success) {
SendErrorToClient(client, IReqCode, X_GetSelectedExtensionEvents, 0,
- BadWindow);
+ rc);
return Success;
}
diff --git a/Xi/selectev.c b/Xi/selectev.c
index 7d3ef9d48..8c893ca1e 100644
--- a/Xi/selectev.c
+++ b/Xi/selectev.c
@@ -170,11 +170,9 @@ ProcXSelectExtensionEvent(register ClientPtr client)
return Success;
}
- pWin = (WindowPtr) LookupWindow(stuff->window, client);
- if (!pWin) {
- client->errorValue = stuff->window;
- SendErrorToClient(client, IReqCode, X_SelectExtensionEvent, 0,
- BadWindow);
+ ret = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
+ if (ret != Success) {
+ SendErrorToClient(client, IReqCode, X_SelectExtensionEvent, 0, ret);
return Success;
}
diff --git a/Xi/ungrdevb.c b/Xi/ungrdevb.c
index 64bb213f5..8db9307ce 100644
--- a/Xi/ungrdevb.c
+++ b/Xi/ungrdevb.c
@@ -105,6 +105,7 @@ ProcXUngrabDeviceButton(ClientPtr client)
DeviceIntPtr mdev;
WindowPtr pWin;
GrabRec temporaryGrab;
+ int rc;
REQUEST(xUngrabDeviceButtonReq);
REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq);
@@ -134,9 +135,9 @@ ProcXUngrabDeviceButton(ClientPtr client)
} else
mdev = (DeviceIntPtr) LookupKeyboardDevice();
- pWin = LookupWindow(stuff->grabWindow, client);
- if (!pWin) {
- SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0, BadWindow);
+ rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixUnknownAccess);
+ if (rc != Success) {
+ SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0, rc);
return Success;
}
diff --git a/Xi/ungrdevk.c b/Xi/ungrdevk.c
index 0a6b3b619..ebb83bce7 100644
--- a/Xi/ungrdevk.c
+++ b/Xi/ungrdevk.c
@@ -105,6 +105,7 @@ ProcXUngrabDeviceKey(ClientPtr client)
DeviceIntPtr mdev;
WindowPtr pWin;
GrabRec temporaryGrab;
+ int rc;
REQUEST(xUngrabDeviceKeyReq);
REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq);
@@ -133,9 +134,9 @@ ProcXUngrabDeviceKey(ClientPtr client)
} else
mdev = (DeviceIntPtr) LookupKeyboardDevice();
- pWin = LookupWindow(stuff->grabWindow, client);
- if (!pWin) {
- SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0, BadWindow);
+ rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixUnknownAccess);
+ if (rc != Success) {
+ SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0, rc);
return Success;
}
if (((stuff->key > dev->key->curKeySyms.maxKeyCode) ||
diff --git a/composite/compwindow.c b/composite/compwindow.c
index 2c86cdd95..fed642ec6 100644
--- a/composite/compwindow.c
+++ b/composite/compwindow.c
@@ -93,10 +93,10 @@ typedef struct _compPixmapVisit {
static Bool
compRepaintBorder (ClientPtr pClient, pointer closure)
{
- WindowPtr pWindow = LookupWindow ((XID) closure, pClient);
+ WindowPtr pWindow;
+ int rc = dixLookupWindow(&pWindow, (XID)closure, pClient,DixUnknownAccess);
- if (pWindow)
- {
+ if (rc == Success) {
RegionRec exposed;
REGION_NULL(pScreen, &exposed);
diff --git a/hw/darwin/quartz/pseudoramiX.c b/hw/darwin/quartz/pseudoramiX.c
index ab57827d3..a003daf43 100644
--- a/hw/darwin/quartz/pseudoramiX.c
+++ b/hw/darwin/quartz/pseudoramiX.c
@@ -170,12 +170,13 @@ static int ProcPseudoramiXGetState(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;
@@ -196,12 +197,13 @@ static int ProcPseudoramiXGetScreenCount(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;
@@ -222,12 +224,13 @@ static int ProcPseudoramiXGetScreenSize(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/randr/rrxinerama.c b/randr/rrxinerama.c
index 771ed0976..8b951455c 100644
--- a/randr/rrxinerama.c
+++ b/randr/rrxinerama.c
@@ -116,14 +116,15 @@ ProcRRXineramaGetState(ClientPtr client)
REQUEST(xPanoramiXGetStateReq);
WindowPtr pWin;
xPanoramiXGetStateReply rep;
- register int n;
+ register int n, rc;
ScreenPtr pScreen;
rrScrPrivPtr pScrPriv;
Bool active = FALSE;
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;
pScreen = pWin->drawable.pScreen;
pScrPriv = rrGetScrPriv(pScreen);
@@ -180,11 +181,12 @@ ProcRRXineramaGetScreenCount(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;
@@ -206,11 +208,12 @@ ProcRRXineramaGetScreenSize(ClientPtr client)
WindowPtr pWin, pRoot;
ScreenPtr pScreen;
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;
pScreen = pWin->drawable.pScreen;
pRoot = WindowTable[pScreen->myNum];