diff --git a/Xi/allowev.c b/Xi/allowev.c index 7fecef735..f4441b539 100644 --- a/Xi/allowev.c +++ b/Xi/allowev.c @@ -58,25 +58,11 @@ SOFTWARE. #include "dix/dix_priv.h" #include "dix/input_priv.h" +#include "dix/request_priv.h" #include "exglobals.h" #include "allowev.h" -/*********************************************************************** - * - * This procedure allows frozen events to be routed. - * - */ - -int _X_COLD -SProcXAllowDeviceEvents(ClientPtr client) -{ - REQUEST(xAllowDeviceEventsReq); - REQUEST_SIZE_MATCH(xAllowDeviceEventsReq); - swapl(&stuff->time); - return (ProcXAllowDeviceEvents(client)); -} - /*********************************************************************** * * This procedure allows frozen events to be routed. @@ -90,8 +76,8 @@ ProcXAllowDeviceEvents(ClientPtr client) DeviceIntPtr thisdev; int rc; - REQUEST(xAllowDeviceEventsReq); - REQUEST_SIZE_MATCH(xAllowDeviceEventsReq); + REQUEST_HEAD_STRUCT(xAllowDeviceEventsReq); + REQUEST_FIELD_CARD32(time); rc = dixLookupDevice(&thisdev, stuff->deviceid, client, DixGetAttrAccess); if (rc != Success) diff --git a/Xi/allowev.h b/Xi/allowev.h index f081ab52e..4497478b1 100644 --- a/Xi/allowev.h +++ b/Xi/allowev.h @@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef ALLOWEV_H #define ALLOWEV_H 1 -int SProcXAllowDeviceEvents(ClientPtr /* client */ - ); - int ProcXAllowDeviceEvents(ClientPtr /* client */ ); diff --git a/Xi/chgdctl.c b/Xi/chgdctl.c index b0bd882aa..1a6cfa00b 100644 --- a/Xi/chgdctl.c +++ b/Xi/chgdctl.c @@ -57,6 +57,7 @@ SOFTWARE. #include "dix/exevents_priv.h" #include "dix/input_priv.h" +#include "dix/request_priv.h" #include "dix/resource_priv.h" #include "inputstr.h" /* DeviceIntPtr */ @@ -64,37 +65,6 @@ SOFTWARE. #include "exglobals.h" #include "chgdctl.h" -/*********************************************************************** - * - * This procedure changes the control attributes for an extension device, - * for clients on machines with a different byte ordering than the server. - * - */ - -int _X_COLD -SProcXChangeDeviceControl(ClientPtr client) -{ - xDeviceCtl *ctl; - - REQUEST(xChangeDeviceControlReq); - REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl)); - swaps(&stuff->control); - ctl = (xDeviceCtl *) &stuff[1]; - swaps(&ctl->control); - swaps(&ctl->length); - switch (stuff->control) { - case DEVICE_ABS_CALIB: - case DEVICE_ABS_AREA: - case DEVICE_CORE: - case DEVICE_ENABLE: - case DEVICE_RESOLUTION: - /* hmm. beer. *drool* */ - break; - - } - return (ProcXChangeDeviceControl(client)); -} - /*********************************************************************** * * Change the control attributes. @@ -104,6 +74,11 @@ SProcXChangeDeviceControl(ClientPtr client) int ProcXChangeDeviceControl(ClientPtr client) { + REQUEST_HEAD_AT_LEAST(xChangeDeviceControlReq); + REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl)); + REQUEST_FIELD_CARD16(control); + CLIENT_STRUCT_CARD16_2((xDeviceCtl*)&stuff[1], control, length); + unsigned len; int i, status, ret = BadValue; DeviceIntPtr dev; @@ -112,9 +87,6 @@ ProcXChangeDeviceControl(ClientPtr client) CARD32 *resolution; xDeviceEnableCtl *e; - REQUEST(xChangeDeviceControlReq); - REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl)); - len = client->req_len - bytes_to_int32(sizeof(xChangeDeviceControlReq)); ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess); if (ret != Success) diff --git a/Xi/chgdctl.h b/Xi/chgdctl.h index 3924f7251..c6557009b 100644 --- a/Xi/chgdctl.h +++ b/Xi/chgdctl.h @@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef CHGDCTL_H #define CHGDCTL_H 1 -int SProcXChangeDeviceControl(ClientPtr /* client */ - ); - int ProcXChangeDeviceControl(ClientPtr /* client */ ); diff --git a/Xi/chgfctl.c b/Xi/chgfctl.c index e1295b5fa..08e0529fb 100644 --- a/Xi/chgfctl.c +++ b/Xi/chgfctl.c @@ -52,32 +52,18 @@ SOFTWARE. #include -#include "inputstr.h" /* DeviceIntPtr */ #include #include /* control constants */ +#include "dix/request_priv.h" + +#include "inputstr.h" /* DeviceIntPtr */ #include "exglobals.h" #include "chgfctl.h" #define DO_ALL (-1) -/*********************************************************************** - * - * This procedure changes the control attributes for an extension device, - * for clients on machines with a different byte ordering than the server. - * - */ - -int _X_COLD -SProcXChangeFeedbackControl(ClientPtr client) -{ - REQUEST(xChangeFeedbackControlReq); - REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq); - swapl(&stuff->mask); - return (ProcXChangeFeedbackControl(client)); -} - /****************************************************************************** * * This procedure changes KbdFeedbackClass data. @@ -92,13 +78,8 @@ ChangeKbdFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask, int t; int key = DO_ALL; - if (client->swapped) { - swaps(&f->length); - swaps(&f->pitch); - swaps(&f->duration); - swapl(&f->led_mask); - swapl(&f->led_values); - } + CLIENT_STRUCT_CARD16_3(f, length, pitch, duration); + CLIENT_STRUCT_CARD32_2(f, led_mask, led_values); kctrl = k->ctrl; if (mask & DvKeyClickPercent) { @@ -209,12 +190,7 @@ ChangePtrFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask, { PtrCtrl pctrl; /* might get BadValue part way through */ - if (client->swapped) { - swaps(&f->length); - swaps(&f->num); - swaps(&f->denom); - swaps(&f->thresh); - } + CLIENT_STRUCT_CARD16_4(f, length, num, denom, thresh); pctrl = p->ctrl; if (mask & DvAccelNum) { @@ -275,10 +251,8 @@ ChangeIntegerFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask, IntegerFeedbackPtr i, xIntegerFeedbackCtl * f) { - if (client->swapped) { - swaps(&f->length); - swapl(&f->int_to_display); - } + CLIENT_STRUCT_CARD16_1(f, length); + CLIENT_STRUCT_CARD32_1(f, int_to_display); i->ctrl.integer_displayed = f->int_to_display; (*i->CtrlProc) (dev, &i->ctrl); @@ -300,10 +274,9 @@ ChangeStringFeedback(ClientPtr client, DeviceIntPtr dev, KeySym *syms, *sup_syms; syms = (KeySym *) (f + 1); - if (client->swapped) { - swaps(&f->length); /* swapped num_keysyms in calling proc */ - SwapLongs((CARD32 *) syms, f->num_keysyms); - } + + CLIENT_STRUCT_CARD16_1(f, length); /* swapped num_keysyms in calling proc */ + REQUEST_BUF_CARD32((CARD32 *) syms, f->num_keysyms); if (f->num_keysyms > s->ctrl.max_symbols) return BadValue; @@ -338,11 +311,7 @@ ChangeBellFeedback(ClientPtr client, DeviceIntPtr dev, int t; BellCtrl bctrl; /* might get BadValue part way through */ - if (client->swapped) { - swaps(&f->length); - swaps(&f->pitch); - swaps(&f->duration); - } + CLIENT_STRUCT_CARD16_3(f, length, pitch, duration); bctrl = b->ctrl; if (mask & DvPercent) { @@ -394,11 +363,8 @@ ChangeLedFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask, { LedCtrl lctrl; /* might get BadValue part way through */ - if (client->swapped) { - swaps(&f->length); - swapl(&f->led_values); - swapl(&f->led_mask); - } + CLIENT_STRUCT_CARD16_1(f, length); + CLIENT_STRUCT_CARD32_2(f, led_values, led_mask); f->led_mask &= l->ctrl.led_mask; /* set only supported leds */ f->led_values &= l->ctrl.led_mask; /* set only supported leds */ @@ -432,8 +398,8 @@ ProcXChangeFeedbackControl(ClientPtr client) LedFeedbackPtr l; int rc; - REQUEST(xChangeFeedbackControlReq); - REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq); + REQUEST_HEAD_AT_LEAST(xChangeFeedbackControlReq); + REQUEST_FIELD_CARD32(mask); len = client->req_len - bytes_to_int32(sizeof(xChangeFeedbackControlReq)); rc = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess); @@ -466,11 +432,7 @@ ProcXChangeFeedbackControl(ClientPtr client) REQUEST_AT_LEAST_EXTRA_SIZE(xChangeFeedbackControlReq, sizeof(xStringFeedbackCtl)); f = ((xStringFeedbackCtl *) &stuff[1]); - if (client->swapped) { - if (len < bytes_to_int32(sizeof(xStringFeedbackCtl))) - return BadLength; - swaps(&f->num_keysyms); - } + CLIENT_STRUCT_CARD16_1(f, num_keysyms); if (len != (bytes_to_int32(sizeof(xStringFeedbackCtl)) + f->num_keysyms)) return BadLength; diff --git a/Xi/chgfctl.h b/Xi/chgfctl.h index 45a55a5f8..d9cf75086 100644 --- a/Xi/chgfctl.h +++ b/Xi/chgfctl.h @@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef CHGFCTL_H #define CHGFCTL_H 1 -int SProcXChangeFeedbackControl(ClientPtr /* client */ - ); - int ProcXChangeFeedbackControl(ClientPtr /* client */ ); diff --git a/Xi/chgkbd.c b/Xi/chgkbd.c index 8e16c9dea..e15268a59 100644 --- a/Xi/chgkbd.c +++ b/Xi/chgkbd.c @@ -52,12 +52,14 @@ SOFTWARE. #include -#include "inputstr.h" /* DeviceIntPtr */ #include #include + +#include "dix/request_priv.h" + +#include "inputstr.h" /* DeviceIntPtr */ #include "XIstubs.h" #include "globals.h" - #include "exevents.h" #include "exglobals.h" @@ -72,8 +74,7 @@ SOFTWARE. int ProcXChangeKeyboardDevice(ClientPtr client) { - /* REQUEST(xChangeKeyboardDeviceReq); */ - REQUEST_SIZE_MATCH(xChangeKeyboardDeviceReq); + REQUEST_HEAD_STRUCT(xChangeKeyboardDeviceReq); return BadDevice; } diff --git a/Xi/chgkmap.c b/Xi/chgkmap.c index 73cc8b4e2..07e26f65e 100644 --- a/Xi/chgkmap.c +++ b/Xi/chgkmap.c @@ -56,32 +56,13 @@ SOFTWARE. #include #include "dix/exevents_priv.h" +#include "dix/request_priv.h" #include "inputstr.h" /* DeviceIntPtr */ #include "exglobals.h" #include "chgkmap.h" -/*********************************************************************** - * - * This procedure swaps the request when the client and - * server have different byte orderings. - * - */ - -int _X_COLD -SProcXChangeDeviceKeyMapping(ClientPtr client) -{ - unsigned int count; - - REQUEST(xChangeDeviceKeyMappingReq); - 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)); -} - /*********************************************************************** * * Change the device key mapping. @@ -96,11 +77,10 @@ ProcXChangeDeviceKeyMapping(ClientPtr client) DeviceIntPtr dev; unsigned int count; - REQUEST(xChangeDeviceKeyMappingReq); - REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq); - + REQUEST_HEAD_AT_LEAST(xChangeDeviceKeyMappingReq); count = stuff->keyCodes * stuff->keySymsPerKeyCode; REQUEST_FIXED_SIZE(xChangeDeviceKeyMappingReq, count * sizeof(CARD32)); + REQUEST_BUF_CARD32(&stuff[1], count); ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess); if (ret != Success) diff --git a/Xi/chgkmap.h b/Xi/chgkmap.h index 633af7ca4..00a30d221 100644 --- a/Xi/chgkmap.h +++ b/Xi/chgkmap.h @@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef CHGKMAP_H #define CHGKMAP_H 1 -int SProcXChangeDeviceKeyMapping(ClientPtr /* client */ - ); - int ProcXChangeDeviceKeyMapping(ClientPtr /* client */ ); diff --git a/Xi/chgprop.c b/Xi/chgprop.c index ab1a6b601..9cc43fb5c 100644 --- a/Xi/chgprop.c +++ b/Xi/chgprop.c @@ -57,6 +57,7 @@ SOFTWARE. #include "dix/dix_priv.h" #include "dix/exevents_priv.h" +#include "dix/request_priv.h" #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" @@ -65,25 +66,6 @@ SOFTWARE. #include "chgprop.h" #include "grabdev.h" -/*********************************************************************** - * - * This procedure returns the extension version. - * - */ - -int _X_COLD -SProcXChangeDeviceDontPropagateList(ClientPtr client) -{ - REQUEST(xChangeDeviceDontPropagateListReq); - REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq); - swapl(&stuff->window); - swaps(&stuff->count); - REQUEST_FIXED_SIZE(xChangeDeviceDontPropagateListReq, - stuff->count * sizeof(CARD32)); - SwapLongs((CARD32 *) (&stuff[1]), stuff->count); - return (ProcXChangeDeviceDontPropagateList(client)); -} - /*********************************************************************** * * This procedure changes the dont-propagate list for the specified window. @@ -98,13 +80,12 @@ ProcXChangeDeviceDontPropagateList(ClientPtr client) struct tmask tmp[EMASKSIZE]; OtherInputMasks *others; - REQUEST(xChangeDeviceDontPropagateListReq); - REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq); - - if (client->req_len != - bytes_to_int32(sizeof(xChangeDeviceDontPropagateListReq)) + - stuff->count) - return BadLength; + REQUEST_HEAD_AT_LEAST(xChangeDeviceDontPropagateListReq); + REQUEST_FIELD_CARD32(window); + REQUEST_FIELD_CARD16(count); + REQUEST_FIXED_SIZE(xChangeDeviceDontPropagateListReq, + stuff->count * sizeof(CARD32)); + REQUEST_BUF_CARD32(&stuff[1], stuff->count); rc = dixLookupWindow(&pWin, stuff->window, client, DixSetAttrAccess); if (rc != Success) diff --git a/Xi/chgprop.h b/Xi/chgprop.h index 89d6b5695..308cb6fe7 100644 --- a/Xi/chgprop.h +++ b/Xi/chgprop.h @@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef CHGPROP_H #define CHGPROP_H 1 -int SProcXChangeDeviceDontPropagateList(ClientPtr /* client */ - ); - int ProcXChangeDeviceDontPropagateList(ClientPtr /* client */ ); diff --git a/Xi/chgptr.c b/Xi/chgptr.c index 4ec83d9f9..f4aabfce1 100644 --- a/Xi/chgptr.c +++ b/Xi/chgptr.c @@ -52,13 +52,15 @@ SOFTWARE. #include -#include "inputstr.h" /* DeviceIntPtr */ #include #include + +#include "dix/request_priv.h" + +#include "inputstr.h" /* DeviceIntPtr */ #include "XIstubs.h" #include "windowstr.h" /* window structure */ #include "scrnintstr.h" /* screen structure */ - #include "exevents.h" #include "exglobals.h" @@ -73,8 +75,7 @@ SOFTWARE. int ProcXChangePointerDevice(ClientPtr client) { - /* REQUEST(xChangePointerDeviceReq); */ - REQUEST_SIZE_MATCH(xChangePointerDeviceReq); + REQUEST_HEAD_STRUCT(xChangePointerDeviceReq); return BadDevice; } diff --git a/Xi/closedev.c b/Xi/closedev.c index 7979facd2..d269f496c 100644 --- a/Xi/closedev.c +++ b/Xi/closedev.c @@ -55,6 +55,7 @@ SOFTWARE. #include #include +#include "dix/request_priv.h" #include "dix/resource_priv.h" #include "inputstr.h" /* DeviceIntPtr */ @@ -125,8 +126,7 @@ ProcXCloseDevice(ClientPtr client) WindowPtr pWin, p1; DeviceIntPtr d; - REQUEST(xCloseDeviceReq); - REQUEST_SIZE_MATCH(xCloseDeviceReq); + REQUEST_HEAD_STRUCT(xCloseDeviceReq); rc = dixLookupDevice(&d, stuff->deviceid, client, DixUseAccess); if (rc != Success) diff --git a/Xi/devbell.c b/Xi/devbell.c index 76085c738..89dbc7665 100644 --- a/Xi/devbell.c +++ b/Xi/devbell.c @@ -52,9 +52,12 @@ SOFTWARE. #include -#include "inputstr.h" /* DeviceIntPtr */ #include #include + +#include "dix/request_priv.h" + +#include "inputstr.h" /* DeviceIntPtr */ #include "exglobals.h" #include "devbell.h" @@ -77,8 +80,7 @@ ProcXDeviceBell(ClientPtr client) void *ctrl; BellProcPtr proc; - REQUEST(xDeviceBellReq); - REQUEST_SIZE_MATCH(xDeviceBellReq); + REQUEST_HEAD_STRUCT(xDeviceBellReq); rc = dixLookupDevice(&dev, stuff->deviceid, client, DixBellAccess); if (rc != Success) { diff --git a/Xi/extinit.c b/Xi/extinit.c index e35839928..7e1dc9965 100644 --- a/Xi/extinit.c +++ b/Xi/extinit.c @@ -380,152 +380,6 @@ ProcIDispatch(ClientPtr client) } } -/******************************************************************************* - * - * SProcXDispatch - * - * Main swapped dispatch routine for requests to this extension. - * This routine is used if server and client do not have the same byte ordering. - * - */ - -static int _X_COLD -SProcIDispatch(ClientPtr client) -{ - REQUEST(xReq); - - UpdateCurrentTimeIf(); - - switch (stuff->data) { - case X_GetExtensionVersion: - return SProcXGetExtensionVersion(client); - case X_ListInputDevices: - return SProcXListInputDevices(client); - case X_OpenDevice: - return SProcXOpenDevice(client); - case X_CloseDevice: - return SProcXCloseDevice(client); - case X_SetDeviceMode: - return SProcXSetDeviceMode(client); - case X_SelectExtensionEvent: - return SProcXSelectExtensionEvent(client); - case X_GetSelectedExtensionEvents: - return SProcXGetSelectedExtensionEvents(client); - case X_ChangeDeviceDontPropagateList: - return SProcXChangeDeviceDontPropagateList(client); - case X_GetDeviceDontPropagateList: - return SProcXGetDeviceDontPropagateList(client); - case X_GetDeviceMotionEvents: - return SProcXGetDeviceMotionEvents(client); - case X_ChangeKeyboardDevice: - return SProcXChangeKeyboardDevice(client); - case X_ChangePointerDevice: - return SProcXChangePointerDevice(client); - case X_GrabDevice: - return SProcXGrabDevice(client); - case X_UngrabDevice: - return SProcXUngrabDevice(client); - case X_GrabDeviceKey: - return SProcXGrabDeviceKey(client); - case X_UngrabDeviceKey: - return SProcXUngrabDeviceKey(client); - case X_GrabDeviceButton: - return SProcXGrabDeviceButton(client); - case X_UngrabDeviceButton: - return SProcXUngrabDeviceButton(client); - case X_AllowDeviceEvents: - return SProcXAllowDeviceEvents(client); - case X_GetDeviceFocus: - return SProcXGetDeviceFocus(client); - case X_SetDeviceFocus: - return SProcXSetDeviceFocus(client); - case X_GetFeedbackControl: - return SProcXGetFeedbackControl(client); - case X_ChangeFeedbackControl: - return SProcXChangeFeedbackControl(client); - case X_GetDeviceKeyMapping: - return SProcXGetDeviceKeyMapping(client); - case X_ChangeDeviceKeyMapping: - return SProcXChangeDeviceKeyMapping(client); - case X_GetDeviceModifierMapping: - return SProcXGetDeviceModifierMapping(client); - case X_SetDeviceModifierMapping: - return SProcXSetDeviceModifierMapping(client); - case X_GetDeviceButtonMapping: - return SProcXGetDeviceButtonMapping(client); - case X_SetDeviceButtonMapping: - return SProcXSetDeviceButtonMapping(client); - case X_QueryDeviceState: - return SProcXQueryDeviceState(client); - case X_SendExtensionEvent: - return SProcXSendExtensionEvent(client); - case X_DeviceBell: - return SProcXDeviceBell(client); - case X_SetDeviceValuators: - return SProcXSetDeviceValuators(client); - case X_GetDeviceControl: - return SProcXGetDeviceControl(client); - case X_ChangeDeviceControl: - return SProcXChangeDeviceControl(client); - /* XI 1.5 */ - case X_ListDeviceProperties: - return SProcXListDeviceProperties(client); - case X_ChangeDeviceProperty: - return SProcXChangeDeviceProperty(client); - case X_DeleteDeviceProperty: - return SProcXDeleteDeviceProperty(client); - case X_GetDeviceProperty: - return SProcXGetDeviceProperty(client); - /* XI 2 */ - case X_XIQueryPointer: - return SProcXIQueryPointer(client); - case X_XIWarpPointer: - return SProcXIWarpPointer(client); - case X_XIChangeCursor: - return SProcXIChangeCursor(client); - case X_XIChangeHierarchy: - return SProcXIChangeHierarchy(client); - case X_XISetClientPointer: - return SProcXISetClientPointer(client); - case X_XIGetClientPointer: - return SProcXIGetClientPointer(client); - case X_XISelectEvents: - return SProcXISelectEvents(client); - case X_XIQueryVersion: - return SProcXIQueryVersion(client); - case X_XIQueryDevice: - return SProcXIQueryDevice(client); - case X_XISetFocus: - return SProcXISetFocus(client); - case X_XIGetFocus: - return SProcXIGetFocus(client); - case X_XIGrabDevice: - return SProcXIGrabDevice(client); - case X_XIUngrabDevice: - return SProcXIUngrabDevice(client); - case X_XIAllowEvents: - return SProcXIAllowEvents(client); - case X_XIPassiveGrabDevice: - return SProcXIPassiveGrabDevice(client); - case X_XIPassiveUngrabDevice: - return SProcXIPassiveUngrabDevice(client); - case X_XIListProperties: - return SProcXIListProperties(client); - case X_XIChangeProperty: - return SProcXIChangeProperty(client); - case X_XIDeleteProperty: - return SProcXIDeleteProperty(client); - case X_XIGetProperty: - return SProcXIGetProperty(client); - case X_XIGetSelectedEvents: - return SProcXIGetSelectedEvents(client); - case X_XIBarrierReleasePointer: - return SProcXIBarrierReleasePointer(client); - default: - return BadRequest; - } -} - /************************************************************************ * * This function swaps the DeviceValuator event. @@ -1344,7 +1198,7 @@ XInputExtensionInit(void) FatalError("Could not initialize barriers.\n"); extEntry = AddExtension(INAME, IEVENTS, IERRORS, ProcIDispatch, - SProcIDispatch, IResetProc, StandardMinorOpcode); + ProcIDispatch, IResetProc, StandardMinorOpcode); if (extEntry) { assert(extEntry->base == EXTENSION_MAJOR_XINPUT); diff --git a/Xi/getbmap.c b/Xi/getbmap.c index 77ea8ec82..5b54c1cd0 100644 --- a/Xi/getbmap.c +++ b/Xi/getbmap.c @@ -52,9 +52,12 @@ SOFTWARE. #include -#include "inputstr.h" /* DeviceIntPtr */ #include #include + +#include "dix/request_priv.h" + +#include "inputstr.h" /* DeviceIntPtr */ #include "exglobals.h" #include "getbmap.h" @@ -72,8 +75,7 @@ ProcXGetDeviceButtonMapping(ClientPtr client) ButtonClassPtr b; int rc; - REQUEST(xGetDeviceButtonMappingReq); - REQUEST_SIZE_MATCH(xGetDeviceButtonMappingReq); + REQUEST_HEAD_STRUCT(xGetDeviceButtonMappingReq); rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess); if (rc != Success) diff --git a/Xi/getdctl.c b/Xi/getdctl.c index e4f4a855b..5cda7331c 100644 --- a/Xi/getdctl.c +++ b/Xi/getdctl.c @@ -52,29 +52,16 @@ SOFTWARE. #include -#include "inputstr.h" /* DeviceIntPtr */ #include #include + +#include "dix/request_priv.h" + +#include "inputstr.h" /* DeviceIntPtr */ #include "exglobals.h" #include "getdctl.h" -/*********************************************************************** - * - * This procedure gets the control attributes for an extension device, - * for clients on machines with a different byte ordering than the server. - * - */ - -int _X_COLD -SProcXGetDeviceControl(ClientPtr client) -{ - REQUEST(xGetDeviceControlReq); - REQUEST_SIZE_MATCH(xGetDeviceControlReq); - swaps(&stuff->control); - return (ProcXGetDeviceControl(client)); -} - /*********************************************************************** * * This procedure copies DeviceResolution data, swapping if necessary. @@ -155,8 +142,8 @@ ProcXGetDeviceControl(ClientPtr client) int rc, total_length = 0; DeviceIntPtr dev; - REQUEST(xGetDeviceControlReq); - REQUEST_SIZE_MATCH(xGetDeviceControlReq); + REQUEST_HEAD_STRUCT(xGetDeviceControlReq); + REQUEST_FIELD_CARD16(control); rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess); if (rc != Success) diff --git a/Xi/getdctl.h b/Xi/getdctl.h index 430b75b1d..50b02858a 100644 --- a/Xi/getdctl.h +++ b/Xi/getdctl.h @@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef GETDCTL_H #define GETDCTL_H 1 -int SProcXGetDeviceControl(ClientPtr /* client */ - ); - int ProcXGetDeviceControl(ClientPtr /* client */ ); diff --git a/Xi/getfctl.c b/Xi/getfctl.c index bf3db9864..c3ab72183 100644 --- a/Xi/getfctl.c +++ b/Xi/getfctl.c @@ -52,9 +52,12 @@ SOFTWARE. #include -#include "inputstr.h" /* DeviceIntPtr */ #include #include + +#include "dix/request_priv.h" + +#include "inputstr.h" /* DeviceIntPtr */ #include "exglobals.h" #include "getfctl.h" @@ -252,8 +255,7 @@ ProcXGetFeedbackControl(ClientPtr client) BellFeedbackPtr b; LedFeedbackPtr l; - REQUEST(xGetFeedbackControlReq); - REQUEST_SIZE_MATCH(xGetFeedbackControlReq); + REQUEST_HEAD_STRUCT(xGetFeedbackControlReq); rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess); if (rc != Success) diff --git a/Xi/getfocus.c b/Xi/getfocus.c index 5c43ed6cc..ca8f5df4d 100644 --- a/Xi/getfocus.c +++ b/Xi/getfocus.c @@ -52,10 +52,13 @@ SOFTWARE. #include -#include "windowstr.h" /* focus struct */ -#include "inputstr.h" /* DeviceIntPtr */ #include #include + +#include "dix/request_priv.h" + +#include "windowstr.h" /* focus struct */ +#include "inputstr.h" /* DeviceIntPtr */ #include "exglobals.h" #include "getfocus.h" @@ -73,8 +76,7 @@ ProcXGetDeviceFocus(ClientPtr client) FocusClassPtr focus; int rc; - REQUEST(xGetDeviceFocusReq); - REQUEST_SIZE_MATCH(xGetDeviceFocusReq); + REQUEST_HEAD_STRUCT(xGetDeviceFocusReq); rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetFocusAccess); if (rc != Success) diff --git a/Xi/getkmap.c b/Xi/getkmap.c index 5b47a1f5f..cae4b0db5 100644 --- a/Xi/getkmap.c +++ b/Xi/getkmap.c @@ -52,9 +52,12 @@ SOFTWARE. #include -#include "inputstr.h" /* DeviceIntPtr */ #include #include + +#include "dix/request_priv.h" + +#include "inputstr.h" /* DeviceIntPtr */ #include "exglobals.h" #include "swaprep.h" #include "xkbsrv.h" @@ -76,8 +79,7 @@ ProcXGetDeviceKeyMapping(ClientPtr client) KeySymsPtr syms; int rc; - REQUEST(xGetDeviceKeyMappingReq); - REQUEST_SIZE_MATCH(xGetDeviceKeyMappingReq); + REQUEST_HEAD_STRUCT(xGetDeviceKeyMappingReq); rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess); if (rc != Success) diff --git a/Xi/getmmap.c b/Xi/getmmap.c index e0ae696ef..74a366c38 100644 --- a/Xi/getmmap.c +++ b/Xi/getmmap.c @@ -52,9 +52,12 @@ SOFTWARE. #include -#include "inputstr.h" /* DeviceIntPtr */ #include #include /* Request macro */ + +#include "dix/request_priv.h" + +#include "inputstr.h" /* DeviceIntPtr */ #include "exglobals.h" #include "getmmap.h" @@ -72,8 +75,7 @@ ProcXGetDeviceModifierMapping(ClientPtr client) KeyCode *modkeymap = NULL; int ret, max_keys_per_mod; - REQUEST(xGetDeviceModifierMappingReq); - REQUEST_SIZE_MATCH(xGetDeviceModifierMappingReq); + REQUEST_HEAD_STRUCT(xGetDeviceModifierMappingReq); ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess); if (ret != Success) diff --git a/Xi/getprop.c b/Xi/getprop.c index 1bf56c64c..26de108db 100644 --- a/Xi/getprop.c +++ b/Xi/getprop.c @@ -56,6 +56,7 @@ SOFTWARE. #include #include "dix/dix_priv.h" +#include "dix/request_priv.h" #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structs */ @@ -66,21 +67,6 @@ SOFTWARE. extern XExtEventInfo EventInfo[]; extern int ExtEventIndex; -/*********************************************************************** - * - * Handle a request from a client with a different byte order. - * - */ - -int _X_COLD -SProcXGetDeviceDontPropagateList(ClientPtr client) -{ - REQUEST(xGetDeviceDontPropagateListReq); - REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq); - swapl(&stuff->window); - return (ProcXGetDeviceDontPropagateList(client)); -} - /*********************************************************************** * * This procedure lists the input devices available to the server. @@ -96,8 +82,8 @@ ProcXGetDeviceDontPropagateList(ClientPtr client) WindowPtr pWin; OtherInputMasks *others; - REQUEST(xGetDeviceDontPropagateListReq); - REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq); + REQUEST_HEAD_STRUCT(xGetDeviceDontPropagateListReq); + REQUEST_FIELD_CARD32(window); xGetDeviceDontPropagateListReply rep = { .repType = X_Reply, diff --git a/Xi/getprop.h b/Xi/getprop.h index 59225cba9..849778887 100644 --- a/Xi/getprop.h +++ b/Xi/getprop.h @@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef GETPROP_H #define GETPROP_H 1 -int SProcXGetDeviceDontPropagateList(ClientPtr /* client */ - ); - int ProcXGetDeviceDontPropagateList(ClientPtr /* client */ ); diff --git a/Xi/getselev.c b/Xi/getselev.c index 73d71d5bc..41a48fd49 100644 --- a/Xi/getselev.c +++ b/Xi/getselev.c @@ -55,6 +55,7 @@ SOFTWARE. #include #include +#include "dix/request_priv.h" #include "dix/resource_priv.h" #include "inputstr.h" /* DeviceIntPtr */ @@ -64,21 +65,6 @@ SOFTWARE. #include "getprop.h" #include "getselev.h" -/*********************************************************************** - * - * This procedure gets the current selected extension events. - * - */ - -int _X_COLD -SProcXGetSelectedExtensionEvents(ClientPtr client) -{ - REQUEST(xGetSelectedExtensionEventsReq); - REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq); - swapl(&stuff->window); - return (ProcXGetSelectedExtensionEvents(client)); -} - /*********************************************************************** * * This procedure gets the current device select mask, @@ -97,8 +83,8 @@ ProcXGetSelectedExtensionEvents(ClientPtr client) OtherInputMasks *pOthers; InputClientsPtr others; - REQUEST(xGetSelectedExtensionEventsReq); - REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq); + REQUEST_HEAD_STRUCT(xGetSelectedExtensionEventsReq); + REQUEST_FIELD_CARD32(window); xGetSelectedExtensionEventsReply rep = { .repType = X_Reply, diff --git a/Xi/getselev.h b/Xi/getselev.h index bcb8ebcbb..7e5e56de1 100644 --- a/Xi/getselev.h +++ b/Xi/getselev.h @@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef GETSELEV_H #define GETSELEV_H 1 -int SProcXGetSelectedExtensionEvents(ClientPtr /* client */ - ); - int ProcXGetSelectedExtensionEvents(ClientPtr /* client */ ); diff --git a/Xi/getvers.c b/Xi/getvers.c index c02294fe9..f4b001272 100644 --- a/Xi/getvers.c +++ b/Xi/getvers.c @@ -52,9 +52,12 @@ SOFTWARE. #include -#include "inputstr.h" /* DeviceIntPtr */ #include #include + +#include "dix/request_priv.h" + +#include "inputstr.h" /* DeviceIntPtr */ #include "exevents.h" #include "exglobals.h" @@ -62,21 +65,6 @@ SOFTWARE. XExtensionVersion XIVersion; -/*********************************************************************** - * - * Handle a request from a client with a different byte order than us. - * - */ - -int _X_COLD -SProcXGetExtensionVersion(ClientPtr client) -{ - REQUEST(xGetExtensionVersionReq); - REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq); - swaps(&stuff->nbytes); - return (ProcXGetExtensionVersion(client)); -} - /*********************************************************************** * * This procedure returns the major/minor version of the X Input extension. @@ -86,8 +74,8 @@ SProcXGetExtensionVersion(ClientPtr client) int ProcXGetExtensionVersion(ClientPtr client) { - REQUEST(xGetExtensionVersionReq); - REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq); + REQUEST_HEAD_STRUCT(xGetExtensionVersionReq); + REQUEST_FIELD_CARD16(nbytes); if (client->req_len != bytes_to_int32(sizeof(xGetExtensionVersionReq) + stuff->nbytes)) diff --git a/Xi/getvers.h b/Xi/getvers.h index 678046d1d..6032cbacd 100644 --- a/Xi/getvers.h +++ b/Xi/getvers.h @@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef GETVERS_H #define GETVERS_H 1 -int SProcXGetExtensionVersion(ClientPtr /* client */ - ); - int ProcXGetExtensionVersion(ClientPtr /* client */ ); diff --git a/Xi/grabdev.c b/Xi/grabdev.c index 175f4c9b1..18773df07 100644 --- a/Xi/grabdev.c +++ b/Xi/grabdev.c @@ -56,6 +56,7 @@ SOFTWARE. #include #include "dix/dix_priv.h" +#include "dix/request_priv.h" #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ @@ -65,31 +66,6 @@ SOFTWARE. extern XExtEventInfo EventInfo[]; extern int ExtEventIndex; -/*********************************************************************** - * - * Swap the request if the requestor has a different byte order than us. - * - */ - -int _X_COLD -SProcXGrabDevice(ClientPtr client) -{ - REQUEST(xGrabDeviceReq); - REQUEST_AT_LEAST_SIZE(xGrabDeviceReq); - - swapl(&stuff->grabWindow); - swapl(&stuff->time); - swaps(&stuff->event_count); - - if (client->req_len != - bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count) - return BadLength; - - SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count); - - return (ProcXGrabDevice(client)); -} - /*********************************************************************** * * Grab an extension device. @@ -104,13 +80,17 @@ ProcXGrabDevice(ClientPtr client) GrabMask mask; struct tmask tmp[EMASKSIZE]; - REQUEST(xGrabDeviceReq); - REQUEST_AT_LEAST_SIZE(xGrabDeviceReq); + REQUEST_HEAD_AT_LEAST(xGrabDeviceReq); + REQUEST_FIELD_CARD32(grabWindow); + REQUEST_FIELD_CARD32(time); + REQUEST_FIELD_CARD16(event_count); if (client->req_len != bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count) return BadLength; + REQUEST_BUF_CARD32(&stuff[1], stuff->event_count); + xGrabDeviceReply rep = { .repType = X_Reply, .RepType = X_GrabDevice, diff --git a/Xi/grabdev.h b/Xi/grabdev.h index 8dfcab70d..051571104 100644 --- a/Xi/grabdev.h +++ b/Xi/grabdev.h @@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef GRABDEV_H #define GRABDEV_H 1 -int SProcXGrabDevice(ClientPtr /* client */ - ); - int ProcXGrabDevice(ClientPtr /* client */ ); diff --git a/Xi/grabdevb.c b/Xi/grabdevb.c index e0e8878f7..1c9198469 100644 --- a/Xi/grabdevb.c +++ b/Xi/grabdevb.c @@ -57,6 +57,7 @@ SOFTWARE. #include "dix/exevents_priv.h" #include "dix/input_priv.h" +#include "dix/request_priv.h" #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ @@ -65,27 +66,6 @@ SOFTWARE. #include "grabdev.h" #include "grabdevb.h" -/*********************************************************************** - * - * Handle requests from clients with a different byte order. - * - */ - -int _X_COLD -SProcXGrabDeviceButton(ClientPtr client) -{ - REQUEST(xGrabDeviceButtonReq); - REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq); - swapl(&stuff->grabWindow); - swaps(&stuff->modifiers); - swaps(&stuff->event_count); - REQUEST_FIXED_SIZE(xGrabDeviceButtonReq, - stuff->event_count * sizeof(CARD32)); - SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count); - - return (ProcXGrabDeviceButton(client)); -} - /*********************************************************************** * * Grab a button on an extension device. @@ -102,12 +82,13 @@ ProcXGrabDeviceButton(ClientPtr client) struct tmask tmp[EMASKSIZE]; GrabMask mask; - REQUEST(xGrabDeviceButtonReq); - REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq); - - if (client->req_len != - bytes_to_int32(sizeof(xGrabDeviceButtonReq)) + stuff->event_count) - return BadLength; + REQUEST_HEAD_AT_LEAST(xGrabDeviceButtonReq); + REQUEST_FIELD_CARD32(grabWindow); + REQUEST_FIELD_CARD16(modifiers); + REQUEST_FIELD_CARD16(event_count); + REQUEST_FIXED_SIZE(xGrabDeviceButtonReq, + stuff->event_count * sizeof(CARD32)); + REQUEST_BUF_CARD32(&stuff[1], stuff->event_count); ret = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess); if (ret != Success) diff --git a/Xi/grabdevb.h b/Xi/grabdevb.h index b2a9796b5..13227fe00 100644 --- a/Xi/grabdevb.h +++ b/Xi/grabdevb.h @@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef GRABDEVB_H #define GRABDEVB_H 1 -int SProcXGrabDeviceButton(ClientPtr /* client */ - ); - int ProcXGrabDeviceButton(ClientPtr /* client */ ); diff --git a/Xi/grabdevk.c b/Xi/grabdevk.c index 2fb1a95dd..6ddf35cc4 100644 --- a/Xi/grabdevk.c +++ b/Xi/grabdevk.c @@ -57,6 +57,7 @@ SOFTWARE. #include "dix/exevents_priv.h" #include "dix/input_priv.h" +#include "dix/request_priv.h" #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ @@ -65,25 +66,6 @@ SOFTWARE. #include "grabdev.h" #include "grabdevk.h" -/*********************************************************************** - * - * Handle requests from clients with a different byte order. - * - */ - -int _X_COLD -SProcXGrabDeviceKey(ClientPtr client) -{ - REQUEST(xGrabDeviceKeyReq); - REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq); - swapl(&stuff->grabWindow); - swaps(&stuff->modifiers); - swaps(&stuff->event_count); - REQUEST_FIXED_SIZE(xGrabDeviceKeyReq, stuff->event_count * sizeof(CARD32)); - SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count); - return (ProcXGrabDeviceKey(client)); -} - /*********************************************************************** * * Grab a key on an extension device. @@ -100,12 +82,12 @@ ProcXGrabDeviceKey(ClientPtr client) struct tmask tmp[EMASKSIZE]; GrabMask mask; - REQUEST(xGrabDeviceKeyReq); - REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq); - - if (client->req_len != - bytes_to_int32(sizeof(xGrabDeviceKeyReq)) + stuff->event_count) - return BadLength; + REQUEST_HEAD_AT_LEAST(xGrabDeviceKeyReq); + REQUEST_FIELD_CARD32(grabWindow); + REQUEST_FIELD_CARD16(modifiers); + REQUEST_FIELD_CARD16(event_count); + REQUEST_FIXED_SIZE(xGrabDeviceKeyReq, stuff->event_count * sizeof(CARD32)); + REQUEST_BUF_CARD32(&stuff[1], stuff->event_count); ret = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess); if (ret != Success) diff --git a/Xi/grabdevk.h b/Xi/grabdevk.h index 85738affa..4523e318e 100644 --- a/Xi/grabdevk.h +++ b/Xi/grabdevk.h @@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef GRABDEVK_H #define GRABDEVK_H 1 -int SProcXGrabDeviceKey(ClientPtr /* client */ - ); - int ProcXGrabDeviceKey(ClientPtr /* client */ ); diff --git a/Xi/gtmotion.c b/Xi/gtmotion.c index 5e4d39bdc..88243e1bb 100644 --- a/Xi/gtmotion.c +++ b/Xi/gtmotion.c @@ -56,27 +56,12 @@ SOFTWARE. #include #include "dix/exevents_priv.h" +#include "dix/request_priv.h" #include "inputstr.h" /* DeviceIntPtr */ #include "exglobals.h" #include "gtmotion.h" -/*********************************************************************** - * - * Swap the request if server and client have different byte ordering. - * - */ - -int _X_COLD -SProcXGetDeviceMotionEvents(ClientPtr client) -{ - REQUEST(xGetDeviceMotionEventsReq); - REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq); - swapl(&stuff->start); - swapl(&stuff->stop); - return (ProcXGetDeviceMotionEvents(client)); -} - /**************************************************************************** * * Get the motion history for an extension pointer devices. @@ -86,8 +71,9 @@ SProcXGetDeviceMotionEvents(ClientPtr client) int ProcXGetDeviceMotionEvents(ClientPtr client) { - REQUEST(xGetDeviceMotionEventsReq); - REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq); + REQUEST_HEAD_STRUCT(xGetDeviceMotionEventsReq); + REQUEST_FIELD_CARD32(start); + REQUEST_FIELD_CARD32(stop); DeviceIntPtr dev; int rc = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess); diff --git a/Xi/gtmotion.h b/Xi/gtmotion.h index 70e75b85a..91265192c 100644 --- a/Xi/gtmotion.h +++ b/Xi/gtmotion.h @@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef GTMOTION_H #define GTMOTION_H 1 -int SProcXGetDeviceMotionEvents(ClientPtr /* client */ - ); - int ProcXGetDeviceMotionEvents(ClientPtr /* client */ ); diff --git a/Xi/listdev.c b/Xi/listdev.c index 9455f594e..470e09cfc 100644 --- a/Xi/listdev.c +++ b/Xi/listdev.c @@ -58,6 +58,7 @@ SOFTWARE. #include #include "dix/input_priv.h" +#include "dix/request_priv.h" #include "inputstr.h" /* DeviceIntPtr */ #include "XIstubs.h" @@ -325,7 +326,7 @@ ProcXListInputDevices(ClientPtr client) xDeviceInfo *dev; DeviceIntPtr d; - REQUEST_SIZE_MATCH(xListInputDevicesReq); + REQUEST_HEAD_STRUCT(xListInputDevicesReq); /* allocate space for saving skip value */ skip = calloc(inputInfo.numDevices, sizeof(Bool)); diff --git a/Xi/opendev.c b/Xi/opendev.c index 2e7b28bab..a394caadf 100644 --- a/Xi/opendev.c +++ b/Xi/opendev.c @@ -56,6 +56,7 @@ SOFTWARE. #include #include "dix/input_priv.h" +#include "dix/request_priv.h" #include "inputstr.h" /* DeviceIntPtr */ #include "XIstubs.h" @@ -81,8 +82,7 @@ ProcXOpenDevice(ClientPtr client) int status = Success; DeviceIntPtr dev; - REQUEST(xOpenDeviceReq); - REQUEST_SIZE_MATCH(xOpenDeviceReq); + REQUEST_HEAD_STRUCT(xOpenDeviceReq); status = dixLookupDevice(&dev, stuff->deviceid, client, DixUseAccess); diff --git a/Xi/queryst.c b/Xi/queryst.c index 7bd405cda..7224bd8d9 100644 --- a/Xi/queryst.c +++ b/Xi/queryst.c @@ -39,6 +39,7 @@ from The Open Group. #include "dix/exevents_priv.h" #include "dix/input_priv.h" +#include "dix/request_priv.h" #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ @@ -69,8 +70,7 @@ ProcXQueryDeviceState(ClientPtr client) DeviceIntPtr dev; double *values; - REQUEST(xQueryDeviceStateReq); - REQUEST_SIZE_MATCH(xQueryDeviceStateReq); + REQUEST_HEAD_STRUCT(xQueryDeviceStateReq); rc = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess); if (rc != Success && rc != BadAccess) diff --git a/Xi/selectev.c b/Xi/selectev.c index 3f2a3178c..53c8ce5a4 100644 --- a/Xi/selectev.c +++ b/Xi/selectev.c @@ -58,6 +58,7 @@ SOFTWARE. #include "dix/dix_priv.h" #include "dix/exevents_priv.h" +#include "dix/request_priv.h" #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ @@ -111,25 +112,6 @@ HandleDevicePresenceMask(ClientPtr client, WindowPtr win, return Success; } -/*********************************************************************** - * - * Handle requests from clients with a different byte order. - * - */ - -int _X_COLD -SProcXSelectExtensionEvent(ClientPtr client) -{ - REQUEST(xSelectExtensionEventReq); - REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq); - swapl(&stuff->window); - swaps(&stuff->count); - REQUEST_FIXED_SIZE(xSelectExtensionEventReq, stuff->count * sizeof(CARD32)); - SwapLongs((CARD32 *) (&stuff[1]), stuff->count); - - return (ProcXSelectExtensionEvent(client)); -} - /*********************************************************************** * * This procedure selects input from an extension device. @@ -144,12 +126,11 @@ ProcXSelectExtensionEvent(ClientPtr client) WindowPtr pWin; struct tmask tmp[EMASKSIZE]; - REQUEST(xSelectExtensionEventReq); - REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq); - - if (client->req_len != - bytes_to_int32(sizeof(xSelectExtensionEventReq)) + stuff->count) - return BadLength; + REQUEST_HEAD_AT_LEAST(xSelectExtensionEventReq); + REQUEST_FIELD_CARD32(window); + REQUEST_FIELD_CARD16(count); + REQUEST_FIXED_SIZE(xSelectExtensionEventReq, stuff->count * sizeof(CARD32)); + REQUEST_BUF_CARD32(&stuff[1], stuff->count); ret = dixLookupWindow(&pWin, stuff->window, client, DixReceiveAccess); if (ret != Success) diff --git a/Xi/selectev.h b/Xi/selectev.h index e80fe4a43..bfba828ac 100644 --- a/Xi/selectev.h +++ b/Xi/selectev.h @@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef SELECTEV_H #define SELECTEV_H 1 -int SProcXSelectExtensionEvent(ClientPtr /* client */ - ); - int ProcXSelectExtensionEvent(ClientPtr /* client */ ); diff --git a/Xi/sendexev.c b/Xi/sendexev.c index 79a93b6b7..52dfc224b 100644 --- a/Xi/sendexev.c +++ b/Xi/sendexev.c @@ -56,6 +56,7 @@ SOFTWARE. #include #include "dix/exevents_priv.h" +#include "dix/request_priv.h" #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* Window */ @@ -66,53 +67,6 @@ SOFTWARE. extern int lastEvent; /* Defined in extension.c */ -/*********************************************************************** - * - * Handle requests from clients with a different byte order than us. - * - */ - -int _X_COLD -SProcXSendExtensionEvent(ClientPtr client) -{ - CARD32 *p; - int i; - xEvent eventT = { .u.u.type = 0 }; - xEvent *eventP; - EventSwapPtr proc; - - REQUEST(xSendExtensionEventReq); - REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq); - swapl(&stuff->destination); - swaps(&stuff->count); - - if (client->req_len != - bytes_to_int32(sizeof(xSendExtensionEventReq)) + stuff->count + - bytes_to_int32(stuff->num_events * sizeof(xEvent))) - return BadLength; - - eventP = (xEvent *) &stuff[1]; - for (i = 0; i < stuff->num_events; i++, eventP++) { - if (eventP->u.u.type == GenericEvent) { - client->errorValue = eventP->u.u.type; - return BadValue; - } - - proc = EventSwapVector[eventP->u.u.type & 0177]; - /* no swapping proc; invalid event type? */ - if (proc == NotImplemented) { - client->errorValue = eventP->u.u.type; - return BadValue; - } - (*proc) (eventP, &eventT); - *eventP = eventT; - } - - p = (CARD32 *) (((xEvent *) &stuff[1]) + stuff->num_events); - SwapLongs(p, stuff->count); - return (ProcXSendExtensionEvent(client)); -} - /*********************************************************************** * * Send an event to some client, as if it had come from an extension input @@ -129,14 +83,42 @@ ProcXSendExtensionEvent(ClientPtr client) XEventClass *list; struct tmask tmp[EMASKSIZE]; - REQUEST(xSendExtensionEventReq); - REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq); + REQUEST_HEAD_AT_LEAST(xSendExtensionEventReq); + REQUEST_FIELD_CARD32(destination); + REQUEST_FIELD_CARD16(count); if (client->req_len != bytes_to_int32(sizeof(xSendExtensionEventReq)) + stuff->count + - (stuff->num_events * bytes_to_int32(sizeof(xEvent)))) + bytes_to_int32(stuff->num_events * sizeof(xEvent))) return BadLength; + if (client->swapped) { + CARD32 *p; + xEvent eventT = { .u.u.type = 0 }; + xEvent *eventP; + EventSwapPtr proc; + + eventP = (xEvent *) &stuff[1]; + for (i = 0; i < stuff->num_events; i++, eventP++) { + if (eventP->u.u.type == GenericEvent) { + client->errorValue = eventP->u.u.type; + return BadValue; + } + + proc = EventSwapVector[eventP->u.u.type & 0177]; + /* no swapping proc; invalid event type? */ + if (proc == NotImplemented) { + client->errorValue = eventP->u.u.type; + return BadValue; + } + (*proc) (eventP, &eventT); + *eventP = eventT; + } + + p = (CARD32 *) (((xEvent *) &stuff[1]) + stuff->num_events); + SwapLongs(p, stuff->count); + } + ret = dixLookupDevice(&dev, stuff->deviceid, client, DixWriteAccess); if (ret != Success) return ret; diff --git a/Xi/sendexev.h b/Xi/sendexev.h index 38c66434d..836352988 100644 --- a/Xi/sendexev.h +++ b/Xi/sendexev.h @@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef SENDEXEV_H #define SENDEXEV_H 1 -int SProcXSendExtensionEvent(ClientPtr /* client */ - ); - int ProcXSendExtensionEvent(ClientPtr /* client */ ); diff --git a/Xi/setbmap.c b/Xi/setbmap.c index c235fbb4f..78e3ee715 100644 --- a/Xi/setbmap.c +++ b/Xi/setbmap.c @@ -56,6 +56,7 @@ SOFTWARE. #include #include "dix/input_priv.h" +#include "dix/request_priv.h" #include "inputstr.h" /* DeviceIntPtr */ #include "exevents.h" @@ -74,8 +75,7 @@ ProcXSetDeviceButtonMapping(ClientPtr client) int ret; DeviceIntPtr dev; - REQUEST(xSetDeviceButtonMappingReq); - REQUEST_AT_LEAST_SIZE(xSetDeviceButtonMappingReq); + REQUEST_HEAD_AT_LEAST(xSetDeviceButtonMappingReq); if (client->req_len != bytes_to_int32(sizeof(xSetDeviceButtonMappingReq) + stuff->map_length)) diff --git a/Xi/setdval.c b/Xi/setdval.c index 7ef99e46b..8c4248b0e 100644 --- a/Xi/setdval.c +++ b/Xi/setdval.c @@ -56,6 +56,7 @@ SOFTWARE. #include #include "dix/input_priv.h" +#include "dix/request_priv.h" #include "dix/resource_priv.h" #include "inputstr.h" /* DeviceIntPtr */ @@ -75,8 +76,7 @@ ProcXSetDeviceValuators(ClientPtr client) DeviceIntPtr dev; int rc; - REQUEST(xSetDeviceValuatorsReq); - REQUEST_AT_LEAST_SIZE(xSetDeviceValuatorsReq); + REQUEST_HEAD_AT_LEAST(xSetDeviceValuatorsReq); xSetDeviceValuatorsReply rep = { .repType = X_Reply, diff --git a/Xi/setfocus.c b/Xi/setfocus.c index 6aec8934d..774c8a86e 100644 --- a/Xi/setfocus.c +++ b/Xi/setfocus.c @@ -59,26 +59,11 @@ SOFTWARE. #include "inputstr.h" /* DeviceIntPtr */ #include "dix/dix_priv.h" +#include "dix/request_priv.h" #include "exglobals.h" #include "setfocus.h" -/*********************************************************************** - * - * This procedure sets the focus for a device. - * - */ - -int _X_COLD -SProcXSetDeviceFocus(ClientPtr client) -{ - REQUEST(xSetDeviceFocusReq); - REQUEST_SIZE_MATCH(xSetDeviceFocusReq); - swapl(&stuff->focus); - swapl(&stuff->time); - return (ProcXSetDeviceFocus(client)); -} - /*********************************************************************** * * This procedure sets the focus for a device. @@ -91,8 +76,9 @@ ProcXSetDeviceFocus(ClientPtr client) int ret; DeviceIntPtr dev; - REQUEST(xSetDeviceFocusReq); - REQUEST_SIZE_MATCH(xSetDeviceFocusReq); + REQUEST_HEAD_STRUCT(xSetDeviceFocusReq); + REQUEST_FIELD_CARD32(focus); + REQUEST_FIELD_CARD32(time); ret = dixLookupDevice(&dev, stuff->device, client, DixSetFocusAccess); if (ret != Success) diff --git a/Xi/setfocus.h b/Xi/setfocus.h index 0adf45157..1198727e8 100644 --- a/Xi/setfocus.h +++ b/Xi/setfocus.h @@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef SETFOCUS_H #define SETFOCUS_H 1 -int SProcXSetDeviceFocus(ClientPtr /* client */ - ); - int ProcXSetDeviceFocus(ClientPtr /* client */ ); diff --git a/Xi/setmmap.c b/Xi/setmmap.c index b8e703cc1..5c8cd6dbc 100644 --- a/Xi/setmmap.c +++ b/Xi/setmmap.c @@ -57,6 +57,7 @@ SOFTWARE. #include #include "dix/input_priv.h" +#include "dix/request_priv.h" #include "inputstr.h" /* DeviceIntPtr */ #include "exevents.h" @@ -75,8 +76,7 @@ ProcXSetDeviceModifierMapping(ClientPtr client) int ret; DeviceIntPtr dev; - REQUEST(xSetDeviceModifierMappingReq); - REQUEST_AT_LEAST_SIZE(xSetDeviceModifierMappingReq); + REQUEST_HEAD_AT_LEAST(xSetDeviceModifierMappingReq); if (client->req_len != bytes_to_int32(sizeof(xSetDeviceModifierMappingReq)) + (stuff->numKeyPerModifier << 1)) diff --git a/Xi/setmode.c b/Xi/setmode.c index d84e4bcd8..338cba259 100644 --- a/Xi/setmode.c +++ b/Xi/setmode.c @@ -56,6 +56,7 @@ SOFTWARE. #include #include "dix/input_priv.h" +#include "dix/request_priv.h" #include "dix/resource_priv.h" #include "inputstr.h" /* DeviceIntPtr */ @@ -75,8 +76,7 @@ ProcXSetDeviceMode(ClientPtr client) DeviceIntPtr dev; int rc; - REQUEST(xSetDeviceModeReq); - REQUEST_SIZE_MATCH(xSetDeviceModeReq); + REQUEST_HEAD_STRUCT(xSetDeviceModeReq); xSetDeviceModeReply rep = { .repType = X_Reply, diff --git a/Xi/ungrdev.c b/Xi/ungrdev.c index 511f39202..3640b16e0 100644 --- a/Xi/ungrdev.c +++ b/Xi/ungrdev.c @@ -54,6 +54,7 @@ SOFTWARE. #include +#include "dix/request_priv.h" #include "dix/resource_priv.h" #include "inputstr.h" /* DeviceIntPtr */ @@ -61,21 +62,6 @@ SOFTWARE. #include "exglobals.h" #include "ungrdev.h" -/*********************************************************************** - * - * Handle requests from a client with a different byte order. - * - */ - -int _X_COLD -SProcXUngrabDevice(ClientPtr client) -{ - REQUEST(xUngrabDeviceReq); - REQUEST_SIZE_MATCH(xUngrabDeviceReq); - swapl(&stuff->time); - return (ProcXUngrabDevice(client)); -} - /*********************************************************************** * * Release a grab of an extension device. @@ -90,8 +76,8 @@ ProcXUngrabDevice(ClientPtr client) TimeStamp time; int rc; - REQUEST(xUngrabDeviceReq); - REQUEST_SIZE_MATCH(xUngrabDeviceReq); + REQUEST_HEAD_STRUCT(xUngrabDeviceReq); + REQUEST_FIELD_CARD32(time); rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess); if (rc != Success) diff --git a/Xi/ungrdev.h b/Xi/ungrdev.h index 8a85c27f1..c138efc1f 100644 --- a/Xi/ungrdev.h +++ b/Xi/ungrdev.h @@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef UNGRDEV_H #define UNGRDEV_H 1 -int SProcXUngrabDevice(ClientPtr /* client */ - ); - int ProcXUngrabDevice(ClientPtr /* client */ ); diff --git a/Xi/ungrdevb.c b/Xi/ungrdevb.c index 1d6795fe8..cd58e8b0a 100644 --- a/Xi/ungrdevb.c +++ b/Xi/ungrdevb.c @@ -57,6 +57,7 @@ SOFTWARE. #include "dix/dix_priv.h" #include "dix/dixgrabs_priv.h" +#include "dix/request_priv.h" #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ @@ -67,22 +68,6 @@ SOFTWARE. ShiftMask | LockMask | ControlMask | Mod1Mask | Mod2Mask | \ Mod3Mask | Mod4Mask | Mod5Mask ) -/*********************************************************************** - * - * Handle requests from a client with a different byte order. - * - */ - -int _X_COLD -SProcXUngrabDeviceButton(ClientPtr client) -{ - REQUEST(xUngrabDeviceButtonReq); - REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq); - swapl(&stuff->grabWindow); - swaps(&stuff->modifiers); - return (ProcXUngrabDeviceButton(client)); -} - /*********************************************************************** * * Release a grab of a button on an extension device. @@ -98,8 +83,9 @@ ProcXUngrabDeviceButton(ClientPtr client) GrabPtr temporaryGrab; int rc; - REQUEST(xUngrabDeviceButtonReq); - REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq); + REQUEST_HEAD_STRUCT(xUngrabDeviceButtonReq); + REQUEST_FIELD_CARD32(grabWindow); + REQUEST_FIELD_CARD16(modifiers); rc = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess); if (rc != Success) diff --git a/Xi/ungrdevb.h b/Xi/ungrdevb.h index 97d8aede1..4c68a2f7b 100644 --- a/Xi/ungrdevb.h +++ b/Xi/ungrdevb.h @@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef UNGRDEVB_H #define UNGRDEVB_H 1 -int SProcXUngrabDeviceButton(ClientPtr /* client */ - ); - int ProcXUngrabDeviceButton(ClientPtr /* client */ ); diff --git a/Xi/ungrdevk.c b/Xi/ungrdevk.c index eee36cbd1..2dc9bedca 100644 --- a/Xi/ungrdevk.c +++ b/Xi/ungrdevk.c @@ -57,6 +57,7 @@ SOFTWARE. #include "dix/dix_priv.h" #include "dix/dixgrabs_priv.h" +#include "dix/request_priv.h" #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ @@ -69,22 +70,6 @@ SOFTWARE. ShiftMask | LockMask | ControlMask | Mod1Mask | Mod2Mask | \ Mod3Mask | Mod4Mask | Mod5Mask ) -/*********************************************************************** - * - * Handle requests from a client with a different byte order. - * - */ - -int _X_COLD -SProcXUngrabDeviceKey(ClientPtr client) -{ - REQUEST(xUngrabDeviceKeyReq); - REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq); - swapl(&stuff->grabWindow); - swaps(&stuff->modifiers); - return (ProcXUngrabDeviceKey(client)); -} - /*********************************************************************** * * Release a grab of a key on an extension device. @@ -100,8 +85,9 @@ ProcXUngrabDeviceKey(ClientPtr client) GrabPtr temporaryGrab; int rc; - REQUEST(xUngrabDeviceKeyReq); - REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq); + REQUEST_HEAD_STRUCT(xUngrabDeviceKeyReq); + REQUEST_FIELD_CARD32(grabWindow); + REQUEST_FIELD_CARD16(modifiers); rc = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess); if (rc != Success) diff --git a/Xi/ungrdevk.h b/Xi/ungrdevk.h index 1c4bab65b..e82c9c4cd 100644 --- a/Xi/ungrdevk.h +++ b/Xi/ungrdevk.h @@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef UNGRDEVK_H #define UNGRDEVK_H 1 -int SProcXUngrabDeviceKey(ClientPtr /* client */ - ); - int ProcXUngrabDeviceKey(ClientPtr /* client */ ); diff --git a/Xi/xiallowev.c b/Xi/xiallowev.c index 1eb596935..6bcebb46e 100644 --- a/Xi/xiallowev.c +++ b/Xi/xiallowev.c @@ -37,6 +37,7 @@ #include "dix/dix_priv.h" #include "dix/exevents_priv.h" #include "dix/input_priv.h" +#include "dix/request_priv.h" #include "os/fmt.h" #include "inputstr.h" /* DeviceIntPtr */ @@ -46,42 +47,82 @@ #include "exglobals.h" /* BadDevice */ #include "xiallowev.h" -int _X_COLD -SProcXIAllowEvents(ClientPtr client) +static int allowEvents(ClientPtr client, xXIAllowEventsReq *stuff) { - REQUEST(xXIAllowEventsReq); - REQUEST_AT_LEAST_SIZE(xXIAllowEventsReq); + DeviceIntPtr dev; - swaps(&stuff->deviceid); - swapl(&stuff->time); - if (client->req_len > 3) { - xXI2_2AllowEventsReq *req_xi22 = (xXI2_2AllowEventsReq *) stuff; + int ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess); + if (ret != Success) + return ret; - REQUEST_AT_LEAST_SIZE(xXI2_2AllowEventsReq); - swapl(&req_xi22->touchid); - swapl(&req_xi22->grab_window); + TimeStamp time = ClientTimeToServerTime(stuff->time); + + switch (stuff->mode) { + case XIReplayDevice: + AllowSome(client, time, dev, NOT_GRABBED); + break; + case XISyncDevice: + AllowSome(client, time, dev, FREEZE_NEXT_EVENT); + break; + case XIAsyncDevice: + AllowSome(client, time, dev, THAWED); + break; + case XIAsyncPairedDevice: + if (IsMaster(dev)) + AllowSome(client, time, dev, THAW_OTHERS); + break; + case XISyncPair: + if (IsMaster(dev)) + AllowSome(client, time, dev, FREEZE_BOTH_NEXT_EVENT); + break; + case XIAsyncPair: + if (IsMaster(dev)) + AllowSome(client, time, dev, THAWED_BOTH); + break; + default: + client->errorValue = stuff->mode; + ret = BadValue; } - - return ProcXIAllowEvents(client); + return ret; } int ProcXIAllowEvents(ClientPtr client) { - TimeStamp time; - DeviceIntPtr dev; - int ret = Success; - XIClientPtr xi_client; - Bool have_xi22 = FALSE; - - REQUEST(xXI2_2AllowEventsReq); - - xi_client = dixLookupPrivate(&client->devPrivates, XIClientPrivateKey); + XIClientPtr xi_client = dixLookupPrivate(&client->devPrivates, XIClientPrivateKey); if (version_compare(xi_client->major_version, xi_client->minor_version, 2, 2) >= 0) { - REQUEST_AT_LEAST_SIZE(xXI2_2AllowEventsReq); - have_xi22 = TRUE; + REQUEST_HEAD_AT_LEAST(xXI2_2AllowEventsReq); + REQUEST_FIELD_CARD16(length); + REQUEST_FIELD_CARD16(deviceid); + REQUEST_FIELD_CARD32(time); + REQUEST_FIELD_CARD32(touchid); + REQUEST_FIELD_CARD32(grab_window); + + if ((stuff->mode == XIRejectTouch) || (stuff->mode == XIAcceptTouch)) { + DeviceIntPtr dev; + int rc; + WindowPtr win; + + int ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess); + if (ret != Success) + return ret; + + rc = dixLookupWindow(&win, stuff->grab_window, client, DixReadAccess); + if (rc != Success) + return rc; + + return TouchAcceptReject(client, dev, stuff->mode, stuff->touchid, + stuff->grab_window, &client->errorValue); + } + return allowEvents(client, (xXIAllowEventsReq*)stuff); + } else { + REQUEST_HEAD_AT_LEAST(xXIAllowEventsReq); + REQUEST_FIELD_CARD16(length); + REQUEST_FIELD_CARD16(deviceid); + REQUEST_FIELD_CARD32(time); + return allowEvents(client, stuff); } else { REQUEST_AT_LEAST_SIZE(xXIAllowEventsReq); diff --git a/Xi/xiallowev.h b/Xi/xiallowev.h index c24ac3df4..44fc900a9 100644 --- a/Xi/xiallowev.h +++ b/Xi/xiallowev.h @@ -31,6 +31,5 @@ #define XIALLOWEV_H 1 int ProcXIAllowEvents(ClientPtr client); -int SProcXIAllowEvents(ClientPtr client); #endif /* XIALLOWEV_H */ diff --git a/Xi/xibarriers.c b/Xi/xibarriers.c index 977a49714..af833135f 100644 --- a/Xi/xibarriers.c +++ b/Xi/xibarriers.c @@ -46,6 +46,7 @@ #include "dix/cursor_priv.h" #include "dix/dix_priv.h" #include "dix/input_priv.h" +#include "dix/request_priv.h" #include "dix/resource_priv.h" #include "mi/mi_priv.h" #include "os/bug_priv.h" @@ -849,52 +850,33 @@ XIDestroyPointerBarrier(ClientPtr client, return Success; } -int _X_COLD -SProcXIBarrierReleasePointer(ClientPtr client) -{ - xXIBarrierReleasePointerInfo *info; - REQUEST(xXIBarrierReleasePointerReq); - int i; - - REQUEST_AT_LEAST_SIZE(xXIBarrierReleasePointerReq); - - swapl(&stuff->num_barriers); - if (stuff->num_barriers > UINT32_MAX / sizeof(xXIBarrierReleasePointerInfo)) - return BadLength; - REQUEST_FIXED_SIZE(xXIBarrierReleasePointerReq, stuff->num_barriers * sizeof(xXIBarrierReleasePointerInfo)); - - info = (xXIBarrierReleasePointerInfo*) &stuff[1]; - for (i = 0; i < stuff->num_barriers; i++, info++) { - swaps(&info->deviceid); - swapl(&info->barrier); - swapl(&info->eventid); - } - - return (ProcXIBarrierReleasePointer(client)); -} - int ProcXIBarrierReleasePointer(ClientPtr client) { + REQUEST_HEAD_AT_LEAST(xXIBarrierReleasePointerReq); + REQUEST_FIELD_CARD32(num_barriers); + + if (stuff->num_barriers > UINT32_MAX / sizeof(xXIBarrierReleasePointerInfo)) + return BadLength; + + REQUEST_FIXED_SIZE(xXIBarrierReleasePointerReq, stuff->num_barriers * sizeof(xXIBarrierReleasePointerInfo)); + int i; int err; struct PointerBarrierClient *barrier; struct PointerBarrier *b; - xXIBarrierReleasePointerInfo *info; - REQUEST(xXIBarrierReleasePointerReq); - REQUEST_AT_LEAST_SIZE(xXIBarrierReleasePointerReq); - if (stuff->num_barriers > UINT32_MAX / sizeof(xXIBarrierReleasePointerInfo)) - return BadLength; - REQUEST_FIXED_SIZE(xXIBarrierReleasePointerReq, stuff->num_barriers * sizeof(xXIBarrierReleasePointerInfo)); + xXIBarrierReleasePointerInfo *info = (xXIBarrierReleasePointerInfo*) &stuff[1]; - info = (xXIBarrierReleasePointerInfo*) &stuff[1]; for (i = 0; i < stuff->num_barriers; i++, info++) { struct PointerBarrierDevice *pbd; DeviceIntPtr dev; CARD32 barrier_id, event_id; _X_UNUSED CARD32 device_id; + CLIENT_STRUCT_CARD16_1(info, deviceid); + CLIENT_STRUCT_CARD32_2(info, barrier, eventid); + barrier_id = info->barrier; event_id = info->eventid; diff --git a/Xi/xibarriers.h b/Xi/xibarriers.h index 386a6ebe5..851614a24 100644 --- a/Xi/xibarriers.h +++ b/Xi/xibarriers.h @@ -39,7 +39,6 @@ XIDestroyPointerBarrier(ClientPtr client, Bool XIBarrierInit(void); void XIBarrierReset(void); -int SProcXIBarrierReleasePointer(ClientPtr client); int ProcXIBarrierReleasePointer(ClientPtr client); void XIBarrierNewMasterDevice(ClientPtr client, int deviceid); diff --git a/Xi/xichangecursor.c b/Xi/xichangecursor.c index 2b43a014a..f7c2d7bba 100644 --- a/Xi/xichangecursor.c +++ b/Xi/xichangecursor.c @@ -38,6 +38,7 @@ #include "dix/cursor_priv.h" #include "dix/dix_priv.h" +#include "dix/request_priv.h" #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ @@ -54,17 +55,6 @@ * */ -int _X_COLD -SProcXIChangeCursor(ClientPtr client) -{ - REQUEST(xXIChangeCursorReq); - REQUEST_SIZE_MATCH(xXIChangeCursorReq); - swapl(&stuff->win); - swapl(&stuff->cursor); - swaps(&stuff->deviceid); - return (ProcXIChangeCursor(client)); -} - int ProcXIChangeCursor(ClientPtr client) { @@ -73,8 +63,10 @@ ProcXIChangeCursor(ClientPtr client) DeviceIntPtr pDev = NULL; CursorPtr pCursor = NULL; - REQUEST(xXIChangeCursorReq); - REQUEST_SIZE_MATCH(xXIChangeCursorReq); + REQUEST_HEAD_STRUCT(xXIChangeCursorReq); + REQUEST_FIELD_CARD32(win); + REQUEST_FIELD_CARD32(cursor); + REQUEST_FIELD_CARD16(deviceid); rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixSetAttrAccess); if (rc != Success) diff --git a/Xi/xichangecursor.h b/Xi/xichangecursor.h index 14477772a..305ba77cc 100644 --- a/Xi/xichangecursor.h +++ b/Xi/xichangecursor.h @@ -30,7 +30,6 @@ #ifndef CHDEVCUR_H #define CHDEVCUR_H 1 -int SProcXIChangeCursor(ClientPtr /* client */ ); int ProcXIChangeCursor(ClientPtr /* client */ ); #endif /* CHDEVCUR_H */ diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c index 90b19d9ac..781490554 100644 --- a/Xi/xichangehierarchy.c +++ b/Xi/xichangehierarchy.c @@ -42,6 +42,7 @@ #include "dix/exevents_priv.h" #include "dix/extension_priv.h" #include "dix/input_priv.h" +#include "dix/request_priv.h" #include "os/bug_priv.h" #include "inputstr.h" /* DeviceIntPtr */ @@ -423,7 +424,12 @@ attach_slave(ClientPtr client, xXIAttachSlaveInfo * c, int flags[MAXDEVICES]) return rc; } -#define SWAPIF(cmd) if (client->swapped) { cmd; } +/*********************************************************************** + * + * This procedure allows a client to change the device hierarchy through + * adding new master devices, removing them, etc. + * + */ int ProcXIChangeHierarchy(ClientPtr client) @@ -438,8 +444,7 @@ ProcXIChangeHierarchy(ClientPtr client) CHANGED, } changes = NO_CHANGE; - REQUEST(xXIChangeHierarchyReq); - REQUEST_AT_LEAST_SIZE(xXIChangeHierarchyReq); + REQUEST_HEAD_AT_LEAST(xXIChangeHierarchyReq); if (!stuff->num_changes) return rc; @@ -453,8 +458,7 @@ ProcXIChangeHierarchy(ClientPtr client) goto unwind; } - SWAPIF(swaps(&any->type)); - SWAPIF(swaps(&any->length)); + CLIENT_STRUCT_CARD16_2(any, type, length); if (len < ((size_t)any->length << 2)) return BadLength; @@ -477,7 +481,7 @@ ProcXIChangeHierarchy(ClientPtr client) rc = BadLength; goto unwind; } - SWAPIF(swaps(&c->name_len)); + CLIENT_STRUCT_CARD16_1(c, name_len); if (c->name_len > (len - sizeof(xXIAddMasterInfo))) { rc = BadLength; goto unwind; diff --git a/Xi/xigetclientpointer.c b/Xi/xigetclientpointer.c index e36667960..8903d8be5 100644 --- a/Xi/xigetclientpointer.c +++ b/Xi/xigetclientpointer.c @@ -31,6 +31,7 @@ #include #include "dix/dix_priv.h" +#include "dix/request_priv.h" #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ @@ -41,29 +42,14 @@ #include "exglobals.h" #include "xigetclientpointer.h" -/*********************************************************************** - * This procedure allows a client to query another client's client pointer - * setting. - */ - -int _X_COLD -SProcXIGetClientPointer(ClientPtr client) -{ - REQUEST(xXIGetClientPointerReq); - REQUEST_SIZE_MATCH(xXIGetClientPointerReq); - - swapl(&stuff->win); - return ProcXIGetClientPointer(client); -} - int ProcXIGetClientPointer(ClientPtr client) { int rc; ClientPtr winclient; - REQUEST(xXIGetClientPointerReq); - REQUEST_SIZE_MATCH(xXIGetClientPointerReq); + REQUEST_HEAD_STRUCT(xXIGetClientPointerReq); + REQUEST_FIELD_CARD32(win); if (stuff->win != None) { rc = dixLookupResourceOwner(&winclient, stuff->win, client, DixGetAttrAccess); diff --git a/Xi/xigetclientpointer.h b/Xi/xigetclientpointer.h index 2e3cfc330..6ccf838a8 100644 --- a/Xi/xigetclientpointer.h +++ b/Xi/xigetclientpointer.h @@ -30,7 +30,6 @@ #ifndef GETCPTR_H #define GETCPTR_H 1 -int SProcXIGetClientPointer(ClientPtr /* client */ ); int ProcXIGetClientPointer(ClientPtr /* client */ ); #endif /* GETCPTR_H */ diff --git a/Xi/xigrabdev.c b/Xi/xigrabdev.c index 3494c41cc..b08a2f222 100644 --- a/Xi/xigrabdev.c +++ b/Xi/xigrabdev.c @@ -36,6 +36,7 @@ #include "dix/dix_priv.h" #include "dix/exevents_priv.h" +#include "dix/request_priv.h" #include "dix/resource_priv.h" #include "inputstr.h" /* DeviceIntPtr */ @@ -44,25 +45,6 @@ #include "xigrabdev.h" #include "inpututils.h" -int _X_COLD -SProcXIGrabDevice(ClientPtr client) -{ - REQUEST(xXIGrabDeviceReq); - /* - * Check here for at least the length of the struct we swap, then - * let ProcXIGrabDevice check the full size after we swap mask_len. - */ - REQUEST_AT_LEAST_SIZE(xXIGrabDeviceReq); - - swaps(&stuff->deviceid); - swapl(&stuff->grab_window); - swapl(&stuff->cursor); - swapl(&stuff->time); - swaps(&stuff->mask_len); - - return ProcXIGrabDevice(client); -} - int ProcXIGrabDevice(ClientPtr client) { @@ -74,7 +56,12 @@ ProcXIGrabDevice(ClientPtr client) unsigned int keyboard_mode; unsigned int pointer_mode; - REQUEST(xXIGrabDeviceReq); + REQUEST_HEAD_AT_LEAST(xXIGrabDeviceReq); + REQUEST_FIELD_CARD16(deviceid); + REQUEST_FIELD_CARD32(grab_window); + REQUEST_FIELD_CARD32(cursor); + REQUEST_FIELD_CARD32(time); + REQUEST_FIELD_CARD16(mask_len); REQUEST_FIXED_SIZE(xXIGrabDeviceReq, ((size_t) stuff->mask_len) * 4); ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess); @@ -136,18 +123,6 @@ ProcXIGrabDevice(ClientPtr client) return ret; } -int _X_COLD -SProcXIUngrabDevice(ClientPtr client) -{ - REQUEST(xXIUngrabDeviceReq); - REQUEST_SIZE_MATCH(xXIUngrabDeviceReq); - - swaps(&stuff->deviceid); - swapl(&stuff->time); - - return ProcXIUngrabDevice(client); -} - int ProcXIUngrabDevice(ClientPtr client) { @@ -156,8 +131,9 @@ ProcXIUngrabDevice(ClientPtr client) int ret = Success; TimeStamp time; - REQUEST(xXIUngrabDeviceReq); - REQUEST_SIZE_MATCH(xXIUngrabDeviceReq); + REQUEST_HEAD_STRUCT(xXIUngrabDeviceReq); + REQUEST_FIELD_CARD16(deviceid); + REQUEST_FIELD_CARD32(time); ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess); if (ret != Success) diff --git a/Xi/xigrabdev.h b/Xi/xigrabdev.h index 3deacffed..c5bf8f382 100644 --- a/Xi/xigrabdev.h +++ b/Xi/xigrabdev.h @@ -31,9 +31,7 @@ #define XIGRABDEV_H 1 int ProcXIGrabDevice(ClientPtr client); -int SProcXIGrabDevice(ClientPtr client); int ProcXIUngrabDevice(ClientPtr client); -int SProcXIUngrabDevice(ClientPtr client); #endif /* XIGRABDEV_H */ diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c index 2eb8820aa..287a05c9c 100644 --- a/Xi/xipassivegrab.c +++ b/Xi/xipassivegrab.c @@ -37,6 +37,7 @@ #include "dix/dix_priv.h" #include "dix/dixgrabs_priv.h" #include "dix/exevents_priv.h" +#include "dix/request_priv.h" #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ @@ -46,34 +47,6 @@ #include "misc.h" #include "inpututils.h" -int _X_COLD -SProcXIPassiveGrabDevice(ClientPtr client) -{ - int i; - uint32_t *mods; - - REQUEST(xXIPassiveGrabDeviceReq); - REQUEST_AT_LEAST_SIZE(xXIPassiveGrabDeviceReq); - - swaps(&stuff->deviceid); - swapl(&stuff->grab_window); - swapl(&stuff->cursor); - swapl(&stuff->time); - swapl(&stuff->detail); - swaps(&stuff->mask_len); - swaps(&stuff->num_modifiers); - - REQUEST_FIXED_SIZE(xXIPassiveGrabDeviceReq, - ((uint32_t) stuff->mask_len + stuff->num_modifiers) *4); - mods = (uint32_t *) &stuff[1] + stuff->mask_len; - - for (i = 0; i < stuff->num_modifiers; i++, mods++) { - swapl(mods); - } - - return ProcXIPassiveGrabDevice(client); -} - int ProcXIPassiveGrabDevice(ClientPtr client) { @@ -93,9 +66,23 @@ ProcXIPassiveGrabDevice(ClientPtr client) void *tmp; int mask_len; - REQUEST(xXIPassiveGrabDeviceReq); + REQUEST_HEAD_AT_LEAST(xXIPassiveGrabDeviceReq); + REQUEST_FIELD_CARD16(deviceid); + REQUEST_FIELD_CARD32(grab_window); + REQUEST_FIELD_CARD32(cursor); + REQUEST_FIELD_CARD32(time); + REQUEST_FIELD_CARD32(detail); + REQUEST_FIELD_CARD16(mask_len); + REQUEST_FIELD_CARD16(num_modifiers); REQUEST_FIXED_SIZE(xXIPassiveGrabDeviceReq, - ((uint32_t) stuff->mask_len + stuff->num_modifiers) * 4); + ((uint32_t) stuff->mask_len + stuff->num_modifiers) *4); + + if (client->swapped) { + uint32_t *mods = (uint32_t *) &stuff[1] + stuff->mask_len; + for (i = 0; i < stuff->num_modifiers; i++, mods++) { + swapl(mods); + } + } if (stuff->deviceid == XIAllDevices) dev = inputInfo.all_devices; @@ -262,30 +249,6 @@ ProcXIPassiveGrabDevice(ClientPtr client) return ret; } -int _X_COLD -SProcXIPassiveUngrabDevice(ClientPtr client) -{ - int i; - uint32_t *modifiers; - - REQUEST(xXIPassiveUngrabDeviceReq); - REQUEST_AT_LEAST_SIZE(xXIPassiveUngrabDeviceReq); - - swapl(&stuff->grab_window); - swaps(&stuff->deviceid); - swapl(&stuff->detail); - swaps(&stuff->num_modifiers); - - REQUEST_FIXED_SIZE(xXIPassiveUngrabDeviceReq, - ((uint32_t) stuff->num_modifiers) << 2); - modifiers = (uint32_t *) &stuff[1]; - - for (i = 0; i < stuff->num_modifiers; i++, modifiers++) - swapl(modifiers); - - return ProcXIPassiveUngrabDevice(client); -} - int ProcXIPassiveUngrabDevice(ClientPtr client) { @@ -295,10 +258,20 @@ ProcXIPassiveUngrabDevice(ClientPtr client) uint32_t *modifiers; int i, rc; - REQUEST(xXIPassiveUngrabDeviceReq); + REQUEST_HEAD_AT_LEAST(xXIPassiveUngrabDeviceReq); + REQUEST_FIELD_CARD32(grab_window); + REQUEST_FIELD_CARD16(deviceid); + REQUEST_FIELD_CARD32(detail); + REQUEST_FIELD_CARD16(num_modifiers); REQUEST_FIXED_SIZE(xXIPassiveUngrabDeviceReq, ((uint32_t) stuff->num_modifiers) << 2); + if (client->swapped) { + modifiers = (uint32_t *) &stuff[1]; + for (i = 0; i < stuff->num_modifiers; i++, modifiers++) + swapl(modifiers); + } + if (stuff->deviceid == XIAllDevices) dev = inputInfo.all_devices; else if (stuff->deviceid == XIAllMasterDevices) diff --git a/Xi/xipassivegrab.h b/Xi/xipassivegrab.h index de59ab990..6c6777abe 100644 --- a/Xi/xipassivegrab.h +++ b/Xi/xipassivegrab.h @@ -30,9 +30,7 @@ #ifndef XIPASSIVEGRAB_H #define XIPASSIVEGRAB_H 1 -int SProcXIPassiveUngrabDevice(ClientPtr client); int ProcXIPassiveUngrabDevice(ClientPtr client); int ProcXIPassiveGrabDevice(ClientPtr client); -int SProcXIPassiveGrabDevice(ClientPtr client); #endif /* XIPASSIVEGRAB_H */ diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c index 55c52addb..e305d8e83 100644 --- a/Xi/xiproperty.c +++ b/Xi/xiproperty.c @@ -35,6 +35,7 @@ #include "dix/exevents_priv.h" #include "dix/extension_priv.h" #include "dix/input_priv.h" +#include "dix/request_priv.h" #include "dix.h" #include "inputstr.h" @@ -854,8 +855,7 @@ ProcXListDeviceProperties(ClientPtr client) DeviceIntPtr dev; int rc = Success; - REQUEST(xListDevicePropertiesReq); - REQUEST_SIZE_MATCH(xListDevicePropertiesReq); + REQUEST_HEAD_STRUCT(xListDevicePropertiesReq); rc = dixLookupDevice(&dev, stuff->deviceid, client, DixListPropAccess); if (rc != Success) @@ -890,13 +890,16 @@ ProcXListDeviceProperties(ClientPtr client) int ProcXChangeDeviceProperty(ClientPtr client) { - REQUEST(xChangeDevicePropertyReq); + REQUEST_HEAD_AT_LEAST(xChangeDevicePropertyReq); + REQUEST_FIELD_CARD32(property); + REQUEST_FIELD_CARD32(type); + REQUEST_FIELD_CARD32(nUnits); + DeviceIntPtr dev; unsigned long len; uint64_t totalSize; int rc; - REQUEST_AT_LEAST_SIZE(xChangeDevicePropertyReq); UpdateCurrentTime(); rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetPropAccess); @@ -923,11 +926,12 @@ ProcXChangeDeviceProperty(ClientPtr client) int ProcXDeleteDeviceProperty(ClientPtr client) { - REQUEST(xDeleteDevicePropertyReq); + REQUEST_HEAD_STRUCT(xDeleteDevicePropertyReq); + REQUEST_FIELD_CARD32(property); + DeviceIntPtr dev; int rc; - REQUEST_SIZE_MATCH(xDeleteDevicePropertyReq); UpdateCurrentTime(); rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetPropAccess); if (rc != Success) @@ -945,14 +949,18 @@ ProcXDeleteDeviceProperty(ClientPtr client) int ProcXGetDeviceProperty(ClientPtr client) { - REQUEST(xGetDevicePropertyReq); + REQUEST_HEAD_STRUCT(xGetDevicePropertyReq); + REQUEST_FIELD_CARD32(property); + REQUEST_FIELD_CARD32(type); + REQUEST_FIELD_CARD32(longOffset); + REQUEST_FIELD_CARD32(longLength); + DeviceIntPtr dev; int length; int rc, format, nitems, bytes_after; char *data; Atom type; - REQUEST_SIZE_MATCH(xGetDevicePropertyReq); if (stuff->delete) UpdateCurrentTime(); rc = dixLookupDevice(&dev, stuff->deviceid, client, @@ -1022,53 +1030,18 @@ ProcXGetDeviceProperty(ClientPtr client) return Success; } -int _X_COLD -SProcXChangeDeviceProperty(ClientPtr client) -{ - REQUEST(xChangeDevicePropertyReq); - - REQUEST_AT_LEAST_SIZE(xChangeDevicePropertyReq); - swapl(&stuff->property); - swapl(&stuff->type); - swapl(&stuff->nUnits); - return (ProcXChangeDeviceProperty(client)); -} - -int _X_COLD -SProcXDeleteDeviceProperty(ClientPtr client) -{ - REQUEST(xDeleteDevicePropertyReq); - REQUEST_SIZE_MATCH(xDeleteDevicePropertyReq); - - swapl(&stuff->property); - return (ProcXDeleteDeviceProperty(client)); -} - -int _X_COLD -SProcXGetDeviceProperty(ClientPtr client) -{ - REQUEST(xGetDevicePropertyReq); - REQUEST_SIZE_MATCH(xGetDevicePropertyReq); - - swapl(&stuff->property); - swapl(&stuff->type); - swapl(&stuff->longOffset); - swapl(&stuff->longLength); - return (ProcXGetDeviceProperty(client)); -} - /* XI2 Request/reply handling */ int ProcXIListProperties(ClientPtr client) { + REQUEST_HEAD_STRUCT(xXIListPropertiesReq); + REQUEST_FIELD_CARD16(deviceid); + Atom *atoms; int natoms; DeviceIntPtr dev; int rc = Success; - REQUEST(xXIListPropertiesReq); - REQUEST_SIZE_MATCH(xXIListPropertiesReq); - rc = dixLookupDevice(&dev, stuff->deviceid, client, DixListPropAccess); if (rc != Success) return rc; @@ -1102,13 +1075,17 @@ ProcXIListProperties(ClientPtr client) int ProcXIChangeProperty(ClientPtr client) { + REQUEST_HEAD_AT_LEAST(xXIChangePropertyReq); + REQUEST_FIELD_CARD16(deviceid); + REQUEST_FIELD_CARD32(property); + REQUEST_FIELD_CARD32(type); + REQUEST_FIELD_CARD32(num_items); + int rc; DeviceIntPtr dev; uint64_t totalSize; unsigned long len; - REQUEST(xXIChangePropertyReq); - REQUEST_AT_LEAST_SIZE(xXIChangePropertyReq); UpdateCurrentTime(); rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetPropAccess); @@ -1135,12 +1112,13 @@ ProcXIChangeProperty(ClientPtr client) int ProcXIDeleteProperty(ClientPtr client) { + REQUEST_HEAD_STRUCT(xXIDeletePropertyReq); + REQUEST_FIELD_CARD16(deviceid); + REQUEST_FIELD_CARD32(property); + DeviceIntPtr dev; int rc; - REQUEST(xXIDeletePropertyReq); - - REQUEST_SIZE_MATCH(xXIDeletePropertyReq); UpdateCurrentTime(); rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetPropAccess); if (rc != Success) @@ -1158,14 +1136,20 @@ ProcXIDeleteProperty(ClientPtr client) int ProcXIGetProperty(ClientPtr client) { - REQUEST(xXIGetPropertyReq); + REQUEST_HEAD_STRUCT(xXIGetPropertyReq); + + REQUEST_FIELD_CARD16(deviceid); + REQUEST_FIELD_CARD32(property); + REQUEST_FIELD_CARD32(type); + REQUEST_FIELD_CARD32(offset); + REQUEST_FIELD_CARD32(len); + DeviceIntPtr dev; int length; int rc, format, nitems, bytes_after; char *data; Atom type; - REQUEST_SIZE_MATCH(xXIGetPropertyReq); if (stuff->delete) UpdateCurrentTime(); rc = dixLookupDevice(&dev, stuff->deviceid, client, @@ -1234,51 +1218,3 @@ ProcXIGetProperty(ClientPtr client) return Success; } - -int _X_COLD -SProcXIListProperties(ClientPtr client) -{ - REQUEST(xXIListPropertiesReq); - REQUEST_SIZE_MATCH(xXIListPropertiesReq); - - swaps(&stuff->deviceid); - return (ProcXIListProperties(client)); -} - -int _X_COLD -SProcXIChangeProperty(ClientPtr client) -{ - REQUEST(xXIChangePropertyReq); - - REQUEST_AT_LEAST_SIZE(xXIChangePropertyReq); - swaps(&stuff->deviceid); - swapl(&stuff->property); - swapl(&stuff->type); - swapl(&stuff->num_items); - return (ProcXIChangeProperty(client)); -} - -int _X_COLD -SProcXIDeleteProperty(ClientPtr client) -{ - REQUEST(xXIDeletePropertyReq); - REQUEST_SIZE_MATCH(xXIDeletePropertyReq); - - swaps(&stuff->deviceid); - swapl(&stuff->property); - return (ProcXIDeleteProperty(client)); -} - -int _X_COLD -SProcXIGetProperty(ClientPtr client) -{ - REQUEST(xXIGetPropertyReq); - REQUEST_SIZE_MATCH(xXIGetPropertyReq); - - swaps(&stuff->deviceid); - swapl(&stuff->property); - swapl(&stuff->type); - swapl(&stuff->offset); - swapl(&stuff->len); - return (ProcXIGetProperty(client)); -} diff --git a/Xi/xiproperty.h b/Xi/xiproperty.h index 5edc28733..60638d459 100644 --- a/Xi/xiproperty.h +++ b/Xi/xiproperty.h @@ -35,22 +35,12 @@ int ProcXChangeDeviceProperty(ClientPtr client); int ProcXDeleteDeviceProperty(ClientPtr client); int ProcXGetDeviceProperty(ClientPtr client); -/* request swapping */ -int SProcXChangeDeviceProperty(ClientPtr client); -int SProcXDeleteDeviceProperty(ClientPtr client); -int SProcXGetDeviceProperty(ClientPtr client); - /* XI2 request/reply handling */ int ProcXIListProperties(ClientPtr client); int ProcXIChangeProperty(ClientPtr client); int ProcXIDeleteProperty(ClientPtr client); int ProcXIGetProperty(ClientPtr client); -int SProcXIListProperties(ClientPtr client); -int SProcXIChangeProperty(ClientPtr client); -int SProcXIDeleteProperty(ClientPtr client); -int SProcXIGetProperty(ClientPtr client); - void XIResetProperties(void); #endif /* XIPROPERTY_H */ diff --git a/Xi/xiquerydevice.c b/Xi/xiquerydevice.c index 95d18f20f..61d00e44b 100644 --- a/Xi/xiquerydevice.c +++ b/Xi/xiquerydevice.c @@ -36,6 +36,7 @@ #include "dix/exevents_priv.h" #include "dix/input_priv.h" +#include "dix/request_priv.h" #include "os/fmt.h" #include "inputstr.h" @@ -53,29 +54,19 @@ static int ListDeviceInfo(ClientPtr client, DeviceIntPtr dev, xXIDeviceInfo * info); static int SizeDeviceInfo(DeviceIntPtr dev); static void SwapDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo * info); -int _X_COLD -SProcXIQueryDevice(ClientPtr client) -{ - REQUEST(xXIQueryDeviceReq); - REQUEST_SIZE_MATCH(xXIQueryDeviceReq); - - swaps(&stuff->deviceid); - - return ProcXIQueryDevice(client); -} int ProcXIQueryDevice(ClientPtr client) { + REQUEST_HEAD_STRUCT(xXIQueryDeviceReq); + REQUEST_FIELD_CARD16(deviceid); + DeviceIntPtr dev = NULL; int rc = Success; int i = 0, len = 0; char *info, *ptr; Bool *skip = NULL; - REQUEST(xXIQueryDeviceReq); - REQUEST_SIZE_MATCH(xXIQueryDeviceReq); - if (stuff->deviceid != XIAllDevices && stuff->deviceid != XIAllMasterDevices) { rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess); diff --git a/Xi/xiquerydevice.h b/Xi/xiquerydevice.h index 5f6fee3db..df14c4b2a 100644 --- a/Xi/xiquerydevice.h +++ b/Xi/xiquerydevice.h @@ -33,7 +33,6 @@ #include -int SProcXIQueryDevice(ClientPtr client); int ProcXIQueryDevice(ClientPtr client); int SizeDeviceClasses(DeviceIntPtr dev); int ListDeviceClasses(ClientPtr client, DeviceIntPtr dev, diff --git a/Xi/xiquerypointer.c b/Xi/xiquerypointer.c index ef7f16dff..b63851b11 100644 --- a/Xi/xiquerypointer.c +++ b/Xi/xiquerypointer.c @@ -40,6 +40,7 @@ #include "dix/eventconvert.h" #include "dix/exevents_priv.h" #include "dix/input_priv.h" +#include "dix/request_priv.h" #include "os/fmt.h" #include "Xext/panoramiXsrv.h" @@ -59,20 +60,13 @@ * */ -int _X_COLD -SProcXIQueryPointer(ClientPtr client) -{ - REQUEST(xXIQueryPointerReq); - REQUEST_SIZE_MATCH(xXIQueryPointerReq); - - swaps(&stuff->deviceid); - swapl(&stuff->win); - return (ProcXIQueryPointer(client)); -} - int ProcXIQueryPointer(ClientPtr client) { + REQUEST_HEAD_STRUCT(xXIQueryPointerReq); + REQUEST_FIELD_CARD16(deviceid); + REQUEST_FIELD_CARD32(win); + int rc; DeviceIntPtr pDev, kbd; WindowPtr pWin, t; @@ -83,9 +77,6 @@ ProcXIQueryPointer(ClientPtr client) XIClientPtr xi_client; Bool have_xi22 = FALSE; - REQUEST(xXIQueryPointerReq); - REQUEST_SIZE_MATCH(xXIQueryPointerReq); - /* Check if client is compliant with XInput 2.2 or later. Earlier clients * do not know about touches, so we must report emulated button presses. 2.2 * and later clients are aware of touches, so we don't include emulated diff --git a/Xi/xiquerypointer.h b/Xi/xiquerypointer.h index f4dfacc4f..f455aa44b 100644 --- a/Xi/xiquerypointer.h +++ b/Xi/xiquerypointer.h @@ -30,7 +30,6 @@ #ifndef QUERYDP_H #define QUERYDP_H 1 -int SProcXIQueryPointer(ClientPtr /* client */ ); int ProcXIQueryPointer(ClientPtr /* client */ ); #endif /* QUERYDP_H */ diff --git a/Xi/xiqueryversion.c b/Xi/xiqueryversion.c index 44aa68264..2b8ca45d7 100644 --- a/Xi/xiqueryversion.c +++ b/Xi/xiqueryversion.c @@ -36,6 +36,7 @@ #include #include "dix/exevents_priv.h" +#include "dix/request_priv.h" #include "os/fmt.h" #include "inputstr.h" @@ -54,12 +55,13 @@ extern XExtensionVersion XIVersion; /* defined in getvers.c */ int ProcXIQueryVersion(ClientPtr client) { + REQUEST_HEAD_AT_LEAST(xXIQueryVersionReq); + REQUEST_FIELD_CARD16(major_version); + REQUEST_FIELD_CARD16(minor_version); + XIClientPtr pXIClient; int major, minor; - REQUEST(xXIQueryVersionReq); - REQUEST_SIZE_MATCH(xXIQueryVersionReq); - /* This request only exists after XI2 */ if (stuff->major_version < 2) { client->errorValue = stuff->major_version; @@ -129,15 +131,3 @@ ProcXIQueryVersion(ClientPtr client) return Success; } - -/* Swapping routines */ - -int _X_COLD -SProcXIQueryVersion(ClientPtr client) -{ - REQUEST(xXIQueryVersionReq); - REQUEST_AT_LEAST_SIZE(xXIQueryVersionReq); - swaps(&stuff->major_version); - swaps(&stuff->minor_version); - return (ProcXIQueryVersion(client)); -} diff --git a/Xi/xiqueryversion.h b/Xi/xiqueryversion.h index 824e168a4..9502d1177 100644 --- a/Xi/xiqueryversion.h +++ b/Xi/xiqueryversion.h @@ -33,7 +33,6 @@ #ifndef QUERYVERSION_H #define QUERYVERSION_H 1 -int SProcXIQueryVersion(ClientPtr client); int ProcXIQueryVersion(ClientPtr client); #endif /* QUERYVERSION_H */ diff --git a/Xi/xiselectev.c b/Xi/xiselectev.c index 6bd117414..3baa9b545 100644 --- a/Xi/xiselectev.c +++ b/Xi/xiselectev.c @@ -29,6 +29,7 @@ #include "dix/dix_priv.h" #include "dix/exevents_priv.h" +#include "dix/request_priv.h" #include "dix/resource_priv.h" #include "dixstruct.h" @@ -113,39 +114,37 @@ XICheckInvalidMaskBits(ClientPtr client, unsigned char *mask, int len) return Success; } -int _X_COLD -SProcXISelectEvents(ClientPtr client) -{ - int i; - int len; - xXIEventMask *evmask; - - REQUEST(xXISelectEventsReq); - REQUEST_AT_LEAST_SIZE(xXISelectEventsReq); - swapl(&stuff->win); - swaps(&stuff->num_masks); - - len = client->req_len - bytes_to_int32(sizeof(xXISelectEventsReq)); - evmask = (xXIEventMask *) &stuff[1]; - for (i = 0; i < stuff->num_masks; i++) { - if (len < bytes_to_int32(sizeof(xXIEventMask))) - return BadLength; - len -= bytes_to_int32(sizeof(xXIEventMask)); - swaps(&evmask->deviceid); - swaps(&evmask->mask_len); - if (len < evmask->mask_len) - return BadLength; - len -= evmask->mask_len; - evmask = - (xXIEventMask *) (((char *) &evmask[1]) + evmask->mask_len * 4); - } - - return (ProcXISelectEvents(client)); -} - int ProcXISelectEvents(ClientPtr client) { + REQUEST_HEAD_AT_LEAST(xXISelectEventsReq); + REQUEST_FIELD_CARD32(win); + REQUEST_FIELD_CARD16(num_masks); + + if (stuff->num_masks == 0) + return BadValue; + + if (client->swapped) { + int i; + int len; + xXIEventMask *evmask; + + len = stuff->length - bytes_to_int32(sizeof(xXISelectEventsReq)); + evmask = (xXIEventMask *) &stuff[1]; + for (i = 0; i < stuff->num_masks; i++) { + if (len < bytes_to_int32(sizeof(xXIEventMask))) + return BadLength; + len -= bytes_to_int32(sizeof(xXIEventMask)); + swaps(&evmask->deviceid); + swaps(&evmask->mask_len); + if (len < evmask->mask_len) + return BadLength; + len -= evmask->mask_len; + evmask = + (xXIEventMask *) (((char *) &evmask[1]) + evmask->mask_len * 4); + } + } + int rc, num_masks; WindowPtr win; DeviceIntPtr dev; @@ -154,12 +153,6 @@ ProcXISelectEvents(ClientPtr client) int *types = NULL; int len; - REQUEST(xXISelectEventsReq); - REQUEST_AT_LEAST_SIZE(xXISelectEventsReq); - - if (stuff->num_masks == 0) - return BadValue; - rc = dixLookupWindow(&win, stuff->win, client, DixReceiveAccess); if (rc != Success) return rc; @@ -327,19 +320,12 @@ ProcXISelectEvents(ClientPtr client) return Success; } -int _X_COLD -SProcXIGetSelectedEvents(ClientPtr client) -{ - REQUEST(xXIGetSelectedEventsReq); - REQUEST_SIZE_MATCH(xXIGetSelectedEventsReq); - swapl(&stuff->win); - - return (ProcXIGetSelectedEvents(client)); -} - int ProcXIGetSelectedEvents(ClientPtr client) { + REQUEST_HEAD_STRUCT(xXIGetSelectedEventsReq); + REQUEST_FIELD_CARD32(win); + int rc, i; WindowPtr win; OtherInputMasks *masks; @@ -347,9 +333,6 @@ ProcXIGetSelectedEvents(ClientPtr client) xXIEventMask *evmask = NULL; DeviceIntPtr dev; - REQUEST(xXIGetSelectedEventsReq); - REQUEST_SIZE_MATCH(xXIGetSelectedEventsReq); - rc = dixLookupWindow(&win, stuff->win, client, DixGetAttrAccess); if (rc != Success) return rc; diff --git a/Xi/xiselectev.h b/Xi/xiselectev.h index f0f0d1c16..d6328a9df 100644 --- a/Xi/xiselectev.h +++ b/Xi/xiselectev.h @@ -30,9 +30,7 @@ #ifndef XISELECTEVENTS_H #define XISELECTEVENTS_H 1 -int SProcXISelectEvents(ClientPtr client); int ProcXISelectEvents(ClientPtr client); -int SProcXIGetSelectedEvents(ClientPtr client); int ProcXIGetSelectedEvents(ClientPtr client); #endif /* _XISELECTEVENTS_H_ */ diff --git a/Xi/xisetclientpointer.c b/Xi/xisetclientpointer.c index 2f8808c93..a90fb2551 100644 --- a/Xi/xisetclientpointer.c +++ b/Xi/xisetclientpointer.c @@ -34,40 +34,32 @@ #include /* for inputstr.h */ #include /* Request macro */ +#include +#include #include "dix/dix_priv.h" +#include "dix/request_priv.h" #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ #include "scrnintstr.h" /* screen structure */ -#include -#include #include "extnsionst.h" #include "exevents.h" #include "exglobals.h" #include "xisetclientpointer.h" -int _X_COLD -SProcXISetClientPointer(ClientPtr client) -{ - REQUEST(xXISetClientPointerReq); - REQUEST_SIZE_MATCH(xXISetClientPointerReq); - - swapl(&stuff->win); - swaps(&stuff->deviceid); - return (ProcXISetClientPointer(client)); -} - int ProcXISetClientPointer(ClientPtr client) { + REQUEST_HEAD_STRUCT(xXISetClientPointerReq); + + REQUEST_FIELD_CARD32(win); + REQUEST_FIELD_CARD16(deviceid); + DeviceIntPtr pDev; ClientPtr targetClient; int rc; - REQUEST(xXISetClientPointerReq); - REQUEST_SIZE_MATCH(xXISetClientPointerReq); - rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixManageAccess); if (rc != Success) { client->errorValue = stuff->deviceid; diff --git a/Xi/xisetclientpointer.h b/Xi/xisetclientpointer.h index f5c15bf49..0bac38d88 100644 --- a/Xi/xisetclientpointer.h +++ b/Xi/xisetclientpointer.h @@ -30,7 +30,6 @@ #ifndef SETCPTR_H #define SETCPTR_H 1 -int SProcXISetClientPointer(ClientPtr /* client */ ); int ProcXISetClientPointer(ClientPtr /* client */ ); #endif /* SETCPTR_H */ diff --git a/Xi/xisetdevfocus.c b/Xi/xisetdevfocus.c index 303578237..8293555ad 100644 --- a/Xi/xisetdevfocus.c +++ b/Xi/xisetdevfocus.c @@ -34,45 +34,24 @@ #include #include "dix/dix_priv.h" +#include "dix/request_priv.h" #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ #include "exglobals.h" /* BadDevice */ #include "xisetdevfocus.h" -int _X_COLD -SProcXISetFocus(ClientPtr client) -{ - REQUEST(xXISetFocusReq); - REQUEST_AT_LEAST_SIZE(xXISetFocusReq); - - swaps(&stuff->deviceid); - swapl(&stuff->focus); - swapl(&stuff->time); - - return ProcXISetFocus(client); -} - -int _X_COLD -SProcXIGetFocus(ClientPtr client) -{ - REQUEST(xXIGetFocusReq); - REQUEST_AT_LEAST_SIZE(xXIGetFocusReq); - - swaps(&stuff->deviceid); - - return ProcXIGetFocus(client); -} - int ProcXISetFocus(ClientPtr client) { + REQUEST_HEAD_AT_LEAST(xXISetFocusReq); + REQUEST_FIELD_CARD16(deviceid); + REQUEST_FIELD_CARD32(focus); + REQUEST_FIELD_CARD32(time); + DeviceIntPtr dev; int ret; - REQUEST(xXISetFocusReq); - REQUEST_AT_LEAST_SIZE(xXISetFocusReq); - ret = dixLookupDevice(&dev, stuff->deviceid, client, DixSetFocusAccess); if (ret != Success) return ret; @@ -86,12 +65,12 @@ ProcXISetFocus(ClientPtr client) int ProcXIGetFocus(ClientPtr client) { + REQUEST_HEAD_AT_LEAST(xXIGetFocusReq); + REQUEST_FIELD_CARD16(deviceid); + DeviceIntPtr dev; int ret; - REQUEST(xXIGetFocusReq); - REQUEST_AT_LEAST_SIZE(xXIGetFocusReq); - ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetFocusAccess); if (ret != Success) return ret; diff --git a/Xi/xisetdevfocus.h b/Xi/xisetdevfocus.h index 68dbe0ee5..785b429ec 100644 --- a/Xi/xisetdevfocus.h +++ b/Xi/xisetdevfocus.h @@ -30,10 +30,8 @@ #ifndef XISETDEVFOCUS_H #define XISETDEVFOCUS_H 1 -int SProcXISetFocus(ClientPtr client); int ProcXISetFocus(ClientPtr client); -int SProcXIGetFocus(ClientPtr client); int ProcXIGetFocus(ClientPtr client); #endif /* XISETDEVFOCUS_H */ diff --git a/Xi/xiwarppointer.c b/Xi/xiwarppointer.c index 84c2db81b..8c25416ec 100644 --- a/Xi/xiwarppointer.c +++ b/Xi/xiwarppointer.c @@ -39,6 +39,7 @@ #include "dix/cursor_priv.h" #include "dix/dix_priv.h" #include "dix/input_priv.h" +#include "dix/request_priv.h" #include "mi/mipointer_priv.h" #include "inputstr.h" /* DeviceIntPtr */ @@ -56,27 +57,20 @@ * */ -int _X_COLD -SProcXIWarpPointer(ClientPtr client) -{ - REQUEST(xXIWarpPointerReq); - REQUEST_SIZE_MATCH(xXIWarpPointerReq); - - swapl(&stuff->src_win); - swapl(&stuff->dst_win); - swapl(&stuff->src_x); - swapl(&stuff->src_y); - swaps(&stuff->src_width); - swaps(&stuff->src_height); - swapl(&stuff->dst_x); - swapl(&stuff->dst_y); - swaps(&stuff->deviceid); - return (ProcXIWarpPointer(client)); -} - int ProcXIWarpPointer(ClientPtr client) { + REQUEST_HEAD_STRUCT(xXIWarpPointerReq); + REQUEST_FIELD_CARD32(src_win); + REQUEST_FIELD_CARD32(dst_win); + REQUEST_FIELD_CARD32(src_x); + REQUEST_FIELD_CARD32(src_y); + REQUEST_FIELD_CARD16(src_width); + REQUEST_FIELD_CARD16(src_height); + REQUEST_FIELD_CARD32(dst_x); + REQUEST_FIELD_CARD32(dst_y); + REQUEST_FIELD_CARD16(deviceid); + int rc; int x, y; WindowPtr dest = NULL; @@ -86,9 +80,6 @@ ProcXIWarpPointer(ClientPtr client) int src_x, src_y; int dst_x, dst_y; - REQUEST(xXIWarpPointerReq); - REQUEST_SIZE_MATCH(xXIWarpPointerReq); - /* FIXME: panoramix stuff is missing, look at ProcWarpPointer */ rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixWriteAccess); diff --git a/Xi/xiwarppointer.h b/Xi/xiwarppointer.h index 7637f422a..3f28e3c79 100644 --- a/Xi/xiwarppointer.h +++ b/Xi/xiwarppointer.h @@ -30,7 +30,6 @@ #ifndef WARPDEVP_H #define WARPDEVP_H 1 -int SProcXIWarpPointer(ClientPtr /* client */ ); int ProcXIWarpPointer(ClientPtr /* client */ ); #endif /* WARPDEVP_H */ diff --git a/test/xi1/protocol-xchangedevicecontrol.c b/test/xi1/protocol-xchangedevicecontrol.c index 1ec1d1a26..8718cf3c8 100644 --- a/test/xi1/protocol-xchangedevicecontrol.c +++ b/test/xi1/protocol-xchangedevicecontrol.c @@ -76,7 +76,7 @@ request_ChangeDeviceControl(ClientPtr client, xChangeDeviceControlReq * req, swaps(&ctl->length); swaps(&ctl->control); /* XXX: swap other contents of ctl, depending on type */ - rc = SProcXChangeDeviceControl(&client_request); + rc = ProcXChangeDeviceControl(&client_request); assert(rc == error); } diff --git a/test/xi2/protocol-xigetclientpointer.c b/test/xi2/protocol-xigetclientpointer.c index ca33ec184..fa0469eb4 100644 --- a/test/xi2/protocol-xigetclientpointer.c +++ b/test/xi2/protocol-xigetclientpointer.c @@ -91,7 +91,7 @@ request_XIGetClientPointer(ClientPtr client, xXIGetClientPointerReq * req, client_request.swapped = TRUE; swapl(&req->win); swaps(&req->length); - rc = SProcXIGetClientPointer(&client_request); + rc = ProcXIGetClientPointer(&client_request); assert(rc == error); if (rc == BadWindow) diff --git a/test/xi2/protocol-xigetselectedevents.c b/test/xi2/protocol-xigetselectedevents.c index b13077955..086b11df5 100644 --- a/test/xi2/protocol-xigetselectedevents.c +++ b/test/xi2/protocol-xigetselectedevents.c @@ -151,7 +151,7 @@ request_XIGetSelectedEvents(xXIGetSelectedEventsReq * req, int error) */ swapl(&req->win); - rc = SProcXIGetSelectedEvents(&client); + rc = ProcXIGetSelectedEvents(&client); assert(rc == error); } diff --git a/test/xi2/protocol-xipassivegrabdevice.c b/test/xi2/protocol-xipassivegrabdevice.c index f794faf5c..4694819fa 100644 --- a/test/xi2/protocol-xipassivegrabdevice.c +++ b/test/xi2/protocol-xipassivegrabdevice.c @@ -172,7 +172,7 @@ request_XIPassiveGrabDevice(ClientPtr client, xXIPassiveGrabDeviceReq * req, swapl(mod); } - rc = SProcXIPassiveGrabDevice(&client_request); + rc = ProcXIPassiveGrabDevice(&client_request); assert(rc == error); if (rc != Success) diff --git a/test/xi2/protocol-xiquerydevice.c b/test/xi2/protocol-xiquerydevice.c index daa3f6024..0384566cc 100644 --- a/test/xi2/protocol-xiquerydevice.c +++ b/test/xi2/protocol-xiquerydevice.c @@ -304,7 +304,7 @@ request_XIQueryDevice(struct test_data *querydata, int deviceid, int error) client.swapped = TRUE; swaps(&request.length); swaps(&request.deviceid); - rc = SProcXIQueryDevice(&client); + rc = ProcXIQueryDevice(&client); assert(rc == error); if (rc != Success) diff --git a/test/xi2/protocol-xiquerypointer.c b/test/xi2/protocol-xiquerypointer.c index 99933483c..daa680628 100644 --- a/test/xi2/protocol-xiquerypointer.c +++ b/test/xi2/protocol-xiquerypointer.c @@ -131,7 +131,7 @@ request_XIQueryPointer(ClientPtr client, xXIQueryPointerReq * req, int error) swaps(&req->deviceid); swapl(&req->win); swaps(&req->length); - rc = SProcXIQueryPointer(&client_request); + rc = ProcXIQueryPointer(&client_request); assert(rc == error); if (rc == BadDevice) diff --git a/test/xi2/protocol-xiqueryversion.c b/test/xi2/protocol-xiqueryversion.c index f452333e6..bd0289c63 100644 --- a/test/xi2/protocol-xiqueryversion.c +++ b/test/xi2/protocol-xiqueryversion.c @@ -147,7 +147,7 @@ request_XIQueryVersion(int smaj, int smin, int cmaj, int cmin, int error) swaps(&request.major_version); swaps(&request.minor_version); - rc = SProcXIQueryVersion(&client); + rc = ProcXIQueryVersion(&client); assert(rc == error); } diff --git a/test/xi2/protocol-xiselectevents.c b/test/xi2/protocol-xiselectevents.c index 237c8f00b..8390677ab 100644 --- a/test/xi2/protocol-xiselectevents.c +++ b/test/xi2/protocol-xiselectevents.c @@ -119,7 +119,7 @@ request_XISelectEvent(xXISelectEventsReq * req, int error) swapl(&req->win); swaps(&req->num_masks); - rc = SProcXISelectEvents(&client); + rc = ProcXISelectEvents(&client); assert(rc == error); } diff --git a/test/xi2/protocol-xisetclientpointer.c b/test/xi2/protocol-xisetclientpointer.c index 674bc9b18..04a5b90e4 100644 --- a/test/xi2/protocol-xisetclientpointer.c +++ b/test/xi2/protocol-xisetclientpointer.c @@ -79,7 +79,7 @@ request_XISetClientPointer(xXISetClientPointerReq * req, int error) swapl(&req->win); swaps(&req->deviceid); - rc = SProcXISetClientPointer(&client_request); + rc = ProcXISetClientPointer(&client_request); assert(rc == error); if (rc == BadDevice) diff --git a/test/xi2/protocol-xiwarppointer.c b/test/xi2/protocol-xiwarppointer.c index 680a94cf2..7b495a2c2 100644 --- a/test/xi2/protocol-xiwarppointer.c +++ b/test/xi2/protocol-xiwarppointer.c @@ -86,7 +86,7 @@ request_XIWarpPointer(ClientPtr client, xXIWarpPointerReq * req, int error) swaps(&req->src_height); swaps(&req->deviceid); - rc = SProcXIWarpPointer(client); + rc = ProcXIWarpPointer(client); assert(rc == error); if (rc == BadDevice)