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.

70 lines
1.8 KiB

  1. /*++
  2. Copyright (c) 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. #if SXS_PRECOMPILED_MANIFESTS_ENABLED
  13. #include <stdio.h>
  14. #include <windows.h>
  15. #include <ole2.h>
  16. #include <xmlparser.h>
  17. #include "simplefp.h"
  18. class __declspec(uuid("79fd77ad-f467-44ad-8cf9-2f259eeb3878"))
  19. PCMTestFactory : public IXMLNodeFactory
  20. {
  21. public:
  22. // IUnknown methods
  23. STDMETHODIMP QueryInterface(REFIID riid,void ** ppv);
  24. STDMETHODIMP_(ULONG) AddRef();
  25. STDMETHODIMP_(ULONG) Release();
  26. // IXMLNodeFactory
  27. STDMETHODIMP NotifyEvent(IXMLNodeSource __RPC_FAR *pSource, XML_NODEFACTORY_EVENT iEvt);
  28. STDMETHODIMP BeginChildren(IXMLNodeSource __RPC_FAR *pSource, XML_NODE_INFO* __RPC_FAR pNodeInfo);
  29. STDMETHODIMP EndChildren(IXMLNodeSource __RPC_FAR *pSource, BOOL fEmptyNode, XML_NODE_INFO* __RPC_FAR pNodeInfo);
  30. STDMETHODIMP Error(IXMLNodeSource __RPC_FAR *pSource, HRESULT hrErrorCode, USHORT cNumRecs, XML_NODE_INFO* __RPC_FAR * __RPC_FAR apNodeInfo)
  31. {
  32. return hrErrorCode;
  33. }
  34. STDMETHODIMP CreateNode(IXMLNodeSource __RPC_FAR *pSource, PVOID pNodeParent, USHORT cNumRecs, XML_NODE_INFO* __RPC_FAR * __RPC_FAR apNodeInfo);
  35. PCMTestFactory(PCWSTR pFileName = NULL) : m_cRef(0)
  36. {
  37. m_pFileStream = new CSimpleFileStream(pFileName);
  38. }
  39. ~PCMTestFactory()
  40. {
  41. CSxsPreserveLastError ple;
  42. ASSERT(m_cRef == 0);
  43. FUSION_DELETE_SINGLETON(m_pFileStream);
  44. ple.Restore();
  45. }
  46. private :
  47. VOID PrintSingleXMLNode(XML_NODE_INFO * pNode);
  48. VOID PrintXMLNodeType(DWORD dwType);
  49. ULONG m_cRef;
  50. CSimpleFileStream* m_pFileStream;
  51. };
  52. #endif