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.

253 lines
5.9 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1999
  6. //
  7. // File: stdafx.h
  8. //
  9. //--------------------------------------------------------------------------
  10. // stdafx.h : include file for standard system include files,
  11. // or project specific include files that are used frequently,
  12. // but are changed infrequently
  13. #ifndef __STDAFX_H__
  14. #define __STDAFX_H__
  15. // often, we have local variables for the express purpose of ASSERTion.
  16. // when compiling retail, those assertions disappear, leaving our locals
  17. // as unreferenced.
  18. #ifndef DBG
  19. #pragma warning (disable: 4189 4100)
  20. #endif // DBG
  21. // common utility macros
  22. #define RETURN_IF_FAILED(hr) if (FAILED(hr)) { return hr; }
  23. // C++ RTTI
  24. #include <typeinfo.h>
  25. #define IS_CLASS(x,y) (typeid(x) == typeid(y))
  26. #define STRICT
  27. #include <nt.h>
  28. #include <ntdef.h>
  29. #include <ntrtl.h>
  30. #include <nturtl.h>
  31. #define NT_INCLUDED
  32. #undef ASSERT
  33. #undef ASSERTMSG
  34. #define _ATL_NO_UUIDOF
  35. #define _USE_MFC
  36. #ifdef _USE_MFC
  37. #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
  38. #include <afxwin.h> // MFC core and standard components
  39. #include <afxext.h> // MFC extensions
  40. #include <afxtempl.h> // MFC Template classes
  41. #include <afxdlgs.h>
  42. #include <afxdisp.h> // MFC OLE Control Containment component
  43. #ifndef _AFX_NO_AFXCMN_SUPPORT
  44. #include <afxcmn.h> // MFC support for Windows 95 Common Controls
  45. #endif // _AFX_NO_AFXCMN_SUPPORT
  46. #endif
  47. ///////////////////////////////////////////
  48. // ASSERT's and TRACE's without debug CRT's
  49. #if defined (DBG)
  50. #if !defined (_DEBUG)
  51. #define _USE_DSA_TRACE
  52. #define _USE_DSA_ASSERT
  53. #define _USE_DSA_TIMER
  54. #endif
  55. #endif
  56. #include "dbg.h"
  57. ///////////////////////////////////////////
  58. #include <atlbase.h>
  59. //You may derive a class from CComModule and use it if you want to override
  60. //something, but do not change the name of _Module
  61. interface IADsPathname; // fwd decl
  62. class CThreadContext; // fwd decl
  63. class CDsAdminModule : public CComModule
  64. {
  65. public:
  66. CDsAdminModule()
  67. {
  68. }
  69. HRESULT WINAPI UpdateRegistryCLSID(const CLSID& clsid, BOOL bRegister);
  70. };
  71. #define DECLARE_REGISTRY_CLSID() \
  72. static HRESULT WINAPI UpdateRegistry(BOOL bRegister) \
  73. { \
  74. return _Module.UpdateRegistryCLSID(GetObjectCLSID(), bRegister); \
  75. }
  76. extern CDsAdminModule _Module;
  77. #include <atlcom.h>
  78. #include <atlwin.h>
  79. #include "dbgutil.h"
  80. #define SECURITY_WIN32
  81. #include "security.h"
  82. #include <activeds.h>
  83. #include <iadsp.h>
  84. #include <mmc.h>
  85. #pragma comment(lib, "mmcuuid.lib")
  86. #include <shlobj.h> // needed for dsclient.h
  87. #include <dsclient.h>
  88. #include <dsclintp.h>
  89. #include <dspropp.h>
  90. #include <propcfg.h> // private dsprop header
  91. #include <stdabout.h>
  92. #include <dsadmin.h> // COM extensibility interfaces
  93. #include <dsadminp.h> // common functionality
  94. #define SECURITY_WIN32
  95. #include "security.h"
  96. #include "pcrack.h" // CPathCracker
  97. // macros
  98. extern const CLSID CLSID_DSSnapin;
  99. extern const CLSID CLSID_DSSnapinEx;
  100. extern const CLSID CLSID_SiteSnapin;
  101. extern const CLSID CLSID_DSContextMenu;
  102. extern const CLSID CLSID_DSAboutSnapin;
  103. extern const CLSID CLSID_SitesAboutSnapin;
  104. extern const CLSID CLSID_DSAdminQueryUIForm;
  105. extern const GUID cDefaultNodeType;
  106. extern const wchar_t* cszDefaultNodeType;
  107. // New Clipboard format that has the Type and Cookie
  108. extern const wchar_t* SNAPIN_INTERNAL;
  109. // these are from ntsam.h, i can't include it here.
  110. //
  111. // Group Flag Definitions to determine Type of Group
  112. //
  113. #define GROUP_TYPE_BUILTIN_LOCAL_GROUP 0x00000001
  114. #define GROUP_TYPE_ACCOUNT_GROUP 0x00000002
  115. #define GROUP_TYPE_RESOURCE_GROUP 0x00000004
  116. #define GROUP_TYPE_UNIVERSAL_GROUP 0x00000008
  117. #define GROUP_TYPE_SECURITY_ENABLED 0x80000000
  118. // struct definitions
  119. typedef struct _CREATEINFO {
  120. DWORD dwSize; // in bytes
  121. DWORD cItems; // how many entries;
  122. LPWSTR paClassNames[1]; // array of LPWSTR
  123. } CREATEINFO, *PCREATEINFO;
  124. typedef enum _SnapinType
  125. {
  126. SNAPINTYPE_DS = 0,
  127. SNAPINTYPE_DSEX,
  128. SNAPINTYPE_SITE,
  129. SNAPINTYPE_NUMTYPES
  130. } SnapinType;
  131. extern int ResourceIDForSnapinType[SNAPINTYPE_NUMTYPES];
  132. class CUINode;
  133. struct INTERNAL
  134. {
  135. INTERNAL()
  136. {
  137. m_type = CCT_UNINITIALIZED;
  138. m_cookie = NULL;
  139. m_cookie_count = 0;
  140. m_p_cookies = NULL;
  141. m_snapintype = SNAPINTYPE_DS;
  142. };
  143. ~INTERNAL() {}
  144. DATA_OBJECT_TYPES m_type; // What context is the data object.
  145. CUINode* m_cookie; // What object the cookie represents
  146. CString m_string;
  147. SnapinType m_snapintype;
  148. CLSID m_clsid;
  149. DWORD m_cookie_count; // > 1 if multi-select
  150. CUINode** m_p_cookies; //rest of cookies here, as array
  151. };
  152. ///////////////////////////////////////////////////
  153. // NT 5.0 style ACL manipulation API's
  154. #include <aclapi.h>
  155. ///////////////////////////////////////////////////
  156. // Security Identity Mapping (SIM) Stuff
  157. // Must include file "\nt\public\sdk\inc\wincrypt.h"
  158. #include <wincrypt.h> // CryptDecodeObject() found in crypt32.lib
  159. // REVIEW_MARCOC:
  160. // this is to allow new MMC interfaces and code based on
  161. // the new ISnapinProperty (and related) interfaces
  162. // comment/uncomment it to change functionality
  163. //#define _MMC_ISNAPIN_PROPERTY
  164. //
  165. // REVIEW_JEFFJON : this is to enable inetOrgPerson to behave like a user class object
  166. // For more information talk to JC Cannon
  167. //
  168. #define INETORGPERSON
  169. //
  170. // This is to enable profiling through the macros defined in profile.h
  171. // Profile.h will turn on profiling if MAX_PROFILING_ENABLED is defined
  172. // NOTE : profiling as implemented by profile.h does not work well with
  173. // multiple instances of the same snapin in one MMC console
  174. //
  175. #ifdef MAX_PROFILING_ENABLED
  176. #pragma warning(push, 3)
  177. #include <list>
  178. #include <vector>
  179. #include <stack>
  180. #include <map>
  181. #include <algorithm>
  182. #pragma warning (pop)
  183. #endif
  184. #include "profile.h"
  185. #include "MyBasePathsInfo.h"
  186. #endif //__STDAFX_H__