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.

161 lines
3.6 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. //
  39. // Class Qualifier Values
  40. //
  41. static LPCWSTR g_wszCqv_Provider = L"IIS__PROVIDER";
  42. class CPusher
  43. {
  44. public:
  45. CPusher() : m_pNamespace(NULL),
  46. m_pCtx(NULL),
  47. m_bInitCalled(false),
  48. m_bInitSuccessful(false)
  49. {
  50. }
  51. virtual ~CPusher();
  52. HRESULT Initialize(
  53. CWbemServices* i_pNamespace,
  54. IWbemContext* i_pCtx);
  55. HRESULT Push(
  56. const CSchemaExtensions* i_pCatalog,
  57. CHashTable<WMI_CLASS *>* i_phashClasses,
  58. CHashTable<WMI_ASSOCIATION*>* i_phashAssocs);
  59. private:
  60. //
  61. // These are called by Push.
  62. //
  63. HRESULT RepositoryInSync(
  64. const CSchemaExtensions* i_pCatalog,
  65. bool* io_pbInSync);
  66. HRESULT PushClasses(
  67. CHashTable<WMI_CLASS *>* i_phashTable);
  68. HRESULT PushAssocs(
  69. CHashTable<WMI_ASSOCIATION *>* i_phashTable);
  70. HRESULT SetTimeStamp(
  71. const CSchemaExtensions* i_pCatalog);
  72. //
  73. // Called by PushClasses and PushAssocs
  74. //
  75. HRESULT DeleteChildren(
  76. LPCWSTR i_wszExtSuperClass);
  77. bool NeedToDeleteAssoc(
  78. IWbemClassObject* i_pObj) const;
  79. HRESULT GetObject(
  80. LPCWSTR i_wszClass,
  81. IWbemClassObject** o_ppObj);
  82. HRESULT SetClassInfo(
  83. IWbemClassObject* i_pObj,
  84. LPCWSTR i_wszClassName,
  85. ULONG i_iShipped);
  86. //
  87. // Called by PushClasses
  88. //
  89. HRESULT PrepareForPutClass(
  90. const WMI_CLASS* i_pElement,
  91. bool* io_pbPutNeeded);
  92. HRESULT SetProperties(
  93. const WMI_CLASS* i_pElement,
  94. IWbemClassObject* i_pObject) const;
  95. HRESULT SetMethods(
  96. const WMI_CLASS* i_pElement,
  97. IWbemClassObject* i_pObject) const;
  98. //
  99. // Called by PushAssocs
  100. //
  101. HRESULT SetAssociationComponent(
  102. IWbemClassObject* i_pObject,
  103. LPCWSTR i_wszComp,
  104. LPCWSTR i_wszClass) const;
  105. CWbemServices* m_pNamespace;
  106. IWbemContext* m_pCtx;
  107. //
  108. // These are base classes that are opened in "Initialize" to
  109. // prevent repeated WMI calls to m_pNamespace->GetObject().
  110. //
  111. CComPtr<IWbemClassObject> m_spBaseElementObject;
  112. CComPtr<IWbemClassObject> m_spBaseSettingObject;
  113. CComPtr<IWbemClassObject> m_spBaseElementSettingObject;
  114. CComPtr<IWbemClassObject> m_spBaseGroupPartObject;
  115. //
  116. // Class qualifier name/value pairs
  117. // Used in PushClasses and PushAssocs
  118. //
  119. LPCWSTR m_awszClassQualNames[2];
  120. CComVariant m_avtClassQualValues[2];
  121. bool m_bInitCalled;
  122. bool m_bInitSuccessful;
  123. };
  124. #endif // _pusher_h_