summaryrefslogtreecommitdiff
path: root/randr
diff options
context:
space:
mode:
Diffstat (limited to 'randr')
-rw-r--r--randr/rrdispatch.c7
-rw-r--r--randr/rrscreen.c40
2 files changed, 20 insertions, 27 deletions
diff --git a/randr/rrdispatch.c b/randr/rrdispatch.c
index b1ec68b83..7f98965a4 100644
--- a/randr/rrdispatch.c
+++ b/randr/rrdispatch.c
@@ -70,11 +70,12 @@ ProcRRSelectInput (ClientPtr client)
WindowPtr pWin;
RREventPtr pRREvent, *pHead;
XID clientResource;
+ int rc;
REQUEST_SIZE_MATCH(xRRSelectInputReq);
- pWin = SecurityLookupWindow (stuff->window, client, DixWriteAccess);
- if (!pWin)
- return BadWindow;
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixWriteAccess);
+ if (rc != Success)
+ return rc;
pHead = (RREventPtr *)SecurityLookupIDByType(client,
pWin->drawable.id, RREventType,
DixWriteAccess);
diff --git a/randr/rrscreen.c b/randr/rrscreen.c
index f1d8fc5d9..6f7afaf7a 100644
--- a/randr/rrscreen.c
+++ b/randr/rrscreen.c
@@ -217,13 +217,12 @@ ProcRRGetScreenSizeRange (ClientPtr client)
WindowPtr pWin;
ScreenPtr pScreen;
rrScrPrivPtr pScrPriv;
+ int rc;
REQUEST_SIZE_MATCH(xRRGetScreenInfoReq);
- pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
- DixReadAccess);
-
- if (!pWin)
- return BadWindow;
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
+ if (rc != Success)
+ return rc;
pScreen = pWin->drawable.pScreen;
pScrPriv = rrGetScrPriv(pScreen);
@@ -268,14 +267,12 @@ ProcRRSetScreenSize (ClientPtr client)
WindowPtr pWin;
ScreenPtr pScreen;
rrScrPrivPtr pScrPriv;
- int i;
+ int i, rc;
REQUEST_SIZE_MATCH(xRRSetScreenSizeReq);
- pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
- DixReadAccess);
-
- if (!pWin)
- return BadWindow;
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
+ if (rc != Success)
+ return rc;
pScreen = pWin->drawable.pScreen;
pScrPriv = rrGetScrPriv(pScreen);
@@ -336,19 +333,16 @@ ProcRRGetScreenResources (ClientPtr client)
rrScrPrivPtr pScrPriv;
CARD8 *extra;
unsigned long extraLen;
- int i;
+ int i, n, rc;
RRCrtc *crtcs;
RROutput *outputs;
xRRModeInfo *modeinfos;
CARD8 *names;
- int n;
REQUEST_SIZE_MATCH(xRRGetScreenResourcesReq);
- pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
- DixReadAccess);
-
- if (!pWin)
- return BadWindow;
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
+ if (rc != Success)
+ return rc;
pScreen = pWin->drawable.pScreen;
pScrPriv = rrGetScrPriv(pScreen);
@@ -580,7 +574,7 @@ ProcRRGetScreenInfo (ClientPtr client)
REQUEST(xRRGetScreenInfoReq);
xRRGetScreenInfoReply rep;
WindowPtr pWin;
- int n;
+ int n, rc;
ScreenPtr pScreen;
rrScrPrivPtr pScrPriv;
CARD8 *extra;
@@ -588,11 +582,9 @@ ProcRRGetScreenInfo (ClientPtr client)
RROutputPtr output;
REQUEST_SIZE_MATCH(xRRGetScreenInfoReq);
- pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
- DixReadAccess);
-
- if (!pWin)
- return BadWindow;
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
+ if (rc != Success)
+ return rc;
pScreen = pWin->drawable.pScreen;
pScrPriv = rrGetScrPriv(pScreen);