// --------------------------------------------------------
// EncDecTag.idl
//
//
//      Encrypter-Tagger/DeCrypter-Detagger filter definitions
//
//
//  Copyright (c) Microsoft, 2002
// ---------------------------------------------------------
//
// Guide to CLSIDS:
//
// -- 8x Enc/dec Properties
// -- 9x Tag Properties
// -- Ax
// -- Bx IFilter
// -- Cx IFilterEvents
// -- Dx IFilterConfig
// -- Ex
// -- Fx CFilter (coclass)
//
//  x = 1 - Encrypter-Tagger
//  x = 2 - Decrypter-Detagger

cpp_quote("//+-------------------------------------------------------------------------")
cpp_quote("//")
cpp_quote("//  Microsoft Windows")
cpp_quote("//  Copyright (C) Microsoft Corporation, 2002.")
cpp_quote("//")
cpp_quote("//--------------------------------------------------------------------------")
cpp_quote("#pragma once")

import "oaidl.idl";
import "ocidl.idl";

import "TvRatings.idl";

cpp_quote ("// {C4C4C4C4-0049-4E2B-98FB-9537F6CE516D}")
cpp_quote ("DEFINE_GUID(SID_DRMSecureServiceChannel,")
cpp_quote ("0xC4C4C4C4, 0x0049, 0x4E2B, 0x98, 0xFB, 0x95, 0x37, 0xF6, 0xCE, 0x51, 0x6D);")

// -----------------
//   filter ClassID's

cpp_quote ("// {C4C4C481-0049-4E2B-98FB-9537F6CE516D}")
cpp_quote ("DEFINE_GUID(CLSID_ETFilterEncProperties,")
cpp_quote ("0xC4C4C481, 0x0049, 0x4E2B, 0x98, 0xFB, 0x95, 0x37, 0xF6, 0xCE, 0x51, 0x6D);")

cpp_quote ("// {C4C4C491-0049-4E2B-98FB-9537F6CE516D}")
cpp_quote ("DEFINE_GUID(CLSID_ETFilterTagProperties,")
cpp_quote ("0xC4C4C491, 0x0049, 0x4E2B, 0x98, 0xFB, 0x95, 0x37, 0xF6, 0xCE, 0x51, 0x6D);")

/* CLSID defined in coclass below
cpp_quote ("// {C4C4C4F1-0049-4E2B-98FB-9537F6CE516D}")
cpp_quote ("DEFINE_GUID(CLSID_ETFilter,")
cpp_quote ("0xC4C4C4F1, 0x0049, 0x4E2B, 0x98, 0xFB, 0x95, 0x37, 0xF6, 0xCE, 0x51, 0x6D);")
*/

cpp_quote ("// {9CD31617-B303-4f96-8330-2EB173EA4DC6}")
cpp_quote ("DEFINE_GUID(CLSID_PTFilter,")
cpp_quote ("0x9cd31617, 0xb303, 0x4f96, 0x83, 0x30, 0x2e, 0xb1, 0x73, 0xea, 0x4d, 0xc6);")




cpp_quote ("// {C4C4C482-0049-4E2B-98FB-9537F6CE516D}")
cpp_quote ("DEFINE_GUID(CLSID_DTFilterEncProperties,")
cpp_quote ("0xC4C4C482, 0x0049, 0x4E2B, 0x98, 0xFB, 0x95, 0x37, 0xF6, 0xCE, 0x51, 0x6D);")

cpp_quote ("// {C4C4C492-0049-4E2B-98FB-9537F6CE516D}")
cpp_quote ("DEFINE_GUID(CLSID_DTFilterTagProperties,")
cpp_quote ("0xC4C4C492, 0x0049, 0x4E2B, 0x98, 0xFB, 0x95, 0x37, 0xF6, 0xCE, 0x51, 0x6D);")

/*
cpp_quote ("// {C4C4C4F2-0049-4E2B-98FB-9537F6CE516D}")
cpp_quote ("DEFINE_GUID(CLSID_DTFilter,")
cpp_quote ("0xC4C4C4F2, 0x0049, 0x4E2B, 0x98, 0xFB, 0x95, 0x37, 0xF6, 0xCE, 0x51, 0x6D);")
*/

