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.7 KiB

  1. HRESULT InitDefaultMappings();
  2. void CleanupDefaultMappings();
  3. class CMapStringToCLSID
  4. {
  5. public:
  6. CMapStringToCLSID(); // Default constructor
  7. ~CMapStringToCLSID(); // Destructor
  8. const CLSID& GetCLSID() const;
  9. DWORD GetMapMode() const;
  10. LPCTSTR GetString() const;
  11. HRESULT InitFromKey( HKEY hKey, LPCTSTR pszKeyName );
  12. void SetCLSID( REFGUID clsid );
  13. void SetMapMode( DWORD dwMapMode );
  14. HRESULT SetString( LPCTSTR pszString );
  15. protected:
  16. char m_achSignature[4];
  17. public:
  18. CMapStringToCLSID* m_pNext;
  19. protected:
  20. LPTSTR m_pszString;
  21. CLSID m_clsid;
  22. DWORD m_dwMapMode;
  23. };
  24. class CMapMIMEToCLSID :
  25. public IMapMIMEToCLSID,
  26. public CComObjectRoot,
  27. public CComCoClass< CMapMIMEToCLSID, &CLSID_CoMapMIMEToCLSID >
  28. {
  29. public:
  30. CMapMIMEToCLSID(); // Default constructor
  31. ~CMapMIMEToCLSID(); // Destructor
  32. BEGIN_COM_MAP( CMapMIMEToCLSID )
  33. COM_INTERFACE_ENTRY( IMapMIMEToCLSID )
  34. END_COM_MAP()
  35. DECLARE_REGISTRY( CMapMIMEToCLSID, _T( "ImgUtil.CoMapMIMEToCLSID.1" ),
  36. _T( "ImgUtil.CoMapMIMEToCLSID" ), IDS_COMAPMIMETOCLSID_DESC,
  37. THREADFLAGS_BOTH )
  38. // DECLARE_NO_REGISTRY()
  39. // IMapMIMEToCLSID
  40. public:
  41. STDMETHOD( EnableDefaultMappings )( BOOL bEnable );
  42. STDMETHOD( MapMIMEToCLSID )( LPCOLESTR pszMIMEType, GUID* pCLSID );
  43. STDMETHOD( SetMapping )( LPCOLESTR pszMIMEType, DWORD dwMapMode,
  44. REFGUID clsid );
  45. protected:
  46. CMapStringToCLSID* AddMapping( LPCTSTR pszMIMEType );
  47. void DeleteMapping( LPCTSTR pszMIMEType );
  48. CMapStringToCLSID* FindMapping( LPCTSTR pszMIMEType );
  49. protected:
  50. ULONG m_nMappings;
  51. BOOL m_bEnableDefaultMappings;
  52. CMapStringToCLSID* m_pMappings;
  53. };