Leaked source code of windows server 2003
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.

87 lines
2.1 KiB

  1. //
  2. // System level IO verification configuration utility
  3. // Copyright (c) Microsoft Corporation, 1999
  4. //
  5. //
  6. // module: regutil.hxx
  7. // author: DMihai
  8. // created: 04/19/99
  9. // description: resources manipulation routines
  10. //
  11. //
  12. #ifndef __RESUTIL_HXX_INCLUDED__
  13. #define __RESUTIL_HXX_INCLUDED__
  14. #include <windows.h>
  15. #include <tchar.h>
  16. #include <stdlib.h>
  17. /////////////////////////////////////////////////////////////////////
  18. //
  19. // Macro:
  20. //
  21. // assert_ (exp)
  22. //
  23. // Description:
  24. //
  25. // Custom defined assertion macro. It is active, unless
  26. // ASSERT_DISABLED macro is defined. We take care to protect
  27. // it from multiple definitions by enclosing it in
  28. // '#ifndef assert_ .. #endif'.
  29. //
  30. #ifndef ASSERT_DISABLED
  31. #ifndef assert_
  32. #define assert_(exp) \
  33. if ((exp) == 0) \
  34. { \
  35. _tprintf ( _TEXT("'assert_' failed: %s (%d): \n %s"), \
  36. _TEXT( __FILE__ ), __LINE__, _TEXT( #exp ) ); \
  37. exit (-1); \
  38. }
  39. #endif // #ifndef assert_
  40. #else
  41. #define assert_(exp)
  42. #endif // #ifndef ASSERT_DISABLED
  43. /////////////////////////////////////////////////////////////////////
  44. //
  45. // Macro:
  46. //
  47. // ARRAY_LEN( array )
  48. //
  49. // Description:
  50. //
  51. // Calculate array length
  52. //
  53. #define ARRAY_LEN( array ) ( sizeof(array) / sizeof( array[0] ) )
  54. /////////////////////////////////////////////////////////////////////
  55. BOOL
  56. GetStringFromResources(
  57. UINT uIdResource,
  58. TCHAR *strResult,
  59. int nBufferLen );
  60. /////////////////////////////////////////////////////////////////////
  61. void
  62. PrintStringFromResources(
  63. UINT uIdResource);
  64. /////////////////////////////////////////////////////////////////////
  65. void
  66. __cdecl
  67. DisplayErrorMessage(
  68. UINT uFormatResId,
  69. ... );
  70. #endif //#ifndef __RESUTIL_HXX_INCLUDED__