===================================================================
--- B:/users/xalex/PREFAST_TRUNK_3_0_0/core/complib/kernel/cl_timer.c	(revision 8191)
+++ B:/users/xalex/PREFAST_TRUNK_3_0_0/core/complib/kernel/cl_timer.c	(revision 8196)
@@ -33,7 +33,9 @@
 #include "complib/cl_timer.h"
 #include "complib/cl_memory.h"
 
+#ifdef NTDDI_WIN8
 static KDEFERRED_ROUTINE __timer_callback;
+#endif
 static void
 __timer_callback( 
 	IN	PRKDPC		p_dpc,
Index: B:/users/xalex/PREFAST_TRUNK_3_0_0/core/complib/kernel/cl_thread.c
===================================================================
--- B:/users/xalex/PREFAST_TRUNK_3_0_0/core/complib/kernel/cl_thread.c	(revision 8191)
+++ B:/users/xalex/PREFAST_TRUNK_3_0_0/core/complib/kernel/cl_thread.c	(revision 8196)
@@ -31,7 +31,9 @@
 
 #include "complib/cl_thread.h"
 
+#ifdef NTDDI_WIN8
 static KSTART_ROUTINE __thread_callback;
+#endif
 static void
 __thread_callback( 
 	IN	cl_thread_t* p_thread )
@@ -75,8 +77,12 @@
 
 	p_thread->pfn_callback = pfn_callback;
 	p_thread->context = context;
+#ifdef NTDDI_WIN8
 	strncpy_s( &p_thread->name[0], sizeof(p_thread->name), name, sizeof(p_thread->name) );
-
+#else
+	//TODO to use ntrsafe.dll and remove this call
+	strncpy( &p_thread->name[0], name, sizeof(p_thread->name) );
+#endif
 	/* Create a new thread, storing both the handle and thread id. */
 	InitializeObjectAttributes( &attr, NULL, OBJ_KERNEL_HANDLE, NULL, NULL );
 	status = PsCreateSystemThread( &p_thread->osd.h_thread, THREAD_ALL_ACCESS,
Index: B:/users/xalex/PREFAST_TRUNK_3_0_0/core/complib/kernel/cl_pnp_po.c
===================================================================
--- B:/users/xalex/PREFAST_TRUNK_3_0_0/core/complib/kernel/cl_pnp_po.c	(revision 8191)
+++ B:/users/xalex/PREFAST_TRUNK_3_0_0/core/complib/kernel/cl_pnp_po.c	(revision 8196)
@@ -1142,7 +1142,9 @@
 	return status;
 }
 
+#ifdef NTDDI_WIN8
 static IO_COMPLETION_ROUTINE __sync_completion;
+#endif
 static NTSTATUS
 __sync_completion(
 	IN				DEVICE_OBJECT				*p_dev_obj,
Index: B:/users/xalex/PREFAST_TRUNK_3_0_0/core/complib/cl_memory.c
===================================================================
--- B:/users/xalex/PREFAST_TRUNK_3_0_0/core/complib/cl_memory.c	(revision 8191)
+++ B:/users/xalex/PREFAST_TRUNK_3_0_0/core/complib/cl_memory.c	(revision 8196)
@@ -231,7 +231,13 @@
 	 * parameters are in paged pool.
 	 */
 	temp_line = line_num;
+#ifdef NTDDI_WIN8
 	strncpy_s( (char*)temp_buf, sizeof(temp_buf), p_file_name, FILE_NAME_LENGTH );
+#else 
+	//TODO to use ntrsafe.dll and remove this call
+	strncpy( (char*)temp_buf, p_file_name, FILE_NAME_LENGTH );
+#endif
+
 	/* Make sure the string is null terminated. */
 	((char*)temp_buf)[FILE_NAME_LENGTH - 1] = '\0';
 
Index: B:/users/xalex/PREFAST_TRUNK_3_0_0/core/complib/user/cl_log.c
===================================================================
--- B:/users/xalex/PREFAST_TRUNK_3_0_0/core/complib/user/cl_log.c	(revision 8191)
+++ B:/users/xalex/PREFAST_TRUNK_3_0_0/core/complib/user/cl_log.c	(revision 8196)
@@ -45,7 +45,7 @@
     HANDLE	h;
 	WORD	log_type;
 	WORD	num_str = 0;
-
+#pragma prefast(suppress: 28735 , "Ignore Banned Crimson API Usage")
     h = RegisterEventSource( NULL, name );
 
     if( !h )
Index: B:/users/xalex/PREFAST_TRUNK_3_0_0/core/complib/user/complib.rc
===================================================================
--- B:/users/xalex/PREFAST_TRUNK_3_0_0/core/complib/user/complib.rc	(revision 8191)
+++ B:/users/xalex/PREFAST_TRUNK_3_0_0/core/complib/user/complib.rc	(revision 8196)
@@ -37,8 +37,8 @@
 
 #ifdef _DEBUG_
 #define VER_FILEDESCRIPTION_STR		"Component Library (Debug)"
-#define VER_INTERNALNAME_STR		"complibd.dll"
-#define VER_ORIGINALFILENAME_STR	"complibd.dll"
+#define VER_INTERNALNAME_STR		"complib.dll"
+#define VER_ORIGINALFILENAME_STR	"complib.dll"
 #else
 #define VER_FILEDESCRIPTION_STR		"Component Library"
 #define VER_INTERNALNAME_STR		"complib.dll"
Index: B:/users/xalex/PREFAST_TRUNK_3_0_0/core/complib/user/complib.src
===================================================================
--- B:/users/xalex/PREFAST_TRUNK_3_0_0/core/complib/user/complib.src	(revision 8191)
+++ B:/users/xalex/PREFAST_TRUNK_3_0_0/core/complib/user/complib.src	(revision 8196)
@@ -245,7 +245,6 @@
 cl_spinlock_release
 cl_sys_callback_get
 cl_sys_callback_put
-cl_sys_callback_queue
 cl_thread_construct
 cl_thread_init
 cl_thread_destroy
Index: B:/users/xalex/PREFAST_TRUNK_3_0_0/core/al/user/ual_support.h
===================================================================
--- B:/users/xalex/PREFAST_TRUNK_3_0_0/core/al/user/ual_support.h	(revision 8191)
+++ B:/users/xalex/PREFAST_TRUNK_3_0_0/core/al/user/ual_support.h	(revision 8196)
@@ -65,11 +65,7 @@
 al_load_uvp(
 	IN				char* const					uvp_lib_name )
 {
-#ifdef _DEBUG_
-	StringCbCatA( uvp_lib_name, 32, "d.dll" );
-#else	/* _DEBUG_ */
 	StringCbCatA( uvp_lib_name, 32, ".dll" );
-#endif	/* _DEBUG_ */
 	return LoadLibrary( uvp_lib_name );
 }
 
Index: B:/users/xalex/PREFAST_TRUNK_3_0_0/core/al/user/al_dll.c
===================================================================
--- B:/users/xalex/PREFAST_TRUNK_3_0_0/core/al/user/al_dll.c	(revision 8191)
+++ B:/users/xalex/PREFAST_TRUNK_3_0_0/core/al/user/al_dll.c	(revision 8196)
@@ -79,11 +79,7 @@
 	case DLL_PROCESS_ATTACH:
 
 #if defined(EVENT_TRACING)
-#if DBG
-		WPP_INIT_TRACING(L"ibald.dll");
-#else
-		WPP_INIT_TRACING(L"ibal.dll");
-#endif
+    WPP_INIT_TRACING(L"ibal.dll");
 #endif		
 		cl_perf_init( &g_perf, AlMaxPerf );
 		DisableThreadLibraryCalls( h_module );
Index: B:/users/xalex/PREFAST_TRUNK_3_0_0/inc/kernel/complib/cl_spinlock_osd.h
===================================================================
--- B:/users/xalex/PREFAST_TRUNK_3_0_0/inc/kernel/complib/cl_spinlock_osd.h	(revision 8191)
+++ B:/users/xalex/PREFAST_TRUNK_3_0_0/inc/kernel/complib/cl_spinlock_osd.h	(revision 8196)
@@ -83,11 +83,12 @@
 	UNUSED_PARAM( p_spinlock );
 }
 
-#pragma prefast(suppress: 28157, "The irql level remains the same and equals to DISPATH_LEVEL")
+#ifdef NTDDI_WIN8
 _IRQL_requires_max_(DISPATCH_LEVEL)
 _IRQL_raises_(DISPATCH_LEVEL)
 __drv_at(p_spinlock->lock, __drv_acquiresExclusiveResource(KSPIN_LOCK))
 __drv_at(p_spinlock->irql, __drv_savesIRQL)
+#endif
 CL_INLINE void
 cl_spinlock_acquire( 
 	IN	cl_spinlock_t* const	p_spinlock )
@@ -98,28 +99,28 @@
 	if (irql == DISPATCH_LEVEL) {
 		KeAcquireSpinLockAtDpcLevel( &p_spinlock->lock );
 		p_spinlock->irql = irql;
-		#pragma prefast(suppress: 28157, "The irql level remains the same and equals to DISPATH_LEVEL")
 	}
 	else 
 		KeAcquireSpinLock( &p_spinlock->lock, &p_spinlock->irql );
 
 }
 
