static int ProcXvGrabPort(ClientPtr client) { int result, status; XvPortPtr pPort; xvGrabPortReply rep; REQUEST(xvGrabPortReq); REQUEST_SIZE_MATCH(xvGrabPortReq); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); if ((status = _AllocatePort(stuff->port, pPort)) != Success) { client->errorValue = stuff->port; return status; } status = XvdiGrabPort(client, pPort, stuff->time, &result); if (status != Success) { return status; } rep.type = X_Reply; rep.sequenceNumber = client->sequence; rep.length = 0; rep.result = result; _WriteGrabPortReply(client, &rep); return Success; }
static int ProcXvGrabPort(ClientPtr client) { int result, status; XvPortPtr pPort; xvGrabPortReply rep; REQUEST(xvGrabPortReq); REQUEST_SIZE_MATCH(xvGrabPortReq); if(!(pPort = LOOKUP_PORT(stuff->port, client) )) { client->errorValue = stuff->port; return (_XvBadPort); } if ((status = _AllocatePort(stuff->port, pPort)) != Success) { client->errorValue = stuff->port; return (status); } status = XVCALL(diGrabPort)(client, pPort, stuff->time, &result); if (status != Success) { return status; } rep.type = X_Reply; rep.sequenceNumber = client->sequence; rep.length = 0; rep.result = result; _WriteGrabPortReply(client, &rep); return Success; }