cpp_quote ("// {C4C4C483-0049-4E2B-98FB-9537F6CE516D}")
cpp_quote ("DEFINE_GUID(CLSID_XDSCodecProperties,")
cpp_quote ("0xC4C4C483, 0x0049, 0x4E2B, 0x98, 0xFB, 0x95, 0x37, 0xF6, 0xCE, 0x51, 0x6D);")

cpp_quote ("// {C4C4C493-0049-4E2B-98FB-9537F6CE516D}")
cpp_quote ("DEFINE_GUID(CLSID_XDSCodecTagProperties,")
cpp_quote ("0xC4C4C493, 0x0049, 0x4E2B, 0x98, 0xFB, 0x95, 0x37, 0xF6, 0xCE, 0x51, 0x6D);")

/*
cpp_quote ("// {C4C4C4F3-0049-4E2B-98FB-9537F6CE516D}")
cpp_quote ("DEFINE_GUID(CLSID_XDSCodec,")
cpp_quote ("0xC4C4C4F3, 0x0049, 0x4E2B, 0x98, 0xFB, 0x95, 0x37, 0xF6, 0xCE, 0x51, 0x6D);")
*/

cpp_quote ("// {C4C4C4FC-0049-4E2B-98FB-9537F6CE516D}")
cpp_quote ("DEFINE_GUID(CLSID_CPCAFiltersCategory,")
cpp_quote ("0xC4C4C4FC, 0x0049, 0x4E2B, 0x98, 0xFB, 0x95, 0x37, 0xF6, 0xCE, 0x51, 0x6D);")


// broadcast eventID's
                // sent by XDSCodec when get a new rating
cpp_quote ("// {C4C4C4E0-0049-4E2B-98FB-9537F6CE516D}")
cpp_quote ("DEFINE_GUID(EVENTID_XDSCodecNewXDSRating,")
cpp_quote ("0xC4C4C4E0, 0x0049, 0x4E2B, 0x98, 0xFB, 0x95, 0x37, 0xF6, 0xCE, 0x51, 0x6D);")

                // sent by XDSCodec when get a duplicate to a current non DontKnow rating
cpp_quote ("// {C4C4C4DF-0049-4E2B-98FB-9537F6CE516D}")
cpp_quote ("DEFINE_GUID(EVENTID_XDSCodecDuplicateXDSRating,")
cpp_quote ("0xC4C4C4DF, 0x0049, 0x4E2B, 0x98, 0xFB, 0x95, 0x37, 0xF6, 0xCE, 0x51, 0x6D);")

                // sent by XDS Codec when get some other XDS packet
cpp_quote ("// {C4C4C4E1-0049-4E2B-98FB-9537F6CE516D}")
cpp_quote ("DEFINE_GUID(EVENTID_XDSCodecNewXDSPacket,")
cpp_quote ("0xC4C4C4E1, 0x0049, 0x4E2B, 0x98, 0xFB, 0x95, 0x37, 0xF6, 0xCE, 0x51, 0x6D);")

                // sent by Decrypter/Detagger when rating changes
cpp_quote ("// {C4C4C4E2-0049-4E2B-98FB-9537F6CE516D}")
cpp_quote ("DEFINE_GUID(EVENTID_DTFilterRatingChange,")
cpp_quote ("0xC4C4C4E2, 0x0049, 0x4E2B, 0x98, 0xFB, 0x95, 0x37, 0xF6, 0xCE, 0x51, 0x6D);")

                // sent by Decrypter/DeTagger when show rating exceeds max allowable
cpp_quote ("// {C4C4C4E3-0049-4E2B-98FB-9537F6CE516D}")
cpp_quote ("DEFINE_GUID(EVENTID_DTFilterRatingsBlock,")
cpp_quote ("0xC4C4C4E3, 0x0049, 0x4E2B, 0x98, 0xFB, 0x95, 0x37, 0xF6, 0xCE, 0x51, 0x6D);")

                // sent by Decrypter/DeTagger when show rating drops below max allowable
