ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
October 2013
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
14 participants
325 discussions
Start a n
N
ew thread
[akhaldi] 60501: [DXDIAGN_WINETEST] * Import from Wine 1.7.1. CORE-7469
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Oct 1 17:49:24 2013 New Revision: 60501 URL:
http://svn.reactos.org/svn/reactos?rev=60501&view=rev
Log: [DXDIAGN_WINETEST] * Import from Wine 1.7.1. CORE-7469 Added: trunk/rostests/winetests/dxdiagn/ trunk/rostests/winetests/dxdiagn/CMakeLists.txt (with props) trunk/rostests/winetests/dxdiagn/container.c (with props) trunk/rostests/winetests/dxdiagn/provider.c (with props) trunk/rostests/winetests/dxdiagn/testlist.c (with props) Modified: trunk/rostests/winetests/CMakeLists.txt Modified: trunk/rostests/winetests/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/CMakeLists.txt?…
============================================================================== --- trunk/rostests/winetests/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/winetests/CMakeLists.txt [iso-8859-1] Tue Oct 1 17:49:24 2013 @@ -22,6 +22,7 @@ add_subdirectory(dnsapi) add_subdirectory(dplayx) add_subdirectory(dsound) +add_subdirectory(dxdiagn) add_subdirectory(faultrep) add_subdirectory(fusion) add_subdirectory(gdi32) Added: trunk/rostests/winetests/dxdiagn/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/dxdiagn/CMakeLi…
============================================================================== --- trunk/rostests/winetests/dxdiagn/CMakeLists.txt (added) +++ trunk/rostests/winetests/dxdiagn/CMakeLists.txt [iso-8859-1] Tue Oct 1 17:49:24 2013 @@ -0,0 +1,10 @@ + +list(APPEND SOURCE + container.c + provider + testlist.c) + +add_executable(dxdiagn_winetest ${SOURCE}) +set_module_type(dxdiagn_winetest win32cui) +add_importlibs(dxdiagn_winetest oleaut32 ole32 msvcrt kernel32) +add_cd_file(TARGET dxdiagn_winetest DESTINATION reactos/bin FOR all) Propchange: trunk/rostests/winetests/dxdiagn/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/winetests/dxdiagn/container.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/dxdiagn/contain…
============================================================================== --- trunk/rostests/winetests/dxdiagn/container.c (added) +++ trunk/rostests/winetests/dxdiagn/container.c [iso-8859-1] Tue Oct 1 17:49:24 2013 @@ -0,0 +1,1030 @@ +/* + * Unit tests for IDxDiagContainer + * + * Copyright 2010 Andrew Nguyen + * + * 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 + */ + +#define COBJMACROS + +#include <stdio.h> +#include <wine/dxdiag.h> +#include <oleauto.h> +#include <wine/test.h> + +struct property_test +{ + const WCHAR *prop; + VARTYPE vt; +}; + +static IDxDiagProvider *pddp; +static IDxDiagContainer *pddc; + +static const WCHAR DxDiag_SystemInfo[] = {'D','x','D','i','a','g','_','S','y','s','t','e','m','I','n','f','o',0}; +static const WCHAR DxDiag_DisplayDevices[] = {'D','x','D','i','a','g','_','D','i','s','p','l','a','y','D','e','v','i','c','e','s',0}; + +/* Based on debugstr_variant in dlls/jscript/jsutils.c. */ +static const char *debugstr_variant(const VARIANT *var) +{ + static char buf[400]; + + if (!var) + return "(null)"; + + switch (V_VT(var)) + { + case VT_EMPTY: + return "{VT_EMPTY}"; + case VT_BSTR: + sprintf(buf, "{VT_BSTR: %s}", wine_dbgstr_w(V_BSTR(var))); + break; + case VT_BOOL: + sprintf(buf, "{VT_BOOL: %x}", V_BOOL(var)); + break; + case VT_UI4: + sprintf(buf, "{VT_UI4: %u}", V_UI4(var)); + break; + default: + sprintf(buf, "{vt %d}", V_VT(var)); + break; + } + + return buf; +} + +static BOOL create_root_IDxDiagContainer(void) +{ + HRESULT hr; + DXDIAG_INIT_PARAMS params; + + hr = CoCreateInstance(&CLSID_DxDiagProvider, NULL, CLSCTX_INPROC_SERVER, + &IID_IDxDiagProvider, (LPVOID*)&pddp); + if (SUCCEEDED(hr)) + { + params.dwSize = sizeof(params); + params.dwDxDiagHeaderVersion = DXDIAG_DX9_SDK_VERSION; + params.bAllowWHQLChecks = FALSE; + params.pReserved = NULL; + hr = IDxDiagProvider_Initialize(pddp, ¶ms); + if (SUCCEEDED(hr)) + { + hr = IDxDiagProvider_GetRootContainer(pddp, &pddc); + if (SUCCEEDED(hr)) + return TRUE; + } + IDxDiagProvider_Release(pddp); + } + return FALSE; +} + +static void test_GetNumberOfChildContainers(void) +{ + HRESULT hr; + DWORD count; + + if (!create_root_IDxDiagContainer()) + { + skip("Unable to create the root IDxDiagContainer\n"); + return; + } + + hr = IDxDiagContainer_GetNumberOfChildContainers(pddc, NULL); + ok(hr == E_INVALIDARG, + "Expected IDxDiagContainer::GetNumberOfChildContainers to return E_INVALIDARG, got 0x%08x\n", hr); + + hr = IDxDiagContainer_GetNumberOfChildContainers(pddc, &count); + ok(hr == S_OK, + "Expected IDxDiagContainer::GetNumberOfChildContainers to return S_OK, got 0x%08x\n", hr); + if (hr == S_OK) + ok(count != 0, "Expected the number of child containers for the root container to be non-zero\n"); + + IDxDiagContainer_Release(pddc); + IDxDiagProvider_Release(pddp); +} + +static void test_GetNumberOfProps(void) +{ + HRESULT hr; + DWORD count; + + if (!create_root_IDxDiagContainer()) + { + skip("Unable to create the root IDxDiagContainer\n"); + return; + } + + hr = IDxDiagContainer_GetNumberOfProps(pddc, NULL); + ok(hr == E_INVALIDARG, "Expected IDxDiagContainer::GetNumberOfProps to return E_INVALIDARG, got 0x%08x\n", hr); + + hr = IDxDiagContainer_GetNumberOfProps(pddc, &count); + ok(hr == S_OK, "Expected IDxDiagContainer::GetNumberOfProps to return S_OK, got 0x%08x\n", hr); + if (hr == S_OK) + ok(count == 0, "Expected the number of properties for the root container to be zero\n"); + + IDxDiagContainer_Release(pddc); + IDxDiagProvider_Release(pddp); +} + +static void test_EnumChildContainerNames(void) +{ + HRESULT hr; + WCHAR container[256]; + DWORD maxcount, index; + static const WCHAR testW[] = {'t','e','s','t',0}; + static const WCHAR zerotestW[] = {0,'e','s','t',0}; + + if (!create_root_IDxDiagContainer()) + { + skip("Unable to create the root IDxDiagContainer\n"); + return; + } + + /* Test various combinations of invalid parameters. */ + hr = IDxDiagContainer_EnumChildContainerNames(pddc, 0, NULL, 0); + ok(hr == E_INVALIDARG, + "Expected IDxDiagContainer::EnumChildContainerNames to return E_INVALIDARG, got 0x%08x\n", hr); + + hr = IDxDiagContainer_EnumChildContainerNames(pddc, 0, NULL, sizeof(container)/sizeof(WCHAR)); + ok(hr == E_INVALIDARG, + "Expected IDxDiagContainer::EnumChildContainerNames to return E_INVALIDARG, got 0x%08x\n", hr); + + /* Test the conditions in which the output buffer can be modified. */ + memcpy(container, testW, sizeof(testW)); + hr = IDxDiagContainer_EnumChildContainerNames(pddc, 0, container, 0); + ok(hr == E_INVALIDARG, + "Expected IDxDiagContainer::EnumChildContainerNames to return E_INVALIDARG, got 0x%08x\n", hr); + ok(!memcmp(container, testW, sizeof(testW)), + "Expected the container buffer to be untouched, got %s\n", wine_dbgstr_w(container)); + + memcpy(container, testW, sizeof(testW)); + hr = IDxDiagContainer_EnumChildContainerNames(pddc, ~0, container, 0); + ok(hr == E_INVALIDARG, + "Expected IDxDiagContainer::EnumChildContainerNames to return E_INVALIDARG, got 0x%08x\n", hr); + ok(!memcmp(container, testW, sizeof(testW)), + "Expected the container buffer to be untouched, got %s\n", wine_dbgstr_w(container)); + + memcpy(container, testW, sizeof(testW)); + hr = IDxDiagContainer_EnumChildContainerNames(pddc, ~0, container, sizeof(container)/sizeof(WCHAR)); + ok(hr == E_INVALIDARG, + "Expected IDxDiagContainer::EnumChildContainerNames to return E_INVALIDARG, got 0x%08x\n", hr); + ok(!memcmp(container, zerotestW, sizeof(zerotestW)), + "Expected the container buffer string to be empty, got %s\n", wine_dbgstr_w(container)); + + hr = IDxDiagContainer_GetNumberOfChildContainers(pddc, &maxcount); + ok(hr == S_OK, "Expected IDxDiagContainer::GetNumberOfChildContainers to return S_OK, got 0x%08x\n", hr); + if (FAILED(hr)) + { + skip("IDxDiagContainer::GetNumberOfChildContainers failed\n"); + goto cleanup; + } + + trace("Starting child container enumeration of the root container:\n"); + + /* We should be able to enumerate as many child containers as the value + * that IDxDiagContainer::GetNumberOfChildContainers returns. */ + for (index = 0; index <= maxcount; index++) + { + /* A buffer size of 1 is unlikely to be valid, as only a null terminator + * could be stored, and it is unlikely that a container name could be empty. */ + DWORD buffersize = 1; + memcpy(container, testW, sizeof(testW)); + hr = IDxDiagContainer_EnumChildContainerNames(pddc, index, container, buffersize); + if (hr == E_INVALIDARG) + { + /* We should get here when index is one more than the maximum index value. */ + ok(maxcount == index, + "Expected IDxDiagContainer::EnumChildContainerNames to return E_INVALIDARG " + "on the last index %d, got 0x%08x\n", index, hr); + ok(container[0] == '\0', + "Expected the container buffer string to be empty, got %s\n", wine_dbgstr_w(container)); + break; + } + else if (hr == DXDIAG_E_INSUFFICIENT_BUFFER) + { + WCHAR temp[256]; + + ok(container[0] == '\0', + "Expected the container buffer string to be empty, got %s\n", wine_dbgstr_w(container)); + + /* Get the container name to compare against. */ + hr = IDxDiagContainer_EnumChildContainerNames(pddc, index, temp, sizeof(temp)/sizeof(WCHAR)); + ok(hr == S_OK, + "Expected IDxDiagContainer::EnumChildContainerNames to return S_OK, got 0x%08x\n", hr); + + /* Show that the DirectX SDK's stipulation that the buffer be at + * least 256 characters long is a mere suggestion, and smaller sizes + * can be acceptable also. IDxDiagContainer::EnumChildContainerNames + * doesn't provide a way of getting the exact size required, so the + * buffersize value will be iterated to at most 256 characters. */ + for (buffersize = 2; buffersize <= 256; buffersize++) + { + memcpy(container, testW, sizeof(testW)); + hr = IDxDiagContainer_EnumChildContainerNames(pddc, index, container, buffersize); + if (hr != DXDIAG_E_INSUFFICIENT_BUFFER) + break; + + ok(!memcmp(temp, container, sizeof(WCHAR)*(buffersize - 1)), + "Expected truncated container name string, got %s\n", wine_dbgstr_w(container)); + } + + ok(hr == S_OK, + "Expected IDxDiagContainer::EnumChildContainerNames to return S_OK, " + "got hr = 0x%08x, buffersize = %d\n", hr, buffersize); + if (hr == S_OK) + trace("pddc[%d] = %s, length = %d\n", index, wine_dbgstr_w(container), buffersize); + } + else + { + ok(0, "IDxDiagContainer::EnumChildContainerNames unexpectedly returned 0x%08x\n", hr); + break; + } + } + +cleanup: + IDxDiagContainer_Release(pddc); + IDxDiagProvider_Release(pddp); +} + +static void test_GetChildContainer(void) +{ + HRESULT hr; + WCHAR container[256] = {0}; + IDxDiagContainer *child; + + if (!create_root_IDxDiagContainer()) + { + skip("Unable to create the root IDxDiagContainer\n"); + return; + } + + /* Test various combinations of invalid parameters. */ + hr = IDxDiagContainer_GetChildContainer(pddc, NULL, NULL); + ok(hr == E_INVALIDARG, + "Expected IDxDiagContainer::GetChildContainer to return E_INVALIDARG, got 0x%08x\n", hr); + + child = (void*)0xdeadbeef; + hr = IDxDiagContainer_GetChildContainer(pddc, NULL, &child); + ok(hr == E_INVALIDARG, + "Expected IDxDiagContainer::GetChildContainer to return E_INVALIDARG, got 0x%08x\n", hr); + ok(child == (void*)0xdeadbeef, "Expected output pointer to be unchanged, got %p\n", child); + + hr = IDxDiagContainer_GetChildContainer(pddc, container, NULL); + ok(hr == E_INVALIDARG, + "Expected IDxDiagContainer::GetChildContainer to return E_INVALIDARG, got 0x%08x\n", hr); + + child = (void*)0xdeadbeef; + hr = IDxDiagContainer_GetChildContainer(pddc, container, &child); + ok(hr == E_INVALIDARG, + "Expected IDxDiagContainer::GetChildContainer to return E_INVALIDARG, got 0x%08x\n", hr); + ok(child == NULL, "Expected output pointer to be NULL, got %p\n", child); + + /* Get the name of a suitable child container. */ + hr = IDxDiagContainer_EnumChildContainerNames(pddc, 0, container, sizeof(container)/sizeof(WCHAR)); + ok(hr == S_OK, + "Expected IDxDiagContainer::EnumChildContainerNames to return S_OK, got 0x%08x\n", hr); + if (FAILED(hr)) + { + skip("IDxDiagContainer::EnumChildContainerNames failed\n"); + goto cleanup; + } + + child = (void*)0xdeadbeef; + hr = IDxDiagContainer_GetChildContainer(pddc, container, &child); + ok(hr == S_OK, + "Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x\n", hr); + ok(child != NULL && child != (void*)0xdeadbeef, "Expected a valid output pointer, got %p\n", child); + + if (SUCCEEDED(hr)) + { + IDxDiagContainer *ptr; + + /* Show that IDxDiagContainer::GetChildContainer returns a different pointer + * for multiple calls for the same container name. */ + hr = IDxDiagContainer_GetChildContainer(pddc, container, &ptr); + ok(hr == S_OK, + "Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x\n", hr); + if (SUCCEEDED(hr)) + ok(ptr != child, "Expected the two pointers (%p vs. %p) to be unequal\n", child, ptr); + + IDxDiagContainer_Release(ptr); + IDxDiagContainer_Release(child); + } + +cleanup: + IDxDiagContainer_Release(pddc); + IDxDiagProvider_Release(pddp); +} + +static void test_dot_parsing(void) +{ + HRESULT hr; + WCHAR containerbufW[256] = {0}, childbufW[256] = {0}; + DWORD count, index; + size_t i; + static const struct + { + const char *format; + const HRESULT expect; + } test_strings[] = { + { "%s.%s", S_OK }, + { "%s.%s.", S_OK }, + { ".%s.%s", E_INVALIDARG }, + { "%s.%s..", E_INVALIDARG }, + { ".%s.%s.", E_INVALIDARG }, + { "..%s.%s", E_INVALIDARG }, + }; + + if (!create_root_IDxDiagContainer()) + { + skip("Unable to create the root IDxDiagContainer\n"); + return; + } + + /* Find a container with a child container of its own. */ + hr = IDxDiagContainer_GetNumberOfChildContainers(pddc, &count); + ok(hr == S_OK, "Expected IDxDiagContainer::GetNumberOfChildContainers to return S_OK, got 0x%08x\n", hr); + if (FAILED(hr)) + { + skip("IDxDiagContainer::GetNumberOfChildContainers failed\n"); + goto cleanup; + } + + for (index = 0; index < count; index++) + { + IDxDiagContainer *child; + + hr = IDxDiagContainer_EnumChildContainerNames(pddc, index, containerbufW, sizeof(containerbufW)/sizeof(WCHAR)); + ok(hr == S_OK, "Expected IDxDiagContainer_EnumChildContainerNames to return S_OK, got 0x%08x\n", hr); + if (FAILED(hr)) + { + skip("IDxDiagContainer::EnumChildContainerNames failed\n"); + goto cleanup; + } + + hr = IDxDiagContainer_GetChildContainer(pddc, containerbufW, &child); + ok(hr == S_OK, "Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x\n", hr); + + if (SUCCEEDED(hr)) + { + hr = IDxDiagContainer_EnumChildContainerNames(child, 0, childbufW, sizeof(childbufW)/sizeof(WCHAR)); + ok(hr == S_OK || hr == E_INVALIDARG, + "Expected IDxDiagContainer::EnumChildContainerNames to return S_OK or E_INVALIDARG, got 0x%08x\n", hr); + IDxDiagContainer_Release(child); + + if (SUCCEEDED(hr)) + break; + } + } + + if (!*containerbufW || !*childbufW) + { + skip("Unable to find a suitable container\n"); + goto cleanup; + } + + trace("Testing IDxDiagContainer::GetChildContainer dot parsing with container %s and child container %s.\n", + wine_dbgstr_w(containerbufW), wine_dbgstr_w(childbufW)); + + for (i = 0; i < sizeof(test_strings)/sizeof(test_strings[0]); i++) + { + IDxDiagContainer *child; + char containerbufA[256]; + char childbufA[256]; + char dotbufferA[255 + 255 + 3 + 1]; + WCHAR dotbufferW[255 + 255 + 3 + 1]; /* containerbuf + childbuf + dots + null terminator */ + + WideCharToMultiByte(CP_ACP, 0, containerbufW, -1, containerbufA, sizeof(containerbufA), NULL, NULL); + WideCharToMultiByte(CP_ACP, 0, childbufW, -1, childbufA, sizeof(childbufA), NULL, NULL); + sprintf(dotbufferA, test_strings[i].format, containerbufA, childbufA); + MultiByteToWideChar(CP_ACP, 0, dotbufferA, -1, dotbufferW, sizeof(dotbufferW)/sizeof(WCHAR)); + + trace("Trying container name %s\n", wine_dbgstr_w(dotbufferW)); + hr = IDxDiagContainer_GetChildContainer(pddc, dotbufferW, &child); + ok(hr == test_strings[i].expect, + "Expected IDxDiagContainer::GetChildContainer to return 0x%08x for %s, got 0x%08x\n", + test_strings[i].expect, wine_dbgstr_w(dotbufferW), hr); + if (SUCCEEDED(hr)) + IDxDiagContainer_Release(child); + } + +cleanup: + IDxDiagContainer_Release(pddc); + IDxDiagProvider_Release(pddp); +} + +static void test_EnumPropNames(void) +{ + HRESULT hr; + WCHAR container[256], property[256]; + IDxDiagContainer *child = NULL; + DWORD count, index, propcount; + static const WCHAR testW[] = {'t','e','s','t',0}; + + if (!create_root_IDxDiagContainer()) + { + skip("Unable to create the root IDxDiagContainer\n"); + return; + } + + /* Find a container with a non-zero number of properties. */ + hr = IDxDiagContainer_GetNumberOfChildContainers(pddc, &count); + ok(hr == S_OK, "Expected IDxDiagContainer::GetNumberOfChildContainers to return S_OK, got 0x%08x\n", hr); + if (FAILED(hr)) + { + skip("IDxDiagContainer::GetNumberOfChildContainers failed\n"); + goto cleanup; + } + + for (index = 0; index < count; index++) + { + hr = IDxDiagContainer_EnumChildContainerNames(pddc, index, container, sizeof(container)/sizeof(WCHAR)); + ok(hr == S_OK, "Expected IDxDiagContainer_EnumChildContainerNames to return S_OK, got 0x%08x\n", hr); + if (FAILED(hr)) + { + skip("IDxDiagContainer::EnumChildContainerNames failed\n"); + goto cleanup; + } + + hr = IDxDiagContainer_GetChildContainer(pddc, container, &child); + ok(hr == S_OK, "Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x\n", hr); + + if (SUCCEEDED(hr)) + { + hr = IDxDiagContainer_GetNumberOfProps(child, &propcount); + ok(hr == S_OK, "Expected IDxDiagContainer::GetNumberOfProps to return S_OK, got 0x%08x\n", hr); + + if (!propcount) + { + IDxDiagContainer_Release(child); + child = NULL; + } + else + break; + } + } + + if (!child) + { + skip("Unable to find a container with non-zero property count\n"); + goto cleanup; + } + + hr = IDxDiagContainer_EnumPropNames(child, ~0, NULL, 0); + ok(hr == E_INVALIDARG, "Expected IDxDiagContainer::EnumPropNames to return E_INVALIDARG, got 0x%08x\n", hr); + + memcpy(property, testW, sizeof(testW)); + hr = IDxDiagContainer_EnumPropNames(child, ~0, property, 0); + ok(hr == E_INVALIDARG, "Expected IDxDiagContainer::EnumPropNames to return E_INVALIDARG, got 0x%08x\n", hr); + ok(!memcmp(property, testW, sizeof(testW)), + "Expected the property buffer to be unchanged, got %s\n", wine_dbgstr_w(property)); + + memcpy(property, testW, sizeof(testW)); + hr = IDxDiagContainer_EnumPropNames(child, ~0, property, sizeof(property)/sizeof(WCHAR)); + ok(hr == E_INVALIDARG, "Expected IDxDiagContainer::EnumPropNames to return E_INVALIDARG, got 0x%08x\n", hr); + ok(!memcmp(property, testW, sizeof(testW)), + "Expected the property buffer to be unchanged, got %s\n", wine_dbgstr_w(property)); + + trace("Starting property enumeration of the %s container:\n", wine_dbgstr_w(container)); + + /* We should be able to enumerate as many properties as the value that + * IDxDiagContainer::GetNumberOfProps returns. */ + for (index = 0; index <= propcount; index++) + { + /* A buffer size of 1 is unlikely to be valid, as only a null terminator + * could be stored, and it is unlikely that a property name could be empty. */ + DWORD buffersize = 1; + + memcpy(property, testW, sizeof(testW)); + hr = IDxDiagContainer_EnumPropNames(child, index, property, buffersize); + if (hr == E_INVALIDARG) + { + /* We should get here when index is one more than the maximum index value. */ + ok(propcount == index, + "Expected IDxDiagContainer::EnumPropNames to return E_INVALIDARG " + "on the last index %d, got 0x%08x\n", index, hr); + ok(!memcmp(property, testW, sizeof(testW)), + "Expected the property buffer to be unchanged, got %s\n", wine_dbgstr_w(property)); + break; + } + else if (hr == DXDIAG_E_INSUFFICIENT_BUFFER) + { + WCHAR temp[256]; + + ok(property[0] == '\0', + "Expected the property buffer string to be empty, got %s\n", wine_dbgstr_w(property)); + hr = IDxDiagContainer_EnumPropNames(child, index, temp, sizeof(temp)/sizeof(WCHAR)); + ok(hr == S_OK, + "Expected IDxDiagContainer::EnumPropNames to return S_OK, got 0x%08x\n", hr); + + /* Show that the DirectX SDK's stipulation that the buffer be at + * least 256 characters long is a mere suggestion, and smaller sizes + * can be acceptable also. IDxDiagContainer::EnumPropNames doesn't + * provide a way of getting the exact size required, so the buffersize + * value will be iterated to at most 256 characters. */ + for (buffersize = 2; buffersize <= 256; buffersize++) + { + memcpy(property, testW, sizeof(testW)); + hr = IDxDiagContainer_EnumPropNames(child, index, property, buffersize); + if (hr != DXDIAG_E_INSUFFICIENT_BUFFER) + break; + + ok(!memcmp(temp, property, sizeof(WCHAR)*(buffersize - 1)), + "Expected truncated property name string, got %s\n", wine_dbgstr_w(property)); + } + + ok(hr == S_OK, + "Expected IDxDiagContainer::EnumPropNames to return S_OK, " + "got hr = 0x%08x, buffersize = %d\n", hr, buffersize); + if (hr == S_OK) + trace("child[%d] = %s, length = %d\n", index, wine_dbgstr_w(property), buffersize); + } + else + { + ok(0, "IDxDiagContainer::EnumPropNames unexpectedly returned 0x%08x\n", hr); + break; + } + } + + IDxDiagContainer_Release(child); + +cleanup: + IDxDiagContainer_Release(pddc); + IDxDiagProvider_Release(pddp); +} + +static void test_GetProp(void) +{ + HRESULT hr; + WCHAR container[256], property[256]; + IDxDiagContainer *child = NULL; + DWORD count, index; + VARIANT var; + SAFEARRAY *sa; + SAFEARRAYBOUND bound; + ULONG ref; + static const WCHAR emptyW[] = {0}; + static const WCHAR testW[] = {'t','e','s','t',0}; + + if (!create_root_IDxDiagContainer()) + { + skip("Unable to create the root IDxDiagContainer\n"); + return; + } + + /* Find a container with a property. */ + hr = IDxDiagContainer_GetNumberOfChildContainers(pddc, &count); + ok(hr == S_OK, "Expected IDxDiagContainer::GetNumberOfChildContainers to return S_OK, got 0x%08x\n", hr); + if (FAILED(hr)) + { + skip("IDxDiagContainer::GetNumberOfChildContainers failed\n"); + goto cleanup; + } + + for (index = 0; index < count; index++) + { + hr = IDxDiagContainer_EnumChildContainerNames(pddc, index, container, sizeof(container)/sizeof(WCHAR)); + ok(hr == S_OK, "Expected IDxDiagContainer_EnumChildContainerNames to return S_OK, got 0x%08x\n", hr); + if (FAILED(hr)) + { + skip("IDxDiagContainer::EnumChildContainerNames failed\n"); + goto cleanup; + } + + hr = IDxDiagContainer_GetChildContainer(pddc, container, &child); + ok(hr == S_OK, "Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x\n", hr); + + if (SUCCEEDED(hr)) + { + hr = IDxDiagContainer_EnumPropNames(child, 0, property, sizeof(property)/sizeof(WCHAR)); + ok(hr == S_OK || hr == E_INVALIDARG, + "Expected IDxDiagContainer::EnumPropNames to return S_OK or E_INVALIDARG, got 0x%08x\n", hr); + + if (SUCCEEDED(hr)) + break; + else + { + IDxDiagContainer_Release(child); + child = NULL; + } + } + } + + if (!child) + { + skip("Unable to find a suitable container\n"); + goto cleanup; + } + + hr = IDxDiagContainer_GetProp(child, NULL, NULL); + ok(hr == E_INVALIDARG, "Expected IDxDiagContainer::GetProp to return E_INVALIDARG, got 0x%08x\n", hr); + + V_VT(&var) = 0xdead; + hr = IDxDiagContainer_GetProp(child, NULL, &var); + ok(hr == E_INVALIDARG, "Expected IDxDiagContainer::GetProp to return E_INVALIDARG, got 0x%08x\n", hr); + ok(V_VT(&var) == 0xdead, "Expected the variant to be untouched, got %u\n", V_VT(&var)); + + hr = IDxDiagContainer_GetProp(child, emptyW, NULL); + ok(hr == E_INVALIDARG, "Expected IDxDiagContainer::GetProp to return E_INVALIDARG, got 0x%08x\n", hr); + + V_VT(&var) = 0xdead; + hr = IDxDiagContainer_GetProp(child, emptyW, &var); + ok(hr == E_INVALIDARG, "Expected IDxDiagContainer::GetProp to return E_INVALIDARG, got 0x%08x\n", hr); + ok(V_VT(&var) == 0xdead, "Expected the variant to be untouched, got %u\n", V_VT(&var)); + + hr = IDxDiagContainer_GetProp(child, testW, NULL); + ok(hr == E_INVALIDARG, "Expected IDxDiagContainer::GetProp to return E_INVALIDARG, got 0x%08x\n", hr); + + V_VT(&var) = 0xdead; + hr = IDxDiagContainer_GetProp(child, testW, &var); + ok(hr == E_INVALIDARG, "Expected IDxDiagContainer::GetProp to return E_INVALIDARG, got 0x%08x\n", hr); + ok(V_VT(&var) == 0xdead, "Expected the variant to be untouched, got %u\n", V_VT(&var)); + + VariantInit(&var); + hr = IDxDiagContainer_GetProp(child, property, &var); + ok(hr == S_OK, "Expected IDxDiagContainer::GetProp to return S_OK, got 0x%08x\n", hr); + ok(V_VT(&var) != VT_EMPTY, "Expected the variant to be modified, got %d\n", V_VT(&var)); + + /* Since the documentation for IDxDiagContainer::GetProp claims that the + * function reports return values from VariantCopy, try to exercise failure + * paths in handling the destination variant. */ + + /* Try an invalid variant type. */ + V_VT(&var) = 0xdead; + hr = IDxDiagContainer_GetProp(child, property, &var); + ok(hr == S_OK, "Expected IDxDiagContainer::GetProp to return S_OK, got 0x%08x\n", hr); + ok(V_VT(&var) != 0xdead, "Expected the variant to be modified, got %d\n", V_VT(&var)); + + /* Try passing a variant with a locked SAFEARRAY. */ + bound.cElements = 1; + bound.lLbound = 0; + sa = SafeArrayCreate(VT_UI1, 1, &bound); + ok(sa != NULL, "Expected SafeArrayCreate to return a valid pointer\n"); + + V_VT(&var) = (VT_ARRAY | VT_UI1); + V_ARRAY(&var) = sa; + + hr = SafeArrayLock(sa); + ok(hr == S_OK, "Expected SafeArrayLock to return S_OK, got 0x%08x\n", hr); + + hr = IDxDiagContainer_GetProp(child, property, &var); + ok(hr == S_OK, "Expected IDxDiagContainer::GetProp to return S_OK, got 0x%08x\n", hr); + ok(V_VT(&var) != (VT_ARRAY | VT_UI1), "Expected the variant to be modified\n"); + + hr = SafeArrayUnlock(sa); + ok(hr == S_OK, "Expected SafeArrayUnlock to return S_OK, got 0x%08x\n", hr); + hr = SafeArrayDestroy(sa); + ok(hr == S_OK, "Expected SafeArrayDestroy to return S_OK, got 0x%08x\n", hr); + + /* Determine whether GetProp calls VariantClear on the passed variant. */ + V_VT(&var) = VT_UNKNOWN; + V_UNKNOWN(&var) = (IUnknown *)child; + IDxDiagContainer_AddRef(child); + + hr = IDxDiagContainer_GetProp(child, property, &var); + ok(hr == S_OK, "Expected IDxDiagContainer::GetProp to return S_OK, got 0x%08x\n", hr); + ok(V_VT(&var) != VT_UNKNOWN, "Expected the variant to be modified\n"); + + IDxDiagContainer_AddRef(child); + ref = IDxDiagContainer_Release(child); + ok(ref == 2, "Expected reference count to be 2, got %u\n", ref); + + IDxDiagContainer_Release(child); +cleanup: + IDxDiagContainer_Release(pddc); + IDxDiagProvider_Release(pddp); +} + +static void test_root_children(void) +{ + static const WCHAR DxDiag_DirectSound[] = {'D','x','D','i','a','g','_','D','i','r','e','c','t','S','o','u','n','d',0}; + static const WCHAR DxDiag_DirectMusic[] = {'D','x','D','i','a','g','_','D','i','r','e','c','t','M','u','s','i','c',0}; + static const WCHAR DxDiag_DirectInput[] = {'D','x','D','i','a','g','_','D','i','r','e','c','t','I','n','p','u','t',0}; + static const WCHAR DxDiag_DirectPlay[] = {'D','x','D','i','a','g','_','D','i','r','e','c','t','P','l','a','y',0}; + static const WCHAR DxDiag_SystemDevices[] = {'D','x','D','i','a','g','_','S','y','s','t','e','m','D','e','v','i','c','e','s',0}; + static const WCHAR DxDiag_DirectXFiles[] = {'D','x','D','i','a','g','_','D','i','r','e','c','t','X','F','i','l','e','s',0}; + static const WCHAR DxDiag_DirectShowFilters[] = {'D','x','D','i','a','g','_','D','i','r','e','c','t','S','h','o','w','F','i','l','t','e','r','s',0}; + static const WCHAR DxDiag_LogicalDisks[] = {'D','x','D','i','a','g','_','L','o','g','i','c','a','l','D','i','s','k','s',0}; + + HRESULT hr; + DWORD count, index; + + static const WCHAR *root_children[] = { + DxDiag_SystemInfo, DxDiag_DisplayDevices, DxDiag_DirectSound, + DxDiag_DirectMusic, DxDiag_DirectInput, DxDiag_DirectPlay, + DxDiag_SystemDevices, DxDiag_DirectXFiles, DxDiag_DirectShowFilters, + DxDiag_LogicalDisks + }; + + if (!create_root_IDxDiagContainer()) + { + skip("Unable to create the root IDxDiagContainer\n"); + return; + } + + /* Verify the identity and ordering of the root container's children. */ + hr = IDxDiagContainer_GetNumberOfChildContainers(pddc, &count); + ok(hr == S_OK, "Expected IDxDiagContainer::GetNumberOfChildContainers to return S_OK, got 0x%08x\n", hr); + if (FAILED(hr)) + { + skip("IDxDiagContainer::GetNumberOfChildContainers failed\n"); + goto cleanup; + } + + ok(count == sizeof(root_children)/sizeof(root_children[0]), + "Got unexpected count %u for the number of child containers\n", count); + + if (count != sizeof(root_children)/sizeof(root_children[0])) + { + skip("Received unexpected number of child containers\n"); + goto cleanup; + } + + for (index = 0; index <= count; index++) + { + WCHAR container[256]; + + hr = IDxDiagContainer_EnumChildContainerNames(pddc, index, container, sizeof(container)/sizeof(WCHAR)); + if (hr == E_INVALIDARG) + { + ok(index == count, + "Expected IDxDiagContainer::EnumChildContainerNames to return " + "E_INVALIDARG on the last index %u\n", count); + break; + } + else if (hr == S_OK) + { + ok(!lstrcmpW(container, root_children[index]), + "Expected container %s for index %u, got %s\n", + wine_dbgstr_w(root_children[index]), index, wine_dbgstr_w(container)); + } + else + { + ok(0, "IDxDiagContainer::EnumChildContainerNames unexpectedly returned 0x%08x\n", hr); + break; + } + } + +cleanup: + IDxDiagContainer_Release(pddc); + IDxDiagProvider_Release(pddp); +} + +static void test_container_properties(IDxDiagContainer *container, const struct property_test *property_tests, size_t len) +{ + HRESULT hr; + + /* Check that the container has no properties if there are no properties to examine. */ + if (len == 0) + { + DWORD prop_count; + + hr = IDxDiagContainer_GetNumberOfProps(container, &prop_count); + ok(hr == S_OK, "Expected IDxDiagContainer::GetNumberOfProps to return S_OK, got 0x%08x\n", hr); + if (hr == S_OK) + ok(prop_count == 0, "Expected container property count to be zero, got %u\n", prop_count); + } + else + { + VARIANT var; + int i; + + VariantInit(&var); + + /* Examine the variant types of obtained property values. */ + for (i = 0; i < len; i++) + { + hr = IDxDiagContainer_GetProp(container, property_tests[i].prop, &var); + ok(hr == S_OK, "[%d] Expected IDxDiagContainer::GetProp to return S_OK for %s, got 0x%08x\n", + i, wine_dbgstr_w(property_tests[i].prop), hr); + + if (hr == S_OK) + { + ok(V_VT(&var) == property_tests[i].vt, + "[%d] Expected variant type %d, got %d\n", i, property_tests[i].vt, V_VT(&var)); + trace("%s = %s\n", wine_dbgstr_w(property_tests[i].prop), debugstr_variant(&var)); + VariantClear(&var); + } + } + } +} + +static void test_DxDiag_SystemInfo(void) +{ + static const WCHAR dwOSMajorVersion[] = {'d','w','O','S','M','a','j','o','r','V','e','r','s','i','o','n',0}; + static const WCHAR dwOSMinorVersion[] = {'d','w','O','S','M','i','n','o','r','V','e','r','s','i','o','n',0}; + static const WCHAR dwOSBuildNumber[] = {'d','w','O','S','B','u','i','l','d','N','u','m','b','e','r',0}; + static const WCHAR dwOSPlatformID[] = {'d','w','O','S','P','l','a','t','f','o','r','m','I','D',0}; + static const WCHAR dwDirectXVersionMajor[] = {'d','w','D','i','r','e','c','t','X','V','e','r','s','i','o','n','M','a','j','o','r',0}; + static const WCHAR dwDirectXVersionMinor[] = {'d','w','D','i','r','e','c','t','X','V','e','r','s','i','o','n','M','i','n','o','r',0}; + static const WCHAR szDirectXVersionLetter[] = {'s','z','D','i','r','e','c','t','X','V','e','r','s','i','o','n','L','e','t','t','e','r',0}; + static const WCHAR bDebug[] = {'b','D','e','b','u','g',0}; + static const WCHAR bNECPC98[] = {'b','N','E','C','P','C','9','8',0}; + static const WCHAR ullPhysicalMemory[] = {'u','l','l','P','h','y','s','i','c','a','l','M','e','m','o','r','y',0}; + static const WCHAR ullUsedPageFile[] = {'u','l','l','U','s','e','d','P','a','g','e','F','i','l','e',0}; + static const WCHAR ullAvailPageFile[] = {'u','l','l','A','v','a','i','l','P','a','g','e','F','i','l','e',0}; + static const WCHAR szWindowsDir[] = {'s','z','W','i','n','d','o','w','s','D','i','r',0}; + static const WCHAR szCSDVersion[] = {'s','z','C','S','D','V','e','r','s','i','o','n',0}; + static const WCHAR szDirectXVersionEnglish[] = {'s','z','D','i','r','e','c','t','X','V','e','r','s','i','o','n','E','n','g','l','i','s','h',0}; + static const WCHAR szDirectXVersionLongEnglish[] = {'s','z','D','i','r','e','c','t','X','V','e','r','s','i','o','n','L','o','n','g','E','n','g','l','i','s','h',0}; + static const WCHAR bNetMeetingRunning[] = {'b','N','e','t','M','e','e','t','i','n','g','R','u','n','n','i','n','g',0}; + static const WCHAR szMachineNameLocalized[] = {'s','z','M','a','c','h','i','n','e','N','a','m','e','L','o','c','a','l','i','z','e','d',0}; + static const WCHAR szMachineNameEnglish[] = {'s','z','M','a','c','h','i','n','e','N','a','m','e','E','n','g','l','i','s','h',0}; + static const WCHAR szLanguagesLocalized[] = {'s','z','L','a','n','g','u','a','g','e','s','L','o','c','a','l','i','z','e','d',0}; + static const WCHAR szLanguagesEnglish[] = {'s','z','L','a','n','g','u','a','g','e','s','E','n','g','l','i','s','h',0}; + static const WCHAR szTimeLocalized[] = {'s','z','T','i','m','e','L','o','c','a','l','i','z','e','d',0}; + static const WCHAR szTimeEnglish[] = {'s','z','T','i','m','e','E','n','g','l','i','s','h',0}; + static const WCHAR szPhysicalMemoryEnglish[] = {'s','z','P','h','y','s','i','c','a','l','M','e','m','o','r','y','E','n','g','l','i','s','h',0}; + static const WCHAR szPageFileLocalized[] = {'s','z','P','a','g','e','F','i','l','e','L','o','c','a','l','i','z','e','d',0}; + static const WCHAR szPageFileEnglish[] = {'s','z','P','a','g','e','F','i','l','e','E','n','g','l','i','s','h',0}; + static const WCHAR szOSLocalized[] = {'s','z','O','S','L','o','c','a','l','i','z','e','d',0}; + static const WCHAR szOSExLocalized[] = {'s','z','O','S','E','x','L','o','c','a','l','i','z','e','d',0}; + static const WCHAR szOSExLongLocalized[] = {'s','z','O','S','E','x','L','o','n','g','L','o','c','a','l','i','z','e','d',0}; + static const WCHAR szOSEnglish[] = {'s','z','O','S','E','n','g','l','i','s','h',0}; + static const WCHAR szOSExEnglish[] = {'s','z','O','S','E','x','E','n','g','l','i','s','h',0}; + static const WCHAR szOSExLongEnglish[] = {'s','z','O','S','E','x','L','o','n','g','E','n','g','l','i','s','h',0}; + static const WCHAR szProcessorEnglish[] = {'s','z','P','r','o','c','e','s','s','o','r','E','n','g','l','i','s','h',0}; + + static const struct property_test property_tests[] = + { + {dwOSMajorVersion, VT_UI4}, + {dwOSMinorVersion, VT_UI4}, + {dwOSBuildNumber, VT_UI4}, + {dwOSPlatformID, VT_UI4}, + {dwDirectXVersionMajor, VT_UI4}, + {dwDirectXVersionMinor, VT_UI4}, + {szDirectXVersionLetter, VT_BSTR}, + {bDebug, VT_BOOL}, + {bNECPC98, VT_BOOL}, + {ullPhysicalMemory, VT_BSTR}, + {ullUsedPageFile, VT_BSTR}, + {ullAvailPageFile, VT_BSTR}, + {szWindowsDir, VT_BSTR}, + {szCSDVersion, VT_BSTR}, + {szDirectXVersionEnglish, VT_BSTR}, + {szDirectXVersionLongEnglish, VT_BSTR}, + {bNetMeetingRunning, VT_BOOL}, + {szMachineNameLocalized, VT_BSTR}, + {szMachineNameEnglish, VT_BSTR}, + {szLanguagesLocalized, VT_BSTR}, + {szLanguagesEnglish, VT_BSTR}, + {szTimeLocalized, VT_BSTR}, + {szTimeEnglish, VT_BSTR}, + {szPhysicalMemoryEnglish, VT_BSTR}, + {szPageFileLocalized, VT_BSTR}, + {szPageFileEnglish, VT_BSTR}, + {szOSLocalized, VT_BSTR}, + {szOSExLocalized, VT_BSTR}, + {szOSExLongLocalized, VT_BSTR}, + {szOSEnglish, VT_BSTR}, + {szOSExEnglish, VT_BSTR}, + {szOSExLongEnglish, VT_BSTR}, + {szProcessorEnglish, VT_BSTR}, + }; + + IDxDiagContainer *container; + HRESULT hr; + + if (!create_root_IDxDiagContainer()) + { + skip("Unable to create the root IDxDiagContainer\n"); + return; + } + + hr = IDxDiagContainer_GetChildContainer(pddc, DxDiag_SystemInfo, &container); + ok(hr == S_OK, "Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x\n", hr); + + if (hr == S_OK) + { + trace("Testing container DxDiag_SystemInfo\n"); + test_container_properties(container, property_tests, sizeof(property_tests)/sizeof(property_tests[0])); + IDxDiagContainer_Release(container); + } + + IDxDiagContainer_Release(pddc); + IDxDiagProvider_Release(pddp); +} + +static void test_DxDiag_DisplayDevices(void) +{ + static const WCHAR szDescription[] = {'s','z','D','e','s','c','r','i','p','t','i','o','n',0}; + static const WCHAR szDeviceName[] = {'s','z','D','e','v','i','c','e','N','a','m','e',0}; + static const WCHAR szKeyDeviceID[] = {'s','z','K','e','y','D','e','v','i','c','e','I','D',0}; + static const WCHAR szKeyDeviceKey[] = {'s','z','K','e','y','D','e','v','i','c','e','K','e','y',0}; + static const WCHAR szVendorId[] = {'s','z','V','e','n','d','o','r','I','d',0}; + static const WCHAR szDeviceId[] = {'s','z','D','e','v','i','c','e','I','d',0}; + static const WCHAR szDeviceIdentifier[] = {'s','z','D','e','v','i','c','e','I','d','e','n','t','i','f','i','e','r',0}; + static const WCHAR dwWidth[] = {'d','w','W','i','d','t','h',0}; + static const WCHAR dwHeight[] = {'d','w','H','e','i','g','h','t',0}; + static const WCHAR dwBpp[] = {'d','w','B','p','p',0}; + static const WCHAR szDisplayMemoryLocalized[] = {'s','z','D','i','s','p','l','a','y','M','e','m','o','r','y','L','o','c','a','l','i','z','e','d',0}; + static const WCHAR szDisplayMemoryEnglish[] = {'s','z','D','i','s','p','l','a','y','M','e','m','o','r','y','E','n','g','l','i','s','h',0}; + static const WCHAR szDriverName[] = {'s','z','D','r','i','v','e','r','N','a','m','e',0}; + static const WCHAR szDriverVersion[] = {'s','z','D','r','i','v','e','r','V','e','r','s','i','o','n',0}; + static const WCHAR szSubSysId[] = {'s','z','S','u','b','S','y','s','I','d',0}; + static const WCHAR szRevisionId[] = {'s','z','R','e','v','i','s','i','o','n','I','d',0}; + static const WCHAR dwRefreshRate[] = {'d','w','R','e','f','r','e','s','h','R','a','t','e',0}; + static const WCHAR szManufacturer[] = {'s','z','M','a','n','u','f','a','c','t','u','r','e','r',0}; + + static const struct property_test property_tests[] = + { + {szDescription, VT_BSTR}, + {szDeviceName, VT_BSTR}, + {szKeyDeviceID, VT_BSTR}, + {szKeyDeviceKey, VT_BSTR}, + {szVendorId, VT_BSTR}, + {szDeviceId, VT_BSTR}, + {szDeviceIdentifier, VT_BSTR}, + {dwWidth, VT_UI4}, + {dwHeight, VT_UI4}, + {dwBpp, VT_UI4}, + {szDisplayMemoryLocalized, VT_BSTR}, + {szDisplayMemoryEnglish, VT_BSTR}, + {szDriverName, VT_BSTR}, + {szDriverVersion, VT_BSTR}, + {szSubSysId, VT_BSTR}, + {szRevisionId, VT_BSTR}, + {dwRefreshRate, VT_UI4}, + {szManufacturer, VT_BSTR}, + }; + + IDxDiagContainer *display_cont = NULL; + DWORD count, i; + HRESULT hr; + + if (!create_root_IDxDiagContainer()) + { + skip("Unable to create the root IDxDiagContainer\n"); + return; + } + + hr = IDxDiagContainer_GetChildContainer(pddc, DxDiag_DisplayDevices, &display_cont); + ok(hr == S_OK, "Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x\n", hr); + + if (hr != S_OK) + goto cleanup; + + hr = IDxDiagContainer_GetNumberOfProps(display_cont, &count); + ok(hr == S_OK, "Expected IDxDiagContainer::GetNumberOfProps to return S_OK, got 0x%08x\n", hr); + if (hr == S_OK) + ok(count == 0, "Expected count to be 0, got %u\n", count); + + hr = IDxDiagContainer_GetNumberOfChildContainers(display_cont, &count); + ok(hr == S_OK, "Expected IDxDiagContainer::GetNumberOfChildContainers to return S_OK, got 0x%08x\n", hr); + + if (hr != S_OK) + goto cleanup; + + for (i = 0; i < count; i++) + { + WCHAR child_container[256]; + IDxDiagContainer *child; + + hr = IDxDiagContainer_EnumChildContainerNames(display_cont, i, child_container, sizeof(child_container)/sizeof(WCHAR)); + ok(hr == S_OK, "Expected IDxDiagContainer::EnumChildContainerNames to return S_OK, got 0x%08x\n", hr); + + hr = IDxDiagContainer_GetChildContainer(display_cont, child_container, &child); + ok(hr == S_OK, "Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x\n", hr); + + if (hr == S_OK) + { + trace("Testing container %s\n", wine_dbgstr_w(child_container)); + test_container_properties(child, property_tests, sizeof(property_tests)/sizeof(property_tests[0])); + } + } + +cleanup: + if (display_cont) IDxDiagContainer_Release(display_cont); + IDxDiagContainer_Release(pddc); + IDxDiagProvider_Release(pddp); +} + +START_TEST(container) +{ + CoInitialize(NULL); + test_GetNumberOfChildContainers(); + test_GetNumberOfProps(); + test_EnumChildContainerNames(); + test_GetChildContainer(); + test_dot_parsing(); + test_EnumPropNames(); + test_GetProp(); + + test_root_children(); + test_DxDiag_SystemInfo(); + test_DxDiag_DisplayDevices(); + CoUninitialize(); +} Propchange: trunk/rostests/winetests/dxdiagn/container.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/winetests/dxdiagn/provider.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/dxdiagn/provide…
============================================================================== --- trunk/rostests/winetests/dxdiagn/provider.c (added) +++ trunk/rostests/winetests/dxdiagn/provider.c [iso-8859-1] Tue Oct 1 17:49:24 2013 @@ -0,0 +1,160 @@ +/* + * Unit tests for IDxDiagProvider + * + * Copyright (C) 2009 Andrew Nguyen + * + * 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 + */ + +#define COBJMACROS + +#include <initguid.h> +#include <wine/dxdiag.h> +#include <wine/test.h> + +static void test_Initialize(void) +{ + HRESULT hr; + IDxDiagProvider *pddp; + DXDIAG_INIT_PARAMS params; + + hr = CoCreateInstance(&CLSID_DxDiagProvider, NULL, CLSCTX_INPROC_SERVER, + &IID_IDxDiagProvider, (LPVOID*)&pddp); + ok(hr == S_OK || + broken(hr == REGDB_E_CLASSNOTREG), /* Clean W2K3 */ + "Creating a IDxDiagProvider instance failed with %x\n", hr); + if (FAILED(hr)) + { + skip("Failed to create a IDxDiagProvider instance\n"); + return; + } + + /* Test passing a NULL DXDIAG_INIT_PARAMS pointer. */ + hr = IDxDiagProvider_Initialize(pddp, NULL); + ok(hr == E_POINTER, + "Expected IDxDiagProvider::Initialize to return E_POINTER, got %x\n", hr); + + /* Test passing invalid dwSize values. */ + params.dwSize = 0; + hr = IDxDiagProvider_Initialize(pddp, ¶ms); + ok(hr == E_INVALIDARG, + "Expected IDxDiagProvider::Initialize to return E_INVALIDARG, got %x\n", hr); + + params.dwSize = sizeof(params) + 1; + hr = IDxDiagProvider_Initialize(pddp, ¶ms); + ok(hr == E_INVALIDARG, + "Expected IDxDiagProvider::Initialize to return E_INVALIDARG, got %x\n", hr); + + /* Test passing an unexpected dwDxDiagHeaderVersion value. */ + params.dwSize = sizeof(params); + params.dwDxDiagHeaderVersion = 0; + params.bAllowWHQLChecks = FALSE; + params.pReserved = NULL; + hr = IDxDiagProvider_Initialize(pddp, ¶ms); + ok(hr == E_INVALIDARG, + "Expected IDxDiagProvider::Initialize to return E_INVALIDARG, got %x\n", hr); + + /* Setting pReserved to a non-NULL value causes a crash on Windows. */ + if (0) + { + params.dwDxDiagHeaderVersion = DXDIAG_DX9_SDK_VERSION; + params.bAllowWHQLChecks = FALSE; + params.pReserved = (VOID*)0xdeadbeef; + hr = IDxDiagProvider_Initialize(pddp, ¶ms); + trace("IDxDiagProvider::Initialize returned %x\n", hr); + } + + /* Test passing an appropriately initialized DXDIAG_INIT_PARAMS. */ + params.dwDxDiagHeaderVersion = DXDIAG_DX9_SDK_VERSION; + params.bAllowWHQLChecks = FALSE; + params.pReserved = NULL; + hr = IDxDiagProvider_Initialize(pddp, ¶ms); + ok(hr == S_OK, "Expected IDxDiagProvider::Initialize to return S_OK, got %x\n", hr); + + /* Test initializing multiple times. */ + hr = IDxDiagProvider_Initialize(pddp, ¶ms); + ok(hr == S_OK, "Expected IDxDiagProvider::Initialize to return S_OK, got %x\n", hr); + + IDxDiagProvider_Release(pddp); +} + +static void test_GetRootContainer(void) +{ + HRESULT hr; + IDxDiagProvider *pddp; + IDxDiagContainer *pddc, *pddc2; + DXDIAG_INIT_PARAMS params; + + hr = CoCreateInstance(&CLSID_DxDiagProvider, NULL, CLSCTX_INPROC_SERVER, + &IID_IDxDiagProvider, (LPVOID*)&pddp); + ok(hr == S_OK || + broken(hr == REGDB_E_CLASSNOTREG), /* Clean W2K3 */ + "Creating a IDxDiagProvider instance failed with %x\n", hr); + if (FAILED(hr)) + { + skip("Failed to create a IDxDiagProvider instance\n"); + return; + } + + /* Test calling IDxDiagProvider::GetRootContainer before initialization. */ + hr = IDxDiagProvider_GetRootContainer(pddp, NULL); + ok(hr == CO_E_NOTINITIALIZED, + "Expected IDxDiagProvider::GetRootContainer to return CO_E_NOTINITIALIZED, got %x\n", hr); + + hr = IDxDiagProvider_GetRootContainer(pddp, &pddc); + ok(hr == CO_E_NOTINITIALIZED, + "Expected IDxDiagProvider::GetRootContainer to return CO_E_NOTINITIALIZED, got %x\n", hr); + + params.dwSize = sizeof(params); + params.dwDxDiagHeaderVersion = DXDIAG_DX9_SDK_VERSION; + params.bAllowWHQLChecks = FALSE; + params.pReserved = NULL; + hr = IDxDiagProvider_Initialize(pddp, ¶ms); + ok(hr == S_OK, "Expected IDxDiagProvider::Initialize to return S_OK, got %x\n", hr); + if (FAILED(hr)) + { + skip("IDxDiagProvider::Initialize failed\n"); + IDxDiagProvider_Release(pddp); + return; + } + + /* Passing NULL causes a crash on Windows. */ + if (0) + { + hr = IDxDiagProvider_GetRootContainer(pddp, NULL); + trace("IDxDiagProvider::GetRootContainer returned %x\n", hr); + } + + hr = IDxDiagProvider_GetRootContainer(pddp, &pddc); + ok(hr == S_OK, "Expected IDxDiagProvider::GetRootContainer to return S_OK, got %x\n", hr); + + /* IDxDiagProvider::GetRootContainer creates new instances of the root + * container rather than maintain a static root container. */ + hr = IDxDiagProvider_GetRootContainer(pddp, &pddc2); + ok(hr == S_OK, "Expected IDxDiagProvider::GetRootContainer to return S_OK, got %x\n", hr); + ok(pddc != pddc2, "Expected the two pointers (%p vs. %p) to be unequal\n", pddc, pddc2); + + IDxDiagContainer_Release(pddc2); + IDxDiagContainer_Release(pddc); + IDxDiagProvider_Release(pddp); +} + +START_TEST(provider) +{ + CoInitialize(NULL); + test_Initialize(); + test_GetRootContainer(); + CoUninitialize(); +} Propchange: trunk/rostests/winetests/dxdiagn/provider.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/winetests/dxdiagn/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/dxdiagn/testlis…
============================================================================== --- trunk/rostests/winetests/dxdiagn/testlist.c (added) +++ trunk/rostests/winetests/dxdiagn/testlist.c [iso-8859-1] Tue Oct 1 17:49:24 2013 @@ -0,0 +1,14 @@ +/* Automatically generated file; DO NOT EDIT!! */ + +#define STANDALONE +#include <wine/test.h> + +extern void func_container(void); +extern void func_provider(void); + +const struct test winetest_testlist[] = +{ + { "container", func_container }, + { "provider", func_provider }, + { 0, 0 } +}; Propchange: trunk/rostests/winetests/dxdiagn/testlist.c ------------------------------------------------------------------------------ svn:eol-style = native
11 years, 2 months
1
0
0
0
[akhaldi] 60500: [DXDIAGN] * Sync with Wine 1.7.1. It was synced just recently (8 years ago) but there's not harm in syncing it again ; ) CORE-7469
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Oct 1 17:46:41 2013 New Revision: 60500 URL:
http://svn.reactos.org/svn/reactos?rev=60500&view=rev
Log: [DXDIAGN] * Sync with Wine 1.7.1. It was synced just recently (8 years ago) but there's not harm in syncing it again ;) CORE-7469 Added: trunk/reactos/dll/directx/wine/dxdiagn/dxdiagn.idl (with props) trunk/reactos/dll/directx/wine/dxdiagn/dxdiagn.rc (with props) trunk/reactos/dll/directx/wine/dxdiagn/dxdiagn.rgs (with props) trunk/reactos/dll/directx/wine/dxdiagn/fil_data.idl (with props) trunk/reactos/dll/directx/wine/dxdiagn/resource.h (with props) trunk/reactos/include/reactos/wine/dxdiag.h (with props) Removed: trunk/reactos/dll/directx/wine/dxdiagn/regsvr.c trunk/reactos/dll/directx/wine/dxdiagn/version.rc Modified: trunk/reactos/dll/directx/wine/dxdiagn/CMakeLists.txt trunk/reactos/dll/directx/wine/dxdiagn/container.c trunk/reactos/dll/directx/wine/dxdiagn/dxdiag_main.c trunk/reactos/dll/directx/wine/dxdiagn/dxdiag_private.h trunk/reactos/dll/directx/wine/dxdiagn/provider.c trunk/reactos/media/doc/README.WINE [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/directx/wine/dxdiagn/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dxdiagn/C…
Modified: trunk/reactos/dll/directx/wine/dxdiagn/container.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dxdiagn/c…
Modified: trunk/reactos/dll/directx/wine/dxdiagn/dxdiag_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dxdiagn/d…
Modified: trunk/reactos/dll/directx/wine/dxdiagn/dxdiag_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dxdiagn/d…
Added: trunk/reactos/dll/directx/wine/dxdiagn/dxdiagn.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dxdiagn/d…
Added: trunk/reactos/dll/directx/wine/dxdiagn/dxdiagn.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dxdiagn/d…
Added: trunk/reactos/dll/directx/wine/dxdiagn/dxdiagn.rgs URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dxdiagn/d…
Added: trunk/reactos/dll/directx/wine/dxdiagn/fil_data.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dxdiagn/f…
Modified: trunk/reactos/dll/directx/wine/dxdiagn/provider.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dxdiagn/p…
Removed: trunk/reactos/dll/directx/wine/dxdiagn/regsvr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dxdiagn/r…
Added: trunk/reactos/dll/directx/wine/dxdiagn/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dxdiagn/r…
Removed: trunk/reactos/dll/directx/wine/dxdiagn/version.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dxdiagn/v…
Added: trunk/reactos/include/reactos/wine/dxdiag.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/wine/dxdia…
Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
11 years, 2 months
1
0
0
0
[jgardou] 60499: [OPENGL32] - Do not spam debug logs with wrong calls to wglGetProcAddress
by jgardou@svn.reactos.org
Author: jgardou Date: Tue Oct 1 17:39:38 2013 New Revision: 60499 URL:
http://svn.reactos.org/svn/reactos?rev=60499&view=rev
Log: [OPENGL32] - Do not spam debug logs with wrong calls to wglGetProcAddress Modified: trunk/reactos/dll/opengl/opengl32/swimpl.c Modified: trunk/reactos/dll/opengl/opengl32/swimpl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/opengl32/swimpl…
============================================================================== --- trunk/reactos/dll/opengl/opengl32/swimpl.c [iso-8859-1] (original) +++ trunk/reactos/dll/opengl/opengl32/swimpl.c [iso-8859-1] Tue Oct 1 17:39:38 2013 @@ -102,10 +102,18 @@ { (void) ctx; if(name == GL_RENDERER) - return (const GLubyte *) "ReactOS Software Implementation"; + { + static const GLubyte renderer[] = { 'R','e','a','c','t','O','S',' ', + 'S','o','f','t','w','a','r','e',' ', + 'I','m','p','l','e','m','e','n','t','a','t','i','o','n',0 }; + return renderer; + } /* Don't claim to support the fancy extensions that mesa supports, they will be slow anyway */ if(name == GL_EXTENSIONS) - return (const GLubyte *)""; + { + static const GLubyte extensions[] = { 0 }; + return extensions; + } return NULL; } @@ -595,7 +603,7 @@ PROC sw_GetProcAddress(LPCSTR name) { /* We don't support any extensions */ - FIXME("Asking for proc address %s, returning NULL.\n", name); + WARN("Asking for proc address %s, returning NULL.\n", name); return NULL; }
11 years, 2 months
1
0
0
0
[akhaldi] 60498: [DXSDK] * Add missing INTERFACE undef.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Oct 1 17:03:53 2013 New Revision: 60498 URL:
http://svn.reactos.org/svn/reactos?rev=60498&view=rev
Log: [DXSDK] * Add missing INTERFACE undef. Modified: trunk/reactos/include/dxsdk/dxdiag.h Modified: trunk/reactos/include/dxsdk/dxdiag.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/dxsdk/dxdiag.h?rev…
============================================================================== --- trunk/reactos/include/dxsdk/dxdiag.h [iso-8859-1] (original) +++ trunk/reactos/include/dxsdk/dxdiag.h [iso-8859-1] Tue Oct 1 17:03:53 2013 @@ -52,6 +52,7 @@ STDMETHOD(Initialize) (THIS_ DXDIAG_INIT_PARAMS* pParams) PURE; STDMETHOD(GetRootContainer) (THIS_ IDxDiagContainer **ppInstance) PURE; }; +#undef INTERFACE #define DXDIAG_E_INSUFFICIENT_BUFFER ((HRESULT)0x8007007AL) #if !defined(__cplusplus) || defined(CINTERFACE)
11 years, 2 months
1
0
0
0
[akhaldi] 60497: [MESA] * Fix MSVC build.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Oct 1 16:48:56 2013 New Revision: 60497 URL:
http://svn.reactos.org/svn/reactos?rev=60497&view=rev
Log: [MESA] * Fix MSVC build. Modified: trunk/reactos/dll/opengl/mesa/src/mesa/main/mtypes.h Modified: trunk/reactos/dll/opengl/mesa/src/mesa/main/mtypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/m…
============================================================================== --- trunk/reactos/dll/opengl/mesa/src/mesa/main/mtypes.h [iso-8859-1] (original) +++ trunk/reactos/dll/opengl/mesa/src/mesa/main/mtypes.h [iso-8859-1] Tue Oct 1 16:48:56 2013 @@ -2880,7 +2880,7 @@ GLboolean ARB_texture_multisample; GLboolean ARB_texture_non_power_of_two; GLboolean ARB_texture_rg; - GLboolean ARB_texture_storage;; + GLboolean ARB_texture_storage; GLboolean ARB_transform_feedback2; GLboolean ARB_transpose_matrix; GLboolean ARB_uniform_buffer_object;
11 years, 2 months
1
0
0
0
[jgardou] 60496: [MESA] - leaner build part 3 of X - Get rid of ARB_depth_texture, ARB_sampler_objects, ARB_shadow, ARB_shadow_ambient, ARB_texture_rgb10a2ui, ARB_timer_query and EXT_texture_sRGB_d...
by jgardou@svn.reactos.org
Author: jgardou Date: Tue Oct 1 16:44:47 2013 New Revision: 60496 URL:
http://svn.reactos.org/svn/reactos?rev=60496&view=rev
Log: [MESA] - leaner build part 3 of X - Get rid of ARB_depth_texture, ARB_sampler_objects, ARB_shadow, ARB_shadow_ambient, ARB_texture_rgb10a2ui, ARB_timer_query and EXT_texture_sRGB_decode extensions Removed: trunk/reactos/dll/opengl/mesa/src/mesa/main/samplerobj.c trunk/reactos/dll/opengl/mesa/src/mesa/main/samplerobj.h Modified: trunk/reactos/dll/opengl/mesa/src/mesa/drivers/common/driverfuncs.c trunk/reactos/dll/opengl/mesa/src/mesa/drivers/common/meta.c trunk/reactos/dll/opengl/mesa/src/mesa/main/CMakeLists.txt trunk/reactos/dll/opengl/mesa/src/mesa/main/api_exec.c trunk/reactos/dll/opengl/mesa/src/mesa/main/attrib.c trunk/reactos/dll/opengl/mesa/src/mesa/main/dd.h trunk/reactos/dll/opengl/mesa/src/mesa/main/dispatch.h trunk/reactos/dll/opengl/mesa/src/mesa/main/dlist.c trunk/reactos/dll/opengl/mesa/src/mesa/main/extensions.c trunk/reactos/dll/opengl/mesa/src/mesa/main/fbobject.c trunk/reactos/dll/opengl/mesa/src/mesa/main/ff_fragment_shader.cpp trunk/reactos/dll/opengl/mesa/src/mesa/main/format_unpack.c trunk/reactos/dll/opengl/mesa/src/mesa/main/formats.c trunk/reactos/dll/opengl/mesa/src/mesa/main/formats.h trunk/reactos/dll/opengl/mesa/src/mesa/main/get.c trunk/reactos/dll/opengl/mesa/src/mesa/main/image.c trunk/reactos/dll/opengl/mesa/src/mesa/main/mtypes.h trunk/reactos/dll/opengl/mesa/src/mesa/main/queryobj.c trunk/reactos/dll/opengl/mesa/src/mesa/main/shared.c trunk/reactos/dll/opengl/mesa/src/mesa/main/texformat.c trunk/reactos/dll/opengl/mesa/src/mesa/main/texgetimage.c trunk/reactos/dll/opengl/mesa/src/mesa/main/teximage.c trunk/reactos/dll/opengl/mesa/src/mesa/main/texobj.c trunk/reactos/dll/opengl/mesa/src/mesa/main/texparam.c trunk/reactos/dll/opengl/mesa/src/mesa/main/texstate.c trunk/reactos/dll/opengl/mesa/src/mesa/main/texstore.c trunk/reactos/dll/opengl/mesa/src/mesa/main/version.c trunk/reactos/dll/opengl/mesa/src/mesa/program/prog_statevars.c trunk/reactos/dll/opengl/mesa/src/mesa/swrast/s_texfetch.c trunk/reactos/dll/opengl/mesa/src/mesa/swrast/s_texfilter.c [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/opengl/mesa/src/mesa/drivers/common/driverfuncs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/d…
Modified: trunk/reactos/dll/opengl/mesa/src/mesa/drivers/common/meta.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/d…
Modified: trunk/reactos/dll/opengl/mesa/src/mesa/main/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/m…
Modified: trunk/reactos/dll/opengl/mesa/src/mesa/main/api_exec.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/m…
Modified: trunk/reactos/dll/opengl/mesa/src/mesa/main/attrib.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/m…
Modified: trunk/reactos/dll/opengl/mesa/src/mesa/main/dd.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/m…
Modified: trunk/reactos/dll/opengl/mesa/src/mesa/main/dispatch.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/m…
Modified: trunk/reactos/dll/opengl/mesa/src/mesa/main/dlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/m…
Modified: trunk/reactos/dll/opengl/mesa/src/mesa/main/extensions.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/m…
Modified: trunk/reactos/dll/opengl/mesa/src/mesa/main/fbobject.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/m…
Modified: trunk/reactos/dll/opengl/mesa/src/mesa/main/ff_fragment_shader.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/m…
Modified: trunk/reactos/dll/opengl/mesa/src/mesa/main/format_unpack.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/m…
Modified: trunk/reactos/dll/opengl/mesa/src/mesa/main/formats.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/m…
Modified: trunk/reactos/dll/opengl/mesa/src/mesa/main/formats.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/m…
Modified: trunk/reactos/dll/opengl/mesa/src/mesa/main/get.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/m…
Modified: trunk/reactos/dll/opengl/mesa/src/mesa/main/image.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/m…
Modified: trunk/reactos/dll/opengl/mesa/src/mesa/main/mtypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/m…
Modified: trunk/reactos/dll/opengl/mesa/src/mesa/main/queryobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/m…
Removed: trunk/reactos/dll/opengl/mesa/src/mesa/main/samplerobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/m…
Removed: trunk/reactos/dll/opengl/mesa/src/mesa/main/samplerobj.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/m…
Modified: trunk/reactos/dll/opengl/mesa/src/mesa/main/shared.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/m…
Modified: trunk/reactos/dll/opengl/mesa/src/mesa/main/texformat.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/m…
Modified: trunk/reactos/dll/opengl/mesa/src/mesa/main/texgetimage.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/m…
Modified: trunk/reactos/dll/opengl/mesa/src/mesa/main/teximage.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/m…
Modified: trunk/reactos/dll/opengl/mesa/src/mesa/main/texobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/m…
Modified: trunk/reactos/dll/opengl/mesa/src/mesa/main/texparam.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/m…
Modified: trunk/reactos/dll/opengl/mesa/src/mesa/main/texstate.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/m…
Modified: trunk/reactos/dll/opengl/mesa/src/mesa/main/texstore.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/m…
Modified: trunk/reactos/dll/opengl/mesa/src/mesa/main/version.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/m…
Modified: trunk/reactos/dll/opengl/mesa/src/mesa/program/prog_statevars.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/p…
Modified: trunk/reactos/dll/opengl/mesa/src/mesa/swrast/s_texfetch.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/s…
Modified: trunk/reactos/dll/opengl/mesa/src/mesa/swrast/s_texfilter.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/s…
11 years, 2 months
1
0
0
0
[akhaldi] 60495: * Correct the sync info of dplay and dplayx (svn ?!).
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Oct 1 15:10:44 2013 New Revision: 60495 URL:
http://svn.reactos.org/svn/reactos?rev=60495&view=rev
Log: * Correct the sync info of dplay and dplayx (svn ?!). Modified: trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Oct 1 15:10:44 2013 @@ -37,8 +37,8 @@ reactos/dll/directx/wine/dinput # Synced to Wine-1.7.1 reactos/dll/directx/wine/dinput8 # Synced to Wine-1.5.26 reactos/dll/directx/wine/dmusic # Synced to Wine-1.5.26 -reactos/dll/directx/wine/dplay # Synced to Wine-1.5.26 -reactos/dll/directx/wine/dplayx # Synced to Wine-1.5.26 +reactos/dll/directx/wine/dplay # Synced to Wine-1.7.1 +reactos/dll/directx/wine/dplayx # Synced to Wine-1.7.1 reactos/dll/directx/wine/dsound # Synced to Wine-1.7.1 reactos/dll/directx/wine/dxdiagn # Synced to Wine-0_9_5 reactos/dll/directx/wine/dxgi # Synced to Wine-1.7.1
11 years, 2 months
1
0
0
0
[akhaldi] 60494: [AMSTREAM_WINETEST] * Sync with Wine 1.7.1. CORE-7469
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Oct 1 15:07:45 2013 New Revision: 60494 URL:
http://svn.reactos.org/svn/reactos?rev=60494&view=rev
Log: [AMSTREAM_WINETEST] * Sync with Wine 1.7.1. CORE-7469 Modified: trunk/rostests/winetests/amstream/CMakeLists.txt trunk/rostests/winetests/amstream/amstream.c trunk/rostests/winetests/amstream/testlist.c Modified: trunk/rostests/winetests/amstream/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/amstream/CMakeL…
============================================================================== --- trunk/rostests/winetests/amstream/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/winetests/amstream/CMakeLists.txt [iso-8859-1] Tue Oct 1 15:07:45 2013 @@ -1,8 +1,6 @@ -add_definitions(-D_DLL -D__USE_CRTIMP) add_executable(amstream_winetest amstream.c testlist.c) -target_link_libraries(amstream_winetest wine uuid) +target_link_libraries(amstream_winetest uuid) set_module_type(amstream_winetest win32cui) -add_importlibs(amstream_winetest ole32 user32 ddraw msvcrt kernel32 ntdll) -add_dependencies(amstream_winetest dxsdk) +add_importlibs(amstream_winetest ole32 user32 ddraw msvcrt kernel32) add_cd_file(TARGET amstream_winetest DESTINATION reactos/bin FOR all) Modified: trunk/rostests/winetests/amstream/amstream.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/amstream/amstre…
============================================================================== --- trunk/rostests/winetests/amstream/amstream.c [iso-8859-1] (original) +++ trunk/rostests/winetests/amstream/amstream.c [iso-8859-1] Tue Oct 1 15:07:45 2013 @@ -1,7 +1,7 @@ /* * Unit tests for MultiMedia Stream functions * - * Copyright (C) 2009 Christian Costa + * Copyright (C) 2009, 2012 Christian Costa * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -18,14 +18,22 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + #define COBJMACROS -#include "wine/test.h" -#include "initguid.h" -#include "amstream.h" - -#define FILE_LEN 9 -static const char fileA[FILE_LEN] = "test.avi"; +#include <wine/test.h> +#include <wingdi.h> +#include <winnls.h> +#include <vfwmsgs.h> +#include <objbase.h> +#include <initguid.h> +#include <amstream.h> +#include <dxsdk/uuids.h> + +static const WCHAR filenameW[] = {'t','e','s','t','.','a','v','i',0}; static IAMMultiMediaStream* pams; static IDirectDraw7* pdd7; @@ -88,21 +96,11 @@ static void test_openfile(void) { - HANDLE h; HRESULT hr; - WCHAR fileW[FILE_LEN]; IGraphBuilder* pgraph; if (!create_ammultimediastream()) return; - - h = CreateFileA(fileA, 0, 0, NULL, OPEN_EXISTING, 0, NULL); - if (h == INVALID_HANDLE_VALUE) { - release_ammultimediastream(); - return; - } - - MultiByteToWideChar(CP_ACP, 0, fileA, -1, fileW, FILE_LEN); hr = IAMMultiMediaStream_GetFilterGraph(pams, &pgraph); ok(hr==S_OK, "IAMMultiMediaStream_GetFilterGraph returned: %x\n", hr); @@ -111,7 +109,7 @@ if (pgraph) IGraphBuilder_Release(pgraph); - hr = IAMMultiMediaStream_OpenFile(pams, fileW, 0); + hr = IAMMultiMediaStream_OpenFile(pams, filenameW, 0); ok(hr==S_OK, "IAMMultiMediaStream_OpenFile returned: %x\n", hr); hr = IAMMultiMediaStream_GetFilterGraph(pams, &pgraph); @@ -124,18 +122,20 @@ release_ammultimediastream(); } -static void renderfile(const char * fileA) +static void test_renderfile(void) { HRESULT hr; - WCHAR fileW[FILE_LEN]; IMediaStream *pvidstream = NULL; IDirectDrawMediaStream *pddstream = NULL; IDirectDrawStreamSample *pddsample = NULL; + if (!create_ammultimediastream()) + return; if (!create_directdraw()) + { + release_ammultimediastream(); return; - - MultiByteToWideChar(CP_ACP, 0, fileA, -1, fileW, FILE_LEN); + } hr = IAMMultiMediaStream_Initialize(pams, STREAMTYPE_READ, 0, NULL); ok(hr==S_OK, "IAMMultiMediaStream_Initialize returned: %x\n", hr); @@ -146,7 +146,7 @@ hr = IAMMultiMediaStream_AddMediaStream(pams, NULL, &MSPID_PrimaryAudio, AMMSF_ADDDEFAULTRENDERER, NULL); ok(hr==S_OK, "IAMMultiMediaStream_AddMediaStream returned: %x\n", hr); - hr = IAMMultiMediaStream_OpenFile(pams, fileW, 0); + hr = IAMMultiMediaStream_OpenFile(pams, filenameW, 0); ok(hr==S_OK, "IAMMultiMediaStream_OpenFile returned: %x\n", hr); hr = IAMMultiMediaStream_GetMediaStream(pams, &MSPID_PrimaryVideo, &pvidstream); @@ -158,39 +158,305 @@ if (FAILED(hr)) goto error; hr = IDirectDrawMediaStream_CreateSample(pddstream, NULL, NULL, 0, &pddsample); - todo_wine ok(hr==S_OK, "IDirectDrawMediaStream_CreateSample returned: %x\n", hr); + ok(hr == S_OK, "IDirectDrawMediaStream_CreateSample returned: %x\n", hr); error: if (pddsample) - IDirectDrawMediaSample_Release(pddsample); + IDirectDrawStreamSample_Release(pddsample); if (pddstream) IDirectDrawMediaStream_Release(pddstream); if (pvidstream) IMediaStream_Release(pvidstream); release_directdraw(); -} - -static void test_render(void) -{ - HANDLE h; + release_ammultimediastream(); +} + +static void test_media_streams(void) +{ + HRESULT hr; + IMediaStream *video_stream = NULL; + IMediaStream *audio_stream = NULL; + IMediaStream *dummy_stream; + IMediaStreamFilter* media_stream_filter = NULL; if (!create_ammultimediastream()) return; - - h = CreateFileA(fileA, 0, 0, NULL, OPEN_EXISTING, 0, NULL); - if (h != INVALID_HANDLE_VALUE) { - CloseHandle(h); - renderfile(fileA); - } - + if (!create_directdraw()) + { + release_ammultimediastream(); + return; + } + + hr = IAMMultiMediaStream_Initialize(pams, STREAMTYPE_READ, 0, NULL); + ok(hr == S_OK, "IAMMultiMediaStream_Initialize returned: %x\n", hr); + + /* Retrieve media stream filter */ + hr = IAMMultiMediaStream_GetFilter(pams, NULL); + ok(hr == E_POINTER, "IAMMultiMediaStream_GetFilter returned: %x\n", hr); + hr = IAMMultiMediaStream_GetFilter(pams, &media_stream_filter); + ok(hr == S_OK, "IAMMultiMediaStream_GetFilter returned: %x\n", hr); + + /* Verify behaviour with invalid purpose id */ + hr = IAMMultiMediaStream_GetMediaStream(pams, &IID_IUnknown, &dummy_stream); + ok(hr == MS_E_NOSTREAM, "IAMMultiMediaStream_GetMediaStream returned: %x\n", hr); + hr = IAMMultiMediaStream_AddMediaStream(pams, NULL, &IID_IUnknown, 0, NULL); + ok(hr == MS_E_PURPOSEID, "IAMMultiMediaStream_AddMediaStream returned: %x\n", hr); + + /* Verify there is no video media stream */ + hr = IAMMultiMediaStream_GetMediaStream(pams, &MSPID_PrimaryVideo, &video_stream); + ok(hr == MS_E_NOSTREAM, "IAMMultiMediaStream_GetMediaStream returned: %x\n", hr); + + /* Verify there is no default renderer for video stream */ + hr = IAMMultiMediaStream_AddMediaStream(pams, (IUnknown*)pdd7, &MSPID_PrimaryVideo, AMMSF_ADDDEFAULTRENDERER, NULL); + ok(hr == MS_E_PURPOSEID, "IAMMultiMediaStream_AddMediaStream returned: %x\n", hr); + hr = IAMMultiMediaStream_GetMediaStream(pams, &MSPID_PrimaryVideo, &video_stream); + ok(hr == MS_E_NOSTREAM, "IAMMultiMediaStream_GetMediaStream returned: %x\n", hr); + hr = IAMMultiMediaStream_AddMediaStream(pams, NULL, &MSPID_PrimaryVideo, AMMSF_ADDDEFAULTRENDERER, NULL); + ok(hr == MS_E_PURPOSEID, "IAMMultiMediaStream_AddMediaStream returned: %x\n", hr); + hr = IAMMultiMediaStream_GetMediaStream(pams, &MSPID_PrimaryVideo, &video_stream); + ok(hr == MS_E_NOSTREAM, "IAMMultiMediaStream_GetMediaStream returned: %x\n", hr); + + /* Verify normal case for video stream */ + hr = IAMMultiMediaStream_AddMediaStream(pams, NULL, &MSPID_PrimaryVideo, 0, NULL); + ok(hr == S_OK, "IAMMultiMediaStream_AddMediaStream returned: %x\n", hr); + hr = IAMMultiMediaStream_GetMediaStream(pams, &MSPID_PrimaryVideo, &video_stream); + ok(hr == S_OK, "IAMMultiMediaStream_GetMediaStream returned: %x\n", hr); + + /* Verify the video stream has been added to the media stream filter */ + if (media_stream_filter) + { + hr = IMediaStreamFilter_GetMediaStream(media_stream_filter, &MSPID_PrimaryVideo, &dummy_stream); + ok(hr == S_OK, "IMediaStreamFilter_GetMediaStream returned: %x\n", hr); + ok(dummy_stream == video_stream, "Got wrong returned pointer %p, expected %p\n", dummy_stream, video_stream); + if (SUCCEEDED(hr)) + IMediaStream_Release(dummy_stream); + } + + /* Check interfaces and samples for video */ + if (video_stream) + { + IAMMediaStream* am_media_stream; + IAudioMediaStream* audio_media_stream; + IDirectDrawMediaStream *ddraw_stream = NULL; + IDirectDrawStreamSample *ddraw_sample = NULL; + + hr = IMediaStream_QueryInterface(video_stream, &IID_IAMMediaStream, (LPVOID*)&am_media_stream); + ok(hr == S_OK, "IMediaStream_QueryInterface returned: %x\n", hr); + ok((void*)am_media_stream == (void*)video_stream, "Not same interface, got %p expected %p\n", am_media_stream, video_stream); + if (hr == S_OK) + IAMMediaStream_Release(am_media_stream); + + hr = IMediaStream_QueryInterface(video_stream, &IID_IAudioMediaStream, (LPVOID*)&audio_media_stream); + ok(hr == E_NOINTERFACE, "IMediaStream_QueryInterface returned: %x\n", hr); + + hr = IMediaStream_QueryInterface(video_stream, &IID_IDirectDrawMediaStream, (LPVOID*)&ddraw_stream); + ok(hr == S_OK, "IMediaStream_QueryInterface returned: %x\n", hr); + + if (SUCCEEDED(hr)) + { + DDSURFACEDESC current_format, desired_format; + IDirectDrawPalette *palette; + DWORD flags; + + hr = IDirectDrawMediaStream_GetFormat(ddraw_stream, ¤t_format, &palette, &desired_format, &flags); + ok(hr == MS_E_NOSTREAM, "IDirectDrawoMediaStream_GetFormat returned: %x\n", hr); + + hr = IDirectDrawMediaStream_CreateSample(ddraw_stream, NULL, NULL, 0, &ddraw_sample); + ok(hr == S_OK, "IDirectDrawMediaStream_CreateSample returned: %x\n", hr); + } + + if (ddraw_sample) + IDirectDrawStreamSample_Release(ddraw_sample); + if (ddraw_stream) + IDirectDrawMediaStream_Release(ddraw_stream); + } + + /* Verify there is no audio media stream */ + hr = IAMMultiMediaStream_GetMediaStream(pams, &MSPID_PrimaryAudio, &audio_stream); + ok(hr == MS_E_NOSTREAM, "IAMMultiMediaStream_GetMediaStream returned: %x\n", hr); + + /* Verify no stream is created when using the default renderer for audio stream */ + hr = IAMMultiMediaStream_AddMediaStream(pams, NULL, &MSPID_PrimaryAudio, AMMSF_ADDDEFAULTRENDERER, NULL); + ok((hr == S_OK) || (hr == VFW_E_NO_AUDIO_HARDWARE), "IAMMultiMediaStream_AddMediaStream returned: %x\n", hr); + if (hr == S_OK) + { + IGraphBuilder* filtergraph = NULL; + IBaseFilter* filter = NULL; + const WCHAR name[] = {'0','0','0','1',0}; + CLSID clsid; + + hr = IAMMultiMediaStream_GetFilterGraph(pams, &filtergraph); + ok(hr == S_OK, "IAMMultiMediaStream_GetFilterGraph returned: %x\n", hr); + if (hr == S_OK) + { + hr = IGraphBuilder_FindFilterByName(filtergraph, name, &filter); + ok(hr == S_OK, "IGraphBuilder_FindFilterByName returned: %x\n", hr); + } + if (hr == S_OK) + { + hr = IBaseFilter_GetClassID(filter, &clsid); + ok(hr == S_OK, "IGraphBuilder_FindFilterByName returned: %x\n", hr); + } + if (hr == S_OK) + ok(IsEqualGUID(&clsid, &CLSID_DSoundRender), "Got wrong CLSID\n"); + if (filter) + IBaseFilter_Release(filter); + if (filtergraph) + IGraphBuilder_Release(filtergraph); + } + hr = IAMMultiMediaStream_GetMediaStream(pams, &MSPID_PrimaryAudio, &audio_stream); + ok(hr == MS_E_NOSTREAM, "IAMMultiMediaStream_GetMediaStream returned: %x\n", hr); + + /* Verify a stream is created when no default renderer is used */ + hr = IAMMultiMediaStream_AddMediaStream(pams, NULL, &MSPID_PrimaryAudio, 0, NULL); + ok(hr == S_OK, "IAMMultiMediaStream_AddMediaStream returned: %x\n", hr); + hr = IAMMultiMediaStream_GetMediaStream(pams, &MSPID_PrimaryAudio, &audio_stream); + ok(hr == S_OK, "IAMMultiMediaStream_GetMediaStream returned: %x\n", hr); + + /* verify the audio stream has been added to the media stream filter */ + if (media_stream_filter) + { + hr = IMediaStreamFilter_GetMediaStream(media_stream_filter, &MSPID_PrimaryAudio, &dummy_stream); + ok(hr == S_OK, "IAMMultiMediaStream_GetMediaStream returned: %x\n", hr); + ok(dummy_stream == audio_stream, "Got wrong returned pointer %p, expected %p\n", dummy_stream, audio_stream); + if (SUCCEEDED(hr)) + IMediaStream_Release(dummy_stream); + } + + /* Check interfaces and samples for audio */ + if (audio_stream) + { + IAMMediaStream* am_media_stream; + IDirectDrawMediaStream* ddraw_stream = NULL; + IAudioMediaStream* audio_media_stream = NULL; + IAudioStreamSample *audio_sample = NULL; + + hr = IMediaStream_QueryInterface(audio_stream, &IID_IAMMediaStream, (LPVOID*)&am_media_stream); + ok(hr == S_OK, "IMediaStream_QueryInterface returned: %x\n", hr); + ok((void*)am_media_stream == (void*)audio_stream, "Not same interface, got %p expected %p\n", am_media_stream, audio_stream); + if (hr == S_OK) + IAMMediaStream_Release(am_media_stream); + + hr = IMediaStream_QueryInterface(audio_stream, &IID_IDirectDrawMediaStream, (LPVOID*)&ddraw_stream); + ok(hr == E_NOINTERFACE, "IMediaStream_QueryInterface returned: %x\n", hr); + + hr = IMediaStream_QueryInterface(audio_stream, &IID_IAudioMediaStream, (LPVOID*)&audio_media_stream); + ok(hr == S_OK, "IMediaStream_QueryInterface returned: %x\n", hr); + + if (SUCCEEDED(hr)) + { + IAudioData* audio_data = NULL; + WAVEFORMATEX format; + + hr = CoCreateInstance(&CLSID_AMAudioData, NULL, CLSCTX_INPROC_SERVER, &IID_IAudioData, (void **)&audio_data); + ok(hr == S_OK, "CoCreateInstance returned: %x\n", hr); + + hr = IAudioMediaStream_GetFormat(audio_media_stream, NULL); + ok(hr == E_POINTER, "IAudioMediaStream_GetFormat returned: %x\n", hr); + hr = IAudioMediaStream_GetFormat(audio_media_stream, &format); + ok(hr == MS_E_NOSTREAM, "IAudioMediaStream_GetFormat returned: %x\n", hr); + + hr = IAudioMediaStream_CreateSample(audio_media_stream, NULL, 0, &audio_sample); + ok(hr == E_POINTER, "IAudioMediaStream_CreateSample returned: %x\n", hr); + hr = IAudioMediaStream_CreateSample(audio_media_stream, audio_data, 0, &audio_sample); + ok(hr == S_OK, "IAudioMediaStream_CreateSample returned: %x\n", hr); + + if (audio_data) + IAudioData_Release(audio_data); + if (audio_sample) + IAudioStreamSample_Release(audio_sample); + if (audio_media_stream) + IAudioMediaStream_Release(audio_media_stream); + } + } + + if (media_stream_filter) + { + IEnumPins *enum_pins; + + hr = IMediaStreamFilter_EnumPins(media_stream_filter, &enum_pins); + ok(hr == S_OK, "IBaseFilter_EnumPins returned: %x\n", hr); + if (hr == S_OK) + { + IPin* pins[3] = { NULL, NULL, NULL }; + ULONG nb_pins; + ULONG expected_nb_pins = audio_stream ? 2 : 1; + int i; + + hr = IEnumPins_Next(enum_pins, 3, pins, &nb_pins); + ok(SUCCEEDED(hr), "IEnumPins_Next returned: %x\n", hr); + ok(nb_pins == expected_nb_pins, "Number of pins is %u instead of %u\n", nb_pins, expected_nb_pins); + for (i = 0; i < min(nb_pins, expected_nb_pins); i++) + { + IEnumMediaTypes* enum_media_types; + AM_MEDIA_TYPE* media_types[10]; + ULONG nb_media_types; + IPin* pin; + PIN_INFO info; + WCHAR id[40]; + + /* Pin name is "I{guid MSPID_PrimaryVideo or MSPID_PrimaryAudio}" */ + id[0] = 'I'; + StringFromGUID2(i ? &MSPID_PrimaryAudio : &MSPID_PrimaryVideo, id + 1, 40); + + hr = IPin_ConnectedTo(pins[i], &pin); + ok(hr == VFW_E_NOT_CONNECTED, "IPin_ConnectedTo returned: %x\n", hr); + hr = IPin_QueryPinInfo(pins[i], &info); + ok(hr == S_OK, "IPin_QueryPinInfo returned: %x\n", hr); + IBaseFilter_Release(info.pFilter); + ok(info.dir == PINDIR_INPUT, "Pin direction is %u instead of %u\n", info.dir, PINDIR_INPUT); + ok(!lstrcmpW(info.achName, id), "Pin name is %s instead of %s\n", wine_dbgstr_w(info.achName), wine_dbgstr_w(id)); + hr = IPin_EnumMediaTypes(pins[i], &enum_media_types); + ok(hr == S_OK, "IPin_EnumMediaTypes returned: %x\n", hr); + hr = IEnumMediaTypes_Next(enum_media_types, sizeof(media_types) / sizeof(AM_MEDIA_TYPE), media_types, &nb_media_types); + ok(SUCCEEDED(hr), "IEnumMediaTypes_Next returned: %x\n", hr); + ok(nb_media_types == 0, "nb_media_types should be 0 instead of %u\n", nb_media_types); + IEnumMediaTypes_Release(enum_media_types); + IPin_Release(pins[i]); + } + IEnumPins_Release(enum_pins); + } + } + + /* Test open file with no filename */ + hr = IAMMultiMediaStream_OpenFile(pams, NULL, 0); + ok(hr == E_POINTER, "IAMMultiMediaStream_OpenFile returned %x instead of %x\n", hr, E_POINTER); + + if (video_stream) + IMediaStream_Release(video_stream); + if (audio_stream) + IMediaStream_Release(audio_stream); + if (media_stream_filter) + IMediaStreamFilter_Release(media_stream_filter); + + release_directdraw(); release_ammultimediastream(); } START_TEST(amstream) { + HANDLE file; + CoInitializeEx(NULL, COINIT_MULTITHREADED); - test_openfile(); - test_render(); + + if (!winetest_interactive) + { + win_skip("test_media_streams(), ROSTESTS-123\n"); + } + else + { + test_media_streams(); + } + + file = CreateFileW(filenameW, 0, 0, NULL, OPEN_EXISTING, 0, NULL); + if (file != INVALID_HANDLE_VALUE) + { + CloseHandle(file); + + test_openfile(); + test_renderfile(); + } + CoUninitialize(); } Modified: trunk/rostests/winetests/amstream/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/amstream/testli…
============================================================================== --- trunk/rostests/winetests/amstream/testlist.c [iso-8859-1] (original) +++ trunk/rostests/winetests/amstream/testlist.c [iso-8859-1] Tue Oct 1 15:07:45 2013 @@ -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_amstream(void);
11 years, 2 months
1
0
0
0
[akhaldi] 60493: [AMSTREAM] * Sync with Wine 1.7.1. CORE-7469
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Oct 1 15:06:37 2013 New Revision: 60493 URL:
http://svn.reactos.org/svn/reactos?rev=60493&view=rev
Log: [AMSTREAM] * Sync with Wine 1.7.1. CORE-7469 Added: trunk/reactos/dll/directx/wine/amstream/amstream_classes.rgs (with props) trunk/reactos/dll/directx/wine/amstream/audiodata.c (with props) Removed: trunk/reactos/dll/directx/wine/amstream/amstream.rgs Modified: trunk/reactos/dll/directx/wine/amstream/CMakeLists.txt trunk/reactos/dll/directx/wine/amstream/amstream.c trunk/reactos/dll/directx/wine/amstream/amstream_classes.idl trunk/reactos/dll/directx/wine/amstream/amstream_private.h trunk/reactos/dll/directx/wine/amstream/main.c trunk/reactos/dll/directx/wine/amstream/mediastream.c trunk/reactos/dll/directx/wine/amstream/mediastreamfilter.c trunk/reactos/dll/directx/wine/amstream/version.rc trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/directx/wine/amstream/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/amstream/…
============================================================================== --- trunk/reactos/dll/directx/wine/amstream/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/amstream/CMakeLists.txt [iso-8859-1] Tue Oct 1 15:06:37 2013 @@ -1,23 +1,21 @@ -add_definitions(-D__WINESRC__) - -remove_definitions(-D_WIN32_WINNT=0x502) -add_definitions(-D_WIN32_WINNT=0x600) +add_definitions( + -D__WINESRC__ + -DWIDL_C_INLINE_WRAPPERS) include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine) - spec2def(amstream.dll amstream.spec) -add_library(amstream SHARED +list(APPEND SOURCE amstream.c + audiodata.c main.c mediastream.c mediastreamfilter.c - version.rc ${CMAKE_CURRENT_BINARY_DIR}/amstream.def) +add_library(amstream SHARED ${SOURCE} version.rc) set_module_type(amstream win32dll) -target_link_libraries(amstream strmiids uuid wine) -add_importlibs(amstream ole32 advapi32 msvcrt kernel32 ntdll) -add_dependencies(amstream dxsdk) +target_link_libraries(amstream strmbase strmiids uuid wine) +add_importlibs(amstream ole32 msvcrt kernel32 ntdll) add_cd_file(TARGET amstream DESTINATION reactos/system32 FOR all) Modified: trunk/reactos/dll/directx/wine/amstream/amstream.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/amstream/…
============================================================================== --- trunk/reactos/dll/directx/wine/amstream/amstream.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/amstream/amstream.c [iso-8859-1] Tue Oct 1 15:06:37 2013 @@ -1,7 +1,7 @@ /* * Implementation of IAMMultiMediaStream Interface * - * Copyright 2004 Christian Costa + * Copyright 2004, 2012 Christian Costa * Copyright 2006 Ivan Leo Puoti * * This library is free software; you can redistribute it and/or @@ -35,11 +35,14 @@ IAMMultiMediaStream IAMMultiMediaStream_iface; LONG ref; IGraphBuilder* pFilterGraph; + IMediaSeeking* media_seeking; + IMediaControl* media_control; + IBaseFilter* media_stream_filter; IPin* ipin; - IGraphBuilder* GraphBuilder; ULONG nbStreams; IMediaStream** pStreams; STREAM_TYPE StreamType; + OAEVENT event; } IAMMultiMediaStreamImpl; static inline IAMMultiMediaStreamImpl *impl_from_IAMMultiMediaStream(IAMMultiMediaStream *iface) @@ -60,10 +63,7 @@ object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IAMMultiMediaStreamImpl)); if (!object) - { - ERR("Out of memory\n"); return E_OUTOFMEMORY; - } object->IAMMultiMediaStream_iface.lpVtbl = &AM_Vtbl; object->ref = 1; @@ -84,8 +84,8 @@ IsEqualGUID(riid, &IID_IMultiMediaStream) || IsEqualGUID(riid, &IID_IAMMultiMediaStream)) { - IUnknown_AddRef(iface); - *ppvObject = This; + IAMMultiMediaStream_AddRef(iface); + *ppvObject = iface; return S_OK; } @@ -107,11 +107,26 @@ { IAMMultiMediaStreamImpl *This = impl_from_IAMMultiMediaStream(iface); ULONG ref = InterlockedDecrement(&This->ref); + ULONG i; TRACE("(%p/%p)\n", iface, This); if (!ref) + { + for(i = 0; i < This->nbStreams; i++) + IMediaStream_Release(This->pStreams[i]); + if (This->ipin) + IPin_Release(This->ipin); + if (This->media_stream_filter) + IBaseFilter_Release(This->media_stream_filter); + if (This->media_seeking) + IMediaSeeking_Release(This->media_seeking); + if (This->media_control) + IMediaControl_Release(This->media_control); + if (This->pFilterGraph) + IGraphBuilder_Release(This->pFilterGraph); HeapFree(GetProcessHeap(), 0, This); + } return ref; } @@ -166,13 +181,19 @@ return E_NOTIMPL; } -static HRESULT WINAPI IAMMultiMediaStreamImpl_SetState(IAMMultiMediaStream* iface, STREAM_STATE NewState) -{ - IAMMultiMediaStreamImpl *This = impl_from_IAMMultiMediaStream(iface); - - FIXME("(%p/%p)->() stub!\n", This, iface); - - return E_NOTIMPL; +static HRESULT WINAPI IAMMultiMediaStreamImpl_SetState(IAMMultiMediaStream* iface, STREAM_STATE new_state) +{ + IAMMultiMediaStreamImpl *This = impl_from_IAMMultiMediaStream(iface); + HRESULT hr = E_INVALIDARG; + + TRACE("(%p/%p)->(%u)\n", This, iface, new_state); + + if (new_state == STREAMSTATE_RUN) + hr = IMediaControl_Run(This->media_control); + else if (new_state == STREAMSTATE_STOP) + hr = IMediaControl_Stop(This->media_control); + + return hr; } static HRESULT WINAPI IAMMultiMediaStreamImpl_GetTime(IAMMultiMediaStream* iface, STREAM_TIME* pCurrentTime) @@ -193,13 +214,13 @@ return E_NOTIMPL; } -static HRESULT WINAPI IAMMultiMediaStreamImpl_Seek(IAMMultiMediaStream* iface, STREAM_TIME SeekTime) -{ - IAMMultiMediaStreamImpl *This = impl_from_IAMMultiMediaStream(iface); - - FIXME("(%p/%p)->() stub!\n", This, iface); - - return E_NOTIMPL; +static HRESULT WINAPI IAMMultiMediaStreamImpl_Seek(IAMMultiMediaStream* iface, STREAM_TIME seek_time) +{ + IAMMultiMediaStreamImpl *This = impl_from_IAMMultiMediaStream(iface); + + TRACE("(%p/%p)->(%s)\n", This, iface, wine_dbgstr_longlong(seek_time)); + + return IMediaSeeking_SetPositions(This->media_seeking, &seek_time, AM_SEEKING_AbsolutePositioning, NULL, AM_SEEKING_NoPositioning); } static HRESULT WINAPI IAMMultiMediaStreamImpl_GetEndOfStream(IAMMultiMediaStream* iface, HANDLE* phEOS) @@ -216,6 +237,7 @@ { IAMMultiMediaStreamImpl *This = impl_from_IAMMultiMediaStream(iface); HRESULT hr = S_OK; + const WCHAR filternameW[] = {'M','e','d','i','a','S','t','r','e','a','m','F','i','l','t','e','r',0}; TRACE("(%p/%p)->(%x,%x,%p)\n", This, iface, (DWORD)StreamType, dwFlags, pFilterGraph); @@ -232,6 +254,40 @@ if (SUCCEEDED(hr)) { This->StreamType = StreamType; + hr = IGraphBuilder_QueryInterface(This->pFilterGraph, &IID_IMediaSeeking, (void**)&This->media_seeking); + if (SUCCEEDED(hr)) + IGraphBuilder_QueryInterface(This->pFilterGraph, &IID_IMediaControl, (void**)&This->media_control); + if (SUCCEEDED(hr)) + hr = CoCreateInstance(&CLSID_MediaStreamFilter, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (LPVOID*)&This->media_stream_filter); + if (SUCCEEDED(hr)) + IGraphBuilder_AddFilter(This->pFilterGraph, This->media_stream_filter, filternameW); + if (SUCCEEDED(hr)) + { + IMediaEventEx* media_event = NULL; + hr = IGraphBuilder_QueryInterface(This->pFilterGraph, &IID_IMediaEventEx, (void**)&media_event); + if (SUCCEEDED(hr)) + hr = IMediaEventEx_GetEventHandle(media_event, &This->event); + if (SUCCEEDED(hr)) + hr = IMediaEventEx_SetNotifyFlags(media_event, AM_MEDIAEVENT_NONOTIFY); + if (media_event) + IMediaEventEx_Release(media_event); + } + } + + if (FAILED(hr)) + { + if (This->media_stream_filter) + IBaseFilter_Release(This->media_stream_filter); + This->media_stream_filter = NULL; + if (This->media_seeking) + IMediaSeeking_Release(This->media_seeking); + This->media_seeking = NULL; + if (This->media_control) + IMediaControl_Release(This->media_control); + This->media_control = NULL; + if (This->pFilterGraph) + IGraphBuilder_Release(This->pFilterGraph); + This->pFilterGraph = NULL; } return hr; @@ -247,7 +303,7 @@ return E_POINTER; if (This->pFilterGraph) - return IFilterGraph_QueryInterface(This->pFilterGraph, &IID_IGraphBuilder, (void**)ppGraphBuilder); + return IGraphBuilder_QueryInterface(This->pFilterGraph, &IID_IGraphBuilder, (void**)ppGraphBuilder); else *ppGraphBuilder = NULL; @@ -257,13 +313,22 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_GetFilter(IAMMultiMediaStream* iface, IMediaStreamFilter** ppFilter) { IAMMultiMediaStreamImpl *This = impl_from_IAMMultiMediaStream(iface); - - FIXME("(%p/%p)->(%p) stub!\n", This, iface, ppFilter); - - return E_NOTIMPL; -} - -static HRESULT WINAPI IAMMultiMediaStreamImpl_AddMediaStream(IAMMultiMediaStream* iface, IUnknown* pStreamObject, const MSPID* PurposeId, + HRESULT hr = S_OK; + + TRACE("(%p/%p)->(%p)\n", This, iface, ppFilter); + + if (!ppFilter) + return E_POINTER; + + *ppFilter = NULL; + + if (This->media_stream_filter) + hr = IBaseFilter_QueryInterface(This->media_stream_filter, &IID_IMediaStreamFilter, (LPVOID*)ppFilter); + + return hr; +} + +static HRESULT WINAPI IAMMultiMediaStreamImpl_AddMediaStream(IAMMultiMediaStream* iface, IUnknown* stream_object, const MSPID* PurposeId, DWORD dwFlags, IMediaStream** ppNewStream) { IAMMultiMediaStreamImpl *This = impl_from_IAMMultiMediaStream(iface); @@ -271,9 +336,42 @@ IMediaStream* pStream; IMediaStream** pNewStreams; - FIXME("(%p/%p)->(%p,%s,%x,%p) partial stub!\n", This, iface, pStreamObject, debugstr_guid(PurposeId), dwFlags, ppNewStream); - - hr = mediastream_create((IMultiMediaStream*)iface, PurposeId, This->StreamType, &pStream); + TRACE("(%p/%p)->(%p,%s,%x,%p)\n", This, iface, stream_object, debugstr_guid(PurposeId), dwFlags, ppNewStream); + + if (!IsEqualGUID(PurposeId, &MSPID_PrimaryVideo) && !IsEqualGUID(PurposeId, &MSPID_PrimaryAudio)) + return MS_E_PURPOSEID; + + if (stream_object) + FIXME("Specifying a stream object in params is not yet supported\n"); + + if (dwFlags & AMMSF_ADDDEFAULTRENDERER) + { + if (IsEqualGUID(PurposeId, &MSPID_PrimaryVideo)) + { + /* Default renderer not supported by video stream */ + return MS_E_PURPOSEID; + } + else + { + IBaseFilter* dsoundrender_filter; + + /* Create the default renderer for audio */ + hr = CoCreateInstance(&CLSID_DSoundRender, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (LPVOID*)&dsoundrender_filter); + if (SUCCEEDED(hr)) + { + hr = IGraphBuilder_AddFilter(This->pFilterGraph, dsoundrender_filter, NULL); + IBaseFilter_Release(dsoundrender_filter); + } + + /* No media stream created when the default renderer is used */ + return hr; + } + } + + if (IsEqualGUID(PurposeId, &MSPID_PrimaryVideo)) + hr = ddrawmediastream_create((IMultiMediaStream*)iface, PurposeId, This->StreamType, &pStream); + else + hr = audiomediastream_create((IMultiMediaStream*)iface, PurposeId, This->StreamType, &pStream); if (SUCCEEDED(hr)) { pNewStreams = CoTaskMemRealloc(This->pStreams, (This->nbStreams+1) * sizeof(IMediaStream*)); @@ -290,80 +388,57 @@ *ppNewStream = pStream; } + if (SUCCEEDED(hr)) + { + /* Add stream to the media stream filter */ + IMediaStreamFilter_AddMediaStream((IMediaStreamFilter*)This->media_stream_filter, (IAMMediaStream*)pStream); + } + return hr; } -static HRESULT WINAPI IAMMultiMediaStreamImpl_OpenFile(IAMMultiMediaStream* iface, LPCWSTR pszFileName, DWORD dwFlags) -{ - HRESULT ret; - IAMMultiMediaStreamImpl *This = impl_from_IAMMultiMediaStream(iface); - IFileSourceFilter *SourceFilter; - IBaseFilter *BaseFilter; - IEnumPins *EnumPins; +static HRESULT WINAPI IAMMultiMediaStreamImpl_OpenFile(IAMMultiMediaStream* iface, LPCWSTR filename, DWORD flags) +{ + IAMMultiMediaStreamImpl *This = impl_from_IAMMultiMediaStream(iface); + HRESULT ret = S_OK; + IBaseFilter *BaseFilter = NULL; + IEnumPins *EnumPins = NULL; IPin *ipin; PIN_DIRECTION pin_direction; - - TRACE("(%p/%p)->(%s,%x)\n", This, iface, debugstr_w(pszFileName), dwFlags); - - ret = CoCreateInstance(&CLSID_AsyncReader, NULL, CLSCTX_INPROC_SERVER, &IID_IFileSourceFilter, (void**)&SourceFilter); - if(ret != S_OK) - return ret; - - ret = IFileSourceFilter_Load(SourceFilter, pszFileName, NULL); - if(ret != S_OK) - { - IFileSourceFilter_Release(SourceFilter); - return ret; - } - - ret = IFileSourceFilter_QueryInterface(SourceFilter, &IID_IBaseFilter, (void**)&BaseFilter); - if(ret != S_OK) - { - IFileSourceFilter_Release(SourceFilter); - return ret; - } - - ret = IBaseFilter_EnumPins(BaseFilter, &EnumPins); - if(ret != S_OK) - { - goto end; - } - - ret = IEnumPins_Next(EnumPins, 1, &ipin, NULL); - if(ret == S_OK) - { - ret = IPin_QueryDirection(ipin, &pin_direction); - IEnumPins_Release(EnumPins); - if(ret == S_OK && pin_direction == PINDIR_OUTPUT) - This->ipin = ipin; - else - goto end; - } - else - { - IEnumPins_Release(EnumPins); - goto end; - } + const WCHAR sourceW[] = {'S','o','u','r','c','e',0}; + + TRACE("(%p/%p)->(%s,%x)\n", This, iface, debugstr_w(filename), flags); + + if (!filename) + return E_POINTER; /* If Initialize was not called before, we do it here */ if (!This->pFilterGraph) - { ret = IAMMultiMediaStream_Initialize(iface, STREAMTYPE_READ, 0, NULL); - if (FAILED(ret)) - goto end; - } - - ret = IFilterGraph_QueryInterface(This->pFilterGraph, &IID_IGraphBuilder, (void**)&This->GraphBuilder); - if(ret != S_OK) - { - goto end; - } - - ret = IGraphBuilder_AddSourceFilter(This->GraphBuilder, pszFileName, pszFileName, &BaseFilter); - -end: - IBaseFilter_Release(BaseFilter); - IFileSourceFilter_Release(SourceFilter); + + if (SUCCEEDED(ret)) + ret = IGraphBuilder_AddSourceFilter(This->pFilterGraph, filename, sourceW, &BaseFilter); + + if (SUCCEEDED(ret)) + ret = IBaseFilter_EnumPins(BaseFilter, &EnumPins); + + if (SUCCEEDED(ret)) + ret = IEnumPins_Next(EnumPins, 1, &ipin, NULL); + + if (SUCCEEDED(ret)) + { + ret = IPin_QueryDirection(ipin, &pin_direction); + if (ret == S_OK && pin_direction == PINDIR_OUTPUT) + This->ipin = ipin; + } + + if (SUCCEEDED(ret) && !(flags & AMMSF_NORENDER)) + ret = IGraphBuilder_Render(This->pFilterGraph, This->ipin); + + if (EnumPins) + IEnumPins_Release(EnumPins); + if (BaseFilter) + IBaseFilter_Release(BaseFilter); return ret; } @@ -385,7 +460,7 @@ if(dwFlags != AMMSF_NOCLOCK) return E_INVALIDARG; - return IGraphBuilder_Render(This->GraphBuilder, This->ipin); + return IGraphBuilder_Render(This->pFilterGraph, This->ipin); } static const IAMMultiMediaStreamVtbl AM_Vtbl = Removed: trunk/reactos/dll/directx/wine/amstream/amstream.rgs URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/amstream/…
============================================================================== --- trunk/reactos/dll/directx/wine/amstream/amstream.rgs [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/amstream/amstream.rgs (removed) @@ -1,21 +0,0 @@ -HKCR -{ - NoRemove Interface - { - } - NoRemove CLSID - { - '{49C47CE0-9BA4-11D0-8212-00C04FC32C45}' = s 'SFilter Class' - { - InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' } - } - '{49C47CE4-9BA4-11D0-8212-00C04FC32C45}' = s 'Stream Class' - { - InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' } - } - '{49C47CE5-9BA4-11D0-8212-00C04FC32C45}' = s 'MMStream Class' - { - InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' } - } - } -} Modified: trunk/reactos/dll/directx/wine/amstream/amstream_classes.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/amstream/…
============================================================================== --- trunk/reactos/dll/directx/wine/amstream/amstream_classes.idl [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/amstream/amstream_classes.idl [iso-8859-1] Tue Oct 1 15:06:37 2013 @@ -38,3 +38,10 @@ uuid(49c47ce5-9ba4-11d0-8212-00c04fc32c45) ] coclass AMMultiMediaStream { interface IAMMultiMediaStream; } + +[ + helpstring("AuStream Class"), + threading(both), + uuid(f2468580-af8a-11d0-8212-00c04fc32c45) +] +coclass AMAudioData { interface IAudioData; } Added: trunk/reactos/dll/directx/wine/amstream/amstream_classes.rgs URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/amstream/…
============================================================================== --- trunk/reactos/dll/directx/wine/amstream/amstream_classes.rgs (added) +++ trunk/reactos/dll/directx/wine/amstream/amstream_classes.rgs [iso-8859-1] Tue Oct 1 15:06:37 2013 @@ -0,0 +1,25 @@ +HKCR +{ + NoRemove Interface + { + } + NoRemove CLSID + { + '{49C47CE0-9BA4-11D0-8212-00C04FC32C45}' = s 'SFilter Class' + { + InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' } + } + '{49C47CE4-9BA4-11D0-8212-00C04FC32C45}' = s 'Stream Class' + { + InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' } + } + '{49C47CE5-9BA4-11D0-8212-00C04FC32C45}' = s 'MMStream Class' + { + InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' } + } + '{F2468580-AF8A-11D0-8212-00C04FC32C45}' = s 'AuStream Class' + { + InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' } + } + } +} Propchange: trunk/reactos/dll/directx/wine/amstream/amstream_classes.rgs ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/directx/wine/amstream/amstream_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/amstream/…
============================================================================== --- trunk/reactos/dll/directx/wine/amstream/amstream_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/amstream/amstream_private.h [iso-8859-1] Tue Oct 1 15:06:37 2013 @@ -33,10 +33,14 @@ //#include "winuser.h" #include <dshow.h> #include <mmstream.h> +#include <austream.h> HRESULT AM_create(IUnknown *pUnkOuter, LPVOID *ppObj) DECLSPEC_HIDDEN; +HRESULT AMAudioData_create(IUnknown *pUnkOuter, LPVOID *ppObj) DECLSPEC_HIDDEN; HRESULT MediaStreamFilter_create(IUnknown *pUnkOuter, LPVOID *ppObj) DECLSPEC_HIDDEN; -HRESULT mediastream_create(IMultiMediaStream *Parent, const MSPID *pPurposeId, +HRESULT ddrawmediastream_create(IMultiMediaStream *Parent, const MSPID *pPurposeId, STREAM_TYPE StreamType, IMediaStream **ppMediaStream) DECLSPEC_HIDDEN; +HRESULT audiomediastream_create(IMultiMediaStream *parent, const MSPID *purpose_id, + STREAM_TYPE stream_type, IMediaStream **media_stream) DECLSPEC_HIDDEN; #endif /* __AMSTREAM_PRIVATE_INCLUDED__ */ Added: trunk/reactos/dll/directx/wine/amstream/audiodata.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/amstream/…
============================================================================== --- trunk/reactos/dll/directx/wine/amstream/audiodata.c (added) +++ trunk/reactos/dll/directx/wine/amstream/audiodata.c [iso-8859-1] Tue Oct 1 15:06:37 2013 @@ -0,0 +1,154 @@ +/* + * Implementation of IAudioData Interface + * + * Copyright 2012 Christian Costa + * + * 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 + */ + +#include "wine/debug.h" + +#define COBJMACROS + +#include "winbase.h" +#include "amstream_private.h" + +#include "amstream.h" + +WINE_DEFAULT_DEBUG_CHANNEL(amstream); + +typedef struct { + IAudioData IAudioData_iface; + LONG ref; +} AMAudioDataImpl; + +static inline AMAudioDataImpl *impl_from_IAudioData(IAudioData *iface) +{ + return CONTAINING_RECORD(iface, AMAudioDataImpl, IAudioData_iface); +} + +/*** IUnknown methods ***/ +static HRESULT WINAPI IAudioDataImpl_QueryInterface(IAudioData *iface, REFIID riid, void **ret_iface) +{ + TRACE("(%p)->(%s,%p)\n", iface, debugstr_guid(riid), ret_iface); + + if (IsEqualGUID(riid, &IID_IUnknown) || + IsEqualGUID(riid, &IID_IMemoryData) || + IsEqualGUID(riid, &IID_IAudioData)) + { + IAudioData_AddRef(iface); + *ret_iface = iface; + return S_OK; + } + + ERR("(%p)->(%s,%p),not found\n", iface, debugstr_guid(riid), ret_iface); + return E_NOINTERFACE; +} + +static ULONG WINAPI IAudioDataImpl_AddRef(IAudioData* iface) +{ + AMAudioDataImpl *This = impl_from_IAudioData(iface); + ULONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p)->(): new ref = %u\n", iface, This->ref); + + return ref; +} + +static ULONG WINAPI IAudioDataImpl_Release(IAudioData* iface) +{ + AMAudioDataImpl *This = impl_from_IAudioData(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p)->(): new ref = %u\n", iface, This->ref); + + if (!ref) + HeapFree(GetProcessHeap(), 0, This); + + return ref; +} + +/*** IMemoryData methods ***/ +static HRESULT WINAPI IAudioDataImpl_SetBuffer(IAudioData* iface, DWORD size, BYTE *data, DWORD flags) +{ + FIXME("(%p)->(%u,%p,%x): stub\n", iface, size, data, flags); + + return E_NOTIMPL; +} + +static HRESULT WINAPI IAudioDataImpl_GetInfo(IAudioData* iface, DWORD *length, BYTE **data, DWORD *actual_data) +{ + FIXME("(%p)->(%p,%p,%p): stub\n", iface, length, data, actual_data); + + return E_NOTIMPL; +} + +static HRESULT WINAPI IAudioDataImpl_SetActual(IAudioData* iface, DWORD data_valid) +{ + FIXME("(%p)->(%u): stub\n", iface, data_valid); + + return E_NOTIMPL; +} + +/*** IAudioData methods ***/ +static HRESULT WINAPI IAudioDataImpl_GetFormat(IAudioData* iface, WAVEFORMATEX *wave_format_current) +{ + FIXME("(%p)->(%p): stub\n", iface, wave_format_current); + + return E_NOTIMPL; +} + +static HRESULT WINAPI IAudioDataImpl_SetFormat(IAudioData* iface, const WAVEFORMATEX *wave_format) +{ + FIXME("(%p)->(%p): stub\n", iface, wave_format); + + return E_NOTIMPL; +} + +static const struct IAudioDataVtbl AudioData_Vtbl = +{ + /*** IUnknown methods ***/ + IAudioDataImpl_QueryInterface, + IAudioDataImpl_AddRef, + IAudioDataImpl_Release, + /*** IMemoryData methods ***/ + IAudioDataImpl_SetBuffer, + IAudioDataImpl_GetInfo, + IAudioDataImpl_SetActual, + /*** IAudioData methods ***/ + IAudioDataImpl_GetFormat, + IAudioDataImpl_SetFormat +}; + +HRESULT AMAudioData_create(IUnknown *pUnkOuter, LPVOID *ppObj) +{ + AMAudioDataImpl *object; + + TRACE("(%p,%p)\n", pUnkOuter, ppObj); + + if (pUnkOuter) + return CLASS_E_NOAGGREGATION; + + object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(AMAudioDataImpl)); + if (!object) + return E_OUTOFMEMORY; + + object->IAudioData_iface.lpVtbl = &AudioData_Vtbl; + object->ref = 1; + + *ppObj = &object->IAudioData_iface; + + return S_OK; +} Propchange: trunk/reactos/dll/directx/wine/amstream/audiodata.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/directx/wine/amstream/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/amstream/…
============================================================================== --- trunk/reactos/dll/directx/wine/amstream/main.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/amstream/main.c [iso-8859-1] Tue Oct 1 15:06:37 2013 @@ -53,8 +53,6 @@ instance = hInstDLL; DisableThreadLibraryCalls(hInstDLL); break; - case DLL_PROCESS_DETACH: - break; } return TRUE; } @@ -63,12 +61,16 @@ * Multimedia Streams ClassFactory */ typedef struct { - IClassFactory ITF_IClassFactory; - + IClassFactory IClassFactory_iface; LONG ref; HRESULT (*pfnCreateInstance)(IUnknown *pUnkOuter, LPVOID *ppObj); } IClassFactoryImpl; +static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface) +{ + return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface); +} + struct object_creation_info { const CLSID *clsid; @@ -79,36 +81,34 @@ { { &CLSID_AMMultiMediaStream, AM_create }, { &CLSID_AMDirectDrawStream, AM_create }, + { &CLSID_AMAudioData, AMAudioData_create }, { &CLSID_MediaStreamFilter, MediaStreamFilter_create } }; -static HRESULT WINAPI -AMCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) -{ - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; - +static HRESULT WINAPI AMCF_QueryInterface(IClassFactory *iface, REFIID riid, void **ppobj) +{ if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IClassFactory)) { IClassFactory_AddRef(iface); - *ppobj = This; + *ppobj = iface; return S_OK; } - WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj); + *ppobj = NULL; + WARN("(%p)->(%s,%p), not found\n", iface, debugstr_guid(riid), ppobj); return E_NOINTERFACE; } -static ULONG WINAPI AMCF_AddRef(LPCLASSFACTORY iface) -{ - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; +static ULONG WINAPI AMCF_AddRef(IClassFactory *iface) +{ + IClassFactoryImpl *This = impl_from_IClassFactory(iface); return InterlockedIncrement(&This->ref); } -static ULONG WINAPI AMCF_Release(LPCLASSFACTORY iface) -{ - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; - +static ULONG WINAPI AMCF_Release(IClassFactory *iface) +{ + IClassFactoryImpl *This = impl_from_IClassFactory(iface); ULONG ref = InterlockedDecrement(&This->ref); if (ref == 0) @@ -118,10 +118,10 @@ } -static HRESULT WINAPI AMCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, - REFIID riid, LPVOID *ppobj) -{ - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; +static HRESULT WINAPI AMCF_CreateInstance(IClassFactory *iface, IUnknown *pOuter, + REFIID riid, void **ppobj) +{ + IClassFactoryImpl *This = impl_from_IClassFactory(iface); HRESULT hres; LPUNKNOWN punk; @@ -136,9 +136,9 @@ return hres; } -static HRESULT WINAPI AMCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) -{ - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; +static HRESULT WINAPI AMCF_LockServer(IClassFactory *iface, BOOL dolock) +{ + IClassFactoryImpl *This = impl_from_IClassFactory(iface); FIXME("(%p)->(%d),stub!\n",This,dolock); return S_OK; } @@ -195,12 +195,12 @@ factory = HeapAlloc(GetProcessHeap(), 0, sizeof(*factory)); if (factory == NULL) return E_OUTOFMEMORY; - factory->ITF_IClassFactory.lpVtbl = &DSCF_Vtbl; + factory->IClassFactory_iface.lpVtbl = &DSCF_Vtbl; factory->ref = 1; factory->pfnCreateInstance = object_creation[i].pfnCreateInstance; - *ppv = &(factory->ITF_IClassFactory); + *ppv = &factory->IClassFactory_iface; return S_OK; } Modified: trunk/reactos/dll/directx/wine/amstream/mediastream.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/amstream/…
============================================================================== --- trunk/reactos/dll/directx/wine/amstream/mediastream.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/amstream/mediastream.c [iso-8859-1] Tue Oct 1 15:06:37 2013 @@ -1,7 +1,7 @@ /* - * Implementation of IMediaStream Interface + * Implementation of IMediaStream Interfaces * - * Copyright 2005, 2008 Christian Costa + * Copyright 2005, 2008, 2012 Christian Costa * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -32,51 +32,250 @@ WINE_DEFAULT_DEBUG_CHANNEL(amstream); +static HRESULT ddrawstreamsample_create(IDirectDrawMediaStream *parent, IDirectDrawStreamSample **ddraw_stream_sample); +static HRESULT audiostreamsample_create(IAudioMediaStream *parent, IAudioData *audio_data, IAudioStreamSample **audio_stream_sample); + typedef struct { + IAMMediaStream IAMMediaStream_iface; IDirectDrawMediaStream IDirectDrawMediaStream_iface; LONG ref; - IMultiMediaStream* Parent; - MSPID PurposeId; - STREAM_TYPE StreamType; -} IDirectDrawMediaStreamImpl; - -static inline IDirectDrawMediaStreamImpl *impl_from_IDirectDrawMediaStream(IDirectDrawMediaStream *iface) -{ - return CONTAINING_RECORD(iface, IDirectDrawMediaStreamImpl, IDirectDrawMediaStream_iface); -} - -static HRESULT WINAPI IDirectDrawMediaStreamImpl_QueryInterface(IDirectDrawMediaStream *iface, - REFIID riid, void **ppv) -{ - IDirectDrawMediaStreamImpl *This = impl_from_IDirectDrawMediaStream(iface); - - TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ppv); + IMultiMediaStream* parent; + MSPID purpose_id; + STREAM_TYPE stream_type; +} DirectDrawMediaStreamImpl; + +static inline DirectDrawMediaStreamImpl *impl_from_DirectDrawMediaStream_IAMMediaStream(IAMMediaStream *iface) +{ + return CONTAINING_RECORD(iface, DirectDrawMediaStreamImpl, IAMMediaStream_iface); +} + +/*** IUnknown methods ***/ +static HRESULT WINAPI DirectDrawMediaStreamImpl_IAMMediaStream_QueryInterface(IAMMediaStream *iface, + REFIID riid, void **ret_iface) +{ + DirectDrawMediaStreamImpl *This = impl_from_DirectDrawMediaStream_IAMMediaStream(iface); + + TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ret_iface); + + if (IsEqualGUID(riid, &IID_IUnknown) || + IsEqualGUID(riid, &IID_IMediaStream) || + IsEqualGUID(riid, &IID_IAMMediaStream)) + { + IAMMediaStream_AddRef(iface); + *ret_iface = iface; + return S_OK; + } + else if (IsEqualGUID(riid, &IID_IDirectDrawMediaStream)) + { + IAMMediaStream_AddRef(iface); + *ret_iface = &This->IDirectDrawMediaStream_iface; + return S_OK; + } + + ERR("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ret_iface); + return E_NOINTERFACE; +} + +static ULONG WINAPI DirectDrawMediaStreamImpl_IAMMediaStream_AddRef(IAMMediaStream *iface) +{ + DirectDrawMediaStreamImpl *This = impl_from_DirectDrawMediaStream_IAMMediaStream(iface); + ULONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p/%p)->(): new ref = %u\n", iface, This, ref); + + return ref; +} + +static ULONG WINAPI DirectDrawMediaStreamImpl_IAMMediaStream_Release(IAMMediaStream *iface) +{ + DirectDrawMediaStreamImpl *This = impl_from_DirectDrawMediaStream_IAMMediaStream(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p/%p)->(): new ref = %u\n", iface, This, ref); + + if (!ref) + HeapFree(GetProcessHeap(), 0, This); + + return ref; +} + +/*** IMediaStream methods ***/ +static HRESULT WINAPI DirectDrawMediaStreamImpl_IAMMediaStream_GetMultiMediaStream(IAMMediaStream *iface, + IMultiMediaStream** multi_media_stream) +{ + DirectDrawMediaStreamImpl *This = impl_from_DirectDrawMediaStream_IAMMediaStream(iface); + + FIXME("(%p/%p)->(%p) stub!\n", This, iface, multi_media_stream); + + return S_FALSE; +} + +static HRESULT WINAPI DirectDrawMediaStreamImpl_IAMMediaStream_GetInformation(IAMMediaStream *iface, + MSPID *purpose_id, STREAM_TYPE *type) +{ + DirectDrawMediaStreamImpl *This = impl_from_DirectDrawMediaStream_IAMMediaStream(iface); + + TRACE("(%p/%p)->(%p,%p)\n", This, iface, purpose_id, type); + + if (purpose_id) + *purpose_id = This->purpose_id; + if (type) + *type = This->stream_type; + + return S_OK; +} + +static HRESULT WINAPI DirectDrawMediaStreamImpl_IAMMediaStream_SetSameFormat(IAMMediaStream *iface, + IMediaStream *pStreamThatHasDesiredFormat, DWORD flags) +{ + DirectDrawMediaStreamImpl *This = impl_from_DirectDrawMediaStream_IAMMediaStream(iface); + + FIXME("(%p/%p)->(%p,%x) stub!\n", This, iface, pStreamThatHasDesiredFormat, flags); + + return S_FALSE; +} + +static HRESULT WINAPI DirectDrawMediaStreamImpl_IAMMediaStream_AllocateSample(IAMMediaStream *iface, + DWORD flags, IStreamSample **sample) +{ + DirectDrawMediaStreamImpl *This = impl_from_DirectDrawMediaStream_IAMMediaStream(iface); + + FIXME("(%p/%p)->(%x,%p) stub!\n", This, iface, flags, sample); + + return S_FALSE; +} + +static HRESULT WINAPI DirectDrawMediaStreamImpl_IAMMediaStream_CreateSharedSample(IAMMediaStream *iface, + IStreamSample *existing_sample, DWORD flags, IStreamSample **sample) +{ + DirectDrawMediaStreamImpl *This = impl_from_DirectDrawMediaStream_IAMMediaStream(iface); + + FIXME("(%p/%p)->(%p,%x,%p) stub!\n", This, iface, existing_sample, flags, sample); + + return S_FALSE; +} + +static HRESULT WINAPI DirectDrawMediaStreamImpl_IAMMediaStream_SendEndOfStream(IAMMediaStream *iface, DWORD flags) +{ + DirectDrawMediaStreamImpl *This = impl_from_DirectDrawMediaStream_IAMMediaStream(iface); + + FIXME("(%p/%p)->(%x) stub!\n", This, iface, flags); + + return S_FALSE; +} + +/*** IAMMediaStream methods ***/ +static HRESULT WINAPI DirectDrawMediaStreamImpl_IAMMediaStream_Initialize(IAMMediaStream *iface, IUnknown *source_object, DWORD flags, + REFMSPID purpose_id, const STREAM_TYPE stream_type) +{ + DirectDrawMediaStreamImpl *This = impl_from_DirectDrawMediaStream_IAMMediaStream(iface); + + FIXME("(%p/%p)->(%p,%x,%p,%u) stub!\n", This, iface, source_object, flags, purpose_id, stream_type); + + return S_FALSE; +} + +static HRESULT WINAPI DirectDrawMediaStreamImpl_IAMMediaStream_SetState(IAMMediaStream *iface, FILTER_STATE state) +{ + DirectDrawMediaStreamImpl *This = impl_from_DirectDrawMediaStream_IAMMediaStream(iface); + + FIXME("(%p/%p)->(%u) stub!\n", This, iface, state); + + return S_FALSE; +} + +static HRESULT WINAPI DirectDrawMediaStreamImpl_IAMMediaStream_JoinAMMultiMediaStream(IAMMediaStream *iface, IAMMultiMediaStream *am_multi_media_stream) +{ + DirectDrawMediaStreamImpl *This = impl_from_DirectDrawMediaStream_IAMMediaStream(iface); + + FIXME("(%p/%p)->(%p) stub!\n", This, iface, am_multi_media_stream); + + return S_FALSE; +} + +static HRESULT WINAPI DirectDrawMediaStreamImpl_IAMMediaStream_JoinFilter(IAMMediaStream *iface, IMediaStreamFilter *media_stream_filter) +{ + DirectDrawMediaStreamImpl *This = impl_from_DirectDrawMediaStream_IAMMediaStream(iface); + + FIXME("(%p/%p)->(%p) stub!\n", This, iface, media_stream_filter); + + return S_FALSE; +} + +static HRESULT WINAPI DirectDrawMediaStreamImpl_IAMMediaStream_JoinFilterGraph(IAMMediaStream *iface, IFilterGraph *filtergraph) +{ + DirectDrawMediaStreamImpl *This = impl_from_DirectDrawMediaStream_IAMMediaStream(iface); + + FIXME("(%p/%p)->(%p) stub!\n", This, iface, filtergraph); + + return S_FALSE; +} + +static const struct IAMMediaStreamVtbl DirectDrawMediaStreamImpl_IAMMediaStream_Vtbl = +{ + /*** IUnknown methods ***/ + DirectDrawMediaStreamImpl_IAMMediaStream_QueryInterface, + DirectDrawMediaStreamImpl_IAMMediaStream_AddRef, + DirectDrawMediaStreamImpl_IAMMediaStream_Release, + /*** IMediaStream methods ***/ + DirectDrawMediaStreamImpl_IAMMediaStream_GetMultiMediaStream, + DirectDrawMediaStreamImpl_IAMMediaStream_GetInformation, + DirectDrawMediaStreamImpl_IAMMediaStream_SetSameFormat, + DirectDrawMediaStreamImpl_IAMMediaStream_AllocateSample, + DirectDrawMediaStreamImpl_IAMMediaStream_CreateSharedSample, + DirectDrawMediaStreamImpl_IAMMediaStream_SendEndOfStream, + /*** IAMMediaStream methods ***/ + DirectDrawMediaStreamImpl_IAMMediaStream_Initialize, + DirectDrawMediaStreamImpl_IAMMediaStream_SetState, + DirectDrawMediaStreamImpl_IAMMediaStream_JoinAMMultiMediaStream, + DirectDrawMediaStreamImpl_IAMMediaStream_JoinFilter, + DirectDrawMediaStreamImpl_IAMMediaStream_JoinFilterGraph +}; + +static inline DirectDrawMediaStreamImpl *impl_from_IDirectDrawMediaStream(IDirectDrawMediaStream *iface) +{ + return CONTAINING_RECORD(iface, DirectDrawMediaStreamImpl, IDirectDrawMediaStream_iface); +} + +/*** IUnknown methods ***/ +static HRESULT WINAPI DirectDrawMediaStreamImpl_IDirectDrawMediaStream_QueryInterface(IDirectDrawMediaStream *iface, + REFIID riid, void **ret_iface) +{ + DirectDrawMediaStreamImpl *This = impl_from_IDirectDrawMediaStream(iface); + + TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ret_iface); if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IMediaStream) || IsEqualGUID(riid, &IID_IDirectDrawMediaStream)) { - IUnknown_AddRef(iface); - *ppv = This; + IDirectDrawMediaStream_AddRef(iface); + *ret_iface = iface; return S_OK; } - - ERR("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppv); + else if (IsEqualGUID(riid, &IID_IAMMediaStream)) + { + IDirectDrawMediaStream_AddRef(iface); + *ret_iface = &This->IAMMediaStream_iface; + return S_OK; + } + + ERR("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ret_iface); return E_NOINTERFACE; } -static ULONG WINAPI IDirectDrawMediaStreamImpl_AddRef(IDirectDrawMediaStream *iface) -{ - IDirectDrawMediaStreamImpl *This = impl_from_IDirectDrawMediaStream(iface); +static ULONG WINAPI DirectDrawMediaStreamImpl_IDirectDrawMediaStream_AddRef(IDirectDrawMediaStream *iface) +{ + DirectDrawMediaStreamImpl *This = impl_from_IDirectDrawMediaStream(iface); TRACE("(%p/%p)\n", iface, This); return InterlockedIncrement(&This->ref); } -static ULONG WINAPI IDirectDrawMediaStreamImpl_Release(IDirectDrawMediaStream *iface) -{ - IDirectDrawMediaStreamImpl *This = impl_from_IDirectDrawMediaStream(iface); +static ULONG WINAPI DirectDrawMediaStreamImpl_IDirectDrawMediaStream_Release(IDirectDrawMediaStream *iface) +{ + DirectDrawMediaStreamImpl *This = impl_from_IDirectDrawMediaStream(iface); ULONG ref = InterlockedDecrement(&This->ref); TRACE("(%p/%p)\n", iface, This); @@ -88,83 +287,84 @@ } /*** IMediaStream methods ***/ -static HRESULT WINAPI IDirectDrawMediaStreamImpl_GetMultiMediaStream(IDirectDrawMediaStream *iface, +static HRESULT WINAPI DirectDrawMediaStreamImpl_IDirectDrawMediaStream_GetMultiMediaStream(IDirectDrawMediaStream *iface, IMultiMediaStream** ppMultiMediaStream) { - IDirectDrawMediaStreamImpl *This = impl_from_IDirectDrawMediaStream(iface); + DirectDrawMediaStreamImpl *This = impl_from_IDirectDrawMediaStream(iface); FIXME("(%p/%p)->(%p) stub!\n", This, iface, ppMultiMediaStream); return S_FALSE; } -static HRESULT WINAPI IDirectDrawMediaStreamImpl_GetInformation(IDirectDrawMediaStream *iface, - MSPID *pPurposeId, STREAM_TYPE *pType) -{ - IDirectDrawMediaStreamImpl *This = impl_from_IDirectDrawMediaStream(iface); - - TRACE("(%p/%p)->(%p,%p)\n", This, iface, pPurposeId, pType); - - if (pPurposeId) - *pPurposeId = This->PurposeId; - if (pType) - *pType = This->StreamType; +static HRESULT WINAPI DirectDrawMediaStreamImpl_IDirectDrawMediaStream_GetInformation(IDirectDrawMediaStream *iface, + MSPID *purpose_id, STREAM_TYPE *type) +{ + DirectDrawMediaStreamImpl *This = impl_from_IDirectDrawMediaStream(iface); + + TRACE("(%p/%p)->(%p,%p)\n", This, iface, purpose_id, type); + + if (purpose_id) + *purpose_id = This->purpose_id; + if (type) + *type = This->stream_type; return S_OK; } -static HRESULT WINAPI IDirectDrawMediaStreamImpl_SetSameFormat(IDirectDrawMediaStream *iface, +static HRESULT WINAPI DirectDrawMediaStreamImpl_IDirectDrawMediaStream_SetSameFormat(IDirectDrawMediaStream *iface, IMediaStream *pStreamThatHasDesiredFormat, DWORD dwFlags) { - IDirectDrawMediaStreamImpl *This = impl_from_IDirectDrawMediaStream(iface); + DirectDrawMediaStreamImpl *This = impl_from_IDirectDrawMediaStream(iface); FIXME("(%p/%p)->(%p,%x) stub!\n", This, iface, pStreamThatHasDesiredFormat, dwFlags); return S_FALSE; } -static HRESULT WINAPI IDirectDrawMediaStreamImpl_AllocateSample(IDirectDrawMediaStream *iface, +static HRESULT WINAPI DirectDrawMediaStreamImpl_IDirectDrawMediaStream_AllocateSample(IDirectDrawMediaStream *iface, DWORD dwFlags, IStreamSample **ppSample) { - IDirectDrawMediaStreamImpl *This = impl_from_IDirectDrawMediaStream(iface); + DirectDrawMediaStreamImpl *This = impl_from_IDirectDrawMediaStream(iface); FIXME("(%p/%p)->(%x,%p) stub!\n", This, iface, dwFlags, ppSample); return S_FALSE; } -static HRESULT WINAPI IDirectDrawMediaStreamImpl_CreateSharedSample(IDirectDrawMediaStream *iface, +static HRESULT WINAPI DirectDrawMediaStreamImpl_IDirectDrawMediaStream_CreateSharedSample(IDirectDrawMediaStream *iface, IStreamSample *pExistingSample, DWORD dwFlags, IStreamSample **ppSample) { - IDirectDrawMediaStreamImpl *This = impl_from_IDirectDrawMediaStream(iface); + DirectDrawMediaStreamImpl *This = impl_from_IDirectDrawMediaStream(iface); FIXME("(%p/%p)->(%p,%x,%p) stub!\n", This, iface, pExistingSample, dwFlags, ppSample); return S_FALSE; } -static HRESULT WINAPI IDirectDrawMediaStreamImpl_SendEndOfStream(IDirectDrawMediaStream *iface, +static HRESULT WINAPI DirectDrawMediaStreamImpl_IDirectDrawMediaStream_SendEndOfStream(IDirectDrawMediaStream *iface, DWORD dwFlags) { - IDirectDrawMediaStreamImpl *This = impl_from_IDirectDrawMediaStream(iface); + DirectDrawMediaStreamImpl *This = impl_from_IDirectDrawMediaStream(iface); FIXME("(%p/%p)->(%x) stub!\n", This, iface, dwFlags); return S_FALSE; } -static HRESULT WINAPI IDirectDrawMediaStreamImpl_GetFormat(IDirectDrawMediaStream *iface, - DDSURFACEDESC *pDDSDCurrent, IDirectDrawPalette **ppDirectDrawPalette, - DDSURFACEDESC *pDDSDDesired, DWORD *pdwFlags) -{ - FIXME("(%p)->(%p,%p,%p,%p) stub!\n", iface, pDDSDCurrent, ppDirectDrawPalette, pDDSDDesired, - pdwFlags); - - return E_NOTIMPL; - -} - -static HRESULT WINAPI IDirectDrawMediaStreamImpl_SetFormat(IDirectDrawMediaStream *iface, +/*** IDirectDrawMediaStream methods ***/ +static HRESULT WINAPI DirectDrawMediaStreamImpl_IDirectDrawMediaStream_GetFormat(IDirectDrawMediaStream *iface, + DDSURFACEDESC *current_format, IDirectDrawPalette **palette, + DDSURFACEDESC *desired_format, DWORD *flags) +{ + FIXME("(%p)->(%p,%p,%p,%p) stub!\n", iface, current_format, palette, desired_format, + flags); + + return MS_E_NOSTREAM; + +} + +static HRESULT WINAPI DirectDrawMediaStreamImpl_IDirectDrawMediaStream_SetFormat(IDirectDrawMediaStream *iface, const DDSURFACEDESC *pDDSurfaceDesc, IDirectDrawPalette *pDirectDrawPalette) { FIXME("(%p)->(%p,%p) stub!\n", iface, pDDSurfaceDesc, pDirectDrawPalette); @@ -172,7 +372,7 @@ return E_NOTIMPL; } -static HRESULT WINAPI IDirectDrawMediaStreamImpl_GetDirectDraw(IDirectDrawMediaStream *iface, +static HRESULT WINAPI DirectDrawMediaStreamImpl_IDirectDrawMediaStream_GetDirectDraw(IDirectDrawMediaStream *iface, IDirectDraw **ppDirectDraw) { FIXME("(%p)->(%p) stub!\n", iface, ppDirectDraw); @@ -180,7 +380,7 @@ return E_NOTIMPL; } -static HRESULT WINAPI IDirectDrawMediaStreamImpl_SetDirectDraw(IDirectDrawMediaStream *iface, +static HRESULT WINAPI DirectDrawMediaStreamImpl_IDirectDrawMediaStream_SetDirectDraw(IDirectDrawMediaStream *iface, IDirectDraw *pDirectDraw) { FIXME("(%p)->(%p) stub!\n", iface, pDirectDraw); @@ -188,16 +388,16 @@ return E_NOTIMPL; } -static HRESULT WINAPI IDirectDrawMediaStreamImpl_CreateSample(IDirectDrawMediaStream *iface, +static HRESULT WINAPI DirectDrawMediaStreamImpl_IDirectDrawMediaStream_CreateSample(IDirectDrawMediaStream *iface, IDirectDrawSurface *pSurface, const RECT *pRect, DWORD dwFlags, IDirectDrawStreamSample **ppSample) { - FIXME("(%p)->(%p,%p,%x,%p) stub!\n", iface, pSurface, pRect, dwFlags, ppSample); - - return E_NOTIMPL; -} - -static HRESULT WINAPI IDirectDrawMediaStreamImpl_GetTimePerFrame(IDirectDrawMediaStream *iface, + TRACE("(%p)->(%p,%p,%x,%p)\n", iface, pSurface, pRect, dwFlags, ppSample); + + return ddrawstreamsample_create(iface, ppSample); +} + +static HRESULT WINAPI DirectDrawMediaStreamImpl_IDirectDrawMediaStream_GetTimePerFrame(IDirectDrawMediaStream *iface, STREAM_TIME *pFrameTime) { FIXME("(%p)->(%p) stub!\n", iface, pFrameTime); @@ -205,47 +405,733 @@ return E_NOTIMPL; } -static const struct IDirectDrawMediaStreamVtbl DirectDrawMediaStream_Vtbl = -{ - IDirectDrawMediaStreamImpl_QueryInterface, - IDirectDrawMediaStreamImpl_AddRef, - IDirectDrawMediaStreamImpl_Release, - IDirectDrawMediaStreamImpl_GetMultiMediaStream, - IDirectDrawMediaStreamImpl_GetInformation, - IDirectDrawMediaStreamImpl_SetSameFormat, - IDirectDrawMediaStreamImpl_AllocateSample, - IDirectDrawMediaStreamImpl_CreateSharedSample, - IDirectDrawMediaStreamImpl_SendEndOfStream, - IDirectDrawMediaStreamImpl_GetFormat, - IDirectDrawMediaStreamImpl_SetFormat, - IDirectDrawMediaStreamImpl_GetDirectDraw, - IDirectDrawMediaStreamImpl_SetDirectDraw, - IDirectDrawMediaStreamImpl_CreateSample, - IDirectDrawMediaStreamImpl_GetTimePerFrame +static const struct IDirectDrawMediaStreamVtbl DirectDrawMediaStreamImpl_IDirectDrawMediaStream_Vtbl = +{ + /*** IUnknown methods ***/ + DirectDrawMediaStreamImpl_IDirectDrawMediaStream_QueryInterface, + DirectDrawMediaStreamImpl_IDirectDrawMediaStream_AddRef, + DirectDrawMediaStreamImpl_IDirectDrawMediaStream_Release, + /*** IMediaStream methods ***/ + DirectDrawMediaStreamImpl_IDirectDrawMediaStream_GetMultiMediaStream, + DirectDrawMediaStreamImpl_IDirectDrawMediaStream_GetInformation, + DirectDrawMediaStreamImpl_IDirectDrawMediaStream_SetSameFormat, + DirectDrawMediaStreamImpl_IDirectDrawMediaStream_AllocateSample, + DirectDrawMediaStreamImpl_IDirectDrawMediaStream_CreateSharedSample, + DirectDrawMediaStreamImpl_IDirectDrawMediaStream_SendEndOfStream, + /*** IDirectDrawMediaStream methods ***/ + DirectDrawMediaStreamImpl_IDirectDrawMediaStream_GetFormat, + DirectDrawMediaStreamImpl_IDirectDrawMediaStream_SetFormat, + DirectDrawMediaStreamImpl_IDirectDrawMediaStream_GetDirectDraw, + DirectDrawMediaStreamImpl_IDirectDrawMediaStream_SetDirectDraw, + DirectDrawMediaStreamImpl_IDirectDrawMediaStream_CreateSample, + DirectDrawMediaStreamImpl_IDirectDrawMediaStream_GetTimePerFrame }; -HRESULT mediastream_create(IMultiMediaStream *Parent, const MSPID *pPurposeId, - STREAM_TYPE StreamType, IMediaStream **ppMediaStream) -{ - IDirectDrawMediaStreamImpl *object; - - TRACE("(%p,%s,%p)\n", Parent, debugstr_guid(pPurposeId), ppMediaStream); - - object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectDrawMediaStreamImpl)); +HRESULT ddrawmediastream_create(IMultiMediaStream *parent, const MSPID *purpose_id, + STREAM_TYPE stream_type, IMediaStream **media_stream) +{ + DirectDrawMediaStreamImpl *object; + + TRACE("(%p,%s,%p)\n", parent, debugstr_guid(purpose_id), media_stream); + + object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DirectDrawMediaStreamImpl)); if (!object) + return E_OUTOFMEMORY; + + object->IAMMediaStream_iface.lpVtbl = &DirectDrawMediaStreamImpl_IAMMediaStream_Vtbl; + object->IDirectDrawMediaStream_iface.lpVtbl = &DirectDrawMediaStreamImpl_IDirectDrawMediaStream_Vtbl; + object->ref = 1; + + object->parent = parent; + object->purpose_id = *purpose_id; + object->stream_type = stream_type; + + *media_stream = (IMediaStream*)&object->IAMMediaStream_iface; + + return S_OK; +} + +typedef struct { + IAMMediaStream IAMMediaStream_iface; + IAudioMediaStream IAudioMediaStream_iface; + LONG ref; + IMultiMediaStream* parent; + MSPID purpose_id; + STREAM_TYPE stream_type; +} AudioMediaStreamImpl; + +static inline AudioMediaStreamImpl *impl_from_AudioMediaStream_IAMMediaStream(IAMMediaStream *iface) +{ + return CONTAINING_RECORD(iface, AudioMediaStreamImpl, IAMMediaStream_iface); +} + +/*** IUnknown methods ***/ +static HRESULT WINAPI AudioMediaStreamImpl_IAMMediaStream_QueryInterface(IAMMediaStream *iface, + REFIID riid, void **ret_iface) +{ + AudioMediaStreamImpl *This = impl_from_AudioMediaStream_IAMMediaStream(iface); + + TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ret_iface); + + if (IsEqualGUID(riid, &IID_IUnknown) || + IsEqualGUID(riid, &IID_IMediaStream) || + IsEqualGUID(riid, &IID_IAMMediaStream)) { - ERR("Out of memory\n"); + IAMMediaStream_AddRef(iface); + *ret_iface = iface; + return S_OK; + } + else if (IsEqualGUID(riid, &IID_IAudioMediaStream)) + { + IAMMediaStream_AddRef(iface); + *ret_iface = &This->IAudioMediaStream_iface; + return S_OK; + } + + ERR("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ret_iface); + return E_NOINTERFACE; +} + +static ULONG WINAPI AudioMediaStreamImpl_IAMMediaStream_AddRef(IAMMediaStream *iface) +{ + AudioMediaStreamImpl *This = impl_from_AudioMediaStream_IAMMediaStream(iface); + ULONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p/%p)->(): new ref = %u\n", iface, This, ref); + + return ref; +} + +static ULONG WINAPI AudioMediaStreamImpl_IAMMediaStream_Release(IAMMediaStream *iface) +{ + AudioMediaStreamImpl *This = impl_from_AudioMediaStream_IAMMediaStream(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p/%p)->(): new ref = %u\n", iface, This, ref); + + if (!ref) + HeapFree(GetProcessHeap(), 0, This); + + return ref; +} + +/*** IMediaStream methods ***/ +static HRESULT WINAPI AudioMediaStreamImpl_IAMMediaStream_GetMultiMediaStream(IAMMediaStream *iface, + IMultiMediaStream** multi_media_stream) +{ + AudioMediaStreamImpl *This = impl_from_AudioMediaStream_IAMMediaStream(iface); + + FIXME("(%p/%p)->(%p) stub!\n", This, iface, multi_media_stream); + + return S_FALSE; +} + +static HRESULT WINAPI AudioMediaStreamImpl_IAMMediaStream_GetInformation(IAMMediaStream *iface, + MSPID *purpose_id, STREAM_TYPE *type) +{ + AudioMediaStreamImpl *This = impl_from_AudioMediaStream_IAMMediaStream(iface); + + TRACE("(%p/%p)->(%p,%p)\n", This, iface, purpose_id, type); + + if (purpose_id) + *purpose_id = This->purpose_id; + if (type) + *type = This->stream_type; + + return S_OK; +} + +static HRESULT WINAPI AudioMediaStreamImpl_IAMMediaStream_SetSameFormat(IAMMediaStream *iface, + IMediaStream *pStreamThatHasDesiredFormat, DWORD flags) +{ + AudioMediaStreamImpl *This = impl_from_AudioMediaStream_IAMMediaStream(iface); + + FIXME("(%p/%p)->(%p,%x) stub!\n", This, iface, pStreamThatHasDesiredFormat, flags); + + return S_FALSE; +} + +static HRESULT WINAPI AudioMediaStreamImpl_IAMMediaStream_AllocateSample(IAMMediaStream *iface, + DWORD flags, IStreamSample **sample) +{ + AudioMediaStreamImpl *This = impl_from_AudioMediaStream_IAMMediaStream(iface); + + FIXME("(%p/%p)->(%x,%p) stub!\n", This, iface, flags, sample); + + return S_FALSE; +} + +static HRESULT WINAPI AudioMediaStreamImpl_IAMMediaStream_CreateSharedSample(IAMMediaStream *iface, + IStreamSample *existing_sample, DWORD flags, IStreamSample **sample) +{ + AudioMediaStreamImpl *This = impl_from_AudioMediaStream_IAMMediaStream(iface); + + FIXME("(%p/%p)->(%p,%x,%p) stub!\n", This, iface, existing_sample, flags, sample); + + return S_FALSE; +} + +static HRESULT WINAPI AudioMediaStreamImpl_IAMMediaStream_SendEndOfStream(IAMMediaStream *iface, DWORD flags) +{ + AudioMediaStreamImpl *This = impl_from_AudioMediaStream_IAMMediaStream(iface); + + FIXME("(%p/%p)->(%x) stub!\n", This, iface, flags); + + return S_FALSE; +} + +/*** IAMMediaStream methods ***/ +static HRESULT WINAPI AudioMediaStreamImpl_IAMMediaStream_Initialize(IAMMediaStream *iface, IUnknown *source_object, DWORD flags, + REFMSPID purpose_id, const STREAM_TYPE stream_type) +{ + AudioMediaStreamImpl *This = impl_from_AudioMediaStream_IAMMediaStream(iface); + + FIXME("(%p/%p)->(%p,%x,%p,%u) stub!\n", This, iface, source_object, flags, purpose_id, stream_type); + + return S_FALSE; +} + +static HRESULT WINAPI AudioMediaStreamImpl_IAMMediaStream_SetState(IAMMediaStream *iface, FILTER_STATE state) +{ + AudioMediaStreamImpl *This = impl_from_AudioMediaStream_IAMMediaStream(iface); + + FIXME("(%p/%p)->(%u) stub!\n", This, iface, state); + + return S_FALSE; +} + +static HRESULT WINAPI AudioMediaStreamImpl_IAMMediaStream_JoinAMMultiMediaStream(IAMMediaStream *iface, IAMMultiMediaStream *am_multi_media_stream) +{ + AudioMediaStreamImpl *This = impl_from_AudioMediaStream_IAMMediaStream(iface); + + FIXME("(%p/%p)->(%p) stub!\n", This, iface, am_multi_media_stream); + + return S_FALSE; +} + +static HRESULT WINAPI AudioMediaStreamImpl_IAMMediaStream_JoinFilter(IAMMediaStream *iface, IMediaStreamFilter *media_stream_filter) +{ + AudioMediaStreamImpl *This = impl_from_AudioMediaStream_IAMMediaStream(iface); + + FIXME("(%p/%p)->(%p) stub!\n", This, iface, media_stream_filter); + + return S_FALSE; +} + +static HRESULT WINAPI AudioMediaStreamImpl_IAMMediaStream_JoinFilterGraph(IAMMediaStream *iface, IFilterGraph *filtergraph) +{ + AudioMediaStreamImpl *This = impl_from_AudioMediaStream_IAMMediaStream(iface); + + FIXME("(%p/%p)->(%p) stub!\n", This, iface, filtergraph); + + return S_FALSE; +} + +static const struct IAMMediaStreamVtbl AudioMediaStreamImpl_IAMMediaStream_Vtbl = +{ + /*** IUnknown methods ***/ + AudioMediaStreamImpl_IAMMediaStream_QueryInterface, + AudioMediaStreamImpl_IAMMediaStream_AddRef, + AudioMediaStreamImpl_IAMMediaStream_Release, + /*** IMediaStream methods ***/ + AudioMediaStreamImpl_IAMMediaStream_GetMultiMediaStream, + AudioMediaStreamImpl_IAMMediaStream_GetInformation, + AudioMediaStreamImpl_IAMMediaStream_SetSameFormat, + AudioMediaStreamImpl_IAMMediaStream_AllocateSample, + AudioMediaStreamImpl_IAMMediaStream_CreateSharedSample, + AudioMediaStreamImpl_IAMMediaStream_SendEndOfStream, + /*** IAMMediaStream methods ***/ + AudioMediaStreamImpl_IAMMediaStream_Initialize, + AudioMediaStreamImpl_IAMMediaStream_SetState, + AudioMediaStreamImpl_IAMMediaStream_JoinAMMultiMediaStream, + AudioMediaStreamImpl_IAMMediaStream_JoinFilter, + AudioMediaStreamImpl_IAMMediaStream_JoinFilterGraph +}; + +static inline AudioMediaStreamImpl *impl_from_IAudioMediaStream(IAudioMediaStream *iface) +{ + return CONTAINING_RECORD(iface, AudioMediaStreamImpl, IAudioMediaStream_iface); +} + +/*** IUnknown methods ***/ +static HRESULT WINAPI AudioMediaStreamImpl_IAudioMediaStream_QueryInterface(IAudioMediaStream *iface, + REFIID riid, void **ret_iface) +{ + AudioMediaStreamImpl *This = impl_from_IAudioMediaStream(iface); + + TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ret_iface); + + if (IsEqualGUID(riid, &IID_IUnknown) || + IsEqualGUID(riid, &IID_IMediaStream) || + IsEqualGUID(riid, &IID_IAudioMediaStream)) + { + IAudioMediaStream_AddRef(iface); + *ret_iface = iface; + return S_OK; + } + else if (IsEqualGUID(riid, &IID_IAMMediaStream)) + { + IAudioMediaStream_AddRef(iface); + *ret_iface = &This->IAMMediaStream_iface; + return S_OK; + } + + + *ret_iface = NULL; + + ERR("(%p/%p)->(%s,%p),not found\n", iface, This, debugstr_guid(riid), ret_iface); + return E_NOINTERFACE; +} + +static ULONG WINAPI AudioMediaStreamImpl_IAudioMediaStream_AddRef(IAudioMediaStream *iface) +{ + AudioMediaStreamImpl *This = impl_from_IAudioMediaStream(iface); + ULONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p/%p): new ref = %u\n", iface, This, ref); + + return ref; +} + +static ULONG WINAPI AudioMediaStreamImpl_IAudioMediaStream_Release(IAudioMediaStream *iface) +{ + AudioMediaStreamImpl *This = impl_from_IAudioMediaStream(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p/%p): new ref = %u\n", iface, This, ref); + + if (!ref) + HeapFree(GetProcessHeap(), 0, This); + + return ref; +} + +/*** IMediaStream methods ***/ +static HRESULT WINAPI AudioMediaStreamImpl_IAudioMediaStream_GetMultiMediaStream(IAudioMediaStream *iface, + IMultiMediaStream** multimedia_stream) +{ + AudioMediaStreamImpl *This = impl_from_IAudioMediaStream(iface); + + FIXME("(%p/%p)->(%p) stub!\n", iface, This, multimedia_stream); + + return S_FALSE; +} + +static HRESULT WINAPI AudioMediaStreamImpl_IAudioMediaStream_GetInformation(IAudioMediaStream *iface, + MSPID *purpose_id, STREAM_TYPE *type) +{ + AudioMediaStreamImpl *This = impl_from_IAudioMediaStream(iface); + + TRACE("(%p/%p)->(%p,%p)\n", iface, This, purpose_id, type); + + if (purpose_id) + *purpose_id = This->purpose_id; + if (type) + *type = This->stream_type; + + return S_OK; +} + +static HRESULT WINAPI AudioMediaStreamImpl_IAudioMediaStream_SetSameFormat(IAudioMediaStream *iface, + IMediaStream *stream_format, DWORD flags) +{ + AudioMediaStreamImpl *This = impl_from_IAudioMediaStream(iface); + + FIXME("(%p/%p)->(%p,%x) stub!\n", iface, This, stream_format, flags); + + return S_FALSE; +} + +static HRESULT WINAPI AudioMediaStreamImpl_IAudioMediaStream_AllocateSample(IAudioMediaStream *iface, + DWORD flags, IStreamSample **sample) +{ + AudioMediaStreamImpl *This = impl_from_IAudioMediaStream(iface); + + FIXME("(%p/%p)->(%x,%p) stub!\n", iface, This, flags, sample); + + return S_FALSE; +} + +static HRESULT WINAPI AudioMediaStreamImpl_IAudioMediaStream_CreateSharedSample(IAudioMediaStream *iface, + IStreamSample *existing_sample, DWORD flags, IStreamSample **sample) +{ + AudioMediaStreamImpl *This = impl_from_IAudioMediaStream(iface); + + FIXME("(%p/%p)->(%p,%x,%p) stub!\n", iface, This, existing_sample, flags, sample); + + return S_FALSE; +} + +static HRESULT WINAPI AudioMediaStreamImpl_IAudioMediaStream_SendEndOfStream(IAudioMediaStream *iface, + DWORD flags) +{ + AudioMediaStreamImpl *This = impl_from_IAudioMediaStream(iface); + + FIXME("(%p/%p)->(%x) stub!\n", iface, This, flags); + + return S_FALSE; +} + +/*** IAudioMediaStream methods ***/ +static HRESULT WINAPI AudioMediaStreamImpl_IAudioMediaStream_GetFormat(IAudioMediaStream *iface, WAVEFORMATEX *wave_format_current) +{ + AudioMediaStreamImpl *This = impl_from_IAudioMediaStream(iface); + + FIXME("(%p/%p)->(%p) stub!\n", iface, This, wave_format_current); + + if (!wave_format_current) + return E_POINTER; + + return MS_E_NOSTREAM; + +} + +static HRESULT WINAPI AudioMediaStreamImpl_IAudioMediaStream_SetFormat(IAudioMediaStream *iface, const WAVEFORMATEX *wave_format) +{ + AudioMediaStreamImpl *This = impl_from_IAudioMediaStream(iface); + + FIXME("(%p/%p)->(%p) stub!\n", iface, This, wave_format); + + return E_NOTIMPL; +} + +static HRESULT WINAPI AudioMediaStreamImpl_IAudioMediaStream_CreateSample(IAudioMediaStream *iface, IAudioData *audio_data, + DWORD flags, IAudioStreamSample **sample) +{ + AudioMediaStreamImpl *This = impl_from_IAudioMediaStream(iface); + + TRACE("(%p/%p)->(%p,%u,%p)\n", iface, This, audio_data, flags, sample); + + if (!audio_data) + return E_POINTER; + + return audiostreamsample_create(iface, audio_data, sample); +} + +static const struct IAudioMediaStreamVtbl AudioMediaStreamImpl_IAudioMediaStream_Vtbl = +{ + /*** IUnknown methods ***/ + AudioMediaStreamImpl_IAudioMediaStream_QueryInterface, + AudioMediaStreamImpl_IAudioMediaStream_AddRef, + AudioMediaStreamImpl_IAudioMediaStream_Release, + /*** IMediaStream methods ***/ + AudioMediaStreamImpl_IAudioMediaStream_GetMultiMediaStream, + AudioMediaStreamImpl_IAudioMediaStream_GetInformation, + AudioMediaStreamImpl_IAudioMediaStream_SetSameFormat, + AudioMediaStreamImpl_IAudioMediaStream_AllocateSample, + AudioMediaStreamImpl_IAudioMediaStream_CreateSharedSample, + AudioMediaStreamImpl_IAudioMediaStream_SendEndOfStream, + /*** IAudioMediaStream methods ***/ + AudioMediaStreamImpl_IAudioMediaStream_GetFormat, + AudioMediaStreamImpl_IAudioMediaStream_SetFormat, + AudioMediaStreamImpl_IAudioMediaStream_CreateSample +}; + +HRESULT audiomediastream_create(IMultiMediaStream *parent, const MSPID *purpose_id, + STREAM_TYPE stream_type, IMediaStream **media_stream) +{ + AudioMediaStreamImpl *object; + + TRACE("(%p,%s,%p)\n", parent, debugstr_guid(purpose_id), media_stream); + + object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(AudioMediaStreamImpl)); + if (!object) return E_OUTOFMEMORY; + + object->IAMMediaStream_iface.lpVtbl = &AudioMediaStreamImpl_IAMMediaStream_Vtbl; + object->IAudioMediaStream_iface.lpVtbl = &AudioMediaStreamImpl_IAudioMediaStream_Vtbl; + object->ref = 1; + + object->parent = parent; + object->purpose_id = *purpose_id; + object->stream_type = stream_type; + + *media_stream = (IMediaStream*)&object->IAMMediaStream_iface; + + return S_OK; +} + +typedef struct { + IDirectDrawStreamSample IDirectDrawStreamSample_iface; + LONG ref; + IMediaStream *parent; +} IDirectDrawStreamSampleImpl; + +static inline IDirectDrawStreamSampleImpl *impl_from_IDirectDrawStreamSample(IDirectDrawStreamSample *iface) +{ + return CONTAINING_RECORD(iface, IDirectDrawStreamSampleImpl, IDirectDrawStreamSample_iface); +} + +/*** IUnknown methods ***/ +static HRESULT WINAPI IDirectDrawStreamSampleImpl_QueryInterface(IDirectDrawStreamSample *iface, + REFIID riid, void **ret_iface) +{ + TRACE("(%p)->(%s,%p)\n", iface, debugstr_guid(riid), ret_iface); + + if (IsEqualGUID(riid, &IID_IUnknown) || + IsEqualGUID(riid, &IID_IStreamSample) || + IsEqualGUID(riid, &IID_IDirectDrawStreamSample)) + { + IDirectDrawStreamSample_AddRef(iface); + *ret_iface = iface; + return S_OK; } - object->IDirectDrawMediaStream_iface.lpVtbl = &DirectDrawMediaStream_Vtbl; + *ret_iface = NULL; + + ERR("(%p)->(%s,%p),not found\n", iface, debugstr_guid(riid), ret_iface); + return E_NOINTERFACE; +} + +static ULONG WINAPI IDirectDrawStreamSampleImpl_AddRef(IDirectDrawStreamSample *iface) +{ + IDirectDrawStreamSampleImpl *This = impl_from_IDirectDrawStreamSample(iface); + ULONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p)->(): new ref = %u\n", iface, ref); + + return ref; +} + +static ULONG WINAPI IDirectDrawStreamSampleImpl_Release(IDirectDrawStreamSample *iface) +{ + IDirectDrawStreamSampleImpl *This = impl_from_IDirectDrawStreamSample(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p)->(): new ref = %u\n", iface, ref); + + if (!ref) + HeapFree(GetProcessHeap(), 0, This); + + return ref; +} + +/*** IStreamSample methods ***/ +static HRESULT WINAPI IDirectDrawStreamSampleImpl_GetMediaStream(IDirectDrawStreamSample *iface, IMediaStream **media_stream) +{ + FIXME("(%p)->(%p): stub\n", iface, media_stream); + + return E_NOTIMPL; +} + +static HRESULT WINAPI IDirectDrawStreamSampleImpl_GetSampleTimes(IDirectDrawStreamSample *iface, STREAM_TIME *start_time, + STREAM_TIME *end_time, STREAM_TIME *current_time) +{ + FIXME("(%p)->(%p,%p,%p): stub\n", iface, start_time, end_time, current_time); + + return E_NOTIMPL; +} + +static HRESULT WINAPI IDirectDrawStreamSampleImpl_SetSampleTimes(IDirectDrawStreamSample *iface, const STREAM_TIME *start_time, + const STREAM_TIME *end_time) +{ + FIXME("(%p)->(%p,%p): stub\n", iface, start_time, end_time); + + return E_NOTIMPL; +} + +static HRESULT WINAPI IDirectDrawStreamSampleImpl_Update(IDirectDrawStreamSample *iface, DWORD flags, HANDLE event, + PAPCFUNC func_APC, DWORD APC_data) +{ + FIXME("(%p)->(%x,%p,%p,%u): stub\n", iface, flags, event, func_APC, APC_data); + + return E_NOTIMPL; +} + +static HRESULT WINAPI IDirectDrawStreamSampleImpl_CompletionStatus(IDirectDrawStreamSample *iface, DWORD flags, DWORD milliseconds) +{ + FIXME("(%p)->(%x,%u): stub\n", iface, flags, milliseconds); + + return E_NOTIMPL; +} + +/*** IDirectDrawStreamSample methods ***/ +static HRESULT WINAPI IDirectDrawStreamSampleImpl_GetSurface(IDirectDrawStreamSample *iface, IDirectDrawSurface **ddraw_surface, + RECT *rect) +{ + FIXME("(%p)->(%p,%p): stub\n", iface, ddraw_surface, rect); + + return E_NOTIMPL; +} + +static HRESULT WINAPI IDirectDrawStreamSampleImpl_SetRect(IDirectDrawStreamSample *iface, const RECT *rect) +{ + FIXME("(%p)->(%p): stub\n", iface, rect); + + return E_NOTIMPL; +} + +static const struct IDirectDrawStreamSampleVtbl DirectDrawStreamSample_Vtbl = +{ + /*** IUnknown methods ***/ + IDirectDrawStreamSampleImpl_QueryInterface, + IDirectDrawStreamSampleImpl_AddRef, + IDirectDrawStreamSampleImpl_Release, + /*** IStreamSample methods ***/ + IDirectDrawStreamSampleImpl_GetMediaStream, + IDirectDrawStreamSampleImpl_GetSampleTimes, + IDirectDrawStreamSampleImpl_SetSampleTimes, + IDirectDrawStreamSampleImpl_Update, + IDirectDrawStreamSampleImpl_CompletionStatus, + /*** IDirectDrawStreamSample methods ***/ + IDirectDrawStreamSampleImpl_GetSurface, + IDirectDrawStreamSampleImpl_SetRect +}; + +static HRESULT ddrawstreamsample_create(IDirectDrawMediaStream *parent, IDirectDrawStreamSample **ddraw_stream_sample) +{ + IDirectDrawStreamSampleImpl *object; + + TRACE("(%p)\n", ddraw_stream_sample); + + object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectDrawStreamSampleImpl)); + if (!object) + return E_OUTOFMEMORY; + + object->IDirectDrawStreamSample_iface.lpVtbl = &DirectDrawStreamSample_Vtbl; object->ref = 1; - - object->Parent = Parent; - object->PurposeId = *pPurposeId; - object->StreamType = StreamType; - - *ppMediaStream = (IMediaStream*)&object->IDirectDrawMediaStream_iface; + object->parent = (IMediaStream*)parent; + + *ddraw_stream_sample = (IDirectDrawStreamSample*)&object->IDirectDrawStreamSample_iface; return S_OK; } + +typedef struct { + IAudioStreamSample IAudioStreamSample_iface; + LONG ref; + IMediaStream *parent; + IAudioData *audio_data; +} IAudioStreamSampleImpl; + +static inline IAudioStreamSampleImpl *impl_from_IAudioStreamSample(IAudioStreamSample *iface) +{ + return CONTAINING_RECORD(iface, IAudioStreamSampleImpl, IAudioStreamSample_iface); +} + +/*** IUnknown methods ***/ +static HRESULT WINAPI IAudioStreamSampleImpl_QueryInterface(IAudioStreamSample *iface, + REFIID riid, void **ret_iface) +{ + TRACE("(%p)->(%s,%p)\n", iface, debugstr_guid(riid), ret_iface); + + if (IsEqualGUID(riid, &IID_IUnknown) || + IsEqualGUID(riid, &IID_IStreamSample) || + IsEqualGUID(riid, &IID_IAudioStreamSample)) + { + IAudioStreamSample_AddRef(iface); + *ret_iface = iface; + return S_OK; + } + + *ret_iface = NULL; + + ERR("(%p)->(%s,%p),not found\n", iface, debugstr_guid(riid), ret_iface); + return E_NOINTERFACE; +} + +static ULONG WINAPI IAudioStreamSampleImpl_AddRef(IAudioStreamSample *iface) +{ + IAudioStreamSampleImpl *This = impl_from_IAudioStreamSample(iface); + ULONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p)->(): new ref = %u\n", iface, ref); + + return ref; +} + +static ULONG WINAPI IAudioStreamSampleImpl_Release(IAudioStreamSample *iface) +{ + IAudioStreamSampleImpl *This = impl_from_IAudioStreamSample(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p)->(): new ref = %u\n", iface, ref); + + if (!ref) + HeapFree(GetProcessHeap(), 0, This); + + return ref; +} + +/*** IStreamSample methods ***/ +static HRESULT WINAPI IAudioStreamSampleImpl_GetMediaStream(IAudioStreamSample *iface, IMediaStream **media_stream) +{ + FIXME("(%p)->(%p): stub\n", iface, media_stream); + + return E_NOTIMPL; +} + +static HRESULT WINAPI IAudioStreamSampleImpl_GetSampleTimes(IAudioStreamSample *iface, STREAM_TIME *start_time, + STREAM_TIME *end_time, STREAM_TIME *current_time) +{ + FIXME("(%p)->(%p,%p,%p): stub\n", iface, start_time, end_time, current_time); + + return E_NOTIMPL; +} + +static HRESULT WINAPI IAudioStreamSampleImpl_SetSampleTimes(IAudioStreamSample *iface, const STREAM_TIME *start_time, + const STREAM_TIME *end_time) +{ + FIXME("(%p)->(%p,%p): stub\n", iface, start_time, end_time); + + return E_NOTIMPL; +} + +static HRESULT WINAPI IAudioStreamSampleImpl_Update(IAudioStreamSample *iface, DWORD flags, HANDLE event, + PAPCFUNC func_APC, DWORD APC_data) +{ + FIXME("(%p)->(%x,%p,%p,%u): stub\n", iface, flags, event, func_APC, APC_data); + + return E_NOTIMPL; +} + +static HRESULT WINAPI IAudioStreamSampleImpl_CompletionStatus(IAudioStreamSample *iface, DWORD flags, DWORD milliseconds) +{ + FIXME("(%p)->(%x,%u): stub\n", iface, flags, milliseconds); + + return E_NOTIMPL; +} + +/*** IAudioStreamSample methods ***/ +static HRESULT WINAPI IAudioStreamSampleImpl_GetAudioData(IAudioStreamSample *iface, IAudioData **audio_data) +{ + FIXME("(%p)->(%p): stub\n", iface, audio_data); + + return E_NOTIMPL; +} + +static const struct IAudioStreamSampleVtbl AudioStreamSample_Vtbl = +{ + /*** IUnknown methods ***/ + IAudioStreamSampleImpl_QueryInterface, + IAudioStreamSampleImpl_AddRef, + IAudioStreamSampleImpl_Release, + /*** IStreamSample methods ***/ + IAudioStreamSampleImpl_GetMediaStream, + IAudioStreamSampleImpl_GetSampleTimes, + IAudioStreamSampleImpl_SetSampleTimes, + IAudioStreamSampleImpl_Update, + IAudioStreamSampleImpl_CompletionStatus, + /*** IAudioStreamSample methods ***/ + IAudioStreamSampleImpl_GetAudioData +}; + +static HRESULT audiostreamsample_create(IAudioMediaStream *parent, IAudioData *audio_data, IAudioStreamSample **audio_stream_sample) +{ + IAudioStreamSampleImpl *object; + + TRACE("(%p)\n", audio_stream_sample); + + object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IAudioStreamSampleImpl)); + if (!object) + return E_OUTOFMEMORY; + + object->IAudioStreamSample_iface.lpVtbl = &AudioStreamSample_Vtbl; + object->ref = 1; + object->parent = (IMediaStream*)parent; + object->audio_data = audio_data; + + *audio_stream_sample = (IAudioStreamSample*)&object->IAudioStreamSample_iface; + + return S_OK; +} Modified: trunk/reactos/dll/directx/wine/amstream/mediastreamfilter.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/amstream/…
============================================================================== --- trunk/reactos/dll/directx/wine/amstream/mediastreamfilter.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/amstream/mediastreamfilter.c [iso-8859-1] Tue Oct 1 15:06:37 2013 @@ -1,7 +1,7 @@ /* * Implementation of MediaStream Filter * - * Copyright 2008 Christian Costa + * Copyright 2008, 2012 Christian Costa * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,6 +24,9 @@ //#include "winbase.h" //#include "wingdi.h" +#include <dshow.h> + +#include <wine/strmbase.h> //#include "amstream_private.h" #include <amstream.h> @@ -32,46 +35,191 @@ WINE_DEFAULT_DEBUG_CHANNEL(amstream); +typedef struct MediaStreamFilter_InputPin +{ + BaseInputPin pin; +} MediaStreamFilter_InputPin; + +static const IPinVtbl MediaStreamFilter_InputPin_Vtbl = +{ + BaseInputPinImpl_QueryInterface, + BasePinImpl_AddRef, + BaseInputPinImpl_Release, + BaseInputPinImpl_Connect, + BaseInputPinImpl_ReceiveConnection, + BasePinImpl_Disconnect, + BasePinImpl_ConnectedTo, + BasePinImpl_ConnectionMediaType, + BasePinImpl_QueryPinInfo, + BasePinImpl_QueryDirection, + BasePinImpl_QueryId, + BasePinImpl_QueryAccept, + BasePinImpl_EnumMediaTypes, + BasePinImpl_QueryInternalConnections, + BaseInputPinImpl_EndOfStream, + BaseInputPinImpl_BeginFlush, + BaseInputPinImpl_EndFlush, + BasePinImpl_NewSegment +}; + typedef struct { - IMediaStreamFilter IMediaStreamFilter_iface; - LONG ref; - CRITICAL_SECTION csFilter; - FILTER_STATE state; - REFERENCE_TIME rtStreamStart; - IReferenceClock * pClock; - FILTER_INFO filterInfo; + BaseFilter filter; + ULONG nb_streams; + IMediaStream** streams; + IPin** pins; } IMediaStreamFilterImpl; static inline IMediaStreamFilterImpl *impl_from_IMediaStreamFilter(IMediaStreamFilter *iface) { - return CONTAINING_RECORD(iface, IMediaStreamFilterImpl, IMediaStreamFilter_iface); -} + return CONTAINING_RECORD(iface, IMediaStreamFilterImpl, filter); +} + +static HRESULT WINAPI BasePinImpl_CheckMediaType(BasePin *This, const AM_MEDIA_TYPE *pmt) +{ + IMediaStreamFilterImpl *filter = impl_from_IMediaStreamFilter((IMediaStreamFilter*)This->pinInfo.pFilter); + MSPID purpose_id; + ULONG i; + + TRACE("Checking media type %s - %s\n", debugstr_guid(&pmt->majortype), debugstr_guid(&pmt->subtype)); + + /* Find which stream is associated with the pin */ + for (i = 0; i < filter->nb_streams; i++) + if (&This->IPin_iface == filter->pins[i]) + break; + + if (i == filter->nb_streams) + return S_FALSE; + + if (FAILED(IMediaStream_GetInformation(filter->streams[i], &purpose_id, NULL))) + return S_FALSE; + + TRACE("Checking stream with purpose id %s\n", debugstr_guid(&purpose_id)); + + if (IsEqualGUID(&purpose_id, &MSPID_PrimaryVideo) && IsEqualGUID(&pmt->majortype, &MEDIATYPE_Video)) + { + if (IsEqualGUID(&pmt->subtype, &MEDIASUBTYPE_RGB1) || + IsEqualGUID(&pmt->subtype, &MEDIASUBTYPE_RGB4) || + IsEqualGUID(&pmt->subtype, &MEDIASUBTYPE_RGB8) || + IsEqualGUID(&pmt->subtype, &MEDIASUBTYPE_RGB565) || + IsEqualGUID(&pmt->subtype, &MEDIASUBTYPE_RGB555) || + IsEqualGUID(&pmt->subtype, &MEDIASUBTYPE_RGB24) || + IsEqualGUID(&pmt->subtype, &MEDIASUBTYPE_RGB32)) + { + TRACE("Video sub-type %s matches\n", debugstr_guid(&pmt->subtype)); + return S_OK; + } + } + else if (IsEqualGUID(&purpose_id, &MSPID_PrimaryAudio) && IsEqualGUID(&pmt->majortype, &MEDIATYPE_Audio)) + { + if (IsEqualGUID(&pmt->subtype, &MEDIASUBTYPE_PCM)) + { + TRACE("Audio sub-type %s matches\n", debugstr_guid(&pmt->subtype)); + return S_OK; + } + } + + return S_FALSE; +} + +static LONG WINAPI BasePinImp_GetMediaTypeVersion(BasePin *This) +{ + return 0; +} + +static HRESULT WINAPI BasePinImp_GetMediaType(BasePin *This, int index, AM_MEDIA_TYPE *amt) +{ + IMediaStreamFilterImpl *filter = (IMediaStreamFilterImpl*)This->pinInfo.pFilter; + MSPID purpose_id; + ULONG i; + + /* FIXME: Reset structure as we only fill majortype and minortype for now */ + ZeroMemory(amt, sizeof(*amt)); + + /* Find which stream is associated with the pin */ + for (i = 0; i < filter->nb_streams; i++) + if (&This->IPin_iface == filter->pins[i]) + break; + + if (i == filter->nb_streams) + return S_FALSE; + + if (FAILED(IMediaStream_GetInformation(filter->streams[i], &purpose_id, NULL))) + return S_FALSE; + + TRACE("Processing stream with purpose id %s\n", debugstr_guid(&purpose_id)); + + if (IsEqualGUID(&purpose_id, &MSPID_PrimaryVideo)) + { + amt->majortype = MEDIATYPE_Video; + + switch (index) + { + case 0: + amt->subtype = MEDIASUBTYPE_RGB1; + break; + case 1: + amt->subtype = MEDIASUBTYPE_RGB4; + break; + case 2: + amt->subtype = MEDIASUBTYPE_RGB8; + break; + case 3: + amt->subtype = MEDIASUBTYPE_RGB565; + break; + case 4: + amt->subtype = MEDIASUBTYPE_RGB555; + break; + case 5: + amt->subtype = MEDIASUBTYPE_RGB24; + break; + case 6: + amt->subtype = MEDIASUBTYPE_RGB32; + break; + default: + return S_FALSE; + } + } + else if (IsEqualGUID(&purpose_id, &MSPID_PrimaryAudio)) + { + if (index) + return S_FALSE; + + amt->majortype = MEDIATYPE_Audio; + amt->subtype = MEDIASUBTYPE_PCM; + } + + return S_OK; +} + +static const BasePinFuncTable input_BaseFuncTable = { + BasePinImpl_CheckMediaType, + NULL, + BasePinImp_GetMediaTypeVersion, + BasePinImp_GetMediaType +}; + +static const BaseInputPinFuncTable input_BaseInputFuncTable = { + NULL +}; /*** IUnknown methods ***/ -static HRESULT WINAPI MediaStreamFilterImpl_QueryInterface(IMediaStreamFilter *iface, REFIID riid, - void **ppv) -{ - IMediaStreamFilterImpl *This = impl_from_IMediaStreamFilter(iface); - - TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); - - *ppv = NULL; - - if (IsEqualIID(riid, &IID_IUnknown)) - *ppv = This; - else if (IsEqualIID(riid, &IID_IPersist)) - *ppv = This; - else if (IsEqualIID(riid, &IID_IMediaFilter)) - *ppv = This; - else if (IsEqualIID(riid, &IID_IBaseFilter)) - *ppv = This; - else if (IsEqualIID(riid, &IID_IMediaStreamFilter)) - *ppv = This; - - if (*ppv) - { - IUnknown_AddRef((IUnknown *)(*ppv)); +static HRESULT WINAPI MediaStreamFilterImpl_QueryInterface(IMediaStreamFilter *iface, REFIID riid, void **ret_iface) +{ + TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ret_iface); + + *ret_iface = NULL; + + if (IsEqualIID(riid, &IID_IUnknown) || + IsEqualIID(riid, &IID_IPersist) || + IsEqualIID(riid, &IID_IMediaFilter) || + IsEqualIID(riid, &IID_IBaseFilter) || + IsEqualIID(riid, &IID_IMediaStreamFilter)) + *ret_iface = iface; + + if (*ret_iface) + { + IMediaStreamFilter_AddRef(*ret_iface); return S_OK; } @@ -81,132 +229,178 @@ static ULONG WINAPI MediaStreamFilterImpl_AddRef(IMediaStreamFilter *iface) { IMediaStreamFilterImpl *This = impl_from_IMediaStreamFilter(iface); - ULONG refCount = InterlockedIncrement(&This->ref); - - TRACE("(%p)->() AddRef from %d\n", iface, refCount - 1); - - return refCount; + ULONG ref = BaseFilterImpl_AddRef(&This->filter.IBaseFilter_iface); + + TRACE("(%p)->(): new ref = %u\n", iface, ref); + + return ref; } static ULONG WINAPI MediaStreamFilterImpl_Release(IMediaStreamFilter *iface) { IMediaStreamFilterImpl *This = impl_from_IMediaStreamFilter(iface); - ULONG refCount = InterlockedDecrement(&This->ref); - - TRACE("(%p)->() Release from %d\n", iface, refCount + 1); - - if (!refCount) + ULONG ref = BaseFilterImpl_Release(&This->filter.IBaseFilter_iface); + + TRACE("(%p)->(): new ref = %u\n", iface, ref); + + if (!ref) + { + ULONG i; + for (i = 0; i < This->nb_streams; i++) + { + IMediaStream_Release(This->streams[i]); + IPin_Release(This->pins[i]); + } HeapFree(GetProcessHeap(), 0, This); - - return refCount; + } + + return ref; } /*** IPersist methods ***/ -static HRESULT WINAPI MediaStreamFilterImpl_GetClassID(IMediaStreamFilter * iface, CLSID * pClsid) -{ - TRACE("(%p)->(%p)\n", iface, pClsid); - - *pClsid = CLSID_MediaStreamFilter; +static HRESULT WINAPI MediaStreamFilterImpl_GetClassID(IMediaStreamFilter *iface, CLSID *clsid) +{ + IMediaStreamFilterImpl *This = impl_from_IMediaStreamFilter(iface); + return BaseFilterImpl_GetClassID(&This->filter.IBaseFilter_iface, clsid); +} + +/*** IBaseFilter methods ***/ + +static HRESULT WINAPI MediaStreamFilterImpl_Stop(IMediaStreamFilter *iface) +{ + FIXME("(%p)->(): Stub!\n", iface); + + return E_NOTIMPL; +} + +static HRESULT WINAPI MediaStreamFilterImpl_Pause(IMediaStreamFilter *iface) +{ + FIXME("(%p)->(): Stub!\n", iface); + + return E_NOTIMPL; +} + +static HRESULT WINAPI MediaStreamFilterImpl_Run(IMediaStreamFilter *iface, REFERENCE_TIME start) +{ + FIXME("(%p)->(%s): Stub!\n", iface, wine_dbgstr_longlong(start)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI MediaStreamFilterImpl_GetState(IMediaStreamFilter *iface, DWORD ms_timeout, FILTER_STATE *state) +{ + IMediaStreamFilterImpl *This = impl_from_IMediaStreamFilter(iface); + return BaseFilterImpl_GetState(&This->filter.IBaseFilter_iface, ms_timeout, state); +} + +static HRESULT WINAPI MediaStreamFilterImpl_SetSyncSource(IMediaStreamFilter *iface, IReferenceClock *clock) +{ + IMediaStreamFilterImpl *This = impl_from_IMediaStreamFilter(iface); + return BaseFilterImpl_SetSyncSource(&This->filter.IBaseFilter_iface, clock); +} + +static HRESULT WINAPI MediaStreamFilterImpl_GetSyncSource(IMediaStreamFilter *iface, IReferenceClock **clock) +{ + IMediaStreamFilterImpl *This = impl_from_IMediaStreamFilter(iface); + return BaseFilterImpl_GetSyncSource(&This->filter.IBaseFilter_iface, clock); +} + +static HRESULT WINAPI MediaStreamFilterImpl_EnumPins(IMediaStreamFilter *iface, IEnumPins **enum_pins) +{ + IMediaStreamFilterImpl *This = impl_from_IMediaStreamFilter(iface); + return BaseFilterImpl_EnumPins(&This->filter.IBaseFilter_iface, enum_pins); +} + +static HRESULT WINAPI MediaStreamFilterImpl_FindPin(IMediaStreamFilter *iface, LPCWSTR id, IPin **pin) +{ + FIXME("(%p)->(%s,%p): Stub!\n", iface, debugstr_w(id), pin); + + return E_NOTIMPL; +} + +static HRESULT WINAPI MediaStreamFilterImpl_QueryFilterInfo(IMediaStreamFilter *iface, FILTER_INFO *info) +{ + IMediaStreamFilterImpl *This = impl_from_IMediaStreamFilter(iface); + return BaseFilterImpl_QueryFilterInfo(&This->filter.IBaseFilter_iface, info); +} + +static HRESULT WINAPI MediaStreamFilterImpl_JoinFilterGraph(IMediaStreamFilter *iface, IFilterGraph *graph, LPCWSTR name) +{ + IMediaStreamFilterImpl *This = impl_from_IMediaStreamFilter(iface); + return BaseFilterImpl_JoinFilterGraph(&This->filter.IBaseFilter_iface, graph, name); +} + +static HRESULT WINAPI MediaStreamFilterImpl_QueryVendorInfo(IMediaStreamFilter *iface, LPWSTR *vendor_info) +{ + IMediaStreamFilterImpl *This = impl_from_IMediaStreamFilter(iface); + return BaseFilterImpl_QueryVendorInfo(&This->filter.IBaseFilter_iface, vendor_info); +} + +/*** IMediaStreamFilter methods ***/ + +static HRESULT WINAPI MediaStreamFilterImpl_AddMediaStream(IMediaStreamFilter* iface, IAMMediaStream *pAMMediaStream) +{ + IMediaStreamFilterImpl *This = impl_from_IMediaStreamFilter(iface); + IMediaStream** streams; + IPin** pins; + MediaStreamFilter_InputPin* pin; + HRESULT hr; + PIN_INFO info; + MSPID purpose_id; + + TRACE("(%p)->(%p)\n", iface, pAMMediaStream); + + streams = CoTaskMemRealloc(This->streams, (This->nb_streams + 1) * sizeof(IMediaStream*)); + if (!streams) + return E_OUTOFMEMORY; + This->streams = streams; + pins = CoTaskMemRealloc(This->pins, (This->nb_streams + 1) * sizeof(IPin*)); + if (!pins) + return E_OUTOFMEMORY; + This->pins = pins; + info.pFilter = (IBaseFilter*)&This->filter; + info.dir = PINDIR_INPUT; + hr = IAMMediaStream_GetInformation(pAMMediaStream, &purpose_id, NULL); + if (FAILED(hr)) + return hr; + /* Pin name is "I{guid MSPID_PrimaryVideo or MSPID_PrimaryAudio}" */ + info.achName[0] = 'I'; + StringFromGUID2(&purpose_id, info.achName + 1, 40); + hr = BaseInputPin_Construct(&MediaStreamFilter_InputPin_Vtbl, &info, &input_BaseFuncTable, &input_BaseInputFuncTable, &This->filter.csFilter, NULL, &This->pins[This->nb_streams]); + if (FAILED(hr)) + return hr; + + pin = (MediaStreamFilter_InputPin*)This->pins[This->nb_streams]; + pin->pin.pin.pinInfo.pFilter = (LPVOID)This; + This->streams[This->nb_streams] = (IMediaStream*)pAMMediaStream; + This->nb_streams++; + + IMediaStream_AddRef((IMediaStream*)pAMMediaStream); return S_OK; } -/*** IMediaFilter methods ***/ - -static HRESULT WINAPI MediaStreamFilterImpl_Stop(IMediaStreamFilter * iface) -{ - FIXME("(%p)->(): Stub!\n", iface); - - return E_NOTIMPL; -} - -static HRESULT WINAPI MediaStreamFilterImpl_Pause(IMediaStreamFilter * iface) -{ - FIXME("(%p)->(): Stub!\n", iface); - - return E_NOTIMPL; -} - -static HRESULT WINAPI MediaStreamFilterImpl_Run(IMediaStreamFilter * iface, REFERENCE_TIME tStart) -{ - FIXME("(%p)->(%s): Stub!\n", iface, wine_dbgstr_longlong(tStart)); - - return E_NOTIMPL; -} - -static HRESULT WINAPI MediaStreamFilterImpl_GetState(IMediaStreamFilter * iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState) -{ - FIXME("(%p)->(%d,%p): Stub!\n", iface, dwMilliSecsTimeout, pState); - - return E_NOTIMPL; -} - -static HRESULT WINAPI MediaStreamFilterImpl_SetSyncSource(IMediaStreamFilter * iface, IReferenceClock *pClock) -{ - TRACE("(%p)->(%p): Stub!\n", iface, pClock); - - return E_NOTIMPL; -} - -static HRESULT WINAPI MediaStreamFilterImpl_GetSyncSource(IMediaStreamFilter * iface, IReferenceClock **ppClock) -{ - FIXME("(%p)->(%p): Stub!\n", iface, ppClock); - - return E_NOTIMPL; -} - -/*** IBaseFilter methods ***/ - -static HRESULT WINAPI MediaStreamFilterImpl_EnumPins(IMediaStreamFilter * iface, IEnumPins **ppEnum) -{ - FIXME("(%p)->(%p): Stub!\n", iface, ppEnum); - - return E_NOTIMPL; -} - -static HRESULT WINAPI MediaStreamFilterImpl_FindPin(IMediaStreamFilter * iface, LPCWSTR Id, IPin **ppPin) -{ - FIXME("(%p)->(%s,%p): Stub!\n", iface, debugstr_w(Id), ppPin); - - return E_NOTIMPL; -} - -static HRESULT WINAPI MediaStreamFilterImpl_QueryFilterInfo(IMediaStreamFilter * iface, FILTER_INFO *pInfo) -{ - FIXME("(%p)->(%p): Stub!\n", iface, pInfo); - - return E_NOTIMPL; -} - -static HRESULT WINAPI MediaStreamFilterImpl_JoinFilterGraph(IMediaStreamFilter * iface, IFilterGraph *pGraph, LPCWSTR pName) -{ - FIXME("(%p)->(%p, %s): Stub!\n", iface, pGraph, debugstr_w(pName)); - - return E_NOTIMPL; -} - -static HRESULT WINAPI MediaStreamFilterImpl_QueryVendorInfo(IMediaStreamFilter * iface, LPWSTR *pVendorInfo) -{ - FIXME("(%p)->(%p): Stub!\n", iface, pVendorInfo); - - return E_NOTIMPL; -} - -/*** IMediaStreamFilter methods ***/ - -static HRESULT WINAPI MediaStreamFilterImpl_AddMediaStream(IMediaStreamFilter* iface, IAMMediaStream *pAMMediaStream) -{ - FIXME("(%p)->(%p): Stub!\n", iface, pAMMediaStream); - - return E_NOTIMPL; -} - static HRESULT WINAPI MediaStreamFilterImpl_GetMediaStream(IMediaStreamFilter* iface, REFMSPID idPurpose, IMediaStream **ppMediaStream) { - FIXME("(%p)->(%s,%p): Stub!\n", iface, debugstr_guid(idPurpose), ppMediaStream); - - return E_NOTIMPL; + IMediaStreamFilterImpl *This = impl_from_IMediaStreamFilter(iface); + MSPID purpose_id; + unsigned int i; + + TRACE("(%p)->(%s,%p)\n", iface, debugstr_guid(idPurpose), ppMediaStream); + + for (i = 0; i < This->nb_streams; i++) + { + IMediaStream_GetInformation(This->streams[i], &purpose_id, NULL); + if (IsEqualIID(&purpose_id, idPurpose)) + { + *ppMediaStream = This->streams[i]; + IMediaStream_AddRef(*ppMediaStream); + return S_OK; + } + } + + return MS_E_NOSTREAM; } static HRESULT WINAPI MediaStreamFilterImpl_EnumMediaStreams(IMediaStreamFilter* iface, LONG Index, IMediaStream **ppMediaStream) @@ -286,6 +480,31 @@ MediaStreamFilterImpl_EndOfStream }; +static IPin* WINAPI MediaStreamFilterImpl_GetPin(BaseFilter *iface, int pos) +{ + IMediaStreamFilterImpl* This = (IMediaStreamFilterImpl*)iface; + + if (pos < This->nb_streams) + { + IPin_AddRef(This->pins[pos]); + return This->pins[pos]; + } + + return NULL; +} + +static LONG WINAPI MediaStreamFilterImpl_GetPinCount(BaseFilter *iface) +{ + IMediaStreamFilterImpl* This = (IMediaStreamFilterImpl*)iface; + + return This->nb_streams; +} + +static const BaseFilterFuncTable BaseFuncTable = { + MediaStreamFilterImpl_GetPin, + MediaStreamFilterImpl_GetPinCount +}; + HRESULT MediaStreamFilter_create(IUnknown *pUnkOuter, void **ppObj) { IMediaStreamFilterImpl* object; @@ -297,13 +516,9 @@ object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IMediaStreamFilterImpl)); if (!object) - { - ERR("Out of memory\n"); return E_OUTOFMEMORY; - } - - object->IMediaStreamFilter_iface.lpVtbl = &MediaStreamFilter_Vtbl; - object->ref = 1; + + BaseFilter_Init(&object->filter, (IBaseFilterVtbl*)&MediaStreamFilter_Vtbl, &CLSID_MediaStreamFilter, (DWORD_PTR)(__FILE__ ": MediaStreamFilterImpl.csFilter"), &BaseFuncTable); *ppObj = object; Modified: trunk/reactos/dll/directx/wine/amstream/version.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/amstream/…
============================================================================== --- trunk/reactos/dll/directx/wine/amstream/version.rc [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/amstream/version.rc [iso-8859-1] Tue Oct 1 15:06:37 2013 @@ -16,7 +16,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -1 WINE_REGISTRY amstream.rgs +1 WINE_REGISTRY amstream_classes.rgs #define WINE_FILEDESCRIPTION_STR "Wine AMStream dll" #define WINE_FILENAME_STR "amstream.dll" @@ -25,4 +25,4 @@ #define WINE_PRODUCTVERSION 6,5,1,900 #define WINE_PRODUCTVERSION_STR "6.5" -#include "wine/wine_common_ver.rc" +#include <wine/wine_common_ver.rc> Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Oct 1 15:06:37 2013 @@ -27,7 +27,7 @@ The following libraries are shared with Wine. -reactos/dll/directx/wine/amstream # Synced to Wine-1.3.37 +reactos/dll/directx/wine/amstream # Synced to Wine-1.7.1 reactos/dll/directx/wine/d3d8 # Synced to Wine-1.7.1 reactos/dll/directx/wine/d3d9 # Synced to Wine-1.7.1 reactos/dll/directx/wine/d3dcompiler_43 # Synced to Wine-1.7.1 @@ -37,8 +37,8 @@ reactos/dll/directx/wine/dinput # Synced to Wine-1.7.1 reactos/dll/directx/wine/dinput8 # Synced to Wine-1.5.26 reactos/dll/directx/wine/dmusic # Synced to Wine-1.5.26 -reactos/dll/directx/wine/dplay # Synced to Wine-1.7.1 -reactos/dll/directx/wine/dplayx # Synced to Wine-1.7.1 +reactos/dll/directx/wine/dplay # Synced to Wine-1.5.26 +reactos/dll/directx/wine/dplayx # Synced to Wine-1.5.26 reactos/dll/directx/wine/dsound # Synced to Wine-1.7.1 reactos/dll/directx/wine/dxdiagn # Synced to Wine-0_9_5 reactos/dll/directx/wine/dxgi # Synced to Wine-1.7.1
11 years, 2 months
1
0
0
0
[aandrejevic] 60492: [SOFT386] Implement the (undocumented) opcode SALC.
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Tue Oct 1 15:02:07 2013 New Revision: 60492 URL:
http://svn.reactos.org/svn/reactos?rev=60492&view=rev
Log: [SOFT386] Implement the (undocumented) opcode SALC. Modified: branches/ntvdm/lib/soft386/opcodes.c branches/ntvdm/lib/soft386/opcodes.h Modified: branches/ntvdm/lib/soft386/opcodes.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/soft386/opcodes.c?rev…
============================================================================== --- branches/ntvdm/lib/soft386/opcodes.c [iso-8859-1] (original) +++ branches/ntvdm/lib/soft386/opcodes.c [iso-8859-1] Tue Oct 1 15:02:07 2013 @@ -253,7 +253,7 @@ Soft386OpcodeGroupD3, Soft386OpcodeAam, Soft386OpcodeAad, - NULL, // TODO: OPCODE 0xD6 NOT SUPPORTED + Soft386OpcodeSalc, Soft386OpcodeXlat, NULL, // TODO: OPCODE 0xD8 NOT SUPPORTED NULL, // TODO: OPCODE 0xD9 NOT SUPPORTED @@ -5588,3 +5588,21 @@ sizeof(USHORT)); } } + +SOFT386_OPCODE_HANDLER(Soft386OpcodeSalc) +{ + /* Make sure this is the right instruction */ + ASSERT(Opcode == 0xD6); + + if (State->PrefixFlags & SOFT386_PREFIX_LOCK) + { + /* Invalid prefix */ + Soft386Exception(State, SOFT386_EXCEPTION_UD); + return FALSE; + } + + /* Set all the bits of AL to CF */ + State->GeneralRegs[SOFT386_REG_EAX].LowByte = State->Flags.Cf ? 0xFF : 0x00; + + return TRUE; +} Modified: branches/ntvdm/lib/soft386/opcodes.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/soft386/opcodes.h?rev…
============================================================================== --- branches/ntvdm/lib/soft386/opcodes.h [iso-8859-1] (original) +++ branches/ntvdm/lib/soft386/opcodes.h [iso-8859-1] Tue Oct 1 15:02:07 2013 @@ -147,5 +147,6 @@ SOFT386_OPCODE_HANDLER(Soft386OpcodeMovEaxOffset); SOFT386_OPCODE_HANDLER(Soft386OpcodeMovOffsetAl); SOFT386_OPCODE_HANDLER(Soft386OpcodeMovOffsetEax); +SOFT386_OPCODE_HANDLER(Soft386OpcodeSalc); #endif // _OPCODES_H_
11 years, 2 months
1
0
0
0
← Newer
1
...
29
30
31
32
33
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Results per page:
10
25
50
100
200