&& stuff->mousetype != MTYPE_SYSMOUSE)
&& stuff->mousetype != MTYPE_SYSMOUSE && stuff->mousetype != MTYPE_WSMOUSE)
ProcXF86MiscSetMouseSettings(client)    register ClientPtr client;{    int reopen, msetype, flags, baudrate, samplerate, resolution;    REQUEST(xXF86MiscSetMouseSettingsReq);    REQUEST_SIZE_MATCH(xXF86MiscSetMouseSettingsReq);    if (xf86Verbose) {	ErrorF("SetMouseSettings - type: %d brate: %d srate: %d chdmid: %d\n",		stuff->mousetype, stuff->baudrate,		stuff->samplerate, stuff->chordmiddle);	ErrorF("                   em3but: %d em3tim: %d res: %d flags: %d\n",		stuff->emulate3buttons, stuff->emulate3timeout,		stuff->resolution, stuff->flags);    }    if (stuff->mousetype > MTYPE_OSMOUSE            || stuff->mousetype < MTYPE_MICROSOFT)	return miscErrorBase + XF86MiscBadMouseProtocol;#ifdef OSMOUSE_ONLY    if (stuff->mousetype != MTYPE_OSMOUSE)	return miscErrorBase + XF86MiscBadMouseProtocol;#else#ifndef XQUEUE    if (stuff->mousetype == MTYPE_XQUEUE)	return miscErrorBase + XF86MiscBadMouseProtocol;#endif#ifndef USE_OSMOUSE    if (stuff->mousetype == MTYPE_OSMOUSE)	return miscErrorBase + XF86MiscBadMouseProtocol;#endif#endif /* OSMOUSE_ONLY */    if (stuff->emulate3timeout < 0)	return BadValue;    if (stuff->mousetype == MTYPE_LOGIMAN            && !(stuff->baudrate == 1200 || stuff->baudrate == 9600) )	return miscErrorBase + XF86MiscBadMouseBaudRate;    if (stuff->mousetype == MTYPE_LOGIMAN && stuff->samplerate)	return miscErrorBase + XF86MiscBadMouseCombo;    samplerate = xf86Info.mouseDev->sampleRate;    resolution = xf86Info.mouseDev->resolution;    baudrate   = xf86Info.mouseDev->baudRate;    flags      = xf86Info.mouseDev->mouseFlags;    msetype    = xf86Info.mouseDev->mseType;#ifdef XQUEUE    if (xf86Info.mouseDev->mseProc == xf86XqueMseProc)        msetype = MTYPE_XQUEUE;#endif#if defined(USE_OSMOUSE) || defined(OSMOUSE_ONLY)    if (xf86Info.mouseDev->mseProc == xf86OsMouseProc)        msetype = MTYPE_OSMOUSE;#endif    reopen     = 0;    if (stuff->mousetype != msetype)	if (stuff->mousetype == MTYPE_XQUEUE		|| stuff->mousetype == MTYPE_OSMOUSE		|| msetype == MTYPE_XQUEUE		|| msetype == MTYPE_OSMOUSE)	    return miscErrorBase + XF86MiscBadMouseProtocol;	else {	    reopen++;	    msetype = stuff->mousetype;	}    if (stuff->flags & MF_REOPEN) {	reopen++;	stuff->flags &= ~MF_REOPEN;    }    if (stuff->mousetype != MTYPE_OSMOUSE	    && stuff->mousetype != MTYPE_XQUEUE	    && stuff->mousetype != MTYPE_PS_2	    && stuff->mousetype != MTYPE_BUSMOUSE	    && stuff->mousetype != MTYPE_IMPS2	    && stuff->mousetype != MTYPE_THINKINGPS2	    && stuff->mousetype != MTYPE_MMANPLUSPS2	    && stuff->mousetype != MTYPE_GLIDEPOINTPS2	    && stuff->mousetype != MTYPE_NETPS2	    && stuff->mousetype != MTYPE_NETSCROLLPS2	    && stuff->mousetype != MTYPE_SYSMOUSE)    {        if (stuff->baudrate < 1200)	    return miscErrorBase + XF86MiscBadMouseBaudRate;        if (stuff->baudrate % 1200 != 0                || stuff->baudrate < 1200 || stuff->baudrate > 9600)	    return miscErrorBase + XF86MiscBadMouseBaudRate;	if (xf86Info.mouseDev->baudRate != stuff->baudrate) {		reopen++;		baudrate = stuff->baudrate;	}    }    if (stuff->flags & (MF_CLEAR_DTR|MF_CLEAR_RTS))	if (stuff->mousetype != MTYPE_MOUSESYS)	    return miscErrorBase + XF86MiscBadMouseFlags;	else if (xf86Info.mouseDev->mouseFlags != stuff->flags) {	    reopen++;            flags = stuff->flags;	}    if (stuff->mousetype != MTYPE_OSMOUSE	    && stuff->mousetype != MTYPE_XQUEUE	    && stuff->mousetype != MTYPE_BUSMOUSE)    {        if (stuff->samplerate < 0)	    return BadValue;		if (xf86Info.mouseDev->sampleRate != stuff->samplerate) {		reopen++;		samplerate = stuff->samplerate;	}    }    if (stuff->resolution < 0)	return BadValue;    if (xf86Info.mouseDev->resolution != stuff->resolution) {	reopen++;	resolution = stuff->resolution;    }#if 0    /* Ignore the buttons field */    if (xf86Info.mouseDev->buttons != stuff->buttons)	/* we cannot change this field on the fly... */	return BadValue;#endif    if (stuff->chordmiddle)        if (stuff->emulate3buttons		|| !(stuff->mousetype == MTYPE_MICROSOFT		     || stuff->mousetype == MTYPE_LOGIMAN) )	    return miscErrorBase + XF86MiscBadMouseCombo;    xf86Info.mouseDev->chordMiddle = stuff->chordmiddle!=0;    xf86Info.mouseDev->emulate3Buttons = stuff->emulate3buttons!=0;    xf86Info.mouseDev->emulate3Timeout = stuff->emulate3timeout;    if (reopen && msetype != MTYPE_OSMOUSE && msetype != MTYPE_XQUEUE) {        (xf86Info.mouseDev->mseProc)(xf86Info.pMouse, DEVICE_CLOSE);        xf86Info.mouseDev->mseType    = msetype;        xf86Info.mouseDev->mouseFlags = flags;        xf86Info.mouseDev->baudRate   = baudrate;        xf86Info.mouseDev->sampleRate = samplerate;	xf86Info.mouseDev->resolution = resolution;	xf86Info.pMouse->public.on = FALSE;	xf86AllowMouseOpenFail = TRUE;	xf86MouseInit(xf86Info.mouseDev);        (xf86Info.mouseDev->mseProc)(xf86Info.pMouse, DEVICE_ON);    }    if (xf86Verbose)	ErrorF("SetMouseSettings - Succeeded\n");    return (client->noClientException);}