cpp_quote ("// {C4C4C4E4-0049-4E2B-98FB-9537F6CE516D}")
cpp_quote ("DEFINE_GUID(EVENTID_DTFilterRatingsUnblock,")
cpp_quote ("0xC4C4C4E4, 0x0049, 0x4E2B, 0x98, 0xFB, 0x95, 0x37, 0xF6, 0xCE, 0x51, 0x6D);")


                // sent by Decrypter/DeTagger when get new XDS packet
cpp_quote ("// {C4C4C4E5-0049-4E2B-98FB-9537F6CE516D}")
cpp_quote ("DEFINE_GUID(EVENTID_DTFilterXDSPacket,")
cpp_quote ("0xC4C4C4E5, 0x0049, 0x4E2B, 0x98, 0xFB, 0x95, 0x37, 0xF6, 0xCE, 0x51, 0x6D);")

                // sent by Encrypter/Tagger when start to encrypt content
cpp_quote ("// {C4C4C4E6-0049-4E2B-98FB-9537F6CE516D}")
cpp_quote ("DEFINE_GUID(EVENTID_ETFilterEncryptionOn,")
cpp_quote ("0xC4C4C4E6, 0x0049, 0x4E2B, 0x98, 0xFB, 0x95, 0x37, 0xF6, 0xCE, 0x51, 0x6D);")

                // sent by Encrypter/Tagger when stop encrypting content content
cpp_quote ("// {C4C4C4E7-0049-4E2B-98FB-9537F6CE516D}")
cpp_quote ("DEFINE_GUID(EVENTID_ETFilterEncryptionOff,")
cpp_quote ("0xC4C4C4E7, 0x0049, 0x4E2B, 0x98, 0xFB, 0x95, 0x37, 0xF6, 0xCE, 0x51, 0x6D);")

                // sent by Decryptor/Tagger when unblocking COPP block
cpp_quote ("// {C4C4C4E8-0049-4E2B-98FB-9537F6CE516D}")
cpp_quote ("DEFINE_GUID(EVENTID_DTFilterCOPPUnblock,")
cpp_quote ("0xC4C4C4E8, 0x0049, 0x4E2B, 0x98, 0xFB, 0x95, 0x37, 0xF6, 0xCE, 0x51, 0x6D);")

                // sent by Decrypter when bad COPP driver is encountered)...
cpp_quote ("// {C4C4C4E9-0049-4E2B-98FB-9537F6CE516D}")
cpp_quote ("DEFINE_GUID(EVENTID_EncDecFilterError,")
cpp_quote ("0xC4C4C4E9, 0x0049, 0x4E2B, 0x98, 0xFB, 0x95, 0x37, 0xF6, 0xCE, 0x51, 0x6D);")

                // sent by Decrypter when data block due to COPP status...
cpp_quote ("// {C4C4C4EA-0049-4E2B-98FB-9537F6CE516D}")
cpp_quote ("DEFINE_GUID(EVENTID_DTFilterCOPPBlock ,")
cpp_quote ("0xC4C4C4EA, 0x0049, 0x4E2B, 0x98, 0xFB, 0x95, 0x37, 0xF6, 0xCE, 0x51, 0x6D);")

                // sent by Encrypter/Tagger when receiving copy once content
cpp_quote ("// {C4C4C4EB-0049-4E2B-98FB-9537F6CE516D}")
cpp_quote ("DEFINE_GUID(EVENTID_ETFilterCopyOnce,")
cpp_quote ("0xC4C4C4EB, 0x0049, 0x4E2B, 0x98, 0xFB, 0x95, 0x37, 0xF6, 0xCE, 0x51, 0x6D);")


                // sent by Encrypter/Tagger when receiving copy never really for macrovision content
cpp_quote ("// {C4C4C4F0-0049-4E2B-98FB-9537F6CE516D}")
cpp_quote ("DEFINE_GUID(EVENTID_ETFilterCopyNever,")
cpp_quote ("0xC4C4C4F0, 0x0049, 0x4E2B, 0x98, 0xFB, 0x95, 0x37, 0xF6, 0xCE, 0x51, 0x6D);")
        // for now, Format errors are exactly the same as License errors...

                // sent by Decrypter when data format is OK again (only after a failure)...