+#ifdef NTDDI_WIN8
 __drv_at(p_spinlock->lock, __drv_releasesExclusiveResource(KSPIN_LOCK))
 __drv_at(p_spinlock->irql, __drv_restoresIRQL)
-CL_INLINE void
-cl_spinlock_release(
+#endif
+#pragma prefast(suppress: 28157, "The irql level remains the same and equals to DISPATH_LEVEL")
+CL_INLINE void cl_spinlock_release(
 	IN	cl_spinlock_t* const	p_spinlock )
 {
 	CL_ASSERT( p_spinlock );
 
 	if (p_spinlock->irql == DISPATCH_LEVEL) {
-		#pragma prefast(suppress: 28157, "The irql level remains the same and equals to DISPATH_LEVEL")
-		KeReleaseSpinLockFromDpcLevel( &p_spinlock->lock );
+		KeReleaseSpinLockFromDpcLevel( &p_spinlock->lock ); 
 		}
 		
 	else
-		KeReleaseSpinLock( &p_spinlock->lock, p_spinlock->irql );
+		KeReleaseSpinLock( &p_spinlock->lock, p_spinlock->irql ); 
 }
 
 
Index: B:/users/xalex/PREFAST_TRUNK_3_0_0/inc/kernel/complib/cl_mutex_osd.h
===================================================================
--- B:/users/xalex/PREFAST_TRUNK_3_0_0/inc/kernel/complib/cl_mutex_osd.h	(revision 8191)
+++ B:/users/xalex/PREFAST_TRUNK_3_0_0/inc/kernel/complib/cl_mutex_osd.h	(revision 8196)
@@ -80,27 +80,34 @@
 	UNUSED_PARAM( p_mutex );
 }
 
