diff options
author | marha <marha@users.sourceforge.net> | 2009-09-09 05:23:48 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-09-09 05:23:48 +0000 |
commit | 81f91c615982e50bb62708201569c33a3cd3d973 (patch) | |
tree | 4f32ecc48a3b7b5e76642f3792338263c53879bd /xorg-server/hw/xfree86/dixmods/extmod/xf86dga2.c | |
parent | b571a562410f565af2bdde52d9f7f9a23ffae04f (diff) | |
parent | a915739887477b28d924ecc8417ee107d125bd6c (diff) | |
download | vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.tar.gz vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.tar.bz2 vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.zip |
svn merge https://vcxsrv.svn.sourceforge.net/svnroot/vcxsrv/branches/released .
Diffstat (limited to 'xorg-server/hw/xfree86/dixmods/extmod/xf86dga2.c')
-rw-r--r-- | xorg-server/hw/xfree86/dixmods/extmod/xf86dga2.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/xorg-server/hw/xfree86/dixmods/extmod/xf86dga2.c b/xorg-server/hw/xfree86/dixmods/extmod/xf86dga2.c index df0030e80..7579f7d51 100644 --- a/xorg-server/hw/xfree86/dixmods/extmod/xf86dga2.c +++ b/xorg-server/hw/xfree86/dixmods/extmod/xf86dga2.c @@ -11,8 +11,6 @@ #include <xorg-config.h> #endif -#define NEED_REPLIES -#define NEED_EVENTS #include <X11/X.h> #include <X11/Xproto.h> #include "misc.h" @@ -24,9 +22,7 @@ #include "cursorstr.h" #include "scrnintstr.h" #include "servermd.h" -#define _XF86DGA_SERVER_ -#include <X11/extensions/xf86dga.h> -#include <X11/extensions/xf86dgastr.h> +#include <X11/extensions/xf86dgaproto.h> #include "swaprep.h" #include "dgaproc.h" #include "xf86dgaext.h" @@ -161,7 +157,7 @@ ProcXDGAOpenFramebuffer(ClientPtr client) } nameSize = deviceName ? (strlen(deviceName) + 1) : 0; - rep.length = (nameSize + 3) >> 2; + rep.length = bytes_to_int32(nameSize); WriteToClient(client, sizeof(xXDGAOpenFramebufferReply), (char *)&rep); if(rep.length) @@ -227,10 +223,10 @@ ProcXDGAQueryModes(ClientPtr client) size = num * sz_xXDGAModeInfo; for(i = 0; i < num; i++) - size += (strlen(mode[i].name) + 4) & ~3L; /* plus NULL */ + size += pad_to_int32(strlen(mode[i].name) + 1); /* plus NULL */ rep.number = num; - rep.length = size >> 2; + rep.length = bytes_to_int32(size); WriteToClient(client, sz_xXDGAQueryModesReply, (char*)&rep); @@ -391,7 +387,7 @@ ProcXDGASetMode(ClientPtr client) info.reserved1 = mode.reserved1; info.reserved2 = mode.reserved2; - rep.length = (sz_xXDGAModeInfo + info.name_size) >> 2; + rep.length = bytes_to_int32(sz_xXDGAModeInfo + info.name_size); WriteToClient(client, sz_xXDGASetModeReply, (char*)&rep); WriteToClient(client, sz_xXDGAModeInfo, (char*)(&info)); @@ -422,6 +418,7 @@ static int ProcXDGAInstallColormap(ClientPtr client) { ColormapPtr cmap; + int rc; REQUEST(xXDGAInstallColormapReq); if (stuff->screen > screenInfo.numScreens) @@ -432,13 +429,13 @@ ProcXDGAInstallColormap(ClientPtr client) REQUEST_SIZE_MATCH(xXDGAInstallColormapReq); - cmap = (ColormapPtr)LookupIDByType(stuff->cmap, RT_COLORMAP); - if (cmap) { + rc = dixLookupResourceByType((pointer *)&cmap, stuff->cmap, RT_COLORMAP, + client, DixInstallAccess); + if (rc == Success) { DGAInstallCmap(cmap); return (client->noClientException); } else { - client->errorValue = stuff->cmap; - return (BadColor); + return (rc == BadValue) ? BadColor : rc; } return (client->noClientException); @@ -860,6 +857,7 @@ static int ProcXF86DGAInstallColormap(ClientPtr client) { ColormapPtr pcmp; + int rc; REQUEST(xXF86DGAInstallColormapReq); if (stuff->screen > screenInfo.numScreens) @@ -873,13 +871,13 @@ ProcXF86DGAInstallColormap(ClientPtr client) if (!DGAActive(stuff->screen)) return (DGAErrorBase + XF86DGADirectNotActivated); - pcmp = (ColormapPtr )LookupIDByType(stuff->id, RT_COLORMAP); - if (pcmp) { + rc = dixLookupResourceByType((pointer *)&pcmp, stuff->id, RT_COLORMAP, + client, DixInstallAccess); + if (rc == Success) { DGAInstallCmap(pcmp); return (client->noClientException); } else { - client->errorValue = stuff->id; - return (BadColor); + return (rc == BadValue) ? BadColor : rc; } } |