prevent name clash on Windows w/ RT_* defines
Windows' native headers using some our RT_* define's names for other things. Since the naming isn't very nice anyways, introducing some new ones (X11_RESTYPE_NONE, X11_RESTYPE_FONT, X11_RESTYPE_CURSOR) and define the old ones as an alias to them, in case some out-of-tree code still uses them. With thins change, we don't need to be so extremely careful about include ordering and have explicit #undef's in order to prevent name clashes on Win32 targets. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1355>
This commit is contained in:
parent
f789dca4e9
commit
232cad9ec3
|
@ -163,7 +163,7 @@ ProcDPMSSelectInput(register ClientPtr client)
|
||||||
pHead = (DPMSEventPtr *)malloc(sizeof(DPMSEventPtr));
|
pHead = (DPMSEventPtr *)malloc(sizeof(DPMSEventPtr));
|
||||||
if (!pHead ||
|
if (!pHead ||
|
||||||
!AddResource(eventResource, DPMSEventType, (void *)pHead)) {
|
!AddResource(eventResource, DPMSEventType, (void *)pHead)) {
|
||||||
FreeResource(clientResource, RT_NONE);
|
FreeResource(clientResource, X11_RESTYPE_NONE);
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
*pHead = 0;
|
*pHead = 0;
|
||||||
|
|
10
Xext/saver.c
10
Xext/saver.c
|
@ -475,7 +475,7 @@ CreateSaverWindow(ScreenPtr pScreen)
|
||||||
pSaver = &pScreen->screensaver;
|
pSaver = &pScreen->screensaver;
|
||||||
if (pSaver->pWindow) {
|
if (pSaver->pWindow) {
|
||||||
pSaver->pWindow = NullWindow;
|
pSaver->pWindow = NullWindow;
|
||||||
FreeResource(pSaver->wid, RT_NONE);
|
FreeResource(pSaver->wid, X11_RESTYPE_NONE);
|
||||||
if (pPriv) {
|
if (pPriv) {
|
||||||
UninstallSaverColormap(pScreen);
|
UninstallSaverColormap(pScreen);
|
||||||
pPriv->hasWindow = FALSE;
|
pPriv->hasWindow = FALSE;
|
||||||
|
@ -519,7 +519,7 @@ CreateSaverWindow(ScreenPtr pScreen)
|
||||||
CursorPtr cursor;
|
CursorPtr cursor;
|
||||||
if (!pWin->optional)
|
if (!pWin->optional)
|
||||||
if (!MakeWindowOptional(pWin)) {
|
if (!MakeWindowOptional(pWin)) {
|
||||||
FreeResource(pWin->drawable.id, RT_NONE);
|
FreeResource(pWin->drawable.id, X11_RESTYPE_NONE);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
cursor = RefCursor(pAttr->pCursor);
|
cursor = RefCursor(pAttr->pCursor);
|
||||||
|
@ -571,7 +571,7 @@ DestroySaverWindow(ScreenPtr pScreen)
|
||||||
pSaver = &pScreen->screensaver;
|
pSaver = &pScreen->screensaver;
|
||||||
if (pSaver->pWindow) {
|
if (pSaver->pWindow) {
|
||||||
pSaver->pWindow = NullWindow;
|
pSaver->pWindow = NullWindow;
|
||||||
FreeResource(pSaver->wid, RT_NONE);
|
FreeResource(pSaver->wid, X11_RESTYPE_NONE);
|
||||||
}
|
}
|
||||||
pPriv->hasWindow = FALSE;
|
pPriv->hasWindow = FALSE;
|
||||||
CheckScreenPrivate(pScreen);
|
CheckScreenPrivate(pScreen);
|
||||||
|
@ -1035,7 +1035,7 @@ ScreenSaverSetAttributes(ClientPtr client)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ret = dixLookupResourceByType((void **) &pCursor, cursorID,
|
ret = dixLookupResourceByType((void **) &pCursor, cursorID,
|
||||||
RT_CURSOR, client, DixUseAccess);
|
X11_RESTYPE_CURSOR, client, DixUseAccess);
|
||||||
if (ret != Success) {
|
if (ret != Success) {
|
||||||
client->errorValue = cursorID;
|
client->errorValue = cursorID;
|
||||||
goto PatchUp;
|
goto PatchUp;
|
||||||
|
@ -1232,7 +1232,7 @@ ProcScreenSaverSuspend(ClientPtr client)
|
||||||
if (suspend == TRUE)
|
if (suspend == TRUE)
|
||||||
this->count++;
|
this->count++;
|
||||||
else if (--this->count == 0)
|
else if (--this->count == 0)
|
||||||
FreeResource(this->clientResource, RT_NONE);
|
FreeResource(this->clientResource, X11_RESTYPE_NONE);
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
|
@ -202,7 +202,7 @@ SecurityDeleteAuthorization(void *value, XID id)
|
||||||
.authId = pAuth->id
|
.authId = pAuth->id
|
||||||
};
|
};
|
||||||
WriteEventsToClient(rClient(pEventClient), 1, (xEvent *) &are);
|
WriteEventsToClient(rClient(pEventClient), 1, (xEvent *) &are);
|
||||||
FreeResource(pEventClient->resource, RT_NONE);
|
FreeResource(pEventClient->resource, X11_RESTYPE_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* kill all clients using this auth */
|
/* kill all clients using this auth */
|
||||||
|
@ -308,7 +308,7 @@ SecurityAuthorizationExpired(OsTimerPtr timer, CARD32 time, void *pval)
|
||||||
pAuth->secondsRemaining);
|
pAuth->secondsRemaining);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
FreeResource(pAuth->id, RT_NONE);
|
FreeResource(pAuth->id, X11_RESTYPE_NONE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
} /* SecurityAuthorizationExpired */
|
} /* SecurityAuthorizationExpired */
|
||||||
|
@ -372,7 +372,7 @@ SecurityEventSelectForAuthorization(SecurityAuthorizationPtr pAuth,
|
||||||
pEventClient; pEventClient = pEventClient->next) {
|
pEventClient; pEventClient = pEventClient->next) {
|
||||||
if (SameClient(pEventClient, client)) {
|
if (SameClient(pEventClient, client)) {
|
||||||
if (mask == 0)
|
if (mask == 0)
|
||||||
FreeResource(pEventClient->resource, RT_NONE);
|
FreeResource(pEventClient->resource, X11_RESTYPE_NONE);
|
||||||
else
|
else
|
||||||
pEventClient->mask = mask;
|
pEventClient->mask = mask;
|
||||||
return Success;
|
return Success;
|
||||||
|
@ -584,7 +584,7 @@ ProcSecurityRevokeAuthorization(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
FreeResource(stuff->authId, RT_NONE);
|
FreeResource(stuff->authId, X11_RESTYPE_NONE);
|
||||||
return Success;
|
return Success;
|
||||||
} /* ProcSecurityRevokeAuthorization */
|
} /* ProcSecurityRevokeAuthorization */
|
||||||
|
|
||||||
|
|
|
@ -786,7 +786,7 @@ ProcShapeSelectInput(ClientPtr client)
|
||||||
if (!pHead ||
|
if (!pHead ||
|
||||||
!AddResource(pWin->drawable.id, ShapeEventType,
|
!AddResource(pWin->drawable.id, ShapeEventType,
|
||||||
(void *) pHead)) {
|
(void *) pHead)) {
|
||||||
FreeResource(clientResource, RT_NONE);
|
FreeResource(clientResource, X11_RESTYPE_NONE);
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
*pHead = 0;
|
*pHead = 0;
|
||||||
|
|
12
Xext/shm.c
12
Xext/shm.c
|
@ -464,7 +464,7 @@ ProcShmDetach(ClientPtr client)
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xShmDetachReq);
|
REQUEST_SIZE_MATCH(xShmDetachReq);
|
||||||
VERIFY_SHMSEG(stuff->shmseg, shmdesc, client);
|
VERIFY_SHMSEG(stuff->shmseg, shmdesc, client);
|
||||||
FreeResource(stuff->shmseg, RT_NONE);
|
FreeResource(stuff->shmseg, X11_RESTYPE_NONE);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1002,7 +1002,7 @@ ProcPanoramiXShmCreatePixmap(ClientPtr client)
|
||||||
|
|
||||||
if (pMap) {
|
if (pMap) {
|
||||||
result = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid,
|
result = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid,
|
||||||
RT_PIXMAP, pMap, RT_NONE, NULL, DixCreateAccess);
|
RT_PIXMAP, pMap, X11_RESTYPE_NONE, NULL, DixCreateAccess);
|
||||||
if (result != Success) {
|
if (result != Success) {
|
||||||
pDraw->pScreen->DestroyPixmap(pMap);
|
pDraw->pScreen->DestroyPixmap(pMap);
|
||||||
break;
|
break;
|
||||||
|
@ -1024,7 +1024,7 @@ ProcPanoramiXShmCreatePixmap(ClientPtr client)
|
||||||
|
|
||||||
if (result != Success) {
|
if (result != Success) {
|
||||||
while (j--)
|
while (j--)
|
||||||
FreeResource(newPix->info[j].id, RT_NONE);
|
FreeResource(newPix->info[j].id, X11_RESTYPE_NONE);
|
||||||
free(newPix);
|
free(newPix);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1117,7 +1117,7 @@ ProcShmCreatePixmap(ClientPtr client)
|
||||||
stuff->offset);
|
stuff->offset);
|
||||||
if (pMap) {
|
if (pMap) {
|
||||||
rc = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, RT_PIXMAP,
|
rc = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, RT_PIXMAP,
|
||||||
pMap, RT_NONE, NULL, DixCreateAccess);
|
pMap, X11_RESTYPE_NONE, NULL, DixCreateAccess);
|
||||||
if (rc != Success) {
|
if (rc != Success) {
|
||||||
pDraw->pScreen->DestroyPixmap(pMap);
|
pDraw->pScreen->DestroyPixmap(pMap);
|
||||||
return rc;
|
return rc;
|
||||||
|
@ -1144,7 +1144,7 @@ ShmBusfaultNotify(void *context)
|
||||||
(unsigned int) shmdesc->resource);
|
(unsigned int) shmdesc->resource);
|
||||||
busfault_unregister(shmdesc->busfault);
|
busfault_unregister(shmdesc->busfault);
|
||||||
shmdesc->busfault = NULL;
|
shmdesc->busfault = NULL;
|
||||||
FreeResource (shmdesc->resource, RT_NONE);
|
FreeResource (shmdesc->resource, X11_RESTYPE_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -1326,7 +1326,7 @@ ProcShmCreateSegment(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (WriteFdToClient(client, fd, TRUE) < 0) {
|
if (WriteFdToClient(client, fd, TRUE) < 0) {
|
||||||
FreeResource(stuff->shmseg, RT_NONE);
|
FreeResource(stuff->shmseg, X11_RESTYPE_NONE);
|
||||||
close(fd);
|
close(fd);
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,7 +166,7 @@ SertafiedBlockHandler(void *data, void *wt)
|
||||||
pNext = pReq->next;
|
pNext = pReq->next;
|
||||||
if (CompareTimeStamps(pReq->revive, now) == LATER)
|
if (CompareTimeStamps(pReq->revive, now) == LATER)
|
||||||
break;
|
break;
|
||||||
FreeResource(pReq->id, RT_NONE);
|
FreeResource(pReq->id, X11_RESTYPE_NONE);
|
||||||
|
|
||||||
/* AttendClient() may have been called via the resource delete
|
/* AttendClient() may have been called via the resource delete
|
||||||
* function so a client may have input to be processed and so
|
* function so a client may have input to be processed and so
|
||||||
|
@ -195,7 +195,7 @@ SertafiedWakeupHandler(void *data, int i)
|
||||||
pNext = pReq->next;
|
pNext = pReq->next;
|
||||||
if (CompareTimeStamps(pReq->revive, now) == LATER)
|
if (CompareTimeStamps(pReq->revive, now) == LATER)
|
||||||
break;
|
break;
|
||||||
FreeResource(pReq->id, RT_NONE);
|
FreeResource(pReq->id, X11_RESTYPE_NONE);
|
||||||
}
|
}
|
||||||
if (!pPending) {
|
if (!pPending) {
|
||||||
RemoveBlockAndWakeupHandlers(SertafiedBlockHandler,
|
RemoveBlockAndWakeupHandlers(SertafiedBlockHandler,
|
||||||
|
|
28
Xext/sync.c
28
Xext/sync.c
|
@ -696,7 +696,7 @@ SyncAwaitTriggerFired(SyncTrigger * pTrigger)
|
||||||
/* unblock the client */
|
/* unblock the client */
|
||||||
AttendClient(pAwaitUnion->header.client);
|
AttendClient(pAwaitUnion->header.client);
|
||||||
/* delete the await */
|
/* delete the await */
|
||||||
FreeResource(pAwaitUnion->header.delete_id, RT_NONE);
|
FreeResource(pAwaitUnion->header.delete_id, X11_RESTYPE_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int64_t
|
static int64_t
|
||||||
|
@ -751,7 +751,7 @@ SyncEventSelectForAlarm(SyncAlarm * pAlarm, ClientPtr client, Bool wantevents)
|
||||||
* nothing, since it's already got them.
|
* nothing, since it's already got them.
|
||||||
*/
|
*/
|
||||||
if (!wantevents) {
|
if (!wantevents) {
|
||||||
FreeResource(pClients->delete_id, RT_NONE);
|
FreeResource(pClients->delete_id, X11_RESTYPE_NONE);
|
||||||
}
|
}
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
@ -934,7 +934,7 @@ SyncCreateFenceFromFD(ClientPtr client, DrawablePtr pDraw, XID id, int fd, BOOL
|
||||||
|
|
||||||
status = miSyncInitFenceFromFD(pDraw, pFence, fd, initially_triggered);
|
status = miSyncInitFenceFromFD(pDraw, pFence, fd, initially_triggered);
|
||||||
if (status != Success) {
|
if (status != Success) {
|
||||||
FreeResource(pFence->sync.id, RT_NONE);
|
FreeResource(pFence->sync.id, X11_RESTYPE_NONE);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -992,7 +992,7 @@ SyncCreateSystemCounter(const char *name,
|
||||||
|
|
||||||
psci = malloc(sizeof(SysCounterInfo));
|
psci = malloc(sizeof(SysCounterInfo));
|
||||||
if (!psci) {
|
if (!psci) {
|
||||||
FreeResource(pCounter->sync.id, RT_NONE);
|
FreeResource(pCounter->sync.id, X11_RESTYPE_NONE);
|
||||||
return pCounter;
|
return pCounter;
|
||||||
}
|
}
|
||||||
pCounter->pSysCounterInfo = psci;
|
pCounter->pSysCounterInfo = psci;
|
||||||
|
@ -1015,7 +1015,7 @@ SyncDestroySystemCounter(void *pSysCounter)
|
||||||
{
|
{
|
||||||
SyncCounter *pCounter = (SyncCounter *) pSysCounter;
|
SyncCounter *pCounter = (SyncCounter *) pSysCounter;
|
||||||
|
|
||||||
FreeResource(pCounter->sync.id, RT_NONE);
|
FreeResource(pCounter->sync.id, X11_RESTYPE_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1128,7 +1128,7 @@ FreeAlarm(void *addr, XID id)
|
||||||
/* delete event selections */
|
/* delete event selections */
|
||||||
|
|
||||||
while (pAlarm->pEventClients)
|
while (pAlarm->pEventClients)
|
||||||
FreeResource(pAlarm->pEventClients->delete_id, RT_NONE);
|
FreeResource(pAlarm->pEventClients->delete_id, X11_RESTYPE_NONE);
|
||||||
|
|
||||||
SyncDeleteTriggerFromSyncObject(&pAlarm->trigger);
|
SyncDeleteTriggerFromSyncObject(&pAlarm->trigger);
|
||||||
|
|
||||||
|
@ -1493,7 +1493,7 @@ ProcSyncDestroyCounter(ClientPtr client)
|
||||||
client->errorValue = stuff->counter;
|
client->errorValue = stuff->counter;
|
||||||
return BadAccess;
|
return BadAccess;
|
||||||
}
|
}
|
||||||
FreeResource(pCounter->sync.id, RT_NONE);
|
FreeResource(pCounter->sync.id, X11_RESTYPE_NONE);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1594,7 +1594,7 @@ ProcSyncAwait(ClientPtr client)
|
||||||
/* this should take care of removing any triggers created by
|
/* this should take care of removing any triggers created by
|
||||||
* this request that have already been registered on sync objects
|
* this request that have already been registered on sync objects
|
||||||
*/
|
*/
|
||||||
FreeResource(pAwaitUnion->header.delete_id, RT_NONE);
|
FreeResource(pAwaitUnion->header.delete_id, X11_RESTYPE_NONE);
|
||||||
client->errorValue = pProtocolWaitConds->counter;
|
client->errorValue = pProtocolWaitConds->counter;
|
||||||
return SyncErrorBase + XSyncBadCounter;
|
return SyncErrorBase + XSyncBadCounter;
|
||||||
}
|
}
|
||||||
|
@ -1614,7 +1614,7 @@ ProcSyncAwait(ClientPtr client)
|
||||||
/* this should take care of removing any triggers created by
|
/* this should take care of removing any triggers created by
|
||||||
* this request that have already been registered on sync objects
|
* this request that have already been registered on sync objects
|
||||||
*/
|
*/
|
||||||
FreeResource(pAwaitUnion->header.delete_id, RT_NONE);
|
FreeResource(pAwaitUnion->header.delete_id, X11_RESTYPE_NONE);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
/* this is not a mistake -- same function works for both cases */
|
/* this is not a mistake -- same function works for both cases */
|
||||||
|
@ -1745,7 +1745,7 @@ ProcSyncCreateAlarm(ClientPtr client)
|
||||||
|
|
||||||
if (!SyncCheckWarnIsCounter(pTrigger->pSync,
|
if (!SyncCheckWarnIsCounter(pTrigger->pSync,
|
||||||
WARN_INVALID_COUNTER_ALARM)) {
|
WARN_INVALID_COUNTER_ALARM)) {
|
||||||
FreeResource(stuff->id, RT_NONE);
|
FreeResource(stuff->id, X11_RESTYPE_NONE);
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1876,7 +1876,7 @@ ProcSyncDestroyAlarm(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
FreeResource(stuff->alarm, RT_NONE);
|
FreeResource(stuff->alarm, X11_RESTYPE_NONE);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1981,7 +1981,7 @@ ProcSyncDestroyFence(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
FreeResource(stuff->fid, RT_NONE);
|
FreeResource(stuff->fid, X11_RESTYPE_NONE);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2059,7 +2059,7 @@ ProcSyncAwaitFence(ClientPtr client)
|
||||||
/* this should take care of removing any triggers created by
|
/* this should take care of removing any triggers created by
|
||||||
* this request that have already been registered on sync objects
|
* this request that have already been registered on sync objects
|
||||||
*/
|
*/
|
||||||
FreeResource(pAwaitUnion->header.delete_id, RT_NONE);
|
FreeResource(pAwaitUnion->header.delete_id, X11_RESTYPE_NONE);
|
||||||
client->errorValue = *pProtocolFences;
|
client->errorValue = *pProtocolFences;
|
||||||
return SyncErrorBase + XSyncBadFence;
|
return SyncErrorBase + XSyncBadFence;
|
||||||
}
|
}
|
||||||
|
@ -2078,7 +2078,7 @@ ProcSyncAwaitFence(ClientPtr client)
|
||||||
/* this should take care of removing any triggers created by
|
/* this should take care of removing any triggers created by
|
||||||
* this request that have already been registered on sync objects
|
* this request that have already been registered on sync objects
|
||||||
*/
|
*/
|
||||||
FreeResource(pAwaitUnion->header.delete_id, RT_NONE);
|
FreeResource(pAwaitUnion->header.delete_id, X11_RESTYPE_NONE);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
/* this is not a mistake -- same function works for both cases */
|
/* this is not a mistake -- same function works for both cases */
|
||||||
|
|
|
@ -325,9 +325,9 @@ SELinuxTypeToClass(RESTYPE type)
|
||||||
class = SECCLASS_X_DRAWABLE;
|
class = SECCLASS_X_DRAWABLE;
|
||||||
else if (type == RT_GC)
|
else if (type == RT_GC)
|
||||||
class = SECCLASS_X_GC;
|
class = SECCLASS_X_GC;
|
||||||
else if (type == RT_FONT)
|
else if (type == X11_RESTYPE_FONT)
|
||||||
class = SECCLASS_X_FONT;
|
class = SECCLASS_X_FONT;
|
||||||
else if (type == RT_CURSOR)
|
else if (type == X11_RESTYPE_CURSOR)
|
||||||
class = SECCLASS_X_CURSOR;
|
class = SECCLASS_X_CURSOR;
|
||||||
else if (type == RT_COLORMAP)
|
else if (type == RT_COLORMAP)
|
||||||
class = SECCLASS_X_COLORMAP;
|
class = SECCLASS_X_COLORMAP;
|
||||||
|
|
|
@ -131,7 +131,7 @@ ProcXTestCompareCursor(ClientPtr client)
|
||||||
pCursor = GetSpriteCursor(ptr);
|
pCursor = GetSpriteCursor(ptr);
|
||||||
else {
|
else {
|
||||||
rc = dixLookupResourceByType((void **) &pCursor, stuff->cursor,
|
rc = dixLookupResourceByType((void **) &pCursor, stuff->cursor,
|
||||||
RT_CURSOR, client, DixReadAccess);
|
X11_RESTYPE_CURSOR, client, DixReadAccess);
|
||||||
if (rc != Success) {
|
if (rc != Success) {
|
||||||
client->errorValue = stuff->cursor;
|
client->errorValue = stuff->cursor;
|
||||||
return rc;
|
return rc;
|
||||||
|
|
|
@ -290,7 +290,7 @@ ProcXvMCDestroyContext(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
FreeResource(stuff->context_id, RT_NONE);
|
FreeResource(stuff->context_id, X11_RESTYPE_NONE);
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
@ -368,7 +368,7 @@ ProcXvMCDestroySurface(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
FreeResource(stuff->surface_id, RT_NONE);
|
FreeResource(stuff->surface_id, X11_RESTYPE_NONE);
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
@ -496,7 +496,7 @@ ProcXvMCDestroySubpicture(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
FreeResource(stuff->subpicture_id, RT_NONE);
|
FreeResource(stuff->subpicture_id, X11_RESTYPE_NONE);
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,7 +102,7 @@ DeleteDeviceEvents(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client)
|
||||||
next = grab->next;
|
next = grab->next;
|
||||||
if ((grab->device == dev) &&
|
if ((grab->device == dev) &&
|
||||||
(client->clientAsMask == CLIENT_BITS(grab->resource)))
|
(client->clientAsMask == CLIENT_BITS(grab->resource)))
|
||||||
FreeResource(grab->resource, RT_NONE);
|
FreeResource(grab->resource, X11_RESTYPE_NONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1538,7 +1538,7 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
|
||||||
l = &ti->listeners[ti->num_listeners - 1];
|
l = &ti->listeners[ti->num_listeners - 1];
|
||||||
l->listener = g->resource;
|
l->listener = g->resource;
|
||||||
l->grab = g;
|
l->grab = g;
|
||||||
//l->resource_type = RT_NONE;
|
//l->resource_type = X11_RESTYPE_NONE;
|
||||||
|
|
||||||
if (devgrab->grabtype != XI2 || devgrab->type != XI_TouchBegin)
|
if (devgrab->grabtype != XI2 || devgrab->type != XI_TouchBegin)
|
||||||
l->type = TOUCH_LISTENER_POINTER_GRAB;
|
l->type = TOUCH_LISTENER_POINTER_GRAB;
|
||||||
|
@ -2504,7 +2504,7 @@ GrabButton(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device,
|
||||||
cursor = NullCursor;
|
cursor = NullCursor;
|
||||||
else {
|
else {
|
||||||
rc = dixLookupResourceByType((void **) &cursor, param->cursor,
|
rc = dixLookupResourceByType((void **) &cursor, param->cursor,
|
||||||
RT_CURSOR, client, DixUseAccess);
|
X11_RESTYPE_CURSOR, client, DixUseAccess);
|
||||||
if (rc != Success) {
|
if (rc != Success) {
|
||||||
client->errorValue = param->cursor;
|
client->errorValue = param->cursor;
|
||||||
return rc;
|
return rc;
|
||||||
|
@ -2603,7 +2603,7 @@ GrabWindow(ClientPtr client, DeviceIntPtr dev, int type,
|
||||||
cursor = NullCursor;
|
cursor = NullCursor;
|
||||||
else {
|
else {
|
||||||
rc = dixLookupResourceByType((void **) &cursor, param->cursor,
|
rc = dixLookupResourceByType((void **) &cursor, param->cursor,
|
||||||
RT_CURSOR, client, DixUseAccess);
|
X11_RESTYPE_CURSOR, client, DixUseAccess);
|
||||||
if (rc != Success) {
|
if (rc != Success) {
|
||||||
client->errorValue = param->cursor;
|
client->errorValue = param->cursor;
|
||||||
return rc;
|
return rc;
|
||||||
|
@ -2691,7 +2691,7 @@ SelectForWindow(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client,
|
||||||
if (i == EMASKSIZE) {
|
if (i == EMASKSIZE) {
|
||||||
RecalculateDeviceDeliverableEvents(pWin);
|
RecalculateDeviceDeliverableEvents(pWin);
|
||||||
if (ShouldFreeInputMasks(pWin, FALSE))
|
if (ShouldFreeInputMasks(pWin, FALSE))
|
||||||
FreeResource(others->resource, RT_NONE);
|
FreeResource(others->resource, X11_RESTYPE_NONE);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3118,7 +3118,7 @@ DeleteWindowFromAnyExtEvents(WindowPtr pWin, Bool freeResources)
|
||||||
ic = inputMasks->inputClients;
|
ic = inputMasks->inputClients;
|
||||||
for (i = 0; i < EMASKSIZE; i++)
|
for (i = 0; i < EMASKSIZE; i++)
|
||||||
inputMasks->dontPropagateMask[i] = 0;
|
inputMasks->dontPropagateMask[i] = 0;
|
||||||
FreeResource(ic->resource, RT_NONE);
|
FreeResource(ic->resource, X11_RESTYPE_NONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3241,7 +3241,7 @@ DeviceEventSuppressForWindow(WindowPtr pWin, ClientPtr client, Mask mask,
|
||||||
}
|
}
|
||||||
RecalculateDeviceDeliverableEvents(pWin);
|
RecalculateDeviceDeliverableEvents(pWin);
|
||||||
if (ShouldFreeInputMasks(pWin, FALSE))
|
if (ShouldFreeInputMasks(pWin, FALSE))
|
||||||
FreeResource(inputMasks->inputClients->resource, RT_NONE);
|
FreeResource(inputMasks->inputClients->resource, X11_RESTYPE_NONE);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -831,7 +831,7 @@ XIDestroyPointerBarrier(ClientPtr client,
|
||||||
if (CLIENT_ID(stuff->barrier) != client->index)
|
if (CLIENT_ID(stuff->barrier) != client->index)
|
||||||
return BadAccess;
|
return BadAccess;
|
||||||
|
|
||||||
FreeResource(stuff->barrier, RT_NONE);
|
FreeResource(stuff->barrier, X11_RESTYPE_NONE);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,7 @@ ProcXIChangeCursor(ClientPtr client)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
rc = dixLookupResourceByType((void **) &pCursor, stuff->cursor,
|
rc = dixLookupResourceByType((void **) &pCursor, stuff->cursor,
|
||||||
RT_CURSOR, client, DixUseAccess);
|
X11_RESTYPE_CURSOR, client, DixUseAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
|
@ -175,7 +175,7 @@ ProcXIPassiveGrabDevice(ClientPtr client)
|
||||||
|
|
||||||
if (stuff->cursor != None) {
|
if (stuff->cursor != None) {
|
||||||
ret = dixLookupResourceByType(&tmp, stuff->cursor,
|
ret = dixLookupResourceByType(&tmp, stuff->cursor,
|
||||||
RT_CURSOR, client, DixUseAccess);
|
X11_RESTYPE_CURSOR, client, DixUseAccess);
|
||||||
if (ret != Success) {
|
if (ret != Success) {
|
||||||
client->errorValue = stuff->cursor;
|
client->errorValue = stuff->cursor;
|
||||||
goto out;
|
goto out;
|
||||||
|
|
|
@ -217,7 +217,7 @@ compRedirectWindow(ClientPtr pClient, WindowPtr pWin, int update)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!compCheckRedirect(pWin)) {
|
if (!compCheckRedirect(pWin)) {
|
||||||
FreeResource(ccw->id, RT_NONE);
|
FreeResource(ccw->id, X11_RESTYPE_NONE);
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -329,7 +329,7 @@ compUnredirectWindow(ClientPtr pClient, WindowPtr pWin, int update)
|
||||||
|
|
||||||
for (ccw = cw->clients; ccw; ccw = ccw->next)
|
for (ccw = cw->clients; ccw; ccw = ccw->next)
|
||||||
if (ccw->update == update && CLIENT_ID(ccw->id) == pClient->index) {
|
if (ccw->update == update && CLIENT_ID(ccw->id) == pClient->index) {
|
||||||
FreeResource(ccw->id, RT_NONE);
|
FreeResource(ccw->id, X11_RESTYPE_NONE);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
@ -477,7 +477,7 @@ compUnredirectSubwindows(ClientPtr pClient, WindowPtr pWin, int update)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
for (ccw = csw->clients; ccw; ccw = ccw->next)
|
for (ccw = csw->clients; ccw; ccw = ccw->next)
|
||||||
if (ccw->update == update && CLIENT_ID(ccw->id) == pClient->index) {
|
if (ccw->update == update && CLIENT_ID(ccw->id) == pClient->index) {
|
||||||
FreeResource(ccw->id, RT_NONE);
|
FreeResource(ccw->id, X11_RESTYPE_NONE);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
|
@ -265,7 +265,7 @@ ProcCompositeNameWindowPixmap(ClientPtr client)
|
||||||
if (pScreen->NameWindowPixmap) {
|
if (pScreen->NameWindowPixmap) {
|
||||||
rc = pScreen->NameWindowPixmap(pWin, pPixmap, stuff->pixmap);
|
rc = pScreen->NameWindowPixmap(pWin, pPixmap, stuff->pixmap);
|
||||||
if (rc != Success) {
|
if (rc != Success) {
|
||||||
FreeResource(stuff->pixmap, RT_NONE);
|
FreeResource(stuff->pixmap, X11_RESTYPE_NONE);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -302,14 +302,14 @@ ProcCompositeGetOverlayWindow(ClientPtr client)
|
||||||
cs = GetCompScreen(pScreen);
|
cs = GetCompScreen(pScreen);
|
||||||
if (cs->pOverlayWin == NULL)
|
if (cs->pOverlayWin == NULL)
|
||||||
if (!compCreateOverlayWindow(pScreen)) {
|
if (!compCreateOverlayWindow(pScreen)) {
|
||||||
FreeResource(pOc->resource, RT_NONE);
|
FreeResource(pOc->resource, X11_RESTYPE_NONE);
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = XaceHook(XACE_RESOURCE_ACCESS, client, cs->pOverlayWin->drawable.id,
|
rc = XaceHook(XACE_RESOURCE_ACCESS, client, cs->pOverlayWin->drawable.id,
|
||||||
RT_WINDOW, cs->pOverlayWin, RT_NONE, NULL, DixGetAttrAccess);
|
RT_WINDOW, cs->pOverlayWin, X11_RESTYPE_NONE, NULL, DixGetAttrAccess);
|
||||||
if (rc != Success) {
|
if (rc != Success) {
|
||||||
FreeResource(pOc->resource, RT_NONE);
|
FreeResource(pOc->resource, X11_RESTYPE_NONE);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -349,7 +349,7 @@ ProcCompositeReleaseOverlayWindow(ClientPtr client)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
|
|
||||||
/* The delete function will free the client structure */
|
/* The delete function will free the client structure */
|
||||||
FreeResource(pOc->resource, RT_NONE);
|
FreeResource(pOc->resource, X11_RESTYPE_NONE);
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
@ -820,17 +820,17 @@ PanoramiXCompositeGetOverlayWindow(ClientPtr client)
|
||||||
cs = GetCompScreen(pScreen);
|
cs = GetCompScreen(pScreen);
|
||||||
if (cs->pOverlayWin == NULL)
|
if (cs->pOverlayWin == NULL)
|
||||||
if (!compCreateOverlayWindow(pScreen)) {
|
if (!compCreateOverlayWindow(pScreen)) {
|
||||||
FreeResource(pOc->resource, RT_NONE);
|
FreeResource(pOc->resource, X11_RESTYPE_NONE);
|
||||||
free(overlayWin);
|
free(overlayWin);
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = XaceHook(XACE_RESOURCE_ACCESS, client,
|
rc = XaceHook(XACE_RESOURCE_ACCESS, client,
|
||||||
cs->pOverlayWin->drawable.id,
|
cs->pOverlayWin->drawable.id,
|
||||||
RT_WINDOW, cs->pOverlayWin, RT_NONE, NULL,
|
RT_WINDOW, cs->pOverlayWin, X11_RESTYPE_NONE, NULL,
|
||||||
DixGetAttrAccess);
|
DixGetAttrAccess);
|
||||||
if (rc != Success) {
|
if (rc != Success) {
|
||||||
FreeResource(pOc->resource, RT_NONE);
|
FreeResource(pOc->resource, X11_RESTYPE_NONE);
|
||||||
free(overlayWin);
|
free(overlayWin);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -898,7 +898,7 @@ PanoramiXCompositeReleaseOverlayWindow(ClientPtr client)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
|
|
||||||
/* The delete function will free the client structure */
|
/* The delete function will free the client structure */
|
||||||
FreeResource(pOc->resource, RT_NONE);
|
FreeResource(pOc->resource, X11_RESTYPE_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
|
|
|
@ -169,5 +169,5 @@ compDestroyOverlayWindow(ScreenPtr pScreen)
|
||||||
CompScreenPtr cs = GetCompScreen(pScreen);
|
CompScreenPtr cs = GetCompScreen(pScreen);
|
||||||
|
|
||||||
cs->pOverlayWin = NullWindow;
|
cs->pOverlayWin = NullWindow;
|
||||||
FreeResource(cs->overlayWid, RT_NONE);
|
FreeResource(cs->overlayWid, X11_RESTYPE_NONE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -610,9 +610,9 @@ compDestroyWindow(WindowPtr pWin)
|
||||||
|
|
||||||
pScreen->DestroyWindow = cs->DestroyWindow;
|
pScreen->DestroyWindow = cs->DestroyWindow;
|
||||||
while ((cw = GetCompWindow(pWin)))
|
while ((cw = GetCompWindow(pWin)))
|
||||||
FreeResource(cw->clients->id, RT_NONE);
|
FreeResource(cw->clients->id, X11_RESTYPE_NONE);
|
||||||
while ((csw = GetCompSubwindows(pWin)))
|
while ((csw = GetCompSubwindows(pWin)))
|
||||||
FreeResource(csw->clients->id, RT_NONE);
|
FreeResource(csw->clients->id, X11_RESTYPE_NONE);
|
||||||
|
|
||||||
if (pWin->redirectDraw != RedirectDrawNone) {
|
if (pWin->redirectDraw != RedirectDrawNone) {
|
||||||
PixmapPtr pPixmap = (*pScreen->GetWindowPixmap) (pWin);
|
PixmapPtr pPixmap = (*pScreen->GetWindowPixmap) (pWin);
|
||||||
|
|
|
@ -163,7 +163,7 @@ DamageExtDestroy(DamagePtr pDamage, void *closure)
|
||||||
|
|
||||||
pDamageExt->pDamage = 0;
|
pDamageExt->pDamage = 0;
|
||||||
if (pDamageExt->id)
|
if (pDamageExt->id)
|
||||||
FreeResource(pDamageExt->id, RT_NONE);
|
FreeResource(pDamageExt->id, X11_RESTYPE_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -316,7 +316,7 @@ ProcDamageDestroy(ClientPtr client)
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xDamageDestroyReq);
|
REQUEST_SIZE_MATCH(xDamageDestroyReq);
|
||||||
VERIFY_DAMAGEEXT(pDamageExt, stuff->damage, client, DixWriteAccess);
|
VERIFY_DAMAGEEXT(pDamageExt, stuff->damage, client, DixWriteAccess);
|
||||||
FreeResource(stuff->damage, RT_NONE);
|
FreeResource(stuff->damage, X11_RESTYPE_NONE);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -685,7 +685,7 @@ PanoramiXDamageCreate(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
FreeResource(stuff->damage, RT_NONE);
|
FreeResource(stuff->damage, X11_RESTYPE_NONE);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
|
@ -413,7 +413,7 @@ ProcDbeDeallocateBackBufferName(ClientPtr client)
|
||||||
return dbeErrorBase + DbeBadBuffer;
|
return dbeErrorBase + DbeBadBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
FreeResource(stuff->buffer, RT_NONE);
|
FreeResource(stuff->buffer, X11_RESTYPE_NONE);
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
|
|
||||||
|
@ -1314,7 +1314,7 @@ DbeDestroyWindow(WindowPtr pWin)
|
||||||
* NULL if there are no more buffer IDs associated with this
|
* NULL if there are no more buffer IDs associated with this
|
||||||
* window.
|
* window.
|
||||||
*/
|
*/
|
||||||
FreeResource(pDbeWindowPriv->IDs[0], RT_NONE);
|
FreeResource(pDbeWindowPriv->IDs[0], X11_RESTYPE_NONE);
|
||||||
pDbeWindowPriv = DBE_WINDOW_PRIV(pWin);
|
pDbeWindowPriv = DBE_WINDOW_PRIV(pWin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -177,7 +177,7 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction)
|
||||||
if (rc != Success || !AddResource(bufId, dbeDrawableResType,
|
if (rc != Success || !AddResource(bufId, dbeDrawableResType,
|
||||||
pDbeWindowPriv->pBackBuffer)) {
|
pDbeWindowPriv->pBackBuffer)) {
|
||||||
/* free the buffer and the drawable resource */
|
/* free the buffer and the drawable resource */
|
||||||
FreeResource(bufId, RT_NONE);
|
FreeResource(bufId, X11_RESTYPE_NONE);
|
||||||
return (rc == Success) ? BadAlloc : rc;
|
return (rc == Success) ? BadAlloc : rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -599,7 +599,7 @@ miDbePositionWindow(WindowPtr pWin, int x, int y)
|
||||||
/* DbeWindowPrivDelete() will free the window private if there no
|
/* DbeWindowPrivDelete() will free the window private if there no
|
||||||
* more buffer IDs associated with this window.
|
* more buffer IDs associated with this window.
|
||||||
*/
|
*/
|
||||||
FreeResource(pDbeWindowPriv->IDs[0], RT_NONE);
|
FreeResource(pDbeWindowPriv->IDs[0], X11_RESTYPE_NONE);
|
||||||
pDbeWindowPriv = DBE_WINDOW_PRIV(pWin);
|
pDbeWindowPriv = DBE_WINDOW_PRIV(pWin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -377,9 +377,9 @@ CreateColormap(Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
|
||||||
* Security creation/labeling check
|
* Security creation/labeling check
|
||||||
*/
|
*/
|
||||||
i = XaceHook(XACE_RESOURCE_ACCESS, clients[client], mid, RT_COLORMAP,
|
i = XaceHook(XACE_RESOURCE_ACCESS, clients[client], mid, RT_COLORMAP,
|
||||||
pmap, RT_NONE, NULL, DixCreateAccess);
|
pmap, X11_RESTYPE_NONE, NULL, DixCreateAccess);
|
||||||
if (i != Success) {
|
if (i != Success) {
|
||||||
FreeResource(mid, RT_NONE);
|
FreeResource(mid, X11_RESTYPE_NONE);
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -387,7 +387,7 @@ CreateColormap(Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
|
||||||
* this is it. In specific, if this is a Static colormap, this is the
|
* this is it. In specific, if this is a Static colormap, this is the
|
||||||
* time to fill in the colormap's values */
|
* time to fill in the colormap's values */
|
||||||
if (!(*pScreen->CreateColormap) (pmap)) {
|
if (!(*pScreen->CreateColormap) (pmap)) {
|
||||||
FreeResource(mid, RT_NONE);
|
FreeResource(mid, X11_RESTYPE_NONE);
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
pmap->flags &= ~BeingCreated;
|
pmap->flags &= ~BeingCreated;
|
||||||
|
|
16
dix/cursor.c
16
dix/cursor.c
|
@ -276,8 +276,8 @@ AllocARGBCursor(unsigned char *psrcbits, unsigned char *pmaskbits,
|
||||||
pCurs->id = cid;
|
pCurs->id = cid;
|
||||||
|
|
||||||
/* security creation/labeling check */
|
/* security creation/labeling check */
|
||||||
rc = XaceHook(XACE_RESOURCE_ACCESS, client, cid, RT_CURSOR,
|
rc = XaceHook(XACE_RESOURCE_ACCESS, client, cid, X11_RESTYPE_CURSOR,
|
||||||
pCurs, RT_NONE, NULL, DixCreateAccess);
|
pCurs, X11_RESTYPE_NONE, NULL, DixCreateAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
@ -334,13 +334,13 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
|
||||||
CursorPtr pCurs;
|
CursorPtr pCurs;
|
||||||
GlyphSharePtr pShare;
|
GlyphSharePtr pShare;
|
||||||
|
|
||||||
rc = dixLookupResourceByType((void **) &sourcefont, source, RT_FONT,
|
rc = dixLookupResourceByType((void **) &sourcefont, source, X11_RESTYPE_FONT,
|
||||||
client, DixUseAccess);
|
client, DixUseAccess);
|
||||||
if (rc != Success) {
|
if (rc != Success) {
|
||||||
client->errorValue = source;
|
client->errorValue = source;
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
rc = dixLookupResourceByType((void **) &maskfont, mask, RT_FONT, client,
|
rc = dixLookupResourceByType((void **) &maskfont, mask, X11_RESTYPE_FONT, client,
|
||||||
DixUseAccess);
|
DixUseAccess);
|
||||||
if (rc != Success && mask != None) {
|
if (rc != Success && mask != None) {
|
||||||
client->errorValue = mask;
|
client->errorValue = mask;
|
||||||
|
@ -456,8 +456,8 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
|
||||||
pCurs->id = cid;
|
pCurs->id = cid;
|
||||||
|
|
||||||
/* security creation/labeling check */
|
/* security creation/labeling check */
|
||||||
rc = XaceHook(XACE_RESOURCE_ACCESS, client, cid, RT_CURSOR,
|
rc = XaceHook(XACE_RESOURCE_ACCESS, client, cid, X11_RESTYPE_CURSOR,
|
||||||
pCurs, RT_NONE, NULL, DixCreateAccess);
|
pCurs, X11_RESTYPE_NONE, NULL, DixCreateAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
@ -500,7 +500,7 @@ CreateRootCursor(char *unused1, unsigned int unused2)
|
||||||
if (err != Success)
|
if (err != Success)
|
||||||
return NullCursor;
|
return NullCursor;
|
||||||
|
|
||||||
err = dixLookupResourceByType((void **) &cursorfont, fontID, RT_FONT,
|
err = dixLookupResourceByType((void **) &cursorfont, fontID, X11_RESTYPE_FONT,
|
||||||
serverClient, DixReadAccess);
|
serverClient, DixReadAccess);
|
||||||
if (err != Success)
|
if (err != Success)
|
||||||
return NullCursor;
|
return NullCursor;
|
||||||
|
@ -508,7 +508,7 @@ CreateRootCursor(char *unused1, unsigned int unused2)
|
||||||
&curs, serverClient, (XID) 0) != Success)
|
&curs, serverClient, (XID) 0) != Success)
|
||||||
return NullCursor;
|
return NullCursor;
|
||||||
|
|
||||||
if (!AddResource(FakeClientID(0), RT_CURSOR, (void *) curs))
|
if (!AddResource(FakeClientID(0), X11_RESTYPE_CURSOR, (void *) curs))
|
||||||
return NullCursor;
|
return NullCursor;
|
||||||
|
|
||||||
return curs;
|
return curs;
|
||||||
|
|
|
@ -831,7 +831,7 @@ ProcDestroyWindow(ClientPtr client)
|
||||||
DixRemoveAccess);
|
DixRemoveAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
FreeResource(stuff->id, RT_NONE);
|
FreeResource(stuff->id, X11_RESTYPE_NONE);
|
||||||
}
|
}
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
@ -1324,10 +1324,10 @@ ProcCloseFont(ClientPtr client)
|
||||||
REQUEST(xResourceReq);
|
REQUEST(xResourceReq);
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xResourceReq);
|
REQUEST_SIZE_MATCH(xResourceReq);
|
||||||
rc = dixLookupResourceByType((void **) &pFont, stuff->id, RT_FONT,
|
rc = dixLookupResourceByType((void **) &pFont, stuff->id, X11_RESTYPE_FONT,
|
||||||
client, DixDestroyAccess);
|
client, DixDestroyAccess);
|
||||||
if (rc == Success) {
|
if (rc == Success) {
|
||||||
FreeResource(stuff->id, RT_NONE);
|
FreeResource(stuff->id, X11_RESTYPE_NONE);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -1513,7 +1513,7 @@ ProcCreatePixmap(ClientPtr client)
|
||||||
pMap->drawable.id = stuff->pid;
|
pMap->drawable.id = stuff->pid;
|
||||||
/* security creation/labeling check */
|
/* security creation/labeling check */
|
||||||
rc = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, RT_PIXMAP,
|
rc = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, RT_PIXMAP,
|
||||||
pMap, RT_NONE, NULL, DixCreateAccess);
|
pMap, X11_RESTYPE_NONE, NULL, DixCreateAccess);
|
||||||
if (rc != Success) {
|
if (rc != Success) {
|
||||||
(*pDraw->pScreen->DestroyPixmap) (pMap);
|
(*pDraw->pScreen->DestroyPixmap) (pMap);
|
||||||
return rc;
|
return rc;
|
||||||
|
@ -1536,7 +1536,7 @@ ProcFreePixmap(ClientPtr client)
|
||||||
rc = dixLookupResourceByType((void **) &pMap, stuff->id, RT_PIXMAP,
|
rc = dixLookupResourceByType((void **) &pMap, stuff->id, RT_PIXMAP,
|
||||||
client, DixDestroyAccess);
|
client, DixDestroyAccess);
|
||||||
if (rc == Success) {
|
if (rc == Success) {
|
||||||
FreeResource(stuff->id, RT_NONE);
|
FreeResource(stuff->id, X11_RESTYPE_NONE);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -1685,7 +1685,7 @@ ProcFreeGC(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
FreeResource(stuff->id, RT_NONE);
|
FreeResource(stuff->id, X11_RESTYPE_NONE);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2473,7 +2473,7 @@ ProcFreeColormap(ClientPtr client)
|
||||||
if (rc == Success) {
|
if (rc == Success) {
|
||||||
/* Freeing a default colormap is a no-op */
|
/* Freeing a default colormap is a no-op */
|
||||||
if (!(pmap->flags & IsDefault))
|
if (!(pmap->flags & IsDefault))
|
||||||
FreeResource(stuff->id, RT_NONE);
|
FreeResource(stuff->id, X11_RESTYPE_NONE);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -3068,7 +3068,7 @@ ProcCreateCursor(ClientPtr client)
|
||||||
|
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
goto bail;
|
goto bail;
|
||||||
if (!AddResource(stuff->cid, RT_CURSOR, (void *) pCursor)) {
|
if (!AddResource(stuff->cid, X11_RESTYPE_CURSOR, (void *) pCursor)) {
|
||||||
rc = BadAlloc;
|
rc = BadAlloc;
|
||||||
goto bail;
|
goto bail;
|
||||||
}
|
}
|
||||||
|
@ -3098,7 +3098,7 @@ ProcCreateGlyphCursor(ClientPtr client)
|
||||||
&pCursor, client, stuff->cid);
|
&pCursor, client, stuff->cid);
|
||||||
if (res != Success)
|
if (res != Success)
|
||||||
return res;
|
return res;
|
||||||
if (AddResource(stuff->cid, RT_CURSOR, (void *) pCursor))
|
if (AddResource(stuff->cid, X11_RESTYPE_CURSOR, (void *) pCursor))
|
||||||
return Success;
|
return Success;
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
|
@ -3112,10 +3112,10 @@ ProcFreeCursor(ClientPtr client)
|
||||||
REQUEST(xResourceReq);
|
REQUEST(xResourceReq);
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xResourceReq);
|
REQUEST_SIZE_MATCH(xResourceReq);
|
||||||
rc = dixLookupResourceByType((void **) &pCursor, stuff->id, RT_CURSOR,
|
rc = dixLookupResourceByType((void **) &pCursor, stuff->id, X11_RESTYPE_CURSOR,
|
||||||
client, DixDestroyAccess);
|
client, DixDestroyAccess);
|
||||||
if (rc == Success) {
|
if (rc == Success) {
|
||||||
FreeResource(stuff->id, RT_NONE);
|
FreeResource(stuff->id, X11_RESTYPE_NONE);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -133,7 +133,7 @@ GetGlyphs(FontPtr font, unsigned long count, unsigned char *chars,
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* adding RT_FONT prevents conflict with default cursor font
|
* adding RT_FONT / X11_RESTYPE_FONT prevents conflict with default cursor font
|
||||||
*/
|
*/
|
||||||
Bool
|
Bool
|
||||||
SetDefaultFont(const char *defaultfontname)
|
SetDefaultFont(const char *defaultfontname)
|
||||||
|
@ -147,7 +147,7 @@ SetDefaultFont(const char *defaultfontname)
|
||||||
(unsigned) strlen(defaultfontname), defaultfontname);
|
(unsigned) strlen(defaultfontname), defaultfontname);
|
||||||
if (err != Success)
|
if (err != Success)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
err = dixLookupResourceByType((void **) &pf, fid, RT_FONT, serverClient,
|
err = dixLookupResourceByType((void **) &pf, fid, X11_RESTYPE_FONT, serverClient,
|
||||||
DixReadAccess);
|
DixReadAccess);
|
||||||
if (err != Success)
|
if (err != Success)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -355,7 +355,7 @@ doOpenFont(ClientPtr client, OFclosurePtr c)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!AddResource(c->fontid, RT_FONT, (void *) pfont)) {
|
if (!AddResource(c->fontid, X11_RESTYPE_FONT, (void *) pfont)) {
|
||||||
err = AllocError;
|
err = AllocError;
|
||||||
goto bail;
|
goto bail;
|
||||||
}
|
}
|
||||||
|
@ -408,7 +408,7 @@ OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname,
|
||||||
|
|
||||||
cached = xfont2_find_cached_font_pattern(patternCache, pfontname, lenfname);
|
cached = xfont2_find_cached_font_pattern(patternCache, pfontname, lenfname);
|
||||||
if (cached && cached->info.cachable) {
|
if (cached && cached->info.cachable) {
|
||||||
if (!AddResource(fid, RT_FONT, (void *) cached))
|
if (!AddResource(fid, X11_RESTYPE_FONT, (void *) cached))
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
cached->refcnt++;
|
cached->refcnt++;
|
||||||
return Success;
|
return Success;
|
||||||
|
@ -1157,7 +1157,7 @@ doPolyText(ClientPtr client, PTclosurePtr c)
|
||||||
fid = ((Font) *(c->pElt + 4)) /* big-endian */
|
fid = ((Font) *(c->pElt + 4)) /* big-endian */
|
||||||
|((Font) *(c->pElt + 3)) << 8
|
|((Font) *(c->pElt + 3)) << 8
|
||||||
| ((Font) *(c->pElt + 2)) << 16 | ((Font) *(c->pElt + 1)) << 24;
|
| ((Font) *(c->pElt + 2)) << 16 | ((Font) *(c->pElt + 1)) << 24;
|
||||||
err = dixLookupResourceByType((void **) &pFont, fid, RT_FONT,
|
err = dixLookupResourceByType((void **) &pFont, fid, X11_RESTYPE_FONT,
|
||||||
client, DixUseAccess);
|
client, DixUseAccess);
|
||||||
if (err != Success) {
|
if (err != Success) {
|
||||||
/* restore pFont for step 4 (described below) */
|
/* restore pFont for step 4 (described below) */
|
||||||
|
@ -1894,7 +1894,7 @@ find_old_font(XID id)
|
||||||
{
|
{
|
||||||
void *pFont;
|
void *pFont;
|
||||||
|
|
||||||
dixLookupResourceByType(&pFont, id, RT_NONE, serverClient, DixReadAccess);
|
dixLookupResourceByType(&pFont, id, X11_RESTYPE_NONE, serverClient, DixReadAccess);
|
||||||
return (FontPtr) pFont;
|
return (FontPtr) pFont;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1907,13 +1907,13 @@ get_new_font_client_id(void)
|
||||||
static int
|
static int
|
||||||
store_font_Client_font(FontPtr pfont, Font id)
|
store_font_Client_font(FontPtr pfont, Font id)
|
||||||
{
|
{
|
||||||
return AddResource(id, RT_NONE, (void *) pfont);
|
return AddResource(id, X11_RESTYPE_NONE, (void *) pfont);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
delete_font_client_id(Font id)
|
delete_font_client_id(Font id)
|
||||||
{
|
{
|
||||||
FreeResource(id, RT_NONE);
|
FreeResource(id, X11_RESTYPE_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
|
@ -207,7 +207,7 @@ dixLookupFontable(FontPtr *pFont, XID id, ClientPtr client, Mask access)
|
||||||
GC *pGC;
|
GC *pGC;
|
||||||
|
|
||||||
client->errorValue = id; /* EITHER font or gc */
|
client->errorValue = id; /* EITHER font or gc */
|
||||||
rc = dixLookupResourceByType((void **) pFont, id, RT_FONT, client,
|
rc = dixLookupResourceByType((void **) pFont, id, X11_RESTYPE_FONT, client,
|
||||||
access);
|
access);
|
||||||
if (rc != BadFont)
|
if (rc != BadFont)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
16
dix/events.c
16
dix/events.c
|
@ -4534,7 +4534,7 @@ EventSelectForWindow(WindowPtr pWin, ClientPtr client, Mask mask)
|
||||||
check = (mask & ManagerMask);
|
check = (mask & ManagerMask);
|
||||||
if (check) {
|
if (check) {
|
||||||
rc = XaceHook(XACE_RESOURCE_ACCESS, client, pWin->drawable.id,
|
rc = XaceHook(XACE_RESOURCE_ACCESS, client, pWin->drawable.id,
|
||||||
RT_WINDOW, pWin, RT_NONE, NULL, DixManageAccess);
|
RT_WINDOW, pWin, X11_RESTYPE_NONE, NULL, DixManageAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -4559,7 +4559,7 @@ EventSelectForWindow(WindowPtr pWin, ClientPtr client, Mask mask)
|
||||||
if (SameClient(others, client)) {
|
if (SameClient(others, client)) {
|
||||||
check = others->mask;
|
check = others->mask;
|
||||||
if (mask == 0) {
|
if (mask == 0) {
|
||||||
FreeResource(others->resource, RT_NONE);
|
FreeResource(others->resource, X11_RESTYPE_NONE);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -5065,7 +5065,7 @@ ProcChangeActivePointerGrab(ClientPtr client)
|
||||||
newCursor = NullCursor;
|
newCursor = NullCursor;
|
||||||
else {
|
else {
|
||||||
int rc = dixLookupResourceByType((void **) &newCursor, stuff->cursor,
|
int rc = dixLookupResourceByType((void **) &newCursor, stuff->cursor,
|
||||||
RT_CURSOR, client, DixUseAccess);
|
X11_RESTYPE_CURSOR, client, DixUseAccess);
|
||||||
|
|
||||||
if (rc != Success) {
|
if (rc != Success) {
|
||||||
client->errorValue = stuff->cursor;
|
client->errorValue = stuff->cursor;
|
||||||
|
@ -5182,7 +5182,7 @@ GrabDevice(ClientPtr client, DeviceIntPtr dev,
|
||||||
if (curs == None)
|
if (curs == None)
|
||||||
cursor = NullCursor;
|
cursor = NullCursor;
|
||||||
else {
|
else {
|
||||||
rc = dixLookupResourceByType((void **) &cursor, curs, RT_CURSOR,
|
rc = dixLookupResourceByType((void **) &cursor, curs, X11_RESTYPE_CURSOR,
|
||||||
client, DixUseAccess);
|
client, DixUseAccess);
|
||||||
if (rc != Success) {
|
if (rc != Success) {
|
||||||
client->errorValue = curs;
|
client->errorValue = curs;
|
||||||
|
@ -5719,7 +5719,7 @@ ProcGrabButton(ClientPtr client)
|
||||||
cursor = NullCursor;
|
cursor = NullCursor;
|
||||||
else {
|
else {
|
||||||
rc = dixLookupResourceByType((void **) &cursor, stuff->cursor,
|
rc = dixLookupResourceByType((void **) &cursor, stuff->cursor,
|
||||||
RT_CURSOR, client, DixUseAccess);
|
X11_RESTYPE_CURSOR, client, DixUseAccess);
|
||||||
if (rc != Success) {
|
if (rc != Success) {
|
||||||
client->errorValue = stuff->cursor;
|
client->errorValue = stuff->cursor;
|
||||||
return rc;
|
return rc;
|
||||||
|
@ -5906,9 +5906,9 @@ DeleteWindowFromAnyEvents(WindowPtr pWin, Bool freeResources)
|
||||||
if (pWin->dontPropagate)
|
if (pWin->dontPropagate)
|
||||||
DontPropagateRefCnts[pWin->dontPropagate]--;
|
DontPropagateRefCnts[pWin->dontPropagate]--;
|
||||||
while ((oc = wOtherClients(pWin)))
|
while ((oc = wOtherClients(pWin)))
|
||||||
FreeResource(oc->resource, RT_NONE);
|
FreeResource(oc->resource, X11_RESTYPE_NONE);
|
||||||
while ((passive = wPassiveGrabs(pWin)))
|
while ((passive = wPassiveGrabs(pWin)))
|
||||||
FreeResource(passive->resource, RT_NONE);
|
FreeResource(passive->resource, X11_RESTYPE_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
DeleteWindowFromAnyExtEvents(pWin, freeResources);
|
DeleteWindowFromAnyExtEvents(pWin, freeResources);
|
||||||
|
@ -5973,7 +5973,7 @@ ProcRecolorCursor(ClientPtr client)
|
||||||
REQUEST(xRecolorCursorReq);
|
REQUEST(xRecolorCursorReq);
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xRecolorCursorReq);
|
REQUEST_SIZE_MATCH(xRecolorCursorReq);
|
||||||
rc = dixLookupResourceByType((void **) &pCursor, stuff->cursor, RT_CURSOR,
|
rc = dixLookupResourceByType((void **) &pCursor, stuff->cursor, X11_RESTYPE_CURSOR,
|
||||||
client, DixWriteAccess);
|
client, DixWriteAccess);
|
||||||
if (rc != Success) {
|
if (rc != Success) {
|
||||||
client->errorValue = stuff->cursor;
|
client->errorValue = stuff->cursor;
|
||||||
|
|
4
dix/gc.c
4
dix/gc.c
|
@ -425,7 +425,7 @@ static const struct {
|
||||||
} xidfields[] = {
|
} xidfields[] = {
|
||||||
{GCTile, RT_PIXMAP, DixReadAccess},
|
{GCTile, RT_PIXMAP, DixReadAccess},
|
||||||
{GCStipple, RT_PIXMAP, DixReadAccess},
|
{GCStipple, RT_PIXMAP, DixReadAccess},
|
||||||
{GCFont, RT_FONT, DixUseAccess},
|
{GCFont, X11_RESTYPE_FONT, DixUseAccess},
|
||||||
{GCClipMask, RT_PIXMAP, DixReadAccess},
|
{GCClipMask, RT_PIXMAP, DixReadAccess},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -550,7 +550,7 @@ CreateGC(DrawablePtr pDrawable, BITS32 mask, XID *pval, int *pStatus,
|
||||||
|
|
||||||
/* security creation/labeling check */
|
/* security creation/labeling check */
|
||||||
*pStatus = XaceHook(XACE_RESOURCE_ACCESS, client, gcid, RT_GC, pGC,
|
*pStatus = XaceHook(XACE_RESOURCE_ACCESS, client, gcid, RT_GC, pGC,
|
||||||
RT_NONE, NULL, DixCreateAccess | DixSetAttrAccess);
|
X11_RESTYPE_NONE, NULL, DixCreateAccess | DixSetAttrAccess);
|
||||||
if (*pStatus != Success)
|
if (*pStatus != Success)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
|
|
@ -201,8 +201,8 @@ GestureAddGrabListener(DeviceIntPtr dev, GestureInfoPtr gi, GrabPtr grab)
|
||||||
BUG_RETURN_MSG(1, "Unsupported grab type\n");
|
BUG_RETURN_MSG(1, "Unsupported grab type\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* grab listeners are always RT_NONE since we keep the grab pointer */
|
/* grab listeners are always X11_RESTYPE_NONE since we keep the grab pointer */
|
||||||
GestureAddListener(gi, grab->resource, RT_NONE, type, grab->window, grab);
|
GestureAddListener(gi, grab->resource, X11_RESTYPE_NONE, type, grab->window, grab);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -681,13 +681,13 @@ DeletePassiveGrabFromList(GrabPtr pMinuendGrab)
|
||||||
|
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
for (i = 0; i < nadds; i++)
|
for (i = 0; i < nadds; i++)
|
||||||
FreeResource(adds[i]->resource, RT_NONE);
|
FreeResource(adds[i]->resource, X11_RESTYPE_NONE);
|
||||||
for (i = 0; i < nups; i++)
|
for (i = 0; i < nups; i++)
|
||||||
free(details[i]);
|
free(details[i]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for (i = 0; i < ndels; i++)
|
for (i = 0; i < ndels; i++)
|
||||||
FreeResource(deletes[i]->resource, RT_NONE);
|
FreeResource(deletes[i]->resource, X11_RESTYPE_NONE);
|
||||||
for (i = 0; i < nadds; i++) {
|
for (i = 0; i < nadds; i++) {
|
||||||
grab = adds[i];
|
grab = adds[i];
|
||||||
grab->next = grab->window->optional->passiveGrabs;
|
grab->next = grab->window->optional->passiveGrabs;
|
||||||
|
|
|
@ -564,12 +564,12 @@ dixPrivatesSize(DevPrivateType type)
|
||||||
|
|
||||||
/* Table of devPrivates offsets */
|
/* Table of devPrivates offsets */
|
||||||
static const int offsets[] = {
|
static const int offsets[] = {
|
||||||
-1, /* RT_NONE */
|
-1, /* RT_NONE / X11_RESTYPE_NONE */
|
||||||
offsetof(WindowRec, devPrivates), /* RT_WINDOW */
|
offsetof(WindowRec, devPrivates), /* RT_WINDOW */
|
||||||
offsetof(PixmapRec, devPrivates), /* RT_PIXMAP */
|
offsetof(PixmapRec, devPrivates), /* RT_PIXMAP */
|
||||||
offsetof(GC, devPrivates), /* RT_GC */
|
offsetof(GC, devPrivates), /* RT_GC */
|
||||||
-1, /* RT_FONT */
|
-1, /* RT_FONT / X11_RESTYPE_FONT */
|
||||||
offsetof(CursorRec, devPrivates), /* RT_CURSOR */
|
offsetof(CursorRec, devPrivates), /* RT_CURSOR / X11_RESTYPE_CURSOR */
|
||||||
offsetof(ColormapRec, devPrivates), /* RT_COLORMAP */
|
offsetof(ColormapRec, devPrivates), /* RT_COLORMAP */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -363,12 +363,12 @@ dixResetRegistry(void)
|
||||||
|
|
||||||
#ifdef X_REGISTRY_RESOURCE
|
#ifdef X_REGISTRY_RESOURCE
|
||||||
/* Add built-in resources */
|
/* Add built-in resources */
|
||||||
RegisterResourceName(RT_NONE, "NONE");
|
RegisterResourceName(X11_RESTYPE_NONE, "NONE");
|
||||||
RegisterResourceName(RT_WINDOW, "WINDOW");
|
RegisterResourceName(RT_WINDOW, "WINDOW");
|
||||||
RegisterResourceName(RT_PIXMAP, "PIXMAP");
|
RegisterResourceName(RT_PIXMAP, "PIXMAP");
|
||||||
RegisterResourceName(RT_GC, "GC");
|
RegisterResourceName(RT_GC, "GC");
|
||||||
RegisterResourceName(RT_FONT, "FONT");
|
RegisterResourceName(X11_RESTYPE_FONT, "FONT");
|
||||||
RegisterResourceName(RT_CURSOR, "CURSOR");
|
RegisterResourceName(X11_RESTYPE_CURSOR, "CURSOR");
|
||||||
RegisterResourceName(RT_COLORMAP, "COLORMAP");
|
RegisterResourceName(RT_COLORMAP, "COLORMAP");
|
||||||
RegisterResourceName(RT_CMAPENTRY, "COLORMAP ENTRY");
|
RegisterResourceName(RT_CMAPENTRY, "COLORMAP ENTRY");
|
||||||
RegisterResourceName(RT_OTHERCLIENT, "OTHER CLIENT");
|
RegisterResourceName(RT_OTHERCLIENT, "OTHER CLIENT");
|
||||||
|
|
|
@ -432,7 +432,7 @@ FindGCSubRes(void *value, FindAllRes func, void *cdata)
|
||||||
static struct ResourceType *resourceTypes;
|
static struct ResourceType *resourceTypes;
|
||||||
|
|
||||||
static const struct ResourceType predefTypes[] = {
|
static const struct ResourceType predefTypes[] = {
|
||||||
[RT_NONE & (RC_LASTPREDEF - 1)] = {
|
[X11_RESTYPE_NONE & (RC_LASTPREDEF - 1)] = {
|
||||||
.deleteFunc = (DeleteType) NoopDDA,
|
.deleteFunc = (DeleteType) NoopDDA,
|
||||||
.sizeFunc = GetDefaultBytes,
|
.sizeFunc = GetDefaultBytes,
|
||||||
.findSubResFunc = DefaultFindSubRes,
|
.findSubResFunc = DefaultFindSubRes,
|
||||||
|
@ -456,13 +456,13 @@ static const struct ResourceType predefTypes[] = {
|
||||||
.findSubResFunc = FindGCSubRes,
|
.findSubResFunc = FindGCSubRes,
|
||||||
.errorValue = BadGC,
|
.errorValue = BadGC,
|
||||||
},
|
},
|
||||||
[RT_FONT & (RC_LASTPREDEF - 1)] = {
|
[X11_RESTYPE_FONT & (RC_LASTPREDEF - 1)] = {
|
||||||
.deleteFunc = CloseFont,
|
.deleteFunc = CloseFont,
|
||||||
.sizeFunc = GetDefaultBytes,
|
.sizeFunc = GetDefaultBytes,
|
||||||
.findSubResFunc = DefaultFindSubRes,
|
.findSubResFunc = DefaultFindSubRes,
|
||||||
.errorValue = BadFont,
|
.errorValue = BadFont,
|
||||||
},
|
},
|
||||||
[RT_CURSOR & (RC_LASTPREDEF - 1)] = {
|
[X11_RESTYPE_CURSOR & (RC_LASTPREDEF - 1)] = {
|
||||||
.deleteFunc = FreeCursor,
|
.deleteFunc = FreeCursor,
|
||||||
.sizeFunc = GetDefaultBytes,
|
.sizeFunc = GetDefaultBytes,
|
||||||
.findSubResFunc = DefaultFindSubRes,
|
.findSubResFunc = DefaultFindSubRes,
|
||||||
|
@ -1224,7 +1224,7 @@ dixLookupResourceByType(void **result, XID id, RESTYPE rtype,
|
||||||
|
|
||||||
if (client) {
|
if (client) {
|
||||||
cid = XaceHook(XACE_RESOURCE_ACCESS, client, id, res->type,
|
cid = XaceHook(XACE_RESOURCE_ACCESS, client, id, res->type,
|
||||||
res->value, RT_NONE, NULL, mode);
|
res->value, X11_RESTYPE_NONE, NULL, mode);
|
||||||
if (cid == BadValue)
|
if (cid == BadValue)
|
||||||
return resourceTypes[rtype & TypeMask].errorValue;
|
return resourceTypes[rtype & TypeMask].errorValue;
|
||||||
if (cid != Success)
|
if (cid != Success)
|
||||||
|
@ -1259,7 +1259,7 @@ dixLookupResourceByClass(void **result, XID id, RESTYPE rclass,
|
||||||
|
|
||||||
if (client) {
|
if (client) {
|
||||||
cid = XaceHook(XACE_RESOURCE_ACCESS, client, id, res->type,
|
cid = XaceHook(XACE_RESOURCE_ACCESS, client, id, res->type,
|
||||||
res->value, RT_NONE, NULL, mode);
|
res->value, X11_RESTYPE_NONE, NULL, mode);
|
||||||
if (cid != Success)
|
if (cid != Success)
|
||||||
return cid;
|
return cid;
|
||||||
}
|
}
|
||||||
|
|
|
@ -712,8 +712,8 @@ TouchAddGrabListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
|
||||||
type = TOUCH_LISTENER_POINTER_GRAB;
|
type = TOUCH_LISTENER_POINTER_GRAB;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* grab listeners are always RT_NONE since we keep the grab pointer */
|
/* grab listeners are always X11_RESTYPE_NONE since we keep the grab pointer */
|
||||||
TouchAddListener(ti, grab->resource, RT_NONE, grab->grabtype,
|
TouchAddListener(ti, grab->resource, X11_RESTYPE_NONE, grab->grabtype,
|
||||||
type, TOUCH_LISTENER_AWAITING_BEGIN, grab->window, grab);
|
type, TOUCH_LISTENER_AWAITING_BEGIN, grab->window, grab);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
18
dix/window.c
18
dix/window.c
|
@ -640,7 +640,7 @@ CreateRootWindow(ScreenPtr pScreen)
|
||||||
/* security creation/labeling check
|
/* security creation/labeling check
|
||||||
*/
|
*/
|
||||||
if (XaceHook(XACE_RESOURCE_ACCESS, serverClient, pWin->drawable.id,
|
if (XaceHook(XACE_RESOURCE_ACCESS, serverClient, pWin->drawable.id,
|
||||||
RT_WINDOW, pWin, RT_NONE, NULL, DixCreateAccess))
|
RT_WINDOW, pWin, X11_RESTYPE_NONE, NULL, DixCreateAccess))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (!AddResource(pWin->drawable.id, RT_WINDOW, (void *) pWin))
|
if (!AddResource(pWin->drawable.id, RT_WINDOW, (void *) pWin))
|
||||||
|
@ -1118,11 +1118,11 @@ DestroySubwindows(WindowPtr pWin, ClientPtr client)
|
||||||
while (pWin->lastChild) {
|
while (pWin->lastChild) {
|
||||||
int rc = XaceHook(XACE_RESOURCE_ACCESS, client,
|
int rc = XaceHook(XACE_RESOURCE_ACCESS, client,
|
||||||
pWin->lastChild->drawable.id, RT_WINDOW,
|
pWin->lastChild->drawable.id, RT_WINDOW,
|
||||||
pWin->lastChild, RT_NONE, NULL, DixDestroyAccess);
|
pWin->lastChild, X11_RESTYPE_NONE, NULL, DixDestroyAccess);
|
||||||
|
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
FreeResource(pWin->lastChild->drawable.id, RT_NONE);
|
FreeResource(pWin->lastChild->drawable.id, X11_RESTYPE_NONE);
|
||||||
}
|
}
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
@ -1399,7 +1399,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
|
||||||
}
|
}
|
||||||
if (val == xTrue) {
|
if (val == xTrue) {
|
||||||
rc = XaceHook(XACE_RESOURCE_ACCESS, client, pWin->drawable.id,
|
rc = XaceHook(XACE_RESOURCE_ACCESS, client, pWin->drawable.id,
|
||||||
RT_WINDOW, pWin, RT_NONE, NULL, DixGrabAccess);
|
RT_WINDOW, pWin, X11_RESTYPE_NONE, NULL, DixGrabAccess);
|
||||||
if (rc != Success) {
|
if (rc != Success) {
|
||||||
error = rc;
|
error = rc;
|
||||||
client->errorValue = pWin->drawable.id;
|
client->errorValue = pWin->drawable.id;
|
||||||
|
@ -1495,7 +1495,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
rc = dixLookupResourceByType((void **) &pCursor, cursorID,
|
rc = dixLookupResourceByType((void **) &pCursor, cursorID,
|
||||||
RT_CURSOR, client, DixUseAccess);
|
X11_RESTYPE_CURSOR, client, DixUseAccess);
|
||||||
if (rc != Success) {
|
if (rc != Success) {
|
||||||
error = rc;
|
error = rc;
|
||||||
client->errorValue = cursorID;
|
client->errorValue = cursorID;
|
||||||
|
@ -2666,7 +2666,7 @@ MapWindow(WindowPtr pWin, ClientPtr client)
|
||||||
|
|
||||||
/* general check for permission to map window */
|
/* general check for permission to map window */
|
||||||
if (XaceHook(XACE_RESOURCE_ACCESS, client, pWin->drawable.id, RT_WINDOW,
|
if (XaceHook(XACE_RESOURCE_ACCESS, client, pWin->drawable.id, RT_WINDOW,
|
||||||
pWin, RT_NONE, NULL, DixShowAccess) != Success)
|
pWin, X11_RESTYPE_NONE, NULL, DixShowAccess) != Success)
|
||||||
return Success;
|
return Success;
|
||||||
|
|
||||||
pScreen = pWin->drawable.pScreen;
|
pScreen = pWin->drawable.pScreen;
|
||||||
|
@ -3138,7 +3138,7 @@ dixSaveScreens(ClientPtr client, int on, int mode)
|
||||||
}
|
}
|
||||||
else if (HasSaverWindow(pScreen)) {
|
else if (HasSaverWindow(pScreen)) {
|
||||||
pScreen->screensaver.pWindow = NullWindow;
|
pScreen->screensaver.pWindow = NullWindow;
|
||||||
FreeResource(pScreen->screensaver.wid, RT_NONE);
|
FreeResource(pScreen->screensaver.wid, X11_RESTYPE_NONE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SCREEN_SAVER_CYCLE:
|
case SCREEN_SAVER_CYCLE:
|
||||||
|
@ -3266,7 +3266,7 @@ TileScreenSaver(ScreenPtr pScreen, int kind)
|
||||||
&cursor, serverClient, (XID) 0);
|
&cursor, serverClient, (XID) 0);
|
||||||
if (cursor) {
|
if (cursor) {
|
||||||
cursorID = FakeClientID(0);
|
cursorID = FakeClientID(0);
|
||||||
if (AddResource(cursorID, RT_CURSOR, (void *) cursor)) {
|
if (AddResource(cursorID, X11_RESTYPE_CURSOR, (void *) cursor)) {
|
||||||
attributes[attri] = cursorID;
|
attributes[attri] = cursorID;
|
||||||
mask |= CWCursor;
|
mask |= CWCursor;
|
||||||
}
|
}
|
||||||
|
@ -3289,7 +3289,7 @@ TileScreenSaver(ScreenPtr pScreen, int kind)
|
||||||
wVisual(pScreen->root), &result);
|
wVisual(pScreen->root), &result);
|
||||||
|
|
||||||
if (cursor)
|
if (cursor)
|
||||||
FreeResource(cursorID, RT_NONE);
|
FreeResource(cursorID, X11_RESTYPE_NONE);
|
||||||
|
|
||||||
if (!pWin)
|
if (!pWin)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -440,7 +440,7 @@ To free a resource, use one of the following.
|
||||||
FreeResource frees all resources matching the given id, regardless of
|
FreeResource frees all resources matching the given id, regardless of
|
||||||
type; the type's deleteFunc will be called on each matching resource,
|
type; the type's deleteFunc will be called on each matching resource,
|
||||||
except that skipDeleteFuncType can be set to a single type for which
|
except that skipDeleteFuncType can be set to a single type for which
|
||||||
the deleteFunc should not be called (otherwise pass RT_NONE).
|
the deleteFunc should not be called (otherwise pass RT_NONE / X11_RESTYPE_NONE).
|
||||||
FreeResourceByType frees a specific resource matching a given id
|
FreeResourceByType frees a specific resource matching a given id
|
||||||
and type; if skipFree is true, then the deleteFunc is not called.
|
and type; if skipFree is true, then the deleteFunc is not called.
|
||||||
</para>
|
</para>
|
||||||
|
|
|
@ -239,7 +239,7 @@ proc_dri3_pixmap_from_buffer(ClientPtr client)
|
||||||
|
|
||||||
/* security creation/labeling check */
|
/* security creation/labeling check */
|
||||||
rc = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pixmap, RT_PIXMAP,
|
rc = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pixmap, RT_PIXMAP,
|
||||||
pixmap, RT_NONE, NULL, DixCreateAccess);
|
pixmap, X11_RESTYPE_NONE, NULL, DixCreateAccess);
|
||||||
|
|
||||||
if (rc != Success) {
|
if (rc != Success) {
|
||||||
(*drawable->pScreen->DestroyPixmap) (pixmap);
|
(*drawable->pScreen->DestroyPixmap) (pixmap);
|
||||||
|
@ -503,7 +503,7 @@ proc_dri3_pixmap_from_buffers(ClientPtr client)
|
||||||
|
|
||||||
/* security creation/labeling check */
|
/* security creation/labeling check */
|
||||||
rc = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pixmap, RT_PIXMAP,
|
rc = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pixmap, RT_PIXMAP,
|
||||||
pixmap, RT_NONE, NULL, DixCreateAccess);
|
pixmap, X11_RESTYPE_NONE, NULL, DixCreateAccess);
|
||||||
|
|
||||||
if (rc != Success) {
|
if (rc != Success) {
|
||||||
(*screen->DestroyPixmap) (pixmap);
|
(*screen->DestroyPixmap) (pixmap);
|
||||||
|
|
|
@ -1396,7 +1396,7 @@ DoCreatePbuffer(ClientPtr client, int screenNum, XID fbconfigId,
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
||||||
err = XaceHook(XACE_RESOURCE_ACCESS, client, glxDrawableId, RT_PIXMAP,
|
err = XaceHook(XACE_RESOURCE_ACCESS, client, glxDrawableId, RT_PIXMAP,
|
||||||
pPixmap, RT_NONE, NULL, DixCreateAccess);
|
pPixmap, X11_RESTYPE_NONE, NULL, DixCreateAccess);
|
||||||
if (err != Success) {
|
if (err != Success) {
|
||||||
(*pGlxScreen->pScreen->DestroyPixmap) (pPixmap);
|
(*pGlxScreen->pScreen->DestroyPixmap) (pPixmap);
|
||||||
return err;
|
return err;
|
||||||
|
|
|
@ -114,7 +114,7 @@ GlxMappingInit(void)
|
||||||
|
|
||||||
idResource = CreateNewResourceType(idResourceDeleteCallback,
|
idResource = CreateNewResourceType(idResourceDeleteCallback,
|
||||||
"GLXServerIDRes");
|
"GLXServerIDRes");
|
||||||
if (idResource == RT_NONE)
|
if (idResource == X11_RESTYPE_NONE)
|
||||||
{
|
{
|
||||||
GlxMappingReset();
|
GlxMappingReset();
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -369,7 +369,7 @@ xf86SetDGAMode(ScrnInfoPtr pScrn, int num, DGADevicePtr devRet)
|
||||||
|
|
||||||
if (oldPix) {
|
if (oldPix) {
|
||||||
if (oldPix->drawable.id)
|
if (oldPix->drawable.id)
|
||||||
FreeResource(oldPix->drawable.id, RT_NONE);
|
FreeResource(oldPix->drawable.id, X11_RESTYPE_NONE);
|
||||||
else
|
else
|
||||||
(*pScreen->DestroyPixmap) (oldPix);
|
(*pScreen->DestroyPixmap) (oldPix);
|
||||||
}
|
}
|
||||||
|
@ -431,7 +431,7 @@ xf86SetDGAMode(ScrnInfoPtr pScrn, int num, DGADevicePtr devRet)
|
||||||
|
|
||||||
if (oldPix) {
|
if (oldPix) {
|
||||||
if (oldPix->drawable.id)
|
if (oldPix->drawable.id)
|
||||||
FreeResource(oldPix->drawable.id, RT_NONE);
|
FreeResource(oldPix->drawable.id, X11_RESTYPE_NONE);
|
||||||
else
|
else
|
||||||
(*pScreen->DestroyPixmap) (oldPix);
|
(*pScreen->DestroyPixmap) (oldPix);
|
||||||
}
|
}
|
||||||
|
|
|
@ -271,7 +271,7 @@ ProcAppleWMSelectInput(register ClientPtr client)
|
||||||
pHead = (WMEventPtr *)malloc(sizeof(WMEventPtr));
|
pHead = (WMEventPtr *)malloc(sizeof(WMEventPtr));
|
||||||
if (!pHead ||
|
if (!pHead ||
|
||||||
!AddResource(eventResource, EventType, (void *)pHead)) {
|
!AddResource(eventResource, EventType, (void *)pHead)) {
|
||||||
FreeResource(clientResource, RT_NONE);
|
FreeResource(clientResource, X11_RESTYPE_NONE);
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
*pHead = 0;
|
*pHead = 0;
|
||||||
|
|
|
@ -71,19 +71,25 @@ typedef uint32_t RESTYPE;
|
||||||
|
|
||||||
/* types for Resource routines */
|
/* types for Resource routines */
|
||||||
|
|
||||||
|
// prevent namespace clash with Windows
|
||||||
|
#define X11_RESTYPE_NONE ((RESTYPE)0)
|
||||||
|
#define X11_RESTYPE_FONT ((RESTYPE)4)
|
||||||
|
#define X11_RESTYPE_CURSOR ((RESTYPE)5)
|
||||||
|
|
||||||
#define RT_WINDOW ((RESTYPE)1|RC_DRAWABLE)
|
#define RT_WINDOW ((RESTYPE)1|RC_DRAWABLE)
|
||||||
#define RT_PIXMAP ((RESTYPE)2|RC_DRAWABLE)
|
#define RT_PIXMAP ((RESTYPE)2|RC_DRAWABLE)
|
||||||
#define RT_GC ((RESTYPE)3)
|
#define RT_GC ((RESTYPE)3)
|
||||||
#undef RT_FONT
|
#undef RT_FONT
|
||||||
#undef RT_CURSOR
|
#undef RT_CURSOR
|
||||||
#define RT_FONT ((RESTYPE)4)
|
#define RT_FONT X11_RESTYPE_FONT
|
||||||
#define RT_CURSOR ((RESTYPE)5)
|
#define RT_CURSOR X11_RESTYPE_CURSOR
|
||||||
#define RT_COLORMAP ((RESTYPE)6)
|
#define RT_COLORMAP ((RESTYPE)6)
|
||||||
#define RT_CMAPENTRY ((RESTYPE)7)
|
#define RT_CMAPENTRY ((RESTYPE)7)
|
||||||
#define RT_OTHERCLIENT ((RESTYPE)8|RC_NEVERRETAIN)
|
#define RT_OTHERCLIENT ((RESTYPE)8|RC_NEVERRETAIN)
|
||||||
#define RT_PASSIVEGRAB ((RESTYPE)9|RC_NEVERRETAIN)
|
#define RT_PASSIVEGRAB ((RESTYPE)9|RC_NEVERRETAIN)
|
||||||
#define RT_LASTPREDEF ((RESTYPE)9)
|
#define RT_LASTPREDEF ((RESTYPE)9)
|
||||||
#define RT_NONE ((RESTYPE)0)
|
#define RT_NONE X11_RESTYPE_NONE
|
||||||
|
|
||||||
|
|
||||||
extern _X_EXPORT unsigned int ResourceClientBits(void);
|
extern _X_EXPORT unsigned int ResourceClientBits(void);
|
||||||
/* bits and fields within a resource id */
|
/* bits and fields within a resource id */
|
||||||
|
|
|
@ -52,7 +52,7 @@ present_free_events(WindowPtr window)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
while ((event = window_priv->events))
|
while ((event = window_priv->events))
|
||||||
FreeResource(event->id, RT_NONE);
|
FreeResource(event->id, X11_RESTYPE_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -224,7 +224,7 @@ present_select_input(ClientPtr client, XID eid, WindowPtr window, CARD32 mask)
|
||||||
if (mask)
|
if (mask)
|
||||||
event->mask = mask;
|
event->mask = mask;
|
||||||
else
|
else
|
||||||
FreeResource(eid, RT_NONE);
|
FreeResource(eid, X11_RESTYPE_NONE);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
if (ret != BadValue)
|
if (ret != BadValue)
|
||||||
|
|
|
@ -138,7 +138,7 @@ ProcRRSelectInput(ClientPtr client)
|
||||||
if (!pHead ||
|
if (!pHead ||
|
||||||
!AddResource(pWin->drawable.id, RREventType,
|
!AddResource(pWin->drawable.id, RREventType,
|
||||||
(void *) pHead)) {
|
(void *) pHead)) {
|
||||||
FreeResource(clientResource, RT_NONE);
|
FreeResource(clientResource, X11_RESTYPE_NONE);
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
*pHead = 0;
|
*pHead = 0;
|
||||||
|
|
|
@ -151,7 +151,7 @@ RRLeaseTerminated(RRLeasePtr lease)
|
||||||
RRLeaseChangeState(lease, RRLeaseTerminating, RRLeaseTerminating);
|
RRLeaseChangeState(lease, RRLeaseTerminating, RRLeaseTerminating);
|
||||||
|
|
||||||
if (lease->id != None)
|
if (lease->id != None)
|
||||||
FreeResource(lease->id, RT_NONE);
|
FreeResource(lease->id, X11_RESTYPE_NONE);
|
||||||
|
|
||||||
xorg_list_del(&lease->list);
|
xorg_list_del(&lease->list);
|
||||||
}
|
}
|
||||||
|
@ -368,7 +368,7 @@ ProcRRFreeLease(ClientPtr client)
|
||||||
RRTerminateLease(lease);
|
RRTerminateLease(lease);
|
||||||
else
|
else
|
||||||
/* Get rid of the resource database entry */
|
/* Get rid of the resource database entry */
|
||||||
FreeResource(stuff->lid, RT_NONE);
|
FreeResource(stuff->lid, X11_RESTYPE_NONE);
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2457,7 +2457,7 @@ ProcRecordFreeContext(ClientPtr client)
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xRecordFreeContextReq);
|
REQUEST_SIZE_MATCH(xRecordFreeContextReq);
|
||||||
VERIFY_CONTEXT(pContext, stuff->context, client);
|
VERIFY_CONTEXT(pContext, stuff->context, client);
|
||||||
FreeResource(stuff->context, RT_NONE);
|
FreeResource(stuff->context, X11_RESTYPE_NONE);
|
||||||
return Success;
|
return Success;
|
||||||
} /* ProcRecordFreeContext */
|
} /* ProcRecordFreeContext */
|
||||||
|
|
||||||
|
|
|
@ -336,8 +336,8 @@ AnimCursorCreate(CursorPtr *cursors, CARD32 *deltas, int ncursor,
|
||||||
|
|
||||||
/* security creation/labeling check */
|
/* security creation/labeling check */
|
||||||
if (ac->timer)
|
if (ac->timer)
|
||||||
rc = XaceHook(XACE_RESOURCE_ACCESS, client, cid, RT_CURSOR, pCursor,
|
rc = XaceHook(XACE_RESOURCE_ACCESS, client, cid, X11_RESTYPE_CURSOR, pCursor,
|
||||||
RT_NONE, NULL, DixCreateAccess);
|
X11_RESTYPE_NONE, NULL, DixCreateAccess);
|
||||||
|
|
||||||
if (rc != Success) {
|
if (rc != Success) {
|
||||||
TimerFree(ac->timer);
|
TimerFree(ac->timer);
|
||||||
|
|
|
@ -640,7 +640,7 @@ PictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats)
|
||||||
(formats[n].id, PictFormatType, (void *) (formats + n))) {
|
(formats[n].id, PictFormatType, (void *) (formats + n))) {
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < n; i++)
|
for (i = 0; i < n; i++)
|
||||||
FreeResource(formats[i].id, RT_NONE);
|
FreeResource(formats[i].id, X11_RESTYPE_NONE);
|
||||||
free(formats);
|
free(formats);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -649,7 +649,7 @@ ProcRenderFreePicture(ClientPtr client)
|
||||||
REQUEST_SIZE_MATCH(xRenderFreePictureReq);
|
REQUEST_SIZE_MATCH(xRenderFreePictureReq);
|
||||||
|
|
||||||
VERIFY_PICTURE(pPicture, stuff->picture, client, DixDestroyAccess);
|
VERIFY_PICTURE(pPicture, stuff->picture, client, DixDestroyAccess);
|
||||||
FreeResource(stuff->picture, RT_NONE);
|
FreeResource(stuff->picture, X11_RESTYPE_NONE);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -930,7 +930,7 @@ ProcRenderCreateGlyphSet(ClientPtr client)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
/* security creation/labeling check */
|
/* security creation/labeling check */
|
||||||
rc = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->gsid, GlyphSetType,
|
rc = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->gsid, GlyphSetType,
|
||||||
glyphSet, RT_NONE, NULL, DixCreateAccess);
|
glyphSet, X11_RESTYPE_NONE, NULL, DixCreateAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
if (!AddResource(stuff->gsid, GlyphSetType, (void *) glyphSet))
|
if (!AddResource(stuff->gsid, GlyphSetType, (void *) glyphSet))
|
||||||
|
@ -980,7 +980,7 @@ ProcRenderFreeGlyphSet(ClientPtr client)
|
||||||
client->errorValue = stuff->glyphset;
|
client->errorValue = stuff->glyphset;
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
FreeResource(stuff->glyphset, RT_NONE);
|
FreeResource(stuff->glyphset, X11_RESTYPE_NONE);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1635,7 +1635,7 @@ ProcRenderCreateCursor(ClientPtr client)
|
||||||
&pCursor, client, stuff->cid);
|
&pCursor, client, stuff->cid);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
goto bail;
|
goto bail;
|
||||||
if (!AddResource(stuff->cid, RT_CURSOR, (void *) pCursor)) {
|
if (!AddResource(stuff->cid, X11_RESTYPE_CURSOR, (void *) pCursor)) {
|
||||||
rc = BadAlloc;
|
rc = BadAlloc;
|
||||||
goto bail;
|
goto bail;
|
||||||
}
|
}
|
||||||
|
@ -1805,7 +1805,7 @@ ProcRenderCreateAnimCursor(ClientPtr client)
|
||||||
elt = (xAnimCursorElt *) (stuff + 1);
|
elt = (xAnimCursorElt *) (stuff + 1);
|
||||||
for (i = 0; i < ncursor; i++) {
|
for (i = 0; i < ncursor; i++) {
|
||||||
ret = dixLookupResourceByType((void **) (cursors + i), elt->cursor,
|
ret = dixLookupResourceByType((void **) (cursors + i), elt->cursor,
|
||||||
RT_CURSOR, client, DixReadAccess);
|
X11_RESTYPE_CURSOR, client, DixReadAccess);
|
||||||
if (ret != Success) {
|
if (ret != Success) {
|
||||||
free(cursors);
|
free(cursors);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1819,7 +1819,7 @@ ProcRenderCreateAnimCursor(ClientPtr client)
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (AddResource(stuff->cid, RT_CURSOR, (void *) pCursor))
|
if (AddResource(stuff->cid, X11_RESTYPE_CURSOR, (void *) pCursor))
|
||||||
return Success;
|
return Success;
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
|
@ -1863,7 +1863,7 @@ ProcRenderCreateSolidFill(ClientPtr client)
|
||||||
return error;
|
return error;
|
||||||
/* security creation/labeling check */
|
/* security creation/labeling check */
|
||||||
error = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, PictureType,
|
error = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, PictureType,
|
||||||
pPicture, RT_NONE, NULL, DixCreateAccess);
|
pPicture, X11_RESTYPE_NONE, NULL, DixCreateAccess);
|
||||||
if (error != Success)
|
if (error != Success)
|
||||||
return error;
|
return error;
|
||||||
if (!AddResource(stuff->pid, PictureType, (void *) pPicture))
|
if (!AddResource(stuff->pid, PictureType, (void *) pPicture))
|
||||||
|
@ -1902,7 +1902,7 @@ ProcRenderCreateLinearGradient(ClientPtr client)
|
||||||
return error;
|
return error;
|
||||||
/* security creation/labeling check */
|
/* security creation/labeling check */
|
||||||
error = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, PictureType,
|
error = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, PictureType,
|
||||||
pPicture, RT_NONE, NULL, DixCreateAccess);
|
pPicture, X11_RESTYPE_NONE, NULL, DixCreateAccess);
|
||||||
if (error != Success)
|
if (error != Success)
|
||||||
return error;
|
return error;
|
||||||
if (!AddResource(stuff->pid, PictureType, (void *) pPicture))
|
if (!AddResource(stuff->pid, PictureType, (void *) pPicture))
|
||||||
|
@ -1942,7 +1942,7 @@ ProcRenderCreateRadialGradient(ClientPtr client)
|
||||||
return error;
|
return error;
|
||||||
/* security creation/labeling check */
|
/* security creation/labeling check */
|
||||||
error = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, PictureType,
|
error = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, PictureType,
|
||||||
pPicture, RT_NONE, NULL, DixCreateAccess);
|
pPicture, X11_RESTYPE_NONE, NULL, DixCreateAccess);
|
||||||
if (error != Success)
|
if (error != Success)
|
||||||
return error;
|
return error;
|
||||||
if (!AddResource(stuff->pid, PictureType, (void *) pPicture))
|
if (!AddResource(stuff->pid, PictureType, (void *) pPicture))
|
||||||
|
@ -1981,7 +1981,7 @@ ProcRenderCreateConicalGradient(ClientPtr client)
|
||||||
return error;
|
return error;
|
||||||
/* security creation/labeling check */
|
/* security creation/labeling check */
|
||||||
error = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, PictureType,
|
error = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, PictureType,
|
||||||
pPicture, RT_NONE, NULL, DixCreateAccess);
|
pPicture, X11_RESTYPE_NONE, NULL, DixCreateAccess);
|
||||||
if (error != Success)
|
if (error != Success)
|
||||||
return error;
|
return error;
|
||||||
if (!AddResource(stuff->pid, PictureType, (void *) pPicture))
|
if (!AddResource(stuff->pid, PictureType, (void *) pPicture))
|
||||||
|
|
|
@ -74,7 +74,7 @@ static void deleteCursorHideCountsForScreen(ScreenPtr pScreen);
|
||||||
do { \
|
do { \
|
||||||
int err; \
|
int err; \
|
||||||
err = dixLookupResourceByType((void **) &pCursor, cursor, \
|
err = dixLookupResourceByType((void **) &pCursor, cursor, \
|
||||||
RT_CURSOR, client, access); \
|
X11_RESTYPE_CURSOR, client, access); \
|
||||||
if (err != Success) { \
|
if (err != Success) { \
|
||||||
client->errorValue = cursor; \
|
client->errorValue = cursor; \
|
||||||
return err; \
|
return err; \
|
||||||
|
@ -373,8 +373,8 @@ ProcXFixesGetCursorImage(ClientPtr client)
|
||||||
pCursor = CursorForClient(client);
|
pCursor = CursorForClient(client);
|
||||||
if (!pCursor)
|
if (!pCursor)
|
||||||
return BadCursor;
|
return BadCursor;
|
||||||
rc = XaceHook(XACE_RESOURCE_ACCESS, client, pCursor->id, RT_CURSOR,
|
rc = XaceHook(XACE_RESOURCE_ACCESS, client, pCursor->id, X11_RESTYPE_CURSOR,
|
||||||
pCursor, RT_NONE, NULL, DixReadAccess);
|
pCursor, X11_RESTYPE_NONE, NULL, DixReadAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
GetSpritePosition(PickPointer(client), &x, &y);
|
GetSpritePosition(PickPointer(client), &x, &y);
|
||||||
|
@ -522,8 +522,8 @@ ProcXFixesGetCursorImageAndName(ClientPtr client)
|
||||||
pCursor = CursorForClient(client);
|
pCursor = CursorForClient(client);
|
||||||
if (!pCursor)
|
if (!pCursor)
|
||||||
return BadCursor;
|
return BadCursor;
|
||||||
rc = XaceHook(XACE_RESOURCE_ACCESS, client, pCursor->id, RT_CURSOR,
|
rc = XaceHook(XACE_RESOURCE_ACCESS, client, pCursor->id, X11_RESTYPE_CURSOR,
|
||||||
pCursor, RT_NONE, NULL, DixReadAccess | DixGetAttrAccess);
|
pCursor, X11_RESTYPE_NONE, NULL, DixReadAccess | DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
GetSpritePosition(PickPointer(client), &x, &y);
|
GetSpritePosition(PickPointer(client), &x, &y);
|
||||||
|
@ -597,7 +597,7 @@ typedef struct {
|
||||||
} ReplaceCursorLookupRec, *ReplaceCursorLookupPtr;
|
} ReplaceCursorLookupRec, *ReplaceCursorLookupPtr;
|
||||||
|
|
||||||
static const RESTYPE CursorRestypes[] = {
|
static const RESTYPE CursorRestypes[] = {
|
||||||
RT_WINDOW, RT_PASSIVEGRAB, RT_CURSOR
|
RT_WINDOW, RT_PASSIVEGRAB, X11_RESTYPE_CURSOR
|
||||||
};
|
};
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
|
@ -622,7 +622,7 @@ ReplaceCursorLookup(void *value, XID id, void *closure)
|
||||||
pCursorRef = &pGrab->cursor;
|
pCursorRef = &pGrab->cursor;
|
||||||
pCursor = *pCursorRef;
|
pCursor = *pCursorRef;
|
||||||
break;
|
break;
|
||||||
case RT_CURSOR:
|
case X11_RESTYPE_CURSOR:
|
||||||
pCursorRef = 0;
|
pCursorRef = 0;
|
||||||
pCursor = (CursorPtr) value;
|
pCursor = (CursorPtr) value;
|
||||||
cursor = id;
|
cursor = id;
|
||||||
|
@ -635,7 +635,7 @@ ReplaceCursorLookup(void *value, XID id, void *closure)
|
||||||
if (pCursorRef)
|
if (pCursorRef)
|
||||||
*pCursorRef = curs;
|
*pCursorRef = curs;
|
||||||
else
|
else
|
||||||
ChangeResourceValue(id, RT_CURSOR, curs);
|
ChangeResourceValue(id, X11_RESTYPE_CURSOR, curs);
|
||||||
FreeCursor(pCursor, cursor);
|
FreeCursor(pCursor, cursor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -301,7 +301,7 @@ ProcXFixesDestroyRegion(ClientPtr client)
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXFixesDestroyRegionReq);
|
REQUEST_SIZE_MATCH(xXFixesDestroyRegionReq);
|
||||||
VERIFY_REGION(pRegion, stuff->region, client, DixWriteAccess);
|
VERIFY_REGION(pRegion, stuff->region, client, DixWriteAccess);
|
||||||
FreeResource(stuff->region, RT_NONE);
|
FreeResource(stuff->region, X11_RESTYPE_NONE);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue