Index: cifxapi.c =================================================================== --- cifxapi.c (revision 5795) +++ cifxapi.c (working copy) @@ -345,10 +345,13 @@ if ((g_ptCifXDrvInfo == NULL) || (g_ptCifXDrvInfo->fInitialized == 0)) { return CIFX_DRV_NOT_INITIALIZED; - } else if (g_ptCifXDrvInfo != (CIFX_DRIVER_INFO_T*)hDriver) + } +#ifndef NXT_DISABLE_DRIVERHANDLECHECK + else if (g_ptCifXDrvInfo != (CIFX_DRIVER_INFO_T*)hDriver) { return CIFX_INVALID_HANDLE; } +#endif OS_EnterLock( s_pvDriverLock); { @@ -431,10 +434,13 @@ if ((g_ptCifXDrvInfo == NULL) || (g_ptCifXDrvInfo->fInitialized == 0)) { return CIFX_DRV_NOT_INITIALIZED; - } else if (g_ptCifXDrvInfo != (CIFX_DRIVER_INFO_T*)hDriver) + } +#ifndef NXT_DISABLE_DRIVERHANDLECHECK + else if (g_ptCifXDrvInfo != (CIFX_DRIVER_INFO_T*)hDriver) { return CIFX_INVALID_HANDLE; } +#endif if(ulSize >= sizeof(ptDriverInfo)) { OS_Strvsprintf( ptDriverInfo->abDriverVersion, 32, @@ -486,11 +492,13 @@ if ((g_ptCifXDrvInfo == NULL) || (g_ptCifXDrvInfo->fInitialized == 0)) { return CIFX_DRV_NOT_INITIALIZED; - } else if (g_ptCifXDrvInfo != (CIFX_DRIVER_INFO_T*)hDriver) + } +#ifndef NXT_DISABLE_DRIVERHANDLECHECK + else if (g_ptCifXDrvInfo != (CIFX_DRIVER_INFO_T*)hDriver) { return CIFX_INVALID_HANDLE; } - +#endif /* iterate over all registered translation layers */ for (ulSupportedTLCount = 0; ulSupportedTLCount<(g_ptCifXDrvInfo->ulTLInfoSize/sizeof(DRV_TL_INFO_T));ulSupportedTLCount++) { @@ -558,11 +566,14 @@ if ((g_ptCifXDrvInfo == NULL) || (g_ptCifXDrvInfo->fInitialized == 0)) { return CIFX_DRV_NOT_INITIALIZED; - } else if (g_ptCifXDrvInfo != (CIFX_DRIVER_INFO_T*)hDriver) + } +#ifndef NXT_DISABLE_DRIVERHANDLECHECK + else if (g_ptCifXDrvInfo != (CIFX_DRIVER_INFO_T*)hDriver) { return CIFX_INVALID_HANDLE; } - +#endif + for (ulSupportedTLCount = 0; ulSupportedTLCount<(g_ptCifXDrvInfo->ulTLInfoSize/sizeof(DRV_TL_INFO_T));ulSupportedTLCount++) { ptDrvInfo = &g_ptCifXDrvInfo->atTLInfo[ulSupportedTLCount]; @@ -686,10 +697,14 @@ if ((g_ptCifXDrvInfo == NULL) || (g_ptCifXDrvInfo->fInitialized == 0)) { return CIFX_DRV_NOT_INITIALIZED; - } else if (g_ptCifXDrvInfo != (CIFX_DRIVER_INFO_T*)hDriver) + } +#ifndef NXT_DISABLE_DRIVERHANDLECHECK + else if (g_ptCifXDrvInfo != (CIFX_DRIVER_INFO_T*)hDriver) { return CIFX_INVALID_HANDLE; - } else if (NULL == (ptnetXTransportDevice = OS_Memalloc(sizeof(CIFX_TRANSPORT_DEVICE_INST_T)))) + } +#endif + else if (NULL == (ptnetXTransportDevice = OS_Memalloc(sizeof(CIFX_TRANSPORT_DEVICE_INST_T)))) { return CIFX_FUNCTION_FAILED; } @@ -1188,10 +1203,14 @@ if ((g_ptCifXDrvInfo == NULL) || (g_ptCifXDrvInfo->fInitialized == 0)) { return CIFX_DRV_NOT_INITIALIZED; - } else if (g_ptCifXDrvInfo != (CIFX_DRIVER_INFO_T*)hDriver) + } +#ifndef NXT_DISABLE_DRIVERHANDLECHECK + else if (g_ptCifXDrvInfo != (CIFX_DRIVER_INFO_T*)hDriver) { return CIFX_INVALID_HANDLE; - } else if (NULL == (ptnetXTransportDevice = OS_Memalloc(sizeof(CIFX_TRANSPORT_DEVICE_INST_T)))) + } +#endif + else if (NULL == (ptnetXTransportDevice = OS_Memalloc(sizeof(CIFX_TRANSPORT_DEVICE_INST_T)))) { return CIFX_FUNCTION_FAILED; }