Exemple #1
0
int
ProcSetEventMask(ClientPtr client)
{
    REQUEST(fsSetEventMaskReq);
    REQUEST_AT_LEAST_SIZE(fsSetEventMaskReq);

    if (stuff->event_mask & ~AllEventMasks) {
	SendErrToClient(client, FSBadEventMask, (pointer) &stuff->event_mask);
	return FSBadEventMask;
    }
    client->eventmask = stuff->event_mask;
    return client->noClientException;
}
Exemple #2
0
/* The following routine is used for all Poly drawing requests
   (except FillPoly, which uses a different request format) */
int
SProcPoly(ClientPtr client)
{
    char n;

    REQUEST(xPolyPointReq);
    swaps(&stuff->length, n);
    REQUEST_AT_LEAST_SIZE(xPolyPointReq);
    swapl(&stuff->drawable, n);
    swapl(&stuff->gc, n);
    SwapRestS(stuff);
    return((* ProcVector[stuff->reqType])(client));
}
Exemple #3
0
int _X_COLD
SProcXChangeDeviceKeyMapping(ClientPtr client)
{
    unsigned int count;

    REQUEST(xChangeDeviceKeyMappingReq);
    swaps(&stuff->length);
    REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq);
    count = stuff->keyCodes * stuff->keySymsPerKeyCode;
    REQUEST_FIXED_SIZE(xChangeDeviceKeyMappingReq, count * sizeof(CARD32));
    SwapLongs((CARD32 *) (&stuff[1]), count);
    return (ProcXChangeDeviceKeyMapping(client));
}
Exemple #4
0
static int _X_COLD
SProcRRConfigureProviderProperty(ClientPtr client)
{
    REQUEST(xRRConfigureProviderPropertyReq);

    REQUEST_AT_LEAST_SIZE(xRRConfigureProviderPropertyReq);
    swaps(&stuff->length);
    swapl(&stuff->provider);
    swapl(&stuff->property);
    /* TODO: no way to specify format? */
    SwapRestL(stuff);
    return ProcRandrVector[stuff->randrReqType] (client);
}
Exemple #5
0
int
SProcSetClipRectangles(ClientPtr client)
{
    char n;
    REQUEST(xSetClipRectanglesReq);
    swaps(&stuff->length, n);
    REQUEST_AT_LEAST_SIZE(xSetClipRectanglesReq);
    swapl(&stuff->gc, n);
    swaps(&stuff->xOrigin, n);
    swaps(&stuff->yOrigin, n);
    SwapRestS(stuff);
    return((* ProcVector[X_SetClipRectangles])(client));
}
Exemple #6
0
int
SProcXISetFocus(ClientPtr client)
{
    REQUEST(xXISetFocusReq);
    REQUEST_AT_LEAST_SIZE(xXISetFocusReq);

    swaps(&stuff->length);
    swaps(&stuff->deviceid);
    swapl(&stuff->focus);
    swapl(&stuff->time);

    return ProcXISetFocus(client);
}
Exemple #7
0
int
SProcCreateGC(ClientPtr client)
{
    char n;
    REQUEST(xCreateGCReq);
    swaps(&stuff->length, n);
    REQUEST_AT_LEAST_SIZE(xCreateGCReq);
    swapl(&stuff->gc, n);
    swapl(&stuff->drawable, n);
    swapl(&stuff->mask, n);
    SwapRestL(stuff);
    return((* ProcVector[X_CreateGC])(client));
}
Exemple #8
0
int
SProcSetDashes(ClientPtr client)
{
    char n;
    REQUEST(xSetDashesReq);
    swaps(&stuff->length, n);
    REQUEST_AT_LEAST_SIZE(xSetDashesReq);
    swapl(&stuff->gc, n);
    swaps(&stuff->dashOffset, n);
    swaps(&stuff->nDashes, n);
    return((* ProcVector[X_SetDashes])(client));

}
Exemple #9
0
int
SProcChangeWindowAttributes(ClientPtr client)
{
    char n;

    REQUEST(xChangeWindowAttributesReq);
    swaps(&stuff->length, n);
    REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq);
    swapl(&stuff->window, n);
    swapl(&stuff->valueMask, n);
    SwapRestL(stuff);
    return((* ProcVector[X_ChangeWindowAttributes])(client));
}
Exemple #10
0
int
SProcConfigureWindow(ClientPtr client)
{
    char n;
    REQUEST(xConfigureWindowReq);
    swaps(&stuff->length, n);
    REQUEST_AT_LEAST_SIZE(xConfigureWindowReq);
    swapl(&stuff->window, n);
    swaps(&stuff->mask, n);
    SwapRestL(stuff);
    return((* ProcVector[X_ConfigureWindow])(client));

}
Exemple #11
0
int
SProcPolyText(register ClientPtr client)
{
    register char n;
    REQUEST(xPolyTextReq);
    swaps(&stuff->length, n);
    REQUEST_AT_LEAST_SIZE(xPolyTextReq);
    swapl(&stuff->drawable, n);
    swapl(&stuff->gc, n);
    swaps(&stuff->x, n);
    swaps(&stuff->y, n);
    return((* ProcVector[stuff->reqType])(client));
}
Exemple #12
0
int
SProcFreeColors(ClientPtr client)
{
    char n;
    REQUEST(xFreeColorsReq);
    swaps(&stuff->length, n);
    REQUEST_AT_LEAST_SIZE(xFreeColorsReq);
    swapl(&stuff->cmap, n);
    swapl(&stuff->planeMask, n);
    SwapRestL(stuff);
    return((* ProcVector[X_FreeColors])(client));

}
Exemple #13
0
static int
SProcShapeRectangles(ClientPtr client)
{
    REQUEST(xShapeRectanglesReq);

    swaps(&stuff->length);
    REQUEST_AT_LEAST_SIZE(xShapeRectanglesReq);
    swapl(&stuff->dest);
    swaps(&stuff->xOff);
    swaps(&stuff->yOff);
    SwapRestS(stuff);
    return ProcShapeRectangles(client);
}
Exemple #14
0
static 
int SProcXagCreate(
    ClientPtr client)
{
    register int n;
    REQUEST (xXagCreateReq);
    swaps (&stuff->length, n);
    REQUEST_AT_LEAST_SIZE (xXagCreateReq);
    swapl (&stuff->app_group, n);
    swapl (&stuff->attrib_mask, n);
    SwapRestL (stuff);
    return ProcXagCreate (client);
}
Exemple #15
0
static int
SProcXkbSetIndicatorMap(ClientPtr client)
{
register int	n;

    REQUEST(xkbSetIndicatorMapReq);

    swaps(&stuff->length,n);
    REQUEST_AT_LEAST_SIZE(xkbSetIndicatorMapReq);
    swaps(&stuff->deviceSpec,n);
    swapl(&stuff->which,n);
    return ProcXkbSetIndicatorMap(client);
}
Exemple #16
0
int
SProcImageText(ClientPtr client)
{
    char n;
    REQUEST(xImageTextReq);
    swaps(&stuff->length, n);
    REQUEST_AT_LEAST_SIZE(xImageTextReq);
    swapl(&stuff->drawable, n);
    swapl(&stuff->gc, n);
    swaps(&stuff->x, n);
    swaps(&stuff->y, n);
    return((* ProcVector[stuff->reqType])(client));
}
Exemple #17
0
/* cannot use SProcPoly for this one, because xFillPolyReq
   is longer than xPolyPointReq, and we don't want to swap
   the difference as shorts! */
