Exemple #1
0
static int
ProcXF86DRIDestroyDrawable(
    register ClientPtr client
)
{
    REQUEST(xXF86DRIDestroyDrawableReq);
    DrawablePtr pDrawable;
    REQUEST_SIZE_MATCH(xXF86DRIDestroyDrawableReq);
    int rc;

    if (stuff->screen >= screenInfo.numScreens) {
	client->errorValue = stuff->screen;
	return BadValue;
    }

    rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
			   DixReadAccess);
    if (rc != Success)
	return rc;

    if (!DRIDestroyDrawable(screenInfo.screens[stuff->screen], client,
			    pDrawable)) {
	return BadValue;
    }

    return (client->noClientException);
}
static int
ProcXF86DRIDestroyDrawable(
    register ClientPtr client
)
{
    REQUEST(xXF86DRIDestroyDrawableReq);
    DrawablePtr pDrawable;
    REQUEST_SIZE_MATCH(xXF86DRIDestroyDrawableReq);
    if (stuff->screen >= screenInfo.numScreens) {
	client->errorValue = stuff->screen;
	return BadValue;
    }

    if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable(
						(Drawable)stuff->drawable,
						client, 
						SecurityReadAccess))) {
	return BadValue;
    }

    if (!DRIDestroyDrawable( screenInfo.screens[stuff->screen], 
			     (Drawable)stuff->drawable,
			     pDrawable)) {
	return BadValue;
    }

    return (client->noClientException);
}