aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/glx/clientinfo.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-07-06 09:31:01 +0200
committermarha <marha@users.sourceforge.net>2012-07-06 09:31:01 +0200
commit405ae9defaaa03d4d305b6264a744107c3dd460d (patch)
treee119a54d876fa737d859718afbde7ef507702631 /xorg-server/glx/clientinfo.c
parent3a5976985ab1ca641b095a72730f1f3d3bd5f9bc (diff)
parent336bad93d146931c160d8517edfdf0bee49ad9f7 (diff)
downloadvcxsrv-405ae9defaaa03d4d305b6264a744107c3dd460d.tar.gz
vcxsrv-405ae9defaaa03d4d305b6264a744107c3dd460d.tar.bz2
vcxsrv-405ae9defaaa03d4d305b6264a744107c3dd460d.zip
Merge remote-tracking branch 'origin/released'
Conflicts: xorg-server/dix/dispatch.c xorg-server/dix/privates.c xorg-server/hw/kdrive/ephyr/ephyr.c xorg-server/hw/kdrive/src/kinput.c
Diffstat (limited to 'xorg-server/glx/clientinfo.c')
-rw-r--r--xorg-server/glx/clientinfo.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/xorg-server/glx/clientinfo.c b/xorg-server/glx/clientinfo.c
index b26ac1a72..4aaa4c967 100644
--- a/xorg-server/glx/clientinfo.c
+++ b/xorg-server/glx/clientinfo.c
@@ -29,10 +29,10 @@
#include "glxbyteorder.h"
#include "unpack.h"
-int
-__glXDisp_SetClientInfoARB(__GLXclientState * cl, GLbyte * pc)
+static int
+set_client_info(__GLXclientState * cl, xGLXSetClientInfoARBReq * req,
+ unsigned bytes_per_version)
{
- xGLXSetClientInfoARBReq *req = (xGLXSetClientInfoARBReq *) pc;
char *gl_extensions;
char *glx_extensions;
@@ -40,7 +40,7 @@ __glXDisp_SetClientInfoARB(__GLXclientState * cl, GLbyte * pc)
* sizes specified for the various fields.
*/
const unsigned expected_size = sz_xGLXSetClientInfoARBReq
- + (req->numVersions * 8)
+ + (req->numVersions * bytes_per_version)
+ __GLX_PAD(req->numGLExtensionBytes)
+ __GLX_PAD(req->numGLXExtensionBytes);
@@ -50,7 +50,7 @@ __glXDisp_SetClientInfoARB(__GLXclientState * cl, GLbyte * pc)
/* Verify that the actual length of the GL extension string matches what's
* encoded in protocol packet.
*/
- gl_extensions = (char *) (req + 1) + (req->numVersions * 8);
+ gl_extensions = (char *) (req + 1) + (req->numVersions * bytes_per_version);
if (req->numGLExtensionBytes != 0
&& memchr(gl_extensions, 0,
__GLX_PAD(req->numGLExtensionBytes)) == NULL)
@@ -72,6 +72,12 @@ __glXDisp_SetClientInfoARB(__GLXclientState * cl, GLbyte * pc)
}
int
+__glXDisp_SetClientInfoARB(__GLXclientState * cl, GLbyte * pc)
+{
+ return set_client_info(cl, (xGLXSetClientInfoARBReq *) pc, 8);
+}
+
+int
__glXDispSwap_SetClientInfoARB(__GLXclientState * cl, GLbyte * pc)
{
xGLXSetClientInfoARBReq *req = (xGLXSetClientInfoARBReq *) pc;
@@ -87,11 +93,18 @@ __glXDispSwap_SetClientInfoARB(__GLXclientState * cl, GLbyte * pc)
int
__glXDisp_SetClientInfo2ARB(__GLXclientState * cl, GLbyte * pc)
{
- return BadRequest;
+ return set_client_info(cl, (xGLXSetClientInfoARBReq *) pc, 12);
}
int
__glXDispSwap_SetClientInfo2ARB(__GLXclientState * cl, GLbyte * pc)
{
- return BadRequest;
+ xGLXSetClientInfoARBReq *req = (xGLXSetClientInfoARBReq *) pc;
+
+ req->length = bswap_16(req->length);
+ req->numVersions = bswap_32(req->numVersions);
+ req->numGLExtensionBytes = bswap_32(req->numGLExtensionBytes);
+ req->numGLXExtensionBytes = bswap_32(req->numGLXExtensionBytes);
+
+ return __glXDisp_SetClientInfo2ARB(cl, pc);
}