qasf: Implement IFileSourceFilter_GetCurFile() for WM ASF reader.

Signed-off-by: Jactry Zeng <jzeng@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jactry Zeng 2020-04-06 11:54:08 -05:00 committed by Alexandre Julliard
parent f15c23df4a
commit b38e95dcab
2 changed files with 59 additions and 46 deletions

View File

@ -125,9 +125,28 @@ static HRESULT WINAPI filesourcefilter_GetCurFile(IFileSourceFilter *iface, LPOL
{ {
struct asf_reader *filter = impl_from_IFileSourceFilter(iface); struct asf_reader *filter = impl_from_IFileSourceFilter(iface);
FIXME("filter %p, filename %p, type %p, stub!\n", filter, filename, type); TRACE("filter %p, filename %p, type %p.\n", filter, filename, type);
return E_NOTIMPL; if (!filename)
return E_POINTER;
*filename = NULL;
if (type)
{
type->majortype = filter->type.majortype;
type->subtype = filter->type.subtype;
type->lSampleSize = filter->type.lSampleSize;
type->pUnk = filter->type.pUnk;
type->cbFormat = filter->type.cbFormat;
}
if (filter->filename)
{
*filename = CoTaskMemAlloc((wcslen(filter->filename) + 1) * sizeof(WCHAR));
wcscpy(*filename, filter->filename);
}
return S_OK;
} }
static const IFileSourceFilterVtbl filesourcefilter_vtbl = static const IFileSourceFilterVtbl filesourcefilter_vtbl =

View File

@ -211,25 +211,25 @@ static void test_filesourcefilter(void)
olepath = (void *)0xdeadbeef; olepath = (void *)0xdeadbeef;
memset(&type, 0x22, sizeof(type)); memset(&type, 0x22, sizeof(type));
hr = IFileSourceFilter_GetCurFile(filesource, &olepath, &type); hr = IFileSourceFilter_GetCurFile(filesource, &olepath, &type);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(!olepath, "Got %s.\n", wine_dbgstr_w(olepath)); ok(!olepath, "Got %s.\n", wine_dbgstr_w(olepath));
todo_wine ok(IsEqualGUID(&type.majortype, &MEDIATYPE_NULL), "Got majortype %s.\n", ok(IsEqualGUID(&type.majortype, &MEDIATYPE_NULL), "Got majortype %s.\n",
wine_dbgstr_guid(&type.majortype)); wine_dbgstr_guid(&type.majortype));
todo_wine ok(IsEqualGUID(&type.subtype, &MEDIASUBTYPE_NULL), "Got subtype %s.\n", ok(IsEqualGUID(&type.subtype, &MEDIASUBTYPE_NULL), "Got subtype %s.\n",
wine_dbgstr_guid(&type.subtype)); wine_dbgstr_guid(&type.subtype));
ok(type.bFixedSizeSamples == 0x22222222, "Got fixed size %d.\n", type.bFixedSizeSamples); ok(type.bFixedSizeSamples == 0x22222222, "Got fixed size %d.\n", type.bFixedSizeSamples);
ok(type.bTemporalCompression == 0x22222222, "Got temporal compression %d.\n", type.bTemporalCompression); ok(type.bTemporalCompression == 0x22222222, "Got temporal compression %d.\n", type.bTemporalCompression);
todo_wine ok(!type.lSampleSize, "Got sample size %u.\n", type.lSampleSize); ok(!type.lSampleSize, "Got sample size %u.\n", type.lSampleSize);
ok(IsEqualGUID(&type.formattype, &testguid), "Got format type %s.\n", wine_dbgstr_guid(&type.formattype)); ok(IsEqualGUID(&type.formattype, &testguid), "Got format type %s.\n", wine_dbgstr_guid(&type.formattype));
todo_wine ok(!type.pUnk, "Got pUnk %p.\n", type.pUnk); ok(!type.pUnk, "Got pUnk %p.\n", type.pUnk);
todo_wine ok(!type.cbFormat, "Got format size %u.\n", type.cbFormat); ok(!type.cbFormat, "Got format size %u.\n", type.cbFormat);
memset(&ptr, 0x22, sizeof(ptr)); memset(&ptr, 0x22, sizeof(ptr));
ok(type.pbFormat == ptr, "Got format block %p.\n", type.pbFormat); ok(type.pbFormat == ptr, "Got format block %p.\n", type.pbFormat);
hr = IFileSourceFilter_Load(filesource, L"nonexistent.wmv", NULL); hr = IFileSourceFilter_Load(filesource, L"nonexistent.wmv", NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IFileSourceFilter_GetCurFile(filesource, NULL, NULL); hr = IFileSourceFilter_GetCurFile(filesource, NULL, NULL);
todo_wine ok(hr == E_POINTER, "Got hr %#x.\n", hr); ok(hr == E_POINTER, "Got hr %#x.\n", hr);
hr = IFileSourceFilter_Load(filesource, L"nonexistent2.wmv", NULL); hr = IFileSourceFilter_Load(filesource, L"nonexistent2.wmv", NULL);
ok(hr == E_FAIL, "Got hr %#x.\n", hr); ok(hr == E_FAIL, "Got hr %#x.\n", hr);
@ -237,9 +237,7 @@ static void test_filesourcefilter(void)
olepath = (void *)0xdeadbeef; olepath = (void *)0xdeadbeef;
memset(&type, 0x22, sizeof(type)); memset(&type, 0x22, sizeof(type));
hr = IFileSourceFilter_GetCurFile(filesource, &olepath, &type); hr = IFileSourceFilter_GetCurFile(filesource, &olepath, &type);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
if (SUCCEEDED(hr))
{
ok(!wcscmp(olepath, L"nonexistent.wmv"), "Expected path %s, got %s.\n", ok(!wcscmp(olepath, L"nonexistent.wmv"), "Expected path %s, got %s.\n",
wine_dbgstr_w(L"nonexistent.wmv"), wine_dbgstr_w(olepath)); wine_dbgstr_w(L"nonexistent.wmv"), wine_dbgstr_w(olepath));
ok(IsEqualGUID(&type.majortype, &MEDIATYPE_NULL), "Got majortype %s.\n", ok(IsEqualGUID(&type.majortype, &MEDIATYPE_NULL), "Got majortype %s.\n",
@ -254,7 +252,6 @@ static void test_filesourcefilter(void)
ok(!type.cbFormat, "Got format size %u.\n", type.cbFormat); ok(!type.cbFormat, "Got format size %u.\n", type.cbFormat);
ok(type.pbFormat == ptr, "Got format block %p.\n", type.pbFormat); ok(type.pbFormat == ptr, "Got format block %p.\n", type.pbFormat);
CoTaskMemFree(olepath); CoTaskMemFree(olepath);
}
hr = IBaseFilter_EnumPins(filter, &enumpins); hr = IBaseFilter_EnumPins(filter, &enumpins);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
@ -276,9 +273,7 @@ static void test_filesourcefilter(void)
olepath = (void *)0xdeadbeef; olepath = (void *)0xdeadbeef;
memset(&type, 0x22, sizeof(type)); memset(&type, 0x22, sizeof(type));
hr = IFileSourceFilter_GetCurFile(filesource, &olepath, &type); hr = IFileSourceFilter_GetCurFile(filesource, &olepath, &type);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
if (SUCCEEDED(hr))
{
ok(!wcscmp(olepath, L"nonexistent.wmv"), "Expected path %s, got %s.\n", ok(!wcscmp(olepath, L"nonexistent.wmv"), "Expected path %s, got %s.\n",
wine_dbgstr_w(L"nonexistent.wmv"), wine_dbgstr_w(olepath)); wine_dbgstr_w(L"nonexistent.wmv"), wine_dbgstr_w(olepath));
ok(IsEqualGUID(&type.majortype, &MEDIATYPE_NULL), "Got majortype %s.\n", ok(IsEqualGUID(&type.majortype, &MEDIATYPE_NULL), "Got majortype %s.\n",
@ -293,7 +288,6 @@ static void test_filesourcefilter(void)
ok(!type.cbFormat, "Got format size %u.\n", type.cbFormat); ok(!type.cbFormat, "Got format size %u.\n", type.cbFormat);
ok(type.pbFormat == ptr, "Got format block %p.\n", type.pbFormat); ok(type.pbFormat == ptr, "Got format block %p.\n", type.pbFormat);
CoTaskMemFree(olepath); CoTaskMemFree(olepath);
}
ref = IFilterGraph2_Release(graph); ref = IFilterGraph2_Release(graph);
ok(!ref, "Got outstanding refcount %d.\n", ref); ok(!ref, "Got outstanding refcount %d.\n", ref);