Compare commits

...

42 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult a5074bb749 dix: write out X_ListInstalledColormaps reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:28 +02:00
Enrico Weigelt, metux IT consult 900957760e dix: write out X_ListProperties reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:28 +02:00
Enrico Weigelt, metux IT consult 0f03b898e1 dix: write out X_GetProperty reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult 50e2471ff8 dix: write out X_ListExtensions reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult 54e9dcd06f dix: write out X_QueryExtension reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult d64ab27110 dix: write out X_QueryPointer reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult 9fa0cf3c60 dix: write out X_GrabKeyboard reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult a492ebcb4c dix: write out X_GrabPointer reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult d15ea92195 dix: write out X_GetInputFocus reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult 12d32f26e2 dix: write out X_GetFontPath reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult 9c234253a4 dix: write out X_ListHosts reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult 2910e83693 dix: write out X_GetScreenSaver reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult cc2c43c211 dix: write out X_QueryBestSize reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult 688e7abac4 dix: write out X_LookupColor reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult c8b8d31d6a dix: write out X_QueryColors reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult ef35352e2b dix: write out X_AllocColorPlanes reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult be5d4a26b0 dix: write out X-AllocColorCells reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult 95a86127e9 dix: write out X_AllocNamedColor reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult d0525f1562 dix: write out X_AllocColor reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult a1cc55453b dix: write out X_ListInstalledColormaps reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult 9f7b63df14 dix: write out X_QueryTextExtents reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult 3c6a5956b2 dix: write out X_ListFontsWithInfo reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult 7b28994eb5 dix: write out X_ListFonts reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult 46325ef467 dix: write out X_QueryFont reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult 6a828150b5 dix: write out X_GetAtomName reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult c90b951d71 dix: write out X_InternAtom reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult ec8948dd1d dix: write out X_QueryTree reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult 3d343498c2 dix: write out X_GetWindowAttributes reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult 67e784cb30 dix: write out X_QueryKeymap reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult 6c1a24c7cc dix: write out X_GetPointerControl reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult a39d9e984c dix: write out X_GetPointerControl reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult 7bf52a5510 dix: write out X_GetKeyboardControl reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult 3f4b59f5b5 dix: write out X_GetKeyboardMapping reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult e1db3b431e dix: write out X_GetPointerMapping reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult 95878b2dd3 dix: write out X_SetPointerMapping reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult d9b9906c45 dix: write out X_GetModifierMapping reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult 4664c1a6f8 dix: write out X_SetModifierMapping reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult 5620ee1752 dix: write out X_GetSelectionOwner reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult b3db55be06 dix: write out X_GetImage reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult 3cab73e790 dix: write out X_TranslateCoords reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult 345daa5830 dix: write out X_GetGeometry reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
Enrico Weigelt, metux IT consult 31207481e2 dix: consolidate ProcGetGeometry()
No need to have it split into two functions one just wrapping
another, so move it all into one.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-07 20:10:27 +02:00
12 changed files with 686 additions and 1030 deletions

View File