cpp_quote ("// {C4C4C4EC-0049-4E2B-98FB-9537F6CE516D}")
cpp_quote ("DEFINE_GUID(EVENTID_DTFilterDataFormatOK,")
cpp_quote ("0xC4C4C4EC, 0x0049, 0x4E2B, 0x98, 0xFB, 0x95, 0x37, 0xF6, 0xCE, 0x51, 0x6D);")

                // sent by Decrypter when data format is corrupt (old file?)
cpp_quote ("// {C4C4C4ED-0049-4E2B-98FB-9537F6CE516D}")
cpp_quote ("DEFINE_GUID(EVENTID_DTFilterDataFormatFailure,")
cpp_quote ("0xC4C4C4ED, 0x0049, 0x4E2B, 0x98, 0xFB, 0x95, 0x37, 0xF6, 0xCE, 0x51, 0x6D);")

                // sent by Encrypter or Decrypter when DRM license is OK again (only after a failure)...
cpp_quote ("// {C4C4C4EE-0049-4E2B-98FB-9537F6CE516D}")
cpp_quote ("DEFINE_GUID(EVENTID_ETDTFilterLicenseOK,")
cpp_quote ("0xC4C4C4EE, 0x0049, 0x4E2B, 0x98, 0xFB, 0x95, 0x37, 0xF6, 0xCE, 0x51, 0x6D);")

                // sent by Encrypter or Decrypter when fail to get DRM license
cpp_quote ("// {C4C4C4EF-0049-4E2B-98FB-9537F6CE516D}")
cpp_quote ("DEFINE_GUID(EVENTID_ETDTFilterLicenseFailure,")
cpp_quote ("0xC4C4C4EF, 0x0049, 0x4E2B, 0x98, 0xFB, 0x95, 0x37, 0xF6, 0xCE, 0x51, 0x6D);")

    // Other Guids
                // media subtype sent out of encrypter filter
cpp_quote ("// {C4C4C4D0-0049-4E2B-98FB-9537F6CE516D}")
cpp_quote ("DEFINE_GUID(MEDIASUBTYPE_ETDTFilter_Tagged,")
cpp_quote ("0xC4C4C4D0, 0x0049, 0x4E2B, 0x98, 0xFB, 0x95, 0x37, 0xF6, 0xCE, 0x51, 0x6D);")

                // format block type sent out of encrypter filter
                //  only used if no format block currently avaiable
cpp_quote ("// {C4C4C4D1-0049-4E2B-98FB-9537F6CE516D}")
cpp_quote ("DEFINE_GUID(FORMATTYPE_ETDTFilter_Tagged,")
cpp_quote ("0xC4C4C4D1, 0x0049, 0x4E2B, 0x98, 0xFB, 0x95, 0x37, 0xF6, 0xCE, 0x51, 0x6D);")


cpp_quote ("// {46adbd28-6fd0-4796-93b2-155c51dc048d}")
cpp_quote ("DEFINE_GUID( MEDIASUBTYPE_CPFilters_Processed, 0x46adbd28, 0x6fd0, 0x4796, 0x93, 0xb2, 0x15, 0x5c, 0x51, 0xdc, 0x4, 0x8d );")

cpp_quote ("// {6739b36f-1d5f-4ac2-8192-28bb0e73d16a}")
cpp_quote ("DEFINE_GUID( FORMATTYPE_CPFilters_Processed, 0x6739b36f, 0x1d5f, 0x4ac2, 0x81, 0x92, 0x28, 0xbb, 0xe, 0x73, 0xd1, 0x6a );")

                // Generic event from EncDec fileter. See FireEx
cpp_quote ("// {4A1B465B-0FB9-4159-AFBD-E33006A0F9F4}")
cpp_quote ("DEFINE_GUID(EVENTID_EncDecFilterEvent, ")
cpp_quote ("0x4a1b465b, 0xfb9, 0x4159, 0xaf, 0xbd, 0xe3, 0x30, 0x6, 0xa0, 0xf9, 0xf4);")

