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.

132 lines
3.4 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1995.
  5. //
  6. // File: CCodeFt.hxx
  7. //
  8. // Contents:
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // History: 04-29-97 DanpoZ (Danpo Zhang) Created
  15. //
  16. //----------------------------------------------------------------------------
  17. #ifndef _CCODEFT_HXX_
  18. #define _CCODEFT_HXX_
  19. #include <urlmon.h>
  20. #include <urlmki.h>
  21. //+---------------------------------------------------------------------------
  22. //
  23. // Class: CStdZFilter
  24. //
  25. // Purpose: Standard MS Compressor/DeCompressor
  26. // It support deflate and gzip schema
  27. //
  28. // Interface: [support all IDataFilter]
  29. //
  30. // History: 04-29-97 DanpoZ (Danpo Zhang) Created
  31. //
  32. //----------------------------------------------------------------------------
  33. class CStdZFilter : public IDataFilter
  34. {
  35. public:
  36. // IUnknown methods
  37. STDMETHODIMP QueryInterface(REFIID iid, void **ppvObj);
  38. STDMETHODIMP_(ULONG) AddRef(void);
  39. STDMETHODIMP_(ULONG) Release(void);
  40. STDMETHODIMP DoEncode(
  41. DWORD dwFlags,
  42. LONG lInBufferSize,
  43. BYTE* pbInBuffer,
  44. LONG lOutBufferSize,
  45. BYTE* pbOutBuffer,
  46. LONG lInBytesAvailable,
  47. LONG* plInBytesRead,
  48. LONG* plOutBytesWritten,
  49. DWORD dwReserved
  50. );
  51. STDMETHODIMP DoDecode(
  52. DWORD dwFlags,
  53. LONG lInBufferSize,
  54. BYTE* pbInBuffer,
  55. LONG lOutBufferSize,
  56. BYTE* pbOutBuffer,
  57. LONG lInBytesAvailable,
  58. LONG* plInBytesRead,
  59. LONG* plOutBytesWritten,
  60. DWORD dwReserved
  61. );
  62. STDMETHODIMP SetEncodingLevel(DWORD dwEncLevel);
  63. // ctor and dtor
  64. CStdZFilter(ULONG ulSchema);
  65. ~CStdZFilter();
  66. // init
  67. HRESULT InitFilter();
  68. private:
  69. CRefCount _CRefs;
  70. void* _pEncodeCtx;
  71. void* _pDecodeCtx;
  72. INT _cEncLevel;
  73. ULONG _ulSchema;
  74. };
  75. //+---------------------------------------------------------------------------
  76. //
  77. // Class: CEncodingFilterFactory
  78. //
  79. // Purpose: Factory class that creates DataFilter
  80. //
  81. // Interface: [support all IEncodingFilterFactory]
  82. // [Creates IDataFilter object]
  83. //
  84. // History: 04-29-97 DanpoZ (Danpo Zhang) Created
  85. //
  86. //----------------------------------------------------------------------------
  87. class CEncodingFilterFactory : public IEncodingFilterFactory
  88. {
  89. public:
  90. // IUnknown methods
  91. STDMETHODIMP QueryInterface(REFIID iid, void **ppvObj);
  92. STDMETHODIMP_(ULONG) AddRef(void);
  93. STDMETHODIMP_(ULONG) Release(void);
  94. STDMETHODIMP FindBestFilter(
  95. LPCWSTR pwzCodeIn,
  96. LPCWSTR pwzCodeOut,
  97. DATAINFO info,
  98. IDataFilter** ppDF
  99. );
  100. STDMETHODIMP GetDefaultFilter(
  101. LPCWSTR pwzCodeIn,
  102. LPCWSTR pwzCodeOut,
  103. IDataFilter** ppDF
  104. );
  105. // ctor and dtor
  106. CEncodingFilterFactory();
  107. ~CEncodingFilterFactory();
  108. private:
  109. STDMETHODIMP LookupClsIDFromReg(
  110. LPCWSTR pwzCodeIn,
  111. LPCWSTR pwzCodeOut,
  112. CLSID* pclsid,
  113. DWORD dwFlags
  114. );
  115. private:
  116. CRefCount _CRefs;
  117. };
  118. #endif