Commit 49762b16 authored by Christian Costa's avatar Christian Costa Committed by Alexandre Julliard

amstream: Add checks to GetFormat.

parent bde73d8d
......@@ -159,13 +159,13 @@ static HRESULT WINAPI IDirectDrawMediaStreamImpl_SendEndOfStream(IDirectDrawMedi
/*** IDirectDrawMediaStream methods ***/
static HRESULT WINAPI IDirectDrawMediaStreamImpl_GetFormat(IDirectDrawMediaStream *iface,
DDSURFACEDESC *pDDSDCurrent, IDirectDrawPalette **ppDirectDrawPalette,
DDSURFACEDESC *pDDSDDesired, DWORD *pdwFlags)
DDSURFACEDESC *current_format, IDirectDrawPalette **palette,
DDSURFACEDESC *desired_format, DWORD *flags)
{
FIXME("(%p)->(%p,%p,%p,%p) stub!\n", iface, pDDSDCurrent, ppDirectDrawPalette, pDDSDDesired,
pdwFlags);
FIXME("(%p)->(%p,%p,%p,%p) stub!\n", iface, current_format, palette, desired_format,
flags);
return E_NOTIMPL;
return MS_E_NOSTREAM;
}
......@@ -390,7 +390,10 @@ static HRESULT WINAPI IAudioMediaStreamImpl_GetFormat(IAudioMediaStream *iface,
FIXME("(%p/%p)->(%p) stub!\n", iface, This, wave_format_current);
return E_NOTIMPL;
if (!wave_format_current)
return E_POINTER;
return MS_E_NOSTREAM;
}
......
......@@ -248,6 +248,13 @@ static void test_media_streams(void)
if (SUCCEEDED(hr))
{
DDSURFACEDESC current_format, desired_format;
IDirectDrawPalette *palette;
DWORD flags;
hr = IDirectDrawMediaStream_GetFormat(ddraw_stream, &current_format, &palette, &desired_format, &flags);
ok(hr == MS_E_NOSTREAM, "IDirectDrawoMediaStream_GetFormat returned: %x\n", hr);
hr = IDirectDrawMediaStream_CreateSample(ddraw_stream, NULL, NULL, 0, &ddraw_sample);
ok(hr == S_OK, "IDirectDrawMediaStream_CreateSample returned: %x\n", hr);
}
......@@ -333,9 +340,16 @@ static void test_media_streams(void)
if (SUCCEEDED(hr))
{
IAudioData* audio_data = NULL;
WAVEFORMATEX format;
hr = CoCreateInstance(&CLSID_AMAudioData, NULL, CLSCTX_INPROC_SERVER, &IID_IAudioData, (void **)&audio_data);
ok(hr == S_OK, "CoCreateInstance returned: %x\n", hr);
hr = IAudioMediaStream_GetFormat(audio_media_stream, NULL);
ok(hr == E_POINTER, "IAudioMediaStream_GetFormat returned: %x\n", hr);
hr = IAudioMediaStream_GetFormat(audio_media_stream, &format);
ok(hr == MS_E_NOSTREAM, "IAudioMediaStream_GetFormat returned: %x\n", hr);
hr = IAudioMediaStream_CreateSample(audio_media_stream, NULL, 0, &audio_sample);
ok(hr == E_POINTER, "IAudioMediaStream_CreateSample returned: %x\n", hr);
hr = IAudioMediaStream_CreateSample(audio_media_stream, audio_data, 0, &audio_sample);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment