quartz/tests: Build without -DWINE_NO_LONG_TYPES.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Eric Pouech 2022-03-07 12:54:07 -06:00 committed by Alexandre Julliard
parent 64e2921ef3
commit 3c2e6efb5a
16 changed files with 4934 additions and 4933 deletions

View file

@ -1,4 +1,3 @@
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = quartz.dll
IMPORTS = strmbase advapi32 d3d9 dsound msdmo msvfw32 ole32 oleaut32 user32 uuid winmm

View file

@ -27,7 +27,7 @@ static IBaseFilter *create_acm_wrapper(void)
IBaseFilter *filter = NULL;
HRESULT hr = CoCreateInstance(&CLSID_ACMWrapper, NULL, CLSCTX_INPROC_SERVER,
&IID_IBaseFilter, (void **)&filter);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
return filter;
}
@ -48,7 +48,7 @@ static void check_interface_(unsigned int line, void *iface_ptr, REFIID iid, BOO
expected_hr = supported ? S_OK : E_NOINTERFACE;
hr = IUnknown_QueryInterface(iface, iid, (void **)&unk);
ok_(__FILE__, line)(hr == expected_hr, "Got hr %#x, expected %#x.\n", hr, expected_hr);
ok_(__FILE__, line)(hr == expected_hr, "Got hr %#lx, expected %#lx.\n", hr, expected_hr);
if (SUCCEEDED(hr))
IUnknown_Release(unk);
}
@ -148,53 +148,53 @@ static void test_aggregation(void)
filter = (IBaseFilter *)0xdeadbeef;
hr = CoCreateInstance(&CLSID_ACMWrapper, &test_outer, CLSCTX_INPROC_SERVER,
&IID_IBaseFilter, (void **)&filter);
ok(hr == E_NOINTERFACE, "Got hr %#x.\n", hr);
ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr);
ok(!filter, "Got interface %p.\n", filter);
hr = CoCreateInstance(&CLSID_ACMWrapper, &test_outer, CLSCTX_INPROC_SERVER,
&IID_IUnknown, (void **)&unk);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
ok(unk != &test_outer, "Returned IUnknown should not be outer IUnknown.\n");
ref = get_refcount(unk);
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
ref = IUnknown_AddRef(unk);
ok(ref == 2, "Got unexpected refcount %d.\n", ref);
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
ref = IUnknown_Release(unk);
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
hr = IUnknown_QueryInterface(unk, &IID_IUnknown, (void **)&unk2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(unk2 == unk, "Got unexpected IUnknown %p.\n", unk2);
IUnknown_Release(unk2);
hr = IUnknown_QueryInterface(unk, &IID_IBaseFilter, (void **)&filter);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IBaseFilter_QueryInterface(filter, &IID_IUnknown, (void **)&unk2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(unk2 == (IUnknown *)0xdeadbeef, "Got unexpected IUnknown %p.\n", unk2);
hr = IBaseFilter_QueryInterface(filter, &IID_IBaseFilter, (void **)&filter2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(filter2 == (IBaseFilter *)0xdeadbeef, "Got unexpected IBaseFilter %p.\n", filter2);
hr = IUnknown_QueryInterface(unk, &test_iid, (void **)&unk2);
ok(hr == E_NOINTERFACE, "Got hr %#x.\n", hr);
ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr);
ok(!unk2, "Got unexpected IUnknown %p.\n", unk2);
hr = IBaseFilter_QueryInterface(filter, &test_iid, (void **)&unk2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(unk2 == (IUnknown *)0xdeadbeef, "Got unexpected IUnknown %p.\n", unk2);
IBaseFilter_Release(filter);
ref = IUnknown_Release(unk);
ok(!ref, "Got unexpected refcount %d.\n", ref);
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
ok(!ref, "Got unexpected refcount %ld.\n", ref);
ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
}
static void test_enum_pins(void)
@ -206,116 +206,116 @@ static void test_enum_pins(void)
HRESULT hr;
ref = get_refcount(filter);
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
hr = IBaseFilter_EnumPins(filter, NULL);
ok(hr == E_POINTER, "Got hr %#x.\n", hr);
ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
hr = IBaseFilter_EnumPins(filter, &enum1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ref = get_refcount(filter);
ok(ref == 2, "Got unexpected refcount %d.\n", ref);
ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
ref = get_refcount(enum1);
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
hr = IEnumPins_Next(enum1, 1, NULL, NULL);
ok(hr == E_POINTER, "Got hr %#x.\n", hr);
ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
hr = IEnumPins_Next(enum1, 1, pins, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ref = get_refcount(filter);
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ok(ref == 3, "Got unexpected refcount %ld.\n", ref);
ref = get_refcount(pins[0]);
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ok(ref == 3, "Got unexpected refcount %ld.\n", ref);
ref = get_refcount(enum1);
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
IPin_Release(pins[0]);
ref = get_refcount(filter);
ok(ref == 2, "Got unexpected refcount %d.\n", ref);
ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
hr = IEnumPins_Next(enum1, 1, pins, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ref = get_refcount(filter);
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ok(ref == 3, "Got unexpected refcount %ld.\n", ref);
ref = get_refcount(pins[0]);
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ok(ref == 3, "Got unexpected refcount %ld.\n", ref);
ref = get_refcount(enum1);
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
IPin_Release(pins[0]);
ref = get_refcount(filter);
ok(ref == 2, "Got unexpected refcount %d.\n", ref);
ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
hr = IEnumPins_Next(enum1, 1, pins, NULL);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
hr = IEnumPins_Reset(enum1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumPins_Next(enum1, 1, pins, &count);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(count == 1, "Got count %u.\n", count);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(count == 1, "Got count %lu.\n", count);
IPin_Release(pins[0]);
hr = IEnumPins_Next(enum1, 1, pins, &count);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(count == 1, "Got count %u.\n", count);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(count == 1, "Got count %lu.\n", count);
IPin_Release(pins[0]);
hr = IEnumPins_Next(enum1, 1, pins, &count);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(!count, "Got count %u.\n", count);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
ok(!count, "Got count %lu.\n", count);
hr = IEnumPins_Reset(enum1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumPins_Next(enum1, 2, pins, NULL);
ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
hr = IEnumPins_Next(enum1, 2, pins, &count);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(count == 2, "Got count %u.\n", count);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(count == 2, "Got count %lu.\n", count);
IPin_Release(pins[0]);
IPin_Release(pins[1]);
hr = IEnumPins_Next(enum1, 2, pins, &count);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(!count, "Got count %u.\n", count);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
ok(!count, "Got count %lu.\n", count);
hr = IEnumPins_Reset(enum1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumPins_Next(enum1, 3, pins, &count);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(count == 2, "Got count %u.\n", count);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
ok(count == 2, "Got count %lu.\n", count);
IPin_Release(pins[0]);
IPin_Release(pins[1]);
hr = IEnumPins_Reset(enum1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumPins_Clone(enum1, &enum2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumPins_Skip(enum1, 3);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
hr = IEnumPins_Skip(enum1, 2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumPins_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
hr = IEnumPins_Next(enum1, 1, pins, NULL);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
hr = IEnumPins_Next(enum2, 1, pins, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
IPin_Release(pins[0]);
IEnumPins_Release(enum2);
IEnumPins_Release(enum1);
ref = IBaseFilter_Release(filter);
ok(!ref, "Got outstanding refcount %d.\n", ref);
ok(!ref, "Got outstanding refcount %ld.\n", ref);
}
static void test_find_pin(void)
@ -327,36 +327,36 @@ static void test_find_pin(void)
ULONG ref;
hr = IBaseFilter_EnumPins(filter, &enum_pins);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IBaseFilter_FindPin(filter, L"In", &pin);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumPins_Next(enum_pins, 1, &pin2, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(pin == pin2, "Pins didn't match.\n");
IPin_Release(pin);
IPin_Release(pin2);
hr = IBaseFilter_FindPin(filter, L"Out", &pin);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumPins_Next(enum_pins, 1, &pin2, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(pin == pin2, "Pins didn't match.\n");
IPin_Release(pin);
IPin_Release(pin2);
hr = IBaseFilter_FindPin(filter, L"Input", &pin);
ok(hr == VFW_E_NOT_FOUND, "Got hr %#x.\n", hr);
ok(hr == VFW_E_NOT_FOUND, "Got hr %#lx.\n", hr);
hr = IBaseFilter_FindPin(filter, L"Output", &pin);
ok(hr == VFW_E_NOT_FOUND, "Got hr %#x.\n", hr);
ok(hr == VFW_E_NOT_FOUND, "Got hr %#lx.\n", hr);
hr = IBaseFilter_FindPin(filter, L"input pin", &pin);
ok(hr == VFW_E_NOT_FOUND, "Got hr %#x.\n", hr);
ok(hr == VFW_E_NOT_FOUND, "Got hr %#lx.\n", hr);
hr = IBaseFilter_FindPin(filter, L"output pin", &pin);
ok(hr == VFW_E_NOT_FOUND, "Got hr %#x.\n", hr);
ok(hr == VFW_E_NOT_FOUND, "Got hr %#lx.\n", hr);
IEnumPins_Release(enum_pins);
ref = IBaseFilter_Release(filter);
ok(!ref, "Got outstanding refcount %d.\n", ref);
ok(!ref, "Got outstanding refcount %ld.\n", ref);
}
static void test_pin_info(void)
@ -370,66 +370,66 @@ static void test_pin_info(void)
IPin *pin;
hr = IBaseFilter_FindPin(filter, L"In", &pin);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ref = get_refcount(filter);
ok(ref == 2, "Got unexpected refcount %d.\n", ref);
ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
ref = get_refcount(pin);
ok(ref == 2, "Got unexpected refcount %d.\n", ref);
ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
hr = IPin_QueryPinInfo(pin, &info);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(info.pFilter == filter, "Expected filter %p, got %p.\n", filter, info.pFilter);
ok(info.dir == PINDIR_INPUT, "Got direction %d.\n", info.dir);
todo_wine ok(!wcscmp(info.achName, L"Input"), "Got name %s.\n", debugstr_w(info.achName));
ref = get_refcount(filter);
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ok(ref == 3, "Got unexpected refcount %ld.\n", ref);
ref = get_refcount(pin);
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ok(ref == 3, "Got unexpected refcount %ld.\n", ref);
IBaseFilter_Release(info.pFilter);
hr = IPin_QueryDirection(pin, &dir);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(dir == PINDIR_INPUT, "Got direction %d.\n", dir);
hr = IPin_QueryId(pin, &id);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(!wcscmp(id, L"In"), "Got id %s.\n", wine_dbgstr_w(id));
CoTaskMemFree(id);
hr = IPin_QueryInternalConnections(pin, NULL, NULL);
ok(hr == E_NOTIMPL, "Got hr %#x.\n", hr);
ok(hr == E_NOTIMPL, "Got hr %#lx.\n", hr);
IPin_Release(pin);
hr = IBaseFilter_FindPin(filter, L"Out", &pin);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
check_interface(pin, &IID_IPin, TRUE);
check_interface(pin, &IID_IMediaSeeking, TRUE);
hr = IPin_QueryPinInfo(pin, &info);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(info.pFilter == filter, "Expected filter %p, got %p.\n", filter, info.pFilter);
ok(info.dir == PINDIR_OUTPUT, "Got direction %d.\n", info.dir);
todo_wine ok(!wcscmp(info.achName, L"Output"), "Got name %s.\n", debugstr_w(info.achName));
IBaseFilter_Release(info.pFilter);
hr = IPin_QueryDirection(pin, &dir);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(dir == PINDIR_OUTPUT, "Got direction %d.\n", dir);
hr = IPin_QueryId(pin, &id);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(!wcscmp(id, L"Out"), "Got id %s.\n", wine_dbgstr_w(id));
CoTaskMemFree(id);
hr = IPin_QueryInternalConnections(pin, NULL, NULL);
ok(hr == E_NOTIMPL, "Got hr %#x.\n", hr);
ok(hr == E_NOTIMPL, "Got hr %#lx.\n", hr);
IPin_Release(pin);
ref = IBaseFilter_Release(filter);
ok(!ref, "Got outstanding refcount %d.\n", ref);
ok(!ref, "Got outstanding refcount %ld.\n", ref);
}
static void test_unconnected_filter_state(void)
@ -440,53 +440,53 @@ static void test_unconnected_filter_state(void)
ULONG ref;
hr = IBaseFilter_GetState(filter, 0, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(state == State_Stopped, "Got state %u.\n", state);
hr = IBaseFilter_Pause(filter);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(state == State_Paused, "Got state %u.\n", state);
hr = IBaseFilter_Run(filter, 0);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(state == State_Running, "Got state %u.\n", state);
hr = IBaseFilter_Pause(filter);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(state == State_Paused, "Got state %u.\n", state);
hr = IBaseFilter_Stop(filter);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(state == State_Stopped, "Got state %u.\n", state);
hr = IBaseFilter_Run(filter, 0);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(state == State_Running, "Got state %u.\n", state);
hr = IBaseFilter_Stop(filter);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(state == State_Stopped, "Got state %u.\n", state);
ref = IBaseFilter_Release(filter);
ok(!ref, "Got outstanding refcount %d.\n", ref);
ok(!ref, "Got outstanding refcount %ld.\n", ref);
}
START_TEST(acmwrapper)

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -35,7 +35,7 @@ static IFilterMapper3 *create_mapper(void)
IFilterMapper3 *ret;
HRESULT hr;
hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, &IID_IFilterMapper3, (void **)&ret);
ok(hr == S_OK, "Failed to create filter mapper, hr %#x.\n", hr);
ok(hr == S_OK, "Failed to create filter mapper, hr %#lx.\n", hr);
return ret;
}
@ -56,7 +56,7 @@ static void check_interface_(unsigned int line, void *iface_ptr, REFIID iid, BOO
expected_hr = supported ? S_OK : E_NOINTERFACE;
hr = IUnknown_QueryInterface(iface, iid, (void **)&unk);
ok_(__FILE__, line)(hr == expected_hr, "Got hr %#x, expected %#x.\n", hr, expected_hr);
ok_(__FILE__, line)(hr == expected_hr, "Got hr %#lx, expected %#lx.\n", hr, expected_hr);
if (SUCCEEDED(hr))
IUnknown_Release(unk);
}
@ -92,10 +92,10 @@ static BOOL enum_find_filter(const WCHAR *wszFilterName, IEnumMoniker *pEnum)
VariantInit(&var);
hr = IMoniker_BindToStorage(pMoniker, NULL, NULL, &IID_IPropertyBag, (LPVOID*)&pPropBagCat);
ok(SUCCEEDED(hr), "IMoniker_BindToStorage failed with %x\n", hr);
ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
hr = IPropertyBag_Read(pPropBagCat, L"FriendlyName", &var, NULL);
ok(SUCCEEDED(hr), "IPropertyBag_Read failed with %x\n", hr);
ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
if (!wcscmp(V_BSTR(&var), wszFilterName))
found = TRUE;
@ -128,13 +128,13 @@ static void test_fm2_enummatchingfilters(void)
hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
&IID_IFilterMapper2, (LPVOID*)&pMapper);
ok(hr == S_OK, "CoCreateInstance failed with %x\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
if (FAILED(hr)) goto out;
hr = CoCreateGuid(&clsidFilter1);
ok(hr == S_OK, "CoCreateGuid failed with %x\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = CoCreateGuid(&clsidFilter2);
ok(hr == S_OK, "CoCreateGuid failed with %x\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
/* Test that a test renderer filter is returned when enumerating filters with bRender=FALSE */
rgf2.dwVersion = 2;
@ -162,7 +162,7 @@ static void test_fm2_enummatchingfilters(void)
}
else
{
ok(hr == S_OK, "IFilterMapper2_RegisterFilter failed with %x\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
rgPins2[0].dwFlags = 0;
@ -178,11 +178,11 @@ static void test_fm2_enummatchingfilters(void)
hr = IFilterMapper2_RegisterFilter(pMapper, &clsidFilter2, L"Testfilter2", NULL,
&CLSID_LegacyAmFilterCategory, NULL, &rgf2);
ok(hr == S_OK, "IFilterMapper2_RegisterFilter failed with %x\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IFilterMapper2_EnumMatchingFilters(pMapper, &pEnum, 0, TRUE, MERIT_UNLIKELY, TRUE,
0, NULL, NULL, &GUID_NULL, FALSE, FALSE, 0, NULL, NULL, &GUID_NULL);
ok(hr == S_OK, "IFilterMapper2_EnumMatchingFilters failed with %x\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
if (SUCCEEDED(hr) && pEnum)
{
found = enum_find_filter(L"Testfilter1", pEnum);
@ -194,7 +194,7 @@ static void test_fm2_enummatchingfilters(void)
hr = IFilterMapper2_EnumMatchingFilters(pMapper, &pEnum, 0, TRUE, MERIT_UNLIKELY, TRUE,
0, NULL, NULL, &GUID_NULL, FALSE, FALSE, 0, NULL, NULL, &GUID_NULL);
ok(hr == S_OK, "IFilterMapper2_EnumMatchingFilters failed with %x\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
if (SUCCEEDED(hr) && pEnum)
{
found = enum_find_filter(L"Testfilter2", pEnum);
@ -208,7 +208,7 @@ static void test_fm2_enummatchingfilters(void)
hr = IFilterMapper2_EnumMatchingFilters(pMapper, &pEnum, 0, TRUE, MERIT_UNLIKELY, TRUE,
0, NULL, NULL, &GUID_NULL, TRUE, FALSE, 0, NULL, NULL, &GUID_NULL);
ok(hr == S_OK, "IFilterMapper2_EnumMatchingFilters failed with %x\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
if (SUCCEEDED(hr) && pEnum)
{
@ -217,12 +217,12 @@ static void test_fm2_enummatchingfilters(void)
}
hr = IFilterMapper2_QueryInterface(pMapper, &IID_IFilterMapper, (void **)&mapper);
ok(hr == S_OK, "QueryInterface(IFilterMapper) failed: %#x\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
found = FALSE;
hr = IFilterMapper_EnumMatchingFilters(mapper, &enum_reg, MERIT_UNLIKELY,
FALSE, GUID_NULL, GUID_NULL, FALSE, FALSE, GUID_NULL, GUID_NULL);
ok(hr == S_OK, "IFilterMapper_EnumMatchingFilters failed: %#x\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
while (!found && IEnumRegFilters_Next(enum_reg, 1, &regfilter, &count) == S_OK)
{
if (!wcscmp(regfilter->Name, L"Testfilter1") && IsEqualGUID(&clsidFilter1, &regfilter->Clsid))
@ -239,7 +239,7 @@ static void test_fm2_enummatchingfilters(void)
hr = IFilterMapper2_EnumMatchingFilters(pMapper, &pEnum, 0, TRUE, MERIT_UNLIKELY, TRUE,
0, NULL, NULL, &GUID_NULL, TRUE, FALSE, 0, NULL, NULL, &GUID_NULL);
ok(hr == S_OK, "IFilterMapper2_EnumMatchingFilters failed with %x\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
if (SUCCEEDED(hr) && pEnum)
{
@ -251,18 +251,18 @@ static void test_fm2_enummatchingfilters(void)
{
hr = IFilterMapper2_UnregisterFilter(pMapper, &CLSID_LegacyAmFilterCategory, NULL,
&clsidFilter1);
ok(SUCCEEDED(hr), "IFilterMapper2_UnregisterFilter failed with %x\n", hr);
ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
hr = IFilterMapper2_UnregisterFilter(pMapper, &CLSID_LegacyAmFilterCategory, NULL,
&clsidFilter2);
ok(SUCCEEDED(hr), "IFilterMapper2_UnregisterFilter failed with %x\n", hr);
ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
}
out:
if (pEnum) IEnumMoniker_Release(pEnum);
ref = IFilterMapper2_Release(pMapper);
ok(!ref, "Got outstanding refcount %d.\n", ref);
ok(!ref, "Got outstanding refcount %ld.\n", ref);
}
static void test_legacy_filter_registration(void)
@ -298,34 +298,34 @@ static void test_legacy_filter_registration(void)
* registers in this way. Filters so registered must then be accessible through both IFilterMapper_EnumMatchingFilters
* and IFilterMapper2_EnumMatchingFilters. */
hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, &IID_IFilterMapper2, (void **)&mapper2);
ok(hr == S_OK, "CoCreateInstance failed with %x\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IFilterMapper2_QueryInterface(mapper2, &IID_IFilterMapper, (void **)&mapper);
ok(hr == S_OK, "IFilterMapper2_QueryInterface failed with %x\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
/* Set default value - this is interpreted as "friendly name" later. */
RegSetValueExW(hkey, NULL, 0, REG_SZ, (const BYTE *)L"Testfilter", sizeof(L"Testfilter"));
RegCloseKey(hkey);
hr = IFilterMapper_RegisterFilter(mapper, clsid, L"Testfilter", MERIT_UNLIKELY);
ok(hr == S_OK, "RegisterFilter failed: %#x\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IFilterMapper_RegisterPin(mapper, clsid, L"Pin1", TRUE, FALSE, FALSE, FALSE, GUID_NULL, NULL);
ok(hr == S_OK, "RegisterPin failed: %#x\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IFilterMapper_RegisterPinType(mapper, clsid, L"Pin1", GUID_NULL, GUID_NULL);
ok(hr == S_OK, "RegisterPinType failed: %#x\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IFilterMapper2_EnumMatchingFilters(mapper2, &enum_mon, 0, TRUE, MERIT_UNLIKELY, TRUE,
0, NULL, NULL, &GUID_NULL, FALSE, FALSE, 0, NULL, NULL, &GUID_NULL);
ok(hr == S_OK, "IFilterMapper2_EnumMatchingFilters failed: %x\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(enum_find_filter(L"Testfilter", enum_mon), "IFilterMapper2 didn't find filter\n");
IEnumMoniker_Release(enum_mon);
found = FALSE;
hr = IFilterMapper_EnumMatchingFilters(mapper, &enum_reg, MERIT_UNLIKELY, TRUE, GUID_NULL, GUID_NULL,
FALSE, FALSE, GUID_NULL, GUID_NULL);
ok(hr == S_OK, "IFilterMapper_EnumMatchingFilters failed with %x\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
while(!found && IEnumRegFilters_Next(enum_reg, 1, &regfilter, &count) == S_OK)
{
if (!wcscmp(regfilter->Name, L"Testfilter") && IsEqualGUID(&clsid, &regfilter->Clsid))
@ -335,18 +335,18 @@ static void test_legacy_filter_registration(void)
ok(found, "IFilterMapper didn't find filter\n");
hr = IFilterMapper_UnregisterFilter(mapper, clsid);
ok(hr == S_OK, "FilterMapper_UnregisterFilter failed with %x\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IFilterMapper2_EnumMatchingFilters(mapper2, &enum_mon, 0, TRUE, MERIT_UNLIKELY, TRUE,
0, NULL, NULL, &GUID_NULL, FALSE, FALSE, 0, NULL, NULL, &GUID_NULL);
ok(hr == S_OK, "IFilterMapper2_EnumMatchingFilters failed: %x\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(!enum_find_filter(L"Testfilter", enum_mon), "IFilterMapper2 shouldn't find filter\n");
IEnumMoniker_Release(enum_mon);
found = FALSE;
hr = IFilterMapper_EnumMatchingFilters(mapper, &enum_reg, MERIT_UNLIKELY, TRUE, GUID_NULL, GUID_NULL,
FALSE, FALSE, GUID_NULL, GUID_NULL);
ok(hr == S_OK, "IFilterMapper_EnumMatchingFilters failed with %x\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
while(!found && IEnumRegFilters_Next(enum_reg, 1, &regfilter, &count) == S_OK)
{
if (!wcscmp(regfilter->Name, L"Testfilter") && IsEqualGUID(&clsid, &regfilter->Clsid))
@ -356,13 +356,13 @@ static void test_legacy_filter_registration(void)
ok(!found, "IFilterMapper shouldn't find filter\n");
ret = RegDeleteKeyW(HKEY_CLASSES_ROOT, key_name);
ok(!ret, "RegDeleteKeyA failed: %lu\n", ret);
ok(!ret, "RegDeleteKeyA failed: %Iu\n", ret);
hr = IFilterMapper_RegisterFilter(mapper, clsid, L"Testfilter", MERIT_UNLIKELY);
ok(hr == S_OK, "RegisterFilter failed: %#x\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IFilterMapper_UnregisterFilter(mapper, clsid);
ok(hr == S_OK, "FilterMapper_UnregisterFilter failed with %x\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
IFilterMapper_Release(mapper);
IFilterMapper2_Release(mapper2);
@ -382,13 +382,13 @@ static void test_register_filter_with_null_clsMinorType(void)
hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
&IID_IFilterMapper2, (LPVOID*)&pMapper);
ok(hr == S_OK, "CoCreateInstance failed with %x\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
if (FAILED(hr)) goto out;
hr = CoCreateGuid(&clsidFilter1);
ok(hr == S_OK, "CoCreateGuid failed with %x\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = CoCreateGuid(&clsidFilter2);
ok(hr == S_OK, "CoCreateGuid failed with %x\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
rgPinType.clsMajorType = &GUID_NULL;
/* Make sure quartz accepts it without crashing */
@ -418,10 +418,10 @@ static void test_register_filter_with_null_clsMinorType(void)
skip("Not authorized to register filters\n");
goto out;
}
ok(hr == S_OK, "IFilterMapper2_RegisterFilter failed with %x\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IFilterMapper2_UnregisterFilter(pMapper, &CLSID_LegacyAmFilterCategory, NULL, &clsidFilter1);
ok(hr == S_OK, "FilterMapper_UnregisterFilter failed with %x\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
/* Test with pin descript version 2 */
ZeroMemory(&rgf2, sizeof(rgf2));
@ -440,10 +440,10 @@ static void test_register_filter_with_null_clsMinorType(void)
hr = IFilterMapper2_RegisterFilter(pMapper, &clsidFilter2, L"Testfilter2", NULL,
&CLSID_LegacyAmFilterCategory, NULL, &rgf2);
ok(hr == S_OK, "IFilterMapper2_RegisterFilter failed with %x\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IFilterMapper2_UnregisterFilter(pMapper, &CLSID_LegacyAmFilterCategory, NULL, &clsidFilter2);
ok(hr == S_OK, "FilterMapper_UnregisterFilter failed with %x\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
out:
@ -473,7 +473,7 @@ static void test_parse_filter_data(void)
hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
&IID_IFilterMapper2, (LPVOID*)&pMapper);
ok((hr == S_OK || broken(hr != S_OK)), "CoCreateInstance failed with %x\n", hr);
ok((hr == S_OK || broken(hr != S_OK)), "Got hr %#lx.\n", hr);
if (FAILED(hr)) goto out;
hr = IFilterMapper2_QueryInterface(pMapper, &IID_IAMFilterData, (LPVOID*)&pData);
@ -559,53 +559,53 @@ static void test_aggregation(void)
mapper = (IFilterMapper3 *)0xdeadbeef;
hr = CoCreateInstance(&CLSID_FilterMapper2, &test_outer, CLSCTX_INPROC_SERVER,
&IID_IFilterMapper3, (void **)&mapper);
ok(hr == E_NOINTERFACE, "Got hr %#x.\n", hr);
ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr);
ok(!mapper, "Got interface %p.\n", mapper);
hr = CoCreateInstance(&CLSID_FilterMapper2, &test_outer, CLSCTX_INPROC_SERVER,
&IID_IUnknown, (void **)&unk);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
ok(unk != &test_outer, "Returned IUnknown should not be outer IUnknown.\n");
ref = get_refcount(unk);
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
ref = IUnknown_AddRef(unk);
ok(ref == 2, "Got unexpected refcount %d.\n", ref);
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
ref = IUnknown_Release(unk);
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
hr = IUnknown_QueryInterface(unk, &IID_IUnknown, (void **)&unk2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(unk2 == unk, "Got unexpected IUnknown %p.\n", unk2);
IUnknown_Release(unk2);
hr = IUnknown_QueryInterface(unk, &IID_IFilterMapper3, (void **)&mapper);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IFilterMapper3_QueryInterface(mapper, &IID_IUnknown, (void **)&unk2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(unk2 == (IUnknown *)0xdeadbeef, "Got unexpected IUnknown %p.\n", unk2);
hr = IFilterMapper3_QueryInterface(mapper, &IID_IFilterMapper3, (void **)&mapper2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(mapper2 == (IFilterMapper3 *)0xdeadbeef, "Got unexpected IFilterMapper3 %p.\n", mapper2);
hr = IUnknown_QueryInterface(unk, &test_iid, (void **)&unk2);
ok(hr == E_NOINTERFACE, "Got hr %#x.\n", hr);
ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr);
ok(!unk2, "Got unexpected IUnknown %p.\n", unk2);
hr = IFilterMapper3_QueryInterface(mapper, &test_iid, (void **)&unk2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(unk2 == (IUnknown *)0xdeadbeef, "Got unexpected IUnknown %p.\n", unk2);
IFilterMapper3_Release(mapper);
ref = IUnknown_Release(unk);
ok(!ref, "Got unexpected refcount %d.\n", ref);
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
ok(!ref, "Got unexpected refcount %ld.\n", ref);
ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
}
static void test_dmo(void)
@ -625,19 +625,19 @@ static void test_dmo(void)
skip("Not enough permissions to register DMOs.\n");
return;
}
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
mapper = create_mapper();
hr = IFilterMapper3_EnumMatchingFilters(mapper, &enumerator, 0, FALSE, 0,
FALSE, 0, NULL, NULL, NULL, FALSE, FALSE, 0, NULL, NULL, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
found = FALSE;
while (IEnumMoniker_Next(enumerator, 1, &moniker, NULL) == S_OK)
{
hr = IMoniker_GetDisplayName(moniker, NULL, NULL, &name);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
if (!wcscmp(name, L"@device:dmo:{77777777-0000-0000-0000-000000000000}{57F2DB8B-E6BB-4513-9D43-DCD2A6593125}"))
found = TRUE;
@ -651,10 +651,10 @@ static void test_dmo(void)
/* DMOs are enumerated by IFilterMapper in Windows 7 and higher. */
ref = IFilterMapper3_Release(mapper);
ok(!ref, "Got outstanding refcount %d.\n", ref);
ok(!ref, "Got outstanding refcount %ld.\n", ref);
hr = DMOUnregister(&testclsid, &DMOCATEGORY_AUDIO_DECODER);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
}
START_TEST(filtermapper)

View file

@ -27,7 +27,7 @@ static IMemAllocator *create_allocator(void)
IMemAllocator *allocator = NULL;
HRESULT hr = CoCreateInstance(&CLSID_MemoryAllocator, NULL, CLSCTX_INPROC_SERVER,
&IID_IMemAllocator, (void **)&allocator);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
return allocator;
}
@ -63,59 +63,59 @@ static void test_properties(void)
memset(&ret_props, 0xcc, sizeof(ret_props));
hr = IMemAllocator_GetProperties(allocator, &ret_props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(!ret_props.cBuffers, "Got %d buffers.\n", ret_props.cBuffers);
ok(!ret_props.cbBuffer, "Got size %d.\n", ret_props.cbBuffer);
ok(!ret_props.cbAlign, "Got align %d.\n", ret_props.cbAlign);
ok(!ret_props.cbPrefix, "Got prefix %d.\n", ret_props.cbPrefix);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(!ret_props.cBuffers, "Got %ld buffers.\n", ret_props.cBuffers);
ok(!ret_props.cbBuffer, "Got size %ld.\n", ret_props.cbBuffer);
ok(!ret_props.cbAlign, "Got align %ld.\n", ret_props.cbAlign);
ok(!ret_props.cbPrefix, "Got prefix %ld.\n", ret_props.cbPrefix);
hr = IMemAllocator_SetProperties(allocator, &req_props, &ret_props);
ok(hr == VFW_E_BADALIGN, "Got hr %#x.\n", hr);
ok(hr == VFW_E_BADALIGN, "Got hr %#lx.\n", hr);
for (i = 0; i < ARRAY_SIZE(tests); i++)
{
req_props = tests[i];
hr = IMemAllocator_SetProperties(allocator, &req_props, &ret_props);
ok(hr == S_OK, "Test %u: Got hr %#x.\n", i, hr);
ok(hr == S_OK, "Test %u: Got hr %#lx.\n", i, hr);
ok(!memcmp(&req_props, &tests[i], sizeof(req_props)), "Test %u: Requested props should not be changed.\n", i);
ok(ret_props.cBuffers == req_props.cBuffers, "Test %u: Got %d buffers.\n", i, ret_props.cBuffers);
ok(ret_props.cbBuffer >= req_props.cbBuffer, "Test %u: Got size %d.\n", i, ret_props.cbBuffer);
ok(ret_props.cbAlign == req_props.cbAlign, "Test %u: Got alignment %d.\n", i, ret_props.cbAlign);
ok(ret_props.cbPrefix == req_props.cbPrefix, "Test %u: Got prefix %d.\n", i, ret_props.cbPrefix);
ok(ret_props.cBuffers == req_props.cBuffers, "Test %u: Got %ld buffers.\n", i, ret_props.cBuffers);
ok(ret_props.cbBuffer >= req_props.cbBuffer, "Test %u: Got size %ld.\n", i, ret_props.cbBuffer);
ok(ret_props.cbAlign == req_props.cbAlign, "Test %u: Got alignment %ld.\n", i, ret_props.cbAlign);
ok(ret_props.cbPrefix == req_props.cbPrefix, "Test %u: Got prefix %ld.\n", i, ret_props.cbPrefix);
ret_size = ret_props.cbBuffer;
hr = IMemAllocator_GetProperties(allocator, &ret_props);
ok(hr == S_OK, "Test %u: Got hr %#x.\n", i, hr);
ok(ret_props.cBuffers == req_props.cBuffers, "Test %u: Got %d buffers.\n", i, ret_props.cBuffers);
ok(ret_props.cbBuffer == ret_size, "Test %u: Got size %d.\n", i, ret_props.cbBuffer);
ok(ret_props.cbAlign == req_props.cbAlign, "Test %u: Got alignment %d.\n", i, ret_props.cbAlign);
ok(ret_props.cbPrefix == req_props.cbPrefix, "Test %u: Got prefix %d.\n", i, ret_props.cbPrefix);
ok(hr == S_OK, "Test %u: Got hr %#lx.\n", i, hr);
ok(ret_props.cBuffers == req_props.cBuffers, "Test %u: Got %ld buffers.\n", i, ret_props.cBuffers);
ok(ret_props.cbBuffer == ret_size, "Test %u: Got size %ld.\n", i, ret_props.cbBuffer);
ok(ret_props.cbAlign == req_props.cbAlign, "Test %u: Got alignment %ld.\n", i, ret_props.cbAlign);
ok(ret_props.cbPrefix == req_props.cbPrefix, "Test %u: Got prefix %ld.\n", i, ret_props.cbPrefix);
hr = IMemAllocator_Commit(allocator);
if (!req_props.cbBuffer)
{
ok(hr == VFW_E_SIZENOTSET, "Test %u: Got hr %#x.\n", i, hr);
ok(hr == VFW_E_SIZENOTSET, "Test %u: Got hr %#lx.\n", i, hr);
continue;
}
ok(hr == S_OK, "Test %u: Got hr %#x.\n", i, hr);
ok(hr == S_OK, "Test %u: Got hr %#lx.\n", i, hr);
hr = IMemAllocator_SetProperties(allocator, &req_props, &ret_props);
ok(hr == VFW_E_ALREADY_COMMITTED, "Test %u: Got hr %#x.\n", i, hr);
ok(hr == VFW_E_ALREADY_COMMITTED, "Test %u: Got hr %#lx.\n", i, hr);
hr = IMemAllocator_GetBuffer(allocator, &sample, NULL, NULL, 0);
ok(hr == S_OK, "Test %u: Got hr %#x.\n", i, hr);
ok(hr == S_OK, "Test %u: Got hr %#lx.\n", i, hr);
size = IMediaSample_GetSize(sample);
ok(size == ret_size, "Test %u: Got size %d.\n", i, size);
ok(size == ret_size, "Test %u: Got size %ld.\n", i, size);
hr = IMemAllocator_Decommit(allocator);
ok(hr == S_OK, "Test %u: Got hr %#x.\n", i, hr);
ok(hr == S_OK, "Test %u: Got hr %#lx.\n", i, hr);
hr = IMemAllocator_SetProperties(allocator, &req_props, &ret_props);
ok(hr == VFW_E_BUFFERS_OUTSTANDING, "Test %u: Got hr %#x.\n", i, hr);
ok(hr == VFW_E_BUFFERS_OUTSTANDING, "Test %u: Got hr %#lx.\n", i, hr);
hr = IMediaSample_Release(sample);
ok(hr == S_OK, "Test %u: Got hr %#x.\n", i, hr);
ok(hr == S_OK, "Test %u: Got hr %#lx.\n", i, hr);
}
IMemAllocator_Release(allocator);
@ -130,42 +130,42 @@ static void test_commit(void)
BYTE *data;
hr = IMemAllocator_SetProperties(allocator, &req_props, &ret_props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMemAllocator_GetBuffer(allocator, &sample, NULL, NULL, 0);
ok(hr == VFW_E_NOT_COMMITTED, "Got hr %#x.\n", hr);
ok(hr == VFW_E_NOT_COMMITTED, "Got hr %#lx.\n", hr);
hr = IMemAllocator_Commit(allocator);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMemAllocator_Commit(allocator);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMemAllocator_GetBuffer(allocator, &sample, NULL, NULL, 0);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
IMediaSample_Release(sample);
hr = IMemAllocator_Decommit(allocator);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMemAllocator_Decommit(allocator);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
/* Extant samples remain valid even after Decommit() is called. */
hr = IMemAllocator_Commit(allocator);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMemAllocator_GetBuffer(allocator, &sample, NULL, NULL, 0);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSample_GetPointer(sample, &data);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMemAllocator_Decommit(allocator);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
memset(data, 0xcc, 65536);
hr = IMemAllocator_GetBuffer(allocator, &sample2, NULL, NULL, 0);
ok(hr == VFW_E_NOT_COMMITTED, "Got hr %#x.\n", hr);
ok(hr == VFW_E_NOT_COMMITTED, "Got hr %#lx.\n", hr);
IMediaSample_Release(sample);
IMemAllocator_Release(allocator);
@ -182,132 +182,132 @@ static void test_sample_time(void)
HRESULT hr;
hr = IMemAllocator_SetProperties(allocator, &req_props, &ret_props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMemAllocator_Commit(allocator);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMemAllocator_GetBuffer(allocator, &sample, NULL, NULL, 0);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSample_QueryInterface(sample, &IID_IMediaSample2, (void **)&sample2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
start = 0xdeadbeef;
end = 0xdeadf00d;
hr = IMediaSample_GetTime(sample, &start, &end);
ok(hr == VFW_E_SAMPLE_TIME_NOT_SET, "Got hr %#x.\n", hr);
ok(hr == VFW_E_SAMPLE_TIME_NOT_SET, "Got hr %#lx.\n", hr);
ok(start == 0xdeadbeef, "Got start %s.\n", wine_dbgstr_longlong(start));
ok(end == 0xdeadf00d, "Got end %s.\n", wine_dbgstr_longlong(end));
hr = IMediaSample2_GetProperties(sample2, sizeof(props), (BYTE *)&props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(!props.dwSampleFlags, "Got flags %#x.\n", props.dwSampleFlags);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(!props.dwSampleFlags, "Got flags %#lx.\n", props.dwSampleFlags);
hr = IMediaSample_SetTime(sample, NULL, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSample_GetTime(sample, &start, &end);
ok(hr == VFW_E_SAMPLE_TIME_NOT_SET, "Got hr %#x.\n", hr);
ok(hr == VFW_E_SAMPLE_TIME_NOT_SET, "Got hr %#lx.\n", hr);
hr = IMediaSample2_GetProperties(sample2, sizeof(props), (BYTE *)&props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(!props.dwSampleFlags, "Got flags %#x.\n", props.dwSampleFlags);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(!props.dwSampleFlags, "Got flags %#lx.\n", props.dwSampleFlags);
start = 0x123;
hr = IMediaSample_SetTime(sample, &start, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
start = end = 0;
hr = IMediaSample_GetTime(sample, &start, &end);
ok(hr == VFW_S_NO_STOP_TIME, "Got hr %#x.\n", hr);
ok(hr == VFW_S_NO_STOP_TIME, "Got hr %#lx.\n", hr);
ok(start == 0x123, "Got start %s.\n", wine_dbgstr_longlong(start));
ok(end == 0x124, "Got end %s.\n", wine_dbgstr_longlong(end));
hr = IMediaSample2_GetProperties(sample2, sizeof(props), (BYTE *)&props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(props.dwSampleFlags == AM_SAMPLE_TIMEVALID, "Got flags %#x.\n", props.dwSampleFlags);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(props.dwSampleFlags == AM_SAMPLE_TIMEVALID, "Got flags %#lx.\n", props.dwSampleFlags);
ok(props.tStart == 0x123, "Got start %s.\n", wine_dbgstr_longlong(props.tStart));
hr = IMediaSample_SetTime(sample, NULL, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSample_GetTime(sample, &start, &end);
ok(hr == VFW_E_SAMPLE_TIME_NOT_SET, "Got hr %#x.\n", hr);
ok(hr == VFW_E_SAMPLE_TIME_NOT_SET, "Got hr %#lx.\n", hr);
hr = IMediaSample2_GetProperties(sample2, sizeof(props), (BYTE *)&props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(!props.dwSampleFlags, "Got flags %#x.\n", props.dwSampleFlags);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(!props.dwSampleFlags, "Got flags %#lx.\n", props.dwSampleFlags);
end = 0x321;
hr = IMediaSample_SetTime(sample, NULL, &end);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSample_GetTime(sample, &start, &end);
ok(hr == VFW_E_SAMPLE_TIME_NOT_SET, "Got hr %#x.\n", hr);
ok(hr == VFW_E_SAMPLE_TIME_NOT_SET, "Got hr %#lx.\n", hr);
hr = IMediaSample2_GetProperties(sample2, sizeof(props), (BYTE *)&props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(!props.dwSampleFlags, "Got flags %#x.\n", props.dwSampleFlags);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(!props.dwSampleFlags, "Got flags %#lx.\n", props.dwSampleFlags);
start = 0x123;
end = 0x321;
hr = IMediaSample_SetTime(sample, &start, &end);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
start = end = 0;
hr = IMediaSample_GetTime(sample, &start, &end);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(start == 0x123, "Got start %s.\n", wine_dbgstr_longlong(start));
ok(end == 0x321, "Got end %s.\n", wine_dbgstr_longlong(end));
hr = IMediaSample2_GetProperties(sample2, sizeof(props), (BYTE *)&props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(props.dwSampleFlags == (AM_SAMPLE_TIMEVALID | AM_SAMPLE_STOPVALID),
"Got flags %#x.\n", props.dwSampleFlags);
"Got flags %#lx.\n", props.dwSampleFlags);
ok(props.tStart == 0x123, "Got start %s.\n", wine_dbgstr_longlong(props.tStart));
ok(props.tStop == 0x321, "Got end %s.\n", wine_dbgstr_longlong(props.tStop));
props.dwSampleFlags = 0;
hr = IMediaSample2_SetProperties(sample2, sizeof(props), (BYTE *)&props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSample_GetTime(sample, &start, &end);
ok(hr == VFW_E_SAMPLE_TIME_NOT_SET, "Got hr %#x.\n", hr);
ok(hr == VFW_E_SAMPLE_TIME_NOT_SET, "Got hr %#lx.\n", hr);
hr = IMediaSample2_GetProperties(sample2, sizeof(props), (BYTE *)&props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(!props.dwSampleFlags, "Got flags %#x.\n", props.dwSampleFlags);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(!props.dwSampleFlags, "Got flags %#lx.\n", props.dwSampleFlags);
props.dwSampleFlags = AM_SAMPLE_TIMEVALID;
props.tStart = 0x123;
hr = IMediaSample2_SetProperties(sample2, sizeof(props), (BYTE *)&props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
start = end = 0;
hr = IMediaSample_GetTime(sample, &start, &end);
ok(hr == VFW_S_NO_STOP_TIME, "Got hr %#x.\n", hr);
ok(hr == VFW_S_NO_STOP_TIME, "Got hr %#lx.\n", hr);
ok(start == 0x123, "Got start %s.\n", wine_dbgstr_longlong(start));
ok(end == 0x124, "Got end %s.\n", wine_dbgstr_longlong(end));
hr = IMediaSample2_GetProperties(sample2, sizeof(props), (BYTE *)&props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(props.dwSampleFlags == AM_SAMPLE_TIMEVALID, "Got flags %#x.\n", props.dwSampleFlags);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(props.dwSampleFlags == AM_SAMPLE_TIMEVALID, "Got flags %#lx.\n", props.dwSampleFlags);
ok(props.tStart == 0x123, "Got start %s.\n", wine_dbgstr_longlong(props.tStart));
props.dwSampleFlags = AM_SAMPLE_TIMEVALID | AM_SAMPLE_STOPVALID;
props.tStart = 0x1234;
props.tStop = 0x4321;
hr = IMediaSample2_SetProperties(sample2, sizeof(props), (BYTE *)&props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
start = end = 0;
hr = IMediaSample_GetTime(sample, &start, &end);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(start == 0x1234, "Got start %s.\n", wine_dbgstr_longlong(start));
ok(end == 0x4321, "Got end %s.\n", wine_dbgstr_longlong(end));
hr = IMediaSample2_GetProperties(sample2, sizeof(props), (BYTE *)&props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(props.dwSampleFlags == (AM_SAMPLE_TIMEVALID | AM_SAMPLE_STOPVALID),
"Got flags %#x.\n", props.dwSampleFlags);
"Got flags %#lx.\n", props.dwSampleFlags);
ok(props.tStart == 0x1234, "Got start %s.\n", wine_dbgstr_longlong(props.tStart));
ok(props.tStop == 0x4321, "Got end %s.\n", wine_dbgstr_longlong(props.tStop));
@ -317,28 +317,28 @@ static void test_sample_time(void)
start = 0x123;
end = 0x321;
hr = IMemAllocator_GetBuffer(allocator, &sample, &start, &end, 0);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSample_QueryInterface(sample, &IID_IMediaSample2, (void **)&sample2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
start = 0xdeadbeef;
end = 0xdeadf00d;
hr = IMediaSample_GetTime(sample, &start, &end);
ok(hr == VFW_E_SAMPLE_TIME_NOT_SET, "Got hr %#x.\n", hr);
ok(hr == VFW_E_SAMPLE_TIME_NOT_SET, "Got hr %#lx.\n", hr);
ok(start == 0xdeadbeef, "Got start %s.\n", wine_dbgstr_longlong(start));
ok(end == 0xdeadf00d, "Got end %s.\n", wine_dbgstr_longlong(end));
hr = IMediaSample2_GetProperties(sample2, sizeof(props), (BYTE *)&props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(!props.dwSampleFlags, "Got flags %#x.\n", props.dwSampleFlags);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(!props.dwSampleFlags, "Got flags %#lx.\n", props.dwSampleFlags);
start = 0x123;
end = 0x321;
hr = IMediaSample_SetMediaTime(sample, &start, &end);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSample_GetTime(sample, &start, &end);
ok(hr == VFW_E_SAMPLE_TIME_NOT_SET, "Got hr %#x.\n", hr);
ok(hr == VFW_E_SAMPLE_TIME_NOT_SET, "Got hr %#lx.\n", hr);
IMediaSample2_Release(sample2);
IMediaSample_Release(sample);
@ -355,48 +355,48 @@ static void test_media_time(void)
HRESULT hr;
hr = IMemAllocator_SetProperties(allocator, &req_props, &ret_props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMemAllocator_Commit(allocator);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMemAllocator_GetBuffer(allocator, &sample, NULL, NULL, 0);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
start = 0xdeadbeef;
end = 0xdeadf00d;
hr = IMediaSample_GetMediaTime(sample, &start, &end);
ok(hr == VFW_E_MEDIA_TIME_NOT_SET, "Got hr %#x.\n", hr);
ok(hr == VFW_E_MEDIA_TIME_NOT_SET, "Got hr %#lx.\n", hr);
ok(start == 0xdeadbeef, "Got start %s.\n", wine_dbgstr_longlong(start));
ok(end == 0xdeadf00d, "Got end %s.\n", wine_dbgstr_longlong(end));
hr = IMediaSample_SetMediaTime(sample, NULL, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSample_GetMediaTime(sample, &start, &end);
ok(hr == VFW_E_MEDIA_TIME_NOT_SET, "Got hr %#x.\n", hr);
ok(hr == VFW_E_MEDIA_TIME_NOT_SET, "Got hr %#lx.\n", hr);
/* This crashes on quartz.dll < 6.6. */
if (0)
{
start = 0x123;
hr = IMediaSample_SetMediaTime(sample, &start, NULL);
ok(hr == E_POINTER, "Got hr %#x.\n", hr);
ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
}
end = 0x321;
hr = IMediaSample_SetMediaTime(sample, NULL, &end);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSample_GetMediaTime(sample, &start, &end);
ok(hr == VFW_E_MEDIA_TIME_NOT_SET, "Got hr %#x.\n", hr);
ok(hr == VFW_E_MEDIA_TIME_NOT_SET, "Got hr %#lx.\n", hr);
start = 0x123;
end = 0x321;
hr = IMediaSample_SetMediaTime(sample, &start, &end);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
start = end = 0;
hr = IMediaSample_GetMediaTime(sample, &start, &end);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(start == 0x123, "Got start %s.\n", wine_dbgstr_longlong(start));
ok(end == 0x321, "Got end %s.\n", wine_dbgstr_longlong(end));
@ -405,35 +405,35 @@ static void test_media_time(void)
start = 0x123;
end = 0x321;
hr = IMemAllocator_GetBuffer(allocator, &sample, &start, &end, 0);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
start = 0xdeadbeef;
end = 0xdeadf00d;
hr = IMediaSample_GetMediaTime(sample, &start, &end);
ok(hr == VFW_E_MEDIA_TIME_NOT_SET, "Got hr %#x.\n", hr);
ok(hr == VFW_E_MEDIA_TIME_NOT_SET, "Got hr %#lx.\n", hr);
ok(start == 0xdeadbeef, "Got start %s.\n", wine_dbgstr_longlong(start));
ok(end == 0xdeadf00d, "Got end %s.\n", wine_dbgstr_longlong(end));
start = 0x123;
end = 0x321;
hr = IMediaSample_SetTime(sample, &start, &end);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSample_GetMediaTime(sample, &start, &end);
ok(hr == VFW_E_MEDIA_TIME_NOT_SET, "Got hr %#x.\n", hr);
ok(hr == VFW_E_MEDIA_TIME_NOT_SET, "Got hr %#lx.\n", hr);
start = 0x123;
end = 0x321;
hr = IMediaSample_SetMediaTime(sample, &start, &end);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
IMediaSample_Release(sample);
hr = IMemAllocator_GetBuffer(allocator, &sample, NULL, NULL, 0);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSample_GetMediaTime(sample, &start, &end);
ok(hr == VFW_E_MEDIA_TIME_NOT_SET, "Got hr %#x.\n", hr);
ok(hr == VFW_E_MEDIA_TIME_NOT_SET, "Got hr %#lx.\n", hr);
IMediaSample_Release(sample);
IMemAllocator_Release(allocator);
@ -457,193 +457,193 @@ static void test_sample_properties(void)
expect_mt.pbFormat = NULL;
hr = IMemAllocator_SetProperties(allocator, &req_props, &ret_props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMemAllocator_Commit(allocator);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMemAllocator_GetBuffer(allocator, &sample, NULL, NULL, 0);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSample_QueryInterface(sample, &IID_IMediaSample2, (void **)&sample2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSample_GetPointer(sample, &data);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSample2_GetProperties(sample2, sizeof(props), (BYTE *)&props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(!props.dwTypeSpecificFlags, "Got type-specific flags %#x.\n", props.dwTypeSpecificFlags);
ok(!props.dwSampleFlags, "Got flags %#x.\n", props.dwSampleFlags);
ok(props.lActual == 65536, "Got actual length %d.\n", props.lActual);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(!props.dwTypeSpecificFlags, "Got type-specific flags %#lx.\n", props.dwTypeSpecificFlags);
ok(!props.dwSampleFlags, "Got flags %#lx.\n", props.dwSampleFlags);
ok(props.lActual == 65536, "Got actual length %ld.\n", props.lActual);
ok(!props.tStart, "Got sample start %s.\n", wine_dbgstr_longlong(props.tStart));
ok(!props.dwStreamId, "Got stream ID %#x.\n", props.dwStreamId);
ok(!props.dwStreamId, "Got stream ID %#lx.\n", props.dwStreamId);
ok(!props.pMediaType, "Got media type %p.\n", props.pMediaType);
ok(props.pbBuffer == data, "Expected pointer %p, got %p.\n", data, props.pbBuffer);
ok(props.cbBuffer == 65536, "Got buffer length %d.\n", props.cbBuffer);
ok(props.cbBuffer == 65536, "Got buffer length %ld.\n", props.cbBuffer);
/* media type */
mt = (AM_MEDIA_TYPE *)0xdeadbeef;
hr = IMediaSample_GetMediaType(sample, &mt);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
ok(!mt, "Got media type %p.\n", mt);
hr = IMediaSample_SetMediaType(sample, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
mt = (AM_MEDIA_TYPE *)0xdeadbeef;
hr = IMediaSample_GetMediaType(sample, &mt);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
ok(!mt, "Got media type %p.\n", mt);
hr = IMediaSample2_GetProperties(sample2, sizeof(props), (BYTE *)&props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(!props.dwSampleFlags, "Got flags %#x.\n", props.dwSampleFlags);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(!props.dwSampleFlags, "Got flags %#lx.\n", props.dwSampleFlags);
ok(!props.pMediaType, "Got media type %p.\n", props.pMediaType);
hr = IMediaSample_SetMediaType(sample, &expect_mt);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSample_GetMediaType(sample, &mt);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(!memcmp(mt, &expect_mt, sizeof(AM_MEDIA_TYPE)), "Media types didn't match.\n");
CoTaskMemFree(mt);
hr = IMediaSample2_GetProperties(sample2, sizeof(props), (BYTE *)&props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(props.dwSampleFlags == AM_SAMPLE_TYPECHANGED, "Got flags %#x.\n", props.dwSampleFlags);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(props.dwSampleFlags == AM_SAMPLE_TYPECHANGED, "Got flags %#lx.\n", props.dwSampleFlags);
ok(!memcmp(props.pMediaType, &expect_mt, sizeof(AM_MEDIA_TYPE)), "Media types didn't match.\n");
hr = IMediaSample_SetMediaType(sample, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
mt = (AM_MEDIA_TYPE *)0xdeadbeef;
hr = IMediaSample_GetMediaType(sample, &mt);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
ok(!mt, "Got media type %p.\n", mt);
hr = IMediaSample2_GetProperties(sample2, sizeof(props), (BYTE *)&props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(!props.dwSampleFlags, "Got flags %#x.\n", props.dwSampleFlags);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(!props.dwSampleFlags, "Got flags %#lx.\n", props.dwSampleFlags);
ok(!props.pMediaType, "Got media type %p.\n", props.pMediaType);
/* actual length */
len = IMediaSample_GetActualDataLength(sample);
ok(len == 65536, "Got length %d.\n", len);
ok(len == 65536, "Got length %ld.\n", len);
hr = IMediaSample_SetActualDataLength(sample, 65537);
ok(hr == VFW_E_BUFFER_OVERFLOW, "Got hr %#x.\n", hr);
ok(hr == VFW_E_BUFFER_OVERFLOW, "Got hr %#lx.\n", hr);
hr = IMediaSample_SetActualDataLength(sample, -1);
ok(hr == VFW_E_BUFFER_OVERFLOW || broken(hr == S_OK), "Got hr %#x.\n", hr);
ok(hr == VFW_E_BUFFER_OVERFLOW || broken(hr == S_OK), "Got hr %#lx.\n", hr);
hr = IMediaSample_SetActualDataLength(sample, 65536);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSample_SetActualDataLength(sample, 0);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
len = IMediaSample_GetActualDataLength(sample);
ok(len == 0, "Got length %d.\n", len);
ok(len == 0, "Got length %ld.\n", len);
hr = IMediaSample2_GetProperties(sample2, sizeof(props), (BYTE *)&props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(props.lActual == 0, "Got actual length %d.\n", props.lActual);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(props.lActual == 0, "Got actual length %ld.\n", props.lActual);
props.lActual = 123;
hr = IMediaSample2_SetProperties(sample2, sizeof(props), (BYTE *)&props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSample2_GetProperties(sample2, sizeof(props), (BYTE *)&props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(props.lActual == 123, "Got actual length %d.\n", props.lActual);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(props.lActual == 123, "Got actual length %ld.\n", props.lActual);
len = IMediaSample_GetActualDataLength(sample);
ok(len == 123, "Got length %d.\n", len);
ok(len == 123, "Got length %ld.\n", len);
/* boolean flags */
hr = IMediaSample_IsPreroll(sample);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
hr = IMediaSample_SetPreroll(sample, TRUE);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSample_IsPreroll(sample);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSample2_GetProperties(sample2, sizeof(props), (BYTE *)&props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(props.dwSampleFlags == AM_SAMPLE_PREROLL, "Got flags %#x.\n", props.dwSampleFlags);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(props.dwSampleFlags == AM_SAMPLE_PREROLL, "Got flags %#lx.\n", props.dwSampleFlags);
hr = IMediaSample_SetPreroll(sample, FALSE);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSample_IsPreroll(sample);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
hr = IMediaSample2_GetProperties(sample2, sizeof(props), (BYTE *)&props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(!props.dwSampleFlags, "Got flags %#x.\n", props.dwSampleFlags);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(!props.dwSampleFlags, "Got flags %#lx.\n", props.dwSampleFlags);
hr = IMediaSample_IsDiscontinuity(sample);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
hr = IMediaSample_SetDiscontinuity(sample, TRUE);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSample_IsDiscontinuity(sample);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSample2_GetProperties(sample2, sizeof(props), (BYTE *)&props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(props.dwSampleFlags == AM_SAMPLE_DATADISCONTINUITY, "Got flags %#x.\n", props.dwSampleFlags);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(props.dwSampleFlags == AM_SAMPLE_DATADISCONTINUITY, "Got flags %#lx.\n", props.dwSampleFlags);
hr = IMediaSample_SetDiscontinuity(sample, FALSE);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSample_IsDiscontinuity(sample);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
hr = IMediaSample2_GetProperties(sample2, sizeof(props), (BYTE *)&props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(!props.dwSampleFlags, "Got flags %#x.\n", props.dwSampleFlags);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(!props.dwSampleFlags, "Got flags %#lx.\n", props.dwSampleFlags);
hr = IMediaSample_IsSyncPoint(sample);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
hr = IMediaSample_SetSyncPoint(sample, TRUE);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSample_IsSyncPoint(sample);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSample2_GetProperties(sample2, sizeof(props), (BYTE *)&props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(props.dwSampleFlags == AM_SAMPLE_SPLICEPOINT, "Got flags %#x.\n", props.dwSampleFlags);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(props.dwSampleFlags == AM_SAMPLE_SPLICEPOINT, "Got flags %#lx.\n", props.dwSampleFlags);
hr = IMediaSample_SetSyncPoint(sample, FALSE);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSample_IsSyncPoint(sample);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
hr = IMediaSample2_GetProperties(sample2, sizeof(props), (BYTE *)&props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(!props.dwSampleFlags, "Got flags %#x.\n", props.dwSampleFlags);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(!props.dwSampleFlags, "Got flags %#lx.\n", props.dwSampleFlags);
props.dwSampleFlags = (AM_SAMPLE_PREROLL | AM_SAMPLE_DATADISCONTINUITY | AM_SAMPLE_SPLICEPOINT);
hr = IMediaSample2_SetProperties(sample2, sizeof(props), (BYTE *)&props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSample_IsPreroll(sample);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSample_IsDiscontinuity(sample);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSample_IsSyncPoint(sample);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSample2_GetProperties(sample2, sizeof(props), (BYTE *)&props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(props.dwSampleFlags == (AM_SAMPLE_PREROLL | AM_SAMPLE_DATADISCONTINUITY | AM_SAMPLE_SPLICEPOINT),
"Got flags %#x.\n", props.dwSampleFlags);
"Got flags %#lx.\n", props.dwSampleFlags);
hr = IMediaSample_SetMediaType(sample, &expect_mt);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
IMediaSample2_Release(sample2);
IMediaSample_Release(sample);
hr = IMemAllocator_GetBuffer(allocator, &sample, NULL, NULL, 0);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSample_QueryInterface(sample, &IID_IMediaSample2, (void **)&sample2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSample2_GetProperties(sample2, sizeof(props), (BYTE *)&props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(!props.dwTypeSpecificFlags, "Got type-specific flags %#x.\n", props.dwTypeSpecificFlags);
ok(!props.dwSampleFlags, "Got flags %#x.\n", props.dwSampleFlags);
ok(props.lActual == 123, "Got actual length %d.\n", props.lActual);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(!props.dwTypeSpecificFlags, "Got type-specific flags %#lx.\n", props.dwTypeSpecificFlags);
ok(!props.dwSampleFlags, "Got flags %#lx.\n", props.dwSampleFlags);
ok(props.lActual == 123, "Got actual length %ld.\n", props.lActual);
ok(!props.tStart, "Got sample start %s.\n", wine_dbgstr_longlong(props.tStart));
ok(!props.dwStreamId, "Got stream ID %#x.\n", props.dwStreamId);
ok(!props.dwStreamId, "Got stream ID %#lx.\n", props.dwStreamId);
ok(!props.pMediaType, "Got media type %p.\n", props.pMediaType);
ok(props.cbBuffer == 65536, "Got buffer length %d.\n", props.cbBuffer);
ok(props.cbBuffer == 65536, "Got buffer length %ld.\n", props.cbBuffer);
IMediaSample2_Release(sample2);
IMediaSample_Release(sample);

File diff suppressed because it is too large Load diff

View file

@ -74,53 +74,53 @@ static void test_aggregation(void)
passthrough = (ISeekingPassThru *)0xdeadbeef;
hr = CoCreateInstance(&CLSID_SeekingPassThru, &test_outer, CLSCTX_INPROC_SERVER,
&IID_ISeekingPassThru, (void **)&passthrough);
ok(hr == E_NOINTERFACE, "Got hr %#x.\n", hr);
ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr);
ok(!passthrough, "Got interface %p.\n", passthrough);
hr = CoCreateInstance(&CLSID_SeekingPassThru, &test_outer, CLSCTX_INPROC_SERVER,
&IID_IUnknown, (void **)&unk);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
ok(unk != &test_outer, "Returned IUnknown should not be outer IUnknown.\n");
ref = get_refcount(unk);
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
ref = IUnknown_AddRef(unk);
ok(ref == 2, "Got unexpected refcount %d.\n", ref);
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
ref = IUnknown_Release(unk);
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
hr = IUnknown_QueryInterface(unk, &IID_IUnknown, (void **)&unk2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(unk2 == unk, "Got unexpected IUnknown %p.\n", unk2);
IUnknown_Release(unk2);
hr = IUnknown_QueryInterface(unk, &IID_ISeekingPassThru, (void **)&passthrough);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = ISeekingPassThru_QueryInterface(passthrough, &IID_IUnknown, (void **)&unk2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(unk2 == (IUnknown *)0xdeadbeef, "Got unexpected IUnknown %p.\n", unk2);
hr = ISeekingPassThru_QueryInterface(passthrough, &IID_ISeekingPassThru, (void **)&passthrough2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(passthrough2 == (ISeekingPassThru *)0xdeadbeef, "Got unexpected ISeekingPassThru %p.\n", passthrough2);
hr = IUnknown_QueryInterface(unk, &test_iid, (void **)&unk2);
ok(hr == E_NOINTERFACE, "Got hr %#x.\n", hr);
ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr);
ok(!unk2, "Got unexpected IUnknown %p.\n", unk2);
hr = ISeekingPassThru_QueryInterface(passthrough, &test_iid, (void **)&unk2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(unk2 == (IUnknown *)0xdeadbeef, "Got unexpected IUnknown %p.\n", unk2);
ISeekingPassThru_Release(passthrough);
ref = IUnknown_Release(unk);
ok(!ref, "Got unexpected refcount %d.\n", ref);
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
ok(!ref, "Got unexpected refcount %ld.\n", ref);
ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
}
START_TEST(passthrough)

View file

@ -27,7 +27,7 @@ static IReferenceClock *create_system_clock(void)
IReferenceClock *clock = NULL;
HRESULT hr = CoCreateInstance(&CLSID_SystemClock, NULL, CLSCTX_INPROC_SERVER,
&IID_IReferenceClock, (void **)&clock);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
return clock;
}
@ -48,7 +48,7 @@ static void check_interface_(unsigned int line, void *iface_ptr, REFIID iid, BOO
expected_hr = supported ? S_OK : E_NOINTERFACE;
hr = IUnknown_QueryInterface(iface, iid, (void **)&unk);
ok_(__FILE__, line)(hr == expected_hr, "Got hr %#x, expected %#x.\n", hr, expected_hr);
ok_(__FILE__, line)(hr == expected_hr, "Got hr %#lx, expected %#lx.\n", hr, expected_hr);
if (SUCCEEDED(hr))
IUnknown_Release(unk);
}
@ -64,7 +64,7 @@ static void test_interfaces(void)
check_interface(clock, &IID_IDirectDraw, FALSE);
ref = IReferenceClock_Release(clock);
ok(!ref, "Got outstanding refcount %d.\n", ref);
ok(!ref, "Got outstanding refcount %ld.\n", ref);
}
static const GUID test_iid = {0x33333333};
@ -112,53 +112,53 @@ static void test_aggregation(void)
clock = (IReferenceClock *)0xdeadbeef;
hr = CoCreateInstance(&CLSID_SystemClock, &test_outer, CLSCTX_INPROC_SERVER,
&IID_IReferenceClock, (void **)&clock);
ok(hr == E_NOINTERFACE, "Got hr %#x.\n", hr);
ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr);
ok(!clock, "Got interface %p.\n", clock);
hr = CoCreateInstance(&CLSID_SystemClock, &test_outer, CLSCTX_INPROC_SERVER,
&IID_IUnknown, (void **)&unk);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
ok(unk != &test_outer, "Returned IUnknown should not be outer IUnknown.\n");
ref = get_refcount(unk);
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
ref = IUnknown_AddRef(unk);
ok(ref == 2, "Got unexpected refcount %d.\n", ref);
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
ref = IUnknown_Release(unk);
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
hr = IUnknown_QueryInterface(unk, &IID_IUnknown, (void **)&unk2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(unk2 == unk, "Got unexpected IUnknown %p.\n", unk2);
IUnknown_Release(unk2);
hr = IUnknown_QueryInterface(unk, &IID_IReferenceClock, (void **)&clock);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IReferenceClock_QueryInterface(clock, &IID_IUnknown, (void **)&unk2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(unk2 == (IUnknown *)0xdeadbeef, "Got unexpected IUnknown %p.\n", unk2);
hr = IReferenceClock_QueryInterface(clock, &IID_IReferenceClock, (void **)&clock2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(clock2 == (IReferenceClock *)0xdeadbeef, "Got unexpected IReferenceClock %p.\n", clock2);
hr = IUnknown_QueryInterface(unk, &test_iid, (void **)&unk2);
ok(hr == E_NOINTERFACE, "Got hr %#x.\n", hr);
ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr);
ok(!unk2, "Got unexpected IUnknown %p.\n", unk2);
hr = IReferenceClock_QueryInterface(clock, &test_iid, (void **)&unk2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(unk2 == (IUnknown *)0xdeadbeef, "Got unexpected IUnknown %p.\n", unk2);
IReferenceClock_Release(clock);
ref = IUnknown_Release(unk);
ok(!ref, "Got unexpected refcount %d.\n", ref);
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
ok(!ref, "Got unexpected refcount %ld.\n", ref);
ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
}
static void test_get_time(void)
@ -169,17 +169,17 @@ static void test_get_time(void)
ULONG ref;
hr = IReferenceClock_GetTime(clock, NULL);
ok(hr == E_POINTER, "Got hr %#x.\n", hr);
ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
hr = IReferenceClock_GetTime(clock, &time1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(time1 % 10000 == 0, "Expected no less than 1ms coarseness, but got time %s.\n",
wine_dbgstr_longlong(time1));
ticks = (REFERENCE_TIME)timeGetTime() * 10000;
hr = IReferenceClock_GetTime(clock, &time2);
ok(hr == (time2 == time1 ? S_FALSE : S_OK), "Got hr %#x.\n", hr);
ok(hr == (time2 == time1 ? S_FALSE : S_OK), "Got hr %#lx.\n", hr);
ok(time2 % 10000 == 0, "Expected no less than 1ms coarseness, but got time %s.\n",
wine_dbgstr_longlong(time1));
@ -187,12 +187,12 @@ static void test_get_time(void)
Sleep(100);
hr = IReferenceClock_GetTime(clock, &time2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(time2 - time1 > 80 * 10000, "Expected about %s, but got %s.\n",
wine_dbgstr_longlong(time1 + 80 * 10000), wine_dbgstr_longlong(time2));
ref = IReferenceClock_Release(clock);
ok(!ref, "Got outstanding refcount %d.\n", ref);
ok(!ref, "Got outstanding refcount %ld.\n", ref);
}
static void test_advise(void)
@ -209,72 +209,72 @@ static void test_advise(void)
semaphore = CreateSemaphoreA(NULL, 0, 10, NULL);
hr = IReferenceClock_GetTime(clock, &current);
ok(SUCCEEDED(hr), "Got hr %#x.\n", hr);
ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
hr = IReferenceClock_AdviseTime(clock, current, 500 * 10000, (HEVENT)event, NULL);
ok(hr == E_POINTER, "Got hr %#x.\n", hr);
ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
hr = IReferenceClock_AdviseTime(clock, -1000 * 10000, 500 * 10000, (HEVENT)event, &cookie);
ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
hr = IReferenceClock_AdviseTime(clock, current, 500 * 10000, (HEVENT)event, &cookie);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(WaitForSingleObject(event, 460) == WAIT_TIMEOUT, "Event should not be signaled.\n");
ok(!WaitForSingleObject(event, 80), "Event should be signaled.\n");
hr = IReferenceClock_Unadvise(clock, cookie);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
ResetEvent(event);
hr = IReferenceClock_GetTime(clock, &current);
ok(SUCCEEDED(hr), "Got hr %#x.\n", hr);
ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
hr = IReferenceClock_AdviseTime(clock, current, 500 * 10000, (HEVENT)event, &cookie);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IReferenceClock_Unadvise(clock, cookie);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(WaitForSingleObject(event, 540) == WAIT_TIMEOUT, "Event should not be signaled.\n");
ResetEvent(event);
hr = IReferenceClock_GetTime(clock, &current);
ok(SUCCEEDED(hr), "Got hr %#x.\n", hr);
ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
hr = IReferenceClock_AdviseTime(clock, current + 500 * 10000, 0, (HEVENT)event, &cookie);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(WaitForSingleObject(event, 460) == WAIT_TIMEOUT, "Event should not be signaled.\n");
ok(!WaitForSingleObject(event, 80), "Event should be signaled.\n");
hr = IReferenceClock_GetTime(clock, &current);
ok(SUCCEEDED(hr), "Got hr %#x.\n", hr);
ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
hr = IReferenceClock_AdvisePeriodic(clock, current, 500 * 10000, (HSEMAPHORE)semaphore, NULL);
ok(hr == E_POINTER, "Got hr %#x.\n", hr);
ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
hr = IReferenceClock_AdvisePeriodic(clock, current, 0, (HSEMAPHORE)semaphore, &cookie);
ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
hr = IReferenceClock_AdvisePeriodic(clock, current, -500 * 10000, (HSEMAPHORE)semaphore, &cookie);
ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
hr = IReferenceClock_AdvisePeriodic(clock, -500 * 10000, 1000 * 10000, (HSEMAPHORE)semaphore, &cookie);
ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
hr = IReferenceClock_AdvisePeriodic(clock, current, 100 * 10000, (HSEMAPHORE)semaphore, &cookie);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(!WaitForSingleObject(semaphore, 50), "Semaphore should be signaled.\n");
for (i = 0; i < 5; ++i)
ok(!WaitForSingleObject(semaphore, 500), "Semaphore should be signaled.\n");
hr = IReferenceClock_Unadvise(clock, cookie);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(WaitForSingleObject(semaphore, 200) == WAIT_TIMEOUT, "Semaphore should not be signaled.\n");
ResetEvent(event);
hr = IReferenceClock_GetTime(clock, &current);
ok(SUCCEEDED(hr), "Got hr %#x.\n", hr);
ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
hr = IReferenceClock_AdviseTime(clock, current, 500 * 10000, (HEVENT)event, &cookie);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ref = IReferenceClock_Release(clock);
ok(!ref, "Got outstanding refcount %d.\n", ref);
ok(!ref, "Got outstanding refcount %ld.\n", ref);
ok(WaitForSingleObject(event, 0) == WAIT_TIMEOUT, "Event should not be signaled.\n");

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -30,7 +30,7 @@ static IBaseFilter *create_wave_parser(void)
IBaseFilter *filter = NULL;
HRESULT hr = CoCreateInstance(&CLSID_WAVEParser, NULL, CLSCTX_INPROC_SERVER,
&IID_IBaseFilter, (void **)&filter);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
return filter;
}
@ -46,11 +46,11 @@ static WCHAR *load_resource(const WCHAR *name)
wcscat(pathW, name);
file = CreateFileW(pathW, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0);
ok(file != INVALID_HANDLE_VALUE, "Failed to create file %s, error %u.\n",
ok(file != INVALID_HANDLE_VALUE, "Failed to create file %s, error %lu.\n",
wine_dbgstr_w(pathW), GetLastError());
res = FindResourceW(NULL, name, (LPCWSTR)RT_RCDATA);
ok(!!res, "Failed to load resource, error %u.\n", GetLastError());
ok(!!res, "Failed to load resource, error %lu.\n", GetLastError());
ptr = LockResource(LoadResource(GetModuleHandleA(NULL), res));
WriteFile(file, ptr, SizeofResource( GetModuleHandleA(NULL), res), &written, NULL);
ok(written == SizeofResource(GetModuleHandleA(NULL), res), "Failed to write resource.\n");
@ -88,7 +88,7 @@ static IFilterGraph2 *connect_input(IBaseFilter *splitter, const WCHAR *filename
IBaseFilter_FindPin(reader, L"Output", &source);
hr = IFilterGraph2_ConnectDirect(graph, source, sink, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
IPin_Release(source);
IPin_Release(sink);
@ -107,7 +107,7 @@ static void check_interface_(unsigned int line, void *iface_ptr, REFIID iid, BOO
expected_hr = supported ? S_OK : E_NOINTERFACE;
hr = IUnknown_QueryInterface(iface, iid, (void **)&unk);
ok_(__FILE__, line)(hr == expected_hr, "Got hr %#x, expected %#x.\n", hr, expected_hr);
ok_(__FILE__, line)(hr == expected_hr, "Got hr %#lx, expected %#lx.\n", hr, expected_hr);
if (SUCCEEDED(hr))
IUnknown_Release(unk);
}
@ -212,53 +212,53 @@ static void test_aggregation(void)
filter = (IBaseFilter *)0xdeadbeef;
hr = CoCreateInstance(&CLSID_WAVEParser, &test_outer, CLSCTX_INPROC_SERVER,
&IID_IBaseFilter, (void **)&filter);
ok(hr == E_NOINTERFACE, "Got hr %#x.\n", hr);
ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr);
ok(!filter, "Got interface %p.\n", filter);
hr = CoCreateInstance(&CLSID_WAVEParser, &test_outer, CLSCTX_INPROC_SERVER,
&IID_IUnknown, (void **)&unk);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
ok(unk != &test_outer, "Returned IUnknown should not be outer IUnknown.\n");
ref = get_refcount(unk);
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
ref = IUnknown_AddRef(unk);
ok(ref == 2, "Got unexpected refcount %d.\n", ref);
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
ref = IUnknown_Release(unk);
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
hr = IUnknown_QueryInterface(unk, &IID_IUnknown, (void **)&unk2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(unk2 == unk, "Got unexpected IUnknown %p.\n", unk2);
IUnknown_Release(unk2);
hr = IUnknown_QueryInterface(unk, &IID_IBaseFilter, (void **)&filter);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IBaseFilter_QueryInterface(filter, &IID_IUnknown, (void **)&unk2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(unk2 == (IUnknown *)0xdeadbeef, "Got unexpected IUnknown %p.\n", unk2);
hr = IBaseFilter_QueryInterface(filter, &IID_IBaseFilter, (void **)&filter2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(filter2 == (IBaseFilter *)0xdeadbeef, "Got unexpected IBaseFilter %p.\n", filter2);
hr = IUnknown_QueryInterface(unk, &test_iid, (void **)&unk2);
ok(hr == E_NOINTERFACE, "Got hr %#x.\n", hr);
ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr);
ok(!unk2, "Got unexpected IUnknown %p.\n", unk2);
hr = IBaseFilter_QueryInterface(filter, &test_iid, (void **)&unk2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(unk2 == (IUnknown *)0xdeadbeef, "Got unexpected IUnknown %p.\n", unk2);
IBaseFilter_Release(filter);
ref = IUnknown_Release(unk);
ok(!ref, "Got unexpected refcount %d.\n", ref);
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
ok(!ref, "Got unexpected refcount %ld.\n", ref);
ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
}
static void test_enum_pins(void)
@ -273,79 +273,79 @@ static void test_enum_pins(void)
BOOL ret;
ref = get_refcount(filter);
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
hr = IBaseFilter_EnumPins(filter, NULL);
ok(hr == E_POINTER, "Got hr %#x.\n", hr);
ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
hr = IBaseFilter_EnumPins(filter, &enum1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ref = get_refcount(filter);
ok(ref == 2, "Got unexpected refcount %d.\n", ref);
ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
ref = get_refcount(enum1);
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
hr = IEnumPins_Next(enum1, 1, NULL, NULL);
ok(hr == E_POINTER, "Got hr %#x.\n", hr);
ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
hr = IEnumPins_Next(enum1, 1, pins, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ref = get_refcount(filter);
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ok(ref == 3, "Got unexpected refcount %ld.\n", ref);
ref = get_refcount(pins[0]);
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ok(ref == 3, "Got unexpected refcount %ld.\n", ref);
ref = get_refcount(enum1);
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
IPin_Release(pins[0]);
ref = get_refcount(filter);
ok(ref == 2, "Got unexpected refcount %d.\n", ref);
ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
hr = IEnumPins_Next(enum1, 1, pins, NULL);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
hr = IEnumPins_Reset(enum1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumPins_Next(enum1, 1, pins, &count);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(count == 1, "Got count %u.\n", count);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(count == 1, "Got count %lu.\n", count);
IPin_Release(pins[0]);
hr = IEnumPins_Next(enum1, 1, pins, &count);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(!count, "Got count %u.\n", count);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
ok(!count, "Got count %lu.\n", count);
hr = IEnumPins_Reset(enum1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumPins_Next(enum1, 2, pins, NULL);
ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
hr = IEnumPins_Next(enum1, 2, pins, &count);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(count == 1, "Got count %u.\n", count);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
ok(count == 1, "Got count %lu.\n", count);
IPin_Release(pins[0]);
hr = IEnumPins_Reset(enum1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumPins_Clone(enum1, &enum2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumPins_Skip(enum1, 2);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
hr = IEnumPins_Skip(enum1, 1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumPins_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
hr = IEnumPins_Next(enum1, 1, pins, NULL);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
hr = IEnumPins_Next(enum2, 1, pins, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
IPin_Release(pins[0]);
IEnumPins_Release(enum2);
@ -353,46 +353,46 @@ static void test_enum_pins(void)
graph = connect_input(filter, filename);
hr = IEnumPins_Next(enum1, 1, pins, NULL);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
hr = IEnumPins_Reset(enum1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumPins_Next(enum1, 1, pins, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
IPin_Release(pins[0]);
hr = IEnumPins_Next(enum1, 1, pins, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
IPin_Release(pins[0]);
hr = IEnumPins_Next(enum1, 1, pins, NULL);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
hr = IEnumPins_Reset(enum1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumPins_Next(enum1, 2, pins, &count);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(count == 2, "Got count %u.\n", count);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(count == 2, "Got count %lu.\n", count);
IPin_Release(pins[0]);
IPin_Release(pins[1]);
hr = IEnumPins_Reset(enum1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumPins_Next(enum1, 3, pins, &count);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(count == 2, "Got count %u.\n", count);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
ok(count == 2, "Got count %lu.\n", count);
IPin_Release(pins[0]);
IPin_Release(pins[1]);
IEnumPins_Release(enum1);
IFilterGraph2_Release(graph);
ref = IBaseFilter_Release(filter);
ok(!ref, "Got outstanding refcount %d.\n", ref);
ok(!ref, "Got outstanding refcount %ld.\n", ref);
ret = DeleteFileW(filename);
ok(ret, "Failed to delete file, error %u.\n", GetLastError());
ok(ret, "Failed to delete file, error %lu.\n", GetLastError());
}
static void test_find_pin(void)
@ -407,31 +407,31 @@ static void test_find_pin(void)
BOOL ret;
hr = IBaseFilter_FindPin(filter, L"input pin", &pin);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
IPin_Release(pin);
hr = IBaseFilter_FindPin(filter, L"output", &pin);
ok(hr == VFW_E_NOT_FOUND, "Got hr %#x.\n", hr);
ok(hr == VFW_E_NOT_FOUND, "Got hr %#lx.\n", hr);
graph = connect_input(filter, filename);
hr = IBaseFilter_EnumPins(filter, &enum_pins);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumPins_Next(enum_pins, 1, &pin2, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IBaseFilter_FindPin(filter, L"output", &pin);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(pin == pin2, "Expected pin %p, got %p.\n", pin2, pin);
IPin_Release(pin);
IPin_Release(pin2);
hr = IEnumPins_Next(enum_pins, 1, &pin2, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IBaseFilter_FindPin(filter, L"input pin", &pin);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(pin == pin2, "Expected pin %p, got %p.\n", pin2, pin);
IPin_Release(pin);
IPin_Release(pin2);
@ -439,9 +439,9 @@ static void test_find_pin(void)
IEnumPins_Release(enum_pins);
IFilterGraph2_Release(graph);
ref = IBaseFilter_Release(filter);
ok(!ref, "Got outstanding refcount %d.\n", ref);
ok(!ref, "Got outstanding refcount %ld.\n", ref);
ret = DeleteFileW(filename);
ok(ret, "Failed to delete file, error %u.\n", GetLastError());
ok(ret, "Failed to delete file, error %lu.\n", GetLastError());
}
static void test_pin_info(void)
@ -460,52 +460,52 @@ static void test_pin_info(void)
graph = connect_input(filter, filename);
hr = IBaseFilter_FindPin(filter, L"input pin", &pin);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
expect_ref = get_refcount(filter);
ref = get_refcount(pin);
ok(ref == expect_ref, "Got unexpected refcount %d.\n", ref);
ok(ref == expect_ref, "Got unexpected refcount %ld.\n", ref);
hr = IPin_QueryPinInfo(pin, &info);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(info.pFilter == filter, "Expected filter %p, got %p.\n", filter, info.pFilter);
ok(info.dir == PINDIR_INPUT, "Got direction %d.\n", info.dir);
ok(!wcscmp(info.achName, L"input pin"), "Got name %s.\n", wine_dbgstr_w(info.achName));
ref = get_refcount(filter);
ok(ref == expect_ref + 1, "Got unexpected refcount %d.\n", ref);
ok(ref == expect_ref + 1, "Got unexpected refcount %ld.\n", ref);
ref = get_refcount(pin);
ok(ref == expect_ref + 1, "Got unexpected refcount %d.\n", ref);
ok(ref == expect_ref + 1, "Got unexpected refcount %ld.\n", ref);
IBaseFilter_Release(info.pFilter);
hr = IPin_QueryDirection(pin, &dir);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(dir == PINDIR_INPUT, "Got direction %d.\n", dir);
hr = IPin_QueryId(pin, &id);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(!wcscmp(id, L"input pin"), "Got id %s.\n", wine_dbgstr_w(id));
CoTaskMemFree(id);
IPin_Release(pin);
hr = IBaseFilter_FindPin(filter, L"output", &pin);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
check_interface(pin, &IID_IPin, TRUE);
check_interface(pin, &IID_IMediaSeeking, TRUE);
hr = IPin_QueryPinInfo(pin, &info);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(info.pFilter == filter, "Expected filter %p, got %p.\n", filter, info.pFilter);
ok(info.dir == PINDIR_OUTPUT, "Got direction %d.\n", info.dir);
ok(!wcscmp(info.achName, L"output"), "Got name %s.\n", wine_dbgstr_w(info.achName));
IBaseFilter_Release(info.pFilter);
hr = IPin_QueryDirection(pin, &dir);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(dir == PINDIR_OUTPUT, "Got direction %d.\n", dir);
hr = IPin_QueryId(pin, &id);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(!wcscmp(id, L"output"), "Got id %s.\n", wine_dbgstr_w(id));
CoTaskMemFree(id);
@ -513,9 +513,9 @@ static void test_pin_info(void)
IFilterGraph2_Release(graph);
ref = IBaseFilter_Release(filter);
ok(!ref, "Got outstanding refcount %d.\n", ref);
ok(!ref, "Got outstanding refcount %ld.\n", ref);
ret = DeleteFileW(filename);
ok(ret, "Failed to delete file, error %u.\n", GetLastError());
ok(ret, "Failed to delete file, error %lu.\n", GetLastError());
}
static void test_media_types(void)
@ -536,42 +536,42 @@ static void test_media_types(void)
IBaseFilter_FindPin(filter, L"input pin", &pin);
hr = IPin_EnumMediaTypes(pin, &enummt);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumMediaTypes_Next(enummt, 1, &pmt, NULL);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
IEnumMediaTypes_Release(enummt);
mt.majortype = MEDIATYPE_Stream;
mt.subtype = MEDIASUBTYPE_WAVE;
hr = IPin_QueryAccept(pin, &mt);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
mt.bFixedSizeSamples = TRUE;
mt.bTemporalCompression = TRUE;
mt.lSampleSize = 123;
mt.formattype = FORMAT_VideoInfo;
hr = IPin_QueryAccept(pin, &mt);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
mt.majortype = GUID_NULL;
hr = IPin_QueryAccept(pin, &mt);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
mt.majortype = MEDIATYPE_Stream;
mt.subtype = GUID_NULL;
hr = IPin_QueryAccept(pin, &mt);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
mt.subtype = MEDIASUBTYPE_WAVE;
graph = connect_input(filter, filename);
hr = IPin_EnumMediaTypes(pin, &enummt);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumMediaTypes_Next(enummt, 1, &pmt, NULL);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
IEnumMediaTypes_Release(enummt);
IPin_Release(pin);
@ -579,48 +579,48 @@ static void test_media_types(void)
IBaseFilter_FindPin(filter, L"output", &pin);
hr = IPin_EnumMediaTypes(pin, &enummt);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumMediaTypes_Next(enummt, 1, &pmt, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(IsEqualGUID(&pmt->majortype, &MEDIATYPE_Audio), "Got major type %s.\n",
wine_dbgstr_guid(&pmt->majortype));
ok(IsEqualGUID(&pmt->subtype, &MEDIASUBTYPE_PCM), "Got subtype %s\n",
wine_dbgstr_guid(&pmt->subtype));
ok(pmt->bFixedSizeSamples == TRUE, "Got fixed size %d.\n", pmt->bFixedSizeSamples);
ok(!pmt->bTemporalCompression, "Got temporal compression %d.\n", pmt->bTemporalCompression);
ok(pmt->lSampleSize == 1, "Got sample size %u.\n", pmt->lSampleSize);
ok(pmt->lSampleSize == 1, "Got sample size %lu.\n", pmt->lSampleSize);
ok(IsEqualGUID(&pmt->formattype, &FORMAT_WaveFormatEx), "Got format type %s.\n",
wine_dbgstr_guid(&pmt->formattype));
ok(!pmt->pUnk, "Got pUnk %p.\n", pmt->pUnk);
ok(pmt->cbFormat == sizeof(WAVEFORMATEX), "Got format size %u.\n", pmt->cbFormat);
ok(pmt->cbFormat == sizeof(WAVEFORMATEX), "Got format size %lu.\n", pmt->cbFormat);
ok(!memcmp(pmt->pbFormat, &expect_wfx, sizeof(WAVEFORMATEX)), "Format blocks didn't match.\n");
hr = IPin_QueryAccept(pin, pmt);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
pmt->bFixedSizeSamples = FALSE;
pmt->bTemporalCompression = TRUE;
pmt->lSampleSize = 123;
hr = IPin_QueryAccept(pin, pmt);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
pmt->majortype = GUID_NULL;
hr = IPin_QueryAccept(pin, pmt);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
pmt->majortype = MEDIATYPE_Audio;
pmt->subtype = GUID_NULL;
hr = IPin_QueryAccept(pin, pmt);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
pmt->subtype = MEDIASUBTYPE_WAVE;
pmt->formattype = GUID_NULL;
hr = IPin_QueryAccept(pin, pmt);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
pmt->formattype = FORMAT_None;
hr = IPin_QueryAccept(pin, pmt);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
wfx = (WAVEFORMATEX *)pmt->pbFormat;
@ -628,28 +628,28 @@ static void test_media_types(void)
wfx->nAvgBytesPerSec = 44100 * 2;
wfx->nBlockAlign = 2;
hr = IPin_QueryAccept(pin, pmt);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
*wfx = expect_wfx;
wfx->wFormatTag = WAVE_FORMAT_IMA_ADPCM;
hr = IPin_QueryAccept(pin, pmt);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
*wfx = expect_wfx;
CoTaskMemFree(pmt->pbFormat);
CoTaskMemFree(pmt);
hr = IEnumMediaTypes_Next(enummt, 1, &pmt, NULL);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
IEnumMediaTypes_Release(enummt);
IPin_Release(pin);
IFilterGraph2_Release(graph);
ref = IBaseFilter_Release(filter);
ok(!ref, "Got outstanding refcount %d.\n", ref);
ok(!ref, "Got outstanding refcount %ld.\n", ref);
ret = DeleteFileW(filename);
ok(ret, "Failed to delete file, error %u.\n", GetLastError());
ok(ret, "Failed to delete file, error %lu.\n", GetLastError());
}
static void test_enum_media_types(void)
@ -667,29 +667,29 @@ static void test_enum_media_types(void)
IBaseFilter_FindPin(filter, L"input pin", &pin);
hr = IPin_EnumMediaTypes(pin, &enum1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumMediaTypes_Next(enum1, 1, mts, NULL);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
hr = IEnumMediaTypes_Next(enum1, 1, mts, &count);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(!count, "Got count %u.\n", count);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
ok(!count, "Got count %lu.\n", count);
hr = IEnumMediaTypes_Reset(enum1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumMediaTypes_Next(enum1, 1, mts, NULL);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
hr = IEnumMediaTypes_Clone(enum1, &enum2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
hr = IEnumMediaTypes_Next(enum2, 1, mts, NULL);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
IEnumMediaTypes_Release(enum1);
IEnumMediaTypes_Release(enum2);
@ -698,64 +698,64 @@ static void test_enum_media_types(void)
IBaseFilter_FindPin(filter, L"output", &pin);
hr = IPin_EnumMediaTypes(pin, &enum1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumMediaTypes_Next(enum1, 1, mts, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
CoTaskMemFree(mts[0]->pbFormat);
CoTaskMemFree(mts[0]);
hr = IEnumMediaTypes_Next(enum1, 1, mts, NULL);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
hr = IEnumMediaTypes_Reset(enum1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumMediaTypes_Next(enum1, 1, mts, &count);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(count == 1, "Got count %u.\n", count);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(count == 1, "Got count %lu.\n", count);
CoTaskMemFree(mts[0]->pbFormat);
CoTaskMemFree(mts[0]);
hr = IEnumMediaTypes_Next(enum1, 1, mts, &count);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(!count, "Got count %u.\n", count);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
ok(!count, "Got count %lu.\n", count);
hr = IEnumMediaTypes_Reset(enum1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumMediaTypes_Next(enum1, 2, mts, &count);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(count == 1, "Got count %u.\n", count);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
ok(count == 1, "Got count %lu.\n", count);
CoTaskMemFree(mts[0]->pbFormat);
CoTaskMemFree(mts[0]);
hr = IEnumMediaTypes_Reset(enum1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumMediaTypes_Clone(enum1, &enum2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 2);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
hr = IEnumMediaTypes_Reset(enum1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
hr = IEnumMediaTypes_Next(enum1, 1, mts, NULL);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
hr = IEnumMediaTypes_Next(enum2, 1, mts, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
CoTaskMemFree(mts[0]->pbFormat);
CoTaskMemFree(mts[0]);
@ -765,9 +765,9 @@ static void test_enum_media_types(void)
IFilterGraph2_Release(graph);
ref = IBaseFilter_Release(filter);
ok(!ref, "Got outstanding refcount %d.\n", ref);
ok(!ref, "Got outstanding refcount %ld.\n", ref);
ret = DeleteFileW(filename);
ok(ret, "Failed to delete file, error %u.\n", GetLastError());
ok(ret, "Failed to delete file, error %lu.\n", GetLastError());
}
static void test_unconnected_filter_state(void)
@ -778,53 +778,53 @@ static void test_unconnected_filter_state(void)
ULONG ref;
hr = IBaseFilter_GetState(filter, 0, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(state == State_Stopped, "Got state %u.\n", state);
hr = IBaseFilter_Pause(filter);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(state == State_Paused, "Got state %u.\n", state);
hr = IBaseFilter_Run(filter, 0);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(state == State_Running, "Got state %u.\n", state);
hr = IBaseFilter_Pause(filter);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(state == State_Paused, "Got state %u.\n", state);
hr = IBaseFilter_Stop(filter);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(state == State_Stopped, "Got state %u.\n", state);
hr = IBaseFilter_Run(filter, 0);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(state == State_Running, "Got state %u.\n", state);
hr = IBaseFilter_Stop(filter);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(state == State_Stopped, "Got state %u.\n", state);
ref = IBaseFilter_Release(filter);
ok(!ref, "Got outstanding refcount %d.\n", ref);
ok(!ref, "Got outstanding refcount %ld.\n", ref);
}
static void test_seeking(void)
@ -864,137 +864,137 @@ static void test_seeking(void)
IPin_QueryInterface(pin, &IID_IMediaSeeking, (void **)&seeking);
hr = IMediaSeeking_GetCapabilities(seeking, &caps);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
todo_wine ok(caps == (AM_SEEKING_CanSeekAbsolute | AM_SEEKING_CanSeekForwards
| AM_SEEKING_CanSeekBackwards | AM_SEEKING_CanGetStopPos
| AM_SEEKING_CanGetDuration | AM_SEEKING_CanDoSegments), "Got caps %#x.\n", caps);
| AM_SEEKING_CanGetDuration | AM_SEEKING_CanDoSegments), "Got caps %#lx.\n", caps);
caps = AM_SEEKING_CanSeekAbsolute | AM_SEEKING_CanSeekForwards;
hr = IMediaSeeking_CheckCapabilities(seeking, &caps);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(caps == (AM_SEEKING_CanSeekAbsolute | AM_SEEKING_CanSeekForwards), "Got caps %#x.\n", caps);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(caps == (AM_SEEKING_CanSeekAbsolute | AM_SEEKING_CanSeekForwards), "Got caps %#lx.\n", caps);
caps = AM_SEEKING_CanSeekAbsolute | AM_SEEKING_CanGetCurrentPos;
hr = IMediaSeeking_CheckCapabilities(seeking, &caps);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(caps == AM_SEEKING_CanSeekAbsolute, "Got caps %#x.\n", caps);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
ok(caps == AM_SEEKING_CanSeekAbsolute, "Got caps %#lx.\n", caps);
caps = AM_SEEKING_CanGetCurrentPos;
hr = IMediaSeeking_CheckCapabilities(seeking, &caps);
ok(hr == E_FAIL, "Got hr %#x.\n", hr);
ok(!caps, "Got caps %#x.\n", caps);
ok(hr == E_FAIL, "Got hr %#lx.\n", hr);
ok(!caps, "Got caps %#lx.\n", caps);
caps = 0;
hr = IMediaSeeking_CheckCapabilities(seeking, &caps);
ok(hr == E_FAIL, "Got hr %#x.\n", hr);
ok(!caps, "Got caps %#x.\n", caps);
ok(hr == E_FAIL, "Got hr %#lx.\n", hr);
ok(!caps, "Got caps %#lx.\n", caps);
for (i = 0; i < ARRAY_SIZE(format_tests); ++i)
{
hr = IMediaSeeking_IsFormatSupported(seeking, format_tests[i].guid);
todo_wine_if(i == 1) ok(hr == format_tests[i].hr, "Got hr %#x for format %s.\n",
todo_wine_if(i == 1) ok(hr == format_tests[i].hr, "Got hr %#lx for format %s.\n",
hr, wine_dbgstr_guid(format_tests[i].guid));
}
hr = IMediaSeeking_QueryPreferredFormat(seeking, &format);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(IsEqualGUID(&format, &TIME_FORMAT_MEDIA_TIME), "Got format %s.\n", wine_dbgstr_guid(&format));
hr = IMediaSeeking_GetTimeFormat(seeking, &format);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(IsEqualGUID(&format, &TIME_FORMAT_MEDIA_TIME), "Got format %s.\n", wine_dbgstr_guid(&format));
hr = IMediaSeeking_IsUsingTimeFormat(seeking, &TIME_FORMAT_MEDIA_TIME);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSeeking_IsUsingTimeFormat(seeking, &TIME_FORMAT_SAMPLE);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
hr = IMediaSeeking_SetTimeFormat(seeking, &TIME_FORMAT_FRAME);
ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
hr = IMediaSeeking_SetTimeFormat(seeking, &TIME_FORMAT_SAMPLE);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSeeking_GetTimeFormat(seeking, &format);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
todo_wine ok(IsEqualGUID(&format, &TIME_FORMAT_SAMPLE), "Got format %s.\n", wine_dbgstr_guid(&format));
hr = IMediaSeeking_IsUsingTimeFormat(seeking, &TIME_FORMAT_MEDIA_TIME);
todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr);
todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
hr = IMediaSeeking_IsUsingTimeFormat(seeking, &TIME_FORMAT_SAMPLE);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaSeeking_SetTimeFormat(seeking, &TIME_FORMAT_MEDIA_TIME);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
duration = 0xdeadbeef;
hr = IMediaSeeking_GetDuration(seeking, &duration);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(duration == 1000000, "Got duration %I64d.\n", duration);
stop = current = 0xdeadbeef;
hr = IMediaSeeking_GetStopPosition(seeking, &stop);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(stop == duration, "Expected time %s, got %s.\n",
wine_dbgstr_longlong(duration), wine_dbgstr_longlong(stop));
hr = IMediaSeeking_GetCurrentPosition(seeking, &current);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(!current, "Got time %s.\n", wine_dbgstr_longlong(current));
stop = current = 0xdeadbeef;
hr = IMediaSeeking_GetPositions(seeking, &current, &stop);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(!current, "Got time %s.\n", wine_dbgstr_longlong(current));
ok(stop == duration, "Expected time %s, got %s.\n",
wine_dbgstr_longlong(duration), wine_dbgstr_longlong(stop));
time = 0xdeadbeef;
hr = IMediaSeeking_ConvertTimeFormat(seeking, &time, &TIME_FORMAT_MEDIA_TIME, 0x123456789a, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(time == 0x123456789a, "Got time %s.\n", wine_dbgstr_longlong(time));
time = 0xdeadbeef;
hr = IMediaSeeking_ConvertTimeFormat(seeking, &time, NULL, 0x123456789a, &TIME_FORMAT_MEDIA_TIME);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(time == 0x123456789a, "Got time %s.\n", wine_dbgstr_longlong(time));
time = 0xdeadbeef;
hr = IMediaSeeking_ConvertTimeFormat(seeking, &time, NULL, 441, &TIME_FORMAT_SAMPLE);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr);
todo_wine ok(time == 100000, "Got time %s.\n", wine_dbgstr_longlong(time));
earliest = latest = 0xdeadbeef;
hr = IMediaSeeking_GetAvailable(seeking, &earliest, &latest);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(!earliest, "Got time %s.\n", wine_dbgstr_longlong(earliest));
ok(latest == duration, "Expected time %s, got %s.\n",
wine_dbgstr_longlong(duration), wine_dbgstr_longlong(latest));
rate = 0;
hr = IMediaSeeking_GetRate(seeking, &rate);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(rate == 1.0, "Got rate %.16e.\n", rate);
hr = IMediaSeeking_SetRate(seeking, 200.0);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr);
rate = 0;
hr = IMediaSeeking_GetRate(seeking, &rate);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
todo_wine ok(rate == 200.0, "Got rate %.16e.\n", rate);
hr = IMediaSeeking_SetRate(seeking, -1.0);
todo_wine ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
todo_wine ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
hr = IMediaSeeking_GetPreroll(seeking, &time);
todo_wine ok(hr == E_NOTIMPL, "Got hr %#x.\n", hr);
todo_wine ok(hr == E_NOTIMPL, "Got hr %#lx.\n", hr);
current = 200 * 10000;
stop = 400 * 10000;
hr = IMediaSeeking_SetPositions(seeking, &current, AM_SEEKING_AbsolutePositioning,
&stop, AM_SEEKING_AbsolutePositioning);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(current == 200 * 10000, "Got time %s.\n", wine_dbgstr_longlong(current));
ok(stop == 400 * 10000, "Got time %s.\n", wine_dbgstr_longlong(stop));
stop = current = 0xdeadbeef;
hr = IMediaSeeking_GetPositions(seeking, &current, &stop);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(current == 200 * 10000, "Got time %s.\n", wine_dbgstr_longlong(current));
ok(stop == 400 * 10000, "Got time %s.\n", wine_dbgstr_longlong(stop));
@ -1002,7 +1002,7 @@ static void test_seeking(void)
stop = 400 * 10000;
hr = IMediaSeeking_SetPositions(seeking, &current, AM_SEEKING_AbsolutePositioning | AM_SEEKING_ReturnTime,
&stop, AM_SEEKING_AbsolutePositioning | AM_SEEKING_ReturnTime);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(current == 200 * 10000, "Got time %s.\n", wine_dbgstr_longlong(current));
ok(stop == 400 * 10000, "Got time %s.\n", wine_dbgstr_longlong(stop));
@ -1010,18 +1010,18 @@ static void test_seeking(void)
stop = 200 * 10000;
hr = IMediaSeeking_SetPositions(seeking, &current, AM_SEEKING_AbsolutePositioning | AM_SEEKING_ReturnTime,
&stop, AM_SEEKING_AbsolutePositioning | AM_SEEKING_ReturnTime);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(current == 100 * 10000, "Got time %s.\n", wine_dbgstr_longlong(current));
ok(stop == 200 * 10000, "Got time %s.\n", wine_dbgstr_longlong(stop));
current = 50 * 10000;
hr = IMediaSeeking_SetPositions(seeking, &current, AM_SEEKING_AbsolutePositioning,
NULL, AM_SEEKING_NoPositioning);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
stop = current = 0xdeadbeef;
hr = IMediaSeeking_GetPositions(seeking, &current, &stop);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(current == 50 * 10000, "Got time %s.\n", wine_dbgstr_longlong(current));
ok(stop == 200 * 10000, "Got time %s.\n", wine_dbgstr_longlong(stop));
@ -1029,9 +1029,9 @@ static void test_seeking(void)
IPin_Release(pin);
IFilterGraph2_Release(graph);
ref = IBaseFilter_Release(filter);
ok(!ref, "Got outstanding refcount %d.\n", ref);
ok(!ref, "Got outstanding refcount %ld.\n", ref);
ret = DeleteFileW(filename);
ok(ret, "Failed to delete file, error %u.\n", GetLastError());
ok(ret, "Failed to delete file, error %lu.\n", GetLastError());
}
START_TEST(waveparser)