SND_ASSERT( SoundDevice );
SND_ASSERT( Capabilities );
- SND_TRACE(L"WDMAUD - GetWdmDeviceCapabilities\n");
-
Result = GetSoundDeviceType(SoundDevice, &DeviceType);
SND_ASSERT( Result == MMSYSERR_NOERROR );
if ( ! MMSUCCESS(Result) )
return Result;
+ SND_TRACE(L"WDMAUD - GetWdmDeviceCapabilities DeviceType %u DeviceId %u\n", DeviceType, DeviceId);
ZeroMemory(&DeviceInfo, sizeof(WDMAUD_DEVICE_INFO));
DeviceInfo.DeviceType = DeviceType;
return TranslateInternalMmResult(Result);
}
- SND_TRACE(L"WDMAUD Name %S\n", DeviceInfo.u.WaveOutCaps.szPname);
-
/* This is pretty much a big hack right now */
switch ( DeviceType )
{
{
LPMIXERCAPS MixerCaps = (LPMIXERCAPS) Capabilities;
- CopyWideString(MixerCaps->szPname, DeviceInfo.u.WaveOutCaps.szPname);
+ DeviceInfo.u.MixCaps.szPname[MAXPNAMELEN-1] = L'\0';
+ CopyWideString(MixerCaps->szPname, DeviceInfo.u.MixCaps.szPname);
MixerCaps->cDestinations = DeviceInfo.u.MixCaps.cDestinations;
MixerCaps->fdwSupport = DeviceInfo.u.MixCaps.fdwSupport;
case WAVE_OUT_DEVICE_TYPE :
{
LPWAVEOUTCAPS WaveOutCaps = (LPWAVEOUTCAPS) Capabilities;
+
+ DeviceInfo.u.WaveOutCaps.szPname[MAXPNAMELEN-1] = L'\0';
WaveOutCaps->wMid = DeviceInfo.u.WaveOutCaps.wMid;
WaveOutCaps->wPid = DeviceInfo.u.WaveOutCaps.wPid;
}
case WAVE_IN_DEVICE_TYPE :
{
- LPWAVEINCAPS WaveInCaps = (LPWAVEINCAPS) Capabilities;
- CopyWideString(WaveInCaps->szPname, DeviceInfo.u.WaveOutCaps.szPname);
- /* TODO... other fields */
+ LPWAVEINCAPSW WaveInCaps = (LPWAVEINCAPSW) Capabilities;
+
+ DeviceInfo.u.WaveInCaps.szPname[MAXPNAMELEN-1] = L'\0';
+
+ WaveInCaps->wMid = DeviceInfo.u.WaveInCaps.wMid;
+ WaveInCaps->wPid = DeviceInfo.u.WaveInCaps.wPid;
+
+ WaveInCaps->vDriverVersion = 0x0001;
+ CopyWideString(WaveInCaps->szPname, DeviceInfo.u.WaveInCaps.szPname);
+
+ WaveInCaps->dwFormats = DeviceInfo.u.WaveInCaps.dwFormats;
+ WaveInCaps->wChannels = DeviceInfo.u.WaveInCaps.wChannels;
+ WaveInCaps->wReserved1 = 0;
break;
}
}
{
if (DeviceInfo.u.FrameSize)
{
- //Instance->FrameSize = DeviceInfo.u.FrameSize;
+ Instance->FrameSize = DeviceInfo.u.FrameSize * 2;
Instance->BufferCount = WaveFormat->nAvgBytesPerSec / Instance->FrameSize;
SND_TRACE(L"FrameSize %u BufferCount %u\n", Instance->FrameSize, Instance->BufferCount);
}