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.

180 lines
6.6 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows Media Technologies
  4. // Copyright (C) Microsoft Corporation, 1999 - 2001. All Rights Reserved.
  5. //
  6. // File: drmexternals.idl
  7. //
  8. // Contents: enums and typedefs needed for using microsoft drm.
  9. // !!!THIS FILE NEEDS TO BE DROPPED TO SDK\IDL DIRECTORY WHENEVER CHANGED!!!
  10. //--------------------------------------------------------------------------
  11. import "oaidl.idl";
  12. // The following is a partial list of DRM (v7 or greater) actions that are of interest to applications.
  13. cpp_quote( "static const WCHAR *g_wszWMDRM_RIGHT_PLAYBACK = L\"Play\";" )
  14. cpp_quote( "static const WCHAR *g_wszWMDRM_RIGHT_COPY_TO_CD = L\"Print.redbook\";" )
  15. cpp_quote( "static const WCHAR *g_wszWMDRM_RIGHT_COPY_TO_SDMI_DEVICE = L\"Transfer.SDMI\";" )
  16. cpp_quote( "static const WCHAR *g_wszWMDRM_RIGHT_COPY_TO_NON_SDMI_DEVICE = L\"Transfer.NONSDMI\";" )
  17. cpp_quote( "static const WCHAR *g_wszWMDRM_RIGHT_BACKUP = L\"Backup\";" )
  18. // Property prefix for getting header/license information
  19. cpp_quote( "static const WCHAR *g_wszWMDRM_ActionAllowed = L\"ActionAllowed.\";" )
  20. cpp_quote( "static const WCHAR *g_wszWMDRM_LicenseState = L\"LicenseStateData.\";" )
  21. cpp_quote( "static const WCHAR *g_wszWMDRM_DRMHeader = L\"DRMHeader.\";" )
  22. cpp_quote( "static const WCHAR *g_wszWMDRM_IsDRM = L\"IsDRM\";" )
  23. cpp_quote( "static const WCHAR *g_wszWMDRM_IsDRMCached = L\"IsDRMCached\";" )
  24. cpp_quote( "static const WCHAR *g_wszWMDRM_ActionAllowed_Playback = L\"ActionAllowed.Play\";" )
  25. cpp_quote( "static const WCHAR *g_wszWMDRM_ActionAllowed_CopyToCD = L\"ActionAllowed.Print.redbook\";" )
  26. cpp_quote( "static const WCHAR *g_wszWMDRM_ActionAllowed_CopyToSDMIDevice = L\"ActionAllowed.Transfer.SDMI\";" )
  27. cpp_quote( "static const WCHAR *g_wszWMDRM_ActionAllowed_CopyToNonSDMIDevice = L\"ActionAllowed.Transfer.NONSDMI\";" )
  28. cpp_quote( "static const WCHAR *g_wszWMDRM_ActionAllowed_Backup = L\"ActionAllowed.Backup\";" )
  29. cpp_quote( "static const WCHAR *g_wszWMDRM_LicenseState_Playback = L\"LicenseStateData.Play\";" )
  30. cpp_quote( "static const WCHAR *g_wszWMDRM_LicenseState_CopyToCD = L\"LicenseStateData.Print.redbook\";" )
  31. cpp_quote( "static const WCHAR *g_wszWMDRM_LicenseState_CopyToSDMIDevice = L\"LicenseStateData.Transfer.SDMI\";" )
  32. cpp_quote( "static const WCHAR *g_wszWMDRM_LicenseState_CopyToNonSDMIDevice = L\"LicenseStateData.Transfer.NONSDMI\";" )
  33. // This enum indicates the category for each possible output string to be displayed.
  34. // 0 - Playback not permitted.
  35. // 1 - Playback valid 5 times.
  36. // 2 - Playback valid from 7/12/00.
  37. // 3 - Playback valid until 7/12/00.
  38. // 4 - Playback valid from 5/12 to 9/12.
  39. // 5 - Playback valid 5 times from 7/12/00.
  40. // 6 - Playback valid 5 times until 7/12/00.
  41. // 7 - Playback valid 5 times from 5/12 to 9/12.
  42. // 8 - Playback valid for 24 hours from first use.
  43. typedef enum DRM_LICENSE_STATE_CATEGORY
  44. {
  45. WM_DRM_LICENSE_STATE_NORIGHT = 0,
  46. WM_DRM_LICENSE_STATE_UNLIM,
  47. WM_DRM_LICENSE_STATE_COUNT,
  48. WM_DRM_LICENSE_STATE_FROM,
  49. WM_DRM_LICENSE_STATE_UNTIL,
  50. WM_DRM_LICENSE_STATE_FROM_UNTIL,
  51. WM_DRM_LICENSE_STATE_COUNT_FROM,
  52. WM_DRM_LICENSE_STATE_COUNT_UNTIL,
  53. WM_DRM_LICENSE_STATE_COUNT_FROM_UNTIL,
  54. WM_DRM_LICENSE_STATE_EXPIRATION_AFTER_FIRSTUSE
  55. } DRM_LICENSE_STATE_CATEGORY;
  56. typedef struct _DRM_LICENSE_STATE_DATA
  57. {
  58. DWORD dwStreamId; // 0 => All streams != 0 => For a particular stream.
  59. DRM_LICENSE_STATE_CATEGORY dwCategory; // indicates the category of string to be displayed.
  60. DWORD dwNumCounts; // Number of items supplied in dwCount
  61. DWORD dwCount[4]; // Up to 4 counts
  62. DWORD dwNumDates; // Number of items supplied in dwDate.
  63. FILETIME datetime[4]; // Up to 4 dates.
  64. DWORD dwVague; // 0 => certain 1 => atleast (there could be more licenses. Aggregation not possible).
  65. } DRM_LICENSE_STATE_DATA;
  66. typedef enum DRM_HTTP_STATUS
  67. {
  68. HTTP_NOTINITIATED = 0,
  69. HTTP_CONNECTING,
  70. HTTP_REQUESTING,
  71. HTTP_RECEIVING,
  72. HTTP_COMPLETED
  73. } DRM_HTTP_STATUS;
  74. // The various states individualization can be in:
  75. typedef enum DRM_INDIVIDUALIZATION_STATUS
  76. {
  77. INDI_UNDEFINED = 0x0000,
  78. INDI_BEGIN = 0x0001,
  79. INDI_SUCCEED = 0x0002,
  80. INDI_FAIL = 0x0004,
  81. INDI_CANCEL = 0x0008,
  82. INDI_DOWNLOAD = 0x0010,
  83. INDI_INSTALL = 0x0020
  84. } DRM_INDIVIDUALIZATION_STATUS;
  85. typedef struct _WMIndividualizeStatus
  86. {
  87. HRESULT hr;
  88. DRM_INDIVIDUALIZATION_STATUS enIndiStatus;
  89. LPSTR pszIndiRespUrl;
  90. DWORD dwHTTPRequest;
  91. DRM_HTTP_STATUS enHTTPStatus;
  92. DWORD dwHTTPReadProgress;
  93. DWORD dwHTTPReadTotal;
  94. } WM_INDIVIDUALIZE_STATUS;
  95. typedef struct _WMGetLicenseData
  96. {
  97. DWORD dwSize;
  98. HRESULT hr;
  99. WCHAR *wszURL;
  100. WCHAR *wszLocalFilename;
  101. BYTE *pbPostData;
  102. DWORD dwPostDataSize;
  103. } WM_GET_LICENSE_DATA;
  104. typedef enum MSDRM_STATUS
  105. {
  106. DRM_ERROR = 0,
  107. DRM_INFORMATION = 1,
  108. DRM_BACKUPRESTORE_BEGIN = 2,
  109. DRM_BACKUPRESTORE_END = 3,
  110. DRM_BACKUPRESTORE_CONNECTING = 4,
  111. DRM_BACKUPRESTORE_DISCONNECTING = 5,
  112. DRM_ERROR_WITHURL = 6,
  113. DRM_RESTRICTED_LICENSE = 7,
  114. DRM_NEEDS_INDIVIDUALIZATION = 8
  115. } MSDRM_STATUS;
  116. //
  117. // Attribute datatypes.
  118. //
  119. typedef enum DRM_ATTR_DATATYPE
  120. {
  121. DRM_TYPE_DWORD = 0,
  122. DRM_TYPE_STRING = 1,
  123. DRM_TYPE_BINARY = 2,
  124. DRM_TYPE_BOOL = 3,
  125. DRM_TYPE_QWORD = 4,
  126. DRM_TYPE_WORD = 5,
  127. DRM_TYPE_GUID = 6,
  128. } DRM_ATTR_DATATYPE;
  129. interface IDRMStatusCallback;
  130. cpp_quote( "#define DRM_BACKUP_OVERWRITE ((DWORD) 0x00000001)" )
  131. cpp_quote( "#define DRM_RESTORE_INDIVIDUALIZE ((DWORD) 0x00000002)" )
  132. [
  133. object,
  134. uuid( 08548704-75B1-4982-9B26-FB385DEE741D ),
  135. helpstring("IDRMStatusCallback Interface"),
  136. pointer_default(unique),
  137. local
  138. ]
  139. interface IDRMStatusCallback : IUnknown
  140. {
  141. //
  142. // The contents pParam depends on the Status.
  143. //
  144. HRESULT OnStatus( [in] MSDRM_STATUS Status,
  145. [in] HRESULT hr,
  146. [in] DRM_ATTR_DATATYPE dwType,
  147. [in] BYTE *pValue,
  148. [in] void *pvContext );
  149. };
  150. // drmbuf
  151. cpp_quote("#define DRM_ENCRYPT_CONTENT_ASFv1 0x1001")
  152. cpp_quote("#define DRM_ENCRYPT_CONTENT_ASFv2 0x1002")
  153. typedef struct _DRMBUF {
  154. unsigned long len;
  155. char *buf;
  156. } DRMBUF, *PDRMBUF;