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.

123 lines
4.9 KiB

  1. #ifndef _WLBSCLASSES_INCLUDED_
  2. #define _WLBSCLASSES_INCLUDED_
  3. #include <atlbase.h>
  4. #include <wbemprov.h>
  5. #include "debug.h"
  6. //forward declarations
  7. struct ParsedObjectPath;
  8. ////////////////////////////////////////////////////////////////////////////////
  9. //
  10. // class CWlbs_Root
  11. //
  12. // Purpose: This class servers as the base for all classes that implement
  13. // specific Wbem classes. A pointer to this class is utilized
  14. // polymorphically within CWLBSProvider.
  15. //
  16. ////////////////////////////////////////////////////////////////////////////////
  17. class CWlbs_Root
  18. {
  19. public:
  20. CWlbs_Root(CWbemServices* a_pNameSpace, IWbemObjectSink* a_pResponseHandler);
  21. virtual ~CWlbs_Root();
  22. static void CreateExtendedStatus( CWbemServices* a_pNameSpace,
  23. IWbemClassObject** a_ppWbemInstance,
  24. DWORD a_dwErrorCode = 0,
  25. LPCWSTR a_szDescription = NULL
  26. );
  27. HRESULT virtual GetInstance(
  28. const ParsedObjectPath* a_pParsedPath,
  29. long a_lFlags = 0,
  30. IWbemContext* a_pIContex = NULL) = 0;
  31. HRESULT virtual DeleteInstance(
  32. const ParsedObjectPath* a_pParsedPath,
  33. long a_lFlags = 0,
  34. IWbemContext* a_pIContex = NULL
  35. )
  36. {
  37. throw _com_error( WBEM_E_NOT_SUPPORTED );
  38. return WBEM_E_FAILED;
  39. }
  40. HRESULT virtual PutInstance(
  41. IWbemClassObject* a_pInstance,
  42. long a_lFlags = 0,
  43. IWbemContext* a_pIContex = NULL
  44. )
  45. {
  46. throw _com_error( WBEM_E_NOT_SUPPORTED );
  47. return WBEM_E_FAILED;
  48. }
  49. HRESULT virtual EnumInstances(
  50. BSTR a_bstrClass = NULL,
  51. long a_lFlags = 0,
  52. IWbemContext* a_pIContex = NULL
  53. ) = 0;
  54. HRESULT virtual ExecMethod(
  55. const ParsedObjectPath* a_pParsedPath ,
  56. const BSTR& a_strMethodName,
  57. long a_lFlags = 0,
  58. IWbemContext* a_pIContex = NULL,
  59. IWbemClassObject* a_pIInParams = NULL
  60. )
  61. {
  62. throw _com_error(WBEM_E_NOT_SUPPORTED);
  63. return WBEM_E_NOT_SUPPORTED;
  64. }
  65. void SpawnInstance ( LPCWSTR a_szClassName,
  66. IWbemClassObject** a_ppWbemInstance );
  67. protected:
  68. CWbemServices* m_pNameSpace;
  69. IWbemObjectSink* m_pResponseHandler;
  70. void virtual GetMethodOutputInstance( LPCWSTR a_szMethodClass,
  71. const BSTR a_strMethodName,
  72. IWbemClassObject** a_ppOutputInstance);
  73. void UpdateConfigProp( wstring& a_szDest,
  74. const wstring& a_szSrc,
  75. LPCWSTR a_szPropName,
  76. IWbemClassObject* a_pNodeInstance );
  77. void UpdateConfigProp( bool& a_bDest,
  78. bool a_bSrc,
  79. LPCWSTR a_szPropName,
  80. IWbemClassObject* a_pNodeInstance );
  81. void UpdateConfigProp( DWORD& a_bDest,
  82. DWORD a_bSrc,
  83. LPCWSTR a_szPropName,
  84. IWbemClassObject* a_pNodeInstance );
  85. static void ConstructHostName( wstring& a_wstrHostName,
  86. DWORD a_dwClusIP,
  87. DWORD a_dwHostID );
  88. public:
  89. static DWORD ExtractHostID (const wstring& a_wstrName);
  90. static DWORD ExtractClusterIP(const wstring& a_wstrName);
  91. private:
  92. //This constructor must not be used.
  93. CWlbs_Root();
  94. };
  95. class CWlbsClusterWrapper;
  96. class CWlbsControlWrapper;
  97. CWlbsClusterWrapper* GetClusterFromHostName(CWlbsControlWrapper* pControl,
  98. wstring wstrHostName);
  99. #endif //_WLBSCLASSES_INCLUDED_