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.

191 lines
4.0 KiB

  1. #ifndef _DRMK_H_
  2. #define _DRMK_H_
  3. #ifdef __cplusplus
  4. extern "C"
  5. {
  6. #endif
  7. typedef struct tagDRMRIGHTS {
  8. BOOL CopyProtect;
  9. ULONG Reserved;
  10. BOOL DigitalOutputDisable;
  11. } DRMRIGHTS , *PDRMRIGHTS;
  12. typedef const DRMRIGHTS *PCDRMRIGHTS;
  13. #define DEFINE_DRMRIGHTS_DEFAULT(DrmRights) const DRMRIGHTS DrmRights = {FALSE, 0, FALSE}
  14. // {1915C967-3299-48cb-A3E4-69FD1D1B306E}
  15. DEFINE_GUID(IID_IDrmAudioStream,
  16. 0x1915c967, 0x3299, 0x48cb, 0xa3, 0xe4, 0x69, 0xfd, 0x1d, 0x1b, 0x30, 0x6e);
  17. DECLARE_INTERFACE_(IDrmAudioStream, IUnknown)
  18. {
  19. // IUnknown methods
  20. STDMETHOD_(NTSTATUS, QueryInterface)(THIS_
  21. REFIID InterfaceId,
  22. PVOID* Interface
  23. ) PURE;
  24. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  25. STDMETHOD_(ULONG,Release)(THIS) PURE;
  26. // IDrmAudioStream methods
  27. STDMETHOD_(NTSTATUS,SetContentId)(THIS_
  28. IN ULONG ContentId,
  29. IN PCDRMRIGHTS DrmRights
  30. ) PURE;
  31. };
  32. typedef IDrmAudioStream *PDRMAUDIOSTREAM;
  33. #define IMP_IDrmAudioStream\
  34. STDMETHODIMP_(NTSTATUS) SetContentId\
  35. ( IN ULONG ContentId,\
  36. IN PCDRMRIGHTS DrmRights\
  37. );
  38. typedef struct tagDRMFORWARD {
  39. DWORD Flags;
  40. PDEVICE_OBJECT DeviceObject;
  41. PFILE_OBJECT FileObject;
  42. PVOID Context;
  43. } DRMFORWARD, *PDRMFORWARD;
  44. typedef const DRMFORWARD *PCDRMFORWARD;
  45. NTSTATUS
  46. NTAPI
  47. DrmAddContentHandlers(
  48. IN ULONG ContentId,
  49. IN PVOID* paHandlers,
  50. IN ULONG NumHandlers
  51. );
  52. typedef
  53. NTSTATUS
  54. (NTAPI *PFNDRMADDCONTENTHANDLERS)(
  55. IN ULONG ContentId,
  56. IN PVOID* paHandlers,
  57. IN ULONG NumHandlers
  58. );
  59. NTSTATUS
  60. NTAPI
  61. DrmCreateContentMixed(
  62. IN PULONG paContentId,
  63. IN ULONG cContentId,
  64. OUT PULONG pMixedContentId
  65. );
  66. typedef
  67. NTSTATUS
  68. (NTAPI *PFNDRMCREATECONTENTMIXED)(
  69. IN PULONG paContentId,
  70. IN ULONG cContentId,
  71. OUT PULONG pMixedContentId
  72. );
  73. NTSTATUS
  74. NTAPI
  75. DrmDestroyContent(
  76. IN ULONG ContentId
  77. );
  78. typedef
  79. NTSTATUS
  80. (NTAPI *PFNDRMDESTROYCONTENT)(
  81. IN ULONG ContentId
  82. );
  83. NTSTATUS
  84. NTAPI
  85. DrmForwardContentToDeviceObject(
  86. IN ULONG ContentId,
  87. IN PVOID Reserved,
  88. IN PCDRMFORWARD DrmForward
  89. );
  90. typedef
  91. NTSTATUS
  92. (NTAPI *PFNDRMFORWARDCONTENTTODEVICEOBJECT)(
  93. IN ULONG ContentId,
  94. IN PVOID Reserved,
  95. IN PCDRMFORWARD DrmForward
  96. );
  97. NTSTATUS
  98. NTAPI
  99. DrmForwardContentToFileObject(
  100. IN ULONG ContentId,
  101. IN PFILE_OBJECT FileObject
  102. );
  103. typedef
  104. NTSTATUS
  105. (NTAPI *PFNDRMFORWARDCONTENTTOFILEOBJECT)(
  106. IN ULONG ContentId,
  107. IN PFILE_OBJECT FileObject
  108. );
  109. NTSTATUS
  110. NTAPI
  111. DrmForwardContentToInterface(
  112. ULONG ContentId,
  113. PUNKNOWN pUnknown,
  114. ULONG NumMethods);
  115. typedef
  116. NTSTATUS
  117. (NTAPI *PFNDRMFORWARDCONTENTTOINTERFACE)(
  118. ULONG ContentId,
  119. PUNKNOWN pUnknown,
  120. ULONG NumMethods);
  121. NTSTATUS
  122. NTAPI
  123. DrmGetContentRights(
  124. IN ULONG ContentId,
  125. OUT PDRMRIGHTS DrmRights
  126. );
  127. typedef
  128. NTSTATUS
  129. (NTAPI *PFNDRMGETCONTENTRIGHTS)(
  130. IN ULONG ContentId,
  131. OUT PDRMRIGHTS DrmRights
  132. );
  133. //
  134. // Structures for use with KSPROPERY_DRMAUDIOSTREAM_CONTENTID
  135. //
  136. typedef struct {
  137. ULONG ContentId;
  138. DRMRIGHTS DrmRights;
  139. } KSDRMAUDIOSTREAM_CONTENTID, *PKSDRMAUDIOSTREAM_CONTENTID;
  140. typedef struct {
  141. KSPROPERTY Property;
  142. PVOID Context;
  143. // DRM API callback functions
  144. PFNDRMADDCONTENTHANDLERS DrmAddContentHandlers;
  145. PFNDRMCREATECONTENTMIXED DrmCreateContentMixed;
  146. PFNDRMDESTROYCONTENT DrmDestroyContent;
  147. PFNDRMFORWARDCONTENTTODEVICEOBJECT DrmForwardContentToDeviceObject;
  148. PFNDRMFORWARDCONTENTTOFILEOBJECT DrmForwardContentToFileObject;
  149. PFNDRMFORWARDCONTENTTOINTERFACE DrmForwardContentToInterface;
  150. PFNDRMGETCONTENTRIGHTS DrmGetContentRights;
  151. } KSP_DRMAUDIOSTREAM_CONTENTID, *PKSP_DRMAUDIOSTREAM_CONTENTID;
  152. #ifdef __cplusplus
  153. }
  154. #endif
  155. #endif