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.

159 lines
3.6 KiB

  1. //=================================================================
  2. //
  3. // assoc.h -- Generic association class
  4. //
  5. // Copyright 1999 Microsoft Corporation
  6. //
  7. //=================================================================
  8. class CAssociation : public Provider
  9. {
  10. public:
  11. CAssociation(
  12. LPCWSTR pwszClassName,
  13. LPCWSTR pwszNamespaceName,
  14. LPCWSTR pwszLeftClassName,
  15. LPCWSTR pwszRightClassName,
  16. LPCWSTR pwszLeftPropertyName,
  17. LPCWSTR pwszRightPropertyName
  18. );
  19. ~CAssociation();
  20. HRESULT ExecQuery(
  21. MethodContext* pMethodContext,
  22. CFrameworkQuery &pQuery,
  23. long lFlags
  24. );
  25. HRESULT GetObject(
  26. CInstance* pInstance,
  27. long lFlags,
  28. CFrameworkQuery &pQuery
  29. );
  30. HRESULT EnumerateInstances(
  31. MethodContext *pMethodContext,
  32. long lFlags /*= 0L*/
  33. );
  34. protected:
  35. bool IsInstance(const CInstance *pInstance);
  36. static HRESULT WINAPI StaticEnumerationCallback(
  37. Provider* pThat,
  38. CInstance* pInstance,
  39. MethodContext* pContext,
  40. void* pUserData
  41. );
  42. virtual HRESULT RetrieveLeftInstance(
  43. LPCWSTR lpwszObjPath,
  44. CInstance **ppInstance,
  45. MethodContext *pMethodContext
  46. );
  47. virtual HRESULT RetrieveRightInstance(
  48. LPCWSTR lpwszObjPath,
  49. CInstance **ppInstance,
  50. MethodContext *pMethodContext
  51. );
  52. virtual HRESULT EnumerationCallback(
  53. CInstance *pRight,
  54. MethodContext *pMethodContext,
  55. void *pUserData
  56. );
  57. virtual HRESULT ValidateLeftObjectPaths(
  58. MethodContext *pMethodContext,
  59. const CHStringArray &sPaths,
  60. TRefPointerCollection<CInstance> &lefts
  61. );
  62. virtual HRESULT ValidateRightObjectPaths(
  63. MethodContext *pMethodContext,
  64. const CHStringArray &sPaths,
  65. TRefPointerCollection<CInstance> &lefts
  66. );
  67. virtual BOOL AreRelated(
  68. const CInstance *pLeft,
  69. const CInstance *pRight
  70. )
  71. {
  72. return IsInstance(pLeft) && IsInstance(pRight);
  73. }
  74. virtual HRESULT LoadPropertyValues(
  75. CInstance *pInstance,
  76. const CInstance *pLeft,
  77. const CInstance *pRight
  78. )
  79. {
  80. return WBEM_S_NO_ERROR;
  81. }
  82. virtual HRESULT GetLeftInstances(
  83. MethodContext *pMethodContext,
  84. TRefPointerCollection<CInstance> &lefts
  85. );
  86. virtual HRESULT GetRightInstances(
  87. MethodContext *pMethodContext,
  88. TRefPointerCollection<CInstance> *lefts
  89. );
  90. LPCWSTR m_pwszLeftClassName;
  91. LPCWSTR m_pwszRightClassName;
  92. LPCWSTR m_pwszLeftPropertyName;
  93. LPCWSTR m_pwszRightPropertyName;
  94. };
  95. /*
  96. class CAssocSystemToOS : public CAssociation
  97. {
  98. public:
  99. CAssocSystemToOS(
  100. LPCWSTR pwszClassName,
  101. LPCWSTR pwszNamespaceName,
  102. LPCWSTR pwszLeftClassName,
  103. LPCWSTR pwszRightClassName,
  104. LPCWSTR pwszLeftPropertyName,
  105. LPCWSTR pwszRightPropertyName
  106. );
  107. ~CAssocSystemToOS();
  108. protected:
  109. HRESULT LoadPropertyValues(
  110. CInstance *pInstance,
  111. const CInstance *pLeft,
  112. const CInstance *pRight
  113. );
  114. };
  115. */