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.

162 lines
3.9 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. pusher.h
  5. Abstract:
  6. This file contains the definition of the CPusher class.
  7. This class contains the logic for pushing schema to the repository.
  8. Author:
  9. Mohit Srivastava 28-Nov-00
  10. Revision History:
  11. --*/
  12. #ifndef _pusher_h_
  13. #define _pusher_h_
  14. #include "schemaextensions.h"
  15. //
  16. // Property Names
  17. //
  18. static LPCWSTR g_wszProp_Class = L"__CLASS";
  19. static LPCWSTR g_wszProp_Name = L"Name";
  20. //
  21. // Property Qualifier Names
  22. //
  23. static LPCWSTR g_wszPq_Key = L"Key";
  24. static LPCWSTR g_wszPq_CimType = L"CIMTYPE";
  25. static LPCWSTR g_wszPq_Read = L"Read";
  26. static LPCWSTR g_wszPq_Write = L"Write";
  27. //
  28. // Class Qualifier Names
  29. //
  30. static LPCWSTR g_wszCq_Provider = L"provider";
  31. static LPCWSTR g_wszCq_Dynamic = L"dynamic";
  32. static LPCWSTR g_wszCq_Extended = L"extended";
  33. static LPCWSTR g_wszCq_SchemaTS = L"MbSchemaTimeStamp";
  34. //
  35. // Method Qualifier Names
  36. //
  37. static LPCWSTR g_wszMq_Implemented = L"Implemented";
  38. static LPCWSTR g_wszMq_Bypass_Getobject = L"bypass_getobject";
  39. //
  40. // Class Qualifier Values
  41. //
  42. static LPCWSTR g_wszCqv_Provider = L"IIS__PROVIDER";
  43. class CPusher
  44. {
  45. public:
  46. CPusher() : m_pNamespace(NULL),
  47. m_pCtx(NULL),
  48. m_bInitCalled(false),
  49. m_bInitSuccessful(false)
  50. {
  51. }
  52. virtual ~CPusher();
  53. HRESULT Initialize(
  54. CWbemServices* i_pNamespace,
  55. IWbemContext* i_pCtx);
  56. HRESULT Push(
  57. const CSchemaExtensions* i_pCatalog,
  58. CHashTable<WMI_CLASS *>* i_phashClasses,
  59. CHashTable<WMI_ASSOCIATION*>* i_phashAssocs);
  60. private:
  61. //
  62. // These are called by Push.
  63. //
  64. HRESULT RepositoryInSync(
  65. const CSchemaExtensions* i_pCatalog,
  66. bool* io_pbInSync);
  67. HRESULT PushClasses(
  68. CHashTable<WMI_CLASS *>* i_phashTable);
  69. HRESULT PushAssocs(
  70. CHashTable<WMI_ASSOCIATION *>* i_phashTable);
  71. HRESULT SetTimeStamp(
  72. const CSchemaExtensions* i_pCatalog);
  73. //
  74. // Called by PushClasses and PushAssocs
  75. //
  76. HRESULT DeleteChildren(
  77. LPCWSTR i_wszExtSuperClass);
  78. bool NeedToDeleteAssoc(
  79. IWbemClassObject* i_pObj) const;
  80. HRESULT GetObject(
  81. LPCWSTR i_wszClass,
  82. IWbemClassObject** o_ppObj);
  83. HRESULT SetClassInfo(
  84. IWbemClassObject* i_pObj,
  85. LPCWSTR i_wszClassName,
  86. ULONG i_iShipped);
  87. //
  88. // Called by PushClasses
  89. //
  90. HRESULT PrepareForPutClass(
  91. const WMI_CLASS* i_pElement,
  92. bool* io_pbPutNeeded);
  93. HRESULT SetProperties(
  94. const WMI_CLASS* i_pElement,
  95. IWbemClassObject* i_pObject) const;
  96. HRESULT SetMethods(
  97. const WMI_CLASS* i_pElement,
  98. IWbemClassObject* i_pObject) const;
  99. //
  100. // Called by PushAssocs
  101. //
  102. HRESULT SetAssociationComponent(
  103. IWbemClassObject* i_pObject,
  104. LPCWSTR i_wszComp,
  105. LPCWSTR i_wszClass) const;
  106. CWbemServices* m_pNamespace;
  107. IWbemContext* m_pCtx;
  108. //
  109. // These are base classes that are opened in "Initialize" to
  110. // prevent repeated WMI calls to m_pNamespace->GetObject().
  111. //
  112. CComPtr<IWbemClassObject> m_spBaseElementObject;
  113. CComPtr<IWbemClassObject> m_spBaseSettingObject;
  114. CComPtr<IWbemClassObject> m_spBaseElementSettingObject;
  115. CComPtr<IWbemClassObject> m_spBaseGroupPartObject;
  116. //
  117. // Class qualifier name/value pairs
  118. // Used in PushClasses and PushAssocs
  119. //
  120. LPCWSTR m_awszClassQualNames[2];
  121. CComVariant m_avtClassQualValues[2];
  122. bool m_bInitCalled;
  123. bool m_bInitSuccessful;
  124. };
  125. #endif // _pusher_h_