Add typed resource-lookup errors for non-core resource types.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
Jamey Sharp 2010-04-24 23:56:36 -07:00
parent e291c56182
commit c38552d115
26 changed files with 169 additions and 137 deletions

View File

@ -519,6 +519,10 @@ void PanoramiXExtensionInit(int argc, char *argv[])
panoramiXGeneration = serverGeneration;
success = TRUE;
}
SetResourceTypeErrorValue(XRT_WINDOW, BadWindow);
SetResourceTypeErrorValue(XRT_PIXMAP, BadPixmap);
SetResourceTypeErrorValue(XRT_GC, BadGC);
SetResourceTypeErrorValue(XRT_COLORMAP, BadColor);
}
if (!success) {

View File

@ -74,7 +74,7 @@ int PanoramiXCreateWindow(ClientPtr client)
result = dixLookupResourceByType((pointer *)&parent, stuff->parent,
XRT_WINDOW, client, DixWriteAccess);
if (result != Success)
return (result == BadValue) ? BadWindow : result;
return result;
if(stuff->class == CopyFromParent)
stuff->class = parent->u.win.class;
@ -89,7 +89,7 @@ int PanoramiXCreateWindow(ClientPtr client)
result = dixLookupResourceByType((pointer *)&backPix, tmp,
XRT_PIXMAP, client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadPixmap : result;
return result;
}
}
if ((Mask)stuff->mask & CWBorderPixmap) {
@ -99,7 +99,7 @@ int PanoramiXCreateWindow(ClientPtr client)
result = dixLookupResourceByType((pointer *)&bordPix, tmp,
XRT_PIXMAP, client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadPixmap : result;
return result;
}
}
if ((Mask)stuff->mask & CWColormap) {
@ -109,7 +109,7 @@ int PanoramiXCreateWindow(ClientPtr client)
result = dixLookupResourceByType((pointer *)&cmap, tmp,
XRT_COLORMAP, client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadColor : result;
return result;
}
}
@ -179,7 +179,7 @@ int PanoramiXChangeWindowAttributes(ClientPtr client)
result = dixLookupResourceByType((pointer *)&win, stuff->window,
XRT_WINDOW, client, DixWriteAccess);
if (result != Success)
return (result == BadValue) ? BadWindow : result;
return result;
if((win->u.win.class == InputOnly) &&
(stuff->valueMask & (~INPUTONLY_LEGAL_MASK)))
@ -192,7 +192,7 @@ int PanoramiXChangeWindowAttributes(ClientPtr client)
result = dixLookupResourceByType((pointer *)&backPix, tmp,
XRT_PIXMAP, client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadPixmap : result;
return result;
}
}
if ((Mask)stuff->valueMask & CWBorderPixmap) {
@ -202,7 +202,7 @@ int PanoramiXChangeWindowAttributes(ClientPtr client)
result = dixLookupResourceByType((pointer *)&bordPix, tmp,
XRT_PIXMAP, client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadPixmap : result;
return result;
}
}
if ((Mask)stuff->valueMask & CWColormap) {
@ -212,7 +212,7 @@ int PanoramiXChangeWindowAttributes(ClientPtr client)
result = dixLookupResourceByType((pointer *)&cmap, tmp,
XRT_COLORMAP, client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadColor : result;
return result;
}
}
@ -242,7 +242,7 @@ int PanoramiXDestroyWindow(ClientPtr client)
result = dixLookupResourceByType((pointer *)&win, stuff->id, XRT_WINDOW,
client, DixDestroyAccess);
if (result != Success)
return (result == BadValue) ? BadWindow : result;
return result;
FOR_NSCREENS_BACKWARD(j) {
stuff->id = win->info[j].id;
@ -268,7 +268,7 @@ int PanoramiXDestroySubwindows(ClientPtr client)
result = dixLookupResourceByType((pointer *)&win, stuff->id, XRT_WINDOW,
client, DixDestroyAccess);
if (result != Success)
return (result == BadValue) ? BadWindow : result;
return result;
FOR_NSCREENS_BACKWARD(j) {
stuff->id = win->info[j].id;
@ -294,7 +294,7 @@ int PanoramiXChangeSaveSet(ClientPtr client)
result = dixLookupResourceByType((pointer *)&win, stuff->window,
XRT_WINDOW, client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadWindow : result;
return result;
FOR_NSCREENS_BACKWARD(j) {
stuff->window = win->info[j].id;
@ -319,12 +319,12 @@ int PanoramiXReparentWindow(ClientPtr client)
result = dixLookupResourceByType((pointer *)&win, stuff->window,
XRT_WINDOW, client, DixWriteAccess);
if (result != Success)
return (result == BadValue) ? BadWindow : result;
return result;
result = dixLookupResourceByType((pointer *)&parent, stuff->parent,
XRT_WINDOW, client, DixWriteAccess);
if (result != Success)
return (result == BadValue) ? BadWindow : result;
return result;
x = stuff->x;
y = stuff->y;
@ -356,7 +356,7 @@ int PanoramiXMapWindow(ClientPtr client)
result = dixLookupResourceByType((pointer *)&win, stuff->id,
XRT_WINDOW, client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadWindow : result;
return result;
FOR_NSCREENS_FORWARD(j) {
stuff->id = win->info[j].id;
@ -379,7 +379,7 @@ int PanoramiXMapSubwindows(ClientPtr client)
result = dixLookupResourceByType((pointer *)&win, stuff->id,
XRT_WINDOW, client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadWindow : result;
return result;
FOR_NSCREENS_FORWARD(j) {
stuff->id = win->info[j].id;
@ -402,7 +402,7 @@ int PanoramiXUnmapWindow(ClientPtr client)
result = dixLookupResourceByType((pointer *)&win, stuff->id,
XRT_WINDOW, client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadWindow : result;
return result;
FOR_NSCREENS_FORWARD(j) {
stuff->id = win->info[j].id;
@ -425,7 +425,7 @@ int PanoramiXUnmapSubwindows(ClientPtr client)
result = dixLookupResourceByType((pointer *)&win, stuff->id,
XRT_WINDOW, client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadWindow : result;
return result;
FOR_NSCREENS_FORWARD(j) {
stuff->id = win->info[j].id;
@ -462,7 +462,7 @@ int PanoramiXConfigureWindow(ClientPtr client)
result = dixLookupResourceByType((pointer *)&win, stuff->window,
XRT_WINDOW, client, DixWriteAccess);
if (result != Success)
return (result == BadValue) ? BadWindow : result;
return result;
if ((Mask)stuff->mask & CWSibling) {
XID tmp;
@ -471,7 +471,7 @@ int PanoramiXConfigureWindow(ClientPtr client)
result = dixLookupResourceByType((pointer *)&sib, tmp, XRT_WINDOW,
client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadWindow : result;
return result;
}
}
@ -517,7 +517,7 @@ int PanoramiXCirculateWindow(ClientPtr client)
result = dixLookupResourceByType((pointer *)&win, stuff->window,
XRT_WINDOW, client, DixWriteAccess);
if (result != Success)
return (result == BadValue) ? BadWindow : result;
return result;
FOR_NSCREENS_FORWARD(j) {
stuff->window = win->info[j].id;
@ -697,7 +697,7 @@ int PanoramiXFreePixmap(ClientPtr client)
result = dixLookupResourceByType((pointer *)&pix, stuff->id, XRT_PIXMAP,
client, DixDestroyAccess);
if (result != Success)
return (result == BadValue) ? BadPixmap : result;
return result;
FOR_NSCREENS_BACKWARD(j) {
stuff->id = pix->info[j].id;
@ -742,7 +742,7 @@ int PanoramiXCreateGC(ClientPtr client)
result = dixLookupResourceByType((pointer *)&tile, tmp, XRT_PIXMAP,
client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadPixmap : result;
return result;
}
}
if ((Mask)stuff->mask & GCStipple) {
@ -751,7 +751,7 @@ int PanoramiXCreateGC(ClientPtr client)
result = dixLookupResourceByType((pointer *)&stip, tmp, XRT_PIXMAP,
client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadPixmap : result;
return result;
}
}
if ((Mask)stuff->mask & GCClipMask) {
@ -760,7 +760,7 @@ int PanoramiXCreateGC(ClientPtr client)
result = dixLookupResourceByType((pointer *)&clip, tmp, XRT_PIXMAP,
client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadPixmap : result;
return result;
}
}
@ -813,7 +813,7 @@ int PanoramiXChangeGC(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadGC : result;
return result;
if ((Mask)stuff->mask & GCTile) {
tile_offset = Ones((Mask)stuff->mask & (GCTile - 1));
@ -821,7 +821,7 @@ int PanoramiXChangeGC(ClientPtr client)
result = dixLookupResourceByType((pointer *)&tile, tmp, XRT_PIXMAP,
client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadPixmap : result;
return result;
}
}
if ((Mask)stuff->mask & GCStipple) {
@ -830,7 +830,7 @@ int PanoramiXChangeGC(ClientPtr client)
result = dixLookupResourceByType((pointer *)&stip, tmp, XRT_PIXMAP,
client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadPixmap : result;
return result;
}
}
if ((Mask)stuff->mask & GCClipMask) {
@ -839,7 +839,7 @@ int PanoramiXChangeGC(ClientPtr client)
result = dixLookupResourceByType((pointer *)&clip, tmp, XRT_PIXMAP,
client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadPixmap : result;
return result;
}
}
@ -871,12 +871,12 @@ int PanoramiXCopyGC(ClientPtr client)
result = dixLookupResourceByType((pointer *)&srcGC, stuff->srcGC, XRT_GC,
client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadGC : result;
return result;
result = dixLookupResourceByType((pointer *)&dstGC, stuff->dstGC, XRT_GC,
client, DixWriteAccess);
if (result != Success)
return (result == BadValue) ? BadGC : result;
return result;
FOR_NSCREENS(j) {
stuff->srcGC = srcGC->info[j].id;
@ -900,7 +900,7 @@ int PanoramiXSetDashes(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixWriteAccess);
if (result != Success)
return (result == BadValue) ? BadGC : result;
return result;
FOR_NSCREENS_BACKWARD(j) {
stuff->gc = gc->info[j].id;
@ -923,7 +923,7 @@ int PanoramiXSetClipRectangles(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixWriteAccess);
if (result != Success)
return (result == BadValue) ? BadGC : result;
return result;
FOR_NSCREENS_BACKWARD(j) {
stuff->gc = gc->info[j].id;
@ -946,7 +946,7 @@ int PanoramiXFreeGC(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->id, XRT_GC,
client, DixDestroyAccess);
if (result != Success)
return (result == BadValue) ? BadGC : result;
return result;
FOR_NSCREENS_BACKWARD(j) {
stuff->id = gc->info[j].id;
@ -973,7 +973,7 @@ int PanoramiXClearToBackground(ClientPtr client)
result = dixLookupResourceByType((pointer *)&win, stuff->window,
XRT_WINDOW, client, DixWriteAccess);
if (result != Success)
return (result == BadValue) ? BadWindow : result;
return result;
x = stuff->x;
y = stuff->y;
@ -1033,7 +1033,7 @@ int PanoramiXCopyArea(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadGC : result;
return result;
if((dst->type == XRT_WINDOW) && dst->u.win.root)
dstIsRoot = TRUE;
@ -1188,7 +1188,7 @@ int PanoramiXCopyPlane(ClientPtr client)
rc = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixReadAccess);
if (rc != Success)
return (rc == BadValue) ? BadGC : rc;
return rc;
if((dst->type == XRT_WINDOW) && dst->u.win.root)
dstIsRoot = TRUE;
@ -1285,7 +1285,7 @@ int PanoramiXPolyPoint(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadGC : result;
return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
npoint = bytes_to_int32((client->req_len << 2) - sizeof(xPolyPointReq));
@ -1345,7 +1345,7 @@ int PanoramiXPolyLine(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadGC : result;
return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
npoint = bytes_to_int32((client->req_len << 2) - sizeof(xPolyLineReq));
@ -1405,7 +1405,7 @@ int PanoramiXPolySegment(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadGC : result;
return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1468,7 +1468,7 @@ int PanoramiXPolyRectangle(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadGC : result;
return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1530,7 +1530,7 @@ int PanoramiXPolyArc(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadGC : result;
return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1590,7 +1590,7 @@ int PanoramiXFillPoly(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadGC : result;
return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1651,7 +1651,7 @@ int PanoramiXPolyFillRectangle(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadGC : result;
return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1712,7 +1712,7 @@ int PanoramiXPolyFillArc(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadGC : result;
return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1772,7 +1772,7 @@ int PanoramiXPutImage(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadGC : result;
return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1973,7 +1973,7 @@ PanoramiXPolyText8(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadGC : result;
return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -2014,7 +2014,7 @@ PanoramiXPolyText16(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadGC : result;
return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -2055,7 +2055,7 @@ int PanoramiXImageText8(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadGC : result;
return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -2096,7 +2096,7 @@ int PanoramiXImageText16(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadGC : result;
return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -2128,7 +2128,7 @@ int PanoramiXCreateColormap(ClientPtr client)
result = dixLookupResourceByType((pointer *)&win, stuff->window,
XRT_WINDOW, client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadWindow : result;
return result;
if(!(newCmap = malloc(sizeof(PanoramiXRes))))
return BadAlloc;
@ -2169,7 +2169,7 @@ int PanoramiXFreeColormap(ClientPtr client)
result = dixLookupResourceByType((pointer *)&cmap, stuff->id, XRT_COLORMAP,
client, DixDestroyAccess);
if (result != Success)
return (result == BadValue) ? BadColor : result;
return result;
FOR_NSCREENS_BACKWARD(j) {
stuff->id = cmap->info[j].id;
@ -2199,7 +2199,7 @@ PanoramiXCopyColormapAndFree(ClientPtr client)
XRT_COLORMAP, client,
DixReadAccess | DixWriteAccess);
if (result != Success)
return (result == BadValue) ? BadColor : result;
return result;
if(!(newCmap = malloc(sizeof(PanoramiXRes))))
return BadAlloc;
@ -2238,7 +2238,7 @@ int PanoramiXInstallColormap(ClientPtr client)
result = dixLookupResourceByType((pointer *)&cmap, stuff->id, XRT_COLORMAP,
client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadColor : result;
return result;
FOR_NSCREENS_BACKWARD(j){
stuff->id = cmap->info[j].id;
@ -2262,7 +2262,7 @@ int PanoramiXUninstallColormap(ClientPtr client)
result = dixLookupResourceByType((pointer *)&cmap, stuff->id, XRT_COLORMAP,
client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadColor : result;
return result;
FOR_NSCREENS_BACKWARD(j) {
stuff->id = cmap->info[j].id;
@ -2286,7 +2286,7 @@ int PanoramiXAllocColor(ClientPtr client)
result = dixLookupResourceByType((pointer *)&cmap, stuff->cmap,
XRT_COLORMAP, client, DixWriteAccess);
if (result != Success)
return (result == BadValue) ? BadColor : result;
return result;
FOR_NSCREENS_BACKWARD(j){
stuff->cmap = cmap->info[j].id;
@ -2310,7 +2310,7 @@ int PanoramiXAllocNamedColor(ClientPtr client)
result = dixLookupResourceByType((pointer *)&cmap, stuff->cmap,
XRT_COLORMAP, client, DixWriteAccess);
if (result != Success)
return (result == BadValue) ? BadColor : result;
return result;
FOR_NSCREENS_BACKWARD(j){
stuff->cmap = cmap->info[j].id;
@ -2334,7 +2334,7 @@ int PanoramiXAllocColorCells(ClientPtr client)
result = dixLookupResourceByType((pointer *)&cmap, stuff->cmap,
XRT_COLORMAP, client, DixWriteAccess);
if (result != Success)
return (result == BadValue) ? BadColor : result;
return result;
FOR_NSCREENS_BACKWARD(j){
stuff->cmap = cmap->info[j].id;
@ -2358,7 +2358,7 @@ int PanoramiXAllocColorPlanes(ClientPtr client)
result = dixLookupResourceByType((pointer *)&cmap, stuff->cmap,
XRT_COLORMAP, client, DixWriteAccess);
if (result != Success)
return (result == BadValue) ? BadColor : result;
return result;
FOR_NSCREENS_BACKWARD(j){
stuff->cmap = cmap->info[j].id;
@ -2383,7 +2383,7 @@ int PanoramiXFreeColors(ClientPtr client)
result = dixLookupResourceByType((pointer *)&cmap, stuff->cmap,
XRT_COLORMAP, client, DixWriteAccess);
if (result != Success)
return (result == BadValue) ? BadColor : result;
return result;
FOR_NSCREENS_BACKWARD(j) {
stuff->cmap = cmap->info[j].id;
@ -2406,7 +2406,7 @@ int PanoramiXStoreColors(ClientPtr client)
result = dixLookupResourceByType((pointer *)&cmap, stuff->cmap,
XRT_COLORMAP, client, DixWriteAccess);
if (result != Success)
return (result == BadValue) ? BadColor : result;
return result;
FOR_NSCREENS_BACKWARD(j){
stuff->cmap = cmap->info[j].id;
@ -2430,7 +2430,7 @@ int PanoramiXStoreNamedColor(ClientPtr client)
result = dixLookupResourceByType((pointer *)&cmap, stuff->cmap,
XRT_COLORMAP, client, DixWriteAccess);
if (result != Success)
return (result == BadValue) ? BadColor : result;
return result;
FOR_NSCREENS_BACKWARD(j){
stuff->cmap = cmap->info[j].id;

View File

@ -1272,7 +1272,7 @@ ProcScreenSaverSetAttributes (ClientPtr client)
XRT_PIXMAP, client,
DixReadAccess);
if (status != Success)
return (status == BadValue) ? BadPixmap : status;
return status;
}
}
@ -1284,7 +1284,7 @@ ProcScreenSaverSetAttributes (ClientPtr client)
XRT_PIXMAP, client,
DixReadAccess);
if (status != Success)
return (status == BadValue) ? BadPixmap : status;
return status;
}
}
@ -1296,7 +1296,7 @@ ProcScreenSaverSetAttributes (ClientPtr client)
XRT_COLORMAP, client,
DixReadAccess);
if (status != Success)
return (status == BadValue) ? BadColor : status;
return status;
}
}

View File

@ -623,8 +623,7 @@ ProcSecurityRevokeAuthorization(
SecurityAuthorizationResType, client,
DixDestroyAccess);
if (rc != Success)
return (rc == BadValue) ?
SecurityErrorBase + XSecurityBadAuthorization : rc;
return rc;
FreeResource(stuff->authId, RT_NONE);
return Success;
@ -1140,6 +1139,8 @@ SecurityExtensionInit(INITARGS)
EventSwapVector[SecurityEventBase + XSecurityAuthorizationRevoked] =
(EventSwapPtr)SwapSecurityAuthorizationRevokedEvent;
SetResourceTypeErrorValue(SecurityAuthorizationResType, SecurityErrorBase + XSecurityBadAuthorization);
/* Label objects that were created before we could register ourself */
SecurityLabelInitial();
}

View File

@ -360,7 +360,7 @@ ProcPanoramiXShapeRectangles(
result = dixLookupResourceByType((pointer *)&win, stuff->dest, XRT_WINDOW,
client, DixWriteAccess);
if (result != Success)
return (result == BadValue) ? BadWindow : result;
return result;
FOR_NSCREENS(j) {
stuff->dest = win->info[j].id;
@ -459,13 +459,13 @@ ProcPanoramiXShapeMask(
result = dixLookupResourceByType((pointer *)&win, stuff->dest, XRT_WINDOW,
client, DixWriteAccess);
if (result != Success)
return (result == BadValue) ? BadWindow : result;
return result;
if(stuff->src != None) {
result = dixLookupResourceByType((pointer *)&pmap, stuff->src,
XRT_PIXMAP, client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadPixmap : result;
return result;
} else
pmap = NULL;
@ -589,12 +589,12 @@ ProcPanoramiXShapeCombine(
result = dixLookupResourceByType((pointer *)&win, stuff->dest, XRT_WINDOW,
client, DixWriteAccess);
if (result != Success)
return (result == BadValue) ? BadWindow : result;
return result;
result = dixLookupResourceByType((pointer *)&win2, stuff->src, XRT_WINDOW,
client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadWindow : result;
return result;
FOR_NSCREENS(j) {
stuff->dest = win->info[j].id;
@ -663,7 +663,7 @@ ProcPanoramiXShapeOffset(
result = dixLookupResourceByType((pointer *)&win, stuff->dest, XRT_WINDOW,
client, DixWriteAccess);
if (result != Success)
return (result == BadValue) ? BadWindow : result;
return result;
FOR_NSCREENS(j) {
stuff->dest = win->info[j].id;

View File

@ -156,7 +156,7 @@ static ShmFuncs fbFuncs = {fbShmCreatePixmap, NULL};
rc = dixLookupResourceByType((pointer *)&(shmdesc), shmseg, ShmSegType, \
client, DixReadAccess); \
if (rc != Success) \
return (rc == BadValue) ? BadShmSegCode : rc; \
return rc; \
}
#define VERIFY_SHMPTR(shmseg,offset,needwrite,shmdesc,client) \
@ -286,6 +286,7 @@ ShmExtensionInit(INITARGS)
ShmReqCode = (unsigned char)extEntry->base;
ShmCompletionCode = extEntry->eventBase;
BadShmSegCode = extEntry->errorBase;
SetResourceTypeErrorValue(ShmSegType, BadShmSegCode);
EventSwapVector[ShmCompletionCode] = (EventSwapPtr) SShmCompletionEvent;
}
}
@ -584,7 +585,7 @@ ProcPanoramiXShmPutImage(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc,
XRT_GC, client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadGC : result;
return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;

View File

@ -264,7 +264,7 @@ SyncInitTrigger(ClientPtr client, SyncTrigger *pTrigger, XSyncCounter counter,
counter, RTCounter, client, DixReadAccess)))
{
client->errorValue = counter;
return (rc == BadValue) ? SyncErrorBase + XSyncBadCounter : rc;
return rc;
}
if (pCounter != pTrigger->pCounter)
{ /* new counter for trigger */
@ -1328,7 +1328,7 @@ ProcSyncSetCounter(ClientPtr client)
rc = dixLookupResourceByType((pointer *)&pCounter, stuff->cid, RTCounter,
client, DixWriteAccess);
if (rc != Success)
return (rc == BadValue) ? SyncErrorBase + XSyncBadCounter : rc;
return rc;
if (IsSystemCounter(pCounter))
{
@ -1358,7 +1358,7 @@ ProcSyncChangeCounter(ClientPtr client)
rc = dixLookupResourceByType((pointer *)&pCounter, stuff->cid, RTCounter,
client, DixWriteAccess);
if (rc != Success)
return (rc == BadValue) ? SyncErrorBase + XSyncBadCounter : rc;
return rc;
if (IsSystemCounter(pCounter))
{
@ -1393,7 +1393,7 @@ ProcSyncDestroyCounter(ClientPtr client)
rc = dixLookupResourceByType((pointer *)&pCounter, stuff->counter, RTCounter,
client, DixDestroyAccess);
if (rc != Success)
return (rc == BadValue) ? SyncErrorBase + XSyncBadCounter : rc;
return rc;
if (IsSystemCounter(pCounter))
{
@ -1536,7 +1536,7 @@ ProcSyncQueryCounter(ClientPtr client)
rc = dixLookupResourceByType((pointer *)&pCounter, stuff->counter,
RTCounter, client, DixReadAccess);
if (rc != Success)
return (rc == BadValue) ? SyncErrorBase + XSyncBadCounter : rc;
return rc;
rep.type = X_Reply;
rep.length = 0;
@ -1660,7 +1660,7 @@ ProcSyncChangeAlarm(ClientPtr client)
status = dixLookupResourceByType((pointer *)&pAlarm, stuff->alarm, RTAlarm,
client, DixWriteAccess);
if (status != Success)
return (status == BadValue) ? SyncErrorBase + XSyncBadAlarm : status;
return status;
vmask = stuff->valueMask;
len = client->req_len - bytes_to_int32(sizeof(xSyncChangeAlarmReq));
@ -1699,7 +1699,7 @@ ProcSyncQueryAlarm(ClientPtr client)
rc = dixLookupResourceByType((pointer *)&pAlarm, stuff->alarm, RTAlarm,
client, DixReadAccess);
if (rc != Success)
return (rc == BadValue) ? SyncErrorBase + XSyncBadAlarm : rc;
return rc;
rep.type = X_Reply;
rep.length = bytes_to_int32(sizeof(xSyncQueryAlarmReply) - sizeof(xGenericReply));
@ -1756,7 +1756,7 @@ ProcSyncDestroyAlarm(ClientPtr client)
rc = dixLookupResourceByType((pointer *)&pAlarm, stuff->alarm, RTAlarm,
client, DixDestroyAccess);
if (rc != Success)
return (rc == BadValue) ? SyncErrorBase + XSyncBadAlarm : rc;
return rc;
FreeResource(stuff->alarm, RT_NONE);
return Success;
@ -2127,6 +2127,9 @@ SyncExtensionInit(void)
EventSwapVector[SyncEventBase + XSyncCounterNotify] = (EventSwapPtr) SCounterNotifyEvent;
EventSwapVector[SyncEventBase + XSyncAlarmNotify] = (EventSwapPtr) SAlarmNotifyEvent;
SetResourceTypeErrorValue(RTCounter, SyncErrorBase + XSyncBadCounter);
SetResourceTypeErrorValue(RTAlarm, SyncErrorBase + XSyncBadAlarm);
/*
* Although SERVERTIME is implemented by the OS layer, we initialise it
* here because doing it in OsInit() is too early. The resource database

View File

@ -1025,7 +1025,6 @@ typedef struct _ShmDesc {
} ShmDescRec, *ShmDescPtr;
extern RESTYPE ShmSegType;
extern int BadShmSegCode;
extern int ShmCompletionCode;
static int
@ -1077,7 +1076,7 @@ ProcXvShmPutImage(ClientPtr client)
status = dixLookupResourceByType((pointer *)&shmdesc, stuff->shmseg,
ShmSegType, serverClient, DixReadAccess);
if (status != Success)
return (status == BadValue) ? BadShmSegCode : status;
return status;
width = stuff->width;
height = stuff->height;
@ -1615,7 +1614,7 @@ XineramaXvStopVideo(ClientPtr client)
result = dixLookupResourceByType((pointer *)&port, stuff->port,
XvXRTPort, client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? _XvBadPort : result;
return result;
FOR_NSCREENS_BACKWARD(i) {
if(port->info[i].id) {
@ -1640,7 +1639,7 @@ XineramaXvSetPortAttribute(ClientPtr client)
result = dixLookupResourceByType((pointer *)&port, stuff->port,
XvXRTPort, client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? _XvBadPort : result;
return result;
FOR_NSCREENS_BACKWARD(i) {
if(port->info[i].id) {
@ -1671,12 +1670,12 @@ XineramaXvShmPutImage(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc,
XRT_GC, client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadGC : result;
return result;
result = dixLookupResourceByType((pointer *)&port, stuff->port,
XvXRTPort, client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? _XvBadPort : result;
return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1723,12 +1722,12 @@ XineramaXvPutImage(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc,
XRT_GC, client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadGC : result;
return result;
result = dixLookupResourceByType((pointer *)&port, stuff->port,
XvXRTPort, client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? _XvBadPort : result;
return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1771,12 +1770,12 @@ XineramaXvPutVideo(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc,
XRT_GC, client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadGC : result;
return result;
result = dixLookupResourceByType((pointer *)&port, stuff->port,
XvXRTPort, client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? _XvBadPort : result;
return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1819,12 +1818,12 @@ XineramaXvPutStill(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc,
XRT_GC, client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? BadGC : result;
return result;
result = dixLookupResourceByType((pointer *)&port, stuff->port,
XvXRTPort, client, DixReadAccess);
if (result != Success)
return (result == BadValue) ? _XvBadPort : result;
return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1910,6 +1909,7 @@ void XineramifyXv(void)
XvXRTPort = CreateNewResourceType(XineramaDeleteResource, "XvXRTPort");
if (!xvsp0 || !XvXRTPort) return;
SetResourceTypeErrorValue(XvXRTPort, _XvBadPort);
for(i = 0; i < xvsp0->nAdaptors; i++) {
Bool isOverlay;

View File

@ -206,7 +206,7 @@ typedef struct _XvPortRec {
int rc = dixLookupResourceByType((pointer *)&(pPort), portID,\
XvRTPort, client, mode);\
if (rc != Success)\
return (rc == BadValue) ? _XvBadPort : rc;\
return rc;\
}
typedef struct {

View File

@ -192,6 +192,7 @@ XvExtensionInit(void)
EventSwapVector[XvEventBase+XvPortNotify] =
(EventSwapPtr)WriteSwappedPortNotifyEvent;
SetResourceTypeErrorValue(XvRTPort, _XvBadPort);
(void)MakeAtom(XvName, strlen(XvName), xTrue);
}

View File

@ -40,7 +40,6 @@ unsigned long XvMCGeneration = 0;
int XvMCReqCode;
int XvMCEventBase;
int XvMCErrorBase;
unsigned long XvMCRTContext;
unsigned long XvMCRTSurface;
@ -276,7 +275,7 @@ ProcXvMCDestroyContext(ClientPtr client)
rc = dixLookupResourceByType(&val, stuff->context_id, XvMCRTContext,
client, DixDestroyAccess);
if (rc != Success)
return (rc == BadValue) ? XvMCBadContext + XvMCErrorBase : rc;
return rc;
FreeResource(stuff->context_id, RT_NONE);
@ -299,7 +298,7 @@ ProcXvMCCreateSurface(ClientPtr client)
result = dixLookupResourceByType((pointer *)&pContext, stuff->context_id,
XvMCRTContext, client, DixUseAccess);
if (result != Success)
return (result == BadValue) ? XvMCBadContext + XvMCErrorBase : result;
return result;
pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen);
@ -346,7 +345,7 @@ ProcXvMCDestroySurface(ClientPtr client)
rc = dixLookupResourceByType(&val, stuff->surface_id, XvMCRTSurface,
client, DixDestroyAccess);
if (rc != Success)
return (rc == BadValue) ? XvMCBadSurface + XvMCErrorBase : rc;
return rc;
FreeResource(stuff->surface_id, RT_NONE);
@ -371,7 +370,7 @@ ProcXvMCCreateSubpicture(ClientPtr client)
result = dixLookupResourceByType((pointer *)&pContext, stuff->context_id,
XvMCRTContext, client, DixUseAccess);
if (result != Success)
return (result == BadValue) ? XvMCBadContext + XvMCErrorBase : result;
return result;
pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen);
@ -463,7 +462,7 @@ ProcXvMCDestroySubpicture(ClientPtr client)
rc = dixLookupResourceByType(&val, stuff->subpicture_id, XvMCRTSubpicture,
client, DixDestroyAccess);
if (rc != Success)
return (rc == BadValue) ? XvMCBadSubpicture + XvMCErrorBase : rc;
return rc;
FreeResource(stuff->subpicture_id, RT_NONE);
@ -694,7 +693,9 @@ XvMCExtensionInit(void)
XvMCReqCode = extEntry->base;
XvMCEventBase = extEntry->eventBase;
XvMCErrorBase = extEntry->errorBase;
SetResourceTypeErrorValue(XvMCRTContext, extEntry->errorBase + XvMCBadContext);
SetResourceTypeErrorValue(XvMCRTSurface, extEntry->errorBase + XvMCBadSurface);
SetResourceTypeErrorValue(XvMCRTSubpicture, extEntry->errorBase + XvMCBadSubpicture);
}
static Bool

View File

@ -29,7 +29,6 @@
static unsigned char DamageReqCode;
static int DamageEventBase;
static int DamageErrorBase;
static RESTYPE DamageExtType;
static RESTYPE DamageExtWinType;
@ -515,8 +514,8 @@ DamageExtensionInit(void)
{
DamageReqCode = (unsigned char)extEntry->base;
DamageEventBase = extEntry->eventBase;
DamageErrorBase = extEntry->errorBase;
EventSwapVector[DamageEventBase + XDamageNotify] =
(EventSwapPtr) SDamageNotifyEvent;
SetResourceTypeErrorValue(DamageExtType, extEntry->errorBase + BadDamage);
}
}

View File

@ -62,7 +62,7 @@ typedef struct _DamageExt {
int rc = dixLookupResourceByType((pointer *)&(pDamageExt), rid, \
DamageExtType, client, mode); \
if (rc != Success) \
return (rc == BadValue) ? DamageErrorBase + BadDamage : rc; \
return rc; \
}
void

View File

@ -422,12 +422,12 @@ ProcDbeDeallocateBackBufferName(ClientPtr client)
dbeWindowPrivResType, client,
DixDestroyAccess);
if (rc != Success)
return (rc == BadValue) ? dbeErrorBase + DbeBadBuffer : rc;
return rc;
rc = dixLookupResourceByType(&val, stuff->buffer, dbeDrawableResType,
client, DixDestroyAccess);
if (rc != Success)
return (rc == BadValue) ? dbeErrorBase + DbeBadBuffer : rc;
return rc;
/* Make sure that the id is valid for the window.
* This is paranoid code since we already looked up the ID by type
@ -1672,6 +1672,8 @@ DbeExtensionInit(void)
DbeResetProc, StandardMinorOpcode);
dbeErrorBase = extEntry->errorBase;
SetResourceTypeErrorValue(dbeWindowPrivResType, dbeErrorBase + DbeBadBuffer);
SetResourceTypeErrorValue(dbeDrawableResType, dbeErrorBase + DbeBadBuffer);
} /* DbeExtensionInit() */

View File

@ -268,6 +268,12 @@ CreateNewResourceType(DeleteType deleteFunc, char *name)
return next;
}
void
SetResourceTypeErrorValue(RESTYPE type, int errorValue)
{
resourceTypes[type & TypeMask].errorValue = errorValue;
}
RESTYPE
CreateNewResourceClass(void)
{

View File

@ -157,6 +157,9 @@ typedef Bool (*FindComplexResType)(
extern _X_EXPORT RESTYPE CreateNewResourceType(
DeleteType /*deleteFunc*/, char * /*name*/);
extern _X_EXPORT void SetResourceTypeErrorValue(
RESTYPE /*type*/, int /*errorValue*/);
extern _X_EXPORT RESTYPE CreateNewResourceClass(void);
extern _X_EXPORT Bool InitClientResources(

View File

@ -344,7 +344,7 @@ extern _X_EXPORT RESTYPE RRCrtcType, RRModeType, RROutputType;
RROutputType, client, a);\
if (rc != Success) {\
client->errorValue = id;\
return (rc == BadValue) ? RRErrorBase + BadRROutput : rc;\
return rc;\
}\
}
@ -354,7 +354,7 @@ extern _X_EXPORT RESTYPE RRCrtcType, RRModeType, RROutputType;
RRCrtcType, client, a);\
if (rc != Success) {\
client->errorValue = id;\
return (rc == BadValue) ? RRErrorBase + BadRRCrtc : rc;\
return rc;\
}\
}
@ -364,7 +364,7 @@ extern _X_EXPORT RESTYPE RRCrtcType, RRModeType, RROutputType;
RRModeType, client, a);\
if (rc != Success) {\
client->errorValue = id;\
return (rc == BadValue) ? RRErrorBase + BadRRMode : rc;\
return rc;\
}\
}

View File

@ -634,6 +634,7 @@ RRCrtcInit (void)
RRCrtcType = CreateNewResourceType (RRCrtcDestroyResource, "CRTC");
if (!RRCrtcType)
return FALSE;
SetResourceTypeErrorValue(RRCrtcType, RRErrorBase + BadRRCrtc);
return TRUE;
}
@ -806,7 +807,7 @@ ProcRRSetCrtcConfig (ClientPtr client)
{
if (outputs)
free(outputs);
return (rc == BadValue) ? RRErrorBase + BadRROutput : rc;
return rc;
}
/* validate crtc for this output */
for (j = 0; j < outputs[i]->numCrtcs; j++)

View File

@ -268,6 +268,7 @@ RRModeInit (void)
RRModeType = CreateNewResourceType (RRModeDestroyResource, "MODE");
if (!RRModeType)
return FALSE;
SetResourceTypeErrorValue(RRModeType, RRErrorBase + BadRRMode);
return TRUE;
}

View File

@ -423,6 +423,7 @@ RROutputInit (void)
RROutputType = CreateNewResourceType (RROutputDestroyResource, "OUTPUT");
if (!RROutputType)
return FALSE;
SetResourceTypeErrorValue(RROutputType, RRErrorBase + BadRROutput);
return TRUE;
}

View File

@ -58,7 +58,6 @@ and Jim Haggerty of Metheus.
#include "protocol-versions.h"
static RESTYPE RTContext; /* internal resource type for Record contexts */
static int RecordErrorBase; /* first Record error number */
/* How many bytes of protocol data to buffer in a context. Don't set to less
* than 32.
@ -133,7 +132,7 @@ static int numEnabledRCAPs;
int rc = dixLookupResourceByType((pointer *)&(_pContext), _contextid, \
RTContext, _client, DixUseAccess); \
if (rc != Success) \
return (rc == BadValue) ? RecordErrorBase + XRecordBadContext : rc; \
return rc; \
}
static int RecordDeleteContext(
@ -2911,7 +2910,7 @@ RecordExtensionInit(void)
DeleteCallback(&ClientStateCallback, RecordAClientStateChange, NULL);
return;
}
RecordErrorBase = extentry->errorBase;
SetResourceTypeErrorValue(RTContext, extentry->errorBase + XRecordBadContext);
} /* RecordExtensionInit */

View File

@ -1115,7 +1115,6 @@ ChangePicture (PicturePtr pPicture,
if (error != Success)
{
client->errorValue = pid;
error = (error == BadValue) ? RenderErrBase + BadPicture : error;
break;
}
if (pAlpha->pDrawable == NULL ||

View File

@ -412,7 +412,7 @@ extern _X_EXPORT RESTYPE GlyphSetType;
int rc = dixLookupResourceByType((pointer)&(pPicture), pid,\
PictureType, client, mode);\
if (rc != Success)\
return (rc == BadValue) ? RenderErrBase + BadPicture : rc;\
return rc;\
}
#define VERIFY_ALPHA(pPicture, pid, client, mode) {\

View File

@ -233,6 +233,10 @@ RenderClientCallback (CallbackListPtr *list,
pRenderClient->minor_version = 0;
}
#ifdef PANORAMIX
unsigned long XRT_PICTURE;
#endif
void
RenderExtensionInit (void)
{
@ -253,6 +257,13 @@ RenderExtensionInit (void)
if (!extEntry)
return;
RenderErrBase = extEntry->errorBase;
#ifdef PANORAMIX
if (XRT_PICTURE)
SetResourceTypeErrorValue(XRT_PICTURE, RenderErrBase + BadPicture);
#endif
SetResourceTypeErrorValue(PictureType, RenderErrBase + BadPicture);
SetResourceTypeErrorValue(PictFormatType, RenderErrBase + BadPictFormat);
SetResourceTypeErrorValue(GlyphSetType, RenderErrBase + BadGlyphSet);
}
static int
@ -532,7 +543,7 @@ ProcRenderQueryPictIndexValues (ClientPtr client)
rc = dixLookupResourceByType((pointer *)&pFormat, stuff->format,
PictFormatType, client, DixReadAccess);
if (rc != Success)
return (rc == BadValue) ? RenderErrBase + BadPictFormat : rc;
return rc;
if (pFormat->type != PictTypeIndexed)
{
@ -601,7 +612,7 @@ ProcRenderCreatePicture (ClientPtr client)
rc = dixLookupResourceByType((pointer *)&pFormat, stuff->format,
PictFormatType, client, DixReadAccess);
if (rc != Success)
return (rc == BadValue) ? RenderErrBase + BadPictFormat : rc;
return rc;
if (pFormat->depth != pDrawable->depth)
return BadMatch;
@ -755,7 +766,7 @@ ProcRenderTrapezoids (ClientPtr client)
rc = dixLookupResourceByType((pointer *)&pFormat, stuff->maskFormat,
PictFormatType, client, DixReadAccess);
if (rc != Success)
return (rc == BadValue) ? RenderErrBase + BadPictFormat : rc;
return rc;
}
else
pFormat = 0;
@ -795,7 +806,7 @@ ProcRenderTriangles (ClientPtr client)
rc = dixLookupResourceByType((pointer *)&pFormat, stuff->maskFormat,
PictFormatType, client, DixReadAccess);
if (rc != Success)
return (rc == BadValue) ? RenderErrBase + BadPictFormat : rc;
return rc;
}
else
pFormat = 0;
@ -835,7 +846,7 @@ ProcRenderTriStrip (ClientPtr client)
rc = dixLookupResourceByType((pointer *)&pFormat, stuff->maskFormat,
PictFormatType, client, DixReadAccess);
if (rc != Success)
return (rc == BadValue) ? RenderErrBase + BadPictFormat : rc;
return rc;
}
else
pFormat = 0;
@ -875,7 +886,7 @@ ProcRenderTriFan (ClientPtr client)
rc = dixLookupResourceByType((pointer *)&pFormat, stuff->maskFormat,
PictFormatType, client, DixReadAccess);
if (rc != Success)
return (rc == BadValue) ? RenderErrBase + BadPictFormat : rc;
return rc;
}
else
pFormat = 0;
@ -922,7 +933,7 @@ ProcRenderCreateGlyphSet (ClientPtr client)
rc = dixLookupResourceByType((pointer *)&format, stuff->format,
PictFormatType, client, DixReadAccess);
if (rc != Success)
return (rc == BadValue) ? RenderErrBase + BadPictFormat : rc;
return rc;
switch (format->depth) {
case 1:
@ -974,7 +985,7 @@ ProcRenderReferenceGlyphSet (ClientPtr client)
if (rc != Success)
{
client->errorValue = stuff->existing;
return (rc == BadValue) ? RenderErrBase + BadGlyphSet : rc;
return rc;
}
glyphSet->refcnt++;
if (!AddResource (stuff->gsid, GlyphSetType, (pointer)glyphSet))
@ -998,7 +1009,7 @@ ProcRenderFreeGlyphSet (ClientPtr client)
if (rc != Success)
{
client->errorValue = stuff->glyphset;
return (rc == BadValue) ? RenderErrBase + BadGlyphSet : rc;
return rc;
}
FreeResource (stuff->glyphset, RT_NONE);
return Success;
@ -1037,7 +1048,7 @@ ProcRenderAddGlyphs (ClientPtr client)
if (err != Success)
{
client->errorValue = stuff->glyphset;
return (err == BadValue) ? RenderErrBase + BadGlyphSet : err;
return err;
}
err = BadAlloc;
@ -1238,7 +1249,7 @@ ProcRenderFreeGlyphs (ClientPtr client)
if (rc != Success)
{
client->errorValue = stuff->glyphset;
return (rc == BadValue) ? RenderErrBase + BadGlyphSet : rc;
return rc;
}
nglyph = bytes_to_int32((client->req_len << 2) - sizeof (xRenderFreeGlyphsReq));
gids = (CARD32 *) (stuff + 1);
@ -1300,7 +1311,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
rc = dixLookupResourceByType((pointer *)&pFormat, stuff->maskFormat,
PictFormatType, client, DixReadAccess);
if (rc != Success)
return (rc == BadValue) ? RenderErrBase + BadPictFormat : rc;
return rc;
}
else
pFormat = 0;
@ -1308,7 +1319,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
rc = dixLookupResourceByType((pointer *)&glyphSet, stuff->glyphset,
GlyphSetType, client, DixUseAccess);
if (rc != Success)
return (rc == BadValue) ? RenderErrBase + BadGlyphSet : rc;
return rc;
buffer = (CARD8 *) (stuff + 1);
end = (CARD8 *) stuff + (client->req_len << 2);
@ -1371,7 +1382,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
free(glyphsBase);
if (listsBase != listsLocal)
free(listsBase);
return (rc == BadValue) ? RenderErrBase + BadGlyphSet : rc;
return rc;
}
}
buffer += 4;
@ -2639,7 +2650,7 @@ SProcRenderDispatch (ClientPtr client)
int rc = dixLookupResourceByType((pointer *)&(pPicture), pid,\
XRT_PICTURE, client, mode);\
if (rc != Success)\
return (rc == BadValue) ? RenderErrBase + BadPicture : rc;\
return rc;\
}
#define VERIFY_XIN_ALPHA(pPicture, pid, client, mode) {\
@ -2652,8 +2663,6 @@ SProcRenderDispatch (ClientPtr client)
int (*PanoramiXSaveRenderVector[RenderNumberRequests])(ClientPtr);
unsigned long XRT_PICTURE;
static int
PanoramiXRenderCreatePicture (ClientPtr client)
{
@ -3330,6 +3339,8 @@ PanoramiXRenderInit (void)
XRT_PICTURE = CreateNewResourceType (XineramaDeleteResource,
"XineramaPicture");
if (RenderErrBase)
SetResourceTypeErrorValue(XRT_PICTURE, RenderErrBase + BadPicture);
for (i = 0; i < RenderNumberRequests; i++)
PanoramiXSaveRenderVector[i] = ProcRenderVector[i];
/*
@ -3365,6 +3376,7 @@ PanoramiXRenderReset (void)
int i;
for (i = 0; i < RenderNumberRequests; i++)
ProcRenderVector[i] = PanoramiXSaveRenderVector[i];
RenderErrBase = 0;
}
#endif /* PANORAMIX */

View File

@ -259,5 +259,6 @@ XFixesExtensionInit(void)
(EventSwapPtr) SXFixesSelectionNotifyEvent;
EventSwapVector[XFixesEventBase + XFixesCursorNotify] =
(EventSwapPtr) SXFixesCursorNotifyEvent;
SetResourceTypeErrorValue(RegionResType, XFixesErrorBase + BadRegion);
}
}

View File

@ -37,10 +37,7 @@ extern _X_EXPORT int XFixesErrorBase;
int err; \
err = dixLookupResourceByType((pointer *) &pRegion, rid, \
RegionResType, client, mode); \
if (err == BadValue) { \
client->errorValue = rid; \
return XFixesErrorBase + BadRegion; \
} else if (err != Success) { \
if (err != Success) { \
client->errorValue = rid; \
return err; \
} \