}
/* check buffer description */
- if ((lpcDSBufferDesc->dwSize != sizeof(DSBUFFERDESC) && lpcDSBufferDesc->dwSize != sizeof(DSBUFFERDESC1)) || lpcDSBufferDesc->dwReserved != 0)
+ if ((lpcDSBufferDesc->dwSize != sizeof(DSCBUFFERDESC) && lpcDSBufferDesc->dwSize != sizeof(DSCBUFFERDESC1)) || lpcDSBufferDesc->dwReserved != 0)
{
- DPRINT("Invalid buffer description size %u expected %u dwReserved %u\n", lpcDSBufferDesc->dwSize, sizeof(DSBUFFERDESC1), lpcDSBufferDesc->dwReserved);
+ DPRINT("Invalid buffer description size %u expected %u or %u dwReserved %u\n", lpcDSBufferDesc->dwSize, sizeof(DSBUFFERDESC1), sizeof(DSBUFFERDESC), lpcDSBufferDesc->dwReserved);
return DSERR_INVALIDPARAM;
}
return DSERR_UNINITIALIZED;
}
- if (!pDSCCaps || pDSCCaps->dwSize != sizeof(DSCCAPS))
+ if (!pDSCCaps)
{
/* invalid param */
return DSERR_INVALIDPARAM;
}
+ if (pDSCCaps->dwSize != sizeof(DSCCAPS))
+ {
+ /* invalid param */
+ return DSERR_INVALIDPARAM;
+ }
+
+
/* We are certified ;) */
pDSCCaps->dwFlags = DSCCAPS_CERTIFIED;
+ ASSERT(This->Filter);
+
Result = waveInGetDevCapsW(This->Filter->MappedId[0], &Caps, sizeof(WAVEINCAPSW));
if (Result != MMSYSERR_NOERROR)
{
{
GUID DeviceGuid;
LPOLESTR pGuidStr;
- HRESULT hr;
LPCDirectSoundCaptureImpl This = (LPCDirectSoundCaptureImpl)CONTAINING_RECORD(iface, CDirectSoundCaptureImpl, lpVtbl);
/* sanity check */
pcGuidDevice = &DSDEVID_DefaultCapture;
}
+ if (IsEqualIID(pcGuidDevice, &DSDEVID_DefaultVoicePlayback) || IsEqualIID(pcGuidDevice, &DSDEVID_DefaultPlayback))
+ {
+ /* this has to be a winetest */
+ return DSERR_NODRIVER;
+ }
+
/* now verify the guid */
if (GetDeviceID(pcGuidDevice, &DeviceGuid) != DS_OK)
{
return DSERR_INVALIDPARAM;
}
- hr = FindDeviceByGuid(&DeviceGuid, &This->Filter);
-
- if (SUCCEEDED(hr))
+ if (FindDeviceByGuid(&DeviceGuid, &This->Filter))
{
This->bInitialized = TRUE;
return DS_OK;
return DS_OK;
}
+HRESULT
+CALLBACK
+NewDirectSoundCapture(
+ IUnknown* pUnkOuter,
+ REFIID riid,
+ LPVOID* ppvObject)
+{
+ LPOLESTR pStr;
+ LPCDirectSoundCaptureImpl This;
+
+ /* check requested interface */
+ if (!IsEqualIID(riid, &IID_IUnknown) && !IsEqualIID(riid, &IID_IDirectSoundCapture) && !IsEqualIID(riid, &IID_IDirectSoundCapture8))
+ {
+ *ppvObject = 0;
+ StringFromIID(riid, &pStr);
+ DPRINT("NewDirectSoundCapture does not support Interface %ws\n", pStr);
+ CoTaskMemFree(pStr);
+ return E_NOINTERFACE;
+ }
+
+ /* allocate CDirectSoundCaptureImpl struct */
+ This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(CDirectSoundCaptureImpl));
+ if (!This)
+ {
+ /* not enough memory */
+ return DSERR_OUTOFMEMORY;
+ }
+
+ /* initialize object */
+ This->ref = 1;
+ This->lpVtbl = &vt_DirectSoundCapture;
+ This->bInitialized = FALSE;
+ *ppvObject = (LPVOID)&This->lpVtbl;
+
+ return S_OK;
+}
HRESULT