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.

143 lines
3.1 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1998 - 2000
  3. Module Name:
  4. private.h
  5. Abstract:
  6. This module contains private definitions for DRMK.sys
  7. Author:
  8. Paul England (PEngland) from sample code by
  9. Dale Sather (DaleSat) 31-Jul-1998
  10. --*/
  11. extern "C" {
  12. #include <wdm.h>
  13. }
  14. #include <unknown.h>
  15. #include <ks.h>
  16. #include <windef.h>
  17. #include <stdio.h>
  18. #include <windef.h>
  19. #define NOBITMAP
  20. #include <mmreg.h>
  21. #undef NOBITMAP
  22. #include <ks.h>
  23. #include "ksmedia.h"
  24. #include <unknown.h>
  25. #include <kcom.h>
  26. #if (DBG)
  27. #define STR_MODULENAME "KDRM:"
  28. #endif
  29. #include <ksdebug.h>
  30. #define POOLTAG '2mrD'
  31. #include "inc/KrmCommStructs.h"
  32. #include "inc/DrmErrs.h"
  33. #include <drmk.h>
  34. #pragma code_seg("PAGE")
  35. #define PIN_ID_OUTPUT 0
  36. #define PIN_ID_INPUT 1
  37. //
  38. struct FilterInstance{
  39. DWORD StreamId; // StreamId (known elsewhere as ContentId) is unique-per-stream
  40. PKSDATAFORMAT OutDataFormat; // Output KS data format
  41. PWAVEFORMATEX OutWfx; // Pointer to the waveformatex embedded somewhere within *OutDataFormat
  42. STREAMKEY streamKey; // initially set to the value obtained from StreamManager
  43. bool initKey; // has the streamKey been initted?
  44. bool decryptorRunning; // has the Descrambler seen the start frame?
  45. DWORD frameSize; // size of frame (calculated from OutWfx by Descrambler)
  46. };
  47. struct InputPinInstance
  48. {
  49. // For LOOPED_STREAMING pins:
  50. // the frame's original loop pointer and size
  51. struct {
  52. PVOID Data;
  53. ULONG BytesAvailable;
  54. } Loop;
  55. // the output pin's position when the frame was started or
  56. // its position last set
  57. ULONGLONG BasePosition;
  58. // the position within the frame when it was started or
  59. // its position last set
  60. ULONGLONG StartPosition;
  61. // the next copy-from position within the frame
  62. ULONGLONG OffsetPosition;
  63. // the position last set, and a flag indicating that this
  64. // position needs to be set by the Process function
  65. ULONGLONG SetPosition;
  66. BOOL PendingSetPosition;
  67. };
  68. struct OutputPinInstance
  69. {
  70. // count of bytes written to the output
  71. ULONGLONG BytesWritten;
  72. };
  73. typedef struct {
  74. KSEVENT_ENTRY EventEntry;
  75. ULONGLONG Position;
  76. } DRMLOOPEDSTREAMING_POSITION_EVENT_ENTRY, *PDRMLOOPEDSTREAMING_POSITION_EVENT_ENTRY;
  77. NTSTATUS
  78. DRMAudioIntersectHandlerInPin(
  79. IN PVOID Filter,
  80. IN PIRP Irp,
  81. IN PKSP_PIN PinInstance,
  82. IN PKSDATARANGE CallerDataRange,
  83. IN PKSDATARANGE DescriptorDataRange,
  84. IN ULONG BufferSize,
  85. OUT PVOID Data OPTIONAL,
  86. OUT PULONG DataSize
  87. );
  88. NTSTATUS
  89. DRMAudioIntersectHandlerOutPin(
  90. IN PVOID Filter,
  91. IN PIRP Irp,
  92. IN PKSP_PIN PinInstance,
  93. IN PKSDATARANGE CallerDataRange,
  94. IN PKSDATARANGE DescriptorDataRange,
  95. IN ULONG BufferSize,
  96. OUT PVOID Data OPTIONAL,
  97. OUT PULONG DataSize
  98. );
  99. //
  100. // DRMFilter.cpp
  101. //
  102. extern
  103. const
  104. KSFILTER_DESCRIPTOR
  105. DrmFilterDescriptor;
  106. //
  107. // Filters table.
  108. //
  109. #ifdef DEFINE_FILTER_DESCRIPTORS_ARRAY
  110. DEFINE_KSFILTER_DESCRIPTOR_TABLE(FilterDescriptors)
  111. {
  112. &DrmFilterDescriptor
  113. };
  114. #endif