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.

67 lines
1.4 KiB

  1. class CMIMEBitMatcher
  2. {
  3. public:
  4. CMIMEBitMatcher(); // Default constructor
  5. ~CMIMEBitMatcher(); // Destructor
  6. HRESULT InitFromBinary( const BYTE* pData, ULONG nBytes,
  7. ULONG* pnBytesToMatch );
  8. HRESULT Match( const BYTE* pBytes, ULONG nBytes ) const;
  9. protected:
  10. char m_achSignature[4];
  11. public:
  12. CMIMEBitMatcher* m_pNext;
  13. protected:
  14. ULONG m_nOffset;
  15. ULONG m_nBytes;
  16. BYTE* m_pMask;
  17. BYTE* m_pData;
  18. };
  19. class CMIMEType
  20. {
  21. public:
  22. CMIMEType(); // Default constructor
  23. ~CMIMEType(); // Destructor
  24. UINT GetClipboardFormat() const;
  25. HRESULT InitFromKey( HKEY hKey, LPCTSTR pszName, ULONG* pnMaxBytes );
  26. HRESULT Match( const BYTE* pBytes, ULONG nBytes ) const;
  27. protected:
  28. char m_achSignature[4];
  29. public:
  30. CMIMEType* m_pNext;
  31. protected:
  32. UINT m_nClipboardFormat;
  33. CMIMEBitMatcher* m_lpBitMatchers;
  34. ULONG m_nMaxBytes;
  35. };
  36. class CMIMEIdentifier
  37. {
  38. public:
  39. CMIMEIdentifier(); // Default constructor
  40. ~CMIMEIdentifier(); // Destructor
  41. ULONG GetMaxBytes() const;
  42. HRESULT Identify( const BYTE* pbBytes, ULONG nBytes, UINT* pnFormat );
  43. HRESULT IdentifyStream( ISniffStream* pSniffStream,
  44. UINT* pnClipboardFormat );
  45. HRESULT InitFromRegistry();
  46. protected:
  47. char m_achSignature[4];
  48. protected:
  49. ULONG m_nMaxBytes;
  50. CMIMEType* m_lpTypes;
  51. };
  52. void InitMIMEIdentifier();
  53. void CleanupMIMEIdentifier();