[QUARTZ_WINETEST]

* Sync with Wine 1.7.1.
CORE-7469

svn path=/trunk/; revision=60607
This commit is contained in:
Amine Khaldi 2013-10-11 13:13:45 +00:00
parent 95e46327ba
commit 5c90d5530c
11 changed files with 593 additions and 416 deletions

View file

@ -1,8 +1,4 @@
add_definitions(
-D__ROS_LONG64__
-D_DLL -D__USE_CRTIMP)
list(APPEND SOURCE
avisplitter.c
dsoundrender.c
@ -15,7 +11,8 @@ list(APPEND SOURCE
testlist.c)
add_executable(quartz_winetest ${SOURCE})
target_link_libraries(quartz_winetest wine uuid)
target_link_libraries(quartz_winetest uuid)
add_dependencies(quartz_winetest quartz_idlheader)
set_module_type(quartz_winetest win32cui)
add_importlibs(quartz_winetest ole32 oleaut32 advapi32 msvcrt kernel32 ntdll)
add_cd_file(TARGET quartz_winetest DESTINATION reactos/bin FOR all)

View file

@ -89,29 +89,23 @@ static void test_query_interface(void)
ULONG ref;
IUnknown *iface= NULL;
hr = IUnknown_QueryInterface(pAviSplitter, &IID_IBaseFilter,
(void**)&iface);
#define TEST_INTERFACE(riid,expected) do { \
hr = IUnknown_QueryInterface(pAviSplitter, &riid, (void**)&iface); \
ok( hr == expected, #riid" should %s got %08X\n", expected==S_OK ? "exist" : "not be present", GetLastError() ); \
if (hr == S_OK) { \
ref = IUnknown_Release(iface); \
ok(ref == 1, "Reference is %u, expected 1\n", ref); \
} \
iface = NULL; \
} while(0)
ok(hr == S_OK,
"IID_IBaseFilter should exist, got %08x!\n", GetLastError());
if (hr == S_OK)
{
ref = IUnknown_Release(iface);
iface = NULL;
ok(ref == 1, "Reference is %u, expected 1\n", ref);
}
hr = IUnknown_QueryInterface(pAviSplitter, &IID_IMediaSeeking,
(void**)&iface);
if (hr == S_OK)
ref = IUnknown_Release(iface);
iface = NULL;
todo_wine ok(hr == E_NOINTERFACE,
"Query for IMediaSeeking returned: %08x\n", hr);
/* These interfaces should not be present:
IID_IKsPropertySet, IID_IMediaPosition, IID_IQualityControl, IID_IQualProp
*/
TEST_INTERFACE(IID_IBaseFilter,S_OK);
TEST_INTERFACE(IID_IMediaSeeking,E_NOINTERFACE);
TEST_INTERFACE(IID_IKsPropertySet,E_NOINTERFACE);
TEST_INTERFACE(IID_IMediaPosition,E_NOINTERFACE);
TEST_INTERFACE(IID_IQualityControl,E_NOINTERFACE);
TEST_INTERFACE(IID_IQualProp,E_NOINTERFACE);
#undef TEST_INTERFACE
}
static void test_pin(IPin *pin)
@ -179,10 +173,10 @@ static const WCHAR wfile[] = {'t','e','s','t','.','a','v','i',0};
static const char afile[] = "test.avi";
/* This test doesn't use the quartz filtergraph because it makes it impossible
* to be certain that a thread is really one owned by the avi splitter
* A lot of the decoder filters will also have their own thread, and windows'
* to be certain that a thread is really one owned by the avi splitter.
* A lot of the decoder filters will also have their own thread, and Windows'
* filtergraph has a separate thread for start/stop/seeking requests.
* By avoiding the filtergraph all together and connecting streams directly to
* By avoiding the filtergraph altogether and connecting streams directly to
* the null renderer I am sure that this is not the case here.
*/
static void test_threads(void)
@ -206,7 +200,7 @@ static void test_threads(void)
return;
}
/* Before doing anything (number of threads at the start differs per OS) */
/* Before doing anything (the thread count at the start differs per OS) */
baselevel = count_threads();
file = CreateFileW(wfile, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE,
@ -233,7 +227,7 @@ static void test_threads(void)
ok(hr == E_NOINTERFACE,
"Avi splitter returns unexpected error: %08x\n", hr);
if (pfile)
IUnknown_Release(pfile);
IFileSourceFilter_Release(pfile);
pfile = NULL;
hr = CoCreateInstance(&CLSID_AsyncReader, NULL, CLSCTX_INPROC_SERVER,
@ -242,7 +236,7 @@ static void test_threads(void)
if (hr != S_OK)
goto fail;
hr = IUnknown_QueryInterface(preader, &IID_IFileSourceFilter,
hr = IBaseFilter_QueryInterface(preader, &IID_IFileSourceFilter,
(void**)&pfile);
ok(hr == S_OK, "Could not get IFileSourceFilter: %08x\n", hr);
if (hr != S_OK)
@ -271,7 +265,7 @@ static void test_threads(void)
if (hr != S_OK)
goto fail;
IUnknown_Release(enumpins);
IEnumPins_Release(enumpins);
enumpins = NULL;
hr = IBaseFilter_EnumPins(pavi, &enumpins);
@ -286,7 +280,7 @@ static void test_threads(void)
curlevel = count_threads();
ok(curlevel == baselevel,
"Amount of threads should be %d not %d\n", baselevel, curlevel);
"The thread count should be %d not %d\n", baselevel, curlevel);
hr = IPin_Connect(filepin, avipin, NULL);
ok(hr == S_OK, "Could not connect: %08x\n", hr);
@ -296,9 +290,9 @@ static void test_threads(void)
expected = 1 + baselevel;
curlevel = count_threads();
ok(curlevel == expected,
"Amount of threads should be %d not %d\n", expected, curlevel);
"The thread count should be %d not %d\n", expected, curlevel);
IUnknown_Release(avipin);
IPin_Release(avipin);
avipin = NULL;
IEnumPins_Reset(enumpins);
@ -309,7 +303,6 @@ static void test_threads(void)
*/
while (IEnumPins_Next(enumpins, 1, &avipin, NULL) == S_OK)
{
ok(hr == S_OK, "hr: %08x\n", hr);
IPin_QueryDirection(avipin, &dir);
if (dir == PINDIR_OUTPUT)
{
@ -341,18 +334,18 @@ static void test_threads(void)
++expected;
}
IUnknown_Release(avipin);
IPin_Release(avipin);
avipin = NULL;
}
if (avipin)
IUnknown_Release(avipin);
IPin_Release(avipin);
avipin = NULL;
if (hr != S_OK)
goto fail2;
/* At this point there is a minimalistic connected avi splitter that can
* Be used for all sorts of source filter tests, however that still needs
* be used for all sorts of source filter tests. However that still needs
* to be written at a later time.
*
* Interesting tests:
@ -372,7 +365,7 @@ static void test_threads(void)
curlevel = count_threads();
ok(curlevel == expected,
"Amount of threads should be %d not %d\n", expected, curlevel);
"The thread count should be %d not %d\n", expected, curlevel);
IBaseFilter_Pause(pavi);
IBaseFilter_Pause(preader);
@ -421,10 +414,10 @@ fail:
if (hr != S_OK)
skip("Prerequisites not matched, skipping remainder of test\n");
if (enumpins)
IUnknown_Release(enumpins);
IEnumPins_Release(enumpins);
if (avipin)
IUnknown_Release(avipin);
IPin_Release(avipin);
if (filepin)
{
IPin *to = NULL;
@ -435,20 +428,20 @@ fail:
IPin_Disconnect(filepin);
IPin_Disconnect(to);
}
IUnknown_Release(filepin);
IPin_Release(filepin);
}
if (preader)
IUnknown_Release(preader);
IBaseFilter_Release(preader);
if (pavi)
IUnknown_Release(pavi);
IBaseFilter_Release(pavi);
if (pfile)
IUnknown_Release(pfile);
IFileSourceFilter_Release(pfile);
curlevel = count_threads();
todo_wine
ok(curlevel == baselevel,
"Amount of threads should be %d not %d\n", baselevel, curlevel);
"The thread count should be %d not %d\n", baselevel, curlevel);
}
START_TEST(avisplitter)

View file

@ -33,7 +33,7 @@
ok(ppv != NULL, "Pointer is NULL\n");
#define RELEASE_EXPECT(iface, num) if (iface) { \
hr = IUnknown_Release(iface); \
hr = IUnknown_Release((IUnknown*)iface); \
ok(hr == num, "IUnknown_Release should return %d, got %d\n", num, hr); \
}
@ -148,11 +148,11 @@ static void test_query_interface(void)
ok(hr == S_OK, "Couldn't load default device: %08x\n", hr);
}
RELEASE_EXPECT(ppb, 1);
}
QI_SUCCEED(pDSRender, IID_IMediaPosition, pMediaPosition);
RELEASE_EXPECT(pMediaPosition, 1);
QI_SUCCEED(pDSRender, IID_IQualityControl, pQualityControl);
RELEASE_EXPECT(pQualityControl, 1);
}
}
static void test_pin(IPin *pin)
@ -221,11 +221,11 @@ static void test_basefilter(void)
START_TEST(dsoundrender)
{
if(!winetest_interactive)
{
skip("Skipping dsoundrender test, see ROSTESTS_116\n");
return;
}
if (!winetest_interactive)
{
skip("Skipping dsoundrender test, see ROSTESTS-116\n");
return;
}
CoInitialize(NULL);
if (!create_dsound_renderer())
return;

View file

@ -0,0 +1,50 @@
/*
* Copyright (C) 2009 Vitaliy Margolen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
import "objidl.idl";
import "strmif.idl";
import "unknwn.idl";
/*****************************************************************************
* IAMFilterData interface
*
* Notes:
* - This interface is deprecated and IFilterMapper2 should be used instead.
* - There is no full replacement for IAMFilterData::ParseFilterData short of manually
* parsing out the REGFILTER2 struct from the binary blob.
*/
[
object,
uuid(97f7c4d4-547b-4a5f-8332-536430ad2e4d),
pointer_default(unique)
]
interface IAMFilterData : IUnknown
{
typedef [unique] IAMFilterData *LPIAMFILTERDATA;
HRESULT ParseFilterData(
[in] BYTE * rgbFilterData,
[in] ULONG cb,
[out] BYTE ** prgbRegFilter2);
HRESULT CreateFilterData(
[in] REGFILTER2 * prf2,
[out] BYTE ** prgbFilterData,
[out] ULONG * pcb);
}

File diff suppressed because it is too large Load diff

View file

@ -24,6 +24,9 @@
#include "winbase.h"
#include "initguid.h"
#include "dshow.h"
#include "winternl.h"
#include "fil_data.h"
DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
@ -101,8 +104,8 @@ static void test_fm2_enummatchingfilters(void)
/* Test that a test renderer filter is returned when enumerating filters with bRender=FALSE */
rgf2.dwVersion = 2;
rgf2.dwMerit = MERIT_UNLIKELY;
S1(U(rgf2)).cPins2 = 1;
S1(U(rgf2)).rgPins2 = rgPins2;
S2(U(rgf2)).cPins2 = 1;
S2(U(rgf2)).rgPins2 = rgPins2;
rgPins2[0].dwFlags = REG_PINFLAG_B_RENDERER;
rgPins2[0].cInstances = 1;
@ -117,58 +120,63 @@ static void test_fm2_enummatchingfilters(void)
hr = IFilterMapper2_RegisterFilter(pMapper, &clsidFilter1, wszFilterName1, NULL,
&CLSID_LegacyAmFilterCategory, NULL, &rgf2);
ok(hr == S_OK, "IFilterMapper2_RegisterFilter failed with %x\n", hr);
if (hr == E_ACCESSDENIED)
skip("Not authorized to register filters\n");
else
{
ok(hr == S_OK, "IFilterMapper2_RegisterFilter failed with %x\n", hr);
rgPins2[0].dwFlags = 0;
rgPins2[0].dwFlags = 0;
rgPins2[1].dwFlags = REG_PINFLAG_B_OUTPUT;
rgPins2[1].cInstances = 1;
rgPins2[1].nMediaTypes = 1;
rgPins2[1].lpMediaType = &rgPinType;
rgPins2[1].nMediums = 0;
rgPins2[1].lpMedium = NULL;
rgPins2[1].clsPinCategory = NULL;
rgPins2[1].dwFlags = REG_PINFLAG_B_OUTPUT;
rgPins2[1].cInstances = 1;
rgPins2[1].nMediaTypes = 1;
rgPins2[1].lpMediaType = &rgPinType;
rgPins2[1].nMediums = 0;
rgPins2[1].lpMedium = NULL;
rgPins2[1].clsPinCategory = NULL;
S1(U(rgf2)).cPins2 = 2;
S2(U(rgf2)).cPins2 = 2;
hr = IFilterMapper2_RegisterFilter(pMapper, &clsidFilter2, wszFilterName2, NULL,
hr = IFilterMapper2_RegisterFilter(pMapper, &clsidFilter2, wszFilterName2, NULL,
&CLSID_LegacyAmFilterCategory, NULL, &rgf2);
ok(hr == S_OK, "IFilterMapper2_RegisterFilter failed with %x\n", hr);
ok(hr == S_OK, "IFilterMapper2_RegisterFilter failed with %x\n", hr);
hr = IFilterMapper2_EnumMatchingFilters(pMapper, &pEnum, 0, TRUE, MERIT_UNLIKELY, TRUE,
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);
if (SUCCEEDED(hr) && pEnum)
{
found = enum_find_filter(wszFilterName1, pEnum);
ok(found, "EnumMatchingFilters failed to return the test filter 1\n");
}
ok(hr == S_OK, "IFilterMapper2_EnumMatchingFilters failed with %x\n", hr);
if (SUCCEEDED(hr) && pEnum)
{
found = enum_find_filter(wszFilterName1, pEnum);
ok(found, "EnumMatchingFilters failed to return the test filter 1\n");
}
if (pEnum) IEnumMoniker_Release(pEnum);
pEnum = NULL;
if (pEnum) IEnumMoniker_Release(pEnum);
pEnum = NULL;
hr = IFilterMapper2_EnumMatchingFilters(pMapper, &pEnum, 0, TRUE, MERIT_UNLIKELY, TRUE,
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);
if (SUCCEEDED(hr) && pEnum)
{
found = enum_find_filter(wszFilterName2, pEnum);
ok(found, "EnumMatchingFilters failed to return the test filter 2\n");
}
ok(hr == S_OK, "IFilterMapper2_EnumMatchingFilters failed with %x\n", hr);
if (SUCCEEDED(hr) && pEnum)
{
found = enum_find_filter(wszFilterName2, pEnum);
ok(found, "EnumMatchingFilters failed to return the test filter 2\n");
}
if (pEnum) IEnumMoniker_Release(pEnum);
pEnum = NULL;
if (pEnum) IEnumMoniker_Release(pEnum);
pEnum = NULL;
/* Non renderer must not be returned with bRender=TRUE */
/* Non renderer must not be returned with bRender=TRUE */
hr = IFilterMapper2_EnumMatchingFilters(pMapper, &pEnum, 0, TRUE, MERIT_UNLIKELY, TRUE,
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, "IFilterMapper2_EnumMatchingFilters failed with %x\n", hr);
if (SUCCEEDED(hr) && pEnum)
{
found = enum_find_filter(wszFilterName1, pEnum);
ok(found, "EnumMatchingFilters failed to return the test filter 1\n");
if (SUCCEEDED(hr) && pEnum)
{
found = enum_find_filter(wszFilterName1, pEnum);
ok(found, "EnumMatchingFilters failed to return the test filter 1\n");
}
}
if (pEnum) IEnumMoniker_Release(pEnum);
@ -245,67 +253,72 @@ static void test_legacy_filter_registration(void)
/* Register---- functions need a filter class key to write pin and pin media type data to. Create a bogus
* class key for it. */
lRet = RegCreateKeyExA(HKEY_CLASSES_ROOT, szRegKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL);
ok(lRet == ERROR_SUCCESS, "RegCreateKeyExA failed with %x\n", HRESULT_FROM_WIN32(lRet));
if (lRet == ERROR_ACCESS_DENIED)
skip("Not authorized to register filters\n");
else
{
ok(lRet == ERROR_SUCCESS, "RegCreateKeyExA failed with %x\n", HRESULT_FROM_WIN32(lRet));
/* Set default value - this is interpreted as "friendly name" later. */
lRet = RegSetValueExA(hKey, NULL, 0, REG_SZ, (LPBYTE)szFilterName, lstrlenA(szFilterName) + 1);
ok(lRet == ERROR_SUCCESS, "RegSetValueExA failed with %x\n", HRESULT_FROM_WIN32(lRet));
/* Set default value - this is interpreted as "friendly name" later. */
lRet = RegSetValueExA(hKey, NULL, 0, REG_SZ, (LPBYTE)szFilterName, lstrlenA(szFilterName) + 1);
ok(lRet == ERROR_SUCCESS, "RegSetValueExA failed with %x\n", HRESULT_FROM_WIN32(lRet));
if (hKey) RegCloseKey(hKey);
hKey = NULL;
if (hKey) RegCloseKey(hKey);
hKey = NULL;
hr = IFilterMapper_RegisterFilter(pMapper, clsidFilter, wszFilterName, MERIT_UNLIKELY);
ok(hr == S_OK, "IFilterMapper_RegisterFilter failed with %x\n", hr);
hr = IFilterMapper_RegisterFilter(pMapper, clsidFilter, wszFilterName, MERIT_UNLIKELY);
ok(hr == S_OK, "IFilterMapper_RegisterFilter failed with %x\n", hr);
hr = IFilterMapper_RegisterPin(pMapper, clsidFilter, wszPinName, TRUE, FALSE, FALSE, FALSE, GUID_NULL, NULL);
ok(hr == S_OK, "IFilterMapper_RegisterPin failed with %x\n", hr);
hr = IFilterMapper_RegisterPin(pMapper, clsidFilter, wszPinName, TRUE, FALSE, FALSE, FALSE, GUID_NULL, NULL);
ok(hr == S_OK, "IFilterMapper_RegisterPin failed with %x\n", hr);
hr = IFilterMapper_RegisterPinType(pMapper, clsidFilter, wszPinName, GUID_NULL, GUID_NULL);
ok(hr == S_OK, "IFilterMapper_RegisterPinType failed with %x\n", hr);
hr = IFilterMapper_RegisterPinType(pMapper, clsidFilter, wszPinName, GUID_NULL, GUID_NULL);
ok(hr == S_OK, "IFilterMapper_RegisterPinType failed with %x\n", hr);
hr = IFilterMapper2_EnumMatchingFilters(pMapper2, &pEnum, 0, TRUE, MERIT_UNLIKELY, TRUE,
hr = IFilterMapper2_EnumMatchingFilters(pMapper2, &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);
if (SUCCEEDED(hr) && pEnum)
{
found = enum_find_filter(wszFilterName, pEnum);
ok(found, "IFilterMapper2_EnumMatchingFilters failed to return the test filter\n");
}
if (pEnum) IEnumMoniker_Release(pEnum);
pEnum = NULL;
found = FALSE;
hr = IFilterMapper_EnumMatchingFilters(pMapper, &pRegEnum, MERIT_UNLIKELY, TRUE, GUID_NULL, GUID_NULL,
FALSE, FALSE, GUID_NULL, GUID_NULL);
ok(hr == S_OK, "IFilterMapper_EnumMatchingFilters failed with %x\n", hr);
if (SUCCEEDED(hr) && pRegEnum)
{
ULONG cFetched;
REGFILTER *prgf;
while(!found && IEnumRegFilters_Next(pRegEnum, 1, &prgf, &cFetched) == S_OK)
ok(hr == S_OK, "IFilterMapper2_EnumMatchingFilters failed with %x\n", hr);
if (SUCCEEDED(hr) && pEnum)
{
CHAR val[512];
WideCharToMultiByte(CP_ACP, 0, prgf->Name, -1, val, sizeof(val), 0, 0);
if (!lstrcmpA(val, szFilterName)) found = TRUE;
CoTaskMemFree(prgf);
found = enum_find_filter(wszFilterName, pEnum);
ok(found, "IFilterMapper2_EnumMatchingFilters failed to return the test filter\n");
}
IEnumRegFilters_Release(pRegEnum);
if (pEnum) IEnumMoniker_Release(pEnum);
pEnum = NULL;
found = FALSE;
hr = IFilterMapper_EnumMatchingFilters(pMapper, &pRegEnum, MERIT_UNLIKELY, TRUE, GUID_NULL, GUID_NULL,
FALSE, FALSE, GUID_NULL, GUID_NULL);
ok(hr == S_OK, "IFilterMapper_EnumMatchingFilters failed with %x\n", hr);
if (SUCCEEDED(hr) && pRegEnum)
{
ULONG cFetched;
REGFILTER *prgf;
while(!found && IEnumRegFilters_Next(pRegEnum, 1, &prgf, &cFetched) == S_OK)
{
CHAR val[512];
WideCharToMultiByte(CP_ACP, 0, prgf->Name, -1, val, sizeof(val), 0, 0);
if (!lstrcmpA(val, szFilterName)) found = TRUE;
CoTaskMemFree(prgf);
}
IEnumRegFilters_Release(pRegEnum);
}
ok(found, "IFilterMapper_EnumMatchingFilters failed to return the test filter\n");
hr = IFilterMapper_UnregisterFilter(pMapper, clsidFilter);
ok(hr == S_OK, "FilterMapper_UnregisterFilter failed with %x\n", hr);
lRet = RegOpenKeyExA(HKEY_CLASSES_ROOT, szClsid, 0, KEY_WRITE | DELETE, &hKey);
ok(lRet == ERROR_SUCCESS, "RegOpenKeyExA failed with %x\n", HRESULT_FROM_WIN32(lRet));
lRet = RegDeleteKeyA(hKey, szGuidstring);
ok(lRet == ERROR_SUCCESS, "RegDeleteKeyA failed with %x\n", HRESULT_FROM_WIN32(lRet));
}
ok(found, "IFilterMapper_EnumMatchingFilters failed to return the test filter\n");
hr = IFilterMapper_UnregisterFilter(pMapper, clsidFilter);
ok(hr == S_OK, "FilterMapper_UnregisterFilter failed with %x\n", hr);
lRet = RegOpenKeyExA(HKEY_CLASSES_ROOT, szClsid, 0, KEY_WRITE | DELETE, &hKey);
ok(lRet == ERROR_SUCCESS, "RegOpenKeyExA failed with %x\n", HRESULT_FROM_WIN32(lRet));
lRet = RegDeleteKeyA(hKey, szGuidstring);
ok(lRet == ERROR_SUCCESS, "RegDeleteKeyA failed with %x\n", HRESULT_FROM_WIN32(lRet));
if (hKey) RegCloseKey(hKey);
hKey = NULL;
@ -405,8 +418,8 @@ static void test_register_filter_with_null_clsMinorType(void)
ZeroMemory(&rgf2, sizeof(rgf2));
rgf2.dwVersion = 1;
rgf2.dwMerit = MERIT_UNLIKELY;
S(U(rgf2)).cPins = 1;
S(U(rgf2)).rgPins = &rgPins;
S1(U(rgf2)).cPins = 1;
S1(U(rgf2)).rgPins = &rgPins;
rgPins.strName = wszPinName;
rgPins.bRendered = 1;
@ -420,6 +433,11 @@ static void test_register_filter_with_null_clsMinorType(void)
hr = IFilterMapper2_RegisterFilter(pMapper, &clsidFilter1, wszFilterName1, NULL,
&CLSID_LegacyAmFilterCategory, NULL, &rgf2);
if (hr == E_ACCESSDENIED)
{
skip("Not authorized to register filters\n");
goto out;
}
ok(hr == S_OK, "IFilterMapper2_RegisterFilter failed with %x\n", hr);
hr = IFilterMapper2_UnregisterFilter(pMapper, &CLSID_LegacyAmFilterCategory, NULL, &clsidFilter1);
@ -429,8 +447,8 @@ static void test_register_filter_with_null_clsMinorType(void)
ZeroMemory(&rgf2, sizeof(rgf2));
rgf2.dwVersion = 2;
rgf2.dwMerit = MERIT_UNLIKELY;
S1(U(rgf2)).cPins2 = 1;
S1(U(rgf2)).rgPins2 = &rgPins2;
S2(U(rgf2)).cPins2 = 1;
S2(U(rgf2)).rgPins2 = &rgPins2;
rgPins2.dwFlags = REG_PINFLAG_B_RENDERER;
rgPins2.cInstances = 1;
@ -452,6 +470,70 @@ static void test_register_filter_with_null_clsMinorType(void)
if (pMapper) IFilterMapper2_Release(pMapper);
}
static void test_parse_filter_data(void)
{
static const BYTE data_block[] = {
0x02,0x00,0x00,0x00,0xff,0xff,0x5f,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x70,0x69,0x33,
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x30,0x74,0x79,0x33,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x31,0x70,0x69,0x33,
0x08,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x30,0x74,0x79,0x33,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x76,0x69,0x64,0x73,
0x00,0x00,0x10,0x00,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
BYTE *prgbRegFilter2 = NULL;
REGFILTER2 *pRegFilter = NULL;
IFilterMapper2 *pMapper = NULL;
SAFEARRAYBOUND saBound;
SAFEARRAY *psa = NULL;
LPBYTE pbSAData = NULL;
HRESULT hr;
IAMFilterData *pData = NULL;
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);
if (FAILED(hr)) goto out;
hr = IFilterMapper2_QueryInterface(pMapper, &IID_IAMFilterData, (LPVOID*)&pData);
ok((hr == S_OK || broken(hr != S_OK)), "Unable to find IID_IAMFilterData interface\n");
if (FAILED(hr)) goto out;
saBound.lLbound = 0;
saBound.cElements = sizeof(data_block);
psa = SafeArrayCreate(VT_UI1, 1, &saBound);
ok(psa != NULL, "Unable to crate safe array\n");
if (!psa) goto out;
hr = SafeArrayAccessData(psa, (LPVOID *)&pbSAData);
ok(hr == S_OK, "Unable to access array data\n");
if (FAILED(hr)) goto out;
memcpy(pbSAData, data_block, sizeof(data_block));
hr = IAMFilterData_ParseFilterData(pData, pbSAData, sizeof(data_block), &prgbRegFilter2);
/* We cannot do anything here. prgbRegFilter2 is very unstable */
/* Pre Vista, this is a stack pointer so anything that changes the stack invalidats it */
/* Post Vista, it is a static pointer in the data section of the module */
pRegFilter =((REGFILTER2**)prgbRegFilter2)[0];
ok (hr==S_OK,"Failed to Parse filter Data\n");
ok(IsBadReadPtr(prgbRegFilter2,sizeof(REGFILTER2*))==0,"Bad read pointer returned\n");
ok(IsBadReadPtr(pRegFilter,sizeof(REGFILTER2))==0,"Bad read pointer for FilterData\n");
ok(pRegFilter->dwMerit == 0x5fffff,"Incorrect merit returned\n");
out:
if (pRegFilter)
CoTaskMemFree(pRegFilter);
if (psa)
{
SafeArrayUnaccessData(psa);
SafeArrayDestroy(psa);
}
if (pData)
IAMFilterData_Release(pData);
if (pMapper)
IFilterMapper2_Release(pMapper);
}
START_TEST(filtermapper)
{
@ -461,6 +543,7 @@ START_TEST(filtermapper)
test_legacy_filter_registration();
test_ifiltermapper_from_filtergraph();
test_register_filter_with_null_clsMinorType();
test_parse_filter_data();
CoUninitialize();
}

View file

@ -18,8 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <assert.h>
#define COBJMACROS
#include "wine/test.h"
@ -71,9 +69,9 @@ static void CommitDecommitTest(void)
hr = IMemAllocator_GetBuffer(pMemAllocator, &sample2, NULL, NULL, 0);
ok(hr==S_OK, "Could not get a buffer: %x\n", hr);
IUnknown_Release(sample);
IMediaSample_Release(sample);
if (sample2)
IUnknown_Release(sample2);
IMediaSample_Release(sample2);
hr = IMemAllocator_Decommit(pMemAllocator);
ok(hr==S_OK, "Cecommit returned: %x\n", hr);

View file

@ -69,6 +69,11 @@ static void test_aggregation(const CLSID clsidOuter, const CLSID clsidInner,
/* for aggregation, we should only be able to request IUnknown */
hr = CoCreateInstance(&clsidInner, pUnkOuter, CLSCTX_INPROC_SERVER,
&iidInner, (LPVOID*)&pUnkInnerFail);
if (hr == REGDB_E_CLASSNOTREG)
{
skip("Class not registered\n");
return;
}
ok(hr == E_NOINTERFACE, "CoCreateInstance returned %x\n", hr);
ok(pUnkInnerFail == NULL, "pUnkInnerFail is not NULL\n");
@ -157,6 +162,19 @@ static void test_aggregation(const CLSID clsidOuter, const CLSID clsidInner,
} while (refCount);
}
static void test_null_renderer_aggregations(void)
{
const IID * iids[] = {
&IID_IMediaFilter, &IID_IBaseFilter
};
int i;
for (i = 0; i < sizeof(iids) / sizeof(iids[0]); i++)
{
test_aggregation(CLSID_SystemClock, CLSID_NullRenderer, IID_IReferenceClock, *iids[i]);
}
}
static void test_video_renderer_aggregations(void)
{
const IID * iids[] = {
@ -206,15 +224,17 @@ START_TEST(misc)
{
CoInitialize(NULL);
if(!winetest_interactive)
{
skip("Skipping misc test, see ROSTESTS_116\n");
return;
}
else{
test_video_renderer_aggregations();
test_filter_graph_aggregations();
test_filter_mapper_aggregations();
}
if (!winetest_interactive)
{
skip("Skipping misc test, see ROSTESTS-116\n");
return;
}
else
{
test_null_renderer_aggregations();
test_video_renderer_aggregations();
test_filter_graph_aggregations();
test_filter_mapper_aggregations();
}
CoUninitialize();
}

View file

@ -18,8 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <assert.h>
#define COBJMACROS
#include "wine/test.h"

View file

@ -1,10 +1,7 @@
/* Automatically generated file; DO NOT EDIT!! */
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#define STANDALONE
#include "wine/test.h"
#include <wine/test.h>
extern void func_avisplitter(void);
extern void func_dsoundrender(void);

View file

@ -28,7 +28,7 @@
ok(ppv != NULL, "Pointer is NULL\n");
#define RELEASE_EXPECT(iface, num) if (iface) { \
hr = IUnknown_Release(iface); \
hr = IUnknown_Release((IUnknown*)iface); \
ok(hr == num, "IUnknown_Release should return %d, got %d\n", num, hr); \
}
@ -70,18 +70,18 @@ static void test_query_interface(void)
RELEASE_EXPECT(pBasicVideo, 1);
QI_SUCCEED(pVideoRenderer, IID_IMediaSeeking, pMediaSeeking);
RELEASE_EXPECT(pMediaSeeking, 1);
QI_SUCCEED(pVideoRenderer, IID_IQualityControl, pQualityControl);
RELEASE_EXPECT(pQualityControl, 1);
todo_wine {
QI_SUCCEED(pVideoRenderer, IID_IDirectDrawVideo, pDirectDrawVideo);
RELEASE_EXPECT(pDirectDrawVideo, 1);
QI_SUCCEED(pVideoRenderer, IID_IKsPropertySet, pKsPropertySet);
RELEASE_EXPECT(pKsPropertySet, 1);
QI_SUCCEED(pVideoRenderer, IID_IMediaPosition, pMediaPosition);
RELEASE_EXPECT(pMediaPosition, 1);
QI_SUCCEED(pVideoRenderer, IID_IQualityControl, pQualityControl);
RELEASE_EXPECT(pQualityControl, 1);
QI_SUCCEED(pVideoRenderer, IID_IQualProp, pQualProp);
RELEASE_EXPECT(pQualProp, 1);
}
QI_SUCCEED(pVideoRenderer, IID_IMediaPosition, pMediaPosition);
RELEASE_EXPECT(pMediaPosition, 1);
QI_SUCCEED(pVideoRenderer, IID_IVideoWindow, pVideoWindow);
RELEASE_EXPECT(pVideoWindow, 1);
}
@ -156,15 +156,16 @@ START_TEST(videorenderer)
if (!create_video_renderer())
return;
if(!winetest_interactive)
{
skip("Skipping filtergraph test, see ROSTESTS_116\n");
return;
}
else{
test_query_interface();
test_basefilter();
}
if (!winetest_interactive)
{
skip("Skipping filtergraph test, see ROSTESTS-116\n");
return;
}
else
{
test_query_interface();
test_basefilter();
}
release_video_renderer();
CoUninitialize();