Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
1.1 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1997 - 1999
  3. Module Name:
  4. sensutil.hxx
  5. Abstract:
  6. Header file containing common stuff for SENS.
  7. Author:
  8. Gopal Parupudi <GopalP>
  9. [Notes:]
  10. optional-notes
  11. Revision History:
  12. GopalP 10/11/1997 Start.
  13. --*/
  14. #ifndef __SENSUTIL_HXX__
  15. #define __SENSUTIL_HXX__
  16. //
  17. // Macros
  18. //
  19. #define RequestSensLock() EnterCriticalSection(&gSensLock)
  20. #define ReleaseSensLock() LeaveCriticalSection(&gSensLock)
  21. #ifdef DBG
  22. extern BOOL
  23. ValidateError(
  24. IN int Status,
  25. IN unsigned int Count,
  26. IN const int ErrorList[]
  27. );
  28. #define VALIDATE(_myValueToValidate) \
  29. { int _myTempValueToValidate = (_myValueToValidate); \
  30. static const int _myValidateArray[] =
  31. #define END_VALIDATE ; \
  32. if (ValidateError(_myTempValueToValidate,\
  33. sizeof(_myValidateArray)/sizeof(int), \
  34. _myValidateArray) == 0) ASSERT(0);}
  35. #else // !DBG
  36. // Does nothing on retail systems
  37. #define VALIDATE(_myValueToValidate) { int _bogusarray[] =
  38. #define END_VALIDATE ; }
  39. #endif // DBG
  40. #endif// __SENSUTIL_HXX__