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.

116 lines
3.4 KiB

  1. #pragma once
  2. //+------------------------------------------------------------------
  3. //
  4. // Microsoft Windows
  5. // Copyright (C) Microsoft Corporation, 1994 - 1998.
  6. //
  7. // File: tnupdr.hxx
  8. //
  9. //+------------------------------------------------------------------
  10. DECLARE_DEBUG(updr);
  11. #if DBG == 1
  12. #define updrAssert(e) Win4Assert(e)
  13. #define updrVerify(e) Win4Assert(e)
  14. #define updrDebug(x) updrInlineDebugOut x
  15. // updrDebugOut is called from the Chk/Err macros
  16. #define updrDebugOut(x) updrInlineDebugOut x
  17. #else
  18. #define updrAssert(e)
  19. #define updrVerify(e) (e)
  20. #define updrDebug(x)
  21. #endif
  22. #define updrErr(l, e) ErrJmp(updr, l, e, sc)
  23. #define updrChkTo(l, e) if (FAILED(sc = (e))) updrErr(l, sc) else 1
  24. #define updrChk(e) updrChkTo(EH_Err, e)
  25. #define updrHChkTo(l, e) if (FAILED(sc = DfGetScode(e))) updrErr(l, sc) else 1
  26. #define updrHChk(e) updrHChkTo(EH_Err, e)
  27. #define updrMemTo(l, e) \
  28. if ((e) == NULL) updrErr(l, STG_E_INSUFFICIENTMEMORY) else 1
  29. #define updrMem(e) updrMemTo(EH_Err, e)
  30. // +----------------------------------------------------------------------
  31. // Thumbnail Updater Class
  32. // +----------------------------------------------------------------------
  33. class CTNUpdater: public IFilterStatus,
  34. public IOplockStorage
  35. {
  36. friend HRESULT CThumbnailCF_CreateInstance( IUnknown*, REFIID, void** );
  37. public: // IUnknown
  38. STDMETHODIMP_(ULONG) AddRef(void);
  39. STDMETHODIMP_(ULONG) Release(void);
  40. STDMETHODIMP QueryInterface(REFIID iid, void **ppv);
  41. public: // IFilterStatus
  42. STDMETHODIMP Initialize(
  43. /* [string][in] */ const WCHAR __RPC_FAR *pwszCatalogName,
  44. /* [string][in] */ const WCHAR __RPC_FAR *pwszCatalogPath);
  45. STDMETHODIMP PreFilter(
  46. /* [string][in] */ const WCHAR __RPC_FAR *pwszPath);
  47. STDMETHODIMP FilterLoad(
  48. /* [string][in] */ const WCHAR __RPC_FAR *pwszPath,
  49. /* [in] */ SCODE scFilterStatus);
  50. STDMETHODIMP PostFilter(
  51. /* [string][in] */ const WCHAR __RPC_FAR *pwszPath,
  52. /* [in] */ SCODE scFilterStatus);
  53. public: // IOplockStorage
  54. #define STGM_OPLOCKS_DONT_WORK (STGM_TRANSACTED | STGM_SIMPLE | STGM_PRIORITY)
  55. STDMETHODIMP CreateStorageEx(LPCWSTR pwcsName,
  56. DWORD grfMode,
  57. DWORD stgfmt,
  58. DWORD grfAttrs,
  59. REFIID riid,
  60. void ** ppstgOpen);
  61. STDMETHODIMP OpenStorageEx(LPCWSTR pwcsName,
  62. DWORD grfMode,
  63. DWORD stgfmt,
  64. DWORD grfAttrs,
  65. REFIID riid,
  66. void ** ppstgOpen);
  67. public: // C++ Methods
  68. CTNUpdater(void);
  69. ~CTNUpdater(void);
  70. private: // Non-Interface Methods
  71. BOOL ObjectInit();
  72. BOOL HasAnImageFileExtension(LPCWSTR pwszPath);
  73. HRESULT GetImageFileExtensions();
  74. HRESULT AddToTempExtensionList(WCHAR* pwszExtension);
  75. HRESULT FreeTempExtensionList();
  76. HRESULT GetAFileNameExtension(WCHAR* pwszKeyName, WCHAR** ppwszExtension);
  77. struct TEMPEXTLIST {
  78. WCHAR* pwszExtension;
  79. struct TEMPEXTLIST* pNext;
  80. };
  81. private: // Data
  82. ULONG m_cRef;
  83. IThumbnailExtractor* m_pITE;
  84. HKEY m_hkeyMime;
  85. HANDLE m_hEvRegNotify;
  86. WCHAR** m_ppwszExtensions;
  87. TEMPEXTLIST* m_pTempList;
  88. };