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.

135 lines
3.1 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1998.
  5. //
  6. // File: TxtSinkDump.hxx
  7. //
  8. // Contents: Contains the implementation of ICiCTextSink Interface.
  9. //
  10. // History: Jan-13-98 KLam Created
  11. //
  12. //----------------------------------------------------------------------------
  13. #pragma once
  14. #include <query.h>
  15. #include <stdio.h>
  16. #include <filtntfy.h>
  17. #include <cisem.hxx>
  18. //
  19. // Standard Ole exports
  20. //
  21. STDAPI DllGetClassObject( REFCLSID cid,
  22. REFIID iid,
  23. void ** ppvObj );
  24. STDAPI DllCanUnloadNow ();
  25. STDAPI DllRegisterServer ();
  26. STDAPI DllUnregisterServer ();
  27. //+---------------------------------------------------------------------------
  28. //
  29. // Class: CTextSinkDump
  30. //
  31. // Purpose: Object that dumps text from filters to a file
  32. //
  33. // History: Jan-13-98 KLam Created
  34. //
  35. // Notes:
  36. //
  37. //----------------------------------------------------------------------------
  38. class CFilterStatusDump : public IFilterStatus
  39. {
  40. public:
  41. //
  42. // From IUnknown
  43. //
  44. virtual SCODE STDMETHODCALLTYPE QueryInterface( REFIID riid, void **ppvObject );
  45. virtual ULONG STDMETHODCALLTYPE AddRef();
  46. virtual ULONG STDMETHODCALLTYPE Release();
  47. //
  48. // From IFilterStatus
  49. //
  50. virtual SCODE STDMETHODCALLTYPE Initialize( WCHAR const * pwszCatalogName, WCHAR const * pwszCatalogPath );
  51. virtual SCODE STDMETHODCALLTYPE PreFilter( WCHAR const * pwszPath );
  52. virtual SCODE STDMETHODCALLTYPE FilterLoad( WCHAR const * pwszPath, SCODE scFilterStatus );
  53. virtual SCODE STDMETHODCALLTYPE PostFilter( WCHAR const * pwszPath, SCODE scFilterStatus );
  54. //
  55. // Local Methods
  56. //
  57. private:
  58. friend class CFilterStatusCF;
  59. inline CFilterStatusDump ();
  60. ~CFilterStatusDump ();
  61. FILE * _pfOutput; // Data written here
  62. BOOL _fSuccessReport; // TRUE --> Report success as well as error
  63. CMutexSem _mutex; // Cheap and easy "ThreadingModel = Both"
  64. ULONG _cRefs; // Refcount
  65. };
  66. //+---------------------------------------------------------------------------
  67. //
  68. // Class: CTextSinkDumpCF
  69. //
  70. // Purpose: Class factory for ICiCTextSink
  71. //
  72. // History: Jan-13-98 KLam Created
  73. //
  74. //----------------------------------------------------------------------------
  75. class CFilterStatusCF : public IClassFactory
  76. {
  77. public:
  78. //
  79. // IUnknown
  80. //
  81. virtual SCODE STDMETHODCALLTYPE QueryInterface ( REFIID riid, void **ppvObject );
  82. virtual ULONG STDMETHODCALLTYPE AddRef ();
  83. virtual ULONG STDMETHODCALLTYPE Release ();
  84. //
  85. // IClassFactory
  86. //
  87. virtual SCODE STDMETHODCALLTYPE CreateInstance ( IUnknown * pUnkOuter,
  88. REFIID riid,
  89. void ** ppvObject );
  90. virtual SCODE STDMETHODCALLTYPE LockServer ( BOOL fLock );
  91. //
  92. // Local methods
  93. //
  94. CFilterStatusCF ();
  95. ~CFilterStatusCF ();
  96. private:
  97. ULONG _cRefs;
  98. };