@ -557,7 +557,6 @@ PanoramiXCirculateWindow(ClientPtr client)
int
PanoramiXGetGeometry(ClientPtr client)
{
xGetGeometryReply rep;
DrawablePtr pDraw;
int rc;
@ -568,7 +567,7 @@ PanoramiXGetGeometry(ClientPtr client)
if (rc != Success)
return rc;
rep = (xGetGeometryReply) {
xGetGeometryReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
@ -602,7 +601,16 @@ PanoramiXGetGeometry(ClientPtr client)
rep.borderWidth = pWin->borderWidth;
}
WriteReplyToClient(client, sizeof(xGetGeometryReply), &rep);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.root);
swaps(&rep.x);
swaps(&rep.y);
swaps(&rep.width);
swaps(&rep.height);
swaps(&rep.borderWidth);
}
WriteToClient(client, sizeof(xGetGeometryReply), &rep);
return Success;
}
@ -614,7 +622,6 @@ PanoramiXTranslateCoords(ClientPtr client)
REQUEST(xTranslateCoordsReq);
int rc;
WindowPtr pWin, pDst;
xTranslateCoordsReply rep;
REQUEST_SIZE_MATCH(xTranslateCoordsReq);
rc = dixLookupWindow(&pWin, stuff->srcWid, client, DixReadAccess);
@ -623,7 +630,8 @@ PanoramiXTranslateCoords(ClientPtr client)
rc = dixLookupWindow(&pDst, stuff->dstWid, client, DixReadAccess);
if (rc != Success)
return rc;
rep = (xTranslateCoordsReply) {
xTranslateCoordsReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
@ -674,7 +682,13 @@ PanoramiXTranslateCoords(ClientPtr client)
rep.dstY += screenInfo.screens[0]->y;
}
WriteReplyToClient(client, sizeof(xTranslateCoordsReply), &rep);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.child);
swaps(&rep.dstX);
swaps(&rep.dstY);
}
WriteToClient(client, sizeof(rep), &rep);
return Success;
}
@ -1946,7 +1960,6 @@ PanoramiXGetImage(ClientPtr client)
DrawablePtr drawables[MAXSCREENS];
DrawablePtr pDraw;
PanoramiXRes *draw;
xGetImageReply xgi;
Bool isRoot;
char *pBuf;
int i, x, y, w, h, format, rc;
@ -2020,12 +2033,7 @@ PanoramiXGetImage(ClientPtr client)
IncludeInferiors);
}
xgi = (xGetImageReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
.visual = wVisual(((WindowPtr) pDraw)),
.depth = pDraw->depth
};
if (format == ZPixmap) {
widthBytesLine = PixmapBytePad(w, pDraw->depth);
length = widthBytesLine * h;
@ -2039,7 +2047,13 @@ PanoramiXGetImage(ClientPtr client)
}
xgi.length = bytes_to_int32(length);
xGetImageReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.visual = wVisual(((WindowPtr) pDraw)),
.depth = pDraw->depth,
.length = bytes_to_int32(length),
};
if (widthBytesLine == 0 || h == 0)
linesPerBuf = 0;
@ -2053,7 +2067,12 @@ PanoramiXGetImage(ClientPtr client)
if (!(pBuf = xallocarray(linesPerBuf, widthBytesLine)))
return BadAlloc;
WriteReplyToClient(client, sizeof(xGetImageReply), &xgi);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.visual);
}
WriteToClient(client, sizeof(rep), &rep);
if (linesPerBuf == 0) {
/* nothing to do */

View File

@ -1770,7 +1770,6 @@ BadDeviceMap(BYTE * buff, int length, unsigned low, unsigned high, XID *errval)
int
ProcSetModifierMapping(ClientPtr client)
{
xSetModifierMappingReply rep;
int rc;
REQUEST(xSetModifierMappingReq);
@ -1780,11 +1779,6 @@ ProcSetModifierMapping(ClientPtr client)
bytes_to_int32(sizeof(xSetModifierMappingReq))))
return BadLength;
rep = (xSetModifierMappingReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0
};
rc = change_modmap(client, PickKeyboard(client), (KeyCode *) &stuff[1],
stuff->numKeyPerModifier);
@ -1793,16 +1787,23 @@ ProcSetModifierMapping(ClientPtr client)
if (rc != MappingSuccess && rc != MappingFailed && rc != MappingBusy)
return rc;
rep.success = rc;
xSetModifierMappingReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.success = rc,
};
WriteReplyToClient(client, sizeof(xSetModifierMappingReply), &rep);
if (client->swapped) {
swaps(&rep.sequenceNumber);
}
WriteToClient(client, sizeof(rep), &rep);
return Success;
}
int
ProcGetModifierMapping(ClientPtr client)
{
xGetModifierMappingReply rep;
int max_keys_per_mod = 0;
KeyCode *modkeymap = NULL;
@ -1811,7 +1812,7 @@ ProcGetModifierMapping(ClientPtr client)
generate_modkeymap(client, PickKeyboard(client), &modkeymap,
&max_keys_per_mod);
rep = (xGetModifierMappingReply) {
xGetModifierMappingReply rep = {
.type = X_Reply,
.numKeyPerModifier = max_keys_per_mod,
.sequenceNumber = client->sequence,
@ -1819,7 +1820,12 @@ ProcGetModifierMapping(ClientPtr client)
.length = max_keys_per_mod << 1
};
WriteReplyToClient(client, sizeof(xGetModifierMappingReply), &rep);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
}
WriteToClient(client, sizeof(rep), &rep);
WriteToClient(client, max_keys_per_mod * 8, modkeymap);
free(modkeymap);
@ -1893,7 +1899,6 @@ ProcSetPointerMapping(ClientPtr client)
int ret;
int i, j;
DeviceIntPtr ptr = PickPointer(client);
xSetPointerMappingReply rep;
REQUEST(xSetPointerMappingReq);
REQUEST_AT_LEAST_SIZE(xSetPointerMappingReq);
@ -1902,12 +1907,6 @@ ProcSetPointerMapping(ClientPtr client)
bytes_to_int32(sizeof(xSetPointerMappingReq) + stuff->nElts))
return BadLength;
rep = (xSetPointerMappingReply) {
.type = X_Reply,
.success = MappingSuccess,
.sequenceNumber = client->sequence,
.length = 0
};
map = (BYTE *) &stuff[1];
/* So we're bounded here by the number of core buttons. This check
@ -1933,21 +1932,30 @@ ProcSetPointerMapping(ClientPtr client)
}
ret = ApplyPointerMapping(ptr, map, stuff->nElts, client);
if (ret == MappingBusy)
rep.success = ret;
else if (ret == -1)
if (ret == -1)
return BadValue;
else if (ret != Success)
if (ret != Success && ret != MappingBusy)
return ret;
WriteReplyToClient(client, sizeof(xSetPointerMappingReply), &rep);
xSetPointerMappingReply rep = {
.type = X_Reply,
.success = MappingSuccess,
.sequenceNumber = client->sequence,
.success = ret,
};
if (client->swapped) {
swaps(&rep.sequenceNumber);
}
WriteToClient(client, sizeof(rep), &rep);
return Success;
}
int
ProcGetKeyboardMapping(ClientPtr client)
{
xGetKeyboardMappingReply rep;
DeviceIntPtr kbd = PickKeyboard(client);
XkbDescPtr xkb;
KeySymsPtr syms;
@ -1976,21 +1984,36 @@ ProcGetKeyboardMapping(ClientPtr client)
if (!syms)
return BadAlloc;
rep = (xGetKeyboardMappingReply) {
const int count = syms->mapWidth * stuff->count;
const int size = count * sizeof(KeySym);
void *payload = calloc(count, sizeof(KeySym));
if (!payload)
return BadAlloc;
memcpy(payload,
&syms->map[syms->mapWidth * (stuff->firstKeyCode - syms->minKeyCode)],
size);
xGetKeyboardMappingReply rep = {
.type = X_Reply,
.keySymsPerKeyCode = syms->mapWidth,
.sequenceNumber = client->sequence,
/* length is a count of 4 byte quantities and KeySyms are 4 bytes */
.length = syms->mapWidth * stuff->count
.length = count
};
WriteReplyToClient(client, sizeof(xGetKeyboardMappingReply), &rep);
client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write;
WriteSwappedDataToClient(client,
syms->mapWidth * stuff->count * sizeof(KeySym),
&syms->map[syms->mapWidth * (stuff->firstKeyCode -
syms->minKeyCode)]);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
SwapLongs(payload, count);
}
WriteToClient(client, sizeof(rep), &rep);
WriteToClient(client, size, payload);
free(syms->map);
free(syms);
free(payload);
return Success;
}
@ -1998,7 +2021,6 @@ ProcGetKeyboardMapping(ClientPtr client)
int
ProcGetPointerMapping(ClientPtr client)
{
xGetPointerMappingReply rep;
/* Apps may get different values each time they call GetPointerMapping as
* the ClientPointer could change. */
@ -2014,14 +2036,20 @@ ProcGetPointerMapping(ClientPtr client)
return rc;
nElts = (butc) ? butc->numButtons : 0;
rep = (xGetPointerMappingReply) {
xGetPointerMappingReply rep = {
.type = X_Reply,
.nElts = nElts,
.sequenceNumber = client->sequence,
.length = ((unsigned) nElts + (4 - 1)) / 4
};
WriteReplyToClient(client, sizeof(xGetPointerMappingReply), &rep);
if (butc)
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
}
WriteToClient(client, sizeof(rep), &rep);
WriteToClient(client, nElts, &butc->map[1]);
return Success;
}
@ -2247,18 +2275,16 @@ ProcChangeKeyboardControl(ClientPtr client)
int
ProcGetKeyboardControl(ClientPtr client)
{
int rc, i;
DeviceIntPtr kbd = PickKeyboard(client);
KeybdCtrl *ctrl = &kbd->kbdfeed->ctrl;
xGetKeyboardControlReply rep;
REQUEST_SIZE_MATCH(xReq);
rc = XaceHookDeviceAccess(client, kbd, DixGetAttrAccess);
int rc = XaceHookDeviceAccess(client, kbd, DixGetAttrAccess);
if (rc != Success)
return rc;
rep = (xGetKeyboardControlReply) {
xGetKeyboardControlReply rep = {
.type = X_Reply,
.globalAutoRepeat = ctrl->autoRepeat,
.sequenceNumber = client->sequence,
@ -2269,9 +2295,17 @@ ProcGetKeyboardControl(ClientPtr client)
.bellPitch = ctrl->bell_pitch,
.bellDuration = ctrl->bell_duration
};
for (i = 0; i < 32; i++)
for (int i = 0; i < 32; i++)
rep.map[i] = ctrl->autoRepeats[i];
WriteReplyToClient(client, sizeof(xGetKeyboardControlReply), &rep);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.ledMask);
swaps(&rep.bellPitch);
swaps(&rep.bellDuration);
}
WriteToClient(client, sizeof(rep), &rep);
return Success;
}
@ -2397,7 +2431,6 @@ ProcGetPointerControl(ClientPtr client)
{
DeviceIntPtr ptr = PickPointer(client);
PtrCtrl *ctrl;
xGetPointerControlReply rep;
int rc;
if (ptr->ptrfeed)
@ -2411,7 +2444,7 @@ ProcGetPointerControl(ClientPtr client)
if (rc != Success)
return rc;
rep = (xGetPointerControlReply) {
xGetPointerControlReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
@ -2419,7 +2452,14 @@ ProcGetPointerControl(ClientPtr client)
.accelDenominator = ctrl->den,
.threshold = ctrl->threshold
};
WriteReplyToClient(client, sizeof(xGenericReply), &rep);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swaps(&rep.accelNumerator);
swaps(&rep.accelDenominator);
swaps(&rep.threshold);
}
WriteToClient(client, sizeof(rep), &rep);
return Success;
}
@ -2444,7 +2484,6 @@ ProcGetMotionEvents(ClientPtr client)
{
WindowPtr pWin;
xTimecoord *coords = (xTimecoord *) NULL;
xGetMotionEventsReply rep;
int i, count, xmin, xmax, ymin, ymax, rc;
unsigned long nEvents;
DeviceIntPtr mouse = PickPointer(client);
@ -2463,10 +2502,7 @@ ProcGetMotionEvents(ClientPtr client)
UpdateCurrentTimeIf();
if (mouse->valuator->motionHintWindow)
MaybeStopHint(mouse, client);
rep = (xGetMotionEventsReply) {
.type = X_Reply,
.sequenceNumber = client->sequence
};
nEvents = 0;
start = ClientTimeToServerTime(stuff->start);
stop = ClientTimeToServerTime(stuff->stop);
@ -2493,9 +2529,20 @@ ProcGetMotionEvents(ClientPtr client)
nEvents++;
}
}
rep.length = nEvents * bytes_to_int32(sizeof(xTimecoord));
rep.nEvents = nEvents;
WriteReplyToClient(client, sizeof(xGetMotionEventsReply), &rep);
xGetMotionEventsReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = nEvents * bytes_to_int32(sizeof(xTimecoord)),
.nEvents = nEvents,
};
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.nEvents);
}
WriteToClient(client, sizeof(xGetMotionEventsReply), &rep);
if (nEvents) {
client->pSwapReplyFunc = (ReplySwapPtr) SwapTimeCoordWrite;
WriteSwappedDataToClient(client, nEvents * sizeof(xTimecoord),
@ -2508,13 +2555,13 @@ ProcGetMotionEvents(ClientPtr client)
int
ProcQueryKeymap(ClientPtr client)
{
xQueryKeymapReply rep;
int rc, i;
DeviceIntPtr keybd = PickKeyboard(client);
CARD8 *down = keybd->key->down;
REQUEST_SIZE_MATCH(xReq);
rep = (xQueryKeymapReply) {
xQueryKeymapReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 2
@ -2531,7 +2578,11 @@ ProcQueryKeymap(ClientPtr client)
else if (rc != BadAccess)
return rc;
WriteReplyToClient(client, sizeof(xQueryKeymapReply), &rep);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
}
WriteToClient(client, sizeof(rep), &rep);
return Success;
}

View File

@ -803,25 +803,6 @@ ProcChangeWindowAttributes(ClientPtr client)
stuff->valueMask, (XID *) &stuff[1], client);
}
int
ProcGetWindowAttributes(ClientPtr client)
{
WindowPtr pWin;
REQUEST(xResourceReq);
xGetWindowAttributesReply wa;
int rc;
REQUEST_SIZE_MATCH(xResourceReq);
rc = dixLookupWindow(&pWin, stuff->id, client, DixGetAttrAccess);
if (rc != Success)
return rc;
memset(&wa, 0, sizeof(xGetWindowAttributesReply));
GetWindowAttributes(pWin, client, &wa);
WriteReplyToClient(client, sizeof(xGetWindowAttributesReply), &wa);
return Success;
}
int
ProcDestroyWindow(ClientPtr client)
{
@ -1013,8 +994,8 @@ ProcCirculateWindow(ClientPtr client)
return Success;
}
static int
GetGeometry(ClientPtr client, xGetGeometryReply * rep)
int
ProcGetGeometry(ClientPtr client)
{
DrawablePtr pDraw;
int rc;
@ -1026,46 +1007,40 @@ GetGeometry(ClientPtr client, xGetGeometryReply * rep)
if (rc != Success)
return rc;
rep->type = X_Reply;
rep->length = 0;
rep->sequenceNumber = client->sequence;
rep->root = pDraw->pScreen->root->drawable.id;
rep->depth = pDraw->depth;
rep->width = pDraw->width;
rep->height = pDraw->height;
xGetGeometryReply rep = {
.type = X_Reply,
.length = 0,
.sequenceNumber = client->sequence,
.root = pDraw->pScreen->root->drawable.id,
.depth = pDraw->depth,
.width = pDraw->width,
.height = pDraw->height,
};
if (WindowDrawable(pDraw->type)) {
WindowPtr pWin = (WindowPtr) pDraw;
rep->x = pWin->origin.x - wBorderWidth(pWin);
rep->y = pWin->origin.y - wBorderWidth(pWin);
rep->borderWidth = pWin->borderWidth;
}
else { /* DRAWABLE_PIXMAP */
rep->x = rep->y = rep->borderWidth = 0;
rep.x = pWin->origin.x - wBorderWidth(pWin);
rep.y = pWin->origin.y - wBorderWidth(pWin);
rep.borderWidth = pWin->borderWidth;
}
return Success;
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.root);
swaps(&rep.x);
swaps(&rep.y);
swaps(&rep.width);
swaps(&rep.height);
swaps(&rep.borderWidth);
}
int
ProcGetGeometry(ClientPtr client)
{
xGetGeometryReply rep = { .type = X_Reply };
int status;
if ((status = GetGeometry(client, &rep)) != Success)
return status;
WriteReplyToClient(client, sizeof(xGetGeometryReply), &rep);
WriteToClient(client, sizeof(xGetGeometryReply), &rep);
return Success;
}
int
ProcQueryTree(ClientPtr client)
{
xQueryTreeReply reply;
int rc, numChildren = 0;
WindowPtr pChild, pWin, pHead;
Window *childIDs = (Window *) NULL;
@ -1077,12 +1052,6 @@ ProcQueryTree(ClientPtr client)
if (rc != Success)
return rc;
reply = (xQueryTreeReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
.root = pWin->drawable.pScreen->root->drawable.id,
.parent = (pWin->parent) ? pWin->parent->drawable.id : (Window) None
};
pHead = RealChildHead(pWin);
for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib)
numChildren++;
@ -1097,17 +1066,26 @@ ProcQueryTree(ClientPtr client)
childIDs[curChild++] = pChild->drawable.id;
}
reply.nChildren = numChildren;
reply.length = bytes_to_int32(numChildren * sizeof(Window));
xQueryTreeReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.root = pWin->drawable.pScreen->root->drawable.id,
.parent = (pWin->parent) ? pWin->parent->drawable.id : (Window) None,
.nChildren = numChildren,
.length = bytes_to_int32(numChildren * sizeof(Window)),
};
WriteReplyToClient(client, sizeof(xQueryTreeReply), &reply);
if (numChildren) {
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, numChildren * sizeof(Window),
childIDs);
free(childIDs);
if (client->swapped) {
SwapLongs(childIDs, rep.length);
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.root);
swapl(&rep.parent);
swaps(&rep.nChildren);
}
WriteToClient(client, sizeof(rep), &rep);
WriteToClient(client, numChildren * sizeof(Window), childIDs);
free(childIDs);
return Success;
}
@ -1126,18 +1104,22 @@ ProcInternAtom(ClientPtr client)
}
tchar = (char *) &stuff[1];
atom = MakeAtom(tchar, stuff->nbytes, !stuff->onlyIfExists);
if (atom != BAD_RESOURCE) {
xInternAtomReply reply = {
if (atom == BAD_RESOURCE)
return BadAlloc;
xInternAtomReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.atom = atom
};
WriteReplyToClient(client, sizeof(xInternAtomReply), &reply);
return Success;
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.atom);
}
else
return BadAlloc;
WriteToClient(client, sizeof(rep), &rep);
return Success;
}
int
@ -1148,24 +1130,28 @@ ProcGetAtomName(ClientPtr client)
REQUEST(xResourceReq);
REQUEST_SIZE_MATCH(xResourceReq);
if ((str = NameForAtom(stuff->id))) {
int len = strlen(str);
xGetAtomNameReply reply = {
if (!(str = NameForAtom(stuff->id))) {
client->errorValue = stuff->id;
return BadAtom;
}
const int len = strlen(str);
xGetAtomNameReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = bytes_to_int32(len),
.nameLength = len
};
WriteReplyToClient(client, sizeof(xGetAtomNameReply), &reply);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swaps(&rep.nameLength);
}
WriteToClient(client, sizeof(rep), &rep);
WriteToClient(client, len, str);
return Success;
}
else {
client->errorValue = stuff->id;
return BadAtom;
}
}
int
ProcGrabServer(ClientPtr client)
@ -1238,7 +1224,6 @@ ProcTranslateCoords(ClientPtr client)
REQUEST(xTranslateCoordsReq);
WindowPtr pWin, pDst;
xTranslateCoordsReply rep;
int rc;
REQUEST_SIZE_MATCH(xTranslateCoordsReq);
@ -1249,7 +1234,7 @@ ProcTranslateCoords(ClientPtr client)
if (rc != Success)
return rc;
rep = (xTranslateCoordsReply) {
xTranslateCoordsReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0
@ -1300,7 +1285,14 @@ ProcTranslateCoords(ClientPtr client)
rep.dstX = x - pDst->drawable.x;
rep.dstY = y - pDst->drawable.y;
}
WriteReplyToClient(client, sizeof(xTranslateCoordsReply), &rep);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.child);
swaps(&rep.dstX);
swaps(&rep.dstY);
}
WriteToClient(client, sizeof(rep), &rep);
return Success;
}
@ -1384,7 +1376,11 @@ ProcQueryFont(ClientPtr client)
reply->sequenceNumber = client->sequence;
QueryFont(pFont, reply, nprotoxcistructs);
WriteReplyToClient(client, rlength, reply);
if (client->swapped) {
SwapFont(reply, TRUE);
}
WriteToClient(client, rlength, reply);
free(reply);
return Success;
}
@ -1393,7 +1389,6 @@ ProcQueryFont(ClientPtr client)
int
ProcQueryTextExtents(ClientPtr client)
{
xQueryTextExtentsReply reply;
FontPtr pFont;
ExtentInfoRec info;
unsigned long length;
@ -1415,7 +1410,8 @@ ProcQueryTextExtents(ClientPtr client)
}
if (!xfont2_query_text_extents(pFont, length, (unsigned char *) &stuff[1], &info))
return BadAlloc;
reply = (xQueryTextExtentsReply) {
xQueryTextExtentsReply rep = {
.type = X_Reply,
.drawDirection = info.drawDirection,
.sequenceNumber = client->sequence,
@ -1428,7 +1424,18 @@ ProcQueryTextExtents(ClientPtr client)
.overallLeft = info.overallLeft,
.overallRight = info.overallRight
};
WriteReplyToClient(client, sizeof(xQueryTextExtentsReply), &reply);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swaps(&rep.fontAscent);
swaps(&rep.fontDescent);
swaps(&rep.overallAscent);
swaps(&rep.overallDescent);
swapl(&rep.overallWidth);
swapl(&rep.overallLeft);
swapl(&rep.overallRight);
}
WriteToClient(client, sizeof(rep), &rep);
return Success;
}
@ -2158,7 +2165,6 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
long widthBytesLine, length;
Mask plane = 0;
char *pBuf;
xGetImageReply xgi;
RegionPtr pVisibleRegion = NULL;
if ((format != XYPixmap) && (format != ZPixmap)) {
@ -2169,7 +2175,10 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
if (rc != Success)
return rc;
memset(&xgi, 0, sizeof(xGetImageReply));
xGetImageReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
};
relx = x;
rely = y;
@ -2206,11 +2215,11 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
pBoundingDraw = (DrawablePtr) pDraw->pScreen->root;
}
xgi.visual = wVisual(pWin);
rep.visual = wVisual(pWin);
}
else {
pBoundingDraw = pDraw;
xgi.visual = None;
rep.visual = None;
}
/* "If the drawable is a pixmap, the given rectangle must be wholly
@ -2228,9 +2237,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
rely < 0 || rely + height > (int) pBoundingDraw->height)
return BadMatch;
xgi.type = X_Reply;
xgi.sequenceNumber = client->sequence;
xgi.depth = pDraw->depth;
rep.depth = pDraw->depth;
if (format == ZPixmap) {
widthBytesLine = PixmapBytePad(width, pDraw->depth);
length = widthBytesLine * height;
@ -2245,9 +2252,8 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
}
xgi.length = length;
rep.length = bytes_to_int32(length);
xgi.length = bytes_to_int32(xgi.length);
if (widthBytesLine == 0 || height == 0)
linesPerBuf = 0;
else if (widthBytesLine >= IMAGE_BUFSIZE)
@ -2272,7 +2278,13 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
}
if (!(pBuf = calloc(1, length)))
return BadAlloc;
WriteReplyToClient(client, sizeof(xGetImageReply), &xgi);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.visual);
}
WriteToClient(client, sizeof(rep), &rep);
if (pDraw->type == DRAWABLE_WINDOW) {
pVisibleRegion = &((WindowPtr) pDraw)->borderClip;
@ -2574,8 +2586,7 @@ ProcUninstallColormap(ClientPtr client)
int
ProcListInstalledColormaps(ClientPtr client)
{
xListInstalledColormapsReply *preply;
int nummaps, rc;
int rc;
WindowPtr pWin;
REQUEST(xResourceReq);
@ -2589,22 +2600,31 @@ ProcListInstalledColormaps(ClientPtr client)
if (rc != Success)
return rc;
preply = malloc(sizeof(xListInstalledColormapsReply) +
pWin->drawable.pScreen->maxInstalledCmaps *
Colormap *cm = calloc(pWin->drawable.pScreen->maxInstalledCmaps,
sizeof(Colormap));
if (!preply)
if (!cm)
return BadAlloc;
preply->type = X_Reply;
preply->sequenceNumber = client->sequence;
nummaps = (*pWin->drawable.pScreen->ListInstalledColormaps)
(pWin->drawable.pScreen, (Colormap *) &preply[1]);
preply->nColormaps = nummaps;
preply->length = nummaps;
WriteReplyToClient(client, sizeof(xListInstalledColormapsReply), preply);
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, nummaps * sizeof(Colormap), &preply[1]);
free(preply);
const ScreenPtr pScreen = pWin->drawable.pScreen;
const int nummaps = pScreen->ListInstalledColormaps(pScreen, cm);
xListInstalledColormapsReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.nColormaps = nummaps,
.length = nummaps,
};
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swaps(&rep.nColormaps);
SwapLongs(cm, nummaps * sizeof(Colormap) / 4);
}
WriteToClient(client, sizeof(rep), &rep);
WriteToClient(client, nummaps * sizeof(Colormap), cm);
free(cm);
return Success;
}
@ -2619,8 +2639,12 @@ ProcAllocColor(ClientPtr client)
REQUEST_SIZE_MATCH(xAllocColorReq);
rc = dixLookupResourceByType((void **) &pmap, stuff->cmap, X11_RESTYPE_COLORMAP,
client, DixAddAccess);
if (rc == Success) {
xAllocColorReply acr = {
if (rc != Success) {
client->errorValue = stuff->cmap;
return rc;
}
xAllocColorReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
@ -2629,20 +2653,24 @@ ProcAllocColor(ClientPtr client)
.blue = stuff->blue,
.pixel = 0
};
if ((rc = AllocColor(pmap, &acr.red, &acr.green, &acr.blue,
&acr.pixel, client->index)))
if ((rc = AllocColor(pmap, &rep.red, &rep.green, &rep.blue,
&rep.pixel, client->index)))
return rc;
if (client->swapped) {
swaps(&rep.sequenceNumber);
swaps(&rep.red);
swaps(&rep.green);
swaps(&rep.blue);
swapl(&rep.pixel);
}
#ifdef XINERAMA
if (noPanoramiXExtension || !pmap->pScreen->myNum)
#endif /* XINERAMA */
WriteReplyToClient(client, sizeof(xAllocColorReply), &acr);
WriteToClient(client, sizeof(rep), &rep);
return Success;
}
else {
client->errorValue = stuff->cmap;
return rc;
}
}
int
@ -2656,39 +2684,49 @@ ProcAllocNamedColor(ClientPtr client)
REQUEST_FIXED_SIZE(xAllocNamedColorReq, stuff->nbytes);
rc = dixLookupResourceByType((void **) &pcmp, stuff->cmap, X11_RESTYPE_COLORMAP,
client, DixAddAccess);
if (rc == Success) {
xAllocNamedColorReply ancr = {
if (rc != Success) {
client->errorValue = stuff->cmap;
return rc;
}
xAllocNamedColorReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0
};
if (dixLookupBuiltinColor
if (!dixLookupBuiltinColor
(pcmp->pScreen->myNum, (char *) &stuff[1], stuff->nbytes,
&ancr.exactRed, &ancr.exactGreen, &ancr.exactBlue)) {
ancr.screenRed = ancr.exactRed;
ancr.screenGreen = ancr.exactGreen;
ancr.screenBlue = ancr.exactBlue;
ancr.pixel = 0;
&rep.exactRed, &rep.exactGreen, &rep.exactBlue))
return BadName;
rep.screenRed = rep.exactRed;
rep.screenGreen = rep.exactGreen;
rep.screenBlue = rep.exactBlue;
rep.pixel = 0;
if ((rc = AllocColor(pcmp,
&ancr.screenRed, &ancr.screenGreen,
&ancr.screenBlue, &ancr.pixel, client->index)))
&rep.screenRed, &rep.screenGreen,
&rep.screenBlue, &rep.pixel, client->index)))
return rc;
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.pixel);
swaps(&rep.exactRed);
swaps(&rep.exactGreen);
swaps(&rep.exactBlue);
swaps(&rep.screenRed);
swaps(&rep.screenGreen);
swaps(&rep.screenBlue);
}
#ifdef XINERAMA
if (noPanoramiXExtension || !pcmp->pScreen->myNum)
#endif /* XINERAMA */
WriteReplyToClient(client, sizeof(xAllocNamedColorReply),
&ancr);
WriteToClient(client, sizeof(rep), &rep);
return Success;
}
else
return BadName;
}
else {
client->errorValue = stuff->cmap;
return rc;
}
}
int
ProcAllocColorCells(ClientPtr client)
@ -2731,16 +2769,22 @@ ProcAllocColorCells(ClientPtr client)
if (noPanoramiXExtension || !pcmp->pScreen->myNum)
#endif /* XINERAMA */
{
xAllocColorCellsReply accr = {
xAllocColorCellsReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = bytes_to_int32(length),
.nPixels = npixels,
.nMasks = nmasks
};
WriteReplyToClient(client, sizeof(xAllocColorCellsReply), &accr);
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, length, ppixels);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swaps(&rep.nPixels);
swaps(&rep.nMasks);
SwapLongs(ppixels, length / 4);
}
WriteToClient(client, sizeof(rep), &rep);
WriteToClient(client, length, ppixels);
}
free(ppixels);
return Success;
@ -2763,7 +2807,6 @@ ProcAllocColorPlanes(ClientPtr client)
rc = dixLookupResourceByType((void **) &pcmp, stuff->cmap, X11_RESTYPE_COLORMAP,
client, DixAddAccess);
if (rc == Success) {
xAllocColorPlanesReply acpr;
int npixels;
long length;
Pixel *ppixels;
@ -2777,7 +2820,8 @@ ProcAllocColorPlanes(ClientPtr client)
client->errorValue = stuff->contiguous;
return BadValue;
}
acpr = (xAllocColorPlanesReply) {
xAllocColorPlanesReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.nPixels = npixels
@ -2790,19 +2834,29 @@ ProcAllocColorPlanes(ClientPtr client)
if ((rc = AllocColorPlanes(client->index, pcmp, npixels,
(int) stuff->red, (int) stuff->green,
(int) stuff->blue, (Bool) stuff->contiguous,
ppixels, &acpr.redMask, &acpr.greenMask,
&acpr.blueMask))) {
ppixels, &rep.redMask, &rep.greenMask,
&rep.blueMask))) {
free(ppixels);
return rc;
}
acpr.length = bytes_to_int32(length);
rep.length = bytes_to_int32(length);
if (client->swapped) {
SwapLongs(ppixels, rep.length);
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swaps(&rep.nPixels);
swapl(&rep.redMask);
swapl(&rep.greenMask);
swapl(&rep.blueMask);
}
#ifdef XINERAMA
if (noPanoramiXExtension || !pcmp->pScreen->myNum)
#endif /* XINERAMA */
{
WriteReplyToClient(client, sizeof(xAllocColorPlanesReply), &acpr);
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, length, ppixels);
WriteToClient(client, sizeof(rep), &rep);
WriteToClient(client, length, ppixels);
}
free(ppixels);
return Success;
@ -2911,7 +2965,6 @@ ProcQueryColors(ClientPtr client)
if (rc == Success) {
int count;
xrgb *prgbs;
xQueryColorsReply qcr;
count =
bytes_to_int32((client->req_len << 2) - sizeof(xQueryColorsReq));
@ -2923,20 +2976,25 @@ ProcQueryColors(ClientPtr client)
free(prgbs);
return rc;
}
qcr = (xQueryColorsReply) {
xQueryColorsReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = bytes_to_int32(count * sizeof(xrgb)),
.nColors = count
};
WriteReplyToClient(client, sizeof(xQueryColorsReply), &qcr);
if (count) {
client->pSwapReplyFunc = (ReplySwapPtr) SQColorsExtend;
WriteSwappedDataToClient(client, count * sizeof(xrgb), prgbs);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swaps(&rep.nColors);
SwapShorts((short*)prgbs, count * 4); // xrgb = 4 shorts
}
WriteToClient(client, sizeof(rep), &rep);
WriteToClient(client, count * sizeof(xrgb), prgbs);
free(prgbs);
return Success;
}
else {
client->errorValue = stuff->cmap;
@ -2964,7 +3022,7 @@ ProcLookupColor(ClientPtr client)
&exactRed,
&exactGreen,
&exactBlue)) {
xLookupColorReply lcr = {
xLookupColorReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
@ -2975,10 +3033,19 @@ ProcLookupColor(ClientPtr client)
.screenGreen = exactGreen,
.screenBlue = exactBlue
};
(*pcmp->pScreen->ResolveColor) (&lcr.screenRed,
&lcr.screenGreen,
&lcr.screenBlue, pcmp->pVisual);
WriteReplyToClient(client, sizeof(xLookupColorReply), &lcr);
(*pcmp->pScreen->ResolveColor) (&rep.screenRed,
&rep.screenGreen,
&rep.screenBlue, pcmp->pVisual);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swaps(&rep.exactRed);
swaps(&rep.exactGreen);
swaps(&rep.exactBlue);
swaps(&rep.screenRed);
swaps(&rep.screenGreen);
swaps(&rep.screenBlue);
}
WriteToClient(client, sizeof(rep), &rep);
return Success;
}
return BadName;
@ -3139,7 +3206,6 @@ ProcFreeCursor(ClientPtr client)
int
ProcQueryBestSize(ClientPtr client)
{
xQueryBestSizeReply reply;
DrawablePtr pDraw;
ScreenPtr pScreen;
int rc;
@ -3165,14 +3231,21 @@ ProcQueryBestSize(ClientPtr client)
return rc;
(*pScreen->QueryBestSize) (stuff->class, &stuff->width,
&stuff->height, pScreen);
reply = (xQueryBestSizeReply) {
xQueryBestSizeReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.width = stuff->width,
.height = stuff->height
};
WriteReplyToClient(client, sizeof(xQueryBestSizeReply), &reply);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swaps(&rep.width);
swaps(&rep.height);
}
WriteToClient(client, sizeof(rep), &rep);
return Success;
}
@ -3239,7 +3312,6 @@ ProcSetScreenSaver(ClientPtr client)
int
ProcGetScreenSaver(ClientPtr client)
{
xGetScreenSaverReply rep;
int rc, i;
REQUEST_SIZE_MATCH(xReq);
@ -3251,7 +3323,7 @@ ProcGetScreenSaver(ClientPtr client)
return rc;
}
rep = (xGetScreenSaverReply) {
xGetScreenSaverReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
@ -3260,7 +3332,13 @@ ProcGetScreenSaver(ClientPtr client)
.preferBlanking = ScreenSaverBlanking,
.allowExposures = ScreenSaverAllowExposures
};
WriteReplyToClient(client, sizeof(xGetScreenSaverReply), &rep);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swaps(&rep.timeout);
swaps(&rep.interval);
}
WriteToClient(client, sizeof(rep), &rep);
return Success;
}
@ -3284,7 +3362,6 @@ ProcChangeHosts(ClientPtr client)
int
ProcListHosts(ClientPtr client)
{
xListHostsReply reply;
int len, nHosts, result;
BOOL enabled;
void *pdata;
@ -3302,18 +3379,33 @@ ProcListHosts(ClientPtr client)
if (result != Success)
return result;
reply = (xListHostsReply) {
xListHostsReply rep = {
.type = X_Reply,
.enabled = enabled,
.sequenceNumber = client->sequence,
.length = bytes_to_int32(len),
.nHosts = nHosts
};
WriteReplyToClient(client, sizeof(xListHostsReply), &reply);
if (nHosts) {
client->pSwapReplyFunc = (ReplySwapPtr) SLHostsExtend;
WriteSwappedDataToClient(client, len, pdata);
if (client->swapped) {
char *bufT = pdata;
char *endbuf = bufT + len;
while (bufT < endbuf) {
xHostEntry *host = (xHostEntry *) bufT;
int l1 = host->length;
swaps(&host->length);
bufT += sizeof(xHostEntry) + pad_to_int32(l1);
}
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swaps(&rep.nHosts);
}
WriteToClient(client, sizeof(rep), &rep);
WriteToClient(client, len, pdata);
free(pdata);
return Success;
}
@ -3410,7 +3502,6 @@ ProcSetFontPath(ClientPtr client)
int
ProcGetFontPath(ClientPtr client)
{
xGetFontPathReply reply;
int rc, stringLens, numpaths;
unsigned char *bufferStart;
@ -3421,15 +3512,19 @@ ProcGetFontPath(ClientPtr client)
if (rc != Success)
return rc;
reply = (xGetFontPathReply) {
xGetFontPathReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = bytes_to_int32(stringLens + numpaths),
.nPaths = numpaths
};
WriteReplyToClient(client, sizeof(xGetFontPathReply), &reply);
if (stringLens || numpaths)
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swaps(&rep.nPaths);
}
WriteToClient(client, sizeof(rep), &rep);
WriteToClient(client, stringLens + numpaths, bufferStart);
return Success;
}

View File

@ -59,6 +59,7 @@ Equipment Corporation.
#include "dix/dix_priv.h"
#include "dix/gc_priv.h"
#include "include/swaprep.h"
#include "os/auth.h"
#include "scrnintstr.h"
@ -565,9 +566,6 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
int nnames;
int stringLens;
int i;
xListFontsReply reply;
char *bufptr;
char *bufferStart;
int aliascount = 0;
if (client->clientGone) {
@ -749,16 +747,17 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
for (i = 0; i < nnames; i++)
stringLens += (names->length[i] <= 255) ? names->length[i] : 0;
reply = (xListFontsReply) {
xListFontsReply rep = {
.type = X_Reply,
.length = bytes_to_int32(stringLens + nnames),
.nFonts = nnames,
.sequenceNumber = client->sequence
};
bufptr = bufferStart = malloc(reply.length << 2);
char *bufferStart = calloc(1, rep.length << 2);
char *bufptr = bufferStart;
if (!bufptr && reply.length) {
if (!bufptr && rep.length) {
SendErrorToClient(client, X_ListFonts, 0, 0, BadAlloc);
goto bail;
}
@ -768,17 +767,23 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
*/
for (i = 0; i < nnames; i++) {
if (names->length[i] > 255)
reply.nFonts--;
rep.nFonts--;
else {
*bufptr++ = names->length[i];
memcpy(bufptr, names->names[i], names->length[i]);
bufptr += names->length[i];
}
}
nnames = reply.nFonts;
reply.length = bytes_to_int32(stringLens + nnames);
client->pSwapReplyFunc = ReplySwapVector[X_ListFonts];
WriteSwappedDataToClient(client, sizeof(xListFontsReply), &reply);
nnames = rep.nFonts;
rep.length = bytes_to_int32(stringLens + nnames);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swaps(&rep.nFonts);
}
WriteToClient(client, sizeof(rep), &rep);
WriteToClient(client, stringLens + nnames, bufferStart);
free(bufferStart);
@ -859,7 +864,6 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
xFontProp *pFP;
int i;
int aliascount = 0;
xListFontsWithInfoReply finalReply;
if (client->clientGone) {
if (c->current.current_fpe < c->num_fpes) {
@ -869,7 +873,6 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
err = Successful;
goto bail;
}
client->pSwapReplyFunc = ReplySwapVector[X_ListFontsWithInfo];
if (!c->current.patlen)
goto finish;
while (c->current.current_fpe < c->num_fpes) {
@ -1011,7 +1014,10 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
pFP->value = pFontInfo->props[i].value;
pFP++;
}
WriteSwappedDataToClient(client, length, reply);
if (client->swapped) {
SwapFont((xQueryFontReply *) reply, FALSE);
}
WriteToClient(client, length, reply);
WriteToClient(client, namelen, name);
if (pFontInfo == &fontInfo) {
free(fontInfo.props);
@ -1022,13 +1028,16 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
}
finish:
length = sizeof(xListFontsWithInfoReply);
finalReply = (xListFontsWithInfoReply) {
xListFontsWithInfoReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = bytes_to_int32(sizeof(xListFontsWithInfoReply)
- sizeof(xGenericReply))
};
WriteSwappedDataToClient(client, length, &finalReply);
if (client->swapped) {
SwapFont((xQueryFontReply *) &rep, FALSE);
}
WriteToClient(client, length, &rep);
bail:
ClientWakeup(client);
for (i = 0; i < c->num_fpes; i++)

View File

@ -4938,7 +4938,6 @@ int
ProcGetInputFocus(ClientPtr client)
{
DeviceIntPtr kbd = PickKeyboard(client);
xGetInputFocusReply rep;
FocusClassPtr focus = kbd->focus;
int rc;
@ -4949,7 +4948,7 @@ ProcGetInputFocus(ClientPtr client)
if (rc != Success)
return rc;
rep = (xGetInputFocusReply) {
xGetInputFocusReply rep = {
.type = X_Reply,
.length = 0,
.sequenceNumber = client->sequence,
@ -4963,7 +4962,11 @@ ProcGetInputFocus(ClientPtr client)
else
rep.focus = focus->win->drawable.id;
WriteReplyToClient(client, sizeof(xGetInputFocusReply), &rep);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.focus);
}
WriteToClient(client, sizeof(rep), &rep);
return Success;
}
@ -4976,7 +4979,6 @@ ProcGetInputFocus(ClientPtr client)
int
ProcGrabPointer(ClientPtr client)
{
xGrabPointerReply rep;
DeviceIntPtr device = PickPointer(client);
GrabPtr grab;
GrabMask mask;
@ -5016,13 +5018,17 @@ ProcGrabPointer(ClientPtr client)
if (rc != Success)
return rc;
rep = (xGrabPointerReply) {
xGrabPointerReply rep = {
.type = X_Reply,
.status = status,
.sequenceNumber = client->sequence,
.length = 0
};
WriteReplyToClient(client, sizeof(xGrabPointerReply), &rep);
if (client->swapped) {
swaps(&rep.sequenceNumber);
}
WriteToClient(client, sizeof(rep), &rep);
return Success;
}
@ -5238,7 +5244,6 @@ GrabDevice(ClientPtr client, DeviceIntPtr dev,
int
ProcGrabKeyboard(ClientPtr client)
{
xGrabKeyboardReply rep;
BYTE status;
REQUEST(xGrabKeyboardReq);
@ -5259,13 +5264,18 @@ ProcGrabKeyboard(ClientPtr client)
if (result != Success)
return result;
rep = (xGrabKeyboardReply) {
xGrabKeyboardReply rep = {
.type = X_Reply,
.status = status,
.sequenceNumber = client->sequence,
.length = 0
};
WriteReplyToClient(client, sizeof(xGrabKeyboardReply), &rep);
if (client->swapped) {
swaps(&rep.sequenceNumber);
}
WriteToClient(client, sizeof(rep), &rep);
return Success;
}
@ -5305,7 +5315,6 @@ ProcUngrabKeyboard(ClientPtr client)
int
ProcQueryPointer(ClientPtr client)
{
xQueryPointerReply rep;
WindowPtr pWin, t;
DeviceIntPtr mouse = PickPointer(client);
DeviceIntPtr keyboard;
@ -5327,7 +5336,8 @@ ProcQueryPointer(ClientPtr client)
pSprite = mouse->spriteInfo->sprite;
if (mouse->valuator->motionHintWindow)
MaybeStopHint(mouse, client);
rep = (xQueryPointerReply) {
xQueryPointerReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
@ -5373,8 +5383,17 @@ ProcQueryPointer(ClientPtr client)
rep.winY = 0;
}
WriteReplyToClient(client, sizeof(xQueryPointerReply), &rep);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.root);
swapl(&rep.child);
swaps(&rep.rootX);
swaps(&rep.rootY);
swaps(&rep.winX);
swaps(&rep.winY);
swaps(&rep.mask);
}
WriteToClient(client, sizeof(rep), &rep);
return Success;
}

View File

@ -223,47 +223,46 @@ ExtensionAvailable(ClientPtr client, ExtensionEntry *ext)
int
ProcQueryExtension(ClientPtr client)
{
xQueryExtensionReply reply;
int i;
REQUEST(xQueryExtensionReq);
REQUEST_FIXED_SIZE(xQueryExtensionReq, stuff->nbytes);
reply = (xQueryExtensionReply) {
xQueryExtensionReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.major_opcode = 0
};
if (!NumExtensions)
reply.present = xFalse;
if (!NumExtensions || !extensions)
rep.present = xFalse;
else {
i = FindExtension((char *) &stuff[1], stuff->nbytes);
int i = FindExtension((char *) &stuff[1], stuff->nbytes);
if (i < 0 || !ExtensionAvailable(client, extensions[i]))
reply.present = xFalse;
rep.present = xFalse;
else {
reply.present = xTrue;
reply.major_opcode = extensions[i]->base;
reply.first_event = extensions[i]->eventBase;
reply.first_error = extensions[i]->errorBase;
rep.present = xTrue;
rep.major_opcode = extensions[i]->base;
rep.first_event = extensions[i]->eventBase;
rep.first_error = extensions[i]->errorBase;
}
}
WriteReplyToClient(client, sizeof(xQueryExtensionReply), &reply);
if (client->swapped) {
swaps(&rep.sequenceNumber);
}
WriteToClient(client, sizeof(rep), &rep);
return Success;
}
int
ProcListExtensions(ClientPtr client)
{
xListExtensionsReply reply;
char *bufptr, *buffer;
int total_length = 0;
REQUEST_SIZE_MATCH(xReq);
reply = (xListExtensionsReply) {
xListExtensionsReply rep = {
.type = X_Reply,
.nExtensions = 0,
.sequenceNumber = client->sequence,
@ -280,9 +279,9 @@ ProcListExtensions(ClientPtr client)
continue;
total_length += strlen(extensions[i]->name) + 1;
reply.nExtensions += 1;
rep.nExtensions += 1;
}
reply.length = bytes_to_int32(total_length);
rep.length = bytes_to_int32(total_length);
buffer = bufptr = malloc(total_length);
if (!buffer)
return BadAlloc;
@ -297,8 +296,12 @@ ProcListExtensions(ClientPtr client)
bufptr += len;
}
}
WriteReplyToClient(client, sizeof(xListExtensionsReply), &reply);
if (reply.length)
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
}
WriteToClient(client, sizeof(rep), &rep);
WriteToClient(client, total_length, buffer);
free(buffer);

View File

@ -421,22 +421,6 @@ DeleteAllWindowProperties(WindowPtr pWin)
pWin->optional->userProps = NULL;
}
static int
NullPropertyReply(ClientPtr client, ATOM propertyType, int format)
{
xGetPropertyReply reply = {
.type = X_Reply,
.format = format,
.sequenceNumber = client->sequence,
.length = 0,
.propertyType = propertyType,
.bytesAfter = 0,
.nItems = 0
};
WriteReplyToClient(client, sizeof(xGenericReply), &reply);
return Success;
}
/*****************
* GetProperty
* If type Any is specified, returns the property from the specified
@ -454,7 +438,6 @@ ProcGetProperty(ClientPtr client)
unsigned long n, len, ind;
int rc;
WindowPtr pWin;
xGetPropertyReply reply;
Mask win_mode = DixGetPropAccess, prop_mode = DixReadAccess;
REQUEST(xGetPropertyReq);
@ -483,8 +466,17 @@ ProcGetProperty(ClientPtr client)
}
rc = dixLookupProperty(&pProp, pWin, stuff->property, client, prop_mode);
if (rc == BadMatch)
return NullPropertyReply(client, None, 0);
if (rc == BadMatch) {
xGetPropertyReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
};
if (client->swapped) {
swaps(&rep.sequenceNumber);
}
WriteToClient(client, sizeof(rep), &rep);
return Success;
}
else if (rc != Success)
return rc;
@ -493,16 +485,19 @@ ProcGetProperty(ClientPtr client)
if (((stuff->type != pProp->type) && (stuff->type != AnyPropertyType))
) {
reply = (xGetPropertyReply) {
xGetPropertyReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.bytesAfter = pProp->size,
.format = pProp->format,
.length = 0,
.nItems = 0,
.propertyType = pProp->type
};
WriteReplyToClient(client, sizeof(xGenericReply), &reply);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.propertyType);
swapl(&rep.bytesAfter);
}
WriteToClient(client, sizeof(rep), &rep);
return Success;
}
@ -522,7 +517,7 @@ ProcGetProperty(ClientPtr client)
len = min(n - ind, 4 * stuff->longLength);
reply = (xGetPropertyReply) {
xGetPropertyReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.bytesAfter = n - (ind + len),
@ -532,26 +527,15 @@ ProcGetProperty(ClientPtr client)
.propertyType = pProp->type
};
if (stuff->delete && (reply.bytesAfter == 0))
if (stuff->delete && (rep.bytesAfter == 0))
deliverPropertyNotifyEvent(pWin, PropertyDelete, pProp);
WriteReplyToClient(client, sizeof(xGenericReply), &reply);
if (len) {
switch (reply.format) {
case 32:
client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write;
break;
case 16:
client->pSwapReplyFunc = (ReplySwapPtr) CopySwap16Write;
break;
default:
client->pSwapReplyFunc = (ReplySwapPtr) WriteToClient;
break;
}
WriteSwappedDataToClient(client, len, (char *) pProp->data + ind);
}
void *payload = calloc(1, len);
if (!payload)
return BadAlloc;
memcpy(payload, (char*)(pProp->data) + ind, len);
if (stuff->delete && (reply.bytesAfter == 0)) {
if (stuff->delete && (rep.bytesAfter == 0)) {
/* Delete the Property */
if (pWin->optional->userProps == pProp) {
/* Takes care of head */
@ -569,6 +553,22 @@ ProcGetProperty(ClientPtr client)
free(pProp->data);
dixFreeObjectWithPrivates(pProp, PRIVATE_PROPERTY);
}
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.propertyType);
swapl(&rep.bytesAfter);
swapl(&rep.nItems);
if (rep.format == 32)
SwapLongs(payload, len / 4);
else if (rep.format == 16)
SwapShorts(payload, len / 2);
}
WriteToClient(client, sizeof(rep), &rep);
WriteToClient(client, len, payload);
free(payload);
return Success;
}
@ -576,7 +576,6 @@ int
ProcListProperties(ClientPtr client)
{
Atom *pAtoms = NULL, *temppAtoms;
xListPropertiesReply xlpr;
int rc, numProps = 0;
WindowPtr pWin;
PropertyPtr pProp, realProp;
@ -608,18 +607,24 @@ ProcListProperties(ClientPtr client)
}
}
xlpr = (xListPropertiesReply) {
xListPropertiesReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = bytes_to_int32(numProps * sizeof(Atom)),
.nProperties = numProps
};
WriteReplyToClient(client, sizeof(xGenericReply), &xlpr);
if (numProps) {
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms);
free(pAtoms);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swaps(&rep.nProperties);
SwapLongs(pAtoms, numProps);
}
WriteToClient(client, sizeof(rep), &rep);
WriteToClient(client, numProps * sizeof(Atom), pAtoms);
free(pAtoms);
return Success;
}