-
+#ifdef NTDDI_WIN8
 _IRQL_requires_max_(APC_LEVEL)
 _IRQL_raises_(APC_LEVEL)
+	__drv_at(p_mutex, __drv_acquiresResource(FAST_MUTEX))
+//	__drv_at(p_mutex, __drv_savesIRQL)
+//_IRQL_saves_global_(p_mutex, FAST_MUTEX)
+//TODO http://www.osronline.com/showthread.cfm?link=196119
+__drv_savesIRQLGlobal(FastMutex, FastMutex)
+#endif
 CL_INLINE void
 cl_mutex_acquire(
-	    _Inout_  
-        __drv_in(_IRQL_saves_
-            __drv_acquiresResource(p_mutex))
 	IN	cl_mutex_t* const	p_mutex )
 {
 	CL_ASSERT( KeGetCurrentIrql() < DISPATCH_LEVEL );
 	ExAcquireFastMutex( p_mutex );
 }
 
-
+#ifdef NTDDI_WIN8
 _IRQL_requires_(APC_LEVEL)
+__drv_at(p_mutex, __drv_releasesResource(FAST_MUTEX))
+//__drv_at(p_mutex, __drv_restoresIRQL)
+//_IRQL_restores_global_(p_mutex, FAST_MUTEX)
+//TODO http://www.osronline.com/showthread.cfm?link=196119
+__drv_restoresIRQLGlobal(FastMutex, FastMutex)
+#endif
 CL_INLINE void
