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.

121 lines
4.6 KiB

  1. // attachment.h: interface for the CAttachmentData class.
  2. //
  3. // Copyright (c)1997-1999 Microsoft Corporation
  4. //
  5. //////////////////////////////////////////////////////////////////////
  6. #if !defined(AFX_ATTACHMENT_H__BD7570F7_9F0E_4C6B_B525_E078691B6D0E__INCLUDED_)
  7. #define AFX_ATTACHMENT_H__BD7570F7_9F0E_4C6B_B525_E078691B6D0E__INCLUDED_
  8. #if _MSC_VER >= 1000
  9. #pragma once
  10. #endif // _MSC_VER >= 1000
  11. #include "GenericClass.h"
  12. /*
  13. Class description
  14. Naming:
  15. CPodData stands for a Pod of Data.
  16. Base class:
  17. CGenericClass, because it is a class representing a WMI
  18. object - its WMI class name is Sce_PodData
  19. Purpose of class:
  20. (1) Sce_PodData is one of the extension models we hope to establish so that
  21. other providers can deposit their object information into our store.
  22. Basically, we give other providers a payload member called "Value" where
  23. they package their data in a string. See class definition in sceprov.mof.
  24. (2) This is not in active use as our extension model. The biggest problem
  25. with this model is that we force other providers to do: (a) their instance
  26. must become store-oriented - PutInstance really means to persist the object.
  27. That is not most providers do. (b) they have to come up with a three of the
  28. four key properties (section, pod id, and key). It's challenging for them
  29. to do this because together with the store path, these four properties must
  30. form the key of the instance. (c) they have to pacakge their data into one
  31. string.
  32. Design:
  33. (1) it implements all pure virtual functions declared in CGenericClass
  34. so that it is a concrete class to create.
  35. (2) Since it has virtual functions, the desctructor should be virtual.
  36. Use:
  37. (1) We probably will never directly use this class. All its use is driven by
  38. CGenericClass's interface (its virtual functions).
  39. */
  40. class CPodData : public CGenericClass
  41. {
  42. public:
  43. CPodData(
  44. ISceKeyChain *pKeyChain,
  45. IWbemServices *pNamespace,
  46. IWbemContext *pCtx = NULL
  47. );
  48. virtual ~CPodData();
  49. virtual HRESULT PutInst(
  50. IWbemClassObject *pInst,
  51. IWbemObjectSink *pHandler,
  52. IWbemContext *pCtx
  53. );
  54. virtual HRESULT CreateObject(
  55. IWbemObjectSink *pHandler,
  56. ACTIONTYPE atAction
  57. );
  58. private:
  59. HRESULT ConstructInstance(
  60. IWbemObjectSink * pHandler,
  61. CSceStore * pSceStore,
  62. LPCWSTR wszLogStorePath,
  63. LPCWSTR wszPodID,
  64. LPCWSTR wszSection,
  65. LPCWSTR wszKey,
  66. BOOL bPostFilter
  67. );
  68. HRESULT DeleteInstance(
  69. CSceStore* pSceStore,
  70. LPCWSTR wszPodID,
  71. LPCWSTR wszSection,
  72. LPCWSTR wszKey
  73. );
  74. HRESULT ValidatePodID(LPCWSTR wszPodID);
  75. HRESULT ConstructQueryInstances(
  76. IWbemObjectSink *pHandler,
  77. CSceStore* pSceStore,
  78. LPCWSTR wszLogStorePath,
  79. LPCWSTR wszPodID,
  80. LPCWSTR wszSection,
  81. BOOL bPostFilter
  82. );
  83. HRESULT PutPodDataInstance(
  84. IWbemObjectSink *pHandler,
  85. LPCWSTR wszStoreName,
  86. LPCWSTR wszPodID,
  87. LPCWSTR wszSection,
  88. LPCWSTR wszKey,
  89. LPCWSTR wszValue,
  90. BOOL bPostFilter
  91. );
  92. };
  93. #endif // !defined(AFX_ATTACHMENT_H__BD7570F7_9F0E_4C6B_B525_E078691B6D0E__INCLUDED_)