// Dynamic format not supported events...
enum FormatNotSupportedEvents
{
    FORMATNOTSUPPORTED_CLEAR = 0,
    FORMATNOTSUPPORTED_NOTSUPPORTED = 1
};

// Generic event for tv format not supported, fired when
// an unsupported video or audio format is attempted to be played
cpp_quote ("// {24B2280A-B2AA-4777-BF65-63F35E7B024A}")
cpp_quote ("DEFINE_GUID(EVENTID_FormatNotSupportedEvent, ")
cpp_quote ("0x24b2280a, 0xb2aa, 0x4777, 0xbf, 0x65, 0x63, 0xf3, 0x5e, 0x7b, 0x2, 0x4a);")

//  broadcast event from the demultiplexer on a discontinuity; fired on input
//    discontinuities and in-band discontinuities e.g. continuity_counter skips
//    and timestamp discontinuities
cpp_quote ("// {16155770-AED5-475c-BB98-95A33070DF0C}")
cpp_quote ("DEFINE_GUID(EVENTID_DemultiplexerFilterDiscontinuity, ")
cpp_quote ("0x16155770, 0xaed5, 0x475c, 0xbb, 0x98, 0x95, 0xa3, 0x30, 0x70, 0xdf, 0xc);")

// attributes that are carried as media sample attributes

cpp_quote ("// {40749583-6b9d-4eec-b43c-67a1801e1a9b}")
cpp_quote ("DEFINE_GUID( DSATTRIB_WMDRMProtectionInfo, 0x40749583, 0x6b9d, 0x4eec, 0xb4, 0x3c, 0x67, 0xa1, 0x80, 0x1e, 0x1a, 0x9b );")

cpp_quote ("// {e4846dda-5838-42b4-b897-6f7e5faa2f2f}")
cpp_quote ("DEFINE_GUID( DSATTRIB_BadSampleInfo, 0xe4846dda, 0x5838, 0x42b4, 0xb8, 0x97, 0x6f, 0x7e, 0x5f, 0xaa, 0x2f, 0x2f );")

#pragma pack(push,1)
typedef struct
{
    unsigned short   wszKID [25];
    unsigned __int64 qwCounter;
    unsigned __int64 qwIndex;
    unsigned char    bOffset;
}
WMDRMProtectionInfo;

typedef struct
{
    HRESULT hrReason;
}
BadSampleInfo;

#pragma pack(pop)

//------------------------------------------------------

#ifndef REFERENCE_TIME
typedef LONGLONG REFERENCE_TIME;
#endif

typedef LONG    PackedTvRating;

//------------------------------------------------------

#include <encdec_enums.h>

[
    restricted,
    object,
    uuid (C4C4C4D1-0049-4E2B-98FB-9537F6CE516D),
//  dual
    helpstring("IETFilterConfig Interface"),
    pointer_default(unique)
]
interface IETFilterConfig : IUnknown
{
        [   id(10), helpstring("method InitLicense")]
        HRESULT InitLicense(
                                [in]    int LicenseId   // which license (0-N to use)
                              );
        [    id(11), helpstring("method GetSecureChannelObject")]
        HRESULT GetSecureChannelObject(
                                [out]   IUnknown **ppUnkDRMSecureChannel    // an IDRMSecureChannel
                              );
};

[
    restricted,
    object,
    uuid (C4C4C4D2-0049-4E2B-98FB-9537F6CE516D),
//  dual
    helpstring("IDTFilterConfig Interface"),
    pointer_default(unique)
]
interface IDTFilterConfig : IUnknown
{
        [    id(11), helpstring("method GetSecureChannelObject")]
        HRESULT GetSecureChannelObject(
                                [out]   IUnknown **ppUnkDRMSecureChannel    // an IDRMSecureChannel
                              );
};

