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.

181 lines
5.1 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. #include <afxwin.h>
  7. #include <afxdisp.h>
  8. #include <afxtempl.h>
  9. #include <afxdlgs.h>
  10. #include <afxcmn.h>
  11. #include <afxmt.h> // CCriticalSection
  12. #include <winsvc.h>
  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. extern "C"
  19. {
  20. #include <lmcons.h>
  21. #include <lmshare.h>
  22. #include <lmerr.h>
  23. #include <lmapibuf.h>
  24. #include <macfile.h>
  25. // User browser stuff
  26. // We have to define _NTSEAPI_ since ntseapi.h conflicts with winnt.h
  27. #define _NTSEAPI_
  28. #include <getuser.h> // OpenUserBrowser()
  29. // Hardware profile stuff
  30. #include <regstr.h> // CSCONFIGFLAG_*
  31. #include <cfgmgr32.h> // CM_* APIs
  32. }
  33. #ifndef APIERR
  34. typedef DWORD APIERR; // Error code typically returned by ::GetLastError()
  35. #endif
  36. /////////////////////////////////////////////////////////////////////
  37. //
  38. // Handy macros
  39. //
  40. #define INOUT // Dummy macro
  41. #define IGNORED // Output parameter is ignored
  42. #define LENGTH(x) (sizeof(x)/sizeof(x[0]))
  43. #ifdef _DEBUG
  44. #define DebugCode(x) x
  45. #define GarbageInit(pv, cb) memset(pv, 'a', cb)
  46. #else
  47. #define DebugCode(x)
  48. #define GarbageInit(pv, cb)
  49. #endif
  50. /////////////////////////////////////////////////////////////////////
  51. // Macro Endorse()
  52. //
  53. // This macro is mostly used when validating parameters.
  54. // Some parameters are allowed to be NULL because they are optional
  55. // or simply because the interface uses the NULL case as a valid
  56. // input parameter. In this case the Endorse() macro is used to
  57. // acknowledge the validity of such a parameter.
  58. //
  59. // REMARKS
  60. // This macro is the opposite of Assert().
  61. //
  62. // EXAMPLE
  63. // Endorse(p == NULL); // Code acknowledge p == NULL to not be (or not cause) an error
  64. //
  65. #define Endorse(x)
  66. /////////////////////////////////////////////////////////////////////
  67. #define Assert(x) ASSERT(x)
  68. /////////////////////////////////////////////////////////////////////
  69. // Report is an unsual situation. This is somewhat similar
  70. // to an assert but does not always represent a code bug.
  71. // eg: Unable to load an icon.
  72. #define Report(x) ASSERT(x) // Currently defined as an assert because I don't have time to rewrite another macro
  73. /////////////////////////////////////////////////////////////////////
  74. #include "dbg.h"
  75. #include "mmc.h"
  76. #include <windns.h>
  77. #include <comptr.h>
  78. //#define SNAPIN_PROTOTYPER // Build a snapin prototyper dll instead of FILEMGMT dll
  79. EXTERN_C const CLSID CLSID_FileServiceManagement;
  80. EXTERN_C const CLSID CLSID_SystemServiceManagement;
  81. EXTERN_C const CLSID CLSID_FileServiceManagementExt;
  82. EXTERN_C const CLSID CLSID_SystemServiceManagementExt;
  83. EXTERN_C const CLSID CLSID_FileServiceManagementAbout;
  84. EXTERN_C const CLSID CLSID_SystemServiceManagementAbout;
  85. EXTERN_C const CLSID CLSID_SvcMgmt;
  86. EXTERN_C const IID IID_ISvcMgmtStartStopHelper;
  87. #ifdef SNAPIN_PROTOTYPER
  88. EXTERN_C const CLSID CLSID_SnapinPrototyper;
  89. #endif
  90. #include "regkey.h" // class AMC::CRegKey
  91. /*
  92. // The following defines are required by the framework
  93. #define STD_COOKIE_TYPE CFileMgmtCookie
  94. #define STD_NODETYPE_ENUM FileMgmtObjectType
  95. #define STD_NODETYPE_DEFAULT FILEMGMT_ROOT
  96. #define STD_NODETYPE_NUMTYPES FILEMGMT_NUMTYPES
  97. #define STD_MAX_COLUMNS 7
  98. // CODEWORK are the following ones necessary?
  99. #define STD_COMPONENT_CLASS CFileMgmtComponent
  100. #define STD_COMPONENTDATA_TYPE CFileMgmtComponentData
  101. */
  102. // Property sheet include files
  103. #include "resource.h"
  104. #include "filemgmt.h" // CLSID_SvcMgmt, ISvcMgmtStartStopHelper
  105. #include "SvcProp.h"
  106. #include "SvcProp1.h"
  107. #include "SvcProp2.h"
  108. #include "SvcProp3.h"
  109. #include "SvcUtils.h"
  110. #include "Utils.h"
  111. #include "svchelp.h" // Help IDs
  112. #include "guidhelp.h" // ExtractObjectTypeGUID(), ExtractString()
  113. #include "nodetype.h" // FileMgmtObjectType
  114. #include <shfusion.h>
  115. class CThemeContextActivator
  116. {
  117. public:
  118. CThemeContextActivator() : m_ulActivationCookie(0)
  119. { SHActivateContext (&m_ulActivationCookie); }
  120. ~CThemeContextActivator()
  121. { SHDeactivateContext (m_ulActivationCookie); }
  122. private:
  123. ULONG_PTR m_ulActivationCookie;
  124. };
  125. #ifdef UNICODE
  126. #define PROPSHEETPAGE_V3 PROPSHEETPAGEW_V3
  127. #else
  128. #define PROPSHEETPAGE_V3 PROPSHEETPAGEA_V3
  129. #endif
  130. HPROPSHEETPAGE MyCreatePropertySheetPage(AFX_OLDPROPSHEETPAGE* psp);
  131. #if _WIN32_IE < 0x0400
  132. // We #define ILCreateFromPath to our wrapper so that we can run on
  133. // both NT4 and NT5, since it was a TCHAR export in NT4 and an xxxA/xxxW
  134. // export in NT5
  135. #undef ILCreateFromPath
  136. #define ILCreateFromPath Wrap_ILCreateFromPath
  137. #endif
  138. #define RETURN_HR_IF_FAIL if (FAILED(hr)) { ASSERT(FALSE); return hr; }
  139. #define RETURN_FALSE_IF_FAIL if (FAILED(hr)) { ASSERT(FALSE); return FALSE; }
  140. #define RETURN_E_FAIL_IF_NULL(p) if (NULL == p) { ASSERT(FALSE); return E_FAIL; }
  141. #endif // ~__STDAFX_H__