xref: /reactos/drivers/wdm/audio/legacy/stream/stream.h (revision 60b0afc3)
1 #pragma once
2 
3 #include <strmini.h>
4 
5 // #define NDEBUG
6 #include <debug.h>
7 
8 #define STREAMDEBUG_LEVEL DebugLevelMaximum
9 
10 typedef BOOLEAN (NTAPI *SYNCHRONIZE_FUNC) (IN PKINTERRUPT  Interrupt, IN PKSYNCHRONIZE_ROUTINE  SynchronizeRoutine, IN PVOID  SynchronizeContext);
11 
12 typedef struct
13 {
14     HW_INITIALIZATION_DATA Data;
15 
16 }STREAM_CLASS_DRIVER_EXTENSION, *PSTREAM_CLASS_DRIVER_EXTENSION;
17 
18 typedef struct
19 {
20     LIST_ENTRY Entry;
21     PVOID Start;
22     ULONG Length;
23 }MEMORY_RESOURCE_LIST, *PMEMORY_RESOURCE_LIST;
24 
25 typedef struct
26 {
27     KSDEVICE_HEADER Header;
28     PDEVICE_OBJECT LowerDeviceObject;
29     PDEVICE_OBJECT PhysicalDeviceObject;
30 
31     SYNCHRONIZE_FUNC SynchronizeFunction;
32 
33     ULONG MapRegisters;
34     PDMA_ADAPTER DmaAdapter;
35     PVOID DmaCommonBuffer;
36     PHYSICAL_ADDRESS DmaPhysicalAddress;
37 
38     PKINTERRUPT Interrupt;
39     KDPC InterruptDpc;
40 
41     LIST_ENTRY MemoryResourceList;
42 
43     ULONG StreamDescriptorSize;
44     PHW_STREAM_DESCRIPTOR StreamDescriptor;
45     PSTREAM_CLASS_DRIVER_EXTENSION DriverExtension;
46 
47     PVOID DeviceExtension;
48     LONG InstanceCount;
49 
50 }STREAM_DEVICE_EXTENSION, *PSTREAM_DEVICE_EXTENSION;
51 
52 typedef struct
53 {
54     HW_STREAM_REQUEST_BLOCK Block;
55     KEVENT Event;
56 }HW_STREAM_REQUEST_BLOCK_EXT, *PHW_STREAM_REQUEST_BLOCK_EXT;
57 
58 NTSTATUS
59 NTAPI
60 StreamClassCreateFilter(
61     IN  PDEVICE_OBJECT DeviceObject,
62     IN  PIRP Irp);
63 
64 NTSTATUS
65 NTAPI
66 StreamClassPnp(
67     IN  PDEVICE_OBJECT DeviceObject,
68     IN  PIRP Irp);
69 
70 NTSTATUS
71 NTAPI
72 StreamClassPower(
73     IN  PDEVICE_OBJECT DeviceObject,
74     IN  PIRP Irp);
75 
76 NTSTATUS
77 NTAPI
78 StreamClassSystemControl(
79     IN  PDEVICE_OBJECT DeviceObject,
80     IN  PIRP Irp);
81 
82 NTSTATUS
83 NTAPI
84 StreamClassCleanup(
85     IN  PDEVICE_OBJECT DeviceObject,
86     IN  PIRP Irp);
87 
88 NTSTATUS
89 NTAPI
90 StreamClassFlushBuffers(
91     IN  PDEVICE_OBJECT DeviceObject,
92     IN  PIRP Irp);
93 
94 NTSTATUS
95 NTAPI
96 StreamClassDeviceControl(
97     IN  PDEVICE_OBJECT DeviceObject,
98     IN  PIRP Irp);
99 
100 NTSTATUS
101 NTAPI
102 StreamClassAddDevice(
103     IN PDRIVER_OBJECT  DriverObject,
104     IN PDEVICE_OBJECT  PhysicalDeviceObject);
105 
106 BOOLEAN
107 NTAPI
108 StreamClassSynchronize(
109     IN PKINTERRUPT  Interrupt,
110     IN PKSYNCHRONIZE_ROUTINE  SynchronizeRoutine,
111     IN PVOID  SynchronizeContext);
112 
113 BOOLEAN
114 NTAPI
115 StreamClassInterruptRoutine(
116     IN PKINTERRUPT  Interrupt,
117     IN PVOID  ServiceContext);
118 
119 VOID
120 NTAPI
121 StreamClassInterruptDpc(
122     IN PKDPC Dpc,
123     IN PVOID  DeferredContext,
124     IN PVOID  SystemArgument1,
125     IN PVOID  SystemArgument2);
126 
127 VOID
128 CompleteIrp(
129     IN PIRP Irp,
130     IN NTSTATUS Status,
131     IN ULONG_PTR Information);
132