winehq.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
2025
February
January
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
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
February 2011
----- 2025 -----
February 2025
January 2025
----- 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
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
674 discussions
Start a n
N
ew thread
Andrew Nguyen : dxdiagn: Transition to the information tree by making IDxDiagContainer view the information tree .
by Alexandre Julliard
15 Feb '11
15 Feb '11
Module: wine Branch: master Commit: a9d1f1bb4faa21df8399f0ed21fa95b2bb7b620b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a9d1f1bb4faa21df8399f0ed2…
Author: Andrew Nguyen <anguyen(a)codeweavers.com> Date: Tue Feb 15 01:17:16 2011 -0600 dxdiagn: Transition to the information tree by making IDxDiagContainer view the information tree. --- dlls/dxdiagn/container.c | 98 ++++++++------------------------------- dlls/dxdiagn/dxdiag_private.h | 31 ++++--------- dlls/dxdiagn/provider.c | 64 +------------------------- dlls/dxdiagn/tests/container.c | 2 +- 4 files changed, 33 insertions(+), 162 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=a9d1f1bb4faa21df8399f…
1
0
0
0
Andrew Nguyen : dxdiagn: Remove the old container initialization code in preparation for switching to the information tree .
by Alexandre Julliard
15 Feb '11
15 Feb '11
Module: wine Branch: master Commit: 6ffcfe58c924ff7a8e5c8aef92c77444d0569fd9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6ffcfe58c924ff7a8e5c8aef9…
Author: Andrew Nguyen <anguyen(a)codeweavers.com> Date: Tue Feb 15 01:15:07 2011 -0600 dxdiagn: Remove the old container initialization code in preparation for switching to the information tree. --- dlls/dxdiagn/provider.c | 607 +---------------------------------------------- 1 files changed, 12 insertions(+), 595 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=6ffcfe58c924ff7a8e5c8…
1
0
0
0
Andrew Nguyen : dxdiagn: Add code that populates the DxDiag_DirectShowFilters container.
by Alexandre Julliard
15 Feb '11
15 Feb '11
Module: wine Branch: master Commit: 5ae57265c59a35931cf055876ec44e87ab11dcfd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5ae57265c59a35931cf055876…
Author: Andrew Nguyen <anguyen(a)codeweavers.com> Date: Tue Feb 15 01:14:53 2011 -0600 dxdiagn: Add code that populates the DxDiag_DirectShowFilters container. --- dlls/dxdiagn/provider.c | 271 ++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 270 insertions(+), 1 deletions(-) diff --git a/dlls/dxdiagn/provider.c b/dlls/dxdiagn/provider.c index c61555e..5eafefd 100644 --- a/dlls/dxdiagn/provider.c +++ b/dlls/dxdiagn/provider.c @@ -1417,11 +1417,280 @@ static HRESULT build_directxfiles_tree(IDxDiagContainerImpl_Container *node) return S_OK; } -static HRESULT build_directshowfilters_tree(IDxDiagContainerImpl_Container *node) +static HRESULT read_property_names(IPropertyBag *pPropBag, VARIANT *friendly_name, VARIANT *clsid_name) { + static const WCHAR wszFriendlyName[] = {'F','r','i','e','n','d','l','y','N','a','m','e',0}; + static const WCHAR wszClsidName[] = {'C','L','S','I','D',0}; + + HRESULT hr; + + VariantInit(friendly_name); + VariantInit(clsid_name); + + hr = IPropertyBag_Read(pPropBag, wszFriendlyName, friendly_name, 0); + if (FAILED(hr)) + return hr; + + hr = IPropertyBag_Read(pPropBag, wszClsidName, clsid_name, 0); + if (FAILED(hr)) + { + VariantClear(friendly_name); + return hr; + } + return S_OK; } +static HRESULT fill_filter_data_information(IDxDiagContainerImpl_Container *subcont, BYTE *pData, ULONG cb) +{ + static const WCHAR szVersionW[] = {'s','z','V','e','r','s','i','o','n',0}; + static const WCHAR dwInputs[] = {'d','w','I','n','p','u','t','s',0}; + static const WCHAR dwOutputs[] = {'d','w','O','u','t','p','u','t','s',0}; + static const WCHAR dwMeritW[] = {'d','w','M','e','r','i','t',0}; + static const WCHAR szVersionFormat[] = {'v','%','d',0}; + + HRESULT hr; + IFilterMapper2 *pFileMapper = NULL; + IAMFilterData *pFilterData = NULL; + REGFILTER2 *pRF = NULL; + WCHAR bufferW[10]; + ULONG j; + DWORD dwNOutputs = 0; + DWORD dwNInputs = 0; + + hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC, &IID_IFilterMapper2, + (void **)&pFileMapper); + if (FAILED(hr)) + return hr; + + hr = IFilterMapper2_QueryInterface(pFileMapper, &IID_IAMFilterData, (void **)&pFilterData); + if (FAILED(hr)) + goto cleanup; + + hr = IAMFilterData_ParseFilterData(pFilterData, pData, cb, (BYTE **)&pRF); + if (FAILED(hr)) + goto cleanup; + + snprintfW(bufferW, sizeof(bufferW)/sizeof(bufferW[0]), szVersionFormat, pRF->dwVersion); + hr = add_bstr_property(subcont, szVersionW, bufferW); + if (FAILED(hr)) + goto cleanup; + + if (pRF->dwVersion == 1) + { + for (j = 0; j < pRF->u.s.cPins; j++) + if (pRF->u.s.rgPins[j].bOutput) + dwNOutputs++; + else + dwNInputs++; + } + else if (pRF->dwVersion == 2) + { + for (j = 0; j < pRF->u.s1.cPins2; j++) + if (pRF->u.s1.rgPins2[j].dwFlags & REG_PINFLAG_B_OUTPUT) + dwNOutputs++; + else + dwNInputs++; + } + + hr = add_ui4_property(subcont, dwInputs, dwNInputs); + if (FAILED(hr)) + goto cleanup; + + hr = add_ui4_property(subcont, dwOutputs, dwNOutputs); + if (FAILED(hr)) + goto cleanup; + + hr = add_ui4_property(subcont, dwMeritW, pRF->dwMerit); + if (FAILED(hr)) + goto cleanup; + + hr = S_OK; +cleanup: + CoTaskMemFree(pRF); + if (pFilterData) IAMFilterData_Release(pFilterData); + if (pFileMapper) IFilterMapper2_Release(pFileMapper); + + return hr; +} + +static HRESULT fill_filter_container(IDxDiagContainerImpl_Container *subcont, IMoniker *pMoniker) +{ + static const WCHAR szName[] = {'s','z','N','a','m','e',0}; + static const WCHAR ClsidFilterW[] = {'C','l','s','i','d','F','i','l','t','e','r',0}; + static const WCHAR wszFilterDataName[] = {'F','i','l','t','e','r','D','a','t','a',0}; + + HRESULT hr; + IPropertyBag *pPropFilterBag = NULL; + BYTE *pData; + VARIANT friendly_name; + VARIANT clsid_name; + VARIANT v; + + VariantInit(&friendly_name); + VariantInit(&clsid_name); + VariantInit(&v); + + hr = IMoniker_BindToStorage(pMoniker, NULL, NULL, &IID_IPropertyBag, (void **)&pPropFilterBag); + if (FAILED(hr)) + return hr; + + hr = read_property_names(pPropFilterBag, &friendly_name, &clsid_name); + if (FAILED(hr)) + goto cleanup; + + hr = add_bstr_property(subcont, szName, V_BSTR(&friendly_name)); + if (FAILED(hr)) + goto cleanup; + + hr = add_bstr_property(subcont, ClsidFilterW, V_BSTR(&clsid_name)); + if (FAILED(hr)) + goto cleanup; + + hr = IPropertyBag_Read(pPropFilterBag, wszFilterDataName, &v, NULL); + if (FAILED(hr)) + goto cleanup; + + hr = SafeArrayAccessData(V_ARRAY(&v), (void **)&pData); + if (FAILED(hr)) + goto cleanup; + + hr = fill_filter_data_information(subcont, pData, V_ARRAY(&v)->rgsabound->cElements); + SafeArrayUnaccessData(V_ARRAY(&v)); + if (FAILED(hr)) + goto cleanup; + + hr = S_OK; +cleanup: + VariantClear(&v); + VariantClear(&clsid_name); + VariantClear(&friendly_name); + if (pPropFilterBag) IPropertyBag_Release(pPropFilterBag); + + return hr; +} + +static HRESULT build_directshowfilters_tree(IDxDiagContainerImpl_Container *node) +{ + static const WCHAR szCatName[] = {'s','z','C','a','t','N','a','m','e',0}; + static const WCHAR ClsidCatW[] = {'C','l','s','i','d','C','a','t',0}; + static const WCHAR szIdFormat[] = {'%','d',0}; + + HRESULT hr; + int i = 0; + ICreateDevEnum *pCreateDevEnum; + IEnumMoniker *pEmCat = NULL; + IMoniker *pMCat = NULL; + IEnumMoniker *pEnum = NULL; + + hr = CoCreateInstance(&CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER, + &IID_ICreateDevEnum, (void **)&pCreateDevEnum); + if (FAILED(hr)) + return hr; + + hr = ICreateDevEnum_CreateClassEnumerator(pCreateDevEnum, &CLSID_ActiveMovieCategories, &pEmCat, 0); + if (FAILED(hr)) + goto cleanup; + + while (IEnumMoniker_Next(pEmCat, 1, &pMCat, NULL) == S_OK) + { + VARIANT vCatName; + VARIANT vCatClsid; + IPropertyBag *pPropBag; + CLSID clsidCat; + IMoniker *pMoniker = NULL; + + hr = IMoniker_BindToStorage(pMCat, NULL, NULL, &IID_IPropertyBag, (void **)&pPropBag); + if (FAILED(hr)) + { + IMoniker_Release(pMCat); + break; + } + + hr = read_property_names(pPropBag, &vCatName, &vCatClsid); + IPropertyBag_Release(pPropBag); + if (FAILED(hr)) + { + IMoniker_Release(pMCat); + break; + } + + hr = CLSIDFromString(V_BSTR(&vCatClsid), &clsidCat); + if (FAILED(hr)) + { + IMoniker_Release(pMCat); + VariantClear(&vCatClsid); + VariantClear(&vCatName); + break; + } + + hr = ICreateDevEnum_CreateClassEnumerator(pCreateDevEnum, &clsidCat, &pEnum, 0); + if (hr != S_OK) + { + IMoniker_Release(pMCat); + VariantClear(&vCatClsid); + VariantClear(&vCatName); + continue; + } + + while (IEnumMoniker_Next(pEnum, 1, &pMoniker, NULL) == S_OK) + { + WCHAR bufferW[10]; + IDxDiagContainerImpl_Container *subcont; + + snprintfW(bufferW, sizeof(bufferW)/sizeof(bufferW[0]), szIdFormat, i); + subcont = allocate_information_node(bufferW); + if (!subcont) + { + hr = E_OUTOFMEMORY; + IMoniker_Release(pMoniker); + break; + } + + hr = add_bstr_property(subcont, szCatName, V_BSTR(&vCatName)); + if (FAILED(hr)) + { + free_information_tree(subcont); + IMoniker_Release(pMoniker); + break; + } + + hr = add_bstr_property(subcont, ClsidCatW, V_BSTR(&vCatClsid)); + if (FAILED(hr)) + { + free_information_tree(subcont); + IMoniker_Release(pMoniker); + break; + } + + hr = fill_filter_container(subcont, pMoniker); + if (FAILED(hr)) + { + free_information_tree(subcont); + IMoniker_Release(pMoniker); + break; + } + + add_subcontainer(node, subcont); + i++; + IMoniker_Release(pMoniker); + } + + IEnumMoniker_Release(pEnum); + IMoniker_Release(pMCat); + VariantClear(&vCatClsid); + VariantClear(&vCatName); + + if (FAILED(hr)) + break; + } + +cleanup: + if (pEmCat) IEnumMoniker_Release(pEmCat); + ICreateDevEnum_Release(pCreateDevEnum); + return hr; +} + static HRESULT build_logicaldisks_tree(IDxDiagContainerImpl_Container *node) { return S_OK;
1
0
0
0
Andrew Nguyen : dxdiagn: Add code that populates the DxDiag_DirectXFiles container.
by Alexandre Julliard
15 Feb '11
15 Feb '11
Module: wine Branch: master Commit: 606f428275fb3f209795dd25db0c3fef7240e9cd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=606f428275fb3f209795dd25d…
Author: Andrew Nguyen <anguyen(a)codeweavers.com> Date: Tue Feb 15 01:14:45 2011 -0600 dxdiagn: Add code that populates the DxDiag_DirectXFiles container. --- dlls/dxdiagn/provider.c | 162 +++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 162 insertions(+), 0 deletions(-) diff --git a/dlls/dxdiagn/provider.c b/dlls/dxdiagn/provider.c index dfb892a..c61555e 100644 --- a/dlls/dxdiagn/provider.c +++ b/dlls/dxdiagn/provider.c @@ -1250,8 +1250,170 @@ static HRESULT build_systemdevices_tree(IDxDiagContainerImpl_Container *node) return S_OK; } +static HRESULT fill_file_description(IDxDiagContainerImpl_Container *node, const WCHAR *szFilePath, const WCHAR *szFileName) +{ + static const WCHAR szSlashSep[] = {'\\',0}; + static const WCHAR szPath[] = {'s','z','P','a','t','h',0}; + static const WCHAR szName[] = {'s','z','N','a','m','e',0}; + static const WCHAR szVersion[] = {'s','z','V','e','r','s','i','o','n',0}; + static const WCHAR szAttributes[] = {'s','z','A','t','t','r','i','b','u','t','e','s',0}; + static const WCHAR szLanguageEnglish[] = {'s','z','L','a','n','g','u','a','g','e','E','n','g','l','i','s','h',0}; + static const WCHAR dwFileTimeHigh[] = {'d','w','F','i','l','e','T','i','m','e','H','i','g','h',0}; + static const WCHAR dwFileTimeLow[] = {'d','w','F','i','l','e','T','i','m','e','L','o','w',0}; + static const WCHAR bBeta[] = {'b','B','e','t','a',0}; + static const WCHAR bDebug[] = {'b','D','e','b','u','g',0}; + static const WCHAR bExists[] = {'b','E','x','i','s','t','s',0}; + + /* Values */ + static const WCHAR szFinal_Retail_v[] = {'F','i','n','a','l',' ','R','e','t','a','i','l',0}; + static const WCHAR szEnglish_v[] = {'E','n','g','l','i','s','h',0}; + static const WCHAR szVersionFormat[] = {'%','u','.','%','0','2','u','.','%','0','4','u','.','%','0','4','u',0}; + + HRESULT hr; + WCHAR *szFile; + WCHAR szVersion_v[1024]; + DWORD retval, hdl; + void *pVersionInfo = NULL; + BOOL boolret = FALSE; + UINT uiLength; + VS_FIXEDFILEINFO *pFileInfo; + + szFile = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR) * (lstrlenW(szFilePath) + + lstrlenW(szFileName) + 2 /* slash + terminator */)); + if (!szFile) + return E_OUTOFMEMORY; + + lstrcpyW(szFile, szFilePath); + lstrcatW(szFile, szSlashSep); + lstrcatW(szFile, szFileName); + + retval = GetFileVersionInfoSizeW(szFile, &hdl); + if (retval) + { + pVersionInfo = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, retval); + if (!pVersionInfo) + { + hr = E_OUTOFMEMORY; + goto cleanup; + } + + if (GetFileVersionInfoW(szFile, 0, retval, pVersionInfo) && + VerQueryValueW(pVersionInfo, szSlashSep, (void **)&pFileInfo, &uiLength)) + boolret = TRUE; + } + + hr = add_bstr_property(node, szPath, szFile); + if (FAILED(hr)) + goto cleanup; + + hr = add_bstr_property(node, szName, szFileName); + if (FAILED(hr)) + goto cleanup; + + hr = add_bool_property(node, bExists, boolret); + if (FAILED(hr)) + goto cleanup; + + if (boolret) + { + snprintfW(szVersion_v, sizeof(szVersion_v)/sizeof(szVersion_v[0]), + szVersionFormat, + HIWORD(pFileInfo->dwFileVersionMS), + LOWORD(pFileInfo->dwFileVersionMS), + HIWORD(pFileInfo->dwFileVersionLS), + LOWORD(pFileInfo->dwFileVersionLS)); + + hr = add_bstr_property(node, szVersion, szVersion_v); + if (FAILED(hr)) + goto cleanup; + + hr = add_bstr_property(node, szAttributes, szFinal_Retail_v); + if (FAILED(hr)) + goto cleanup; + + hr = add_bstr_property(node, szLanguageEnglish, szEnglish_v); + if (FAILED(hr)) + goto cleanup; + + hr = add_ui4_property(node, dwFileTimeHigh, pFileInfo->dwFileDateMS); + if (FAILED(hr)) + goto cleanup; + + hr = add_ui4_property(node, dwFileTimeLow, pFileInfo->dwFileDateLS); + if (FAILED(hr)) + goto cleanup; + + hr = add_bool_property(node, bBeta, ((pFileInfo->dwFileFlags & pFileInfo->dwFileFlagsMask) & VS_FF_PRERELEASE) != 0); + if (FAILED(hr)) + goto cleanup; + + hr = add_bool_property(node, bDebug, ((pFileInfo->dwFileFlags & pFileInfo->dwFileFlagsMask) & VS_FF_DEBUG) != 0); + if (FAILED(hr)) + goto cleanup; + } + + hr = S_OK; +cleanup: + HeapFree(GetProcessHeap(), 0, pVersionInfo); + HeapFree(GetProcessHeap(), 0, szFile); + + return hr; +} static HRESULT build_directxfiles_tree(IDxDiagContainerImpl_Container *node) { + static const WCHAR dlls[][15] = + { + {'d','3','d','8','.','d','l','l',0}, + {'d','3','d','9','.','d','l','l',0}, + {'d','d','r','a','w','.','d','l','l',0}, + {'d','e','v','e','n','u','m','.','d','l','l',0}, + {'d','i','n','p','u','t','8','.','d','l','l',0}, + {'d','i','n','p','u','t','.','d','l','l',0}, + {'d','m','b','a','n','d','.','d','l','l',0}, + {'d','m','c','o','m','p','o','s','.','d','l','l',0}, + {'d','m','i','m','e','.','d','l','l',0}, + {'d','m','l','o','a','d','e','r','.','d','l','l',0}, + {'d','m','s','c','r','i','p','t','.','d','l','l',0}, + {'d','m','s','t','y','l','e','.','d','l','l',0}, + {'d','m','s','y','n','t','h','.','d','l','l',0}, + {'d','m','u','s','i','c','.','d','l','l',0}, + {'d','p','l','a','y','x','.','d','l','l',0}, + {'d','p','n','e','t','.','d','l','l',0}, + {'d','s','o','u','n','d','.','d','l','l',0}, + {'d','s','w','a','v','e','.','d','l','l',0}, + {'d','x','d','i','a','g','n','.','d','l','l',0}, + {'q','u','a','r','t','z','.','d','l','l',0} + }; + + HRESULT hr; + WCHAR szFilePath[MAX_PATH]; + INT i; + + GetSystemDirectoryW(szFilePath, MAX_PATH); + + for (i = 0; i < sizeof(dlls) / sizeof(dlls[0]); i++) + { + static const WCHAR szFormat[] = {'%','d',0}; + + WCHAR szFileID[5]; + IDxDiagContainerImpl_Container *file_container; + + snprintfW(szFileID, sizeof(szFileID)/sizeof(szFileID[0]), szFormat, i); + + file_container = allocate_information_node(szFileID); + if (!file_container) + return E_OUTOFMEMORY; + + hr = fill_file_description(file_container, szFilePath, dlls[i]); + if (FAILED(hr)) + { + free_information_tree(file_container); + continue; + } + + add_subcontainer(node, file_container); + } + return S_OK; }
1
0
0
0
Andrew Nguyen : dxdiagn: Add code to create stub containers for DxDiag_DirectSound.
by Alexandre Julliard
15 Feb '11
15 Feb '11
Module: wine Branch: master Commit: 827ce16286c797e054bdb0494352f33398e4daeb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=827ce16286c797e054bdb0494…
Author: Andrew Nguyen <anguyen(a)codeweavers.com> Date: Tue Feb 15 01:14:35 2011 -0600 dxdiagn: Add code to create stub containers for DxDiag_DirectSound. --- dlls/dxdiagn/provider.c | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/dlls/dxdiagn/provider.c b/dlls/dxdiagn/provider.c index 02855bb..dfb892a 100644 --- a/dlls/dxdiagn/provider.c +++ b/dlls/dxdiagn/provider.c @@ -1210,6 +1210,23 @@ cleanup: static HRESULT build_directsound_tree(IDxDiagContainerImpl_Container *node) { + static const WCHAR DxDiag_SoundDevices[] = {'D','x','D','i','a','g','_','S','o','u','n','d','D','e','v','i','c','e','s',0}; + static const WCHAR DxDiag_SoundCaptureDevices[] = {'D','x','D','i','a','g','_','S','o','u','n','d','C','a','p','t','u','r','e','D','e','v','i','c','e','s',0}; + + IDxDiagContainerImpl_Container *cont; + + cont = allocate_information_node(DxDiag_SoundDevices); + if (!cont) + return E_OUTOFMEMORY; + + add_subcontainer(node, cont); + + cont = allocate_information_node(DxDiag_SoundCaptureDevices); + if (!cont) + return E_OUTOFMEMORY; + + add_subcontainer(node, cont); + return S_OK; }
1
0
0
0
Andrew Nguyen : dxdiagn: Add code that populates the DxDiag_DisplayDevices container.
by Alexandre Julliard
15 Feb '11
15 Feb '11
Module: wine Branch: master Commit: 5a2cb2114a098e9cc330676bb2e7655a353b8a4e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5a2cb2114a098e9cc330676bb…
Author: Andrew Nguyen <anguyen(a)codeweavers.com> Date: Tue Feb 15 01:14:27 2011 -0600 dxdiagn: Add code that populates the DxDiag_DisplayDevices container. --- dlls/dxdiagn/provider.c | 119 ++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 118 insertions(+), 1 deletions(-) diff --git a/dlls/dxdiagn/provider.c b/dlls/dxdiagn/provider.c index ac5f366..02855bb 100644 --- a/dlls/dxdiagn/provider.c +++ b/dlls/dxdiagn/provider.c @@ -1088,7 +1088,124 @@ static HRESULT build_systeminfo_tree(IDxDiagContainerImpl_Container *node) static HRESULT build_displaydevices_tree(IDxDiagContainerImpl_Container *node) { - return S_OK; + 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 szAdapterID[] = {'0',0}; + static const WCHAR szEmpty[] = {0}; + + IDxDiagContainerImpl_Container *display_adapter; + HRESULT hr; + IDirectDraw7 *pDirectDraw; + DDSCAPS2 dd_caps; + DISPLAY_DEVICEW disp_dev; + DDSURFACEDESC2 surface_descr; + DWORD tmp; + WCHAR buffer[256]; + + display_adapter = allocate_information_node(szAdapterID); + if (!display_adapter) + return E_OUTOFMEMORY; + + add_subcontainer(node, display_adapter); + + disp_dev.cb = sizeof(disp_dev); + if (EnumDisplayDevicesW( NULL, 0, &disp_dev, 0 )) + { + hr = add_bstr_property(display_adapter, szDeviceName, disp_dev.DeviceName); + if (FAILED(hr)) + return hr; + + hr = add_bstr_property(display_adapter, szDescription, disp_dev.DeviceString); + if (FAILED(hr)) + return hr; + } + + /* For now, silently ignore a failure from DirectDrawCreateEx. */ + hr = DirectDrawCreateEx(NULL, (LPVOID *)&pDirectDraw, &IID_IDirectDraw7, NULL); + if (FAILED(hr)) + return S_OK; + + dd_caps.dwCaps = DDSCAPS_LOCALVIDMEM | DDSCAPS_VIDEOMEMORY; + dd_caps.dwCaps2 = dd_caps.dwCaps3 = dd_caps.dwCaps4 = 0; + hr = IDirectDraw7_GetAvailableVidMem(pDirectDraw, &dd_caps, &tmp, NULL); + if (SUCCEEDED(hr)) + { + static const WCHAR mem_fmt[] = {'%','.','1','f',' ','M','B',0}; + + snprintfW(buffer, sizeof(buffer)/sizeof(buffer[0]), mem_fmt, ((float)tmp) / 1000000.0); + + hr = add_bstr_property(display_adapter, szDisplayMemoryLocalized, buffer); + if (FAILED(hr)) + goto cleanup; + + hr = add_bstr_property(display_adapter, szDisplayMemoryEnglish, buffer); + if (FAILED(hr)) + goto cleanup; + } + + surface_descr.dwSize = sizeof(surface_descr); + hr = IDirectDraw7_GetDisplayMode(pDirectDraw, &surface_descr); + if (SUCCEEDED(hr)) + { + if (surface_descr.dwFlags & DDSD_WIDTH) + { + hr = add_ui4_property(display_adapter, dwWidth, surface_descr.dwWidth); + if (FAILED(hr)) + goto cleanup; + } + + if (surface_descr.dwFlags & DDSD_HEIGHT) + { + hr = add_ui4_property(display_adapter, dwHeight, surface_descr.dwHeight); + if (FAILED(hr)) + goto cleanup; + } + + if (surface_descr.dwFlags & DDSD_PIXELFORMAT) + { + hr = add_ui4_property(display_adapter, dwBpp, surface_descr.u4.ddpfPixelFormat.u1.dwRGBBitCount); + if (FAILED(hr)) + goto cleanup; + } + } + + get_display_device_id(buffer); + + hr = add_bstr_property(display_adapter, szDeviceIdentifier, buffer); + if (FAILED(hr)) + goto cleanup; + + hr = add_bstr_property(display_adapter, szVendorId, szEmpty); + if (FAILED(hr)) + goto cleanup; + + hr = add_bstr_property(display_adapter, szDeviceId, szEmpty); + if (FAILED(hr)) + goto cleanup; + + hr = add_bstr_property(display_adapter, szKeyDeviceKey, szEmpty); + if (FAILED(hr)) + goto cleanup; + + hr = add_bstr_property(display_adapter, szKeyDeviceID, szEmpty); + if (FAILED(hr)) + goto cleanup; + + hr = S_OK; +cleanup: + IDirectDraw7_Release(pDirectDraw); + return hr; } static HRESULT build_directsound_tree(IDxDiagContainerImpl_Container *node)
1
0
0
0
Andrew Nguyen : dxdiagn: Add code that populates the DxDiag_SystemInfo container.
by Alexandre Julliard
15 Feb '11
15 Feb '11
Module: wine Branch: master Commit: 9103efe6a489f5bab91d8fa4436483ddaf103131 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9103efe6a489f5bab91d8fa44…
Author: Andrew Nguyen <anguyen(a)codeweavers.com> Date: Tue Feb 15 01:14:19 2011 -0600 dxdiagn: Add code that populates the DxDiag_SystemInfo container. --- dlls/dxdiagn/provider.c | 213 ++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 212 insertions(+), 1 deletions(-) diff --git a/dlls/dxdiagn/provider.c b/dlls/dxdiagn/provider.c index 9674c28..ac5f366 100644 --- a/dlls/dxdiagn/provider.c +++ b/dlls/dxdiagn/provider.c @@ -828,6 +828,13 @@ static HRESULT DXDiag_InitRootDXDiagContainer(IDxDiagContainer* pRootCont, IDxDi return S_OK; } +static void free_property_information(IDxDiagContainerImpl_Property *prop) +{ + VariantClear(&prop->vProp); + HeapFree(GetProcessHeap(), 0, prop->propName); + HeapFree(GetProcessHeap(), 0, prop); +} + static void free_information_tree(IDxDiagContainerImpl_Container *node) { IDxDiagContainerImpl_Container *ptr, *cursor2; @@ -839,6 +846,14 @@ static void free_information_tree(IDxDiagContainerImpl_Container *node) LIST_FOR_EACH_ENTRY_SAFE(ptr, cursor2, &node->subContainers, IDxDiagContainerImpl_Container, entry) { + IDxDiagContainerImpl_Property *prop, *prop_cursor2; + + LIST_FOR_EACH_ENTRY_SAFE(prop, prop_cursor2, &ptr->properties, IDxDiagContainerImpl_Property, entry) + { + list_remove(&prop->entry); + free_property_information(prop); + } + list_remove(&ptr->entry); free_information_tree(ptr); } @@ -871,14 +886,203 @@ static IDxDiagContainerImpl_Container *allocate_information_node(const WCHAR *na return ret; } +static IDxDiagContainerImpl_Property *allocate_property_information(const WCHAR *name) +{ + IDxDiagContainerImpl_Property *ret; + + ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ret)); + if (!ret) + return NULL; + + ret->propName = HeapAlloc(GetProcessHeap(), 0, (strlenW(name) + 1) * sizeof(*name)); + if (!ret->propName) + { + HeapFree(GetProcessHeap(), 0, ret); + return NULL; + } + strcpyW(ret->propName, name); + + return ret; +} + static inline void add_subcontainer(IDxDiagContainerImpl_Container *node, IDxDiagContainerImpl_Container *subCont) { list_add_tail(&node->subContainers, &subCont->entry); ++node->nSubContainers; } +static inline HRESULT add_bstr_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, const WCHAR *str) +{ + IDxDiagContainerImpl_Property *prop; + BSTR bstr; + + prop = allocate_property_information(propName); + if (!prop) + return E_OUTOFMEMORY; + + bstr = SysAllocString(str); + if (!bstr) + { + free_property_information(prop); + return E_OUTOFMEMORY; + } + + V_VT(&prop->vProp) = VT_BSTR; + V_BSTR(&prop->vProp) = bstr; + + list_add_tail(&node->properties, &prop->entry); + ++node->nProperties; + + return S_OK; +} + +static inline HRESULT add_ui4_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, DWORD data) +{ + IDxDiagContainerImpl_Property *prop; + + prop = allocate_property_information(propName); + if (!prop) + return E_OUTOFMEMORY; + + V_VT(&prop->vProp) = VT_UI4; + V_UI4(&prop->vProp) = data; + + list_add_tail(&node->properties, &prop->entry); + ++node->nProperties; + + return S_OK; +} + +static inline HRESULT add_bool_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, BOOL data) +{ + IDxDiagContainerImpl_Property *prop; + + prop = allocate_property_information(propName); + if (!prop) + return E_OUTOFMEMORY; + + V_VT(&prop->vProp) = VT_BOOL; + V_BOOL(&prop->vProp) = data; + + list_add_tail(&node->properties, &prop->entry); + ++node->nProperties; + + return S_OK; +} + +static inline HRESULT add_ull_as_bstr_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, ULONGLONG data ) +{ + IDxDiagContainerImpl_Property *prop; + + prop = allocate_property_information(propName); + if (!prop) + return E_OUTOFMEMORY; + + V_VT(&prop->vProp) = VT_UI8; + V_UI8(&prop->vProp) = data; + + VariantChangeType(&prop->vProp, &prop->vProp, 0, VT_BSTR); + + list_add_tail(&node->properties, &prop->entry); + ++node->nProperties; + + return S_OK; +} + static HRESULT build_systeminfo_tree(IDxDiagContainerImpl_Container *node) { + 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 szDirectXVersionLetter_v[] = {'c',0}; + static const WCHAR bDebug[] = {'b','D','e','b','u','g',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 szDirectXVersionEnglish_v[] = {'4','.','0','9','.','0','0','0','0','.','0','9','0','4',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 szDirectXVersionLongEnglish_v[] = {'=',' ','"','D','i','r','e','c','t','X',' ','9','.','0','c',' ','(','4','.','0','9','.','0','0','0','0','.','0','9','0','4',')',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 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 szCSDVersion[] = {'s','z','C','S','D','V','e','r','s','i','o','n',0}; + + HRESULT hr; + MEMORYSTATUSEX msex; + OSVERSIONINFOW info; + WCHAR buffer[MAX_PATH]; + + hr = add_ui4_property(node, dwDirectXVersionMajor, 9); + if (FAILED(hr)) + return hr; + + hr = add_ui4_property(node, dwDirectXVersionMinor, 0); + if (FAILED(hr)) + return hr; + + hr = add_bstr_property(node, szDirectXVersionLetter, szDirectXVersionLetter_v); + if (FAILED(hr)) + return hr; + + hr = add_bstr_property(node, szDirectXVersionEnglish, szDirectXVersionEnglish_v); + if (FAILED(hr)) + return hr; + + hr = add_bstr_property(node, szDirectXVersionLongEnglish, szDirectXVersionLongEnglish_v); + if (FAILED(hr)) + return hr; + + hr = add_bool_property(node, bDebug, FALSE); + if (FAILED(hr)) + return hr; + + msex.dwLength = sizeof(msex); + GlobalMemoryStatusEx(&msex); + + hr = add_ull_as_bstr_property(node, ullPhysicalMemory, msex.ullTotalPhys); + if (FAILED(hr)) + return hr; + + hr = add_ull_as_bstr_property(node, ullUsedPageFile, msex.ullTotalPageFile - msex.ullAvailPageFile); + if (FAILED(hr)) + return hr; + + hr = add_ull_as_bstr_property(node, ullAvailPageFile, msex.ullAvailPageFile); + if (FAILED(hr)) + return hr; + + info.dwOSVersionInfoSize = sizeof(info); + GetVersionExW(&info); + + hr = add_ui4_property(node, dwOSMajorVersion, info.dwMajorVersion); + if (FAILED(hr)) + return hr; + + hr = add_ui4_property(node, dwOSMinorVersion, info.dwMinorVersion); + if (FAILED(hr)) + return hr; + + hr = add_ui4_property(node, dwOSBuildNumber, info.dwBuildNumber); + if (FAILED(hr)) + return hr; + + hr = add_ui4_property(node, dwOSPlatformID, info.dwPlatformId); + if (FAILED(hr)) + return hr; + + hr = add_bstr_property(node, szCSDVersion, info.szCSDVersion); + if (FAILED(hr)) + return hr; + + GetWindowsDirectoryW(buffer, MAX_PATH); + + hr = add_bstr_property(node, szWindowsDir, buffer); + if (FAILED(hr)) + return hr; + return S_OK; } @@ -968,6 +1172,7 @@ static HRESULT build_information_tree(IDxDiagContainerImpl_Container **pinfo_roo for (index = 0; index < sizeof(root_children)/sizeof(root_children[0]); index++) { IDxDiagContainerImpl_Container *node; + HRESULT hr; node = allocate_information_node(root_children[index].name); if (!node) @@ -976,7 +1181,13 @@ static HRESULT build_information_tree(IDxDiagContainerImpl_Container **pinfo_roo return E_OUTOFMEMORY; } - root_children[index].initfunc(node); + hr = root_children[index].initfunc(node); + if (FAILED(hr)) + { + free_information_tree(node); + free_information_tree(info_root); + return hr; + } add_subcontainer(info_root, node); }
1
0
0
0
Andrew Nguyen : dxdiagn: Add code that introduces the infrastructure of a provider information tree .
by Alexandre Julliard
15 Feb '11
15 Feb '11
Module: wine Branch: master Commit: 91130395ef2b76f6f6f849ccae97435e9cee7aa8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=91130395ef2b76f6f6f849cca…
Author: Andrew Nguyen <anguyen(a)codeweavers.com> Date: Tue Feb 15 01:14:09 2011 -0600 dxdiagn: Add code that introduces the infrastructure of a provider information tree. --- dlls/dxdiagn/dxdiag_private.h | 11 +++ dlls/dxdiagn/provider.c | 170 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 181 insertions(+), 0 deletions(-) diff --git a/dlls/dxdiagn/dxdiag_private.h b/dlls/dxdiagn/dxdiag_private.h index 6329ccf..30891a0 100644 --- a/dlls/dxdiagn/dxdiag_private.h +++ b/dlls/dxdiagn/dxdiag_private.h @@ -34,6 +34,16 @@ typedef struct IDxDiagProviderImpl IDxDiagProviderImpl; typedef struct IDxDiagContainerImpl IDxDiagContainerImpl; +typedef struct IDxDiagContainerImpl_Container { + struct list entry; + WCHAR *contName; + + struct list subContainers; + DWORD nSubContainers; + struct list properties; + DWORD nProperties; +} IDxDiagContainerImpl_Container; + /* ---------------- */ /* IDxDiagProvider */ /* ---------------- */ @@ -48,6 +58,7 @@ struct IDxDiagProviderImpl { /* IDxDiagProvider fields */ BOOL init; DXDIAG_INIT_PARAMS params; + IDxDiagContainerImpl_Container *info_root; }; /* ---------------- */ diff --git a/dlls/dxdiagn/provider.c b/dlls/dxdiagn/provider.c index 67d75fa..9674c28 100644 --- a/dlls/dxdiagn/provider.c +++ b/dlls/dxdiagn/provider.c @@ -43,6 +43,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(dxdiag); static HRESULT DXDiag_InitRootDXDiagContainer(IDxDiagContainer* pRootCont, IDxDiagProvider *pProv); +static HRESULT build_information_tree(IDxDiagContainerImpl_Container **pinfo_root); +static void free_information_tree(IDxDiagContainerImpl_Container *node); + /* IDxDiagProvider IUnknown parts follow: */ static HRESULT WINAPI IDxDiagProviderImpl_QueryInterface(PDXDIAGPROVIDER iface, REFIID riid, LPVOID *ppobj) { @@ -80,6 +83,7 @@ static ULONG WINAPI IDxDiagProviderImpl_Release(PDXDIAGPROVIDER iface) { TRACE("(%p)->(ref before=%u)\n", This, refCount + 1); if (!refCount) { + free_information_tree(This->info_root); HeapFree(GetProcessHeap(), 0, This); } @@ -91,6 +95,8 @@ static ULONG WINAPI IDxDiagProviderImpl_Release(PDXDIAGPROVIDER iface) { /* IDxDiagProvider Interface follow: */ static HRESULT WINAPI IDxDiagProviderImpl_Initialize(PDXDIAGPROVIDER iface, DXDIAG_INIT_PARAMS* pParams) { IDxDiagProviderImpl *This = (IDxDiagProviderImpl *)iface; + HRESULT hr; + TRACE("(%p,%p)\n", iface, pParams); if (NULL == pParams) { @@ -101,6 +107,13 @@ static HRESULT WINAPI IDxDiagProviderImpl_Initialize(PDXDIAGPROVIDER iface, DXDI return E_INVALIDARG; } + if (!This->info_root) + { + hr = build_information_tree(&This->info_root); + if (FAILED(hr)) + return hr; + } + This->init = TRUE; memcpy(&This->params, pParams, pParams->dwSize); return S_OK; @@ -814,3 +827,160 @@ static HRESULT DXDiag_InitRootDXDiagContainer(IDxDiagContainer* pRootCont, IDxDi return S_OK; } + +static void free_information_tree(IDxDiagContainerImpl_Container *node) +{ + IDxDiagContainerImpl_Container *ptr, *cursor2; + + if (!node) + return; + + HeapFree(GetProcessHeap(), 0, node->contName); + + LIST_FOR_EACH_ENTRY_SAFE(ptr, cursor2, &node->subContainers, IDxDiagContainerImpl_Container, entry) + { + list_remove(&ptr->entry); + free_information_tree(ptr); + } + + HeapFree(GetProcessHeap(), 0, node); +} + +static IDxDiagContainerImpl_Container *allocate_information_node(const WCHAR *name) +{ + IDxDiagContainerImpl_Container *ret; + + ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ret)); + if (!ret) + return NULL; + + if (name) + { + ret->contName = HeapAlloc(GetProcessHeap(), 0, (strlenW(name) + 1) * sizeof(*name)); + if (!ret->contName) + { + HeapFree(GetProcessHeap(), 0, ret); + return NULL; + } + strcpyW(ret->contName, name); + } + + list_init(&ret->subContainers); + list_init(&ret->properties); + + return ret; +} + +static inline void add_subcontainer(IDxDiagContainerImpl_Container *node, IDxDiagContainerImpl_Container *subCont) +{ + list_add_tail(&node->subContainers, &subCont->entry); + ++node->nSubContainers; +} + +static HRESULT build_systeminfo_tree(IDxDiagContainerImpl_Container *node) +{ + return S_OK; +} + +static HRESULT build_displaydevices_tree(IDxDiagContainerImpl_Container *node) +{ + return S_OK; +} + +static HRESULT build_directsound_tree(IDxDiagContainerImpl_Container *node) +{ + return S_OK; +} + +static HRESULT build_directmusic_tree(IDxDiagContainerImpl_Container *node) +{ + return S_OK; +} + +static HRESULT build_directinput_tree(IDxDiagContainerImpl_Container *node) +{ + return S_OK; +} + +static HRESULT build_directplay_tree(IDxDiagContainerImpl_Container *node) +{ + return S_OK; +} + +static HRESULT build_systemdevices_tree(IDxDiagContainerImpl_Container *node) +{ + return S_OK; +} + +static HRESULT build_directxfiles_tree(IDxDiagContainerImpl_Container *node) +{ + return S_OK; +} + +static HRESULT build_directshowfilters_tree(IDxDiagContainerImpl_Container *node) +{ + return S_OK; +} + +static HRESULT build_logicaldisks_tree(IDxDiagContainerImpl_Container *node) +{ + return S_OK; +} + +static HRESULT build_information_tree(IDxDiagContainerImpl_Container **pinfo_root) +{ + 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}; + 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}; + + static const struct + { + const WCHAR *name; + HRESULT (*initfunc)(IDxDiagContainerImpl_Container *); + } root_children[] = + { + {DxDiag_SystemInfo, build_systeminfo_tree}, + {DxDiag_DisplayDevices, build_displaydevices_tree}, + {DxDiag_DirectSound, build_directsound_tree}, + {DxDiag_DirectMusic, build_directmusic_tree}, + {DxDiag_DirectInput, build_directinput_tree}, + {DxDiag_DirectPlay, build_directplay_tree}, + {DxDiag_SystemDevices, build_systemdevices_tree}, + {DxDiag_DirectXFiles, build_directxfiles_tree}, + {DxDiag_DirectShowFilters, build_directshowfilters_tree}, + {DxDiag_LogicalDisks, build_logicaldisks_tree}, + }; + + IDxDiagContainerImpl_Container *info_root; + size_t index; + + info_root = allocate_information_node(NULL); + if (!info_root) + return E_OUTOFMEMORY; + + for (index = 0; index < sizeof(root_children)/sizeof(root_children[0]); index++) + { + IDxDiagContainerImpl_Container *node; + + node = allocate_information_node(root_children[index].name); + if (!node) + { + free_information_tree(info_root); + return E_OUTOFMEMORY; + } + + root_children[index].initfunc(node); + + add_subcontainer(info_root, node); + } + + *pinfo_root = info_root; + return S_OK; +}
1
0
0
0
Andrew Nguyen : dxdiagn: Make the containers keep a reference to a IDxDiagProvider object.
by Alexandre Julliard
15 Feb '11
15 Feb '11
Module: wine Branch: master Commit: 9f60f35ad4cd6fd13a760b1ea37a3e7255c42a83 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9f60f35ad4cd6fd13a760b1ea…
Author: Andrew Nguyen <anguyen(a)codeweavers.com> Date: Tue Feb 15 01:13:22 2011 -0600 dxdiagn: Make the containers keep a reference to a IDxDiagProvider object. --- dlls/dxdiagn/container.c | 5 +++- dlls/dxdiagn/dxdiag_private.h | 3 +- dlls/dxdiagn/provider.c | 44 ++++++++++++++++++++-------------------- 3 files changed, 28 insertions(+), 24 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=9f60f35ad4cd6fd13a760…
1
0
0
0
Thomas Mullaly : urlmon: Fixed invalid read and write errors (Valgrind).
by Alexandre Julliard
15 Feb '11
15 Feb '11
Module: wine Branch: master Commit: 1703368e26d852b8bdc8b127b9329ef84dc13242 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1703368e26d852b8bdc8b127b…
Author: Thomas Mullaly <tmullaly(a)codeweavers.com> Date: Mon Feb 14 19:39:17 2011 -0500 urlmon: Fixed invalid read and write errors (Valgrind). --- dlls/urlmon/uri.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/urlmon/uri.c b/dlls/urlmon/uri.c index a425212..0a92dad 100644 --- a/dlls/urlmon/uri.c +++ b/dlls/urlmon/uri.c @@ -6008,7 +6008,7 @@ static HRESULT combine_uri(Uri *base, Uri *relative, DWORD flags, IUri **result, DWORD new_len = remove_dot_segments(path+offset,path_len-offset); if(new_len != path_len) { - WCHAR *tmp = heap_realloc(path, (path_offset+new_len+1)*sizeof(WCHAR)); + WCHAR *tmp = heap_realloc(path, (offset+new_len+1)*sizeof(WCHAR)); if(!tmp) { heap_free(path); *result = NULL;
1
0
0
0
← Newer
1
...
30
31
32
33
34
35
36
...
68
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Results per page:
10
25
50
100
200