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.

91 lines
3.6 KiB

  1. // HistoryParser.h: interface for the CHistoryParser class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. //hcp://system/sysinfo/msinfo.htm
  5. #if !defined(AFX_HISTORYPARSER_H__3ECAF67C_3080_4166_A5FB_BF98C0BD9588__INCLUDED_)
  6. #define AFX_HISTORYPARSER_H__3ECAF67C_3080_4166_A5FB_BF98C0BD9588__INCLUDED_
  7. #include "fdi.h" // Added by ClassView
  8. #if _MSC_VER > 1000
  9. #pragma once
  10. #endif // _MSC_VER > 1000
  11. #include "datasource.h"
  12. #include "category.h"
  13. extern CTime GetDateFromString(const CString& strDate, int nTimeZone);
  14. extern CString GetIDForClass(CString strClass);
  15. extern CTime GetDeltaTime(CComPtr<IXMLDOMNode> pDorSNode);
  16. extern HRESULT GetTimeStampFromFromD_or_SNodeNode(CComPtr<IXMLDOMNode> pDorSNode,CString* pString, int& nTimeZone);
  17. extern HRESULT GetDataCollectionNode(CComPtr<IXMLDOMDocument> pXMLDoc,CComPtr<IXMLDOMNode>& pDCNode);
  18. extern CString GetPNPNameByID(CComPtr<IXMLDOMDocument> pDoc,CComBSTR bstrPNPID);
  19. //-----------------------------------------------------------------------------
  20. // Encapsulates data from a single Instance node in the XML blob
  21. // Has methods for comparing identical instances across time slices
  22. //-----------------------------------------------------------------------------
  23. class CInstance : public CObject
  24. {
  25. CString m_strClassName;
  26. public:
  27. CString GetChangeType()
  28. {
  29. //Note:there will be no change if data is from snapshot
  30. CString strChange;
  31. m_mapNameValue.Lookup(_T("Change"),strChange);
  32. return strChange;
  33. }
  34. CString GetClassFriendlyName();
  35. HRESULT ProcessPNPAllocatedResource(CComPtr<IXMLDOMNode> pInstanceNode);
  36. HRESULT ProcessPropertyDotReferenceNodes(CComPtr<IXMLDOMNode> pInstanceNameNode,CString* pstrClassName, CString* pstrKeyName,CString* pstrKeyValue);
  37. CString GetInstanceDescription();
  38. CString GetDescriptionForClass(CString strClass);
  39. CString GetIDForClass(CString strClass);
  40. CInstance(CTime tmstmp, CComPtr<IXMLDOMNode> pInstanceNode,CString strClass);
  41. CMapStringToString m_mapNameValue;
  42. CTime m_tmstamp;
  43. CString GetClassName(){return m_strClassName;};
  44. BOOL GetValueFromMap(CString strKey,CString& strVal)
  45. {
  46. return m_mapNameValue.Lookup(strKey, strVal);
  47. };
  48. CString GetInstanceID();
  49. };
  50. //-----------------------------------------------------------------------------
  51. // Encapsulates the parsing of history data (deltas) from the history XML blob
  52. //-----------------------------------------------------------------------------
  53. class CHistoryParser : public CObject
  54. {
  55. private:
  56. CTime m_tmBack;
  57. CObList m_listInstances;
  58. CComPtr<IXMLDOMDocument> m_pDoc;
  59. CMSInfoHistoryCategory* m_pHistCat;
  60. void DeleteAllInstances();
  61. public:
  62. int m_nDeltasBack;
  63. BOOL AreThereChangeLines();
  64. BOOL m_fChangeLines;
  65. HRESULT Refresh(CMSInfoHistoryCategory* pHistCat,int nDeltasBack);
  66. HRESULT GetDeltaAndSnapshotNodes(CComPtr<IXMLDOMNodeList>& pDeltaList);
  67. CHistoryParser(CComPtr<IXMLDOMDocument> pDoc);
  68. virtual ~CHistoryParser();
  69. CInstance* FindPreviousInstance(CInstance* pNewInstance);
  70. CString GetIDForClass(CString strClass);
  71. void CreateChangeStrings(CInstance* pOld, CInstance* pNew);
  72. void ResetInstance(CInstance* pOld, CInstance* pNew);
  73. void ProcessInstance(CInstance* pNewInstance);
  74. HRESULT GetInstanceNodeList(CString strClass,CComPtr<IXMLDOMNode> pDeltaNode, CComPtr<IXMLDOMNodeList>& pInstanceList);
  75. HRESULT ProcessDeltaNode(CComPtr<IXMLDOMNode> pDeltaNode,CString strClass);
  76. HRESULT ProcessDeltas(CComPtr<IXMLDOMNodeList> pDeltaList,CString strClassName,int nDeltasBack);
  77. };
  78. #endif // !defined(AFX_HISTORYPARSER_H__3ECAF67C_3080_4166_A5FB_BF98C0BD9588__INCLUDED_)