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.

143 lines
3.4 KiB

  1. // stdafx.h : include file for standard system include files,
  2. // or project specific include files that are used frequently,
  3. // but are changed infrequently
  4. #ifndef _STDAFX_H_
  5. #define _STDAFX_H_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #ifndef _WIN32_WINNT
  10. #define _WIN32_WINNT 0x0400
  11. #endif
  12. #define _ATL_APARTMENT_THREADED
  13. #include <atlbase.h>
  14. //You may derive a class from CComModule and use it if you want to override
  15. //something, but do not change the name of _Module
  16. extern CComModule _Module;
  17. #include <atlcom.h>
  18. #include <atlwin.h>
  19. #include <atlhost.h>
  20. #define SIZEOF_TCHARBUFFER( x ) sizeof( x ) / sizeof( TCHAR )
  21. #define SIZE_OF_BUFFER( x ) sizeof( x ) / sizeof( TCHAR )
  22. #ifdef DBG
  23. #define ODS OutputDebugString
  24. #define DBGMSG( x , y ) \
  25. {\
  26. TCHAR tchErr[80]; \
  27. wsprintf( tchErr , x , y ); \
  28. ODS( tchErr ); \
  29. }
  30. #define VERIFY_E( retval , expr ) \
  31. if( ( expr ) == retval ) \
  32. { \
  33. ODS( L#expr ); \
  34. ODS( L" returned "); \
  35. ODS( L#retval ); \
  36. ODS( L"\n" ); \
  37. } \
  38. #define VERIFY_S( retval , expr ) \
  39. if( ( expr ) != retval ) \
  40. {\
  41. ODS( L#expr ); \
  42. ODS( L" failed to return " ); \
  43. ODS( L#retval ); \
  44. ODS( L"\n" ); \
  45. }\
  46. #define ASSERT( expr ) \
  47. if( !( expr ) ) \
  48. { \
  49. char tchAssertErr[ 80 ]; \
  50. wsprintfA( tchAssertErr , "Assertion in expression ( %s ) failed\nFile - %s\nLine - %d\nDo you wish to Debug?", #expr , (__FILE__) , __LINE__ ); \
  51. if( MessageBoxA( NULL , tchAssertErr , "ASSERTION FAILURE" , MB_YESNO | MB_ICONERROR ) == IDYES ) \
  52. {\
  53. DebugBreak( );\
  54. }\
  55. } \
  56. #define HR_RET_IF_FAIL( q ) \
  57. if(FAILED(q)) \
  58. { \
  59. ASSERT(!FAILED(q));\
  60. return q; \
  61. } \
  62. #else
  63. #define ODS
  64. #define DBGMSG
  65. #define ASSERT( expr )
  66. #define VERIFY_E( retval , expr ) ( expr )
  67. #define VERIFY_S( retval , expr ) ( expr )
  68. #define HR_RET_IF_FAIL( q ) if(FAILED(q)) {return q;}
  69. #endif
  70. //mstsc.exe can take a maximum of 32 characters for the
  71. //command line including the null terminating character.
  72. #define CL_MAX_DESC_LENGTH 31
  73. #define CL_MAX_DOMAIN_LENGTH 512
  74. //
  75. // For compatability reasons keep the old
  76. // max domain length as the persistence format
  77. // used a fixed size.
  78. //
  79. #define CL_OLD_DOMAIN_LENGTH 52
  80. //
  81. // User name
  82. //
  83. #define CL_MAX_USERNAME_LENGTH 512
  84. //This is the max length of password in bytes.
  85. #define CL_MAX_PASSWORD_LENGTH_BYTES 512
  86. #define CL_OLD_PASSWORD_LENGTH 32
  87. #define CL_SALT_LENGTH 20
  88. //This is the maximum length of the password that
  89. //the user can type in the edit box.
  90. #define CL_MAX_PASSWORD_EDIT 256
  91. #define CL_MAX_APP_LENGTH_16 128
  92. #define CL_MAX_PGMAN_LENGTH 64
  93. #include <adcgbase.h>
  94. //
  95. // Header files for control interfaces (generated from IDL files)
  96. //
  97. #include "mstsax.h"
  98. #include "multihost.h"
  99. #ifdef ECP_TIMEBOMB
  100. //
  101. // Timebomb expires on June 30, 2000
  102. //
  103. #define ECP_TIMEBOMB_YEAR 2000
  104. #define ECP_TIMEBOMB_MONTH 6
  105. #define ECP_TIMEBOMB_DAY 30
  106. //
  107. // Return's true if timebomb test passed otherwise puts up warning
  108. // UI and return's FALSE
  109. //
  110. DCBOOL CheckTimeBomb();
  111. #endif
  112. #define BOOL_TO_VB(x) (x ? VARIANT_TRUE : VARIANT_FALSE)
  113. #endif