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.

155 lines
6.3 KiB

  1. // Storage.h : Declaration of the CStorage
  2. #ifndef __STORAGE_H_
  3. #define __STORAGE_H_
  4. #include "resource.h" // main symbols
  5. /////////////////////////////////////////////////////////////////////////////
  6. // CStorage
  7. class ATL_NO_VTABLE CWMDMStorage :
  8. public CComObjectRootEx<CComMultiThreadModel>,
  9. public CComCoClass<CWMDMStorage, &CLSID_WMDMStorage>,
  10. public IWMDMStorage2,
  11. public IWMDMStorageControl2,
  12. public IWMDMObjectInfo,
  13. public IWMDMRevoked
  14. {
  15. public:
  16. CWMDMStorage();
  17. ~CWMDMStorage();
  18. BEGIN_COM_MAP(CWMDMStorage)
  19. COM_INTERFACE_ENTRY(IWMDMStorage)
  20. COM_INTERFACE_ENTRY(IWMDMStorage2)
  21. COM_INTERFACE_ENTRY(IWMDMStorageControl)
  22. COM_INTERFACE_ENTRY(IWMDMStorageControl2)
  23. COM_INTERFACE_ENTRY(IWMDMObjectInfo)
  24. COM_INTERFACE_ENTRY(IWMDMRevoked)
  25. END_COM_MAP()
  26. public:
  27. // IWMDMStorage
  28. STDMETHOD(SetAttributes)(DWORD dwAttributes, _WAVEFORMATEX *pFormat);
  29. STDMETHOD(GetStorageGlobals)(IWMDMStorageGlobals **ppStorageGlobals);
  30. STDMETHOD(GetAttributes)(DWORD *pdwAttributes,
  31. _WAVEFORMATEX *pFormat);
  32. STDMETHOD(GetName)(LPWSTR pwszName,
  33. UINT nMaxChars);
  34. STDMETHOD(GetDate)(PWMDMDATETIME pDateTimeUTC);
  35. STDMETHOD(GetSize)(DWORD *pdwSizeLow,
  36. DWORD *pdwSizeHigh);
  37. STDMETHOD(GetRights)(PWMDMRIGHTS *ppRights, UINT *pnRightsCount, BYTE abMac[WMDM_MAC_LENGTH]);
  38. STDMETHOD(EnumStorage)(IWMDMEnumStorage **ppEnumStorage);
  39. STDMETHOD(SendOpaqueCommand)(OPAQUECOMMAND *pCommand);
  40. // IWMDMStorage2
  41. STDMETHOD(GetStorage)( LPCWSTR pszStorageName, IWMDMStorage** ppStorage );
  42. STDMETHOD(SetAttributes2)( DWORD dwAttributes,
  43. DWORD dwAttributesEx,
  44. _WAVEFORMATEX *pFormat,
  45. _VIDEOINFOHEADER* pVideoFormat );
  46. STDMETHOD(GetAttributes2)( DWORD *pdwAttributes,
  47. DWORD *pdwAttributesEx,
  48. _WAVEFORMATEX *pAudioFormat,
  49. _VIDEOINFOHEADER* pVideoFormat );
  50. // IWMDMStorageControl
  51. STDMETHOD(Insert)(UINT fuMode,
  52. LPWSTR pwszFile,
  53. IWMDMOperation *pOperation,
  54. IWMDMProgress *pProgress,
  55. IWMDMStorage **ppNewObject);
  56. STDMETHOD(Delete)(UINT fuMode,
  57. IWMDMProgress *pProgress);
  58. STDMETHOD(Rename)(UINT fuMode,
  59. LPWSTR pwszNewName,
  60. IWMDMProgress *pProgress);
  61. STDMETHOD(Read)(UINT fuMode,
  62. LPWSTR pwszFile,
  63. IWMDMProgress *pProgress,
  64. IWMDMOperation *pOperation);
  65. STDMETHOD(Move)(UINT fuMode,
  66. IWMDMStorage *pTargetObject,
  67. IWMDMProgress *pProgress);
  68. // IWMDMStorageControl2
  69. STDMETHOD(Insert2)(UINT fuMode,
  70. LPWSTR pwszFileSource,
  71. LPWSTR pwszFileDest,
  72. IWMDMOperation *pOperation,
  73. IWMDMProgress *pProgress,
  74. IUnknown* pUnknown,
  75. IWMDMStorage **ppNewObject);
  76. // IWMDMObjectInfo
  77. STDMETHOD(GetPlayLength)(DWORD *pdwLength);
  78. STDMETHOD(SetPlayLength)(DWORD dwLength);
  79. STDMETHOD(GetPlayOffset)(DWORD *pdwOffset);
  80. STDMETHOD(SetPlayOffset)(DWORD dwOffset);
  81. STDMETHOD(GetTotalLength)(DWORD *pdwLength);
  82. STDMETHOD(GetLastPlayPosition)(DWORD *pdwLastPos);
  83. STDMETHOD(GetLongestPlayPosition)(DWORD *pdwLongestPos);
  84. // IWMDMRevoked
  85. STDMETHOD(GetRevocationURL)( LPWSTR* ppwszRevocationURL,
  86. DWORD* pdwBufferLen,
  87. DWORD* pdwRevokedBitFlag );
  88. void SetContainedPointer(IMDSPStorage *pStorage, WORD wSPIndex);
  89. void GetContainedPointer(IMDSPStorage **ppStorage);
  90. private:
  91. IMDSPStorage *m_pStorage;
  92. WORD m_wSPIndex;
  93. DWORD m_dwStatus;
  94. LPWSTR m_pwszRevocationURL;
  95. DWORD m_dwRevocationURLLen;
  96. DWORD m_dwRevocationBitFlag;
  97. HRESULT hrCopyToStorageFromFile( UINT fuMode, LPWSTR pwszFileName,
  98. UINT uNewStorageMode, LPWCH wszNewStorageName,
  99. IWMDMStorage*& pNewIWMDMStorage,
  100. IWMDMProgress *pProgress,
  101. IUnknown* pUnknown, BOOL fQuery);
  102. HRESULT hrCopyToOperationFromStorage(IWMDMOperation *pOperation, IWMDMProgress *pProgress, IMDSPObject *pObject);
  103. HRESULT hrCopyToStorageFromOperation(UINT fuMode, IWMDMOperation *pOperation,
  104. UINT uNewStorageMode, LPWCH wszNewStorageName,
  105. IWMDMStorage*& pNewIWMDMStorage,
  106. IWMDMProgress *pProgress,
  107. IUnknown* pUnknown, BOOL fQuery);
  108. HRESULT hrCopyToFileFromStorage(LPWSTR pwszFileName, IWMDMProgress *pProgress, IMDSPObject *pObject);
  109. HRESULT InsertWorker(UINT fuMode,
  110. LPWSTR pwszFileSource,
  111. LPWSTR pwszFileDest,
  112. IWMDMOperation *pOperation,
  113. IWMDMProgress *pProgress,
  114. IUnknown* pUnknown,
  115. IWMDMStorage **ppNewObject);
  116. HRESULT DeleteWorker(UINT fuMode, IWMDMProgress *pProgress);
  117. HRESULT RenameWorker(LPWSTR pwszNewName,
  118. IWMDMProgress *pProgress);
  119. HRESULT MoveWorker(UINT fuMode,
  120. IWMDMStorage *pTargetObject,
  121. IWMDMProgress *pProgress,
  122. IWMDMStorage **ppNewObject);
  123. HRESULT ReadWorker(UINT fuMode,
  124. LPWSTR pwszFile,
  125. IWMDMProgress *pProgress,
  126. IWMDMOperation *pOperation);
  127. friend DWORD InsertThreadFunc(void *pData);
  128. friend DWORD DeleteThreadFunc(void *pData);
  129. friend DWORD RenameThreadFunc(void *pData);
  130. // friend DWORD MoveThreadFunc(void *pData);
  131. friend DWORD ReadThreadFunc(void *pData);
  132. HRESULT UpdateRevocationURL( LPWSTR* ppwszRevocationURL,
  133. DWORD* pdwRevocationURLLen,
  134. DWORD* pdwRevocationBitFlag );
  135. };
  136. #endif //__STORAGE_H_