[WDMAUD.DRV]
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Sat, 2 Jan 2010 01:53:22 +0000 (01:53 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Sat, 2 Jan 2010 01:53:22 +0000 (01:53 +0000)
- Implement AllocEventData, FreeEventData for mmixer library

svn path=/trunk/; revision=44873

reactos/dll/win32/wdmaud.drv/mmixer.c
reactos/dll/win32/wdmaud.drv/wdmaud.rbuild

index bdf5875..ab1ba6f 100644 (file)
@@ -20,6 +20,8 @@ MIXER_STATUS Enum(IN  PVOID EnumContext, IN  ULONG DeviceIndex, OUT LPWSTR * Dev
 MIXER_STATUS OpenKey(IN HANDLE hKey, IN LPWSTR SubKey, IN ULONG DesiredAccess, OUT PHANDLE OutKey);
 MIXER_STATUS CloseKey(IN HANDLE hKey);
 MIXER_STATUS QueryKeyValue(IN HANDLE hKey, IN LPWSTR KeyName, OUT PVOID * ResultBuffer, OUT PULONG ResultLength, OUT PULONG KeyType);
+PVOID AllocEventData(IN ULONG ExtraSize);
+VOID FreeEventData(IN PVOID EventData);
 
 MIXER_CONTEXT MixerContext =
 {
@@ -33,7 +35,9 @@ MIXER_CONTEXT MixerContext =
     Copy,
     OpenKey,
     QueryKeyValue,
-    CloseKey
+    CloseKey,
+    AllocEventData,
+    FreeEventData
 };
 
 GUID CategoryGuid = {STATIC_KSCATEGORY_AUDIO};
@@ -285,6 +289,35 @@ Enum(
     return Status;
 }
 
+PVOID
+AllocEventData(
+    IN ULONG ExtraSize)
+{
+    PKSEVENTDATA Data = (PKSEVENTDATA)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(KSEVENTDATA) + ExtraSize);
+    if (!Data)
+        return NULL;
+
+    Data->EventHandle.Event = CreateEventW(NULL, FALSE, FALSE, NULL);
+    if (!Data->EventHandle.Event)
+    {
+        HeapFree(GetProcessHeap(), 0, Data);
+        return NULL;
+    }
+
+    Data->NotificationType = KSEVENTF_EVENT_HANDLE;
+    return Data;
+}
+
+VOID
+FreeEventData(IN PVOID EventData)
+{
+    PKSEVENTDATA Data = (PKSEVENTDATA)EventData;
+
+    CloseHandle(Data->EventHandle.Event);
+    HeapFree(GetProcessHeap(), 0, Data);
+}
+
+
 BOOL
 WdmAudInitUserModeMixer()
 {
index 69b1f57..31039cc 100644 (file)
@@ -5,7 +5,7 @@
        <include base="wdmaud_kernel">.</include>
        <include base="mmixer">.</include>
        <include base="libsamplerate">.</include>
-       <!-- <define name="USE_MMIXER_LIB">1</define> Enable this line to bypass wdmaud + sysaudio -->
+       <define name="USE_MMIXER_LIB">1</define>
        <!-- <define name="USERMODE_MIXER">1</define> Enable this line to for usermode mixing support -->
        <library>mmebuddy</library>
        <library>ntdll</library>