From 25e71fcb2a7e9bd00e9fe58d07e21af331708371 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 1 Sep 2025 18:27:56 +0200 Subject: [PATCH] randr: ProcRRQueryProviderProperty(): use x_rpcbuf_t Signed-off-by: Enrico Weigelt, metux IT consult --- randr/rrproviderproperty.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/randr/rrproviderproperty.c b/randr/rrproviderproperty.c index a3fc33888..d8a52d4d0 100644 --- a/randr/rrproviderproperty.c +++ b/randr/rrproviderproperty.c @@ -380,26 +380,16 @@ ProcRRQueryProviderProperty(ClientPtr client) if (!prop) return BadName; + x_rpcbuf_t rpcbuf = { .swapped = client->swapped, .err_clear = TRUE }; + x_rpcbuf_write_INT32s(&rpcbuf, prop->valid_values, prop->num_valid); + xRRQueryProviderPropertyReply rep = { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = prop->num_valid, .pending = prop->is_pending, .range = prop->range, .immutable = prop->immutable }; - if (client->swapped) { - swaps(&rep.sequenceNumber); - swapl(&rep.length); - } - WriteToClient(client, sizeof(xRRQueryProviderPropertyReply), (char *) &rep); - if (prop->num_valid) { - if (client->swapped) - CopySwap32Write(client, prop->num_valid * sizeof(INT32), (CARD32*)prop->valid_values); - else - WriteToClient(client, prop->num_valid * sizeof(INT32), prop->valid_values); - } - return Success; + + return X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf); } int