[
    object,
    uuid (C4C4C4D3-0049-4E2B-98FB-9537F6CE516D),
//  dual
    helpstring("IXDSCodecConfig Interface"),
    pointer_default(unique)
]
interface IXDSCodecConfig : IUnknown
{
        // [propget, id(1),  helpstring("property CCMode")]  HRESULT CCMode([out, retval] int *pCCMode);
        [    id(11), helpstring("method GetSecureChannelObject")]
        HRESULT GetSecureChannelObject(
                                [out]   IUnknown **ppUnkDRMSecureChannel    // an IDRMSecureChannel
                              );

        [    id(12), helpstring("method SetPauseBufferTime")]
        HRESULT SetPauseBufferTime([in] DWORD dwPauseBufferTime);
};

// Interface: IDTFilterLicenseRenewal
// ------------------------------------
// This interface is implemented by DTFilter to expose the necessry information for renewing a license.
// This interface will be registed with the vidctrl so that the player can call it.
// The player is indicated thru an event (FireEx) about an expired license.
// The player turns around and calls this interface to get more information about the expired license so that 
// it can be renewed.
//
[
   object,
   uuid(8A78B317-E405-4a43-994A-620D8F5CE25E),
   helpstring("IDTFilterLicenseRenewal Interface"),
   pointer_default(unique)
]
interface IDTFilterLicenseRenewal: IUnknown
{
    HRESULT GetLicenseRenewalData ( [out] WCHAR** ppwszFileName, [out] WCHAR** ppwszExpiredKid, [out] WCHAR** ppwszTunerId);
};



// Interface: IPTFilterLicenseRenewal
// ------------------------------------
// This interface is implemented by PTFilter to enable renewing of licenses. This interface will be registed with vidctl.
// Player will call this interface to start license renewal. 
//
[
   object,
   uuid(26D836A5-0C15-44c7-AC59-B0DA8728F240),
   helpstring("IPTFilterLicenseRenewal Interface"),
   pointer_default(unique)
]
interface IPTFilterLicenseRenewal: IUnknown
{
    HRESULT RenewLicenses ([in] WCHAR* wszFileName, [in] WCHAR* wszExpiredKid, [in] DWORD dwCallersId, [in] BOOL bHighPriority);
    HRESULT CancelLicenseRenewal ();
};


// Interface: IID_IMceBurnerControl
// ------------------------------------
// This interface is implemented by third party MCE DVD burner software to turn on or off DTFilter decryption. 
// If it is detected in the filter graph during OnConnectComplete data will pass thru DTFilter. 
//
[
   object,
   uuid(5A86B91A-E71E-46c1-88A9-9BB338710552),
   helpstring("IID_IMceBurnerControl Interface"),
   pointer_default(unique)
]
interface IMceBurnerControl: IUnknown
{
	HRESULT GetBurnerNoDecryption();
};

// Interface: IID_IMceBurnerControlTest
// ------------------------------------
// This interface is implemented by DvdBurnTest.ax to turn on or off DTFilter decryption. 
// 
//
[
   object,
   uuid(462334C4-3D61-4527-8263-7A41046CD60A),
   helpstring("IID_IMceBurnerControlTest Interface"),
   pointer_default(unique)
]
interface IMceBurnerControlTest: IUnknown
{
	HRESULT SetBurnerNoDecryption([in] BOOL fEnable);
};

    // --------------------------------

