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/hw/xfree86/dri2/dri2ext.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/hw/xfree86/dri2/dri2ext.c')
-rw-r--r-- | xorg-server/hw/xfree86/dri2/dri2ext.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/xorg-server/hw/xfree86/dri2/dri2ext.c b/xorg-server/hw/xfree86/dri2/dri2ext.c index 3c06174cb..72f9a448b 100644 --- a/xorg-server/hw/xfree86/dri2/dri2ext.c +++ b/xorg-server/hw/xfree86/dri2/dri2ext.c @@ -34,7 +34,6 @@ #include <xorg-config.h> #endif -#define NEED_REPLIES #include <X11/X.h> #include <X11/Xproto.h> #include <X11/extensions/dri2proto.h> @@ -54,10 +53,10 @@ static ExtensionEntry *dri2Extension; static RESTYPE dri2DrawableRes; static Bool -validDrawable(ClientPtr client, XID drawable, +validDrawable(ClientPtr client, XID drawable, Mask access_mode, DrawablePtr *pDrawable, int *status) { - *status = dixLookupDrawable(pDrawable, drawable, client, 0, DixReadAccess); + *status = dixLookupDrawable(pDrawable, drawable, client, 0, access_mode); if (*status != Success) { client->errorValue = drawable; return FALSE; @@ -106,7 +105,8 @@ ProcDRI2Connect(ClientPtr client) const char *deviceName; REQUEST_SIZE_MATCH(xDRI2ConnectReq); - if (!validDrawable(client, stuff->window, &pDraw, &status)) + if (!validDrawable(client, stuff->window, DixGetAttrAccess, + &pDraw, &status)) return status; rep.type = X_Reply; @@ -141,7 +141,8 @@ ProcDRI2Authenticate(ClientPtr client) int status; REQUEST_SIZE_MATCH(xDRI2AuthenticateReq); - if (!validDrawable(client, stuff->window, &pDraw, &status)) + if (!validDrawable(client, stuff->window, DixGetAttrAccess, + &pDraw, &status)) return status; rep.type = X_Reply; @@ -162,7 +163,8 @@ ProcDRI2CreateDrawable(ClientPtr client) REQUEST_SIZE_MATCH(xDRI2CreateDrawableReq); - if (!validDrawable(client, stuff->drawable, &pDrawable, &status)) + if (!validDrawable(client, stuff->drawable, DixAddAccess, + &pDrawable, &status)) return status; status = DRI2CreateDrawable(pDrawable); @@ -185,7 +187,8 @@ ProcDRI2DestroyDrawable(ClientPtr client) int status; REQUEST_SIZE_MATCH(xDRI2DestroyDrawableReq); - if (!validDrawable(client, stuff->drawable, &pDrawable, &status)) + if (!validDrawable(client, stuff->drawable, DixRemoveAccess, + &pDrawable, &status)) return status; FreeResourceByType(stuff->drawable, dri2DrawableRes, FALSE); @@ -196,7 +199,7 @@ ProcDRI2DestroyDrawable(ClientPtr client) static void send_buffers_reply(ClientPtr client, DrawablePtr pDrawable, - DRI2Buffer2Ptr *buffers, int count, int width, int height) + DRI2BufferPtr *buffers, int count, int width, int height) { xDRI2GetBuffersReply rep; int skip = 0; @@ -246,12 +249,13 @@ ProcDRI2GetBuffers(ClientPtr client) { REQUEST(xDRI2GetBuffersReq); DrawablePtr pDrawable; - DRI2Buffer2Ptr *buffers; + DRI2BufferPtr *buffers; int status, width, height, count; unsigned int *attachments; REQUEST_FIXED_SIZE(xDRI2GetBuffersReq, stuff->count * 4); - if (!validDrawable(client, stuff->drawable, &pDrawable, &status)) + if (!validDrawable(client, stuff->drawable, DixReadAccess | DixWriteAccess, + &pDrawable, &status)) return status; attachments = (unsigned int *) &stuff[1]; @@ -269,12 +273,13 @@ ProcDRI2GetBuffersWithFormat(ClientPtr client) { REQUEST(xDRI2GetBuffersReq); DrawablePtr pDrawable; - DRI2Buffer2Ptr *buffers; + DRI2BufferPtr *buffers; int status, width, height, count; unsigned int *attachments; REQUEST_FIXED_SIZE(xDRI2GetBuffersReq, stuff->count * (2 * 4)); - if (!validDrawable(client, stuff->drawable, &pDrawable, &status)) + if (!validDrawable(client, stuff->drawable, DixReadAccess | DixWriteAccess, + &pDrawable, &status)) return status; attachments = (unsigned int *) &stuff[1]; @@ -297,7 +302,8 @@ ProcDRI2CopyRegion(ClientPtr client) REQUEST_SIZE_MATCH(xDRI2CopyRegionReq); - if (!validDrawable(client, stuff->drawable, &pDrawable, &status)) + if (!validDrawable(client, stuff->drawable, DixWriteAccess, + &pDrawable, &status)) return status; VERIFY_REGION(pRegion, stuff->region, client, DixReadAccess); |