xace: add hooks + new access codes: XTEST extension

This commit is contained in:
Eamon Walsh 2007-10-02 13:21:53 -04:00 committed by Eamon Walsh
parent 50551ec693
commit b77d272d75

View File

@ -141,7 +141,7 @@ ProcXTestCompareCursor(client)
register int n, rc; register int n, rc;
REQUEST_SIZE_MATCH(xXTestCompareCursorReq); REQUEST_SIZE_MATCH(xXTestCompareCursorReq);
rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
if (rc != Success) if (rc != Success)
return rc; return rc;
if (stuff->cursor == None) if (stuff->cursor == None)
@ -149,11 +149,12 @@ ProcXTestCompareCursor(client)
else if (stuff->cursor == XTestCurrentCursor) else if (stuff->cursor == XTestCurrentCursor)
pCursor = GetSpriteCursor(); pCursor = GetSpriteCursor();
else { else {
pCursor = (CursorPtr)LookupIDByType(stuff->cursor, RT_CURSOR); rc = dixLookupResource((pointer *)&pCursor, stuff->cursor, RT_CURSOR,
if (!pCursor) client, DixReadAccess);
if (rc != Success)
{ {
client->errorValue = stuff->cursor; client->errorValue = stuff->cursor;
return (BadCursor); return (rc == BadValue) ? BadCursor : rc;
} }
} }
rep.type = X_Reply; rep.type = X_Reply;
@ -366,7 +367,7 @@ ProcXTestFakeInput(client)
else else
{ {
rc = dixLookupWindow(&root, ev->u.keyButtonPointer.root, client, rc = dixLookupWindow(&root, ev->u.keyButtonPointer.root, client,
DixUnknownAccess); DixGetAttrAccess);
if (rc != Success) if (rc != Success)
return rc; return rc;
if (root->parent) if (root->parent)