[
        uuid(C4C4C400-0049-4E2B-98FB-9537F6CE516D),
        version(1.0),
        helpstring("Microsoft Encypter-Tagger/Decrypter-Detagger Filters")
]
library EncDec
{
    importlib("stdole32.tlb");
    importlib("stdole2.tlb");

    [
        object,
        uuid (C4C4C4B1-0049-4E2B-98FB-9537F6CE516D),
    //  dual
        helpstring("IETFilter Interface"),
        pointer_default(unique)
    ]
    interface IETFilter : IUnknown
    {
        [propget, id(1),  helpstring("property EvalRatObjOK")]
            HRESULT EvalRatObjOK([out, retval] HRESULT *pHrCoCreateRetVal);

        [         id(2), helpstring("method GetCurrRating")]
            HRESULT GetCurrRating(
                [out] EnTvRat_System        *pEnSystem,
                [out] EnTvRat_GenericLevel  *pEnRating,
                [out] LONG                  *plbfEnAttr      // bitfield of BfEnTvRat_GenericAttributes
            );
        [       id(3), helpstring("method GetCurrLicenseExpDate")]
            HRESULT GetCurrLicenseExpDate(
                  [in]  ProtType   *protType,
                [out] long        *lpDateTime
            );
        [       id(4), helpstring("method GetLastErrorCode")]
            HRESULT GetLastErrorCode();

        [       id(5), helpstring("method SetRecordingOn")]
        HRESULT SetRecordingOn(BOOL fRecState);


    };

    [
        uuid(C4C4C4C1-0049-4E2B-98FB-9537F6CE516D),
        helpstring("IETFilterEvents")
    ]
    dispinterface IETFilterEvents
    {
        properties:
        methods:
    };

    [
        uuid(C4C4C4F1-0049-4E2B-98FB-9537F6CE516D),
        helpstring("ETFilter Class")
    ]
    coclass ETFilter
    {
        [default] interface IETFilter;
        interface IETFilterConfig;

        [default, source] dispinterface IETFilterEvents;
    };

    // ---------------------------------------------------


    [
        object,
        uuid (C4C4C4B2-0049-4E2B-98FB-9537F6CE516D),
    //  dual
        helpstring("IDTFilter Interface"),
        pointer_default(unique)
    ]
    interface IDTFilter : IUnknown
    {
        [propget, id(1),  helpstring("property EvalRatObjOK")]
            HRESULT EvalRatObjOK([out, retval] HRESULT *pHrCoCreateRetVal);

        [       id(2), helpstring("method GetCurrRating")]
            HRESULT GetCurrRating(
                [out] EnTvRat_System        *pEnSystem,
                [out] EnTvRat_GenericLevel  *pEnRating,
                [out] LONG                  *plbfEnAttr      // bitfield of BfEnTvRat_GenericAttributes
            );

        [propget, id(3), helpstring("property BlockedRatingAttributes")]
            HRESULT BlockedRatingAttributes(
                [in] EnTvRat_System         enSystem,
                [in] EnTvRat_GenericLevel   enLevel,
                [out, retval] LONG         *plbfEnAttr
            );

        [propput, id(3), helpstring("property BlockedRatingAttributes")]
            HRESULT BlockedRatingAttributes(
                [in] EnTvRat_System         enSystem,
                [in] EnTvRat_GenericLevel   enLevel,
                [in] LONG                   lbfAttrs       // bitfield of BfEnTvRat_GenericAttributes
            );

        [propget, id(4), helpstring("property BlockUnRated")]
            HRESULT BlockUnRated(
                [out, retval] BOOL          *pfBlockUnRatedShows
            );

        [propput, id(4), helpstring("property BlockUnRated")]
            HRESULT BlockUnRated(
                [in] BOOL                   fBlockUnRatedShows
            );

        [propget, id(5), helpstring("property BlockUnRatedDelay")]
            HRESULT BlockUnRatedDelay(
                [out, retval] LONG          *pmsecsDelayBeforeBlock
            );

        [propput, id(5), helpstring("property BlockUnRatedDelay")]
            HRESULT BlockUnRatedDelay(
                [in] LONG                   msecsDelayBeforeBlock
            );

    };

    [
        object,
        uuid (C4C4C4B4-0049-4E2B-98FB-9537F6CE516D),
        helpstring("IDTFilter2 Interface"),
        pointer_default(unique)
    ]
    interface IDTFilter2 : IDTFilter
    {
        [propget, id(6), helpstring("property ChallengeUrl")]
            HRESULT ChallengeUrl([out] BSTR *pbstrChallengeUrl);

        [       id(7), helpstring("method GetCurrLicenseExpDate")]
            HRESULT GetCurrLicenseExpDate(
				[in]  ProtType  *protType,
                [out] long      *lpDateTime
                );
        [       id(8), helpstring("method GetLastErrorCode")]
            HRESULT GetLastErrorCode();
   };

    [
        object,
        uuid (513998cc-e929-4cdf-9fbd-bad1e0314866),
        helpstring("IDTFilter3 Interface"),
        pointer_default(unique)
    ]
    interface IDTFilter3 : IDTFilter2
    {
        [       id(9), helpstring("method GetProtectionType")]
		    HRESULT GetProtectionType(
                [out] ProtType *pProtectionType
                );

        [       id(10), helpstring("method LicenseHasExpirationDate")]
            HRESULT LicenseHasExpirationDate(
                [out] BOOL *pfLicenseHasExpirationDate
                );

        [       id(11), helpstring("method SetRights")]
            HRESULT SetRights(
                [in] BSTR bstrRights
                );
   };

    [
        uuid(C4C4C4C2-0049-4E2B-98FB-9537F6CE516D),
        helpstring("IDTFilterEvents")
    ]
    dispinterface IDTFilterEvents
    {
                properties:
                methods:
    };

    [
        uuid(C4C4C4F2-0049-4E2B-98FB-9537F6CE516D),
        helpstring("CDTFilter Class")
    ]
    coclass DTFilter
    {
        [default] interface IDTFilter;
        interface IDTFilterConfig;

        [default, source] dispinterface IDTFilterEvents;
    };

    // ---------------------------------------------------
    [
        object,
        uuid (C4C4C4B3-0049-4E2B-98FB-9537F6CE516D),
    //  dual
        helpstring("IXDSCodec Interface"),
        pointer_default(unique)
    ]
    interface IXDSCodec : IUnknown
    {
        [propget, id(1),  helpstring("property XDSToRatObjOK")]
                HRESULT XDSToRatObjOK([out, retval] HRESULT *pHrCoCreateRetVal);

        [propput, id(2),  helpstring("property CCSubstreamService")]
                HRESULT CCSubstreamService([in] long SubstreamMask);

        [propget, id(2),  helpstring("property CCSubstreamService")]
                HRESULT CCSubstreamService([out, retval] long *pSubstreamMask);

        [       id(3),  helpstring("method GetContentAdvisoryRating")   ]
                HRESULT GetContentAdvisoryRating(
                [out] PackedTvRating    *pRat,      // TvRating
                [out] long              *pPktSeqID,
                [out] long              *pCallSeqID,
                [out] REFERENCE_TIME    *pTimeStart,    // time this sample started
                [out] REFERENCE_TIME    *pTimeEnd
                );

        [       id(4),  helpstring("method GetXDSPacket")   ]
            HRESULT GetXDSPacket(
                [out] long              *pXDSClassPkt, // ENUM EnXDSClass
                [out] long              *pXDSTypePkt,
                [out] BSTR              *pBstrXDSPkt,
                [out] long              *pPktSeqID,
                [out] long              *pCallSeqID,
                [out] REFERENCE_TIME    *pTimeStart,    // time this sample started
                [out] REFERENCE_TIME    *pTimeEnd
                );

     [       id(5), helpstring("method GetCurrLicenseExpDate")]
                HRESULT GetCurrLicenseExpDate(
                      [in]  ProtType   *protType,
                    [out] long        *lpDateTime
             );
        [       id(6), helpstring("method GetLastErrorCode")]
            HRESULT GetLastErrorCode();

    };

    [
        uuid(C4C4C4C3-0049-4E2B-98FB-9537F6CE516D),
        helpstring("IXDSCodecEvents")
    ]
    dispinterface IXDSCodecEvents
    {
                properties:
                methods:
    };

    [
        uuid(C4C4C4F3-0049-4E2B-98FB-9537F6CE516D),
        helpstring("CXDSCodec Class")
    ]
    coclass XDSCodec
    {
        [default] interface IXDSCodec;
        interface IXDSCodecConfig;

        [default, source] dispinterface IXDSCodecEvents;
    };

    [
		uuid(C4C4C4F4-0049-4E2B-98FB-9537F6CE516D),
		helpstring("CXDSCodec Class")
    ]
    coclass CXDSData
    {
		[default] interface IXDSCodec;
		interface IXDSCodecConfig;

		[default, source] dispinterface IXDSCodecEvents;
    };

};

