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