View File

@ -219,7 +219,6 @@ ProcGetSelectionOwner(ClientPtr client)
{
int rc;
Selection *pSel;
xGetSelectionOwnerReply reply;
REQUEST(xResourceReq);
REQUEST_SIZE_MATCH(xResourceReq);
@ -229,7 +228,7 @@ ProcGetSelectionOwner(ClientPtr client)
return BadAtom;
}
reply = (xGetSelectionOwnerReply) {
xGetSelectionOwnerReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
@ -237,13 +236,18 @@ ProcGetSelectionOwner(ClientPtr client)
rc = dixLookupSelection(&pSel, stuff->id, client, DixGetAttrAccess);
if (rc == Success)
reply.owner = pSel->window;
rep.owner = pSel->window;
else if (rc == BadMatch)
reply.owner = None;
rep.owner = None;
else
return rc;
WriteReplyToClient(client, sizeof(xGetSelectionOwnerReply), &reply);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.owner);
}
WriteToClient(client, sizeof(rep), &rep);
return Success;
}

View File

@ -59,8 +59,6 @@ static void SwapFontInfo(xQueryFontReply * pr);
static void SwapCharInfo(xCharInfo * pInfo);
static void SwapFont(xQueryFontReply * pr, Bool hasGlyphs);
/**
* Thanks to Jack Palevich for testing and subsequently rewriting all this
*
@ -183,108 +181,6 @@ SGenericReply(ClientPtr pClient, int size, xGenericReply * pRep)
WriteToClient(pClient, size, pRep);
}
/* Extra-large reply */
void _X_COLD
SGetWindowAttributesReply(ClientPtr pClient, int size,
xGetWindowAttributesReply * pRep)
{
swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swapl(&pRep->visualID);
swaps(&pRep->class);
swapl(&pRep->backingBitPlanes);
swapl(&pRep->backingPixel);
swapl(&pRep->colormap);
swapl(&pRep->allEventMasks);
swapl(&pRep->yourEventMask);
swaps(&pRep->doNotPropagateMask);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SGetGeometryReply(ClientPtr pClient, int size, xGetGeometryReply * pRep)
{
swaps(&pRep->sequenceNumber);
swapl(&pRep->root);
swaps(&pRep->x);
swaps(&pRep->y);
swaps(&pRep->width);
swaps(&pRep->height);
swaps(&pRep->borderWidth);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SQueryTreeReply(ClientPtr pClient, int size, xQueryTreeReply * pRep)
{
swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swapl(&pRep->root);
swapl(&pRep->parent);
swaps(&pRep->nChildren);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SInternAtomReply(ClientPtr pClient, int size, xInternAtomReply * pRep)
{
swaps(&pRep->sequenceNumber);
swapl(&pRep->atom);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SGetAtomNameReply(ClientPtr pClient, int size, xGetAtomNameReply * pRep)
{
swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swaps(&pRep->nameLength);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SGetPropertyReply(ClientPtr pClient, int size, xGetPropertyReply * pRep)
{
swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swapl(&pRep->propertyType);
swapl(&pRep->bytesAfter);
swapl(&pRep->nItems);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SListPropertiesReply(ClientPtr pClient, int size, xListPropertiesReply * pRep)
{
swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swaps(&pRep->nProperties);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SGetSelectionOwnerReply(ClientPtr pClient, int size,
xGetSelectionOwnerReply * pRep)
{
swaps(&pRep->sequenceNumber);
swapl(&pRep->owner);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SQueryPointerReply(ClientPtr pClient, int size, xQueryPointerReply * pRep)
{
swaps(&pRep->sequenceNumber);
swapl(&pRep->root);
swapl(&pRep->child);
swaps(&pRep->rootX);
swaps(&pRep->rootY);
swaps(&pRep->winX);
swaps(&pRep->winY);
swaps(&pRep->mask);
WriteToClient(pClient, size, pRep);
}
static void _X_COLD
SwapTimecoord(xTimecoord * pCoord)
{
@ -309,42 +205,6 @@ SwapTimeCoordWrite(ClientPtr pClient, int size, xTimecoord * pRep)
}
void _X_COLD
SGetMotionEventsReply(ClientPtr pClient, int size, xGetMotionEventsReply * pRep)
{
swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swapl(&pRep->nEvents);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
STranslateCoordsReply(ClientPtr pClient, int size, xTranslateCoordsReply * pRep)
{
swaps(&pRep->sequenceNumber);
swapl(&pRep->child);
swaps(&pRep->dstX);
swaps(&pRep->dstY);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SGetInputFocusReply(ClientPtr pClient, int size, xGetInputFocusReply * pRep)
{
swaps(&pRep->sequenceNumber);
swapl(&pRep->focus);
WriteToClient(pClient, size, pRep);
}
/* extra long reply */
void _X_COLD
SQueryKeymapReply(ClientPtr pClient, int size, xQueryKeymapReply * pRep)
{
swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
WriteToClient(pClient, size, pRep);
}
static void _X_COLD
SwapCharInfo(xCharInfo * pInfo)
{
@ -356,7 +216,7 @@ SwapCharInfo(xCharInfo * pInfo)
swaps(&pInfo->attributes);
}
static void _X_COLD
void
SwapFontInfo(xQueryFontReply * pr)
{
swaps(&pr->minCharOrByte2);
@ -370,7 +230,7 @@ SwapFontInfo(xQueryFontReply * pr)
swapl(&pr->nCharInfos);
}
static void _X_COLD
void _X_COLD
SwapFont(xQueryFontReply * pr, Bool hasGlyphs)
{
unsigned i;
@ -399,268 +259,6 @@ SwapFont(xQueryFontReply * pr, Bool hasGlyphs)
}
}
void _X_COLD
SQueryFontReply(ClientPtr pClient, int size, xQueryFontReply * pRep)
{
SwapFont(pRep, TRUE);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SQueryTextExtentsReply(ClientPtr pClient, int size,
xQueryTextExtentsReply * pRep)
{
swaps(&pRep->sequenceNumber);
swaps(&pRep->fontAscent);
swaps(&pRep->fontDescent);
swaps(&pRep->overallAscent);
swaps(&pRep->overallDescent);
swapl(&pRep->overallWidth);
swapl(&pRep->overallLeft);
swapl(&pRep->overallRight);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SListFontsReply(ClientPtr pClient, int size, xListFontsReply * pRep)
{
swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swaps(&pRep->nFonts);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SListFontsWithInfoReply(ClientPtr pClient, int size,
xListFontsWithInfoReply * pRep)
{
SwapFont((xQueryFontReply *) pRep, FALSE);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SGetFontPathReply(ClientPtr pClient, int size, xGetFontPathReply * pRep)
{
swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swaps(&pRep->nPaths);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SGetImageReply(ClientPtr pClient, int size, xGetImageReply * pRep)
{
swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swapl(&pRep->visual);
WriteToClient(pClient, size, pRep);
/* Fortunately, image doesn't need swapping */
}
void _X_COLD
SListInstalledColormapsReply(ClientPtr pClient, int size,
xListInstalledColormapsReply * pRep)
{
swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swaps(&pRep->nColormaps);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SAllocColorReply(ClientPtr pClient, int size, xAllocColorReply * pRep)
{
swaps(&pRep->sequenceNumber);
swaps(&pRep->red);
swaps(&pRep->green);
swaps(&pRep->blue);
swapl(&pRep->pixel);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SAllocNamedColorReply(ClientPtr pClient, int size, xAllocNamedColorReply * pRep)
{
swaps(&pRep->sequenceNumber);
swapl(&pRep->pixel);
swaps(&pRep->exactRed);
swaps(&pRep->exactGreen);
swaps(&pRep->exactBlue);
swaps(&pRep->screenRed);
swaps(&pRep->screenGreen);
swaps(&pRep->screenBlue);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SAllocColorCellsReply(ClientPtr pClient, int size, xAllocColorCellsReply * pRep)
{
swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swaps(&pRep->nPixels);
swaps(&pRep->nMasks);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SAllocColorPlanesReply(ClientPtr pClient, int size,
xAllocColorPlanesReply * pRep)
{
swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swaps(&pRep->nPixels);
swapl(&pRep->redMask);
swapl(&pRep->greenMask);
swapl(&pRep->blueMask);
WriteToClient(pClient, size, pRep);
}
static void _X_COLD
SwapRGB(xrgb * prgb)
{
swaps(&prgb->red);
swaps(&prgb->green);
swaps(&prgb->blue);
}
void _X_COLD
SQColorsExtend(ClientPtr pClient, int size, xrgb * prgb)
{
int i, n;
xrgb *prgbT;
n = size / sizeof(xrgb);
prgbT = prgb;
for (i = 0; i < n; i++) {
SwapRGB(prgbT);
prgbT++;
}
WriteToClient(pClient, size, prgb);
}
void _X_COLD
SQueryColorsReply(ClientPtr pClient, int size, xQueryColorsReply * pRep)
{
swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swaps(&pRep->nColors);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SLookupColorReply(ClientPtr pClient, int size, xLookupColorReply * pRep)
{
swaps(&pRep->sequenceNumber);
swaps(&pRep->exactRed);
swaps(&pRep->exactGreen);
swaps(&pRep->exactBlue);
swaps(&pRep->screenRed);
swaps(&pRep->screenGreen);
swaps(&pRep->screenBlue);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SQueryBestSizeReply(ClientPtr pClient, int size, xQueryBestSizeReply * pRep)
{
swaps(&pRep->sequenceNumber);
swaps(&pRep->width);
swaps(&pRep->height);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SListExtensionsReply(ClientPtr pClient, int size, xListExtensionsReply * pRep)
{
swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SGetKeyboardMappingReply(ClientPtr pClient, int size,
xGetKeyboardMappingReply * pRep)
{
swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SGetPointerMappingReply(ClientPtr pClient, int size,
xGetPointerMappingReply * pRep)
{
swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SGetModifierMappingReply(ClientPtr pClient, int size,
xGetModifierMappingReply * pRep)
{
swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SGetKeyboardControlReply(ClientPtr pClient, int size,
xGetKeyboardControlReply * pRep)
{
swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swapl(&pRep->ledMask);
swaps(&pRep->bellPitch);
swaps(&pRep->bellDuration);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SGetPointerControlReply(ClientPtr pClient, int size,
xGetPointerControlReply * pRep)
{
swaps(&pRep->sequenceNumber);
swaps(&pRep->accelNumerator);
swaps(&pRep->accelDenominator);
swaps(&pRep->threshold);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SGetScreenSaverReply(ClientPtr pClient, int size, xGetScreenSaverReply * pRep)
{
swaps(&pRep->sequenceNumber);
swaps(&pRep->timeout);
swaps(&pRep->interval);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SLHostsExtend(ClientPtr pClient, int size, char *buf)
{
char *bufT = buf;
char *endbuf = buf + size;
while (bufT < endbuf) {
xHostEntry *host = (xHostEntry *) bufT;
int len = host->length;
swaps(&host->length);
bufT += sizeof(xHostEntry) + pad_to_int32(len);
}
WriteToClient(pClient, size, buf);
}
void _X_COLD
SListHostsReply(ClientPtr pClient, int size, xListHostsReply * pRep)
{
swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swaps(&pRep->nHosts);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SErrorEvent(xError * from, xError * to)
{

View File

@ -715,7 +715,7 @@ ReplySwapPtr ReplySwapVector[256] = {
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd,
(ReplySwapPtr) SGetWindowAttributesReply,
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd, /* 5 */
ReplyNotSwappd,
@ -726,45 +726,45 @@ ReplySwapPtr ReplySwapVector[256] = {
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd,
(ReplySwapPtr) SGetGeometryReply,
(ReplySwapPtr) SQueryTreeReply, /* 15 */
(ReplySwapPtr) SInternAtomReply,
(ReplySwapPtr) SGetAtomNameReply,
ReplyNotSwappd,
ReplyNotSwappd, /* 15 */
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd, /* 20 */
ReplyNotSwappd,
ReplyNotSwappd,
(ReplySwapPtr) SGetPropertyReply, /* 20 */
(ReplySwapPtr) SListPropertiesReply,
ReplyNotSwappd,
(ReplySwapPtr) SGetSelectionOwnerReply,
ReplyNotSwappd,
ReplyNotSwappd, /* 25 */
(ReplySwapPtr) SGenericReply, /* SGrabPointerReply, */
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd, /* 30 */
(ReplySwapPtr) SGenericReply, /* SGrabKeyboardReply, */
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd, /* 35 */
ReplyNotSwappd,
ReplyNotSwappd,
(ReplySwapPtr) SQueryPointerReply,
(ReplySwapPtr) SGetMotionEventsReply,
(ReplySwapPtr) STranslateCoordsReply, /* 40 */
ReplyNotSwappd,
ReplyNotSwappd,
(ReplySwapPtr) SGetInputFocusReply,
(ReplySwapPtr) SQueryKeymapReply,
ReplyNotSwappd, /* 40 */
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd, /* 45 */
ReplyNotSwappd,
(ReplySwapPtr) SQueryFontReply,
(ReplySwapPtr) SQueryTextExtentsReply,
(ReplySwapPtr) SListFontsReply,
(ReplySwapPtr) SListFontsWithInfoReply, /* 50 */
ReplyNotSwappd,
(ReplySwapPtr) SGetFontPathReply,
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd, /* 50 */
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd, /* 55 */
@ -785,7 +785,7 @@ ReplySwapPtr ReplySwapVector[256] = {
ReplyNotSwappd, /* 70 */
ReplyNotSwappd,
ReplyNotSwappd,
(ReplySwapPtr) SGetImageReply,
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd, /* 75 */
ReplyNotSwappd,
@ -795,43 +795,43 @@ ReplySwapPtr ReplySwapVector[256] = {
ReplyNotSwappd, /* 80 */
ReplyNotSwappd,
ReplyNotSwappd,
(ReplySwapPtr) SListInstalledColormapsReply,
(ReplySwapPtr) SAllocColorReply,
(ReplySwapPtr) SAllocNamedColorReply, /* 85 */
(ReplySwapPtr) SAllocColorCellsReply,
(ReplySwapPtr) SAllocColorPlanesReply,
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd, /* 85 */
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd, /* 90 */
(ReplySwapPtr) SQueryColorsReply,
(ReplySwapPtr) SLookupColorReply,
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd, /* 95 */
ReplyNotSwappd,
(ReplySwapPtr) SQueryBestSizeReply,
(ReplySwapPtr) SGenericReply, /* SQueryExtensionReply, */
(ReplySwapPtr) SListExtensionsReply,
ReplyNotSwappd, /* 100 */
(ReplySwapPtr) SGetKeyboardMappingReply,
ReplyNotSwappd,
(ReplySwapPtr) SGetKeyboardControlReply,
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd, /* 100 */
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd, /* 105 */
(ReplySwapPtr) SGetPointerControlReply,
ReplyNotSwappd,
(ReplySwapPtr) SGetScreenSaverReply,
ReplyNotSwappd,
(ReplySwapPtr) SListHostsReply, /* 110 */
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd, /* 110 */
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd, /* 115 */
(ReplySwapPtr) SGenericReply, /* SetPointerMapping */
(ReplySwapPtr) SGetPointerMappingReply,
(ReplySwapPtr) SGenericReply, /* SetModifierMapping */
(ReplySwapPtr) SGetModifierMappingReply, /* 119 */
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd, /* 119 */
ReplyNotSwappd, /* 120 */
ReplyNotSwappd, /* 121 */
ReplyNotSwappd, /* 122 */

View File

@ -100,6 +100,7 @@ Equipment Corporation.
#include "dix/colormap_priv.h"
#include "dix/cursor_priv.h"
#include "dix/dispatch.h"
#include "dix/dix_priv.h"
#include "dix/exevents_priv.h"
#include "dix/input_priv.h"
@ -1595,42 +1596,55 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
return error;
}
/*****
* GetWindowAttributes
* Notice that this is different than ChangeWindowAttributes
*****/
void
GetWindowAttributes(WindowPtr pWin, ClientPtr client,
xGetWindowAttributesReply * wa)
int
ProcGetWindowAttributes(ClientPtr client)
{
wa->type = X_Reply;
wa->bitGravity = pWin->bitGravity;
wa->winGravity = pWin->winGravity;
wa->backingStore = pWin->backingStore;
wa->length = bytes_to_int32(sizeof(xGetWindowAttributesReply) -
sizeof(xGenericReply));
wa->sequenceNumber = client->sequence;
wa->backingBitPlanes = wBackingBitPlanes(pWin);
wa->backingPixel = wBackingPixel(pWin);
wa->saveUnder = (BOOL) pWin->saveUnder;
wa->override = pWin->overrideRedirect;
if (!pWin->mapped)
wa->mapState = IsUnmapped;
else if (pWin->realized)
wa->mapState = IsViewable;
else
wa->mapState = IsUnviewable;
REQUEST(xResourceReq);
REQUEST_SIZE_MATCH(xResourceReq);
wa->colormap = wColormap(pWin);
wa->mapInstalled = (wa->colormap == None) ? xFalse
: IsMapInstalled(wa->colormap, pWin);
WindowPtr pWin;
int rc = dixLookupWindow(&pWin, stuff->id, client, DixGetAttrAccess);
if (rc != Success)
return rc;
wa->yourEventMask = EventMaskForClient(pWin, client);
wa->allEventMasks = pWin->eventMask | wOtherEventMasks(pWin);
wa->doNotPropagateMask = wDontPropagateMask(pWin);
wa->class = pWin->drawable.class;
wa->visualID = wVisual(pWin);
xGetWindowAttributesReply rep = {
.type = X_Reply,
.bitGravity = pWin->bitGravity,
.winGravity = pWin->winGravity,
.backingStore = pWin->backingStore,
.length = bytes_to_int32(sizeof(xGetWindowAttributesReply) -
sizeof(xGenericReply)),
.sequenceNumber = client->sequence,
.backingBitPlanes = wBackingBitPlanes(pWin),
.backingPixel = wBackingPixel(pWin),
.saveUnder = (BOOL) pWin->saveUnder,
.override = pWin->overrideRedirect,
.mapState = (!pWin->mapped ? IsUnmapped :
(pWin->realized ? IsViewable : IsUnviewable)),
.colormap = wColormap(pWin),
.mapInstalled = (wColormap(pWin) == None) ? xFalse
: IsMapInstalled(wColormap(pWin), pWin),
.yourEventMask = EventMaskForClient(pWin, client),
.allEventMasks = pWin->eventMask | wOtherEventMasks(pWin),
.doNotPropagateMask = wDontPropagateMask(pWin),
.class = pWin->drawable.class,
.visualID = wVisual(pWin),
};
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.visualID);
swaps(&rep.class);
swapl(&rep.backingBitPlanes);
swapl(&rep.backingPixel);
swapl(&rep.colormap);
swapl(&rep.allEventMasks);
swapl(&rep.yourEventMask);
swaps(&rep.doNotPropagateMask);
}
WriteToClient(client, sizeof(rep), &rep);
return Success;
}
WindowPtr

View File

@ -26,6 +26,8 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef SWAPREP_H
#define SWAPREP_H 1
void SwapFont(xQueryFontReply * pr, Bool hasGlyphs);
extern void Swap32Write(ClientPtr /* pClient */ ,
int /* size */ ,
CARD32 * /* pbuf */ );
@ -42,173 +44,10 @@ extern void SGenericReply(ClientPtr /* pClient */ ,
int /* size */ ,
xGenericReply * /* pRep */ );
extern void SGetWindowAttributesReply(ClientPtr /* pClient */ ,
int /* size */ ,
xGetWindowAttributesReply *
/* pRep */ );
extern void SGetGeometryReply(ClientPtr /* pClient */ ,
int /* size */ ,
xGetGeometryReply * /* pRep */ );
extern void SQueryTreeReply(ClientPtr /* pClient */ ,
int /* size */ ,
xQueryTreeReply * /* pRep */ );
extern void SInternAtomReply(ClientPtr /* pClient */ ,
int /* size */ ,
xInternAtomReply * /* pRep */ );
extern void SGetAtomNameReply(ClientPtr /* pClient */ ,
int /* size */ ,
xGetAtomNameReply * /* pRep */ );
extern void SGetPropertyReply(ClientPtr /* pClient */ ,
int /* size */ ,
xGetPropertyReply * /* pRep */ );
extern void SListPropertiesReply(ClientPtr /* pClient */ ,
int /* size */ ,
xListPropertiesReply * /* pRep */ );
extern void SGetSelectionOwnerReply(ClientPtr /* pClient */ ,
int /* size */ ,
xGetSelectionOwnerReply *
/* pRep */ );
extern void SQueryPointerReply(ClientPtr /* pClient */ ,
int /* size */ ,
xQueryPointerReply * /* pRep */ );
extern void SwapTimeCoordWrite(ClientPtr /* pClient */ ,
int /* size */ ,
xTimecoord * /* pRep */ );
extern void SGetMotionEventsReply(ClientPtr /* pClient */ ,
int /* size */ ,
xGetMotionEventsReply * /* pRep */
);
extern void STranslateCoordsReply(ClientPtr /* pClient */ ,
int /* size */ ,
xTranslateCoordsReply * /* pRep */
);
extern void SGetInputFocusReply(ClientPtr /* pClient */ ,
int /* size */ ,
xGetInputFocusReply * /* pRep */ );
extern void SQueryKeymapReply(ClientPtr /* pClient */ ,
int /* size */ ,
xQueryKeymapReply * /* pRep */ );
extern void SQueryFontReply(ClientPtr /* pClient */ ,
int /* size */ ,
xQueryFontReply * /* pRep */ );
extern void SQueryTextExtentsReply(ClientPtr /* pClient */ ,
int /* size */ ,
xQueryTextExtentsReply * /* pRep */
);
extern void SListFontsReply(ClientPtr /* pClient */ ,
int /* size */ ,
xListFontsReply * /* pRep */ );
extern void SListFontsWithInfoReply(ClientPtr /* pClient */ ,
int /* size */ ,
xListFontsWithInfoReply *
/* pRep */ );
extern void SGetFontPathReply(ClientPtr /* pClient */ ,
int /* size */ ,
xGetFontPathReply * /* pRep */ );
extern void SGetImageReply(ClientPtr /* pClient */ ,
int /* size */ ,
xGetImageReply * /* pRep */ );
extern void SListInstalledColormapsReply(ClientPtr /* pClient */ ,
int /* size */ ,
xListInstalledColormapsReply
* /* pRep */ );
extern void SAllocColorReply(ClientPtr /* pClient */ ,
int /* size */ ,
xAllocColorReply * /* pRep */ );
extern void SAllocNamedColorReply(ClientPtr /* pClient */ ,
int /* size */ ,
xAllocNamedColorReply * /* pRep */
);
extern void SAllocColorCellsReply(ClientPtr /* pClient */ ,
int /* size */ ,
xAllocColorCellsReply * /* pRep */
);
extern void SAllocColorPlanesReply(ClientPtr /* pClient */ ,
int /* size */ ,
xAllocColorPlanesReply * /* pRep */
);
extern void SQColorsExtend(ClientPtr /* pClient */ ,
int /* size */ ,
xrgb * /* prgb */ );
extern void SQueryColorsReply(ClientPtr /* pClient */ ,
int /* size */ ,
xQueryColorsReply * /* pRep */ );
extern void SLookupColorReply(ClientPtr /* pClient */ ,
int /* size */ ,
xLookupColorReply * /* pRep */ );
extern void SQueryBestSizeReply(ClientPtr /* pClient */ ,
int /* size */ ,
xQueryBestSizeReply * /* pRep */ );
extern void SListExtensionsReply(ClientPtr /* pClient */ ,
int /* size */ ,
xListExtensionsReply * /* pRep */ );
extern void SGetKeyboardMappingReply(ClientPtr /* pClient */ ,
int /* size */ ,
xGetKeyboardMappingReply *
/* pRep */ );
extern void SGetPointerMappingReply(ClientPtr /* pClient */ ,
int /* size */ ,
xGetPointerMappingReply *
/* pRep */ );
extern void SGetModifierMappingReply(ClientPtr /* pClient */ ,
int /* size */ ,
xGetModifierMappingReply *
/* pRep */ );
extern void SGetKeyboardControlReply(ClientPtr /* pClient */ ,
int /* size */ ,
xGetKeyboardControlReply *
/* pRep */ );
extern void SGetPointerControlReply(ClientPtr /* pClient */ ,
int /* size */ ,
xGetPointerControlReply *
/* pRep */ );
extern void SGetScreenSaverReply(ClientPtr /* pClient */ ,
int /* size */ ,
xGetScreenSaverReply * /* pRep */ );
extern void SLHostsExtend(ClientPtr /* pClient */ ,
int /* size */ ,
char * /* buf */ );
extern void SListHostsReply(ClientPtr /* pClient */ ,
int /* size */ ,
xListHostsReply * /* pRep */ );
extern void SErrorEvent(xError * /* from */ ,
xError * /* to */ );