e6a47461781fa51a172bcfa7520e51836d458288
2 * PROJECT: ReactOS Sound System
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: dll/win32/wdmaud.drv/wdmaud.c
6 * PURPOSE: WDM Audio Driver (User-mode part)
7 * PROGRAMMERS: Andrew Greenwood (silverblade@reactos.org)
9 * NOTES: Looking for wodMessage & co? You won't find them here. Try
10 * the MME Buddy library, which is where these routines are
11 * actually implemented.
21 #define KERNEL_DEVICE_NAME L"\\\\Device\\wdmaud"
23 HANDLE KernelHandle
= INVALID_HANDLE_VALUE
;
39 SND_TRACE(L
"DRV_LOAD\n");
41 Result
= InitEntrypointMutexes();
43 if ( ! MMSUCCESS(Result
) )
46 KernelHandle
= CreateFile(KERNEL_DEVICE_NAME
,
47 GENERIC_READ
| GENERIC_WRITE
,
48 FILE_SHARE_WRITE
, // ok?
54 if ( KernelHandle
== INVALID_HANDLE_VALUE
)
56 SND_ERR(L
"Failed to open %s\n", KERNEL_DEVICE_NAME
);
57 CleanupEntrypointMutexes();
59 UnlistAllSoundDevices();
64 SND_TRACE(L
"Initialisation complete\n");
71 SND_TRACE(L
"DRV_FREE\n");
73 if ( KernelHandle
!= INVALID_HANDLE_VALUE
)
75 CloseHandle(KernelHandle
);
76 KernelHandle
= INVALID_HANDLE_VALUE
;
79 /* TODO: Clean up the path names! */
80 UnlistAllSoundDevices();
82 CleanupEntrypointMutexes();
84 SND_TRACE(L
"Unfreed memory blocks: %d\n",
85 GetMemoryAllocationCount());
93 SND_TRACE(L
"DRV_ENABLE / DRV_DISABLE\n");
100 SND_TRACE(L
"DRV_OPEN / DRV_CLOSE\n");
104 case DRV_QUERYCONFIGURE
:
106 SND_TRACE(L
"DRV_QUERYCONFIGURE\n");
113 SND_TRACE(L
"Unhandled message %d\n", Message
);
114 return DefDriverProc(DriverId
,
130 case DLL_PROCESS_ATTACH
:
131 SND_TRACE(L
"WDMAUD.DRV - Process attached\n");
133 case DLL_PROCESS_DETACH
:
134 SND_TRACE(L
"WDMAUD.DRV - Process detached\n");
136 case DLL_THREAD_ATTACH
:
137 SND_TRACE(L
"WDMAUD.DRV - Thread attached\n");
139 case DLL_THREAD_DETACH
:
140 SND_TRACE(L
"WDMAUD.DRV - Thread detached\n");