diff options
author | Jeremy Huddleston <jeremyhu@apple.com> | 2011-10-29 17:44:55 -0700 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@apple.com> | 2011-10-30 10:59:46 -0700 |
commit | 77046f9be08295dbca69b51987df3308a284d87e (patch) | |
tree | 8f0f26f152e572d575d70592cc65f03e62db3889 | |
parent | 06f8213bffd27360d5cc3df0cad19b102cc928e2 (diff) |
Convert use of LookupWindow to dixLookupWindow
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r-- | src/sis_driver.c | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/src/sis_driver.c b/src/sis_driver.c index a8af80c..7ac9487 100644 --- a/src/sis_driver.c +++ b/src/sis_driver.c @@ -90,6 +90,26 @@ #include "dri.h" #endif +/* + * LookupWindow was removed with video abi 11. + */ +#if (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 4) +#ifndef DixGetAttrAccess +#define DixGetAttrAccess (1<<4) +#endif +#endif + +#if (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 2) +static inline int +dixLookupWindow(WindowPtr *pWin, XID id, ClientPtr client, Mask access) +{ + *pWin = LookupWindow(id, client); + if (!*pWin) + return BadWindow; + return Success; +} +#endif + /* Globals (yes, these ARE really required to be global) */ #ifdef SISUSEDEVPORT @@ -2146,10 +2166,12 @@ SiSProcXineramaGetState(ClientPtr client) WindowPtr pWin; xPanoramiXGetStateReply rep; register int n; + int rc; REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); - pWin = LookupWindow(stuff->window, client); - if(!pWin) return BadWindow; + rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); + if (rc != Success) + return rc; rep.type = X_Reply; rep.length = 0; @@ -2170,10 +2192,12 @@ SiSProcXineramaGetScreenCount(ClientPtr client) WindowPtr pWin; xPanoramiXGetScreenCountReply rep; register int n; + int rc; REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); - pWin = LookupWindow(stuff->window, client); - if(!pWin) return BadWindow; + rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); + if (rc != Success) + return rc; rep.type = X_Reply; rep.length = 0; @@ -2194,10 +2218,12 @@ SiSProcXineramaGetScreenSize(ClientPtr client) WindowPtr pWin; xPanoramiXGetScreenSizeReply rep; register int n; + int rc; REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); - pWin = LookupWindow (stuff->window, client); - if(!pWin) return BadWindow; + rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); + if (rc != Success) + return rc; rep.type = X_Reply; rep.length = 0; |