[AUDIO-BRINGUP]
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Fri, 10 Dec 2010 07:41:44 +0000 (07:41 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Fri, 10 Dec 2010 07:41:44 +0000 (07:41 +0000)
- Fix broken wave recording

svn path=/branches/audio-bringup/; revision=49998

dll/win32/wdmaud.drv/mmixer.c

index 143c670..a98418a 100644 (file)
@@ -15,6 +15,7 @@ typedef struct
     HANDLE hDevice;
     PSOUND_OVERLAPPED Overlap;
     LPOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine;
     HANDLE hDevice;
     PSOUND_OVERLAPPED Overlap;
     LPOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine;
+    DWORD IoCtl;
 }IO_PACKET, *LPIO_PACKET;
 
 BOOL MMixerLibraryInitialized = FALSE;
 }IO_PACKET, *LPIO_PACKET;
 
 BOOL MMixerLibraryInitialized = FALSE;
@@ -786,29 +787,19 @@ IoStreamingThread(
     LPIO_PACKET Packet = (LPIO_PACKET)lpParameter;
 
     Result =  SyncOverlappedDeviceIoControl(Packet->hDevice,
     LPIO_PACKET Packet = (LPIO_PACKET)lpParameter;
 
     Result =  SyncOverlappedDeviceIoControl(Packet->hDevice,
-                    IOCTL_KS_WRITE_STREAM, //FIXME IOCTL_KS_READ_STREAM
+                    Packet->IoCtl,
                     NULL,
                     0,
                     &Packet->Header,
                     sizeof(KSSTREAM_HEADER),
                     &Length);
 
                     NULL,
                     0,
                     &Packet->Header,
                     sizeof(KSSTREAM_HEADER),
                     &Length);
 
-    /* HACK:
-     * don't call completion routine directly
-     */
-
     Packet->CompletionRoutine(ERROR_SUCCESS, Packet->Header.DataUsed, (LPOVERLAPPED)Packet->Overlap);
 
     HeapFree(GetProcessHeap(), 0, Packet);
     return 0;
 }
 
     Packet->CompletionRoutine(ERROR_SUCCESS, Packet->Header.DataUsed, (LPOVERLAPPED)Packet->Overlap);
 
     HeapFree(GetProcessHeap(), 0, Packet);
     return 0;
 }
 
-
-
-
-
-
-
 MMRESULT
 WdmAudCommitWaveBufferByMMixer(
     IN  PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
 MMRESULT
 WdmAudCommitWaveBufferByMMixer(
     IN  PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
@@ -849,6 +840,7 @@ WdmAudCommitWaveBufferByMMixer(
     Packet->hDevice = SoundDeviceInstance->Handle;
     Packet->Overlap = Overlap;
     Packet->CompletionRoutine = CompletionRoutine;
     Packet->hDevice = SoundDeviceInstance->Handle;
     Packet->Overlap = Overlap;
     Packet->CompletionRoutine = CompletionRoutine;
+    Packet->IoCtl = (DeviceType == WAVE_OUT_DEVICE_TYPE ? IOCTL_KS_WRITE_STREAM : IOCTL_KS_READ_STREAM);
 
     if (DeviceType == WAVE_OUT_DEVICE_TYPE)
     {
 
     if (DeviceType == WAVE_OUT_DEVICE_TYPE)
     {