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.

79 lines
2.7 KiB

  1. #pragma once
  2. class CStorage:
  3. public CComObjectRoot,
  4. public IMDSPStorage,
  5. public IMDSPObject,
  6. public IMDSPObjectInfo
  7. {
  8. public:
  9. //
  10. // Construction/Destruction
  11. //
  12. CStorage();
  13. HRESULT Init( CE_FIND_DATA *pData, LPCWSTR szStartPath, BOOL fIsDeviceStorage, IMDSPDevice *pDevice );
  14. void FinalRelease();
  15. public:
  16. BEGIN_COM_MAP(CStorage)
  17. COM_INTERFACE_ENTRY(IMDSPStorage)
  18. COM_INTERFACE_ENTRY(IMDSPObject)
  19. COM_INTERFACE_ENTRY(IMDSPObjectInfo)
  20. END_COM_MAP()
  21. //
  22. // IMDSPStorage
  23. //
  24. public:
  25. STDMETHOD( GetStorageGlobals )( IMDSPStorageGlobals **ppStorageGlobals );
  26. STDMETHOD( GetAttributes )( DWORD *pdwAttributes, _WAVEFORMATEX *pFormat );
  27. STDMETHOD( SetAttributes )( DWORD dwAttributes, _WAVEFORMATEX *pFormat );
  28. STDMETHOD( GetName )( LPWSTR pwszName, UINT nMaxChars );
  29. STDMETHOD( GetDate )( PWMDMDATETIME pDateTimeUTC );
  30. STDMETHOD( GetSize )( DWORD *pdwSizeLow, DWORD *pdwSizeHigh );
  31. STDMETHOD( GetRights )( PWMDMRIGHTS *ppRights, UINT *pnRightsCount, BYTE abMac[ 20 ] );
  32. STDMETHOD( CreateStorage )( DWORD dwAttributes, _WAVEFORMATEX *pFormat, LPWSTR pwszName, IMDSPStorage **ppNewStorage );
  33. STDMETHOD( EnumStorage )( IMDSPEnumStorage * *ppEnumStorage );
  34. STDMETHOD( SendOpaqueCommand )( OPAQUECOMMAND *pCommand );
  35. //
  36. // IMDSPObject
  37. //
  38. public:
  39. STDMETHOD( Open )( UINT fuMode);
  40. STDMETHOD( Read )( BYTE *pData, DWORD *pdwSize, BYTE abMac[ 20 ] );
  41. STDMETHOD( Write )( BYTE *pData, DWORD *pdwSize, BYTE abMac[ 20 ] );
  42. STDMETHOD( Delete )( UINT fuFlags, IWMDMProgress *pProgress );
  43. STDMETHOD( Seek )( UINT fuFlags, DWORD dwOffset);
  44. STDMETHOD( Rename )( LPWSTR pwszNewName, IWMDMProgress *pProgress );
  45. STDMETHOD( Move )( UINT fuMode, IWMDMProgress *pProgress, IMDSPStorage *pTarget );
  46. STDMETHOD( Close )( void );
  47. //
  48. // IMDSPObjectInfo
  49. //
  50. public:
  51. STDMETHOD( GetPlayLength )( DWORD *pdwLength);
  52. STDMETHOD( SetPlayLength )( DWORD dwLength);
  53. STDMETHOD( GetPlayOffset )( DWORD *pdwOffset );
  54. STDMETHOD( SetPlayOffset )( DWORD dwOffset );
  55. STDMETHOD( GetTotalLength )( DWORD *pdwLength );
  56. STDMETHOD( GetLastPlayPosition )( DWORD *pdwLastPos );
  57. STDMETHOD( GetLongestPlayPosition )(DWORD *pdwLongestPos );
  58. protected:
  59. //
  60. // Helper functions
  61. //
  62. HRESULT DeleteDirectory( LPCWSTR pszPath, BOOL bRecursive );
  63. protected:
  64. CE_FIND_DATA m_findData;
  65. WCHAR m_szStartPath[MAX_PATH];
  66. WCHAR m_szCompletePath[MAX_PATH];
  67. CComPtr<IMDSPDevice> m_spDevice;
  68. HANDLE m_hFile;
  69. BOOL m_fRoot;
  70. };
  71. typedef CComObject<CStorage> CComStorage;