Source code of Windows XP (NT5)
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.

66 lines
1.8 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. pcmtestfactory.h
  5. Abstract:
  6. definition of a nodefactory for Precompiled manifest testing
  7. Author:
  8. Xiaoyu Wu (xiaoyuw) June 2000
  9. Revision History:
  10. --*/
  11. #pragma once
  12. #include <stdio.h>
  13. #include <windows.h>
  14. #include <ole2.h>
  15. #include <xmlparser.h>
  16. #include "simplefp.h"
  17. class __declspec(uuid("79fd77ad-f467-44ad-8cf9-2f259eeb3878"))
  18. PCMTestFactory : public IXMLNodeFactory
  19. {
  20. public:
  21. // IUnknown methods
  22. STDMETHODIMP QueryInterface(REFIID riid,void ** ppv);
  23. STDMETHODIMP_(ULONG) AddRef();
  24. STDMETHODIMP_(ULONG) Release();
  25. // IXMLNodeFactory
  26. STDMETHODIMP NotifyEvent(IXMLNodeSource __RPC_FAR *pSource, XML_NODEFACTORY_EVENT iEvt);
  27. STDMETHODIMP BeginChildren(IXMLNodeSource __RPC_FAR *pSource, XML_NODE_INFO* __RPC_FAR pNodeInfo);
  28. STDMETHODIMP EndChildren(IXMLNodeSource __RPC_FAR *pSource, BOOL fEmptyNode, XML_NODE_INFO* __RPC_FAR pNodeInfo);
  29. STDMETHODIMP Error(IXMLNodeSource __RPC_FAR *pSource, HRESULT hrErrorCode, USHORT cNumRecs, XML_NODE_INFO* __RPC_FAR * __RPC_FAR apNodeInfo)
  30. {
  31. return hrErrorCode;
  32. }
  33. STDMETHODIMP CreateNode(IXMLNodeSource __RPC_FAR *pSource, PVOID pNodeParent, USHORT cNumRecs, XML_NODE_INFO* __RPC_FAR * __RPC_FAR apNodeInfo);
  34. PCMTestFactory(PCSTR pFileName= NULL) : m_cRef(0)
  35. {
  36. m_pFileStream = new CSimpleFileStream(pFileName);
  37. }
  38. ~PCMTestFactory(){
  39. CSxsPreserveLastError ple;
  40. ASSERT(m_cRef == 0);
  41. if (m_pFileStream)
  42. FUSION_DELETE_SINGLETON(m_pFileStream);
  43. ple.Restore();
  44. }
  45. private :
  46. VOID PrintSingleXMLNode(XML_NODE_INFO * pNode);
  47. VOID PrintXMLNodeType(DWORD dwType);
  48. ULONG m_cRef;
  49. CSimpleFileStream* m_pFileStream;
  50. };