ReactOS  0.4.14-dev-49-gfb4591c
entry.c File Reference
#include "wdmaud.h"
#include <debug.h>
Include dependency graph for entry.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

VOID NTAPI WdmAudInitWorkerRoutine (IN PDEVICE_OBJECT DeviceObject, IN PVOID Context)
 
VOID NTAPI WdmAudTimerRoutine (IN PDEVICE_OBJECT DeviceObject, IN PVOID Context)
 
NTSTATUS NTAPI WdmaudAddDevice (IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT PhysicalDeviceObject)
 
VOID NTAPI WdmAudUnload (IN PDRIVER_OBJECT driver)
 
NTSTATUS NTAPI WdmAudPnp (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS NTAPI WdmAudCreate (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS NTAPI WdmAudClose (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS NTAPI WdmAudCleanup (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS NTAPI DriverEntry (IN PDRIVER_OBJECT Driver, IN PUNICODE_STRING Registry_path)
 

Variables

const GUID KSCATEGORY_SYSAUDIO = {0xA7C7A5B1L, 0x5AF3, 0x11D1, {0x9C, 0xED, 0x00, 0xA0, 0x24, 0xBF, 0x04, 0x07}}
 
const GUID KSCATEGORY_WDMAUD = {0x3E227E76L, 0x690D, 0x11D2, {0x81, 0x61, 0x00, 0x00, 0xF8, 0x77, 0x5B, 0xF1}}
 
IO_WORKITEM_ROUTINE WdmAudInitWorkerRoutine
 
IO_TIMER_ROUTINE WdmAudTimerRoutine
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 12 of file entry.c.

Function Documentation

◆ DriverEntry()

NTSTATUS NTAPI DriverEntry ( IN PDRIVER_OBJECT  Driver,
IN PUNICODE_STRING  Registry_path 
)

Definition at line 353 of file entry.c.

357 {
358  DPRINT("Wdmaud.sys loaded\n");
359 
360  Driver->DriverUnload = WdmAudUnload;
361 
362  Driver->MajorFunction[IRP_MJ_CREATE] = WdmAudCreate;
363  Driver->MajorFunction[IRP_MJ_CLOSE] = WdmAudClose;
364  Driver->MajorFunction[IRP_MJ_PNP] = WdmAudPnp;
366  Driver->MajorFunction[IRP_MJ_CLEANUP] = WdmAudCleanup;
368  Driver->MajorFunction[IRP_MJ_WRITE] = WdmAudReadWrite;
369  Driver->MajorFunction[IRP_MJ_READ] = WdmAudReadWrite;
370  Driver->MajorFunction[IRP_MJ_POWER] = KsDefaultDispatchPower;
371  Driver->DriverExtension->AddDevice = WdmaudAddDevice;
372 
373  return STATUS_SUCCESS;
374 }
NTSTATUS NTAPI WdmAudClose(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: entry.c:261
KSDDKAPI NTSTATUS NTAPI KsDefaultDispatchPower(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: api.c:166
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
NTSTATUS NTAPI WdmAudCleanup(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: entry.c:286
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
NTSTATUS NTAPI WdmAudCreate(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: entry.c:205
NTSTATUS NTAPI WdmAudPnp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: entry.c:184
VOID NTAPI WdmAudUnload(IN PDRIVER_OBJECT driver)
Definition: entry.c:176
NTSTATUS NTAPI WdmAudDeviceControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: control.c:302
NTSTATUS NTAPI WdmaudAddDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT PhysicalDeviceObject)
Definition: entry.c:90
void DPRINT(...)
Definition: polytest.cpp:61
_In_ PCUNICODE_STRING _In_ PVOID Driver
Definition: cmfuncs.h:32
#define IRP_MJ_POWER
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
#define IRP_MJ_SYSTEM_CONTROL
KSDDKAPI NTSTATUS NTAPI KsDefaultForwardIrp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: api.c:227
#define IRP_MJ_READ
Definition: rdpdr.c:46
#define IRP_MJ_CLEANUP
NTSTATUS NTAPI WdmAudReadWrite(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: control.c:436
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
return STATUS_SUCCESS
Definition: btrfs.c:2966
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52

◆ WdmaudAddDevice()

NTSTATUS NTAPI WdmaudAddDevice ( IN PDRIVER_OBJECT  DriverObject,
IN PDEVICE_OBJECT  PhysicalDeviceObject 
)

Definition at line 90 of file entry.c.

93 {
96  PWDMAUD_DEVICE_EXTENSION DeviceExtension;
97 
98  DPRINT("WdmaudAddDevice called\n");
99 
101  sizeof(WDMAUD_DEVICE_EXTENSION),
102  NULL,
104  0,
105  FALSE,
106  &DeviceObject);
107 
108  if (!NT_SUCCESS(Status))
109  {
110  DPRINT1("IoCreateDevice failed with %x\n", Status);
111  return Status;
112  }
113 
114  /* get device extension */
116  RtlZeroMemory(DeviceExtension, sizeof(WDMAUD_DEVICE_EXTENSION));
117 
118  /* allocate work item */
119  DeviceExtension->WorkItem = IoAllocateWorkItem(DeviceObject);
120  if (!DeviceExtension->WorkItem)
121  {
122  /* failed to allocate work item */
125  }
126 
127  /* register device interfaces */
129  if (!NT_SUCCESS(Status))
130  {
131  DPRINT1("WdmRegisterDeviceInterface failed with %x\n", Status);
133  return Status;
134  }
135 
136  /* initialize sysaudio device list */
137  InitializeListHead(&DeviceExtension->SysAudioDeviceList);
138 
139  /* initialize client context device list */
140  InitializeListHead(&DeviceExtension->WdmAudClientList);
141 
142  /* initialize spinlock */
143  KeInitializeSpinLock(&DeviceExtension->Lock);
144 
145  /* initialization completion event */
147 
148  /* initialize timer */
150 
151  /* allocate ks device header */
152  Status = KsAllocateDeviceHeader(&DeviceExtension->DeviceHeader, 0, NULL);
153  if (!NT_SUCCESS(Status))
154  {
155  DPRINT1("KsAllocateDeviceHeader failed with %x\n", Status);
157  return Status;
158  }
159 
160  /* attach to device stack */
162  KsSetDevicePnpAndBaseObject(DeviceExtension->DeviceHeader, DeviceExtension->NextDeviceObject, DeviceObject);
163 
164 
165  /* start the timer */
167 
170 
171  return STATUS_SUCCESS;
172 }
#define DO_DEVICE_INITIALIZING
Definition: env_spec_w32.h:399
#define DO_POWER_PAGABLE
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
VOID NTAPI IoStartTimer(IN PDEVICE_OBJECT DeviceObject)
Definition: iotimer.c:133
KSDDKAPI NTSTATUS NTAPI KsAllocateDeviceHeader(OUT KSDEVICE_HEADER *OutHeader, IN ULONG ItemsCount, IN PKSOBJECT_CREATE_ITEM ItemsList OPTIONAL)
Definition: api.c:522
KSDDKAPI VOID NTAPI KsSetDevicePnpAndBaseObject(IN KSDEVICE_HEADER Header, IN PDEVICE_OBJECT PnpDeviceObject, IN PDEVICE_OBJECT BaseDevice)
Definition: api.c:257
LONG NTSTATUS
Definition: precomp.h:26
KSDEVICE_HEADER DeviceHeader
Definition: wdmaud.h:53
PDEVICE_OBJECT PhysicalDeviceObject
Definition: btrfs_drv.h:1114
PIO_WORKITEM NTAPI IoAllocateWorkItem(IN PDEVICE_OBJECT DeviceObject)
Definition: iowork.c:75
#define DO_DIRECT_IO
Definition: env_spec_w32.h:396
struct WDMAUD_DEVICE_EXTENSION * PWDMAUD_DEVICE_EXTENSION
PDEVICE_OBJECT NTAPI IoAttachDeviceToDeviceStack(IN PDEVICE_OBJECT SourceDevice, IN PDEVICE_OBJECT TargetDevice)
Definition: device.c:966
FORCEINLINE VOID KeInitializeSpinLock(_Out_ PKSPIN_LOCK SpinLock)
Definition: kefuncs.h:251
PVOID DeviceExtension
Definition: env_spec_w32.h:418
PIO_WORKITEM WorkItem
Definition: wdmaud.h:66
KEVENT InitializationCompletionEvent
Definition: wdmaud.h:67
smooth NULL
Definition: ftsmooth.c:416
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
void DPRINT(...)
Definition: polytest.cpp:61
IO_TIMER_ROUTINE WdmAudTimerRoutine
Definition: entry.c:19
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
NTSTATUS NTAPI IoInitializeTimer(IN PDEVICE_OBJECT DeviceObject, IN PIO_TIMER_ROUTINE TimerRoutine, IN PVOID Context)
Definition: iotimer.c:92
LIST_ENTRY SysAudioDeviceList
Definition: wdmaud.h:60
KSPIN_LOCK Lock
Definition: wdmaud.h:58
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1251
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
#define FILE_DEVICE_KS
Definition: winioctl.h:152
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
PDEVICE_OBJECT NextDeviceObject
Definition: wdmaud.h:70
#define DPRINT1
Definition: precomp.h:8
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
Definition: device.c:1031
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
return STATUS_SUCCESS
Definition: btrfs.c:2966
LIST_ENTRY WdmAudClientList
Definition: wdmaud.h:63
NTSTATUS WdmAudRegisterDeviceInterface(IN PDEVICE_OBJECT PhysicalDeviceObject, IN PWDMAUD_DEVICE_EXTENSION DeviceExtension)
Definition: deviface.c:186

Referenced by DriverEntry().

◆ WdmAudCleanup()

NTSTATUS NTAPI WdmAudCleanup ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 286 of file entry.c.

289 {
290  PIO_STACK_LOCATION IoStack;
291  PWDMAUD_CLIENT pClient;
292  PWDMAUD_DEVICE_EXTENSION DeviceExtension;
293  ULONG Index;
294  KIRQL OldIrql;
295 
296  /* get device extension */
298 
299  /* get current irp stack location */
301 
302  /* sanity check */
303  ASSERT(IoStack->FileObject);
304 
305  /* get client context struct */
306  pClient = (PWDMAUD_CLIENT)IoStack->FileObject->FsContext;
307 
308  /* sanity check */
309  ASSERT(pClient);
310 
311  /* acquire client context list lock */
312  KeAcquireSpinLock(&DeviceExtension->Lock, &OldIrql);
313 
314  /* remove entry */
315  RemoveEntryList(&pClient->Entry);
316 
317  /* release lock */
318  KeReleaseSpinLock(&DeviceExtension->Lock, OldIrql);
319 
320  /* check if all audio pins have been closed */
321  for (Index = 0; Index < pClient->NumPins; Index++)
322  {
323  DPRINT("Index %u Pin %p Type %x\n", Index, pClient->hPins[Index].Handle, pClient->hPins[Index].Type);
324  if (pClient->hPins[Index].Handle && pClient->hPins[Index].Type != MIXER_DEVICE_TYPE)
325  {
326  /* found an still open audio pin */
327  ZwClose(pClient->hPins[Index].Handle);
328  }
330  }
331 
332  /* free pin array */
333  if (pClient->hPins)
334  FreeItem(pClient->hPins);
335 
336  /* free client context struct */
337  FreeItem(pClient);
338 
339  /* clear old client pointer */
340  IoStack->FileObject->FsContext = NULL;
341 
342  /* complete request */
343  Irp->IoStatus.Status = STATUS_SUCCESS;
344  Irp->IoStatus.Information = 0;
346 
347  /* done */
348  return STATUS_SUCCESS;
349 }
struct WDMAUD_CLIENT * PWDMAUD_CLIENT
_In_ PIRP Irp
Definition: csq.h:116
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
WDMAUD_HANDLE * hPins
Definition: wdmaud.h:32
SOUND_DEVICE_TYPE Type
Definition: wdmaud.h:21
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
UCHAR KIRQL
Definition: env_spec_w32.h:591
VOID FreeItem(IN PVOID Item)
Definition: misc.c:43
struct WDMAUD_DEVICE_EXTENSION * PWDMAUD_DEVICE_EXTENSION
HANDLE Handle
Definition: wdmaud.h:20
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
#define IoCompleteRequest
Definition: irp.c:1240
void DPRINT(...)
Definition: polytest.cpp:61
ULONG NumPins
Definition: wdmaud.h:31
#define KeAcquireSpinLock(sl, irql)
Definition: env_spec_w32.h:609
static const UCHAR Index[8]
Definition: usbohci.c:18
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
VOID WdmAudCloseAllMixers(IN PDEVICE_OBJECT DeviceObject, IN PWDMAUD_CLIENT ClientInfo, IN ULONG Index)
Definition: mmixer.c:501
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803
KSPIN_LOCK Lock
Definition: wdmaud.h:58
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
PFILE_OBJECT FileObject
Definition: iotypes.h:2813
#define KeReleaseSpinLock(sl, irql)
Definition: env_spec_w32.h:627
LIST_ENTRY Entry
Definition: wdmaud.h:29
unsigned int ULONG
Definition: retypes.h:1
#define IO_NO_INCREMENT
Definition: iotypes.h:566
return STATUS_SUCCESS
Definition: btrfs.c:2966

Referenced by DriverEntry(), and DriverProc().

◆ WdmAudClose()

NTSTATUS NTAPI WdmAudClose ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 261 of file entry.c.

264 {
265  /* nothing to do complete request */
266 #if KS_IMPLEMENTED
267  Status = KsDereferenceSoftwareBusObject(DeviceExtension->DeviceHeader);
268 
269  if (NT_SUCCESS(Status))
270  {
271  if (DeviceExtension->SysAudioNotification)
272  Status = IoUnregisterPlugPlayNotification(DeviceExtension->SysAudioNotification);
273  }
274 #endif
275 
276  Irp->IoStatus.Status = STATUS_SUCCESS;
277  Irp->IoStatus.Information = 0;
279 
280  /* done */
281  return STATUS_SUCCESS;
282 }
NTSTATUS NTAPI IoUnregisterPlugPlayNotification(IN PVOID NotificationEntry)
Definition: pnpnotify.c:371
KSDDKAPI VOID NTAPI KsDereferenceSoftwareBusObject(IN KSDEVICE_HEADER Header)
Definition: device.c:876
_In_ PIRP Irp
Definition: csq.h:116
#define IoCompleteRequest
Definition: irp.c:1240
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
Status
Definition: gdiplustypes.h:24
#define IO_NO_INCREMENT
Definition: iotypes.h:566
return STATUS_SUCCESS
Definition: btrfs.c:2966

Referenced by DriverEntry().

◆ WdmAudCreate()

NTSTATUS NTAPI WdmAudCreate ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 205 of file entry.c.

208 {
210  PIO_STACK_LOCATION IoStack;
211  PWDMAUD_CLIENT pClient;
212  PWDMAUD_DEVICE_EXTENSION DeviceExtension;
213 
214  /* get device extension */
216 
217 #if KS_IMPLEMENTED
219  if (!NT_SUCCESS(Status))
220  {
221  DPRINT1("KsReferenceSoftwareBusObject failed with %x\n", Status);
222  return Status;
223  }
224 #endif
225 
226  if (DeviceExtension->FileObject == NULL)
227  {
228  /* initialize */
230  }
231 
232 
234  if (!NT_SUCCESS(Status))
235  {
236  DPRINT1("Failed to open sysaudio!\n");
237 
238  /* complete and forget */
239  Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
241  /* done */
242  return STATUS_UNSUCCESSFUL;
243  }
244 
246  ASSERT(IoStack->FileObject);
247 
248  /* store client context in file object */
249  IoStack->FileObject->FsContext = pClient;
251 
252  Irp->IoStatus.Status = Status;
253  Irp->IoStatus.Information = 0;
255 
256  return Status;
257 }
KSDDKAPI NTSTATUS NTAPI KsReferenceSoftwareBusObject(IN KSDEVICE_HEADER Header)
Definition: device.c:805
_In_ PIRP Irp
Definition: csq.h:116
LONG NTSTATUS
Definition: precomp.h:26
struct WDMAUD_DEVICE_EXTENSION * PWDMAUD_DEVICE_EXTENSION
NTSTATUS WdmAudOpenSysaudio(IN PDEVICE_OBJECT DeviceObject, IN PWDMAUD_CLIENT *pClient)
Definition: deviface.c:206
PVOID DeviceExtension
Definition: env_spec_w32.h:418
IO_WORKITEM_ROUTINE WdmAudInitWorkerRoutine
Definition: entry.c:18
smooth NULL
Definition: ftsmooth.c:416
#define IoCompleteRequest
Definition: irp.c:1240
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
Status
Definition: gdiplustypes.h:24
PFILE_OBJECT FileObject
Definition: wdmaud.h:62
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
PFILE_OBJECT FileObject
Definition: iotypes.h:2813
#define DPRINT1
Definition: precomp.h:8
#define IO_NO_INCREMENT
Definition: iotypes.h:566
return STATUS_SUCCESS
Definition: btrfs.c:2966

Referenced by DriverEntry().

◆ WdmAudInitWorkerRoutine()

VOID NTAPI WdmAudInitWorkerRoutine ( IN PDEVICE_OBJECT  DeviceObject,
IN PVOID  Context 
)

Definition at line 23 of file entry.c.

26 {
28  PWDMAUD_DEVICE_EXTENSION DeviceExtension;
30 
31  /* get device extension */
33 
34 
35  if (DeviceExtension->FileObject == NULL)
36  {
37  /* find available sysaudio devices */
38  Status = WdmAudOpenSysAudioDevices(DeviceObject, DeviceExtension);
39  if (!NT_SUCCESS(Status))
40  {
41  DPRINT1("WdmAudOpenSysAudioDevices failed with %x\n", Status);
42  return;
43  }
44  }
45 
46 
47  /* get device count */
49 
50  DPRINT("WdmAudInitWorkerRoutine SysAudioDeviceCount %ld\n", DeviceCount);
51 
52  /* was a device added / removed */
53  if (DeviceCount != DeviceExtension->SysAudioDeviceCount)
54  {
55  /* init mmixer library */
57  DPRINT("WdmAudMixerInitialize Status %x WaveIn %lu WaveOut %lu Mixer %lu\n", Status, WdmAudGetWaveInDeviceCount(), WdmAudGetWaveOutDeviceCount(), WdmAudGetMixerDeviceCount());
58 
59  /* store sysaudio device count */
60  DeviceExtension->SysAudioDeviceCount = DeviceCount;
61  }
62 
63  /* signal completion */
65 
66  /* reset work item status indicator */
67  InterlockedDecrement((volatile long *)&DeviceExtension->WorkItemActive);
68 }
LONG NTSTATUS
Definition: precomp.h:26
ULONG SysAudioDeviceCount
Definition: wdmaud.h:65
LONG NTAPI KeSetEvent(IN PKEVENT Event, IN KPRIORITY Increment, IN BOOLEAN Wait)
Definition: eventobj.c:159
ULONG WdmAudGetWaveInDeviceCount()
Definition: mmixer.c:669
ULONG DeviceCount
Definition: mpu401.c:26
struct WDMAUD_DEVICE_EXTENSION * PWDMAUD_DEVICE_EXTENSION
PVOID DeviceExtension
Definition: env_spec_w32.h:418
KEVENT InitializationCompletionEvent
Definition: wdmaud.h:67
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
NTSTATUS WdmAudMixerInitialize(IN PDEVICE_OBJECT DeviceObject)
Definition: mmixer.c:380
if(!(yy_init))
Definition: macro.lex.yy.c:714
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define InterlockedDecrement
Definition: armddk.h:52
ULONG WdmAudGetWaveOutDeviceCount()
Definition: mmixer.c:675
NTSTATUS WdmAudOpenSysAudioDevices(IN PDEVICE_OBJECT DeviceObject, IN PWDMAUD_DEVICE_EXTENSION DeviceExtension)
Definition: deviface.c:93
Status
Definition: gdiplustypes.h:24
PFILE_OBJECT FileObject
Definition: wdmaud.h:62
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
#define DPRINT1
Definition: precomp.h:8
unsigned int ULONG
Definition: retypes.h:1
#define IO_NO_INCREMENT
Definition: iotypes.h:566
ULONG WdmAudGetMixerDeviceCount()
Definition: mmixer.c:663
ULONG GetSysAudioDeviceCount(IN PDEVICE_OBJECT DeviceObject)
Definition: sup.c:42

◆ WdmAudPnp()

NTSTATUS NTAPI WdmAudPnp ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 184 of file entry.c.

187 {
188  PIO_STACK_LOCATION IrpStack;
189 
190  DPRINT("WdmAudPnp called\n");
191 
192  IrpStack = IoGetCurrentIrpStackLocation(Irp);
193 
195  {
196  Irp->IoStatus.Information |= PNP_DEVICE_NOT_DISABLEABLE;
198  }
200 }
KSDDKAPI NTSTATUS NTAPI KsDefaultDispatchPnp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: api.c:110
_In_ PIRP Irp
Definition: csq.h:116
void DPRINT(...)
Definition: polytest.cpp:61
#define PNP_DEVICE_NOT_DISABLEABLE
Definition: iotypes.h:969
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
#define IRP_MN_QUERY_PNP_DEVICE_STATE

Referenced by DriverEntry().

◆ WdmAudTimerRoutine()

VOID NTAPI WdmAudTimerRoutine ( IN PDEVICE_OBJECT  DeviceObject,
IN PVOID  Context 
)

Definition at line 72 of file entry.c.

75 {
76  PWDMAUD_DEVICE_EXTENSION DeviceExtension;
77 
78  /* get device extension */
80 
81  if (InterlockedCompareExchange((volatile long *)&DeviceExtension->WorkItemActive, 1, 0) == 0)
82  {
83  /* queue work item */
84  IoQueueWorkItem(DeviceExtension->WorkItem, WdmAudInitWorkerRoutine, DelayedWorkQueue, (PVOID)DeviceExtension);
85  }
86 }
#define InterlockedCompareExchange
Definition: interlocked.h:104
struct WDMAUD_DEVICE_EXTENSION * PWDMAUD_DEVICE_EXTENSION
PVOID DeviceExtension
Definition: env_spec_w32.h:418
PIO_WORKITEM WorkItem
Definition: wdmaud.h:66
IO_WORKITEM_ROUTINE WdmAudInitWorkerRoutine
Definition: entry.c:18
if(!(yy_init))
Definition: macro.lex.yy.c:714
VOID NTAPI IoQueueWorkItem(IN PIO_WORKITEM IoWorkItem, IN PIO_WORKITEM_ROUTINE WorkerRoutine, IN WORK_QUEUE_TYPE QueueType, IN PVOID Context)
Definition: iowork.c:40
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560

◆ WdmAudUnload()

VOID NTAPI WdmAudUnload ( IN PDRIVER_OBJECT  driver)

Definition at line 176 of file entry.c.

178 {
179  DPRINT("WdmAudUnload called\n");
180 }
void DPRINT(...)
Definition: polytest.cpp:61

Referenced by DriverEntry().

Variable Documentation

◆ KSCATEGORY_SYSAUDIO

const GUID KSCATEGORY_SYSAUDIO = {0xA7C7A5B1L, 0x5AF3, 0x11D1, {0x9C, 0xED, 0x00, 0xA0, 0x24, 0xBF, 0x04, 0x07}}

Definition at line 15 of file entry.c.

◆ KSCATEGORY_WDMAUD

const GUID KSCATEGORY_WDMAUD = {0x3E227E76L, 0x690D, 0x11D2, {0x81, 0x61, 0x00, 0x00, 0xF8, 0x77, 0x5B, 0xF1}}

Definition at line 16 of file entry.c.

Referenced by WdmAudRegisterDeviceInterface().

◆ WdmAudInitWorkerRoutine

IO_WORKITEM_ROUTINE WdmAudInitWorkerRoutine

Definition at line 18 of file entry.c.

Referenced by WdmAudCreate(), and WdmAudTimerRoutine().

◆ WdmAudTimerRoutine

IO_TIMER_ROUTINE WdmAudTimerRoutine

Definition at line 19 of file entry.c.

Referenced by WdmaudAddDevice().