mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-01 22:03:09 +00:00
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:
parent
e291c56182
commit
c38552d115
26 changed files with 169 additions and 137 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue