diff --git a/Xi/chgdctl.c b/Xi/chgdctl.c index 24f5ebb39..fd7e52bec 100644 --- a/Xi/chgdctl.c +++ b/Xi/chgdctl.c @@ -66,37 +66,6 @@ SOFTWARE. #include "XIstubs.h" #include "exglobals.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. @@ -106,6 +75,16 @@ SProcXChangeDeviceControl(ClientPtr client) int ProcXChangeDeviceControl(ClientPtr client) { + REQUEST(xChangeDeviceControlReq); + REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl)); + + if (client->swapped) { + swaps(&stuff->control); + xDeviceCtl *ctl = (xDeviceCtl *) &stuff[1]; + swaps(&ctl->control); + swaps(&ctl->length); + } + unsigned len; int i, status, ret = BadValue; DeviceIntPtr dev; @@ -114,9 +93,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/extinit.c b/Xi/extinit.c index f45165c87..233c9d331 100644 --- a/Xi/extinit.c +++ b/Xi/extinit.c @@ -420,7 +420,7 @@ SProcIDispatch(ClientPtr client) case X_GetDeviceControl: return ProcXGetDeviceControl(client); case X_ChangeDeviceControl: - return SProcXChangeDeviceControl(client); + return ProcXChangeDeviceControl(client); /* XI 1.5 */ case X_ListDeviceProperties: return ProcXListDeviceProperties(client); diff --git a/Xi/handlers.h b/Xi/handlers.h index 7bfd282c9..3a3a9eea0 100644 --- a/Xi/handlers.h +++ b/Xi/handlers.h @@ -69,7 +69,6 @@ int ProcXUngrabDeviceButton(ClientPtr client); int ProcXUngrabDevice(ClientPtr client); int ProcXUngrabDeviceKey(ClientPtr client); -int SProcXChangeDeviceControl(ClientPtr client); int SProcXChangeDeviceDontPropagateList(ClientPtr client); int SProcXGetDeviceDontPropagateList(ClientPtr client); int SProcXGetDeviceMotionEvents(ClientPtr client); diff --git a/test/xi1/protocol-xchangedevicecontrol.c b/test/xi1/protocol-xchangedevicecontrol.c index 9d2ea9ba4..8433e13ee 100644 --- a/test/xi1/protocol-xchangedevicecontrol.c +++ b/test/xi1/protocol-xchangedevicecontrol.c @@ -78,7 +78,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); }