aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/randr/rrmode.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-09-09 05:23:48 +0000
committermarha <marha@users.sourceforge.net>2009-09-09 05:23:48 +0000
commit81f91c615982e50bb62708201569c33a3cd3d973 (patch)
tree4f32ecc48a3b7b5e76642f3792338263c53879bd /xorg-server/randr/rrmode.c
parentb571a562410f565af2bdde52d9f7f9a23ffae04f (diff)
parenta915739887477b28d924ecc8417ee107d125bd6c (diff)
downloadvcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.tar.gz
vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.tar.bz2
vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.zip
svn merge https://vcxsrv.svn.sourceforge.net/svnroot/vcxsrv/branches/released .
Diffstat (limited to 'xorg-server/randr/rrmode.c')
-rw-r--r--xorg-server/randr/rrmode.c46
1 files changed, 9 insertions, 37 deletions
diff --git a/xorg-server/randr/rrmode.c b/xorg-server/randr/rrmode.c
index 2fa440385..9642ddae3 100644
--- a/xorg-server/randr/rrmode.c
+++ b/xorg-server/randr/rrmode.c
@@ -288,7 +288,7 @@ ProcRRCreateMode (ClientPtr client)
RRModePtr mode;
REQUEST_AT_LEAST_SIZE (xRRCreateModeReq);
- rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
if (rc != Success)
return rc;
@@ -297,10 +297,10 @@ ProcRRCreateMode (ClientPtr client)
modeInfo = &stuff->modeInfo;
name = (char *) (stuff + 1);
- units_after = (stuff->length - (sizeof (xRRCreateModeReq) >> 2));
+ units_after = (stuff->length - bytes_to_int32(sizeof (xRRCreateModeReq)));
/* check to make sure requested name fits within the data provided */
- if ((int) (modeInfo->nameLength + 3) >> 2 > units_after)
+ if (bytes_to_int32(modeInfo->nameLength) > units_after)
return BadLength;
mode = RRModeCreateUser (pScreen, modeInfo, name, &error);
@@ -332,12 +332,8 @@ ProcRRDestroyMode (ClientPtr client)
RRModePtr mode;
REQUEST_SIZE_MATCH(xRRDestroyModeReq);
- mode = LookupIDByType (stuff->mode, RRModeType);
- if (!mode)
- {
- client->errorValue = stuff->mode;
- return RRErrorBase + BadRRMode;
- }
+ VERIFY_RR_MODE(stuff->mode, mode, DixDestroyAccess);
+
if (!mode->userScreen)
return BadMatch;
if (mode->refcnt > 1)
@@ -354,20 +350,8 @@ ProcRRAddOutputMode (ClientPtr client)
RROutputPtr output;
REQUEST_SIZE_MATCH(xRRAddOutputModeReq);
- output = LookupOutput(client, stuff->output, DixReadAccess);
-
- if (!output)
- {
- client->errorValue = stuff->output;
- return RRErrorBase + BadRROutput;
- }
-
- mode = LookupIDByType (stuff->mode, RRModeType);
- if (!mode)
- {
- client->errorValue = stuff->mode;
- return RRErrorBase + BadRRMode;
- }
+ VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);
+ VERIFY_RR_MODE(stuff->mode, mode, DixUseAccess);
return RROutputAddUserMode (output, mode);
}
@@ -380,20 +364,8 @@ ProcRRDeleteOutputMode (ClientPtr client)
RROutputPtr output;
REQUEST_SIZE_MATCH(xRRDeleteOutputModeReq);
- output = LookupOutput(client, stuff->output, DixReadAccess);
-
- if (!output)
- {
- client->errorValue = stuff->output;
- return RRErrorBase + BadRROutput;
- }
-
- mode = LookupIDByType (stuff->mode, RRModeType);
- if (!mode)
- {
- client->errorValue = stuff->mode;
- return RRErrorBase + BadRRMode;
- }
+ VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);
+ VERIFY_RR_MODE(stuff->mode, mode, DixUseAccess);
return RROutputDeleteUserMode (output, mode);
}