int
SProcFillPoly(ClientPtr client)
{
    char n;

    REQUEST(xFillPolyReq);
    swaps(&stuff->length, n);
    REQUEST_AT_LEAST_SIZE(xFillPolyReq);
    swapl(&stuff->drawable, n);
    swapl(&stuff->gc, n);
    SwapRestS(stuff);
    return((* ProcVector[X_FillPoly])(client));
}
int
ProcRRCreateMode (ClientPtr client)
{
    REQUEST(xRRCreateModeReq);
    xRRCreateModeReply	rep;
    WindowPtr		pWin;
    ScreenPtr		pScreen;
    rrScrPrivPtr	pScrPriv;
    xRRModeInfo		*modeInfo;
    long		units_after;
    char		*name;
    int			error, rc;
    RRModePtr		mode;

    REQUEST_AT_LEAST_SIZE (xRRCreateModeReq);
    rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
    if (rc != Success)
        return rc;

    pScreen = pWin->drawable.pScreen;
    pScrPriv = rrGetScrPriv(pScreen);

    modeInfo = &stuff->modeInfo;
    name = (char *) (stuff + 1);
    units_after = (stuff->length - bytes_to_int32(sizeof (xRRCreateModeReq)));

    /* check to make sure requested name fits within the data provided */
    if (bytes_to_int32(modeInfo->nameLength) > units_after)
        return BadLength;

    mode = RRModeCreateUser (pScreen, modeInfo, name, &error);
    if (!mode)
        return error;

    rep.type = X_Reply;
    rep.pad0 = 0;
    rep.sequenceNumber = client->sequence;
    rep.length = 0;
    rep.mode = mode->mode.id;
    if (client->swapped)
    {
        int n;
        swaps(&rep.sequenceNumber, n);
        swapl(&rep.length, n);
        swapl(&rep.mode, n);
    }
    WriteToClient(client, sizeof(xRRCreateModeReply), (char *)&rep);
    /* Drop out reference to this mode */
    RRModeDestroy (mode);
    return client->noClientException;
}
Exemple #19
0
static int
dmxProcSetFontPath(ClientPtr client)
{
    unsigned char *ptr;
    unsigned long nbytes, total, n;
    long nfonts;
    int i, result;
    unsigned char *oldFontPath, *tmpFontPath;
    int nOldPaths;
    int lenOldPaths;

    REQUEST(xSetFontPathReq);

    REQUEST_AT_LEAST_SIZE(xSetFontPathReq);

    nbytes = (client->req_len << 2) - sizeof(xSetFontPathReq);
    total = nbytes;
    ptr = (unsigned char *) &stuff[1];
    nfonts = stuff->nFonts;

    while (--nfonts >= 0) {
        if ((total == 0) || (total < (n = (*ptr + 1))))
            return BadLength;
        total -= n;
        ptr += n;
    }
    if (total >= 4)
        return BadLength;

    GetFontPath(serverClient, &nOldPaths, &lenOldPaths, &tmpFontPath);
    oldFontPath = malloc(nOldPaths + lenOldPaths);
    memmove(oldFontPath, tmpFontPath, nOldPaths + lenOldPaths);

    result = SetFontPath(client, stuff->nFonts, (unsigned char *) &stuff[1]);
    if (!result) {
        int error = 0;

        for (i = 0; i < dmxNumScreens; i++)
            if ((result = dmxCheckFontPath(&dmxScreens[i], &error)))
                break;

        if (result) {
            /* Restore old fontpath in the DMX server */
            SetFontPath(client, nOldPaths, oldFontPath);
            client->errorValue = error;
        }
    }

    free(oldFontPath);
    return result;
}
Exemple #20
0
static int
SProcXkbSetDeviceInfo(ClientPtr client)
{
register int	n;

    REQUEST(xkbSetDeviceInfoReq);

    swaps(&stuff->length,n);
    REQUEST_AT_LEAST_SIZE(xkbSetDeviceInfoReq);
    swaps(&stuff->deviceSpec,n);
    swaps(&stuff->change,n);
    swaps(&stuff->nDeviceLedFBs,n);
    return ProcXkbSetDeviceInfo(client);
}
Exemple #21
0
static int
SProcXkbGetKbdByName(ClientPtr client)
{
register int	n;

    REQUEST(xkbGetKbdByNameReq);

    swaps(&stuff->length,n);
    REQUEST_AT_LEAST_SIZE(xkbGetKbdByNameReq);
    swaps(&stuff->deviceSpec,n);
    swaps(&stuff->want,n);
    swaps(&stuff->need,n);
    return ProcXkbGetKbdByName(client);
}
Exemple #22
0
static int
SProcXkbSetCompatMap(ClientPtr client)
{
register int	n;

    REQUEST(xkbSetCompatMapReq);

    swaps(&stuff->length,n);
    REQUEST_AT_LEAST_SIZE(xkbSetCompatMapReq);
    swaps(&stuff->deviceSpec,n);
    swaps(&stuff->firstSI,n);
    swaps(&stuff->nSI,n);
    return ProcXkbSetCompatMap(client);
}
Exemple #23
0
static int
ProcAppleWMSetWindowMenu(register ClientPtr client)
{
    const char *bytes, **items;
    char *shortcuts;
    int max_len, nitems, i, j;
    REQUEST(xAppleWMSetWindowMenuReq);

    REQUEST_AT_LEAST_SIZE(xAppleWMSetWindowMenuReq);

    nitems = stuff->nitems;
    items = malloc(sizeof(char *) * nitems);
    shortcuts = malloc(sizeof(char) * nitems);

    if (!items || !shortcuts) {
        free(items);
        free(shortcuts);

        return BadAlloc;
    }

    max_len = (stuff->length << 2) - sizeof(xAppleWMSetWindowMenuReq);
    bytes = (char *)&stuff[1];

    for (i = j = 0; i < max_len && j < nitems;) {
        shortcuts[j] = bytes[i++];
        items[j++] = bytes + i;

        while (i < max_len)
        {
            if (bytes[i++] == 0)
                break;
        }
    }

    /* Check if we bailed out of the above loop due to a request that was too long */
    if (j < nitems) {
        free(items);
        free(shortcuts);

        return BadRequest;
    }

    X11ApplicationSetWindowMenu(nitems, items, shortcuts);
    free(items);
    free(shortcuts);

    return Success;
}
Exemple #24
0
int
ProcGetEventMask(ClientPtr client)
{
    fsGetEventMaskReply rep;

    REQUEST(fsGetEventMaskReq);
    REQUEST_AT_LEAST_SIZE(fsGetEventMaskReq);

    rep.type = FS_Reply;
    rep.sequenceNumber = client->sequence;
    rep.length = SIZEOF(fsGetEventMaskReply) >> 2;
    rep.event_mask = client->eventmask;

    return client->noClientException;
}
Exemple #25
0
static int
SProcXkbSetDebuggingFlags(ClientPtr client)
{
register int	n;

    REQUEST(xkbSetDebuggingFlagsReq);

    swaps(&stuff->length,n);
    REQUEST_AT_LEAST_SIZE(xkbSetDebuggingFlagsReq);
    swapl(&stuff->affectFlags,n);
    swapl(&stuff->flags,n);
    swapl(&stuff->affectCtrls,n);
    swapl(&stuff->ctrls,n);
    swaps(&stuff->msgLength,n);
    return ProcXkbSetDebuggingFlags(client);
}
Exemple #26
0
static int
SProcXkbSetNames(ClientPtr client)
{
register int	n;

    REQUEST(xkbSetNamesReq);

    swaps(&stuff->length,n);
    REQUEST_AT_LEAST_SIZE(xkbSetNamesReq);
    swaps(&stuff->deviceSpec,n);
    swaps(&stuff->virtualMods,n);
    swapl(&stuff->which,n);
    swapl(&stuff->indicators,n);
    swaps(&stuff->totalKTLevelNames,n);
    return ProcXkbSetNames(client);
}
Exemple #27
0
static int _X_COLD
SProcRRSetMonitor(ClientPtr client) {
    REQUEST(xRRSetMonitorReq);

    REQUEST_AT_LEAST_SIZE(xRRGetMonitorsReq);
    swaps(&stuff->length);
    swapl(&stuff->window);
    swapl(&stuff->monitor.name);
    swaps(&stuff->monitor.noutput);
    swaps(&stuff->monitor.x);
    swaps(&stuff->monitor.y);
    swaps(&stuff->monitor.width);
    swaps(&stuff->monitor.height);
    SwapRestL(stuff);
    return ProcRandrVector[stuff->randrReqType] (client);
}
Exemple #28
0
int
SProcStoreColors(ClientPtr client)
{
    char n;
    long count;
    xColorItem 	*pItem;

    REQUEST(xStoreColorsReq);
    swaps(&stuff->length, n);
    REQUEST_AT_LEAST_SIZE(xStoreColorsReq);
    swapl(&stuff->cmap, n);
    pItem = (xColorItem *) &stuff[1];
    for(count = LengthRestB(stuff)/sizeof(xColorItem); --count >= 0; )
	SwapColorItem(pItem++);
    return((* ProcVector[X_StoreColors])(client));
}
Exemple #29
0
static int
XineramaXvPutStill(ClientPtr client)
{
    REQUEST(xvPutImageReq);
    PanoramiXRes *draw, *gc, *port;
    Bool isRoot;
    int result, i, x, y;

    REQUEST_AT_LEAST_SIZE(xvPutImageReq);

    result = dixLookupResourceByClass((pointer *)&draw, stuff->drawable,
				      XRC_DRAWABLE, client, DixWriteAccess);
    if (result != Success)
	return (result == BadValue) ? BadDrawable : result;

    result = dixLookupResourceByType((pointer *)&gc, stuff->gc,
				     XRT_GC, client, DixReadAccess);
    if (result != Success)
        return result;

    result = dixLookupResourceByType((pointer *)&port, stuff->port,
				     XvXRTPort, client, DixReadAccess);
    if (result != Success)
	return result;

    isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;

    x = stuff->drw_x;
    y = stuff->drw_y;

    FOR_NSCREENS_BACKWARD(i) {
        if(port->info[i].id) {
           stuff->drawable = draw->info[i].id;
           stuff->port = port->info[i].id;
           stuff->gc = gc->info[i].id;
           stuff->drw_x = x;
           stuff->drw_y = y;
           if(isRoot) {
                stuff->drw_x -= screenInfo.screens[i]->x;
                stuff->drw_y -= screenInfo.screens[i]->y;
           }

           result = ProcXvPutStill(client);
        }
    }
    return result;
}
Exemple #30
0
static int
SProcXkbSetMap(ClientPtr client)
{
register int	n;

    REQUEST(xkbSetMapReq);

    swaps(&stuff->length,n);
    REQUEST_AT_LEAST_SIZE(xkbSetMapReq);
    swaps(&stuff->deviceSpec,n);
    swaps(&stuff->present,n);
    swaps(&stuff->flags,n);
    swaps(&stuff->totalSyms,n);
    swaps(&stuff->totalActs,n);
    swaps(&stuff->virtualMods,n);
    return ProcXkbSetMap(client);
}