' ########################################################################################
' Microsoft Windows
' File: datacontainer.inc
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_datacontainer_PBI)
#DEFINE PBX_datacontainer_PBI
%EQUATE `DATACONTAINER_INC = 1
'/* header files for imported files */
#INCLUDE ONCE "Legacy/COM/ObjIdl.inc"
#INCLUDE ONCE "Legacy/Media/wmsbuffer.inc"
#INCLUDE ONCE "Legacy/Media/wmscontext.inc"
#INCLUDE ONCE "Legacy/System/datacontainerversion.inc"
#INCLUDE ONCE "Legacy/Media/wmspacket.inc"
%EQUATE `WMS_DATA_CONTAINER_NONSEEKABLE = &HFFFFFFFFFFFFFFFF&&
$IID_IWMSDataSourcePlugin = GUID$("{E1CD3525-03D7-11D2-9EED-006097D2D7CF}")
$IID_IWMSDataSourcePluginCallback = GUID$("{E1CD3526-03D7-11D2-9EED-006097D2D7CF}")
$IID_IWMSDataContainer = GUID$("{E6EE9A13-0FCC-11D2-9EEE-006097D2D7CF}")
$IID_IWMSDataContainerCallback = GUID$("{2E34AB82-0D3D-11D2-9EEE-006097D2D7CF}")
$IID_IWMSDirectory = GUID$("{6FA365E7-E8B9-437A-8C4B-6552DFBB0C57}")
$IID_IWMSUnknownFormat = GUID$("{9B6C9E51-4813-11D2-9EFF-006097D2D7CF}")
$IID_IWMSDirectoryFormat = GUID$("{7408CEB0-3A5A-41B6-A5EC-9A4E811C9673}")
$IID_IWMSPlaylistSmilFormat = GUID$("{C34294EA-E111-4FB2-BE6B-EC686A1A9757}")
' WMS_DATA_CONTAINER_OPEN_FLAGS enum
%EQUATE `WMS_DATA_CONTAINER_READ_ACCESS = &H1
%EQUATE `WMS_DATA_CONTAINER_WRITE_ACCESS = &H2
%EQUATE `WMS_DATA_CONTAINER_CREATE_NEW_CONTAINER = &H4
%EQUATE `WMS_DATA_CONTAINER_ALLOW_BUFFER_IO = &H8
%EQUATE `WMS_DATA_CONTAINER_SHARED_SOURCE = &H10
' WMS_DIRECTORY_ENTRY_FLAGS enum
%EQUATE `WMS_DIRECTORY_ENTRY_IS_DIRECTORY = &H1
' WMS_DATA_CONTAINER_GETINFO_VALUES enum
%EQUATE `WMS_DATA_CONTAINER_SIZE = 1
%EQUATE `WMS_DATA_CONTAINER_MAX_SUPPORTED_READ_SIZE = 2
' WMS_DATA_CONTAINER_GETINFO_FLAGS enum
%EQUATE `WMS_SEEKABLE_CONTAINER = &H1
%EQUATE `WMS_LOCAL_DATA_CONTAINER = &H2
' WMS_DATA_CONTAINER_ATTRIBUTES enum
%EQUATE `WMS_DATA_CONTAINER_SUPPORTS_ENUMERATION = &H1
'typedef unsigned __int64 QWORD;
' ########################################################################################
' Interface name = IWMSDataSourcePlugin
' IID = {E1CD3525-03D7-11D2-9EED-006097D2D7CF}
' Provides methods to manage data containers and retrieve information about them.
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IWMSDataSourcePlugin_INTERFACE_DEFINED)
 %IWMSDataSourcePlugin_INTERFACE_DEFINED = 1
INTERFACE IWMSDataSourcePlugin $IID_IWMSDataSourcePlugin
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetDataSourceAttributes ( ' VTable offset = 12
 BYREF pdwFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetRootDirectories ( ' VTable offset = 16
 BYREF pstrRootDirectoryList AS DWORD
 , BYVAL dwMaxRoots AS DWORD
 , BYVAL pCallback AS IWMSDataSourcePluginCallback
 , BYVAL qwContext AS QUAD
 ) AS LONG
 ' =====================================================================================
 METHOD OpenDataContainer ( ' VTable offset = 20
 BYVAL pCommandContext AS IWMSCommandContext
 , BYVAL pUserContext AS IWMSContext
 , BYVAL pPresentationContext AS IWMSContext
 , BYREF pszContainerName AS WSTRINGZ
 , BYVAL dwFlags AS DWORD
 , BYVAL pBufferAllocator AS IWMSBufferAllocator
 , BYVAL pCallback AS IWMSDataSourcePluginCallback
 , BYVAL qwContext AS QUAD
 ) AS LONG
 ' =====================================================================================
 METHOD OpenDirectory ( ' VTable offset = 24
 BYVAL pCommandContext AS IWMSCommandContext
 , BYVAL pUserContext AS IWMSContext
 , BYVAL pPresentationContext AS IWMSContext
 , BYREF pszContainerName AS WSTRINGZ
 , BYVAL dwFlags AS DWORD
 , BYVAL pBufferAllocator AS IWMSBufferAllocator
 , BYVAL pCallback AS IWMSDataSourcePluginCallback
 , BYVAL qwContext AS QUAD
 ) AS LONG
 ' =====================================================================================
 METHOD DeleteDataContainer ( ' VTable offset = 28
 BYREF pszContainerName AS WSTRINGZ
 , BYVAL dwFlags AS DWORD
 , BYVAL pCallback AS IWMSDataSourcePluginCallback
 , BYVAL qwContext AS QUAD
 ) AS LONG
 ' =====================================================================================
 METHOD GetDataContainerVersion ( ' VTable offset = 32
 BYVAL pCommandContext AS IWMSCommandContext
 , BYVAL pUserContext AS IWMSContext
 , BYVAL pPresContext AS IWMSContext
 , BYREF pszContainerName AS WSTRINGZ
 , BYVAL dwFlags AS DWORD
 , BYVAL pCallback AS IWMSDataSourcePluginCallback
 , BYVAL qwContext AS QUAD
 ) AS LONG
 ' =====================================================================================
 METHOD CreateDataSourceDirectory ( ' VTable offset = 36
 BYVAL pCommandContext AS IWMSCommandContext
 , BYREF pszContainerName AS WSTRINGZ
 , BYVAL dwFlags AS DWORD
 , BYVAL pCallback AS IWMSDataSourcePluginCallback
 , BYVAL qwContext AS QUAD
 ) AS LONG
 ' =====================================================================================
 METHOD DeleteDirectory ( ' VTable offset = 40
 BYREF pszContainerName AS WSTRINGZ
 , BYVAL dwFlags AS DWORD
 , BYVAL pCallback AS IWMSDataSourcePluginCallback
 , BYVAL qwContext AS QUAD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IWMSDataSourcePlugin_INTERFACE_DEFINED__ */
' ########################################################################################
' Interface name = IWMSDataSourcePluginCallback
' IID = {E1CD3526-03D7-11D2-9EED-006097D2D7CF}
' Provides methods to return the results of IWMSDataContainer method calls.
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IWMSDataSourcePluginCallback_INTERFACE_DEFINED)
 %IWMSDataSourcePluginCallback_INTERFACE_DEFINED = 1
INTERFACE IWMSDataSourcePluginCallback $IID_IWMSDataSourcePluginCallback
 INHERIT IUnknown
 ' =====================================================================================
 METHOD OnOpenDataContainer ( ' VTable offset = 12
 BYVAL hr AS LONG
 , BYVAL pDataContainer AS IWMSDataContainer
 , BYVAL qwContext AS QUAD
 ) AS LONG
 ' =====================================================================================
 METHOD OnOpenDirectory ( ' VTable offset = 16
 BYVAL hr AS LONG
 , BYVAL pDirectory AS IWMSDirectory
 , BYVAL qwContext AS QUAD
 ) AS LONG
 ' =====================================================================================
 METHOD OnOpenPacketStreamDataContainer ( ' VTable offset = 20
 BYVAL hr AS LONG
 , BYVAL pLiveDataContainer AS IUnknown
 , BYVAL qwContext AS QUAD
 ) AS LONG
 ' =====================================================================================
 METHOD OnDeleteDataContainer ( ' VTable offset = 24
 BYVAL hr AS LONG
 , BYVAL qwContext AS QUAD
 ) AS LONG
 ' =====================================================================================
 METHOD OnGetDataContainerVersion ( ' VTable offset = 28
 BYVAL hr AS LONG
 , BYVAL pVersion AS IWMSDataContainerVersion
 , BYVAL qwContext AS QUAD
 ) AS LONG
 ' =====================================================================================
 METHOD OnGetRootDirectories ( ' VTable offset = 32
 BYVAL hr AS LONG
 , BYVAL dwNumReturnedRoots AS DWORD
 , BYVAL dwTotalNumRoots AS DWORD
 , BYVAL qwContext AS QUAD
 ) AS LONG
 ' =====================================================================================
 METHOD OnCreateDirectory ( ' VTable offset = 36
 BYVAL hr AS LONG
 , BYVAL qwContext AS QUAD
 ) AS LONG
 ' =====================================================================================
 METHOD OnDeleteDirectory ( ' VTable offset = 40
 BYVAL hr AS LONG
 , BYVAL qwContext AS QUAD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IWMSDataSourcePluginCallback_INTERFACE_DEFINED__ */
' // Size = 16 bytes
TYPE WMSDirectoryEntryInfo DWORD
 pstrName AS WORD PTR
 dwFlags AS DWORD
 qwSize AS QUAD ' QWORD
END TYPE
' ########################################################################################
' Interface name = IWMSDataContainer
' IID = {E6EE9A13-0FCC-11D2-9EEE-006097D2D7CF}
' Provides methods to manage a data container.
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IWMSDataContainer_INTERFACE_DEFINED)
 %IWMSDataContainer_INTERFACE_DEFINED = 1
INTERFACE IWMSDataContainer $IID_IWMSDataContainer
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetContainerFormat ( ' VTable offset = 12
 BYREF pFormat AS GUID
 ) AS LONG
 ' =====================================================================================
 METHOD GetDataSourcePlugin ( ' VTable offset = 16
 BYREF ppDataSource AS IWMSDataSourcePlugin
 ) AS LONG
 ' =====================================================================================
 METHOD GetInfo ( ' VTable offset = 20
 BYVAL dwInfoValueId AS DWORD
 , BYVAL pCallback AS IWMSDataContainerCallback
 , BYVAL qwContext AS QUAD
 ) AS LONG
 ' =====================================================================================
 METHOD Read ( ' VTable offset = 24
 BYREF pbBuffer AS BYTE
 , BYVAL qwOffset AS QUAD
 , BYVAL dwMaxDataSize AS DWORD
 , BYVAL dwFlags AS DWORD
 , BYVAL pCallback AS IWMSDataContainerCallback
 , BYVAL qwContext AS QUAD
 ) AS LONG
 ' =====================================================================================
 METHOD Write ( ' VTable offset = 28
 BYREF pbBuffer AS BYTE
 , BYVAL dwDataSize AS DWORD
 , BYVAL qwWritePosition AS QUAD
 , BYVAL pCallback AS IWMSDataContainerCallback
 , BYVAL qwContext AS QUAD
 ) AS LONG
 ' =====================================================================================
 METHOD GetTransferParameters ( ' VTable offset = 32
 BYVAL qwDesiredOffset AS QUAD
 , BYVAL dwDesiredMinSize AS DWORD
 , BYVAL dwDesiredMaxSize AS DWORD
 , BYREF pqwOffset AS QUAD
 , BYREF pdwSize AS DWORD
 , BYREF pdwBufferAlignment AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD DoDataContainerExtendedCommand ( ' VTable offset = 36
 BYREF szCommandName AS WSTRINGZ
 , BYVAL pCommand AS IWMSCommandContext
 , BYVAL dwCallFlags AS DWORD
 , BYVAL pCallback AS IWMSDataContainerCallback
 , BYVAL qwContext AS QUAD
 ) AS LONG
 ' =====================================================================================
 METHOD FinishParsingPacketlist ( ' VTable offset = 40
 BYVAL pPacketList AS IWMSPacketList
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IWMSDataContainer_INTERFACE_DEFINED__ */
' ########################################################################################
' Interface name = IWMSDataContainerCallback
' IID = {2E34AB82-0D3D-11D2-9EEE-006097D2D7CF}
' Provides methods to return the results of IWMSDataContainer method calls.
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IWMSDataContainerCallback_INTERFACE_DEFINED)
 %IWMSDataContainerCallback_INTERFACE_DEFINED = 1
INTERFACE IWMSDataContainerCallback $IID_IWMSDataContainerCallback
 INHERIT IUnknown
 ' =====================================================================================
 METHOD OnGetInfo ( ' VTable offset = 12
 BYVAL hr AS LONG
 , BYVAL dwFlags AS DWORD
 , BYVAL qwInfoValue AS QUAD
 , BYVAL qwContext AS QUAD
 ) AS LONG
 ' =====================================================================================
 METHOD OnRead ( ' VTable offset = 16
 BYVAL hr AS LONG
 , BYVAL dwActualBytesTransferred AS DWORD
 , BYVAL dwChangeType AS DWORD
 , BYVAL qwChangeParameter AS QUAD
 , BYVAL qwContext AS QUAD
 ) AS LONG
 ' =====================================================================================
 METHOD OnWrite ( ' VTable offset = 20
 BYVAL hr AS LONG
 , BYVAL dwActualBytesTransferred AS DWORD
 , BYVAL qwContext AS QUAD
 ) AS LONG
 ' =====================================================================================
 METHOD OnDoDataContainerExtendedCommand ( ' VTable offset = 24
 BYVAL hr AS LONG
 , BYVAL qwContext AS QUAD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IWMSDataContainerCallback_INTERFACE_DEFINED__ */
' ########################################################################################
' Interface name = IWMSDirectory
' IID = {6FA365E7-E8B9-437A-8C4B-6552DFBB0C57}
' Provides methods for navigating the structure of a directory data container.
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IWMSDirectory_INTERFACE_DEFINED)
 %IWMSDirectory_INTERFACE_DEFINED = 1
INTERFACE IWMSDirectory $IID_IWMSDirectory
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetDataSourcePlugin ( ' VTable offset = 12
 BYREF ppDataSource AS IWMSDataSourcePlugin
 ) AS LONG
 ' =====================================================================================
 METHOD GetName ( ' VTable offset = 16
 BYREF pstrValue AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetChildInfo ( ' VTable offset = 20
 BYVAL dwIndex AS DWORD
 , BYREF pInfo AS WMSDirectoryEntryInfo
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IWMSDirectory_INTERFACE_DEFINED__ */
#ENDIF
