Author: janderwald
Date: Sat Oct 17 17:08:01 2009
New Revision: 43533
URL:
http://svn.reactos.org/svn/reactos?rev=43533&view=rev
Log:
- Quick & dirty implementation of WIDM_RESET / WODM_RESET
Modified:
trunk/reactos/lib/drivers/sound/mmebuddy/wave/streaming.c
Modified: trunk/reactos/lib/drivers/sound/mmebuddy/wave/streaming.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmebuddy…
==============================================================================
--- trunk/reactos/lib/drivers/sound/mmebuddy/wave/streaming.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/sound/mmebuddy/wave/streaming.c [iso-8859-1] Sat Oct 17
17:08:01 2009
@@ -64,6 +64,10 @@
{
HeaderExtension = (PWAVEHDR_EXTENSION) Header->reserved;
SND_ASSERT( HeaderExtension );
+
+ /* Saniy checks */
+ SND_ASSERT(Header->dwFlags & WHDR_PREPARED);
+ SND_ASSERT(Header->dwFlags & WHDR_INQUEUE);
/* Can never be *above* the length */
SND_ASSERT( HeaderExtension->BytesCommitted <= Header->dwBufferLength
);
@@ -170,6 +174,8 @@
WaveHdr = (PWAVEHDR) SoundOverlapped->Header;
SND_ASSERT( WaveHdr );
+ SND_ASSERT( ERROR_SUCCESS == dwErrorCode );
+
HdrExtension = (PWAVEHDR_EXTENSION) WaveHdr->reserved;
SND_ASSERT( HdrExtension );
@@ -239,8 +245,13 @@
IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
IN PVOID Parameter)
{
- /* TODO */
- return MMSYSERR_NOTSUPPORTED;
+ /* complete all pending headers */
+ while(SoundDeviceInstance->HeadWaveHeader)
+ CompleteWaveHeader(SoundDeviceInstance, SoundDeviceInstance->HeadWaveHeader);
+
+ SND_ASSERT( NULL == SoundDeviceInstance->HeadWaveHeader );
+ SND_ASSERT( NULL == SoundDeviceInstance->TailWaveHeader );
+ return MMSYSERR_NOERROR;
}
MMRESULT
@@ -262,8 +273,7 @@
if ( ! MMSUCCESS(Result) )
return TranslateInternalMmResult(Result);
- /* FIXME: What about wave input? */
- if ( DeviceType != WAVE_OUT_DEVICE_TYPE )
+ if ( DeviceType != WAVE_OUT_DEVICE_TYPE && DeviceType != WAVE_IN_DEVICE_TYPE
)
return MMSYSERR_NOTSUPPORTED;
return CallSoundThread(SoundDeviceInstance,