Exemple #1
0
static int
ProcXF86DRIAuthConnection(
    register ClientPtr client
)
{
    xXF86DRIAuthConnectionReply rep;
    
    REQUEST(xXF86DRIAuthConnectionReq);
    REQUEST_SIZE_MATCH(xXF86DRIAuthConnectionReq);
    if (stuff->screen >= screenInfo.numScreens) {
	client->errorValue = stuff->screen;
	return BadValue;
    }

    rep.type = X_Reply;
    rep.length = 0;
    rep.sequenceNumber = client->sequence;
    rep.authenticated = 1;

    if (!DRIAuthConnection( screenInfo.screens[stuff->screen], stuff->magic)) {
        ErrorF("Failed to authenticate %lu\n", (unsigned long)stuff->magic);
	rep.authenticated = 0;
    }
    WriteToClient(client, sizeof(xXF86DRIAuthConnectionReply), (char *)&rep);
    return (client->noClientException);
}
Exemple #2
0
static int
ProcAppleDRIAuthConnection(register ClientPtr client)
{
    xAppleDRIAuthConnectionReply rep;

    REQUEST(xAppleDRIAuthConnectionReq);
    REQUEST_SIZE_MATCH(xAppleDRIAuthConnectionReq);

    rep.type = X_Reply;
    rep.length = 0;
    rep.sequenceNumber = client->sequence;
    rep.authenticated = 1;

    if (!DRIAuthConnection(screenInfo.screens[stuff->screen],
                           stuff->magic)) {
        ErrorF("Failed to authenticate %u\n", (unsigned int)stuff->magic);
        rep.authenticated = 0;
    }

    if (client->swapped) {
        swaps(&rep.sequenceNumber);
        swapl(&rep.length);
        swapl(&rep.authenticated); /* Yes, this is a CARD32 ... sigh */
    }

    WriteToClient(client, sizeof(xAppleDRIAuthConnectionReply), (char *)&rep);
    return Success;
}