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.

104 lines
3.7 KiB

  1. // XMLObject.h: interface for the CXMLObject class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_XMLOBJECT_H__916BE5F2_D29F_484A_9084_1ABB3759F117__INCLUDED_)
  5. #define AFX_XMLOBJECT_H__916BE5F2_D29F_484A_9084_1ABB3759F117__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. //
  10. // From HelpServiceTypeLib.idl
  11. //
  12. #include <HelpServiceTypeLib.h>
  13. #include "wmiabstraction.h"
  14. #include "msxml.h"
  15. #include "category.h"
  16. #include "datasource.h"
  17. class CXMLObject : public CWMIObject
  18. {
  19. private:
  20. CComPtr<IXMLDOMNode> m_pNode;
  21. public:
  22. CComVariant m_varValue;
  23. HRESULT GetPath(CString* strPath);
  24. HRESULT GetDependent(CString* pstrAntecedent);
  25. HRESULT GetAntecedent(CString* pstrAntecedent);
  26. CString m_strClassName;
  27. CXMLObject();
  28. virtual ~CXMLObject();
  29. //HRESULT GetKeybinding(CString* pstrKBName, CString* pstrKBValue);
  30. //HRESULT GetAssociationNode(CComPtr<IXMLDOMNode>& pAssocNode);
  31. HRESULT GetPROPERTYNode(LPCTSTR szProperty,CComPtr<IXMLDOMNode>& pPropNode);
  32. HRESULT Create(CComPtr<IXMLDOMNode> pNode,CString strClassName);
  33. HRESULT GetValue(LPCTSTR szProperty, VARIANT * pvarValue);
  34. HRESULT GetValueString(LPCTSTR szProperty, CString * pstrValue);
  35. HRESULT GetValueDWORD(LPCTSTR szProperty, DWORD * pdwValue);
  36. HRESULT GetValueTime(LPCTSTR szProperty, SYSTEMTIME * psystimeValue);
  37. HRESULT GetValueDoubleFloat(LPCTSTR szProperty, double * pdblValue);
  38. HRESULT GetValueValueMap(LPCTSTR szProperty, CString * pstrValue);
  39. };
  40. class CXMLObjectCollection : public CWMIObjectCollection
  41. {
  42. CComPtr<IXMLDOMDocument> m_pXMLDoc;//if we get a build error here, we may need to undefine _msxml_h_
  43. CComPtr<IXMLDOMNodeList> m_pList;
  44. public:
  45. CString m_strClassName;
  46. HRESULT Create(LPCTSTR szClass, LPCTSTR szProperties);
  47. HRESULT GetNext(CWMIObject ** ppObject);
  48. CXMLObjectCollection(CComPtr<IXMLDOMDocument> pXMLDoc);
  49. virtual ~CXMLObjectCollection();
  50. };
  51. class CXMLHelper : public CWMIHelper
  52. {
  53. private:
  54. CComPtr<IXMLDOMDocument> m_pXMLDoc;//if we get a build error here, we may need to undefine _msxml_h_
  55. public:
  56. CXMLHelper(CComPtr<IXMLDOMDocument> pXMLDoc);
  57. virtual ~CXMLHelper();
  58. HRESULT Enumerate(LPCTSTR szClass, CWMIObjectCollection ** ppCollection, LPCTSTR szProperties);
  59. HRESULT GetObject(LPCTSTR szObjectPath, CWMIObject ** ppObject);
  60. HRESULT Create(LPCTSTR szMachine) { return S_OK; };
  61. };
  62. class CXMLDataSource;
  63. class CXMLSnapshotCategory : public CMSInfoLiveCategory
  64. {
  65. public:
  66. void AppendFilenameToCaption(CString strFileName)
  67. {
  68. CString strCaption;
  69. GetNames(&strCaption, NULL); // forces the caption name to be loaded
  70. //m_strCaption += _T(" ") + strFileName;
  71. //a-stephl fix to OSR v 4.1 bug # 137363
  72. m_strCaption += _T(" [") + strFileName;
  73. m_strCaption += _T("]");
  74. //end a-stephl fix to OSR v 4.1 bug # 137363
  75. }
  76. CXMLSnapshotCategory::CXMLSnapshotCategory(UINT uiCaption, LPCTSTR szName, RefreshFunction pFunction, DWORD dwRefreshIndex, CMSInfoCategory * pParent, CMSInfoCategory * pPrevious, CMSInfoColumn * pColumns, BOOL fDynamicColumns, CategoryEnvironment environment)
  77. : CMSInfoLiveCategory(uiCaption,szName,pFunction,dwRefreshIndex,pParent,pPrevious, _T(""), pColumns, fDynamicColumns,environment)
  78. {};
  79. //this constructor copies caption, name, etc from one of the existing (static) CMSInfoLiveCategory's
  80. CXMLSnapshotCategory(CMSInfoLiveCategory* pLiveCat,CXMLSnapshotCategory* pParent,CXMLSnapshotCategory* pPrevSibling);
  81. virtual BOOL Refresh(CXMLDataSource * pSource, BOOL fRecursive);
  82. virtual DataSourceType GetDataSourceType() { return XML_SNAPSHOT;};
  83. };
  84. #endif // !defined(AFX_XMLOBJECT_H__916BE5F2_D29F_484A_9084_1ABB3759F117__INCLUDED_)