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.

216 lines
5.5 KiB

  1. // This is a part of the Active Template Library.
  2. // Copyright (C) 1996-2001 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Active Template Library Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Active Template Library product.
  10. #ifndef __ATLDEF_H__
  11. #define __ATLDEF_H__
  12. #pragma once
  13. #include <atlres.h>
  14. #ifndef RC_INVOKED
  15. #ifndef __cplusplus
  16. #error ATL requires C++ compilation (use a .cpp suffix)
  17. #endif
  18. #ifdef UNDER_CE
  19. #error ATL not currently supported for CE
  20. #endif
  21. #ifdef _UNICODE
  22. #ifndef UNICODE
  23. #define UNICODE // UNICODE is used by Windows headers
  24. #endif
  25. #endif
  26. #ifdef UNICODE
  27. #ifndef _UNICODE
  28. #define _UNICODE // _UNICODE is used by C-runtime/MFC headers
  29. #endif
  30. #endif
  31. #ifdef _DEBUG
  32. #ifndef DEBUG
  33. #define DEBUG
  34. #endif
  35. #endif
  36. #ifdef _WIN64
  37. #define _ATL_SUPPORT_VT_I8 // Always support VT_I8 on Win64.
  38. #endif
  39. #ifndef ATLASSERT
  40. #define ATLASSERT(expr) _ASSERTE(expr)
  41. #endif
  42. #ifndef ATLVERIFY
  43. #ifdef _DEBUG
  44. #define ATLVERIFY(expr) ATLASSERT(expr)
  45. #else
  46. #define ATLVERIFY(expr) (expr)
  47. #endif // DEBUG
  48. #endif // ATLVERIFY
  49. ///////////////////////////////////////////////////////////////////////////////
  50. // __declspec(novtable) is used on a class declaration to prevent the vtable
  51. // pointer from being initialized in the constructor and destructor for the
  52. // class. This has many benefits because the linker can now eliminate the
  53. // vtable and all the functions pointed to by the vtable. Also, the actual
  54. // constructor and destructor code are now smaller.
  55. ///////////////////////////////////////////////////////////////////////////////
  56. // This should only be used on a class that is not directly createable but is
  57. // rather only used as a base class. Additionally, the constructor and
  58. // destructor (if provided by the user) should not call anything that may cause
  59. // a virtual function call to occur back on the object.
  60. ///////////////////////////////////////////////////////////////////////////////
  61. // By default, the wizards will generate new ATL object classes with this
  62. // attribute (through the ATL_NO_VTABLE macro). This is normally safe as long
  63. // the restriction mentioned above is followed. It is always safe to remove
  64. // this macro from your class, so if in doubt, remove it.
  65. ///////////////////////////////////////////////////////////////////////////////
  66. #ifdef _ATL_DISABLE_NO_VTABLE
  67. #define ATL_NO_VTABLE
  68. #else
  69. #define ATL_NO_VTABLE __declspec(novtable)
  70. #endif
  71. #ifdef _ATL_DISABLE_NOTHROW
  72. #define ATL_NOTHROW
  73. #else
  74. #define ATL_NOTHROW __declspec(nothrow)
  75. #endif
  76. #ifdef _ATL_DISABLE_NOINLINE
  77. #define ATL_NOINLINE
  78. #else
  79. #define ATL_NOINLINE __declspec( noinline )
  80. #endif
  81. #ifdef _ATL_DISABLE_DEPRECATED
  82. #define ATL_DEPRECATED
  83. #else
  84. #define ATL_DEPRECATED __declspec( deprecated )
  85. #endif
  86. // If ATL70.DLL is being used then _ATL_STATIC_REGISTRY doesn't really make sense
  87. #ifdef _ATL_DLL
  88. #undef _ATL_STATIC_REGISTRY
  89. #else
  90. // If not linking to ATL70.DLL, use the static registrar and not building atl.dll
  91. #ifndef _ATL_DLL_IMPL
  92. #ifndef _ATL_STATIC_REGISTRY
  93. #define _ATL_STATIC_REGISTRY
  94. #endif
  95. #endif
  96. #endif
  97. #ifdef _DEBUG
  98. #ifndef _ATL_DEBUG
  99. #define _ATL_DEBUG
  100. #endif // _ATL_DEBUG
  101. #endif // _DEBUG
  102. #ifndef _ATL_HEAPFLAGS
  103. #ifdef _MALLOC_ZEROINIT
  104. #define _ATL_HEAPFLAGS HEAP_ZERO_MEMORY
  105. #else
  106. #define _ATL_HEAPFLAGS 0
  107. #endif
  108. #endif
  109. #ifndef _ATL_PACKING
  110. #define _ATL_PACKING 8
  111. #endif
  112. #if defined(_ATL_DLL)
  113. #define ATLAPI extern "C" HRESULT __declspec(dllimport) __stdcall
  114. #define ATLAPI_(x) extern "C" __declspec(dllimport) x __stdcall
  115. #define ATLINLINE
  116. #elif defined(_ATL_DLL_IMPL)
  117. #define ATLAPI extern "C" inline HRESULT __stdcall
  118. #define ATLAPI_(x) extern "C" inline x __stdcall
  119. #define ATLINLINE
  120. #else
  121. #define ATLAPI ATL_NOTHROW HRESULT __stdcall
  122. #define ATLAPI_(x) ATL_NOTHROW x __stdcall
  123. #define ATLINLINE inline
  124. #endif
  125. #ifdef _ATL_NO_EXCEPTIONS
  126. #ifdef _AFX
  127. #error MFC projects cannot define _ATL_NO_EXCEPTIONS
  128. #endif
  129. #else
  130. #ifndef _CPPUNWIND
  131. #define _ATL_NO_EXCEPTIONS
  132. #endif
  133. #endif
  134. #ifdef _CPPUNWIND
  135. #ifndef ATLTRYALLOC
  136. #ifdef _AFX
  137. #define ATLTRYALLOC(x) try{x;} catch(CException* e){e->Delete();}
  138. #else
  139. #define ATLTRYALLOC(x) try{x;} catch(...){}
  140. #endif //__AFX
  141. #endif //ATLTRYALLOC
  142. #else //_CPPUNWIND
  143. #ifndef ATLTRYALLOC
  144. #define ATLTRYALLOC(x) x;
  145. #endif //ATLTRYALLOC
  146. #endif //_CPPUNWIND
  147. #ifndef ATLTRY
  148. #define ATLTRY(x) ATLTRYALLOC(x)
  149. #endif //ATLTRY
  150. #define offsetofclass(base, derived) ((DWORD_PTR)(static_cast<base*>((derived*)_ATL_PACKING))-_ATL_PACKING)
  151. /////////////////////////////////////////////////////////////////////////////
  152. // Master version numbers
  153. #define _ATL 1 // Active Template Library
  154. #define _ATL_VER 0x0700 // Active Template Library version 7.0
  155. /////////////////////////////////////////////////////////////////////////////
  156. // Threading
  157. #ifndef _ATL_SINGLE_THREADED
  158. #ifndef _ATL_APARTMENT_THREADED
  159. #ifndef _ATL_FREE_THREADED
  160. #define _ATL_FREE_THREADED
  161. #endif
  162. #endif
  163. #endif
  164. // UUIDOF
  165. #ifndef _ATL_NO_UUIDOF
  166. #define _ATL_IIDOF(x) __uuidof(x)
  167. #else
  168. #define _ATL_IIDOF(x) IID_##x
  169. #endif
  170. #endif // RC_INVOKED
  171. #define ATLAXWIN_CLASS "AtlAxWin7"
  172. #define ATLAXWINLIC_CLASS "AtlAxWinLic7"
  173. #endif // __ATLDEF_H__
  174. /////////////////////////////////////////////////////////////////////////////