+#pragma prefast(suppress: 28167, "The irql level is restored by ExReleaseFastMutex")
 cl_mutex_release(
-	  _Inout_  
-		  __drv_in(_IRQL_restores_
-			  __drv_releasesResource(p_mutex))
 	IN	cl_mutex_t* const	p_mutex )
 {
 	CL_ASSERT( KeGetCurrentIrql() == APC_LEVEL );
Index: B:/users/xalex/PREFAST_TRUNK_3_0_0/inc/complib/cl_obj.h
===================================================================
--- B:/users/xalex/PREFAST_TRUNK_3_0_0/inc/complib/cl_obj.h	(revision 8191)
+++ B:/users/xalex/PREFAST_TRUNK_3_0_0/inc/complib/cl_obj.h	(revision 8196)
@@ -696,10 +696,12 @@
 *
 * SYNOPSIS
 */
+#ifdef NTDDI_WIN8
 _IRQL_requires_max_(DISPATCH_LEVEL)
 _IRQL_raises_(DISPATCH_LEVEL)
 __drv_at(p_obj->lock->lock, __drv_acquiresExclusiveResource(KSPIN_LOCK))
 _IRQL_saves_global_(p_obj, lock)
+#endif
 CL_INLINE void CL_API
 cl_obj_lock(
 	IN				cl_obj_t * const			p_obj )
@@ -730,10 +732,12 @@
 *
 * SYNOPSIS
 */
+#ifdef NTDDI_WIN8 
 __drv_at(p_obj->lock->lock, __drv_releasesExclusiveResource(KSPIN_LOCK))
 _IRQL_restores_global_(p_obj, lock)
-CL_INLINE void CL_API
-cl_obj_unlock(
+#endif
+#pragma prefast(suppress: 28167, "The irql will be restored by cl_spinlock_release")
+CL_INLINE void CL_API cl_obj_unlock(
 	IN				cl_obj_t * const			p_obj )
 {
 	CL_ASSERT( p_obj->state == CL_INITIALIZED ||
Index: B:/users/xalex/PREFAST_TRUNK_3_0_0/hw/mlx4/kernel/bus/ib/cq.c
===================================================================
--- B:/users/xalex/PREFAST_TRUNK_3_0_0/hw/mlx4/kernel/bus/ib/cq.c	(revision 8191)
+++ B:/users/xalex/PREFAST_TRUNK_3_0_0/hw/mlx4/kernel/bus/ib/cq.c	(revision 8196)
@@ -255,7 +255,7 @@
 	cq->mcq.comp  = mlx4_ib_cq_comp;
 	cq->mcq.event = mlx4_ib_cq_event;
 
-	if (context) 
+	if (context && udata) 
 		if (ib_copy_to_udata(udata, &cq->mcq.cqn, sizeof (__u32))) {
 			err = -EFAULT;
 			goto err_dbmap;
Index: B:/users/xalex/PREFAST_TRUNK_3_0_0/hw/mlx4/user/hca/mlx4.def
===================================================================
--- B:/users/xalex/PREFAST_TRUNK_3_0_0/hw/mlx4/user/hca/mlx4.def	(revision 8191)
+++ B:/users/xalex/PREFAST_TRUNK_3_0_0/hw/mlx4/user/hca/mlx4.def	(revision 8196)
@@ -1,9 +1,6 @@
-#if DEBUG
-LIBRARY mlx4ud.dll
-#else
 LIBRARY mlx4u.dll
-#endif
 
+
 #ifndef _WIN64
 EXPORTS
 uvp_get_interface
