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.

143 lines
3.3 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1998 - 1999
  6. //
  7. // File: stdafx.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #include <afxwin.h>
  11. #include <afxdisp.h>
  12. ///////////////////////////////////////////
  13. // ASSERT's and TRACE's without debug CRT's
  14. #if defined (DBG)
  15. #if !defined (_DEBUG)
  16. #define _USE_DSA_TRACE
  17. #define _USE_DSA_ASSERT
  18. #define _USE_DSA_TIMER
  19. #endif
  20. #endif
  21. #include "dbg.h"
  22. ///////////////////////////////////////////
  23. #include <atlbase.h>
  24. //You may derive a class from CComModule and use it if you want to override
  25. //something, but do not change the name of _Module
  26. class CDomainAdminModule : public CComModule
  27. {
  28. public:
  29. HRESULT WINAPI UpdateRegistryCLSID(const CLSID& clsid, BOOL bRegister);
  30. };
  31. #define DECLARE_REGISTRY_CLSID() \
  32. static HRESULT WINAPI UpdateRegistry(BOOL bRegister) \
  33. { \
  34. return _Module.UpdateRegistryCLSID(GetObjectCLSID(), bRegister); \
  35. }
  36. extern CDomainAdminModule _Module;
  37. #include <atlcom.h>
  38. #include <atlwin.h>
  39. #include <mmc.h>
  40. #include <afxcmn.h>
  41. #include <afxtempl.h>
  42. #include <dsgetdc.h>
  43. #include <shlobj.h> // needed for dsclient.h
  44. #include <dsclient.h>
  45. #include <dsclintp.h>
  46. #include <dspropp.h>
  47. #include "propcfg.h"
  48. #include <dscmn.h>
  49. #include <dsadminp.h> // DS Admin utilities
  50. const long UNINITIALIZED = -1;
  51. /////////////////////////////////////////////////////////////////////////////
  52. // Helper functions
  53. template<class TYPE>
  54. inline void SAFE_RELEASE(TYPE*& pObj)
  55. {
  56. if (pObj != NULL)
  57. {
  58. pObj->Release();
  59. pObj = NULL;
  60. }
  61. else
  62. {
  63. TRACE(_T("Release called on NULL interface ptr\n"));
  64. }
  65. }
  66. struct INTERNAL
  67. {
  68. INTERNAL() { m_type = CCT_UNINITIALIZED; m_cookie = -1;};
  69. ~INTERNAL() {}
  70. DATA_OBJECT_TYPES m_type; // What context is the data object.
  71. MMC_COOKIE m_cookie; // What object the cookie represents
  72. CString m_string;
  73. CString m_class;
  74. INTERNAL & operator=(const INTERNAL& rhs)
  75. {
  76. if (&rhs == this)
  77. return *this;
  78. m_type = rhs.m_type;
  79. m_cookie = rhs.m_cookie;
  80. m_string = rhs.m_string;
  81. return *this;
  82. }
  83. BOOL operator==(const INTERNAL& rhs)
  84. {
  85. return rhs.m_string == m_string;
  86. }
  87. };
  88. // Debug instance counter
  89. #ifdef _DEBUG
  90. inline void DbgInstanceRemaining(char * pszClassName, int cInstRem)
  91. {
  92. char buf[100];
  93. wsprintfA(buf, "%s has %d instances left over.", pszClassName, cInstRem);
  94. ::MessageBoxA(NULL, buf, "Memory Leak!!!", MB_OK);
  95. }
  96. #define DEBUG_DECLARE_INSTANCE_COUNTER(cls) extern int s_cInst_##cls = 0;
  97. #define DEBUG_INCREMENT_INSTANCE_COUNTER(cls) ++(s_cInst_##cls);
  98. #define DEBUG_DECREMENT_INSTANCE_COUNTER(cls) --(s_cInst_##cls);
  99. #define DEBUG_VERIFY_INSTANCE_COUNT(cls) \
  100. extern int s_cInst_##cls; \
  101. if (s_cInst_##cls) DbgInstanceRemaining(#cls, s_cInst_##cls);
  102. #else
  103. #define DEBUG_DECLARE_INSTANCE_COUNTER(cls)
  104. #define DEBUG_INCREMENT_INSTANCE_COUNTER(cls)
  105. #define DEBUG_DECREMENT_INSTANCE_COUNTER(cls)
  106. #define DEBUG_VERIFY_INSTANCE_COUNT(cls)
  107. #endif
  108. /////////////////////////////////////////////////////////////////////
  109. #include "stdabout.h"
  110. #include "MyBasePathsInfo.h"
  111. #include <secondaryProppages.h>