diff options
author | marha <marha@users.sourceforge.net> | 2009-09-06 18:48:27 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-09-06 18:48:27 +0000 |
commit | a915739887477b28d924ecc8417ee107d125bd6c (patch) | |
tree | c02f315476b61892d1fd89182e18943dce8d6277 /xorg-server/randr/rrproperty.c | |
parent | 6f25a23db1df27e992c34f6fd4c82e83c44fc2e2 (diff) | |
download | vcxsrv-a915739887477b28d924ecc8417ee107d125bd6c.tar.gz vcxsrv-a915739887477b28d924ecc8417ee107d125bd6c.tar.bz2 vcxsrv-a915739887477b28d924ecc8417ee107d125bd6c.zip |
Switched to xorg-server-1.6.99.900.tar.gz
Diffstat (limited to 'xorg-server/randr/rrproperty.c')
-rw-r--r-- | xorg-server/randr/rrproperty.c | 41 |
1 files changed, 13 insertions, 28 deletions
diff --git a/xorg-server/randr/rrproperty.c b/xorg-server/randr/rrproperty.c index 12923a2c7..6187b855f 100644 --- a/xorg-server/randr/rrproperty.c +++ b/xorg-server/randr/rrproperty.c @@ -31,7 +31,8 @@ DeliverPropertyEvent(WindowPtr pWin, void *value) RREventPtr *pHead, pRREvent; ClientPtr client; - pHead = LookupIDByType(pWin->drawable.id, RREventType); + dixLookupResourceByType((pointer *)&pHead, pWin->drawable.id, + RREventType, serverClient, DixReadAccess); if (!pHead) return WT_WALKCHILDREN; @@ -419,10 +420,7 @@ ProcRRListOutputProperties (ClientPtr client) REQUEST_SIZE_MATCH(xRRListOutputPropertiesReq); - output = LookupOutput (client, stuff->output, DixReadAccess); - - if (!output) - return RRErrorBase + BadRROutput; + VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess); for (prop = output->properties; prop; prop = prop->next) numProps++; @@ -431,7 +429,7 @@ ProcRRListOutputProperties (ClientPtr client) return(BadAlloc); rep.type = X_Reply; - rep.length = (numProps * sizeof(Atom)) >> 2; + rep.length = bytes_to_int32(numProps * sizeof(Atom)); rep.sequenceNumber = client->sequence; rep.nAtoms = numProps; if (client->swapped) @@ -466,10 +464,7 @@ ProcRRQueryOutputProperty (ClientPtr client) REQUEST_SIZE_MATCH(xRRQueryOutputPropertyReq); - output = LookupOutput (client, stuff->output, DixReadAccess); - - if (!output) - return RRErrorBase + BadRROutput; + VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess); prop = RRQueryOutputProperty (output, stuff->property); if (!prop) @@ -513,12 +508,9 @@ ProcRRConfigureOutputProperty (ClientPtr client) REQUEST_AT_LEAST_SIZE(xRRConfigureOutputPropertyReq); - output = LookupOutput (client, stuff->output, DixReadAccess); - - if (!output) - return RRErrorBase + BadRROutput; + VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess); - num_valid = stuff->length - (sizeof (xRRConfigureOutputPropertyReq) >> 2); + num_valid = stuff->length - bytes_to_int32(sizeof (xRRConfigureOutputPropertyReq)); return RRConfigureOutputProperty (output, stuff->property, stuff->pending, stuff->range, FALSE, num_valid, @@ -552,15 +544,13 @@ ProcRRChangeOutputProperty (ClientPtr client) return BadValue; } len = stuff->nUnits; - if (len > ((0xffffffff - sizeof(xChangePropertyReq)) >> 2)) + if (len > bytes_to_int32((0xffffffff - sizeof(xChangePropertyReq)))) return BadLength; sizeInBytes = format>>3; totalSize = len * sizeInBytes; REQUEST_FIXED_SIZE(xRRChangeOutputPropertyReq, totalSize); - output = LookupOutput (client, stuff->output, DixWriteAccess); - if (!output) - return RRErrorBase + BadRROutput; + VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess); if (!ValidAtom(stuff->property)) { @@ -590,9 +580,7 @@ ProcRRDeleteOutputProperty (ClientPtr client) REQUEST_SIZE_MATCH(xRRDeleteOutputPropertyReq); UpdateCurrentTime(); - output = LookupOutput (client, stuff->output, DixWriteAccess); - if (!output) - return RRErrorBase + BadRROutput; + VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess); if (!ValidAtom(stuff->property)) { @@ -619,11 +607,8 @@ ProcRRGetOutputProperty (ClientPtr client) REQUEST_SIZE_MATCH(xRRGetOutputPropertyReq); if (stuff->delete) UpdateCurrentTime(); - output = LookupOutput (client, stuff->output, - stuff->delete ? DixWriteAccess : - DixReadAccess); - if (!output) - return RRErrorBase + BadRROutput; + VERIFY_RR_OUTPUT(stuff->output, output, + stuff->delete ? DixWriteAccess : DixReadAccess); if (!ValidAtom(stuff->property)) { @@ -723,7 +708,7 @@ ProcRRGetOutputProperty (ClientPtr client) } reply.bytesAfter = n - (ind + len); reply.format = prop_value->format; - reply.length = (len + 3) >> 2; + reply.length = bytes_to_int32(len); if (prop_value->format) reply.nItems = len / (prop_value->format / 8); else |