From 009dbefaf03544f0d7851b9d93ffb157f55cd367 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Tue, 2 Mar 2021 02:02:38 -0800 Subject: [PATCH] Added DxDiagOutput and DxDiagReport samples --- DxDiag/DxDiagOutput/DxDiagOutput.cpp | 172 ++ DxDiag/DxDiagOutput/DxDiagOutput.rc | 76 + DxDiag/DxDiagOutput/DxDiagOutput_2019.sln | 31 + DxDiag/DxDiagOutput/DxDiagOutput_2019.vcxproj | 372 +++ .../DxDiagOutput_2019.vcxproj.filters | 25 + DxDiag/DxDiagOutput/dxdiagoutput.jpg | Bin 0 -> 15448 bytes DxDiag/DxDiagReport/DxDiagReport.rc | 113 + DxDiag/DxDiagReport/DxDiagReport_2019.sln | 31 + DxDiag/DxDiagReport/DxDiagReport_2019.vcxproj | 383 +++ .../DxDiagReport_2019.vcxproj.filters | 38 + DxDiag/DxDiagReport/dispinfo.h | 110 + DxDiag/DxDiagReport/dxdiaginfo.cpp | 2635 +++++++++++++++++ DxDiag/DxDiagReport/dxdiaginfo.h | 89 + DxDiag/DxDiagReport/dxdiagreport.jpg | Bin 0 -> 11646 bytes DxDiag/DxDiagReport/fileinfo.h | 38 + DxDiag/DxDiagReport/inptinfo.h | 60 + DxDiag/DxDiagReport/main.cpp | 1252 ++++++++ DxDiag/DxDiagReport/musinfo.h | 43 + DxDiag/DxDiagReport/netinfo.h | 91 + DxDiag/DxDiagReport/resource.h | 19 + DxDiag/DxDiagReport/showinfo.h | 30 + DxDiag/DxDiagReport/sndinfo.h | 102 + DxDiag/DxDiagReport/sysinfo.h | 111 + 23 files changed, 5821 insertions(+) create mode 100644 DxDiag/DxDiagOutput/DxDiagOutput.cpp create mode 100644 DxDiag/DxDiagOutput/DxDiagOutput.rc create mode 100644 DxDiag/DxDiagOutput/DxDiagOutput_2019.sln create mode 100644 DxDiag/DxDiagOutput/DxDiagOutput_2019.vcxproj create mode 100644 DxDiag/DxDiagOutput/DxDiagOutput_2019.vcxproj.filters create mode 100644 DxDiag/DxDiagOutput/dxdiagoutput.jpg create mode 100644 DxDiag/DxDiagReport/DxDiagReport.rc create mode 100644 DxDiag/DxDiagReport/DxDiagReport_2019.sln create mode 100644 DxDiag/DxDiagReport/DxDiagReport_2019.vcxproj create mode 100644 DxDiag/DxDiagReport/DxDiagReport_2019.vcxproj.filters create mode 100644 DxDiag/DxDiagReport/dispinfo.h create mode 100644 DxDiag/DxDiagReport/dxdiaginfo.cpp create mode 100644 DxDiag/DxDiagReport/dxdiaginfo.h create mode 100644 DxDiag/DxDiagReport/dxdiagreport.jpg create mode 100644 DxDiag/DxDiagReport/fileinfo.h create mode 100644 DxDiag/DxDiagReport/inptinfo.h create mode 100644 DxDiag/DxDiagReport/main.cpp create mode 100644 DxDiag/DxDiagReport/musinfo.h create mode 100644 DxDiag/DxDiagReport/netinfo.h create mode 100644 DxDiag/DxDiagReport/resource.h create mode 100644 DxDiag/DxDiagReport/showinfo.h create mode 100644 DxDiag/DxDiagReport/sndinfo.h create mode 100644 DxDiag/DxDiagReport/sysinfo.h diff --git a/DxDiag/DxDiagOutput/DxDiagOutput.cpp b/DxDiag/DxDiagOutput/DxDiagOutput.cpp new file mode 100644 index 00000000..0f907e69 --- /dev/null +++ b/DxDiag/DxDiagOutput/DxDiagOutput.cpp @@ -0,0 +1,172 @@ +//---------------------------------------------------------------------------- +// File: DxDiagOutput.cpp +// +// Desc: Sample app to read info from dxdiagn.dll by enumeration +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License (MIT). +//----------------------------------------------------------------------------- +#define INITGUID +#include +#include +#include +#include +#include + +#include + +using Microsoft::WRL::ComPtr; + + +//----------------------------------------------------------------------------- +// Function-prototypes +//----------------------------------------------------------------------------- +HRESULT PrintContainerAndChildren(WCHAR* wszParentName, IDxDiagContainer* pDxDiagContainer); + + + + +//----------------------------------------------------------------------------- +// Name: main() +// Desc: Entry point for the application. We use just the console window +//----------------------------------------------------------------------------- +int main() +{ + HRESULT hr = CoInitialize(nullptr); + if (FAILED(hr)) + return 1; + + // CoCreate a IDxDiagProvider* + ComPtr pDxDiagProvider; + hr = CoCreateInstance(CLSID_DxDiagProvider, + nullptr, + CLSCTX_INPROC_SERVER, + IID_IDxDiagProvider, + (LPVOID*)&pDxDiagProvider); + if (FAILED(hr)) + return 1; + + // Fill out a DXDIAG_INIT_PARAMS struct and pass it to IDxDiagContainer::Initialize + // Passing in TRUE for bAllowWHQLChecks, allows dxdiag to check if drivers are + // digital signed as logo'd by WHQL which may connect via internet to update + // WHQL certificates. + DXDIAG_INIT_PARAMS dxDiagInitParam = {}; + dxDiagInitParam.dwSize = sizeof(DXDIAG_INIT_PARAMS); + dxDiagInitParam.dwDxDiagHeaderVersion = DXDIAG_DX9_SDK_VERSION; + dxDiagInitParam.bAllowWHQLChecks = TRUE; + dxDiagInitParam.pReserved = nullptr; + + hr = pDxDiagProvider->Initialize(&dxDiagInitParam); + if (FAILED(hr)) + return 1; + + ComPtr pDxDiagRoot; + hr = pDxDiagProvider->GetRootContainer(&pDxDiagRoot); + if (FAILED(hr)) + return 1; + + // This function will recursivly print the properties + // the root node and all its child. + hr = PrintContainerAndChildren(nullptr, pDxDiagRoot.Get()); + if (FAILED(hr)) + return 1; + + CoUninitialize(); + + return 0; +} + + + + +//----------------------------------------------------------------------------- +// Name: PrintContainerAndChildren() +// Desc: Recursivly print the properties the root node and all its child +// to the console window +//----------------------------------------------------------------------------- +HRESULT PrintContainerAndChildren(WCHAR* wszParentName, IDxDiagContainer* pDxDiagContainer) +{ + HRESULT hr; + + DWORD dwPropCount; + DWORD dwPropIndex; + WCHAR wszPropName[512]; + VARIANT var; + WCHAR wszPropValue[512]; + + DWORD dwChildCount; + DWORD dwChildIndex; + WCHAR wszChildName[512]; + ComPtr pChildContainer; + + VariantInit(&var); + + hr = pDxDiagContainer->GetNumberOfProps(&dwPropCount); + if (SUCCEEDED(hr)) + { + // Print each property in this container + for (dwPropIndex = 0; dwPropIndex < dwPropCount; dwPropIndex++) + { + hr = pDxDiagContainer->EnumPropNames(dwPropIndex, wszPropName, 512); + if (SUCCEEDED(hr)) + { + hr = pDxDiagContainer->GetProp(wszPropName, &var); + if (SUCCEEDED(hr)) + { + // Switch off the type. There's 4 different types: + switch (var.vt) + { + case VT_UI4: + swprintf_s(wszPropValue, 512, L"%d", var.ulVal); + break; + case VT_I4: + swprintf_s(wszPropValue, 512, L"%d", var.lVal); + break; + case VT_BOOL: + wcscpy_s(wszPropValue, 512, (var.boolVal) ? L"true" : L"false"); + break; + case VT_BSTR: + wcscpy_s(wszPropValue, 512, var.bstrVal); + break; + } + + // Add the parent name to the front if there's one, so that + // its easier to read on the screen + if (wszParentName) + wprintf(L"%ls.%ls = %ls\n", wszParentName, wszPropName, wszPropValue); + else + wprintf(L"%ls = %ls\n", wszPropName, wszPropValue); + + // Clear the variant (this is needed to free BSTR memory) + VariantClear(&var); + } + } + } + } + + // Recursivly call this function for each of its child containers + hr = pDxDiagContainer->GetNumberOfChildContainers(&dwChildCount); + if (SUCCEEDED(hr)) + { + for (dwChildIndex = 0; dwChildIndex < dwChildCount; dwChildIndex++) + { + hr = pDxDiagContainer->EnumChildContainerNames(dwChildIndex, wszChildName, 512); + if (SUCCEEDED(hr)) + { + hr = pDxDiagContainer->GetChildContainer(wszChildName, &pChildContainer); + if (SUCCEEDED(hr)) + { + // wszFullChildName isn't needed but is used for text output + WCHAR wszFullChildName[512]; + if (wszParentName) + swprintf_s(wszFullChildName, 512, L"%ls.%ls", wszParentName, wszChildName); + else + wcscpy_s(wszFullChildName, 512, wszChildName); + PrintContainerAndChildren(wszFullChildName, pChildContainer.Get()); + } + } + } + } + + return S_OK; +} diff --git a/DxDiag/DxDiagOutput/DxDiagOutput.rc b/DxDiag/DxDiagOutput/DxDiagOutput.rc new file mode 100644 index 00000000..93e6b7e3 --- /dev/null +++ b/DxDiag/DxDiagOutput/DxDiagOutput.rc @@ -0,0 +1,76 @@ +// Microsoft Visual C++ generated resource script. +// +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#define IDC_STATIC -1 +#include + + + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_MAIN_ICON ICON "..\\..\\dxut\\optional\\directx.ico" + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#define IDC_STATIC -1\r\n" + "#include \r\n" + "\r\n" + "\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/DxDiag/DxDiagOutput/DxDiagOutput_2019.sln b/DxDiag/DxDiagOutput/DxDiagOutput_2019.sln new file mode 100644 index 00000000..e356936e --- /dev/null +++ b/DxDiag/DxDiagOutput/DxDiagOutput_2019.sln @@ -0,0 +1,31 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio Version 16 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DxDiagOutput", "DxDiagOutput_2019.vcxproj", "{A0763B6A-73EC-42D1-A283-F07D7613AC3C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Profile|Win32 = Profile|Win32 + Profile|x64 = Profile|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A0763B6A-73EC-42D1-A283-F07D7613AC3C}.Debug|Win32.ActiveCfg = Debug|Win32 + {A0763B6A-73EC-42D1-A283-F07D7613AC3C}.Debug|Win32.Build.0 = Debug|Win32 + {A0763B6A-73EC-42D1-A283-F07D7613AC3C}.Debug|x64.ActiveCfg = Debug|x64 + {A0763B6A-73EC-42D1-A283-F07D7613AC3C}.Debug|x64.Build.0 = Debug|x64 + {A0763B6A-73EC-42D1-A283-F07D7613AC3C}.Profile|Win32.ActiveCfg = Profile|Win32 + {A0763B6A-73EC-42D1-A283-F07D7613AC3C}.Profile|Win32.Build.0 = Profile|Win32 + {A0763B6A-73EC-42D1-A283-F07D7613AC3C}.Profile|x64.ActiveCfg = Profile|x64 + {A0763B6A-73EC-42D1-A283-F07D7613AC3C}.Profile|x64.Build.0 = Profile|x64 + {A0763B6A-73EC-42D1-A283-F07D7613AC3C}.Release|Win32.ActiveCfg = Release|Win32 + {A0763B6A-73EC-42D1-A283-F07D7613AC3C}.Release|Win32.Build.0 = Release|Win32 + {A0763B6A-73EC-42D1-A283-F07D7613AC3C}.Release|x64.ActiveCfg = Release|x64 + {A0763B6A-73EC-42D1-A283-F07D7613AC3C}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/DxDiag/DxDiagOutput/DxDiagOutput_2019.vcxproj b/DxDiag/DxDiagOutput/DxDiagOutput_2019.vcxproj new file mode 100644 index 00000000..b7e4d20f --- /dev/null +++ b/DxDiag/DxDiagOutput/DxDiagOutput_2019.vcxproj @@ -0,0 +1,372 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Profile + Win32 + + + Profile + x64 + + + Release + Win32 + + + Release + x64 + + + + DxDiagOutput + {A0763B6A-73EC-42D1-A283-F07D7613AC3C} + DxDiagOutput + Win32Proj + + + + Application + Unicode + v142 + + + Application + Unicode + v142 + + + Application + true + Unicode + v142 + + + Application + true + Unicode + v142 + + + Application + true + Unicode + v142 + + + Application + true + Unicode + v142 + + + + + + + + + + + + + + + + + + + + + + + + true + true + + + true + true + + + false + true + + + false + true + + + false + true + + + false + true + + + + Level4 + Disabled + MultiThreadedDebugDLL + false + true + Fast + StreamingSIMDExtensions2 + Sync + ..\..\\Core;..\..\\Optional;%(AdditionalIncludeDirectories) + %(AdditionalOptions) + WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;D3DXFX_LARGEADDRESS_HANDLE;%(PreprocessorDefinitions) + EditAndContinue + EnableFastChecks + + + %(AdditionalOptions) + odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + Console + true + true + true + true + MachineX86 + AsInvoker + %(DelayLoadDLLs) + + + false + + + + + + + + + + + + + Level4 + Disabled + MultiThreadedDebugDLL + false + true + Fast + Sync + ..\..\\Core;..\..\\Optional;%(AdditionalIncludeDirectories) + %(AdditionalOptions) + WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;D3DXFX_LARGEADDRESS_HANDLE;%(PreprocessorDefinitions) + EnableFastChecks + + + %(AdditionalOptions) + odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + Console + true + true + true + true + MachineX64 + AsInvoker + %(DelayLoadDLLs) + + + false + + + + + + + + + + + + + Level4 + MaxSpeed + MultiThreadedDLL + false + true + true + Fast + StreamingSIMDExtensions2 + Sync + ..\..\\Core;..\..\\Optional;%(AdditionalIncludeDirectories) + %(AdditionalOptions) + WIN32;NDEBUG;_CONSOLE;D3DXFX_LARGEADDRESS_HANDLE;%(PreprocessorDefinitions) + + + %(AdditionalOptions) + odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + true + Console + true + true + true + true + true + MachineX86 + AsInvoker + %(DelayLoadDLLs) + + + false + + + + + + + + + + + + + Level4 + MaxSpeed + MultiThreadedDLL + false + true + true + Fast + Sync + ..\..\\Core;..\..\\Optional;%(AdditionalIncludeDirectories) + %(AdditionalOptions) + WIN32;NDEBUG;_CONSOLE;D3DXFX_LARGEADDRESS_HANDLE;%(PreprocessorDefinitions) + + + %(AdditionalOptions) + odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + true + Console + true + true + true + true + true + MachineX64 + AsInvoker + %(DelayLoadDLLs) + + + false + + + + + + + + + + + + + Level4 + MaxSpeed + MultiThreadedDLL + false + true + true + Fast + StreamingSIMDExtensions2 + Sync + ..\..\\Core;..\..\\Optional;%(AdditionalIncludeDirectories) + %(AdditionalOptions) + WIN32;NDEBUG;PROFILE;_CONSOLE;D3DXFX_LARGEADDRESS_HANDLE;%(PreprocessorDefinitions) + + + %(AdditionalOptions) + odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + true + Console + true + true + true + true + true + MachineX86 + AsInvoker + %(DelayLoadDLLs) + + + false + + + + + + + + + + + + + Level4 + MaxSpeed + MultiThreadedDLL + false + true + true + Fast + Sync + ..\..\\Core;..\..\\Optional;%(AdditionalIncludeDirectories) + + %(AdditionalOptions) + WIN32;NDEBUG;PROFILE;_CONSOLE;D3DXFX_LARGEADDRESS_HANDLE;%(PreprocessorDefinitions) + + + %(AdditionalOptions) + odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + true + Console + true + true + true + true + true + MachineX64 + AsInvoker + %(DelayLoadDLLs) + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DxDiag/DxDiagOutput/DxDiagOutput_2019.vcxproj.filters b/DxDiag/DxDiagOutput/DxDiagOutput_2019.vcxproj.filters new file mode 100644 index 00000000..7ce0f404 --- /dev/null +++ b/DxDiag/DxDiagOutput/DxDiagOutput_2019.vcxproj.filters @@ -0,0 +1,25 @@ + + + + +{8e114980-c1a3-4ada-ad7c-83caadf5daeb} +rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + + + + + + +Resource Files + + +Resource Files + + + + + diff --git a/DxDiag/DxDiagOutput/dxdiagoutput.jpg b/DxDiag/DxDiagOutput/dxdiagoutput.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6bb718ea0b035232a60a2f088605b0c6a5d33a36 GIT binary patch literal 15448 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%0Am6 zro_pJ&`!?m2ZC4IB=6EjG-EJWR!xgry#hJal;~>#AD`G>)DQJSLS#c%Wm|IRe ziyyXmFBhoYkk*@hSP&)@Z=C)o|mLV9t}2TVy`1_}4^29L?+-gL)sI7YyH zWX?vyMkWzx_L*xJYnd4@^;=w{SJTA*L6^s)xosqMlTnN%s%c>O{ zUFt$X@`b~u8?q!>n0m|h4h;o1M2Kxf?1Ls!}W2R=IMbHY>TT>;)%!t_kmNjYB!b&8u69*QE1B zy?~wD>JYpedd6}rZ#8Q;EZp!WVpGKFHPdm{?1|$VkP8n;3TkmPe0Pd)__h&T0z>&c zMFMr4WO>aIx2eMH$%_{Rjl3aiuRLG>pcRx;dXXy3NByW+|G;}r)zr$UyrLkG=3wSZ5CLJ0U(fsl$kj6zRE;`y3ngy*GJv{lma0vTq`gnHv1GDP)} z{#)PGW@SG&gbGgk)f>r|ykh88t+k9k6ligGFgowm9UFe}n;&d+#mpXW)H;N`buH*q zj?Q2tH-o6GXxnz})3?aA_8iWaVnG!g-pZWb|20txyOLrZ|6=hgg8387oyFjMoS@~JnHSwqE>j^?ox!6k37%0bu8OGEBl_^G(u^kq9wa{K5~Xo zoJPcin!D-ZB+ln3WqFjepUha_XY_VJiDx#XWHXt}HjQgJ`fV2s-#H9R&+iuGK>>DW;^sM z`ELn^DWJ}HaILEJ58?rH7L!fkuc9)3%8Z9852$l;-%Rr{KJg3>T&y>@cBhNsIS}Xm zN;L0CJDHXnb*W%ckGbPmpkpO{ahday>u38M>ky5hWcl8n+(iwT-|8a z6;V#z_23DA*vv~j`0a)JUA5rXv%UnkmRzfIJr1Cn9 zi+=7anekn0vuCyzYcx46rEQBecS;34_&t(_XWb>9Sre{4?@K?HAG>gWoRvF*0uRJr zE*vgfd)8gKU{f-C(UU4CqPXp(hHO|Cu7#?9$-kk!5-xH^hbgX543cxesEEIfGj)vJ zWHU}W-^$f$FeJ$($!^J)UHFZ`s>_;piHem=#Up>7#1qaO2|o@+UU4&|Uv(LmA9A~1 z{%P^enI9K4%NOopB}XxOXB#y+Iwq(Qa|*Iw_ii r99L4{Bw7-u%2tn6B{BJ#clTQ+ZO--2IOl!btX=N^aLft(H{A7a>TUsT literal 0 HcmV?d00001 diff --git a/DxDiag/DxDiagReport/DxDiagReport.rc b/DxDiag/DxDiagReport/DxDiagReport.rc new file mode 100644 index 00000000..65c38c34 --- /dev/null +++ b/DxDiag/DxDiagReport/DxDiagReport.rc @@ -0,0 +1,113 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#define APSTUDIO_HIDDEN_SYMBOLS +#include +#undef APSTUDIO_HIDDEN_SYMBOLS +#include "resource.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_MAIN ICON DISCARDABLE "..\..\DXUT\Optional\directx.ico" + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" + "#include ""\r\n" + "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" + "#include ""resource.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_MAIN DIALOG DISCARDABLE 0, 0, 674, 414 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "DxDiag Report Sample" +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "List2",IDC_LIST,"SysListView32",LVS_REPORT | WS_BORDER | + WS_TABSTOP,6,6,662,402 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_MAIN, DIALOG + BEGIN + LEFTMARGIN, 6 + RIGHTMARGIN, 668 + VERTGUIDE, 206 + TOPMARGIN, 6 + BOTTOMMARGIN, 408 + END +END +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/DxDiag/DxDiagReport/DxDiagReport_2019.sln b/DxDiag/DxDiagReport/DxDiagReport_2019.sln new file mode 100644 index 00000000..525e21b0 --- /dev/null +++ b/DxDiag/DxDiagReport/DxDiagReport_2019.sln @@ -0,0 +1,31 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio Version 16 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DxDiagReport", "DxDiagReport_2019.vcxproj", "{049ACB36-B99E-41EF-B26F-9B9C1843A3F9}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Profile|Win32 = Profile|Win32 + Profile|x64 = Profile|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {049ACB36-B99E-41EF-B26F-9B9C1843A3F9}.Debug|Win32.ActiveCfg = Debug|Win32 + {049ACB36-B99E-41EF-B26F-9B9C1843A3F9}.Debug|Win32.Build.0 = Debug|Win32 + {049ACB36-B99E-41EF-B26F-9B9C1843A3F9}.Debug|x64.ActiveCfg = Debug|x64 + {049ACB36-B99E-41EF-B26F-9B9C1843A3F9}.Debug|x64.Build.0 = Debug|x64 + {049ACB36-B99E-41EF-B26F-9B9C1843A3F9}.Profile|Win32.ActiveCfg = Profile|Win32 + {049ACB36-B99E-41EF-B26F-9B9C1843A3F9}.Profile|Win32.Build.0 = Profile|Win32 + {049ACB36-B99E-41EF-B26F-9B9C1843A3F9}.Profile|x64.ActiveCfg = Profile|x64 + {049ACB36-B99E-41EF-B26F-9B9C1843A3F9}.Profile|x64.Build.0 = Profile|x64 + {049ACB36-B99E-41EF-B26F-9B9C1843A3F9}.Release|Win32.ActiveCfg = Release|Win32 + {049ACB36-B99E-41EF-B26F-9B9C1843A3F9}.Release|Win32.Build.0 = Release|Win32 + {049ACB36-B99E-41EF-B26F-9B9C1843A3F9}.Release|x64.ActiveCfg = Release|x64 + {049ACB36-B99E-41EF-B26F-9B9C1843A3F9}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/DxDiag/DxDiagReport/DxDiagReport_2019.vcxproj b/DxDiag/DxDiagReport/DxDiagReport_2019.vcxproj new file mode 100644 index 00000000..c33976ca --- /dev/null +++ b/DxDiag/DxDiagReport/DxDiagReport_2019.vcxproj @@ -0,0 +1,383 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Profile + Win32 + + + Profile + x64 + + + Release + Win32 + + + Release + x64 + + + + DxDiagReport + {049ACB36-B99E-41EF-B26F-9B9C1843A3F9} + DxDiagReport + Win32Proj + + + + Application + Unicode + v142 + + + Application + Unicode + v142 + + + Application + true + Unicode + v142 + + + Application + true + Unicode + v142 + + + Application + true + Unicode + v142 + + + Application + true + Unicode + v142 + + + + + + + + + + + + + + + + + + + + + + + + true + true + + + true + true + + + false + true + + + false + true + + + false + true + + + false + true + + + + Level4 + Disabled + MultiThreadedDebugDLL + false + true + Fast + StreamingSIMDExtensions2 + Sync + ..\..\DXUT\Core;..\..\DXUT\Optional;%(AdditionalIncludeDirectories) + %(AdditionalOptions) + WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;D3DXFX_LARGEADDRESS_HANDLE;_ITERATOR_DEBUG_LEVEL=0;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + EditAndContinue + EnableFastChecks + + + %(AdditionalOptions) + wbemuuid.lib;comctl32.lib;winmm.lib;version.lib;%(AdditionalDependencies) + Windows + true + true + true + true + MachineX86 + AsInvoker + %(DelayLoadDLLs) + + + false + + + + + + + + + + + + + Level4 + Disabled + MultiThreadedDebugDLL + false + true + Fast + Sync + ..\..\DXUT\Core;..\..\DXUT\Optional;%(AdditionalIncludeDirectories) + %(AdditionalOptions) + WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;D3DXFX_LARGEADDRESS_HANDLE;_ITERATOR_DEBUG_LEVEL=0;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + EnableFastChecks + + + %(AdditionalOptions) + wbemuuid.lib;comctl32.lib;winmm.lib;version.lib;%(AdditionalDependencies) + Windows + true + true + true + true + MachineX64 + AsInvoker + %(DelayLoadDLLs) + + + false + + + + + + + + + + + + + Level4 + MaxSpeed + MultiThreadedDLL + false + true + true + Fast + StreamingSIMDExtensions2 + Sync + ..\..\DXUT\Core;..\..\DXUT\Optional;%(AdditionalIncludeDirectories) + %(AdditionalOptions) + WIN32;NDEBUG;_WINDOWS;D3DXFX_LARGEADDRESS_HANDLE;_ITERATOR_DEBUG_LEVEL=0;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + + + %(AdditionalOptions) + wbemuuid.lib;comctl32.lib;winmm.lib;version.lib;%(AdditionalDependencies) + true + Windows + true + true + true + true + true + MachineX86 + AsInvoker + %(DelayLoadDLLs) + + + false + + + + + + + + + + + + + Level4 + MaxSpeed + MultiThreadedDLL + false + true + true + Fast + Sync + ..\..\DXUT\Core;..\..\DXUT\Optional;%(AdditionalIncludeDirectories) + %(AdditionalOptions) + WIN32;NDEBUG;_WINDOWS;D3DXFX_LARGEADDRESS_HANDLE;_ITERATOR_DEBUG_LEVEL=0;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + + + %(AdditionalOptions) + wbemuuid.lib;comctl32.lib;winmm.lib;version.lib;%(AdditionalDependencies) + true + Windows + true + true + true + true + true + MachineX64 + AsInvoker + %(DelayLoadDLLs) + + + false + + + + + + + + + + + + + Level4 + MaxSpeed + MultiThreadedDLL + false + true + true + Fast + StreamingSIMDExtensions2 + Sync + ..\..\DXUT\Core;..\..\DXUT\Optional;%(AdditionalIncludeDirectories) + %(AdditionalOptions) + WIN32;NDEBUG;PROFILE;_WINDOWS;D3DXFX_LARGEADDRESS_HANDLE;_ITERATOR_DEBUG_LEVEL=0;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + + + %(AdditionalOptions) + wbemuuid.lib;comctl32.lib;winmm.lib;version.lib;%(AdditionalDependencies) + true + Windows + true + true + true + true + true + MachineX86 + AsInvoker + %(DelayLoadDLLs) + + + false + + + + + + + + + + + + + Level4 + MaxSpeed + MultiThreadedDLL + false + true + true + Fast + Sync + ..\..\DXUT\Core;..\..\DXUT\Optional;%(AdditionalIncludeDirectories) + + %(AdditionalOptions) + WIN32;NDEBUG;PROFILE;_WINDOWS;D3DXFX_LARGEADDRESS_HANDLE;_ITERATOR_DEBUG_LEVEL=0;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + + + %(AdditionalOptions) + wbemuuid.lib;comctl32.lib;winmm.lib;version.lib;%(AdditionalDependencies) + true + Windows + true + true + true + true + true + MachineX64 + AsInvoker + %(DelayLoadDLLs) + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DxDiag/DxDiagReport/DxDiagReport_2019.vcxproj.filters b/DxDiag/DxDiagReport/DxDiagReport_2019.vcxproj.filters new file mode 100644 index 00000000..dfc2e3b0 --- /dev/null +++ b/DxDiag/DxDiagReport/DxDiagReport_2019.vcxproj.filters @@ -0,0 +1,38 @@ + + + + + {8e114980-c1a3-4ada-ad7c-83caadf5daeb} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + + + + + + + + + + + + + + + + + Resource Files + + + Resource Files + + + Resource Files + + + + + \ No newline at end of file diff --git a/DxDiag/DxDiagReport/dispinfo.h b/DxDiag/DxDiagReport/dispinfo.h new file mode 100644 index 00000000..c5befcf4 --- /dev/null +++ b/DxDiag/DxDiagReport/dispinfo.h @@ -0,0 +1,110 @@ +//---------------------------------------------------------------------------- +// File: dispinfo.h +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License (MIT) +//----------------------------------------------------------------------------- +#pragma once + +struct DxDiag_DXVA_DeinterlaceCaps +{ + WCHAR szD3DInputFormat[100]; + WCHAR szD3DOutputFormat[100]; + WCHAR szGuid[100]; + WCHAR szCaps[100]; + DWORD dwNumPreviousOutputFrames; + DWORD dwNumForwardRefSamples; + DWORD dwNumBackwardRefSamples; + + DWORD m_nElementCount; +}; + +struct DisplayInfo +{ + WCHAR m_szDeviceName[100]; + WCHAR m_szDescription[200]; + WCHAR m_szKeyDeviceID[200]; + WCHAR m_szKeyDeviceKey[200]; + WCHAR m_szManufacturer[200]; + WCHAR m_szChipType[100]; + WCHAR m_szDACType[100]; + WCHAR m_szRevision[100]; + WCHAR m_szDisplayMemoryLocalized[100]; + WCHAR m_szDisplayMemoryEnglish[100]; + WCHAR m_szDisplayModeLocalized[100]; + WCHAR m_szDisplayModeEnglish[100]; + + DWORD m_dwWidth; + DWORD m_dwHeight; + DWORD m_dwBpp; + DWORD m_dwRefreshRate; + + WCHAR m_szMonitorName[100]; + WCHAR m_szMonitorMaxRes[100]; + + WCHAR m_szDriverName[100]; + WCHAR m_szDriverVersion[100]; + WCHAR m_szDriverAttributes[100]; + WCHAR m_szDriverLanguageEnglish[100]; + WCHAR m_szDriverLanguageLocalized[100]; + WCHAR m_szDriverDateEnglish[100]; + WCHAR m_szDriverDateLocalized[100]; + LONG m_lDriverSize; + WCHAR m_szMiniVdd[100]; + WCHAR m_szMiniVddDateLocalized[100]; + WCHAR m_szMiniVddDateEnglish[100]; + LONG m_lMiniVddSize; + WCHAR m_szVdd[100]; + + BOOL m_bCanRenderWindow; + BOOL m_bDriverBeta; + BOOL m_bDriverDebug; + BOOL m_bDriverSigned; + BOOL m_bDriverSignedValid; + DWORD m_dwDDIVersion; + WCHAR m_szDDIVersionEnglish[100]; + WCHAR m_szDDIVersionLocalized[100]; + + DWORD m_iAdapter; + WCHAR m_szVendorId[50]; + WCHAR m_szDeviceId[50]; + WCHAR m_szSubSysId[50]; + WCHAR m_szRevisionId[50]; + DWORD m_dwWHQLLevel; + WCHAR m_szDeviceIdentifier[100]; + WCHAR m_szDriverSignDate[50]; + + BOOL m_bNoHardware; + BOOL m_bDDAccelerationEnabled; + BOOL m_b3DAccelerationExists; + BOOL m_b3DAccelerationEnabled; + BOOL m_bAGPEnabled; + BOOL m_bAGPExists; + BOOL m_bAGPExistenceValid; + + WCHAR m_szDXVAModes[100]; + + std::vector m_vDXVACaps; + + WCHAR m_szDDStatusLocalized[100]; + WCHAR m_szDDStatusEnglish[100]; + WCHAR m_szD3DStatusLocalized[100]; + WCHAR m_szD3DStatusEnglish[100]; + WCHAR m_szAGPStatusLocalized[100]; + WCHAR m_szAGPStatusEnglish[100]; + + WCHAR m_szNotesLocalized[3000]; + WCHAR m_szNotesEnglish[3000]; + WCHAR m_szRegHelpText[3000]; + + WCHAR m_szTestResultDDLocalized[3000]; + WCHAR m_szTestResultDDEnglish[3000]; + WCHAR m_szTestResultD3D7Localized[3000]; + WCHAR m_szTestResultD3D7English[3000]; + WCHAR m_szTestResultD3D8Localized[3000]; + WCHAR m_szTestResultD3D8English[3000]; + WCHAR m_szTestResultD3D9Localized[3000]; + WCHAR m_szTestResultD3D9English[3000]; + + DWORD m_nElementCount; +}; diff --git a/DxDiag/DxDiagReport/dxdiaginfo.cpp b/DxDiag/DxDiagReport/dxdiaginfo.cpp new file mode 100644 index 00000000..bedfc6dc --- /dev/null +++ b/DxDiag/DxDiagReport/dxdiaginfo.cpp @@ -0,0 +1,2635 @@ +//---------------------------------------------------------------------------- +// File: dxdiaginfo.cpp +// +// Desc: Sample app to read info from dxdiagn.dll +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License (MIT). +//----------------------------------------------------------------------------- +#define STRICT +#define INITGUID + +#include +#include +#include +#include +#include + +#include "dxdiaginfo.h" +#include "resource.h" + + + + +//----------------------------------------------------------------------------- +// Defines, and constants +//----------------------------------------------------------------------------- +#define SAFE_DELETE(p) { if(p) { delete (p); (p)=nullptr; } } +#define SAFE_DELETE_ARRAY(p) { if(p) { delete[] (p); (p)=nullptr; } } +#define SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=nullptr; } } +#define SAFE_BSTR_FREE(x) if(x) { SysFreeString( x ); x = nullptr; } +#define EXPAND(x) x, sizeof(x)/sizeof(WCHAR) + + + + +//----------------------------------------------------------------------------- +// Name: CDxDiagInfo() +// Desc: Constuct class +//----------------------------------------------------------------------------- +CDxDiagInfo::CDxDiagInfo() : + m_pDxDiagProvider(nullptr), + m_pDxDiagRoot(nullptr), + m_bCleanupCOM(FALSE), + m_pSysInfo(nullptr), + m_pFileInfo(nullptr), + m_pMusicInfo(nullptr), + m_pInputInfo(nullptr), + m_pNetInfo(nullptr), + m_pShowInfo(nullptr) +{ +} + + + + +//----------------------------------------------------------------------------- +// Name: ~CDxDiagInfo() +// Desc: Cleanup +//----------------------------------------------------------------------------- +CDxDiagInfo::~CDxDiagInfo() +{ + SAFE_RELEASE(m_pDxDiagRoot); + SAFE_RELEASE(m_pDxDiagProvider); + + SAFE_DELETE(m_pSysInfo); + DestroySystemDevice(m_vSystemDevices); + DestroyFileList(m_pFileInfo); + DestroyDisplayInfo(m_vDisplayInfo); + DestroyInputInfo(m_pInputInfo); + DestroyMusicInfo(m_pMusicInfo); + DestroyNetworkInfo(m_pNetInfo); + DestroySoundInfo(m_vSoundInfos); + DestroySoundCaptureInfo(m_vSoundCaptureInfos); + DestroyShowInfo(m_pShowInfo); + + if (m_bCleanupCOM) + CoUninitialize(); +} + + + + +//----------------------------------------------------------------------------- +// Name: Init() +// Desc: Connect to dxdiagn.dll and init it +//----------------------------------------------------------------------------- +HRESULT CDxDiagInfo::Init(BOOL bAllowWHQLChecks) +{ + HRESULT hr = CoInitialize(nullptr); + m_bCleanupCOM = SUCCEEDED(hr); + + hr = CoCreateInstance(CLSID_DxDiagProvider, + nullptr, + CLSCTX_INPROC_SERVER, + IID_IDxDiagProvider, + (LPVOID*)&m_pDxDiagProvider); + if (FAILED(hr)) + return hr; + if (m_pDxDiagProvider == nullptr) + { + return E_POINTER; + } + + // Fill out a DXDIAG_INIT_PARAMS struct and pass it to IDxDiagContainer::Initialize + // Passing in TRUE for bAllowWHQLChecks, allows dxdiag to check if drivers are + // digital signed as logo'd by WHQL which may connect via internet to update + // WHQL certificates. + DXDIAG_INIT_PARAMS dxDiagInitParam = {}; + dxDiagInitParam.dwSize = sizeof(DXDIAG_INIT_PARAMS); + dxDiagInitParam.dwDxDiagHeaderVersion = DXDIAG_DX9_SDK_VERSION; + dxDiagInitParam.bAllowWHQLChecks = bAllowWHQLChecks; + dxDiagInitParam.pReserved = nullptr; + + hr = m_pDxDiagProvider->Initialize(&dxDiagInitParam); + if (FAILED(hr)) + return hr; + + return m_pDxDiagProvider->GetRootContainer(&m_pDxDiagRoot); +} + + + + +//----------------------------------------------------------------------------- +// Name: QueryDxDiagViaDll() +// Desc: Query dxdiagn.dll for all its information +//----------------------------------------------------------------------------- +HRESULT CDxDiagInfo::QueryDxDiagViaDll() +{ + if (nullptr == m_pDxDiagProvider) + return E_INVALIDARG; + + // Any of these might fail, but if they do we + // can still process the others + + GetSystemInfo(&m_pSysInfo); + + GetSystemDevices(m_vSystemDevices); + + GetDirectXFilesInfo(&m_pFileInfo); + + GetDisplayInfo(m_vDisplayInfo); + + GetSoundInfo(m_vSoundInfos, m_vSoundCaptureInfos); + + GetMusicInfo(&m_pMusicInfo); + + GetInputInfo(&m_pInputInfo); + + GetNetworkInfo(&m_pNetInfo); + + GetShowInfo(&m_pShowInfo); + + GetLogicalDiskInfo(m_vLogicalDiskList); + + return S_OK; +} + + + + +//----------------------------------------------------------------------------- +// Name: GetSystemInfo() +// Desc: Get the system info from the dll +//----------------------------------------------------------------------------- +HRESULT CDxDiagInfo::GetSystemInfo(SysInfo** ppSysInfo) +{ + HRESULT hr; + IDxDiagContainer* pObject = nullptr; + DWORD nCurCount = 0; + + if (nullptr == m_pDxDiagProvider) + return E_INVALIDARG; + + int i; + SysInfo* pSysInfo = new (std::nothrow) SysInfo; + if (nullptr == pSysInfo) + return E_OUTOFMEMORY; + ZeroMemory(pSysInfo, sizeof(SysInfo)); + *ppSysInfo = pSysInfo; + + // Get the IDxDiagContainer object called "DxDiag_SystemInfo". + // This call may take some time while dxdiag gathers the info. + hr = m_pDxDiagRoot->GetChildContainer(L"DxDiag_SystemInfo", &pObject); + if (FAILED(hr) || pObject == nullptr) + { + hr = E_FAIL; + goto LCleanup; + } + + if (FAILED(hr = GetUIntValue(pObject, L"dwOSMajorVersion", &pSysInfo->m_dwOSMajorVersion))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwOSMinorVersion", &pSysInfo->m_dwOSMinorVersion))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwOSBuildNumber", &pSysInfo->m_dwOSBuildNumber))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwOSPlatformID", &pSysInfo->m_dwOSPlatformID))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwDirectXVersionMajor", &pSysInfo->m_dwDirectXVersionMajor))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwDirectXVersionMinor", &pSysInfo->m_dwDirectXVersionMinor))) + goto LCleanup; nCurCount++; + + if (FAILED(hr = GetStringValue(pObject, L"szDirectXVersionLetter", EXPAND(pSysInfo->m_szDirectXVersionLetter)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bDebug", &pSysInfo->m_bDebug))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bNECPC98", &pSysInfo->m_bNECPC98))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetInt64Value(pObject, L"ullPhysicalMemory", &pSysInfo->m_ullPhysicalMemory))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetInt64Value(pObject, L"ullUsedPageFile", &pSysInfo->m_ullUsedPageFile))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetInt64Value(pObject, L"ullAvailPageFile", &pSysInfo->m_ullAvailPageFile))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bNetMeetingRunning", &pSysInfo->m_bNetMeetingRunning))) + goto LCleanup; nCurCount++; + + if (FAILED(hr = GetBoolValue(pObject, + L"bIsD3D8DebugRuntimeAvailable", &pSysInfo->m_bIsD3D8DebugRuntimeAvailable))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bIsD3DDebugRuntime", &pSysInfo->m_bIsD3DDebugRuntime))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, + L"bIsDInput8DebugRuntimeAvailable", + &pSysInfo->m_bIsDInput8DebugRuntimeAvailable))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bIsDInput8DebugRuntime", &pSysInfo->m_bIsDInput8DebugRuntime))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, + L"bIsDMusicDebugRuntimeAvailable", &pSysInfo->m_bIsDMusicDebugRuntimeAvailable))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bIsDMusicDebugRuntime", &pSysInfo->m_bIsDMusicDebugRuntime))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bIsDDrawDebugRuntime", &pSysInfo->m_bIsDDrawDebugRuntime))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bIsDPlayDebugRuntime", &pSysInfo->m_bIsDPlayDebugRuntime))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bIsDSoundDebugRuntime", &pSysInfo->m_bIsDSoundDebugRuntime))) + goto LCleanup; nCurCount++; + + if (FAILED(hr = GetIntValue(pObject, L"nD3DDebugLevel", &pSysInfo->m_nD3DDebugLevel))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetIntValue(pObject, L"nDDrawDebugLevel", &pSysInfo->m_nDDrawDebugLevel))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetIntValue(pObject, L"nDIDebugLevel", &pSysInfo->m_nDIDebugLevel))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetIntValue(pObject, L"nDMusicDebugLevel", &pSysInfo->m_nDMusicDebugLevel))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetIntValue(pObject, L"nDPlayDebugLevel", &pSysInfo->m_nDPlayDebugLevel))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetIntValue(pObject, L"nDSoundDebugLevel", &pSysInfo->m_nDSoundDebugLevel))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetIntValue(pObject, L"nDShowDebugLevel", &pSysInfo->m_nDShowDebugLevel))) + goto LCleanup; nCurCount++; + + if (FAILED(hr = GetStringValue(pObject, L"szWindowsDir", EXPAND(pSysInfo->m_szWindowsDir)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szBuildLab", EXPAND(pSysInfo->m_szBuildLab)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDxDiagVersion", EXPAND(pSysInfo->m_szDxDiagVersion)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szSetupParamEnglish", EXPAND(pSysInfo->m_szSetupParamEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szProcessorEnglish", EXPAND(pSysInfo->m_szProcessorEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szSystemManufacturerEnglish", + EXPAND(pSysInfo->m_szSystemManufacturerEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szSystemModelEnglish", EXPAND(pSysInfo->m_szSystemModelEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szBIOSEnglish", EXPAND(pSysInfo->m_szBIOSEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szPhysicalMemoryEnglish", EXPAND(pSysInfo->m_szPhysicalMemoryEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szCSDVersion", EXPAND(pSysInfo->m_szCSDVersion)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDirectXVersionEnglish", EXPAND(pSysInfo->m_szDirectXVersionEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDirectXVersionLongEnglish", + EXPAND(pSysInfo->m_szDirectXVersionLongEnglish)))) + goto LCleanup; nCurCount++; + + if (FAILED(hr = GetStringValue(pObject, L"szMachineNameLocalized", EXPAND(pSysInfo->m_szMachineNameLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szOSLocalized", EXPAND(pSysInfo->m_szOSLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szOSExLocalized", EXPAND(pSysInfo->m_szOSExLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szOSExLongLocalized", EXPAND(pSysInfo->m_szOSExLongLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szLanguagesLocalized", EXPAND(pSysInfo->m_szLanguagesLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szPageFileLocalized", EXPAND(pSysInfo->m_szPageFileLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szTimeLocalized", EXPAND(pSysInfo->m_szTimeLocalized)))) + goto LCleanup; nCurCount++; + + if (FAILED(hr = GetStringValue(pObject, L"szMachineNameEnglish", EXPAND(pSysInfo->m_szMachineNameEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szOSEnglish", EXPAND(pSysInfo->m_szOSEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szOSExEnglish", EXPAND(pSysInfo->m_szOSExEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szOSExLongEnglish", EXPAND(pSysInfo->m_szOSExLongEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szLanguagesEnglish", EXPAND(pSysInfo->m_szLanguagesEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szPageFileEnglish", EXPAND(pSysInfo->m_szPageFileEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szTimeEnglish", EXPAND(pSysInfo->m_szTimeEnglish)))) + goto LCleanup; nCurCount++; + + // Get the extended cpuid for args 0x80000008 through 0x80000018. + // pSysInfo->m_ExtFuncBitmasks[0] will contain extended cpuid info from arg 0x80000009 + // pSysInfo->m_ExtFuncBitmasks[15] will contain extended cpuid info from arg 0x80000018 + for (i = 0; i < 16; i++) + { + WCHAR strName[512]; + WCHAR strName2[512]; + swprintf_s(strName, L"ExtendedCPUFunctionBitmasks_0x800000%0.2x_bits", i + 0x09); + + wcscpy_s(strName2, strName); wcscat_s(strName2, L"0_31"); + if (FAILED(hr = GetUIntValue(pObject, strName2, &pSysInfo->m_ExtFuncBitmasks[i].dwBits0_31))) + goto LCleanup; nCurCount++; + wcscpy_s(strName2, strName); wcscat_s(strName2, L"32_63"); + if (FAILED(hr = GetUIntValue(pObject, strName2, &pSysInfo->m_ExtFuncBitmasks[i].dwBits32_63))) + goto LCleanup; nCurCount++; + wcscpy_s(strName2, strName); wcscat_s(strName2, L"64_95"); + if (FAILED(hr = GetUIntValue(pObject, strName2, &pSysInfo->m_ExtFuncBitmasks[i].dwBits64_95))) + goto LCleanup; nCurCount++; + wcscpy_s(strName2, strName); wcscat_s(strName2, L"96_127"); + if (FAILED(hr = GetUIntValue(pObject, strName2, &pSysInfo->m_ExtFuncBitmasks[i].dwBits96_127))) + goto LCleanup; nCurCount++; + } + +#ifdef _DEBUG + // debug check to make sure we got all the info from the object + // normal clients should't do this + if (FAILED(hr = pObject->GetNumberOfProps(&pSysInfo->m_nElementCount))) + return hr; + if (pSysInfo->m_nElementCount != nCurCount) + OutputDebugStringW(L"Not all elements in pSysInfo recorded"); +#endif + +LCleanup: + SAFE_RELEASE(pObject); + return hr; +} + + + + +//----------------------------------------------------------------------------- +// Name: GetSystemDevices() +// Desc: Get the system devices info from the dll +//----------------------------------------------------------------------------- +HRESULT CDxDiagInfo::GetSystemDevices(std::vector & vSystemDevices) +{ + HRESULT hr; + WCHAR wszContainer[512]; + IDxDiagContainer* pContainer = nullptr; + IDxDiagContainer* pObject = nullptr; + DWORD nInstanceCount = 0; + DWORD nItem = 0; + DWORD nCurCount = 0; + + if (nullptr == m_pDxDiagProvider) + return E_INVALIDARG; + + // Get the IDxDiagContainer object called "DxDiag_SystemDevices". + // This call may take some time while dxdiag gathers the info. + if (FAILED(hr = m_pDxDiagRoot->GetChildContainer(L"DxDiag_SystemDevices", &pContainer))) + goto LCleanup; + if (FAILED(hr = pContainer->GetNumberOfChildContainers(&nInstanceCount))) + goto LCleanup; + + for (nItem = 0; nItem < nInstanceCount; nItem++) + { + nCurCount = 0; + + SystemDevice* pSystemDevice = new SystemDevice; + if (pSystemDevice == nullptr) + return E_OUTOFMEMORY; + ZeroMemory(pSystemDevice, sizeof(SystemDevice)); + + // Add pSystemDevice to vSystemDevices + vSystemDevices.push_back(pSystemDevice); + + hr = pContainer->EnumChildContainerNames(nItem, wszContainer, 512); + if (FAILED(hr)) + goto LCleanup; + hr = pContainer->GetChildContainer(wszContainer, &pObject); + if (FAILED(hr) || pObject == nullptr) + { + if (pObject == nullptr) + hr = E_FAIL; + goto LCleanup; + } + + if (FAILED(hr = GetStringValue(pObject, L"szDescription", EXPAND(pSystemDevice->m_szDescription)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDeviceID", EXPAND(pSystemDevice->m_szDeviceID)))) + goto LCleanup; nCurCount++; + + if (FAILED(hr = GatherSystemDeviceDriverList(pObject, pSystemDevice->m_vDriverList))) + goto LCleanup; + +#ifdef _DEBUG + // debug check to make sure we got all the info from the object + if (FAILED(hr = pObject->GetNumberOfProps(&pSystemDevice->m_nElementCount))) + return hr; + if (pSystemDevice->m_nElementCount != nCurCount) + OutputDebugStringW(L"Not all elements in pSystemDevice recorded"); +#endif + + SAFE_RELEASE(pObject); + } + +LCleanup: + SAFE_RELEASE(pObject); + SAFE_RELEASE(pContainer); + return hr; +} + + + + +//----------------------------------------------------------------------------- +// Name: GetLogicalDiskInfo() +// Desc: Get the logical disk info from the dll +//----------------------------------------------------------------------------- +HRESULT CDxDiagInfo::GetLogicalDiskInfo(std::vector & vLogicalDisks) +{ + HRESULT hr; + WCHAR wszContainer[512]; + IDxDiagContainer* pContainer = nullptr; + IDxDiagContainer* pObject = nullptr; + DWORD nInstanceCount = 0; + DWORD nItem = 0; + DWORD nCurCount = 0; + + if (nullptr == m_pDxDiagProvider) + return E_INVALIDARG; + + // Get the IDxDiagContainer object called "DxDiag_LogicalDisks". + // This call may take some time while dxdiag gathers the info. + if (FAILED(hr = m_pDxDiagRoot->GetChildContainer(L"DxDiag_LogicalDisks", &pContainer))) + goto LCleanup; + if (FAILED(hr = pContainer->GetNumberOfChildContainers(&nInstanceCount))) + goto LCleanup; + + for (nItem = 0; nItem < nInstanceCount; nItem++) + { + nCurCount = 0; + + LogicalDisk* pLogicalDisk = new (std::nothrow) LogicalDisk; + if (pLogicalDisk == nullptr) + return E_OUTOFMEMORY; + ZeroMemory(pLogicalDisk, sizeof(LogicalDisk)); + + // Add pLogicalDisk to vLogicalDisks + vLogicalDisks.push_back(pLogicalDisk); + + hr = pContainer->EnumChildContainerNames(nItem, wszContainer, 512); + if (FAILED(hr)) + goto LCleanup; + hr = pContainer->GetChildContainer(wszContainer, &pObject); + if (FAILED(hr) || pObject == nullptr) + { + if (pObject == nullptr) + hr = E_FAIL; + goto LCleanup; + } + + if (FAILED(hr = GetStringValue(pObject, L"szDriveLetter", EXPAND(pLogicalDisk->m_szDriveLetter)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szFreeSpace", EXPAND(pLogicalDisk->m_szFreeSpace)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szMaxSpace", EXPAND(pLogicalDisk->m_szMaxSpace)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szFileSystem", EXPAND(pLogicalDisk->m_szFileSystem)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szModel", EXPAND(pLogicalDisk->m_szModel)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szPNPDeviceID", EXPAND(pLogicalDisk->m_szPNPDeviceID)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwHardDriveIndex", &pLogicalDisk->m_dwHardDriveIndex))) + goto LCleanup; nCurCount++; + + if (FAILED(hr = GatherSystemDeviceDriverList(pObject, pLogicalDisk->m_vDriverList))) + goto LCleanup; + +#ifdef _DEBUG + // debug check to make sure we got all the info from the object + if (FAILED(hr = pObject->GetNumberOfProps(&pLogicalDisk->m_nElementCount))) + return hr; + if (pLogicalDisk->m_nElementCount != nCurCount) + OutputDebugStringW(L"Not all elements in pLogicalDisk recorded"); +#endif + + SAFE_RELEASE(pObject); + } + +LCleanup: + SAFE_RELEASE(pObject); + SAFE_RELEASE(pContainer); + return hr; +} + + + + +//----------------------------------------------------------------------------- +// Name: GatherSystemDeviceDriverList() +// Desc: +//----------------------------------------------------------------------------- +HRESULT CDxDiagInfo::GatherSystemDeviceDriverList(IDxDiagContainer* pParent, std::vector & vDriverList) +{ + HRESULT hr; + WCHAR wszContainer[512]; + IDxDiagContainer* pContainer = nullptr; + IDxDiagContainer* pObject = nullptr; + DWORD nInstanceCount = 0; + DWORD nItem = 0; + DWORD nCurCount = 0; + + if (FAILED(hr = pParent->GetChildContainer(L"Drivers", &pContainer))) + goto LCleanup; + if (FAILED(hr = pContainer->GetNumberOfChildContainers(&nInstanceCount))) + goto LCleanup; + + for (nItem = 0; nItem < nInstanceCount; nItem++) + { + nCurCount = 0; + + FileNode* pFileNode = new (std::nothrow) FileNode; + if (pFileNode == nullptr) + return E_OUTOFMEMORY; + ZeroMemory(pFileNode, sizeof(FileNode)); + + // Add pFileNode to vDriverList + vDriverList.push_back(pFileNode); + + hr = pContainer->EnumChildContainerNames(nItem, wszContainer, 512); + if (FAILED(hr)) + goto LCleanup; + hr = pContainer->GetChildContainer(wszContainer, &pObject); + if (FAILED(hr) || pObject == nullptr) + { + if (pObject == nullptr) + hr = E_FAIL; + goto LCleanup; + } + + if (FAILED(hr = GatherFileNodeInst(pFileNode, pObject))) + goto LCleanup; + + SAFE_RELEASE(pObject); + } + +LCleanup: + SAFE_RELEASE(pObject); + SAFE_RELEASE(pContainer); + return hr; +} + + + + +//----------------------------------------------------------------------------- +// Name: GatherFileNodeInst() +// Desc: +//----------------------------------------------------------------------------- +HRESULT CDxDiagInfo::GatherFileNodeInst(FileNode* pFileNode, IDxDiagContainer* pObject) +{ + HRESULT hr; + DWORD nCurCount = 0; + + if (FAILED(hr = GetStringValue(pObject, L"szPath", EXPAND(pFileNode->m_szPath)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szName", EXPAND(pFileNode->m_szName)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szVersion", EXPAND(pFileNode->m_szVersion)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szLanguageEnglish", EXPAND(pFileNode->m_szLanguageEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szLanguageLocalized", EXPAND(pFileNode->m_szLanguageLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwFileTimeLow", &pFileNode->m_FileTime.dwLowDateTime))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwFileTimeHigh", &pFileNode->m_FileTime.dwHighDateTime))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDatestampEnglish", EXPAND(pFileNode->m_szDatestampEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDatestampLocalized", EXPAND(pFileNode->m_szDatestampLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szAttributes", EXPAND(pFileNode->m_szAttributes)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetIntValue(pObject, L"lNumBytes", &pFileNode->m_lNumBytes))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bExists", &pFileNode->m_bExists))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bBeta", &pFileNode->m_bBeta))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bDebug", &pFileNode->m_bDebug))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bObsolete", &pFileNode->m_bObsolete))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bProblem", &pFileNode->m_bProblem))) + goto LCleanup; nCurCount++; + +#ifdef _DEBUG + // debug check to make sure we got all the info from the object + if (FAILED(hr = pObject->GetNumberOfProps(&pFileNode->m_nElementCount))) + goto LCleanup; + if (pFileNode->m_nElementCount != nCurCount) + OutputDebugStringW(L"Not all elements in pFileNode recorded"); +#endif + +LCleanup: + return hr; +} + + +//----------------------------------------------------------------------------- +// Name: GetDirectXFilesInfo() +// Desc: Get the DirectX file info from the dll +//----------------------------------------------------------------------------- +HRESULT CDxDiagInfo::GetDirectXFilesInfo(FileInfo** ppFileInfo) +{ + HRESULT hr; + WCHAR wszContainer[512]; + IDxDiagContainer* pContainer = nullptr; + IDxDiagContainer* pObject = nullptr; + DWORD nInstanceCount = 0; + DWORD nItem = 0; + DWORD nCurCount = 0; + + FileInfo* pFileInfo = new (std::nothrow) FileInfo; + if (pFileInfo == nullptr) + return E_OUTOFMEMORY; + ZeroMemory(pFileInfo, sizeof(FileInfo)); + *ppFileInfo = pFileInfo; + + // Get the IDxDiagContainer object called "DxDiag_DirectXFiles". + // This call may take some time while dxdiag gathers the info. + hr = m_pDxDiagRoot->GetChildContainer(L"DxDiag_DirectXFiles", &pObject); + if (FAILED(hr) || pObject == nullptr) + { + hr = E_FAIL; + goto LCleanup; + } + + if (FAILED(hr = GetStringValue(pObject, L"szDXFileNotesLocalized", EXPAND(pFileInfo->m_szDXFileNotesLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDXFileNotesEnglish", EXPAND(pFileInfo->m_szDXFileNotesEnglish)))) + goto LCleanup; nCurCount++; + +#ifdef _DEBUG + // debug check to make sure we got all the info from the object + if (FAILED(hr = pObject->GetNumberOfProps(&pFileInfo->m_nElementCount))) + return hr; + if (pFileInfo->m_nElementCount != nCurCount) + OutputDebugStringW(L"Not all elements in pFileInfo recorded"); +#endif + + SAFE_RELEASE(pObject); + + if (FAILED(hr = m_pDxDiagRoot->GetChildContainer(L"DxDiag_DirectXFiles", &pContainer))) + goto LCleanup; + if (FAILED(hr = pContainer->GetNumberOfChildContainers(&nInstanceCount))) + goto LCleanup; + + for (nItem = 0; nItem < nInstanceCount; nItem++) + { + nCurCount = 0; + + FileNode* pFileNode = new (std::nothrow) FileNode; + if (pFileNode == nullptr) + return E_OUTOFMEMORY; + ZeroMemory(pFileNode, sizeof(FileNode)); + + // Add pFileNode to pFileInfo->m_vDxComponentsFiles + pFileInfo->m_vDxComponentsFiles.push_back(pFileNode); + + hr = pContainer->EnumChildContainerNames(nItem, wszContainer, 512); + if (FAILED(hr)) + goto LCleanup; + hr = pContainer->GetChildContainer(wszContainer, &pObject); + if (FAILED(hr) || pObject == nullptr) + { + if (pObject == nullptr) + hr = E_FAIL; + goto LCleanup; + } + + if (FAILED(hr = GetStringValue(pObject, L"szName", EXPAND(pFileNode->m_szName)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szVersion", EXPAND(pFileNode->m_szVersion)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szLanguageEnglish", EXPAND(pFileNode->m_szLanguageEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szLanguageLocalized", EXPAND(pFileNode->m_szLanguageLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwFileTimeLow", &pFileNode->m_FileTime.dwLowDateTime))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwFileTimeHigh", &pFileNode->m_FileTime.dwHighDateTime))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDatestampEnglish", EXPAND(pFileNode->m_szDatestampEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDatestampLocalized", EXPAND(pFileNode->m_szDatestampLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szAttributes", EXPAND(pFileNode->m_szAttributes)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetIntValue(pObject, L"lNumBytes", &pFileNode->m_lNumBytes))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bExists", &pFileNode->m_bExists))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bBeta", &pFileNode->m_bBeta))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bDebug", &pFileNode->m_bDebug))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bObsolete", &pFileNode->m_bObsolete))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bProblem", &pFileNode->m_bProblem))) + goto LCleanup; nCurCount++; + +#ifdef _DEBUG + // debug check to make sure we got all the info from the object + if (FAILED(hr = pObject->GetNumberOfProps(&pFileNode->m_nElementCount))) + return hr; + if (pFileNode->m_nElementCount != nCurCount) + OutputDebugStringW(L"Not all elements in pFileNode recorded"); +#endif + + SAFE_RELEASE(pObject); + } + +LCleanup: + SAFE_RELEASE(pObject); + SAFE_RELEASE(pContainer); + return hr; +} + + + + +//----------------------------------------------------------------------------- +// Name: GetDisplayInfo() +// Desc: Get the display info from the dll +//----------------------------------------------------------------------------- +HRESULT CDxDiagInfo::GetDisplayInfo(std::vector & vDisplayInfo) +{ + HRESULT hr; + WCHAR wszContainer[512]; + IDxDiagContainer* pContainer = nullptr; + IDxDiagContainer* pObject = nullptr; + DWORD nInstanceCount = 0; + DWORD nItem = 0; + DWORD nCurCount = 0; + + // Get the IDxDiagContainer object called "DxDiag_DisplayDevices". + // This call may take some time while dxdiag gathers the info. + if (FAILED(hr = m_pDxDiagRoot->GetChildContainer(L"DxDiag_DisplayDevices", &pContainer))) + goto LCleanup; + if (FAILED(hr = pContainer->GetNumberOfChildContainers(&nInstanceCount))) + goto LCleanup; + + for (nItem = 0; nItem < nInstanceCount; nItem++) + { + nCurCount = 0; + + DisplayInfo* pDisplayInfo = new (std::nothrow) DisplayInfo; + if (pDisplayInfo == nullptr) + return E_OUTOFMEMORY; + ZeroMemory(pDisplayInfo, sizeof(DisplayInfo)); + + // Add pDisplayInfo to vDisplayInfo + vDisplayInfo.push_back(pDisplayInfo); + + hr = pContainer->EnumChildContainerNames(nItem, wszContainer, 512); + if (FAILED(hr)) + goto LCleanup; + hr = pContainer->GetChildContainer(wszContainer, &pObject); + if (FAILED(hr) || pObject == nullptr) + { + if (pObject == nullptr) + hr = E_FAIL; + goto LCleanup; + } + + if (FAILED(hr = GetStringValue(pObject, L"szDeviceName", EXPAND(pDisplayInfo->m_szDeviceName)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDescription", EXPAND(pDisplayInfo->m_szDescription)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szKeyDeviceID", EXPAND(pDisplayInfo->m_szKeyDeviceID)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szKeyDeviceKey", EXPAND(pDisplayInfo->m_szKeyDeviceKey)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szManufacturer", EXPAND(pDisplayInfo->m_szManufacturer)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szChipType", EXPAND(pDisplayInfo->m_szChipType)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDACType", EXPAND(pDisplayInfo->m_szDACType)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szRevision", EXPAND(pDisplayInfo->m_szRevision)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDisplayMemoryLocalized", + EXPAND(pDisplayInfo->m_szDisplayMemoryLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDisplayMemoryEnglish", + EXPAND(pDisplayInfo->m_szDisplayMemoryEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDisplayModeLocalized", + EXPAND(pDisplayInfo->m_szDisplayModeLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDisplayModeEnglish", EXPAND(pDisplayInfo->m_szDisplayModeEnglish)))) + goto LCleanup; nCurCount++; + + if (FAILED(hr = GetUIntValue(pObject, L"dwWidth", &pDisplayInfo->m_dwWidth))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwHeight", &pDisplayInfo->m_dwHeight))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwBpp", &pDisplayInfo->m_dwBpp))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwRefreshRate", &pDisplayInfo->m_dwRefreshRate))) + goto LCleanup; nCurCount++; + + if (FAILED(hr = GetStringValue(pObject, L"szMonitorName", EXPAND(pDisplayInfo->m_szMonitorName)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szMonitorMaxRes", EXPAND(pDisplayInfo->m_szMonitorMaxRes)))) + goto LCleanup; nCurCount++; + + if (FAILED(hr = GetStringValue(pObject, L"szDriverName", EXPAND(pDisplayInfo->m_szDriverName)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDriverVersion", EXPAND(pDisplayInfo->m_szDriverVersion)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDriverAttributes", EXPAND(pDisplayInfo->m_szDriverAttributes)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDriverLanguageEnglish", + EXPAND(pDisplayInfo->m_szDriverLanguageEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDriverLanguageLocalized", + EXPAND(pDisplayInfo->m_szDriverLanguageLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDriverDateEnglish", EXPAND(pDisplayInfo->m_szDriverDateEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDriverDateLocalized", + EXPAND(pDisplayInfo->m_szDriverDateLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetIntValue(pObject, L"lDriverSize", &pDisplayInfo->m_lDriverSize))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szMiniVdd", EXPAND(pDisplayInfo->m_szMiniVdd)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szMiniVddDateLocalized", + EXPAND(pDisplayInfo->m_szMiniVddDateLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szMiniVddDateEnglish", EXPAND(pDisplayInfo->m_szMiniVddDateEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetIntValue(pObject, L"lMiniVddSize", &pDisplayInfo->m_lMiniVddSize))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szVdd", EXPAND(pDisplayInfo->m_szVdd)))) + goto LCleanup; nCurCount++; + + if (FAILED(hr = GetBoolValue(pObject, L"bCanRenderWindow", &pDisplayInfo->m_bCanRenderWindow))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bDriverBeta", &pDisplayInfo->m_bDriverBeta))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bDriverDebug", &pDisplayInfo->m_bDriverDebug))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bDriverSigned", &pDisplayInfo->m_bDriverSigned))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bDriverSignedValid", &pDisplayInfo->m_bDriverSignedValid))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDeviceIdentifier", EXPAND(pDisplayInfo->m_szDeviceIdentifier)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDriverSignDate", EXPAND(pDisplayInfo->m_szDriverSignDate)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwDDIVersion", &pDisplayInfo->m_dwDDIVersion))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDDIVersionEnglish", EXPAND(pDisplayInfo->m_szDDIVersionEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDDIVersionLocalized", + EXPAND(pDisplayInfo->m_szDDIVersionLocalized)))) + goto LCleanup; nCurCount++; + + if (FAILED(hr = GetUIntValue(pObject, L"iAdapter", &pDisplayInfo->m_iAdapter))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szVendorId", EXPAND(pDisplayInfo->m_szVendorId)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDeviceId", EXPAND(pDisplayInfo->m_szDeviceId)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szSubSysId", EXPAND(pDisplayInfo->m_szSubSysId)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szRevisionId", EXPAND(pDisplayInfo->m_szRevisionId)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwWHQLLevel", &pDisplayInfo->m_dwWHQLLevel))) + goto LCleanup; nCurCount++; + + if (FAILED(hr = GetBoolValue(pObject, L"bNoHardware", &pDisplayInfo->m_bNoHardware))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, + L"bDDAccelerationEnabled", &pDisplayInfo->m_bDDAccelerationEnabled))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"b3DAccelerationExists", &pDisplayInfo->m_b3DAccelerationExists))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, + L"b3DAccelerationEnabled", &pDisplayInfo->m_b3DAccelerationEnabled))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bAGPEnabled", &pDisplayInfo->m_bAGPEnabled))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bAGPExists", &pDisplayInfo->m_bAGPExists))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bAGPExistenceValid", &pDisplayInfo->m_bAGPExistenceValid))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDXVAModes", EXPAND(pDisplayInfo->m_szDXVAModes)))) + goto LCleanup; nCurCount++; + + if (FAILED(hr = GetStringValue(pObject, L"szDDStatusLocalized", EXPAND(pDisplayInfo->m_szDDStatusLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDDStatusEnglish", EXPAND(pDisplayInfo->m_szDDStatusEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szD3DStatusLocalized", EXPAND(pDisplayInfo->m_szD3DStatusLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szD3DStatusEnglish", EXPAND(pDisplayInfo->m_szD3DStatusEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szAGPStatusLocalized", EXPAND(pDisplayInfo->m_szAGPStatusLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szAGPStatusEnglish", EXPAND(pDisplayInfo->m_szAGPStatusEnglish)))) + goto LCleanup; nCurCount++; + + if (FAILED(hr = GetStringValue(pObject, L"szNotesLocalized", EXPAND(pDisplayInfo->m_szNotesLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szNotesEnglish", EXPAND(pDisplayInfo->m_szNotesEnglish)))) + goto LCleanup; nCurCount++; + + if (FAILED(hr = GetStringValue(pObject, L"szRegHelpText", EXPAND(pDisplayInfo->m_szRegHelpText)))) + goto LCleanup; nCurCount++; + + if (FAILED(hr = GetStringValue(pObject, L"szTestResultDDLocalized", + EXPAND(pDisplayInfo->m_szTestResultDDLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szTestResultDDEnglish", + EXPAND(pDisplayInfo->m_szTestResultDDEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szTestResultD3D7Localized", + EXPAND(pDisplayInfo->m_szTestResultD3D7Localized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szTestResultD3D7English", + EXPAND(pDisplayInfo->m_szTestResultD3D7English)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szTestResultD3D8Localized", + EXPAND(pDisplayInfo->m_szTestResultD3D8Localized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szTestResultD3D8English", + EXPAND(pDisplayInfo->m_szTestResultD3D8English)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szTestResultD3D9Localized", + EXPAND(pDisplayInfo->m_szTestResultD3D9Localized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szTestResultD3D9English", + EXPAND(pDisplayInfo->m_szTestResultD3D9English)))) + goto LCleanup; nCurCount++; + +#ifdef _DEBUG + // debug check to make sure we got all the info from the object + if (FAILED(hr = pObject->GetNumberOfProps(&pDisplayInfo->m_nElementCount))) + return hr; + if (pDisplayInfo->m_nElementCount != nCurCount) + OutputDebugStringW(L"Not all elements in pDisplayInfo recorded"); +#endif + + GatherDXVA_DeinterlaceCaps(pObject, pDisplayInfo->m_vDXVACaps); + + SAFE_RELEASE(pObject); + } + +LCleanup: + SAFE_RELEASE(pObject); + SAFE_RELEASE(pContainer); + return hr; +} + + + + +//----------------------------------------------------------------------------- +// Name: GatherDXVA_DeinterlaceCaps +// Desc: +//----------------------------------------------------------------------------- +HRESULT CDxDiagInfo::GatherDXVA_DeinterlaceCaps(IDxDiagContainer* pParent, + std::vector & vDXVACaps) +{ + HRESULT hr; + WCHAR wszContainer[512]; + IDxDiagContainer* pContainer = nullptr; + IDxDiagContainer* pObject = nullptr; + DWORD nInstanceCount = 0; + DWORD nItem = 0; + DWORD nCurCount = 0; + + if (FAILED(hr = pParent->GetChildContainer(L"DXVADeinterlaceCaps", &pContainer))) + goto LCleanup; + if (FAILED(hr = pContainer->GetNumberOfChildContainers(&nInstanceCount))) + goto LCleanup; + + for (nItem = 0; nItem < nInstanceCount; nItem++) + { + nCurCount = 0; + + DxDiag_DXVA_DeinterlaceCaps* pDXVANode = new DxDiag_DXVA_DeinterlaceCaps; + if (pDXVANode == nullptr) + return E_OUTOFMEMORY; + + // Add pDXVANode to vDXVACaps + vDXVACaps.push_back(pDXVANode); + + hr = pContainer->EnumChildContainerNames(nItem, wszContainer, 512); + if (FAILED(hr)) + goto LCleanup; + hr = pContainer->GetChildContainer(wszContainer, &pObject); + if (FAILED(hr) || pObject == nullptr) + { + if (pObject == nullptr) + hr = E_FAIL; + goto LCleanup; + } + + if (FAILED(hr = GetStringValue(pObject, L"szD3DInputFormat", EXPAND(pDXVANode->szD3DInputFormat)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szD3DOutputFormat", EXPAND(pDXVANode->szD3DOutputFormat)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szGuid", EXPAND(pDXVANode->szGuid)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szCaps", EXPAND(pDXVANode->szCaps)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, + L"dwNumPreviousOutputFrames", &pDXVANode->dwNumPreviousOutputFrames))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwNumForwardRefSamples", &pDXVANode->dwNumForwardRefSamples))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwNumBackwardRefSamples", &pDXVANode->dwNumBackwardRefSamples))) + goto LCleanup; nCurCount++; + +#ifdef _DEBUG + // debug check to make sure we got all the info from the object + if (FAILED(hr = pObject->GetNumberOfProps(&pDXVANode->m_nElementCount))) + goto LCleanup; + if (pDXVANode->m_nElementCount != nCurCount) + OutputDebugStringW(L"Not all elements in pDXVANode recorded"); +#endif + + SAFE_RELEASE(pObject); + } + +LCleanup: + SAFE_RELEASE(pObject); + SAFE_RELEASE(pContainer); + return hr; +} + + + + +//----------------------------------------------------------------------------- +// Name: GetSoundInfo() +// Desc: Get the sound info from the dll +//----------------------------------------------------------------------------- +HRESULT CDxDiagInfo::GetSoundInfo(std::vector & vSoundInfos, std::vector & vSoundCaptureInfos) +{ + HRESULT hr; + WCHAR wszContainer[512]; + IDxDiagContainer* pContainer = nullptr; + IDxDiagContainer* pObject = nullptr; + DWORD nInstanceCount = 0; + DWORD nItem = 0; + DWORD nCurCount = 0; + + // Get the IDxDiagContainer object called "DxDiag_DirectSound.DxDiag_SoundDevices". + // This call may take some time while dxdiag gathers the info. + if (FAILED(hr = m_pDxDiagRoot->GetChildContainer(L"DxDiag_DirectSound.DxDiag_SoundDevices", &pContainer))) + goto LCleanup; + if (FAILED(hr = pContainer->GetNumberOfChildContainers(&nInstanceCount))) + goto LCleanup; + + for (nItem = 0; nItem < nInstanceCount; nItem++) + { + nCurCount = 0; + + SoundInfo* pSoundInfo = new SoundInfo; + if (pSoundInfo == nullptr) + return E_OUTOFMEMORY; + ZeroMemory(pSoundInfo, sizeof(SoundInfo)); + + // Add pSoundInfo to vSoundInfos + vSoundInfos.push_back(pSoundInfo); + + hr = pContainer->EnumChildContainerNames(nItem, wszContainer, 512); + if (FAILED(hr)) + goto LCleanup; + hr = pContainer->GetChildContainer(wszContainer, &pObject); + if (FAILED(hr) || pObject == nullptr) + { + if (pObject == nullptr) + hr = E_FAIL; + goto LCleanup; + } + + if (FAILED(hr = GetUIntValue(pObject, L"dwDevnode", &pSoundInfo->m_dwDevnode))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szGuidDeviceID", EXPAND(pSoundInfo->m_szGuidDeviceID)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szHardwareID", EXPAND(pSoundInfo->m_szHardwareID)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szRegKey", EXPAND(pSoundInfo->m_szRegKey)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szManufacturerID", EXPAND(pSoundInfo->m_szManufacturerID)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szProductID", EXPAND(pSoundInfo->m_szProductID)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDescription", EXPAND(pSoundInfo->m_szDescription)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDriverName", EXPAND(pSoundInfo->m_szDriverName)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDriverPath", EXPAND(pSoundInfo->m_szDriverPath)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDriverVersion", EXPAND(pSoundInfo->m_szDriverVersion)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDriverLanguageEnglish", + EXPAND(pSoundInfo->m_szDriverLanguageEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDriverLanguageLocalized", + EXPAND(pSoundInfo->m_szDriverLanguageLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDriverAttributes", EXPAND(pSoundInfo->m_szDriverAttributes)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDriverDateEnglish", EXPAND(pSoundInfo->m_szDriverDateEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDriverDateLocalized", EXPAND(pSoundInfo->m_szDriverDateLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szOtherDrivers", EXPAND(pSoundInfo->m_szOtherDrivers)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szProvider", EXPAND(pSoundInfo->m_szProvider)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szType", EXPAND(pSoundInfo->m_szType)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetIntValue(pObject, L"lNumBytes", &pSoundInfo->m_lNumBytes))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bDriverBeta", &pSoundInfo->m_bDriverBeta))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bDriverDebug", &pSoundInfo->m_bDriverDebug))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bDriverSigned", &pSoundInfo->m_bDriverSigned))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bDriverSignedValid", &pSoundInfo->m_bDriverSignedValid))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetIntValue(pObject, L"lAccelerationLevel", &pSoundInfo->m_lAccelerationLevel))) + goto LCleanup; nCurCount++; + + if (FAILED(hr = GetBoolValue(pObject, L"bDefaultSoundPlayback", &pSoundInfo->m_bDefaultSoundPlayback))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bDefaultVoicePlayback", &pSoundInfo->m_bDefaultVoicePlayback))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bVoiceManager", &pSoundInfo->m_bVoiceManager))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bEAX20Listener", &pSoundInfo->m_bEAX20Listener))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bEAX20Source", &pSoundInfo->m_bEAX20Source))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bI3DL2Listener", &pSoundInfo->m_bI3DL2Listener))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bI3DL2Source", &pSoundInfo->m_bI3DL2Source))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bZoomFX", &pSoundInfo->m_bZoomFX))) + goto LCleanup; nCurCount++; + + if (FAILED(hr = GetUIntValue(pObject, L"dwFlags", &pSoundInfo->m_dwFlags))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, + L"dwMinSecondarySampleRate", &pSoundInfo->m_dwMinSecondarySampleRate))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, + L"dwMaxSecondarySampleRate", &pSoundInfo->m_dwMaxSecondarySampleRate))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwPrimaryBuffers", &pSoundInfo->m_dwPrimaryBuffers))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, + L"dwMaxHwMixingAllBuffers", &pSoundInfo->m_dwMaxHwMixingAllBuffers))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, + L"dwMaxHwMixingStaticBuffers", &pSoundInfo->m_dwMaxHwMixingStaticBuffers))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, + L"dwMaxHwMixingStreamingBuffers", + &pSoundInfo->m_dwMaxHwMixingStreamingBuffers))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, + L"dwFreeHwMixingAllBuffers", &pSoundInfo->m_dwFreeHwMixingAllBuffers))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, + L"dwFreeHwMixingStaticBuffers", &pSoundInfo->m_dwFreeHwMixingStaticBuffers))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, + L"dwFreeHwMixingStreamingBuffers", + &pSoundInfo->m_dwFreeHwMixingStreamingBuffers))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwMaxHw3DAllBuffers", &pSoundInfo->m_dwMaxHw3DAllBuffers))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwMaxHw3DStaticBuffers", &pSoundInfo->m_dwMaxHw3DStaticBuffers))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, + L"dwMaxHw3DStreamingBuffers", &pSoundInfo->m_dwMaxHw3DStreamingBuffers))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwFreeHw3DAllBuffers", &pSoundInfo->m_dwFreeHw3DAllBuffers))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, + L"dwFreeHw3DStaticBuffers", &pSoundInfo->m_dwFreeHw3DStaticBuffers))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, + L"dwFreeHw3DStreamingBuffers", &pSoundInfo->m_dwFreeHw3DStreamingBuffers))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwTotalHwMemBytes", &pSoundInfo->m_dwTotalHwMemBytes))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwFreeHwMemBytes", &pSoundInfo->m_dwFreeHwMemBytes))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, + L"dwMaxContigFreeHwMemBytes", &pSoundInfo->m_dwMaxContigFreeHwMemBytes))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, + L"dwUnlockTransferRateHwBuffers", + &pSoundInfo->m_dwUnlockTransferRateHwBuffers))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, + L"dwPlayCpuOverheadSwBuffers", &pSoundInfo->m_dwPlayCpuOverheadSwBuffers))) + goto LCleanup; nCurCount++; + + if (FAILED(hr = GetStringValue(pObject, L"szNotesLocalized", EXPAND(pSoundInfo->m_szNotesLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szNotesEnglish", EXPAND(pSoundInfo->m_szNotesEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szRegHelpText", EXPAND(pSoundInfo->m_szRegHelpText)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szTestResultLocalized", EXPAND(pSoundInfo->m_szTestResultLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szTestResultEnglish", EXPAND(pSoundInfo->m_szTestResultEnglish)))) + goto LCleanup; nCurCount++; + +#ifdef _DEBUG + // debug check to make sure we got all the info from the object + if (FAILED(hr = pObject->GetNumberOfProps(&pSoundInfo->m_nElementCount))) + return hr; + if (pSoundInfo->m_nElementCount != nCurCount) + OutputDebugStringW(L"Not all elements in pSoundInfo recorded"); +#endif + + SAFE_RELEASE(pObject); + } + + SAFE_RELEASE(pContainer); + + // Get the IDxDiagContainer object called "DxDiag_DirectSound.DxDiag_SoundCaptureDevices". + if (FAILED(hr = m_pDxDiagRoot->GetChildContainer(L"DxDiag_DirectSound.DxDiag_SoundCaptureDevices", + &pContainer))) + goto LCleanup; + if (FAILED(hr = pContainer->GetNumberOfChildContainers(&nInstanceCount))) + goto LCleanup; + + for (nItem = 0; nItem < nInstanceCount; nItem++) + { + nCurCount = 0; + + SoundCaptureInfo* pSoundCaptureInfo = new (std::nothrow) SoundCaptureInfo; + if (pSoundCaptureInfo == nullptr) + return E_OUTOFMEMORY; + ZeroMemory(pSoundCaptureInfo, sizeof(SoundCaptureInfo)); + + // Add pSoundCaptureInfo to vSoundCaptureInfos + vSoundCaptureInfos.push_back(pSoundCaptureInfo); + + hr = pContainer->EnumChildContainerNames(nItem, wszContainer, 512); + if (FAILED(hr)) + goto LCleanup; + hr = pContainer->GetChildContainer(wszContainer, &pObject); + if (FAILED(hr) || pObject == nullptr) + { + if (pObject == nullptr) + hr = E_FAIL; + goto LCleanup; + } + + if (FAILED(hr = GetStringValue(pObject, L"szDescription", EXPAND(pSoundCaptureInfo->m_szDescription)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szGuidDeviceID", EXPAND(pSoundCaptureInfo->m_szGuidDeviceID)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDriverName", EXPAND(pSoundCaptureInfo->m_szDriverName)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDriverPath", EXPAND(pSoundCaptureInfo->m_szDriverPath)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDriverVersion", EXPAND(pSoundCaptureInfo->m_szDriverVersion)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDriverLanguageEnglish", + EXPAND(pSoundCaptureInfo->m_szDriverLanguageEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDriverLanguageLocalized", + EXPAND(pSoundCaptureInfo->m_szDriverLanguageLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDriverAttributes", + EXPAND(pSoundCaptureInfo->m_szDriverAttributes)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDriverDateEnglish", + EXPAND(pSoundCaptureInfo->m_szDriverDateEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDriverDateLocalized", + EXPAND(pSoundCaptureInfo->m_szDriverDateLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetIntValue(pObject, L"lNumBytes", &pSoundCaptureInfo->m_lNumBytes))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bDriverBeta", &pSoundCaptureInfo->m_bDriverBeta))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bDriverDebug", &pSoundCaptureInfo->m_bDriverDebug))) + goto LCleanup; nCurCount++; + + if (FAILED(hr = GetBoolValue(pObject, + L"bDefaultSoundRecording", &pSoundCaptureInfo->m_bDefaultSoundRecording))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, + L"bDefaultVoiceRecording", &pSoundCaptureInfo->m_bDefaultVoiceRecording))) + goto LCleanup; nCurCount++; + + if (FAILED(hr = GetUIntValue(pObject, L"dwFlags", &pSoundCaptureInfo->m_dwFlags))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwFormats", &pSoundCaptureInfo->m_dwFormats))) + goto LCleanup; nCurCount++; + +#ifdef _DEBUG + // debug check to make sure we got all the info from the object + if (FAILED(hr = pObject->GetNumberOfProps(&pSoundCaptureInfo->m_nElementCount))) + return hr; + if (pSoundCaptureInfo->m_nElementCount != nCurCount) + OutputDebugStringW(L"Not all elements in pSoundCaptureInfo recorded"); +#endif + + SAFE_RELEASE(pObject); + } + +LCleanup: + SAFE_RELEASE(pObject); + SAFE_RELEASE(pContainer); + return hr; +} + + + + +//----------------------------------------------------------------------------- +// Name: GetMusicInfo() +// Desc: Get the music info from the dll +//----------------------------------------------------------------------------- +HRESULT CDxDiagInfo::GetMusicInfo(MusicInfo** ppMusicInfo) +{ + HRESULT hr; + WCHAR wszContainer[512]; + IDxDiagContainer* pContainer = nullptr; + IDxDiagContainer* pObject = nullptr; + DWORD nInstanceCount = 0; + DWORD nItem = 0; + DWORD nCurCount = 0; + MusicInfo* pMusicInfo = nullptr; + + pMusicInfo = new (std::nothrow) MusicInfo; + if (nullptr == pMusicInfo) + return E_OUTOFMEMORY; + ZeroMemory(pMusicInfo, sizeof(MusicInfo)); + *ppMusicInfo = pMusicInfo; + + // Get the IDxDiagContainer object called "DxDiag_DirectMusic". + // This call may take some time while dxdiag gathers the info. + hr = m_pDxDiagRoot->GetChildContainer(L"DxDiag_DirectMusic", &pObject); + if (FAILED(hr) || pObject == nullptr) + { + hr = E_FAIL; + goto LCleanup; + } + + if (FAILED(hr = GetBoolValue(pObject, L"bDMusicInstalled", &pMusicInfo->m_bDMusicInstalled))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szGMFilePath", EXPAND(pMusicInfo->m_szGMFilePath)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szGMFileVersion", EXPAND(pMusicInfo->m_szGMFileVersion)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bAccelerationEnabled", &pMusicInfo->m_bAccelerationEnabled))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bAccelerationExists", &pMusicInfo->m_bAccelerationExists))) + goto LCleanup; nCurCount++; + + if (FAILED(hr = GetStringValue(pObject, L"szNotesLocalized", EXPAND(pMusicInfo->m_szNotesLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szNotesEnglish", EXPAND(pMusicInfo->m_szNotesEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szRegHelpText", EXPAND(pMusicInfo->m_szRegHelpText)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szTestResultLocalized", EXPAND(pMusicInfo->m_szTestResultLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szTestResultEnglish", EXPAND(pMusicInfo->m_szTestResultEnglish)))) + goto LCleanup; nCurCount++; + +#ifdef _DEBUG + // debug check to make sure we got all the info from the object + if (FAILED(hr = pObject->GetNumberOfProps(&pMusicInfo->m_nElementCount))) + return hr; + if (pMusicInfo->m_nElementCount != nCurCount) + OutputDebugStringW(L"Not all elements in pMusicInfo recorded"); +#endif + + SAFE_RELEASE(pObject); + + // Get the number of "DxDiag_DirectMusic.DxDiag_DirectMusicPorts" objects in the dll + if (FAILED(hr = m_pDxDiagRoot->GetChildContainer(L"DxDiag_DirectMusic.DxDiag_DirectMusicPorts", &pContainer))) + goto LCleanup; + if (FAILED(hr = pContainer->GetNumberOfChildContainers(&nInstanceCount))) + goto LCleanup; + + for (nItem = 0; nItem < nInstanceCount; nItem++) + { + nCurCount = 0; + + MusicPort* pMusicPort = new (std::nothrow) MusicPort; + if (pMusicPort == nullptr) + return E_OUTOFMEMORY; + ZeroMemory(pMusicPort, sizeof(MusicPort)); + + // Add pMusicPort to pMusicInfo->m_vMusicPorts + pMusicInfo->m_vMusicPorts.push_back(pMusicPort); + + hr = pContainer->EnumChildContainerNames(nItem, wszContainer, 512); + if (FAILED(hr)) + goto LCleanup; + hr = pContainer->GetChildContainer(wszContainer, &pObject); + if (FAILED(hr) || pObject == nullptr) + { + if (pObject == nullptr) + hr = E_FAIL; + goto LCleanup; + } + + if (FAILED(hr = GetStringValue(pObject, L"szGuid", EXPAND(pMusicPort->m_szGuid)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bSoftware", &pMusicPort->m_bSoftware))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bKernelMode", &pMusicPort->m_bKernelMode))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bUsesDLS", &pMusicPort->m_bUsesDLS))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bExternal", &pMusicPort->m_bExternal))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwMaxAudioChannels", &pMusicPort->m_dwMaxAudioChannels))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwMaxChannelGroups", &pMusicPort->m_dwMaxChannelGroups))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bDefaultPort", &pMusicPort->m_bDefaultPort))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bOutputPort", &pMusicPort->m_bOutputPort))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDescription", EXPAND(pMusicPort->m_szDescription)))) + goto LCleanup; nCurCount++; + +#ifdef _DEBUG + // debug check to make sure we got all the info from the object + if (FAILED(hr = pObject->GetNumberOfProps(&pMusicPort->m_nElementCount))) + return hr; + if (pMusicPort->m_nElementCount != nCurCount) + OutputDebugStringW(L"Not all elements in pMusicPort recorded"); +#endif + + SAFE_RELEASE(pObject); + } + +LCleanup: + SAFE_RELEASE(pObject); + SAFE_RELEASE(pContainer); + return hr; +} + + + + +//----------------------------------------------------------------------------- +// Name: GetInputInfo() +// Desc: Get the input info from the dll +//----------------------------------------------------------------------------- +HRESULT CDxDiagInfo::GetInputInfo(InputInfo** ppInputInfo) +{ + HRESULT hr; + WCHAR wszContainer[512]; + IDxDiagContainer* pContainer = nullptr; + IDxDiagContainer* pChild = nullptr; + IDxDiagContainer* pObject = nullptr; + DWORD nInstanceCount = 0; + DWORD nItem = 0; + DWORD nCurCount = 0; + InputInfo* pInputInfo = nullptr; + + pInputInfo = new (std::nothrow) InputInfo; + if (nullptr == pInputInfo) + return E_OUTOFMEMORY; + ZeroMemory(pInputInfo, sizeof(InputInfo)); + *ppInputInfo = pInputInfo; + + // Get the IDxDiagContainer object called "DxDiag_DirectInput". + // This call may take some time while dxdiag gathers the info. + hr = m_pDxDiagRoot->GetChildContainer(L"DxDiag_DirectInput", &pObject); + if (FAILED(hr) || pObject == nullptr) + { + hr = E_FAIL; + goto LCleanup; + } + + if (FAILED(hr = GetBoolValue(pObject, L"bPollFlags", &pInputInfo->m_bPollFlags))) + return hr; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szInputNotesLocalized", EXPAND(pInputInfo->m_szInputNotesLocalized)))) + return hr; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szInputNotesEnglish", EXPAND(pInputInfo->m_szInputNotesEnglish)))) + return hr; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szRegHelpText", EXPAND(pInputInfo->m_szRegHelpText)))) + return hr; nCurCount++; + +#ifdef _DEBUG + // debug check to make sure we got all the info from the object + if (FAILED(hr = pObject->GetNumberOfProps(&pInputInfo->m_nElementCount))) + return hr; + if (pInputInfo->m_nElementCount != nCurCount) + OutputDebugStringW(L"Not all elements in pInputInfo recorded"); +#endif + + SAFE_RELEASE(pObject); + + // Get the number of "DxDiag_DirectInput.DxDiag_DirectInputDevices" objects in the dll + if (FAILED(hr = m_pDxDiagRoot->GetChildContainer(L"DxDiag_DirectInput.DxDiag_DirectInputDevices", + &pContainer))) + goto LCleanup; + if (FAILED(hr = pContainer->GetNumberOfChildContainers(&nInstanceCount))) + goto LCleanup; + + for (nItem = 0; nItem < nInstanceCount; nItem++) + { + nCurCount = 0; + + InputDeviceInfo* pInputDevice = new (std::nothrow) InputDeviceInfo; + if (pInputDevice == nullptr) + return E_OUTOFMEMORY; + ZeroMemory(pInputDevice, sizeof(InputDeviceInfo)); + + // Add pInputDevice to pInputInfo->m_vDirectInputDevices + pInputInfo->m_vDirectInputDevices.push_back(pInputDevice); + + hr = pContainer->EnumChildContainerNames(nItem, wszContainer, 512); + if (FAILED(hr)) + goto LCleanup; + hr = pContainer->GetChildContainer(wszContainer, &pObject); + if (FAILED(hr) || pObject == nullptr) + { + if (pObject == nullptr) + hr = E_FAIL; + goto LCleanup; + } + + if (FAILED(hr = GetStringValue(pObject, L"szInstanceName", EXPAND(pInputDevice->m_szInstanceName)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bAttached", &pInputDevice->m_bAttached))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwVendorID", &pInputDevice->m_dwVendorID))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwProductID", &pInputDevice->m_dwProductID))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwJoystickID", &pInputDevice->m_dwJoystickID))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwDevType", &pInputDevice->m_dwDevType))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szFFDriverName", EXPAND(pInputDevice->m_szFFDriverName)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szFFDriverDateEnglish", + EXPAND(pInputDevice->m_szFFDriverDateEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szFFDriverVersion", EXPAND(pInputDevice->m_szFFDriverVersion)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetIntValue(pObject, L"lFFDriverSize", &pInputDevice->m_lFFDriverSize))) + goto LCleanup; nCurCount++; + +#ifdef _DEBUG + // debug check to make sure we got all the info from the object + if (FAILED(hr = pObject->GetNumberOfProps(&pInputDevice->m_nElementCount))) + return hr; + if (pInputDevice->m_nElementCount != nCurCount) + OutputDebugStringW(L"Not all elements in pInputDevice recorded"); +#endif + + SAFE_RELEASE(pObject); + } + + SAFE_RELEASE(pContainer); + + // Get "DxDiag_DirectInput.DxDiag_DirectInputGameports" tree + if (FAILED(hr = m_pDxDiagRoot->GetChildContainer(L"DxDiag_DirectInput.DxDiag_DirectInputGameports", + &pContainer))) + goto LCleanup; + if (FAILED(hr = pContainer->GetNumberOfChildContainers(&nInstanceCount))) + goto LCleanup; + for (nItem = 0; nItem < nInstanceCount; nItem++) + { + InputRelatedDeviceInfo* pInputRelatedDevice = new InputRelatedDeviceInfo; + if (pInputRelatedDevice == nullptr) + return E_OUTOFMEMORY; + m_pInputInfo->m_vGamePortDevices.push_back(pInputRelatedDevice); + hr = pContainer->EnumChildContainerNames(nItem, wszContainer, 512); + if (FAILED(hr)) + goto LCleanup; + hr = pContainer->GetChildContainer(wszContainer, &pChild); + if (FAILED(hr) || pChild == nullptr) + { + if (pChild == nullptr) + hr = E_FAIL; + goto LCleanup; + } + GatherInputRelatedDeviceInst(pInputRelatedDevice, pChild); + SAFE_RELEASE(pChild); + } + SAFE_RELEASE(pContainer); + + // Get "DxDiag_DirectInput.DxDiag_DirectInputUSBRoot" tree + if (FAILED(hr = m_pDxDiagRoot->GetChildContainer(L"DxDiag_DirectInput.DxDiag_DirectInputUSBRoot", + &pContainer))) + goto LCleanup; + if (FAILED(hr = pContainer->GetNumberOfChildContainers(&nInstanceCount))) + goto LCleanup; + for (nItem = 0; nItem < nInstanceCount; nItem++) + { + InputRelatedDeviceInfo* pInputRelatedDevice = new InputRelatedDeviceInfo; + if (pInputRelatedDevice == nullptr) + return E_OUTOFMEMORY; + m_pInputInfo->m_vUsbRoot.push_back(pInputRelatedDevice); + hr = pContainer->EnumChildContainerNames(nItem, wszContainer, 512); + if (FAILED(hr)) + goto LCleanup; + hr = pContainer->GetChildContainer(wszContainer, &pChild); + if (FAILED(hr) || pChild == nullptr) + { + if (pChild == nullptr) + hr = E_FAIL; + goto LCleanup; + } + GatherInputRelatedDeviceInst(pInputRelatedDevice, pChild); + SAFE_RELEASE(pChild); + } + SAFE_RELEASE(pContainer); + + // Get "DxDiag_DirectInput.DxDiag_DirectInputPS2Devices" tree + if (FAILED(hr = m_pDxDiagRoot->GetChildContainer(L"DxDiag_DirectInput.DxDiag_DirectInputPS2Devices", + &pContainer))) + goto LCleanup; + if (FAILED(hr = pContainer->GetNumberOfChildContainers(&nInstanceCount))) + goto LCleanup; + for (nItem = 0; nItem < nInstanceCount; nItem++) + { + InputRelatedDeviceInfo* pInputRelatedDevice = new InputRelatedDeviceInfo; + if (pInputRelatedDevice == nullptr) + return E_OUTOFMEMORY; + m_pInputInfo->m_vPS2Devices.push_back(pInputRelatedDevice); + hr = pContainer->EnumChildContainerNames(nItem, wszContainer, 512); + if (FAILED(hr)) + goto LCleanup; + hr = pContainer->GetChildContainer(wszContainer, &pChild); + if (FAILED(hr) || pChild == nullptr) + { + if (pChild == nullptr) + hr = E_FAIL; + goto LCleanup; + } + GatherInputRelatedDeviceInst(pInputRelatedDevice, pChild); + SAFE_RELEASE(pChild); + } + SAFE_RELEASE(pContainer); + +LCleanup: + SAFE_RELEASE(pContainer); + SAFE_RELEASE(pChild); + SAFE_RELEASE(pObject); + return hr; +} + + + + +//----------------------------------------------------------------------------- +// Name: GatherInputRelatedDeviceInst() +// Desc: Get the InputRelatedDeviceInfo tree from the dll +//----------------------------------------------------------------------------- +HRESULT CDxDiagInfo::GatherInputRelatedDeviceInst(InputRelatedDeviceInfo* pInputRelatedDevice, + IDxDiagContainer* pContainer) +{ + HRESULT hr; + WCHAR wszContainer[512]; + IDxDiagContainer* pChild = nullptr; + DWORD nInstanceCount = 0; + DWORD nItem = 0; + DWORD nCurCount = 0; + + nCurCount = 0; + + if (FAILED(hr = GetUIntValue(pContainer, L"dwVendorID", &pInputRelatedDevice->m_dwVendorID))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pContainer, L"dwProductID", &pInputRelatedDevice->m_dwProductID))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pContainer, L"szDescription", EXPAND(pInputRelatedDevice->m_szDescription)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pContainer, L"szLocation", EXPAND(pInputRelatedDevice->m_szLocation)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pContainer, L"szMatchingDeviceId", + EXPAND(pInputRelatedDevice->m_szMatchingDeviceId)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pContainer, L"szUpperFilters", EXPAND(pInputRelatedDevice->m_szUpperFilters)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pContainer, L"szService", EXPAND(pInputRelatedDevice->m_szService)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pContainer, L"szLowerFilters", EXPAND(pInputRelatedDevice->m_szLowerFilters)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pContainer, L"szOEMData", EXPAND(pInputRelatedDevice->m_szOEMData)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pContainer, L"szFlags1", EXPAND(pInputRelatedDevice->m_szFlags1)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pContainer, L"szFlags2", EXPAND(pInputRelatedDevice->m_szFlags2)))) + goto LCleanup; nCurCount++; + +#ifdef _DEBUG + // debug check to make sure we got all the info from the object + if (FAILED(hr = pContainer->GetNumberOfProps(&pInputRelatedDevice->m_nElementCount))) + goto LCleanup; + if (pInputRelatedDevice->m_nElementCount != nCurCount) + OutputDebugStringW(L"Not all elements in pInputRelatedDevice recorded"); +#endif + + if (FAILED(hr = pContainer->GetNumberOfChildContainers(&nInstanceCount))) + goto LCleanup; + + for (nItem = 0; nItem < nInstanceCount; nItem++) + { + hr = pContainer->EnumChildContainerNames(nItem, wszContainer, 512); + if (FAILED(hr)) + goto LCleanup; + hr = pContainer->GetChildContainer(wszContainer, &pChild); + if (FAILED(hr) || pChild == nullptr) + { + if (pChild == nullptr) + hr = E_FAIL; + goto LCleanup; + } + + if (wcscmp(wszContainer, L"Drivers") == 0) + { + if (FAILED(hr = GatherInputRelatedDeviceInstDrivers(pInputRelatedDevice, pChild))) + goto LCleanup; + } + else + { + InputRelatedDeviceInfo* pChildInputRelatedDevice = new InputRelatedDeviceInfo; + if (pChildInputRelatedDevice == nullptr) + { + hr = E_OUTOFMEMORY; + goto LCleanup; + } + + pInputRelatedDevice->m_vChildren.push_back(pChildInputRelatedDevice); + + if (FAILED(hr = GatherInputRelatedDeviceInst(pChildInputRelatedDevice, pChild))) + goto LCleanup; + } + + SAFE_RELEASE(pChild); + } + +LCleanup: + SAFE_RELEASE(pChild); + return hr; +} + + + + +//----------------------------------------------------------------------------- +// Name: GatherInputRelatedDeviceInstDrivers() +// Desc: Get the driver list and store it in a InputRelatedDeviceInfo node +//----------------------------------------------------------------------------- +HRESULT CDxDiagInfo::GatherInputRelatedDeviceInstDrivers(InputRelatedDeviceInfo* pInputRelatedDevice, + IDxDiagContainer* pChild) +{ + HRESULT hr; + WCHAR wszContainer[512]; + IDxDiagContainer* pDriverChild = nullptr; + DWORD nChildInstanceCount = 0; + + if (FAILED(hr = pChild->GetNumberOfChildContainers(&nChildInstanceCount))) + goto LCleanup; + + DWORD nFileItem; + for (nFileItem = 0; nFileItem < nChildInstanceCount; nFileItem++) + { + hr = pChild->EnumChildContainerNames(nFileItem, wszContainer, 512); + if (FAILED(hr)) + goto LCleanup; + hr = pChild->GetChildContainer(wszContainer, &pDriverChild); + if (FAILED(hr) || pDriverChild == nullptr) + { + if (pDriverChild == nullptr) + hr = E_FAIL; + goto LCleanup; + } + + FileNode* pFileNode = new FileNode; + if (pFileNode == nullptr) + return E_OUTOFMEMORY; + + pInputRelatedDevice->m_vDriverList.push_back(pFileNode); + + if (FAILED(hr = GatherFileNodeInst(pFileNode, pDriverChild))) + goto LCleanup; + + SAFE_RELEASE(pDriverChild); + } + +LCleanup: + SAFE_RELEASE(pDriverChild); + return hr; +} + + + + +//----------------------------------------------------------------------------- +// Name: GetNetworkInfo() +// Desc: Get the network info from the dll +//----------------------------------------------------------------------------- +HRESULT CDxDiagInfo::GetNetworkInfo(NetInfo** ppNetInfo) +{ + HRESULT hr; + WCHAR wszContainer[512]; + IDxDiagContainer* pContainer = nullptr; + IDxDiagContainer* pObject = nullptr; + DWORD nInstanceCount = 0; + DWORD nItem = 0; + DWORD nCurCount = 0; + NetInfo* pNetInfo = nullptr; + + pNetInfo = new (std::nothrow) NetInfo; + if (nullptr == pNetInfo) + return E_OUTOFMEMORY; + ZeroMemory(pNetInfo, sizeof(NetInfo)); + *ppNetInfo = pNetInfo; + + // Get the IDxDiagContainer object called "DxDiag_DirectPlay". + // This call may take some time while dxdiag gathers the info. + hr = m_pDxDiagRoot->GetChildContainer(L"DxDiag_DirectPlay", &pObject); + if (FAILED(hr) || pObject == nullptr) + { + hr = E_FAIL; + goto LCleanup; + } + + if (FAILED(hr = GetStringValue(pObject, L"szNetworkNotesLocalized", EXPAND(pNetInfo->m_szNetworkNotesLocalized)))) + return hr; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szNetworkNotesEnglish", EXPAND(pNetInfo->m_szNetworkNotesEnglish)))) + return hr; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szRegHelpText", EXPAND(m_pNetInfo->m_szRegHelpText)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szTestResultLocalized", EXPAND(pNetInfo->m_szTestResultLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szTestResultEnglish", EXPAND(pNetInfo->m_szTestResultEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szVoiceWizardFullDuplexTestLocalized", + EXPAND(m_pNetInfo->m_szVoiceWizardFullDuplexTestLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szVoiceWizardHalfDuplexTestLocalized", + EXPAND(m_pNetInfo->m_szVoiceWizardHalfDuplexTestLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szVoiceWizardMicTestLocalized", + EXPAND(m_pNetInfo->m_szVoiceWizardMicTestLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szVoiceWizardFullDuplexTestEnglish", + EXPAND(m_pNetInfo->m_szVoiceWizardFullDuplexTestEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szVoiceWizardHalfDuplexTestEnglish", + EXPAND(m_pNetInfo->m_szVoiceWizardHalfDuplexTestEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szVoiceWizardMicTestEnglish", + EXPAND(m_pNetInfo->m_szVoiceWizardMicTestEnglish)))) + goto LCleanup; nCurCount++; + +#ifdef _DEBUG + // debug check to make sure we got all the info from the object + if (FAILED(hr = pObject->GetNumberOfProps(&pNetInfo->m_nElementCount))) + return hr; + if (pNetInfo->m_nElementCount != nCurCount) + OutputDebugStringW(L"Not all elements in pNetInfo recorded"); +#endif + + SAFE_RELEASE(pObject); + + // Get the number of "DxDiag_DirectPlay.DxDiag_DirectPlayApps" objects in the dll + if (FAILED(hr = m_pDxDiagRoot->GetChildContainer(L"DxDiag_DirectPlay.DxDiag_DirectPlayApps", &pContainer))) + goto LCleanup; + if (FAILED(hr = pContainer->GetNumberOfChildContainers(&nInstanceCount))) + goto LCleanup; + + for (nItem = 0; nItem < nInstanceCount; nItem++) + { + nCurCount = 0; + + NetApp* pNetApp = new (std::nothrow) NetApp; + if (pNetApp == nullptr) + return E_OUTOFMEMORY; + ZeroMemory(pNetApp, sizeof(NetApp)); + + // Add pNetApp to pNetInfo->m_vNetApps + pNetInfo->m_vNetApps.push_back(pNetApp); + + hr = pContainer->EnumChildContainerNames(nItem, wszContainer, 512); + if (FAILED(hr)) + goto LCleanup; + hr = pContainer->GetChildContainer(wszContainer, &pObject); + if (FAILED(hr) || pObject == nullptr) + { + if (pObject == nullptr) + hr = E_FAIL; + goto LCleanup; + } + + if (FAILED(hr = GetStringValue(pObject, L"szName", EXPAND(pNetApp->m_szName)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szGuid", EXPAND(pNetApp->m_szGuid)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szExeFile", EXPAND(pNetApp->m_szExeFile)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szExePath", EXPAND(pNetApp->m_szExePath)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szExeVersionLocalized", EXPAND(pNetApp->m_szExeVersionLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szExeVersionEnglish", EXPAND(pNetApp->m_szExeVersionEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szLauncherFile", EXPAND(pNetApp->m_szLauncherFile)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szLauncherPath", EXPAND(pNetApp->m_szLauncherPath)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szLauncherVersionLocalized", + EXPAND(pNetApp->m_szLauncherVersionLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szLauncherVersionEnglish", + EXPAND(pNetApp->m_szLauncherVersionEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bRegistryOK", &pNetApp->m_bRegistryOK))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bProblem", &pNetApp->m_bProblem))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bFileMissing", &pNetApp->m_bFileMissing))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwDXVer", &pNetApp->m_dwDXVer))) + goto LCleanup; nCurCount++; + +#ifdef _DEBUG + // debug check to make sure we got all the info from the object + if (FAILED(hr = pObject->GetNumberOfProps(&pNetApp->m_nElementCount))) + return hr; + if (pNetApp->m_nElementCount != nCurCount) + OutputDebugStringW(L"Not all elements in pNetApp recorded"); +#endif + + SAFE_RELEASE(pObject); + } + + SAFE_RELEASE(pContainer); + + // Get the number of "DxDiag_DirectPlaySP" objects in the dll + if (FAILED(hr = m_pDxDiagRoot->GetChildContainer(L"DxDiag_DirectPlay.DxDiag_DirectPlaySPs", &pContainer))) + goto LCleanup; + if (FAILED(hr = pContainer->GetNumberOfChildContainers(&nInstanceCount))) + goto LCleanup; + + for (nItem = 0; nItem < nInstanceCount; nItem++) + { + nCurCount = 0; + + NetSP* pNetSP = new (std::nothrow) NetSP; + if (pNetSP == nullptr) + return E_OUTOFMEMORY; + ZeroMemory(pNetSP, sizeof(NetSP)); + + // Add pNetSP to pNetInfo->m_vNetSPs + pNetInfo->m_vNetSPs.push_back(pNetSP); + + hr = pContainer->EnumChildContainerNames(nItem, wszContainer, 512); + if (FAILED(hr)) + goto LCleanup; + hr = pContainer->GetChildContainer(wszContainer, &pObject); + if (FAILED(hr) || pObject == nullptr) + { + if (pObject == nullptr) + hr = E_FAIL; + goto LCleanup; + } + + if (FAILED(hr = GetStringValue(pObject, L"szNameLocalized", EXPAND(pNetSP->m_szNameLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szNameEnglish", EXPAND(pNetSP->m_szNameEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szGuid", EXPAND(pNetSP->m_szGuid)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szFile", EXPAND(pNetSP->m_szFile)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szPath", EXPAND(pNetSP->m_szPath)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szVersionLocalized", EXPAND(pNetSP->m_szVersionLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szVersionEnglish", EXPAND(pNetSP->m_szVersionEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bRegistryOK", &pNetSP->m_bRegistryOK))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bProblem", &pNetSP->m_bProblem))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bFileMissing", &pNetSP->m_bFileMissing))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetBoolValue(pObject, L"bInstalled", &pNetSP->m_bInstalled))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwDXVer", &pNetSP->m_dwDXVer))) + goto LCleanup; nCurCount++; + +#ifdef _DEBUG + // debug check to make sure we got all the info from the object + if (FAILED(hr = pObject->GetNumberOfProps(&pNetSP->m_nElementCount))) + return hr; + if (pNetSP->m_nElementCount != nCurCount) + OutputDebugStringW(L"Not all elements in pNetSP recorded"); +#endif + + SAFE_RELEASE(pObject); + } + + SAFE_RELEASE(pContainer); + + if (FAILED(hr = m_pDxDiagRoot->GetChildContainer(L"DxDiag_DirectPlay.DxDiag_DirectPlayAdapters", + &pContainer))) + goto LCleanup; + if (FAILED(hr = pContainer->GetNumberOfChildContainers(&nInstanceCount))) + goto LCleanup; + + for (nItem = 0; nItem < nInstanceCount; nItem++) + { + nCurCount = 0; + + NetAdapter* pNetAdapter = new (std::nothrow) NetAdapter; + if (pNetAdapter == nullptr) + return E_OUTOFMEMORY; + ZeroMemory(pNetAdapter, sizeof(NetAdapter)); + + // Add pNetAdapter to m_pNetInfo->m_vNetAdapters + m_pNetInfo->m_vNetAdapters.push_back(pNetAdapter); + + hr = pContainer->EnumChildContainerNames(nItem, wszContainer, 512); + if (FAILED(hr)) + goto LCleanup; + hr = pContainer->GetChildContainer(wszContainer, &pObject); + if (FAILED(hr) || pObject == nullptr) + { + if (pObject == nullptr) + hr = E_FAIL; + goto LCleanup; + } + + if (FAILED(hr = GetStringValue(pObject, L"szAdapterName", EXPAND(pNetAdapter->m_szAdapterName)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szSPNameEnglish", EXPAND(pNetAdapter->m_szSPNameEnglish)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szSPNameLocalized", EXPAND(pNetAdapter->m_szSPNameLocalized)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szGuid", EXPAND(pNetAdapter->m_szGuid)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwFlags", &pNetAdapter->m_dwFlags))) + goto LCleanup; nCurCount++; + +#ifdef _DEBUG + // debug check to make sure we got all the info from the object + if (FAILED(hr = pObject->GetNumberOfProps(&pNetAdapter->m_nElementCount))) + return hr; + if (pNetAdapter->m_nElementCount != nCurCount) + OutputDebugStringW(L"Not all elements in pNetAdapter recorded"); +#endif + + SAFE_RELEASE(pObject); + } + + SAFE_RELEASE(pContainer); + + if (FAILED(hr = m_pDxDiagRoot->GetChildContainer(L"DxDiag_DirectPlay.DxDiag_DirectPlayVoiceCodecs", + &pContainer))) + goto LCleanup; + if (FAILED(hr = pContainer->GetNumberOfChildContainers(&nInstanceCount))) + goto LCleanup; + + for (nItem = 0; nItem < nInstanceCount; nItem++) + { + nCurCount = 0; + + NetVoiceCodec* pNetVoiceCodec = new (std::nothrow) NetVoiceCodec; + if (pNetVoiceCodec == nullptr) + return E_OUTOFMEMORY; + ZeroMemory(pNetVoiceCodec, sizeof(NetVoiceCodec)); + + // Add pNetVoiceCodec to m_pNetInfo->m_vNetVoiceCodecs + m_pNetInfo->m_vNetVoiceCodecs.push_back(pNetVoiceCodec); + + hr = pContainer->EnumChildContainerNames(nItem, wszContainer, 512); + if (FAILED(hr)) + goto LCleanup; + hr = pContainer->GetChildContainer(wszContainer, &pObject); + if (FAILED(hr) || pObject == nullptr) + { + if (pObject == nullptr) + hr = E_FAIL; + goto LCleanup; + } + + if (FAILED(hr = GetStringValue(pObject, L"szName", EXPAND(pNetVoiceCodec->m_szName)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szGuid", EXPAND(pNetVoiceCodec->m_szGuid)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szDescription", EXPAND(pNetVoiceCodec->m_szDescription)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwFlags", &pNetVoiceCodec->m_dwFlags))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwMaxBitsPerSecond", &pNetVoiceCodec->m_dwMaxBitsPerSecond))) + goto LCleanup; nCurCount++; + +#ifdef _DEBUG + // debug check to make sure we got all the info from the object + if (FAILED(hr = pObject->GetNumberOfProps(&pNetVoiceCodec->m_nElementCount))) + return hr; + if (pNetVoiceCodec->m_nElementCount != nCurCount) + OutputDebugStringW(L"Not all elements in pNetVoiceCodec recorded"); +#endif + + SAFE_RELEASE(pObject); + } + +LCleanup: + SAFE_RELEASE(pObject); + SAFE_RELEASE(pContainer); + return hr; +} + + + + +//----------------------------------------------------------------------------- +// Name: GetShowInfo() +// Desc: +//----------------------------------------------------------------------------- +HRESULT CDxDiagInfo::GetShowInfo(ShowInfo** ppShowInfo) +{ + HRESULT hr; + WCHAR wszContainer[512]; + IDxDiagContainer* pContainer = nullptr; + IDxDiagContainer* pObject = nullptr; + DWORD nInstanceCount = 0; + DWORD nItem = 0; + DWORD nCurCount = 0; + ShowInfo* pShowInfo = nullptr; + + pShowInfo = new (std::nothrow) ShowInfo; + if (nullptr == pShowInfo) + return E_OUTOFMEMORY; + ZeroMemory(pShowInfo, sizeof(ShowInfo)); + *ppShowInfo = pShowInfo; + + // Get the IDxDiagContainer object called "DxDiag_DirectShowFilters". + // This call may take some time while dxdiag gathers the info. + if (FAILED(hr = m_pDxDiagRoot->GetChildContainer(L"DxDiag_DirectShowFilters", &pContainer))) + goto LCleanup; + if (FAILED(hr = pContainer->GetNumberOfChildContainers(&nInstanceCount))) + goto LCleanup; + + for (nItem = 0; nItem < nInstanceCount; nItem++) + { + nCurCount = 0; + + ShowFilterInfo* pShowFilter = new (std::nothrow) ShowFilterInfo; + if (pShowFilter == nullptr) + return E_OUTOFMEMORY; + ZeroMemory(pShowFilter, sizeof(ShowFilterInfo)); + + // Add pShowFilter to pShowInfo->m_vShowFilters + pShowInfo->m_vShowFilters.push_back(pShowFilter); + + hr = pContainer->EnumChildContainerNames(nItem, wszContainer, 512); + if (FAILED(hr)) + goto LCleanup; + hr = pContainer->GetChildContainer(wszContainer, &pObject); + if (FAILED(hr) || pObject == nullptr) + { + if (pObject == nullptr) + hr = E_FAIL; + goto LCleanup; + } + + if (FAILED(hr = GetStringValue(pObject, L"szName", EXPAND(pShowFilter->m_szName)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szVersion", EXPAND(pShowFilter->m_szVersion)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"ClsidFilter", EXPAND(pShowFilter->m_ClsidFilter)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szFileName", EXPAND(pShowFilter->m_szFileName)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szFileVersion", EXPAND(pShowFilter->m_szFileVersion)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"szCatName", EXPAND(pShowFilter->m_szCatName)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetStringValue(pObject, L"ClsidCat", EXPAND(pShowFilter->m_ClsidCat)))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwInputs", &pShowFilter->m_dwInputs))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwOutputs", &pShowFilter->m_dwOutputs))) + goto LCleanup; nCurCount++; + if (FAILED(hr = GetUIntValue(pObject, L"dwMerit", &pShowFilter->m_dwMerit))) + goto LCleanup; nCurCount++; + +#ifdef _DEBUG + // debug check to make sure we got all the info from the object + if (FAILED(hr = pObject->GetNumberOfProps(&pShowFilter->m_nElementCount))) + return hr; + if (pShowFilter->m_nElementCount != nCurCount) + OutputDebugStringW(L"Not all elements in pShowFilter recorded"); +#endif + + SAFE_RELEASE(pObject); + } + +LCleanup: + SAFE_RELEASE(pObject); + SAFE_RELEASE(pContainer); + return hr; +} + + + + +//----------------------------------------------------------------------------- +// Name: GetStringValue() +// Desc: Get a string value from a IDxDiagContainer object +//----------------------------------------------------------------------------- +HRESULT CDxDiagInfo::GetStringValue(IDxDiagContainer* pObject, WCHAR* wstrName, WCHAR* strValue, int nStrLen) +{ + HRESULT hr; + VARIANT var; + VariantInit(&var); + + if (FAILED(hr = pObject->GetProp(wstrName, &var))) + return hr; + + if (var.vt != VT_BSTR) + return E_INVALIDARG; + +#ifdef _UNICODE + wcsncpy(strValue, var.bstrVal, nStrLen - 1); +#else + wcstombs(strValue, var.bstrVal, nStrLen); +#endif + strValue[nStrLen - 1] = L'\0'; + VariantClear(&var); + + return S_OK; +} + + + + +//----------------------------------------------------------------------------- +// Name: GetUIntValue() +// Desc: Get a UINT value from a IDxDiagContainer object +//----------------------------------------------------------------------------- +HRESULT CDxDiagInfo::GetUIntValue(IDxDiagContainer* pObject, WCHAR* wstrName, DWORD* pdwValue) +{ + HRESULT hr; + VARIANT var; + VariantInit(&var); + + if (FAILED(hr = pObject->GetProp(wstrName, &var))) + return hr; + + if (var.vt != VT_UI4) + return E_INVALIDARG; + + *pdwValue = var.ulVal; + VariantClear(&var); + + return S_OK; +} + + + + +//----------------------------------------------------------------------------- +// Name: GetIntValue() +// Desc: Get a INT value from a IDxDiagContainer object +//----------------------------------------------------------------------------- +HRESULT CDxDiagInfo::GetIntValue(IDxDiagContainer* pObject, WCHAR* wstrName, LONG* pnValue) +{ + HRESULT hr; + VARIANT var; + VariantInit(&var); + + if (FAILED(hr = pObject->GetProp(wstrName, &var))) + return hr; + + if (var.vt != VT_I4) + return E_INVALIDARG; + + *pnValue = var.lVal; + VariantClear(&var); + + return S_OK; +} + + + + +//----------------------------------------------------------------------------- +// Name: GetBoolValue() +// Desc: Get a BOOL value from a IDxDiagContainer object +//----------------------------------------------------------------------------- +HRESULT CDxDiagInfo::GetBoolValue(IDxDiagContainer* pObject, WCHAR* wstrName, BOOL* pbValue) +{ + HRESULT hr; + VARIANT var; + VariantInit(&var); + + if (FAILED(hr = pObject->GetProp(wstrName, &var))) + return hr; + + if (var.vt != VT_BOOL) + return E_INVALIDARG; + + *pbValue = (var.boolVal != 0); + VariantClear(&var); + + return S_OK; +} + + + + +//----------------------------------------------------------------------------- +// Name: GetInt64Value() +// Desc: Get a ULONGLONG value from a IDxDiagContainer object +//----------------------------------------------------------------------------- +HRESULT CDxDiagInfo::GetInt64Value(IDxDiagContainer* pObject, WCHAR* wstrName, ULONGLONG* pullValue) +{ + HRESULT hr; + VARIANT var; + VariantInit(&var); + + if (FAILED(hr = pObject->GetProp(wstrName, &var))) + return hr; + + // 64-bit values are stored as strings in BSTRs + if (var.vt != VT_BSTR) + return E_INVALIDARG; + + *pullValue = _wtoi64(var.bstrVal); + VariantClear(&var); + + return S_OK; +} + + + + +//----------------------------------------------------------------------------- +// Name: DestroySystemDevice() +// Desc: +//----------------------------------------------------------------------------- +VOID CDxDiagInfo::DestroySystemDevice(std::vector & vSystemDevices) +{ + for (auto iter = vSystemDevices.begin(); iter != vSystemDevices.end(); iter++) + { + SystemDevice* pSystemDevice = *iter; + SAFE_DELETE(pSystemDevice); + } + vSystemDevices.clear(); +} + + + + +//----------------------------------------------------------------------------- +// Name: DestroyFileList() +// Desc: Cleanup the file list +//----------------------------------------------------------------------------- +VOID CDxDiagInfo::DestroyFileList(FileInfo* pFileInfo) +{ + if (pFileInfo) + { + for (auto iter = pFileInfo->m_vDxComponentsFiles.begin(); iter != pFileInfo->m_vDxComponentsFiles.end(); iter++) + { + FileNode* pFileNode = *iter; + SAFE_DELETE(pFileNode); + } + pFileInfo->m_vDxComponentsFiles.clear(); + + SAFE_DELETE(pFileInfo); + } +} + + + + +//----------------------------------------------------------------------------- +// Name: DestroyDisplayInfo() +// Desc: Cleanup the display info +//----------------------------------------------------------------------------- +VOID CDxDiagInfo::DestroyDisplayInfo(std::vector & vDisplayInfo) +{ + for (auto iter = vDisplayInfo.begin(); iter != vDisplayInfo.end(); iter++) + { + DisplayInfo* pDisplayInfo = *iter; + + for (auto iterDXVA = pDisplayInfo->m_vDXVACaps.begin(); iterDXVA != pDisplayInfo->m_vDXVACaps.end(); iterDXVA++) + { + DxDiag_DXVA_DeinterlaceCaps* pDXVANode = *iterDXVA; + SAFE_DELETE(pDXVANode); + } + if (pDisplayInfo) + { + pDisplayInfo->m_vDXVACaps.clear(); + } + + SAFE_DELETE(pDisplayInfo); + } + vDisplayInfo.clear(); +} + + + + +//----------------------------------------------------------------------------- +// Name: DestroyInputInfo() +// Desc: Cleanup the input info +//----------------------------------------------------------------------------- +VOID CDxDiagInfo::DestroyInputInfo(InputInfo* pInputInfo) +{ + if (pInputInfo) + { + for (auto iter = pInputInfo->m_vDirectInputDevices.begin(); iter != pInputInfo->m_vDirectInputDevices.end(); + iter++) + { + InputDeviceInfo* pInputDeviceInfoDelete = *iter; + SAFE_DELETE(pInputDeviceInfoDelete); + } + pInputInfo->m_vDirectInputDevices.clear(); + + DeleteInputTree(pInputInfo->m_vGamePortDevices); + DeleteInputTree(pInputInfo->m_vUsbRoot); + DeleteInputTree(pInputInfo->m_vPS2Devices); + + SAFE_DELETE(pInputInfo); + } +} + + + + +//----------------------------------------------------------------------------- +// Name: DeleteInputTree +// Desc: +//----------------------------------------------------------------------------- +VOID CDxDiagInfo::DeleteInputTree(std::vector & vDeviceList) +{ + for (auto iter = vDeviceList.begin(); iter != vDeviceList.end(); iter++) + { + InputRelatedDeviceInfo* pInputNode = *iter; + if (pInputNode) + { + + if (!pInputNode->m_vChildren.empty()) + DeleteInputTree(pInputNode->m_vChildren); + + DeleteFileList(pInputNode->m_vDriverList); + } + SAFE_DELETE(pInputNode); + } + vDeviceList.clear(); +} + + + + +//----------------------------------------------------------------------------- +// Name: DeleteFileList() +// Desc: +//----------------------------------------------------------------------------- +VOID CDxDiagInfo::DeleteFileList(std::vector & vDriverList) +{ + for (auto iter = vDriverList.begin(); iter != vDriverList.end(); iter++) + { + FileNode* pFileNodeDelete = *iter; + SAFE_DELETE(pFileNodeDelete); + } + vDriverList.clear(); +} + + + + +//----------------------------------------------------------------------------- +// Name: DestroyMusicInfo() +// Desc: Cleanup the music info +//----------------------------------------------------------------------------- +VOID CDxDiagInfo::DestroyMusicInfo(MusicInfo* pMusicInfo) +{ + if (pMusicInfo) + { + for (auto iter = pMusicInfo->m_vMusicPorts.begin(); iter != pMusicInfo->m_vMusicPorts.end(); iter++) + { + MusicPort* pMusicPort = *iter; + SAFE_DELETE(pMusicPort); + } + pMusicInfo->m_vMusicPorts.clear(); + + SAFE_DELETE(pMusicInfo); + } +} + + + + +//----------------------------------------------------------------------------- +// Name: DestroyNetworkInfo() +// Desc: Cleanup the network info +//----------------------------------------------------------------------------- +VOID CDxDiagInfo::DestroyNetworkInfo(NetInfo* pNetInfo) +{ + if (pNetInfo) + { + for (auto iterNetApp = pNetInfo->m_vNetApps.begin(); iterNetApp != pNetInfo->m_vNetApps.end(); iterNetApp++) + { + NetApp* pNetApp = *iterNetApp; + SAFE_DELETE(pNetApp); + } + pNetInfo->m_vNetApps.clear(); + + for (auto iterNetSP = pNetInfo->m_vNetSPs.begin(); iterNetSP != pNetInfo->m_vNetSPs.end(); iterNetSP++) + { + NetSP* pNetSP = *iterNetSP; + SAFE_DELETE(pNetSP); + } + pNetInfo->m_vNetSPs.clear(); + + for (auto iterNetAdapter = pNetInfo->m_vNetAdapters.begin(); iterNetAdapter != pNetInfo->m_vNetAdapters.end(); + iterNetAdapter++) + { + NetAdapter* pNetAdapter = *iterNetAdapter; + SAFE_DELETE(pNetAdapter); + } + pNetInfo->m_vNetAdapters.clear(); + + for (auto iterNetCodec = pNetInfo->m_vNetVoiceCodecs.begin(); iterNetCodec != pNetInfo->m_vNetVoiceCodecs.end(); + iterNetCodec++) + { + NetVoiceCodec* pNetVoiceCodec = *iterNetCodec; + SAFE_DELETE(pNetVoiceCodec); + } + pNetInfo->m_vNetVoiceCodecs.clear(); + + SAFE_DELETE(pNetInfo); + } +} + + + + +//----------------------------------------------------------------------------- +// Name: DestroySoundInfo() +// Desc: Cleanup the sound info +//----------------------------------------------------------------------------- +VOID CDxDiagInfo::DestroySoundInfo(std::vector & vSoundInfos) +{ + for (auto iter = vSoundInfos.begin(); iter != vSoundInfos.end(); iter++) + { + SoundInfo* pSoundInfo = *iter; + SAFE_DELETE(pSoundInfo); + } + vSoundInfos.clear(); +} + + + + +//----------------------------------------------------------------------------- +// Name: DestroySoundCaptureInfo() +// Desc: Cleanup the sound info +//----------------------------------------------------------------------------- +VOID CDxDiagInfo::DestroySoundCaptureInfo(std::vector & vSoundCaptureInfos) +{ + for (auto iter = vSoundCaptureInfos.begin(); iter != vSoundCaptureInfos.end(); iter++) + { + SoundCaptureInfo* pSoundCaptureInfo = *iter; + SAFE_DELETE(pSoundCaptureInfo); + } + vSoundCaptureInfos.clear(); +} + + + +//----------------------------------------------------------------------------- +// Name: DestroySoundInfo() +// Desc: Cleanup the show info +//----------------------------------------------------------------------------- +VOID CDxDiagInfo::DestroyShowInfo(ShowInfo* pShowInfo) +{ + for (auto iter = pShowInfo->m_vShowFilters.begin(); iter != pShowInfo->m_vShowFilters.end(); iter++) + { + ShowFilterInfo* pShowFilterInfo = *iter; + SAFE_DELETE(pShowFilterInfo); + } + pShowInfo->m_vShowFilters.clear(); + + SAFE_DELETE(pShowInfo); +} + + diff --git a/DxDiag/DxDiagReport/dxdiaginfo.h b/DxDiag/DxDiagReport/dxdiaginfo.h new file mode 100644 index 00000000..3ea3f3bd --- /dev/null +++ b/DxDiag/DxDiagReport/dxdiaginfo.h @@ -0,0 +1,89 @@ +//---------------------------------------------------------------------------- +// File: dxdiag.h +// +// Desc: +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License (MIT) +//----------------------------------------------------------------------------- +#pragma once + +// Headers for dxdiagn.dll +#include + +// Headers for structs to hold info +#include "fileinfo.h" +#include "sysinfo.h" +#include "dispinfo.h" +#include "sndinfo.h" +#include "musinfo.h" +#include "inptinfo.h" +#include "netinfo.h" +#include "showinfo.h" + +//----------------------------------------------------------------------------- +// Defines, and constants +//----------------------------------------------------------------------------- +class CDxDiagInfo +{ +public: + CDxDiagInfo(); + ~CDxDiagInfo(); + + HRESULT Init(BOOL bAllowWHQLChecks); + HRESULT QueryDxDiagViaDll(); + +protected: + HRESULT GetSystemInfo(SysInfo** ppSysInfo); + HRESULT GetSystemDevices(std::vector & vSystemDevices); + HRESULT GatherSystemDeviceDriverList(IDxDiagContainer* pParent, std::vector & vDriverList); + HRESULT GatherFileNodeInst(FileNode* pFileNode, IDxDiagContainer* pObject); + HRESULT GetDirectXFilesInfo(FileInfo** ppFileInfo); + HRESULT GetDisplayInfo(std::vector & vDisplayInfo); + HRESULT GatherDXVA_DeinterlaceCaps(IDxDiagContainer* pParent, std::vector & vDXVACaps); + HRESULT GetSoundInfo(std::vector & vSoundInfos, std::vector & vSoundCaptureInfos); + HRESULT GetMusicInfo(MusicInfo** ppMusicInfo); + HRESULT GetInputInfo(InputInfo** ppInputInfo); + HRESULT GatherInputRelatedDeviceInst(InputRelatedDeviceInfo* pInputRelatedDevice, IDxDiagContainer* pContainer); + HRESULT GatherInputRelatedDeviceInstDrivers(InputRelatedDeviceInfo* pInputRelatedDevice, + IDxDiagContainer* pChild); + HRESULT GetNetworkInfo(NetInfo** ppNetInfo); + HRESULT GetShowInfo(ShowInfo** ppShowInfo); + HRESULT GetLogicalDiskInfo(std::vector & vLogicalDisks); + + HRESULT GetStringValue(IDxDiagContainer* pObject, WCHAR* wstrName, WCHAR* strValue, int nStrLen); + HRESULT GetUIntValue(IDxDiagContainer* pObject, WCHAR* wstrName, DWORD* pdwValue); + HRESULT GetIntValue(IDxDiagContainer* pObject, WCHAR* wstrName, LONG* pnValue); + HRESULT GetBoolValue(IDxDiagContainer* pObject, WCHAR* wstrName, BOOL* pbValue); + HRESULT GetInt64Value(IDxDiagContainer* pObject, WCHAR* wstrName, ULONGLONG* pullValue); + + VOID DestroyFileList(FileInfo* pFileInfo); + VOID DestroySystemDevice(std::vector & vSystemDevices); + VOID DestroyDisplayInfo(std::vector & vDisplayInfo); + VOID DeleteInputTree(std::vector & vDeviceList); + VOID DeleteFileList(std::vector & vDriverList); + VOID DestroyInputInfo(InputInfo* pInputInfo); + VOID DestroyMusicInfo(MusicInfo* pMusicInfo); + VOID DestroyNetworkInfo(NetInfo* pNetInfo); + VOID DestroySoundInfo(std::vector & vSoundInfos); + VOID DestroySoundCaptureInfo(std::vector & vSoundCaptureInfos); + VOID DestroyShowInfo(ShowInfo* pShowInfo); + + IDxDiagProvider* m_pDxDiagProvider; + IDxDiagContainer* m_pDxDiagRoot; + BOOL m_bCleanupCOM; + +public: + SysInfo* m_pSysInfo; + std::vector m_vSystemDevices; + FileInfo* m_pFileInfo; + std::vector m_vDisplayInfo; + std::vector m_vSoundInfos; + std::vector m_vSoundCaptureInfos; + MusicInfo* m_pMusicInfo; + InputInfo* m_pInputInfo; + NetInfo* m_pNetInfo; + ShowInfo* m_pShowInfo; + std::vector m_vLogicalDiskList; +}; + diff --git a/DxDiag/DxDiagReport/dxdiagreport.jpg b/DxDiag/DxDiagReport/dxdiagreport.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0d328b9ef714bf244c686ef1891e557cfb6f01af GIT binary patch literal 11646 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 RJ{@B5{c`v#slG_#KLMN>K6d~B literal 0 HcmV?d00001 diff --git a/DxDiag/DxDiagReport/fileinfo.h b/DxDiag/DxDiagReport/fileinfo.h new file mode 100644 index 00000000..7e5738f5 --- /dev/null +++ b/DxDiag/DxDiagReport/fileinfo.h @@ -0,0 +1,38 @@ +//---------------------------------------------------------------------------- +// File: fileinfo.h +// +// Desc: +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License (MIT) +//----------------------------------------------------------------------------- +#pragma once + +struct FileNode +{ + WCHAR m_szName[MAX_PATH]; + WCHAR m_szPath[MAX_PATH]; + WCHAR m_szVersion[50]; + WCHAR m_szLanguageEnglish[100]; + WCHAR m_szLanguageLocalized[100]; + FILETIME m_FileTime; + WCHAR m_szDatestampEnglish[30]; + WCHAR m_szDatestampLocalized[30]; + WCHAR m_szAttributes[50]; + LONG m_lNumBytes; + BOOL m_bExists; + BOOL m_bBeta; + BOOL m_bDebug; + BOOL m_bObsolete; + BOOL m_bProblem; + + DWORD m_nElementCount; +}; + +struct FileInfo +{ + std::vector m_vDxComponentsFiles; + WCHAR m_szDXFileNotesLocalized[3000]; // DirectX file notes (localized) + WCHAR m_szDXFileNotesEnglish[3000]; // DirectX file notes (english) + DWORD m_nElementCount; +}; diff --git a/DxDiag/DxDiagReport/inptinfo.h b/DxDiag/DxDiagReport/inptinfo.h new file mode 100644 index 00000000..5bbc5168 --- /dev/null +++ b/DxDiag/DxDiagReport/inptinfo.h @@ -0,0 +1,60 @@ +//---------------------------------------------------------------------------- +// File: inptinfo.h +// +// Desc: +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License (MIT) +//----------------------------------------------------------------------------- +#pragma once + +struct InputRelatedDeviceInfo +{ + DWORD m_dwVendorID; + DWORD m_dwProductID; + WCHAR m_szDescription[MAX_PATH]; + WCHAR m_szLocation[MAX_PATH]; + WCHAR m_szMatchingDeviceId[MAX_PATH]; + WCHAR m_szUpperFilters[MAX_PATH]; + WCHAR m_szService[MAX_PATH]; + WCHAR m_szLowerFilters[MAX_PATH]; + WCHAR m_szOEMData[MAX_PATH]; + WCHAR m_szFlags1[MAX_PATH]; + WCHAR m_szFlags2[MAX_PATH]; + + std::vector m_vDriverList; + std::vector m_vChildren; + DWORD m_nElementCount; +}; + +struct InputDeviceInfo +{ + WCHAR m_szInstanceName[MAX_PATH]; + BOOL m_bAttached; + DWORD m_dwJoystickID; + DWORD m_dwVendorID; + DWORD m_dwProductID; + DWORD m_dwDevType; + WCHAR m_szFFDriverName[MAX_PATH]; + WCHAR m_szFFDriverDateEnglish[MAX_PATH]; + WCHAR m_szFFDriverVersion[MAX_PATH]; + LONG m_lFFDriverSize; + + DWORD m_nElementCount; +}; + +struct InputInfo +{ + BOOL m_bPollFlags; + WCHAR m_szInputNotesLocalized[3000]; // DirectX file notes (localized) + WCHAR m_szInputNotesEnglish[3000]; // DirectX file notes (english) + WCHAR m_szRegHelpText[3000]; + + std::vector m_vGamePortDevices; + std::vector m_vUsbRoot; + std::vector m_vPS2Devices; + std::vector m_vDirectInputDevices; + + DWORD m_nElementCount; +}; + diff --git a/DxDiag/DxDiagReport/main.cpp b/DxDiag/DxDiagReport/main.cpp new file mode 100644 index 00000000..1be7087a --- /dev/null +++ b/DxDiag/DxDiagReport/main.cpp @@ -0,0 +1,1252 @@ +//---------------------------------------------------------------------------- +// File: main.cpp +// +// Desc: Sample app to read info from dxdiagn.dll +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License (MIT) +//----------------------------------------------------------------------------- +#define STRICT +#include + +#include +#include +#include +#include +#include + +#include "dxdiaginfo.h" +#include "resource.h" +#if defined(DEBUG) | defined(_DEBUG) +#include +#endif + + + +#define ADD_STRING_LINE_MACRO(x,y) { AddString( hwndList, x, L## #y, y ); nElementCount++; } +#define ADD_EXPANDED_STRING_LINE_MACRO(x,y) { AddExpandedString( hwndList, x, L## #y, y ); nElementCount++; } +#define ADD_INT_LINE_MACRO(x,y) { AddString( hwndList, x, L## #y, _ltow(y,szTmp,10) ); nElementCount++; } +#define ADD_UINT_LINE_MACRO(x,y) { AddString( hwndList, x, L## #y, _ultow(y,szTmp,10) ); nElementCount++; } +#define ADD_INT64_LINE_MACRO(x,y) { AddString( hwndList, x, L## #y, _ui64tow(y,szTmp,10) ); nElementCount++; } +#define ADD_UINT_LINE_MACRO2(x,y,z) { AddString( hwndList, x, y, _ultow(z,szTmp,10) ); nElementCount++; } + + +//----------------------------------------------------------------------------- +// Global variables +//----------------------------------------------------------------------------- +CDxDiagInfo* g_pDxDiagInfo = nullptr; +HINSTANCE g_hInst = nullptr; + + + + +//----------------------------------------------------------------------------- +// Function-prototypes +//----------------------------------------------------------------------------- +INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); +VOID SetupListBox(HWND hDlg); +VOID FillListBox(HWND hDlg); +VOID FillListBoxWithSysInfo(HWND hDlg); +VOID FillListBoxWithLogicalDiskInfo(HWND hwndList); +VOID FillListBoxWithSystemDevices(HWND hDlg); +VOID FillListBoxWithDirectXFilesInfo(HWND hDlg); +VOID FillListBoxWithDisplayInfo(HWND hDlg); +VOID FillListBoxWithDXVAInfo(WCHAR* szParentName, HWND hwndList, std::vector & vDXVACaps); +VOID FillListBoxWithSoundInfo(HWND hDlg); +VOID FillListBoxWithMusicInfo(HWND hDlg); +VOID FillListBoxWithInputInfo(HWND hDlg); +VOID FillListBoxWithInputRelatedInfo(HWND hDlg, std::vector & vDeviceList); +VOID FillListBoxWithNetworkInfo(HWND hDlg); +VOID FillListBoxWithDirectShowInfo(HWND hDlg); +VOID AddString(HWND hwndList, WCHAR* szKey, WCHAR* szName, WCHAR* szValue); +VOID AddExpandedString(HWND hwndList, WCHAR* szKey, WCHAR* szName, WCHAR* szValue); + + + + +//----------------------------------------------------------------------------- +// Name: WinMain() +// Desc: Entry point for the application. Since we use a simple dialog for +// user interaction we don't need to pump messages. +//----------------------------------------------------------------------------- +int WINAPI WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nCmdShow) +{ + // Enable run-time memory check for debug builds. +#if defined(DEBUG) | defined(_DEBUG) + _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); +#endif + + UNREFERENCED_PARAMETER(hPrevInstance); + UNREFERENCED_PARAMETER(lpCmdLine); + UNREFERENCED_PARAMETER(nCmdShow); + + HRESULT hr; + + g_hInst = hInstance; + + InitCommonControls(); + + g_pDxDiagInfo = new CDxDiagInfo(); + if (g_pDxDiagInfo == nullptr) + return 0; + + if (FAILED(hr = g_pDxDiagInfo->Init(TRUE))) + { + delete g_pDxDiagInfo; + MessageBoxW(nullptr, L"Failed initializing dxdiagn.dll", L"Error", MB_OK); + return 0; + } + + if (FAILED(hr = g_pDxDiagInfo->QueryDxDiagViaDll())) + { + delete g_pDxDiagInfo; + MessageBoxW(nullptr, L"Failed querying dxdiagn.dll", L"Error", MB_OK); + return 0; + } + + // Show dialog and fill it up with info from dxdiagn.dll + DialogBox(hInstance, MAKEINTRESOURCE(IDD_MAIN), nullptr, + (DLGPROC)MainDlgProc); + + delete g_pDxDiagInfo; + + return 0; +} + + + + +//----------------------------------------------------------------------------- +// Name: MainDlgProc() +// Desc: Handles dialog messages +//----------------------------------------------------------------------------- +INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + UNREFERENCED_PARAMETER(lParam); + + switch (msg) + { + case WM_INITDIALOG: + { + // Load and set the icon + HICON hIcon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_MAIN)); + SendMessage(hDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon); // Set big icon + SendMessage(hDlg, WM_SETICON, ICON_SMALL, (LPARAM)hIcon); // Set small icon + + SetupListBox(hDlg); + FillListBox(hDlg); + break; + } + + case WM_COMMAND: + { + switch (LOWORD(wParam)) + { + case IDCANCEL: + EndDialog(hDlg, 0); + return TRUE; + } + break; + } + } + + return FALSE; // Didn't handle message +} + + + + +//----------------------------------------------------------------------------- +// Name: SetupListBox() +// Desc: +//----------------------------------------------------------------------------- +VOID SetupListBox(HWND hDlg) +{ + LV_COLUMN col; + LONG iSubItem = 0; + + HWND hwndList = GetDlgItem(hDlg, IDC_LIST); + + col.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM; + col.fmt = LVCFMT_LEFT; + col.cx = 100; + col.pszText = L"Container"; + col.cchTextMax = 100; + col.iSubItem = iSubItem; + ListView_InsertColumn(hwndList, iSubItem, &col); + iSubItem++; + + col.pszText = L"Name"; + col.cx = 100; + col.iSubItem = iSubItem; + ListView_InsertColumn(hwndList, iSubItem, &col); + iSubItem++; + + col.pszText = L"Value"; + col.cx = 100; + col.iSubItem = iSubItem; + ListView_InsertColumn(hwndList, iSubItem, &col); + iSubItem++; + + // Add a bogus column so SetColumnWidth doesn't do strange + // things with the last real column + col.fmt = LVCFMT_RIGHT; + col.pszText = L""; + col.iSubItem = iSubItem; + ListView_InsertColumn(hwndList, iSubItem, &col); + iSubItem++; +} + + + + +//----------------------------------------------------------------------------- +// Name: FillListBox() +// Desc: +//----------------------------------------------------------------------------- +VOID FillListBox(HWND hDlg) +{ + HWND hwndList = GetDlgItem(hDlg, IDC_LIST); + + FillListBoxWithSysInfo(hwndList); + FillListBoxWithDisplayInfo(hwndList); + FillListBoxWithSoundInfo(hwndList); + FillListBoxWithMusicInfo(hwndList); + FillListBoxWithInputInfo(hwndList); + FillListBoxWithNetworkInfo(hwndList); + FillListBoxWithLogicalDiskInfo(hwndList); + FillListBoxWithSystemDevices(hwndList); + FillListBoxWithDirectXFilesInfo(hwndList); + FillListBoxWithDirectShowInfo(hwndList); + + // Autosize all columns to fit header/text tightly: + INT iColumn = 0; + INT iWidthHeader; + INT iWidthText; + for (; ; ) + { + if (FALSE == ListView_SetColumnWidth(hwndList, iColumn, LVSCW_AUTOSIZE_USEHEADER)) + break; + iWidthHeader = ListView_GetColumnWidth(hwndList, iColumn); + ListView_SetColumnWidth(hwndList, iColumn, LVSCW_AUTOSIZE); + iWidthText = ListView_GetColumnWidth(hwndList, iColumn); + if (iWidthText < iWidthHeader) + ListView_SetColumnWidth(hwndList, iColumn, iWidthHeader); + iColumn++; + } + // Delete the bogus column that was created + ListView_DeleteColumn(hwndList, iColumn - 1); + +} + + + + + +//----------------------------------------------------------------------------- +// Name: FillListBoxWithSysInfo() +// Desc: +//----------------------------------------------------------------------------- +VOID FillListBoxWithSysInfo(HWND hwndList) +{ + SysInfo* pSysInfo = g_pDxDiagInfo->m_pSysInfo; + + WCHAR szTmp[3000]; + WCHAR szKey[] = L"DxDiag_SystemInfo"; + DWORD nElementCount = 0; + + ADD_UINT_LINE_MACRO(szKey, pSysInfo->m_dwOSMajorVersion); + ADD_UINT_LINE_MACRO(szKey, pSysInfo->m_dwOSMinorVersion); + ADD_UINT_LINE_MACRO(szKey, pSysInfo->m_dwOSBuildNumber); + ADD_UINT_LINE_MACRO(szKey, pSysInfo->m_dwOSPlatformID); + ADD_UINT_LINE_MACRO(szKey, pSysInfo->m_dwDirectXVersionMajor); + ADD_UINT_LINE_MACRO(szKey, pSysInfo->m_dwDirectXVersionMinor); + ADD_STRING_LINE_MACRO(szKey, pSysInfo->m_szDirectXVersionLetter); + ADD_INT_LINE_MACRO(szKey, pSysInfo->m_bDebug); + ADD_INT_LINE_MACRO(szKey, pSysInfo->m_bNECPC98); + ADD_INT64_LINE_MACRO(szKey, pSysInfo->m_ullPhysicalMemory); + ADD_INT64_LINE_MACRO(szKey, pSysInfo->m_ullUsedPageFile); + ADD_INT64_LINE_MACRO(szKey, pSysInfo->m_ullAvailPageFile); + ADD_INT_LINE_MACRO(szKey, pSysInfo->m_bNetMeetingRunning); + ADD_INT_LINE_MACRO(szKey, pSysInfo->m_bIsD3D8DebugRuntimeAvailable); + ADD_INT_LINE_MACRO(szKey, pSysInfo->m_bIsD3DDebugRuntime); + ADD_INT_LINE_MACRO(szKey, pSysInfo->m_bIsDInput8DebugRuntimeAvailable); + ADD_INT_LINE_MACRO(szKey, pSysInfo->m_bIsDInput8DebugRuntime); + ADD_INT_LINE_MACRO(szKey, pSysInfo->m_bIsDMusicDebugRuntimeAvailable); + ADD_INT_LINE_MACRO(szKey, pSysInfo->m_bIsDMusicDebugRuntime); + ADD_INT_LINE_MACRO(szKey, pSysInfo->m_bIsDDrawDebugRuntime); + ADD_INT_LINE_MACRO(szKey, pSysInfo->m_bIsDPlayDebugRuntime); + ADD_INT_LINE_MACRO(szKey, pSysInfo->m_bIsDSoundDebugRuntime); + ADD_INT_LINE_MACRO(szKey, pSysInfo->m_nD3DDebugLevel); + ADD_INT_LINE_MACRO(szKey, pSysInfo->m_nDDrawDebugLevel); + ADD_INT_LINE_MACRO(szKey, pSysInfo->m_nDIDebugLevel); + ADD_INT_LINE_MACRO(szKey, pSysInfo->m_nDMusicDebugLevel); + ADD_INT_LINE_MACRO(szKey, pSysInfo->m_nDPlayDebugLevel); + ADD_INT_LINE_MACRO(szKey, pSysInfo->m_nDSoundDebugLevel); + ADD_INT_LINE_MACRO(szKey, pSysInfo->m_nDShowDebugLevel); + ADD_STRING_LINE_MACRO(szKey, pSysInfo->m_szWindowsDir); + ADD_STRING_LINE_MACRO(szKey, pSysInfo->m_szBuildLab); + ADD_STRING_LINE_MACRO(szKey, pSysInfo->m_szDxDiagVersion); + ADD_STRING_LINE_MACRO(szKey, pSysInfo->m_szSetupParamEnglish); + ADD_STRING_LINE_MACRO(szKey, pSysInfo->m_szProcessorEnglish); + ADD_STRING_LINE_MACRO(szKey, pSysInfo->m_szSystemManufacturerEnglish); + ADD_STRING_LINE_MACRO(szKey, pSysInfo->m_szSystemModelEnglish); + ADD_STRING_LINE_MACRO(szKey, pSysInfo->m_szBIOSEnglish); + ADD_STRING_LINE_MACRO(szKey, pSysInfo->m_szPhysicalMemoryEnglish); + ADD_STRING_LINE_MACRO(szKey, pSysInfo->m_szCSDVersion); + ADD_STRING_LINE_MACRO(szKey, pSysInfo->m_szDirectXVersionEnglish); + ADD_STRING_LINE_MACRO(szKey, pSysInfo->m_szDirectXVersionLongEnglish); + ADD_STRING_LINE_MACRO(szKey, pSysInfo->m_szMachineNameLocalized); + ADD_STRING_LINE_MACRO(szKey, pSysInfo->m_szOSLocalized); + ADD_STRING_LINE_MACRO(szKey, pSysInfo->m_szOSExLocalized); + ADD_STRING_LINE_MACRO(szKey, pSysInfo->m_szOSExLongLocalized); + ADD_STRING_LINE_MACRO(szKey, pSysInfo->m_szLanguagesLocalized); + ADD_STRING_LINE_MACRO(szKey, pSysInfo->m_szPageFileLocalized); + ADD_STRING_LINE_MACRO(szKey, pSysInfo->m_szTimeLocalized); + ADD_STRING_LINE_MACRO(szKey, pSysInfo->m_szMachineNameEnglish); + ADD_STRING_LINE_MACRO(szKey, pSysInfo->m_szOSEnglish); + ADD_STRING_LINE_MACRO(szKey, pSysInfo->m_szOSExEnglish); + ADD_STRING_LINE_MACRO(szKey, pSysInfo->m_szOSExLongEnglish); + ADD_STRING_LINE_MACRO(szKey, pSysInfo->m_szLanguagesEnglish); + ADD_STRING_LINE_MACRO(szKey, pSysInfo->m_szPageFileEnglish); + ADD_STRING_LINE_MACRO(szKey, pSysInfo->m_szTimeEnglish); + + for (int i = 0; i < 16; i++) + { + WCHAR szName[512]; + swprintf_s(szName, L"pSysInfo->m_ExtFuncBitmasks[%d].dwBits0_31", i); + ADD_UINT_LINE_MACRO2(szKey, szName, pSysInfo->m_ExtFuncBitmasks[i].dwBits0_31); + swprintf_s(szName, L"pSysInfo->m_ExtFuncBitmasks[%d].dwBits32_63", i); + ADD_UINT_LINE_MACRO2(szKey, szName, pSysInfo->m_ExtFuncBitmasks[i].dwBits32_63); + swprintf_s(szName, L"pSysInfo->m_ExtFuncBitmasks[%d].dwBits64_95", i); + ADD_UINT_LINE_MACRO2(szKey, szName, pSysInfo->m_ExtFuncBitmasks[i].dwBits64_95); + swprintf_s(szName, L"pSysInfo->m_ExtFuncBitmasks[%d].dwBits96_127", i); + ADD_UINT_LINE_MACRO2(szKey, szName, pSysInfo->m_ExtFuncBitmasks[i].dwBits96_127); + } + +#ifdef _DEBUG + // debug check to make sure we display all the info from the object + // you do not need to worry about this. this is for my own verification only + if (nElementCount != pSysInfo->m_nElementCount) + OutputDebugStringW(L"**WARNING** -- not all elements from pSysInfo displayed\n"); +#endif +} + + + + +//----------------------------------------------------------------------------- +// Name: FillListBoxWithLogicalDiskInfo() +// Desc: +//----------------------------------------------------------------------------- +VOID FillListBoxWithLogicalDiskInfo(HWND hwndList) +{ + CDxDiagInfo* pDxDiag = g_pDxDiagInfo; + WCHAR szTmp[3000]; + WCHAR szName[3000]; + + LogicalDisk* pLogicalDisk; + for (auto iterDisk = pDxDiag->m_vLogicalDiskList.begin(); iterDisk != pDxDiag->m_vLogicalDiskList.end(); iterDisk++) + { + pLogicalDisk = *iterDisk; + wcsncpy(szName, pLogicalDisk->m_szDriveLetter, 30); + szName[29] = 0; + + DWORD nElementCount = 0; + + ADD_STRING_LINE_MACRO(szName, pLogicalDisk->m_szDriveLetter); + ADD_STRING_LINE_MACRO(szName, pLogicalDisk->m_szFreeSpace); + ADD_STRING_LINE_MACRO(szName, pLogicalDisk->m_szMaxSpace); + ADD_STRING_LINE_MACRO(szName, pLogicalDisk->m_szFileSystem); + ADD_STRING_LINE_MACRO(szName, pLogicalDisk->m_szModel); + ADD_STRING_LINE_MACRO(szName, pLogicalDisk->m_szPNPDeviceID); + ADD_UINT_LINE_MACRO(szName, pLogicalDisk->m_dwHardDriveIndex); + +#ifdef _DEBUG + // debug check to make sure we display all the info from the object + // you do not need to worry about this. this is for my own verification only + if (nElementCount != pLogicalDisk->m_nElementCount) + OutputDebugStringW(L"**WARNING** -- not all elements from pLogicalDisk displayed\n"); +#endif + + FileNode* pFileNode; + for (auto iter = pLogicalDisk->m_vDriverList.begin(); iter != pLogicalDisk->m_vDriverList.end(); iter++) + { + pFileNode = *iter; + wcsncpy(szName, pLogicalDisk->m_szDriveLetter, 30); + szName[29] = 0; + wcscat_s(szName, L": "); + wcscat_s(szName, pFileNode->m_szName); + + ADD_STRING_LINE_MACRO(szName, pFileNode->m_szPath); + ADD_STRING_LINE_MACRO(szName, pFileNode->m_szName); + ADD_STRING_LINE_MACRO(szName, pFileNode->m_szVersion); + ADD_STRING_LINE_MACRO(szName, pFileNode->m_szLanguageEnglish); + ADD_STRING_LINE_MACRO(szName, pFileNode->m_szLanguageLocalized); + + ADD_UINT_LINE_MACRO(szName, pFileNode->m_FileTime.dwLowDateTime); + ADD_UINT_LINE_MACRO(szName, pFileNode->m_FileTime.dwHighDateTime); + ADD_STRING_LINE_MACRO(szName, pFileNode->m_szDatestampEnglish); + ADD_STRING_LINE_MACRO(szName, pFileNode->m_szDatestampLocalized); + ADD_STRING_LINE_MACRO(szName, pFileNode->m_szAttributes); + ADD_INT_LINE_MACRO(szName, pFileNode->m_lNumBytes); + ADD_INT_LINE_MACRO(szName, pFileNode->m_bExists); + ADD_INT_LINE_MACRO(szName, pFileNode->m_bBeta); + ADD_INT_LINE_MACRO(szName, pFileNode->m_bDebug); + ADD_INT_LINE_MACRO(szName, pFileNode->m_bObsolete); + ADD_INT_LINE_MACRO(szName, pFileNode->m_bProblem); + } + } +} + + + + +//----------------------------------------------------------------------------- +// Name: FillListBoxWithSystemDevices() +// Desc: +//----------------------------------------------------------------------------- +VOID FillListBoxWithSystemDevices(HWND hwndList) +{ + CDxDiagInfo* pDxDiag = g_pDxDiagInfo; + WCHAR szTmp[3000]; + WCHAR szName[3000]; + + SystemDevice* pSystemDevice; + for (auto iterDevice = pDxDiag->m_vSystemDevices.begin(); iterDevice != pDxDiag->m_vSystemDevices.end(); iterDevice++) + { + pSystemDevice = *iterDevice; + wcsncpy(szName, pSystemDevice->m_szDescription, 30); + szName[29] = 0; + + DWORD nElementCount = 0; + + ADD_STRING_LINE_MACRO(szName, pSystemDevice->m_szDescription); + ADD_STRING_LINE_MACRO(szName, pSystemDevice->m_szDeviceID); + +#ifdef _DEBUG + // debug check to make sure we display all the info from the object + // you do not need to worry about this. this is for my own verification only + if (nElementCount != pSystemDevice->m_nElementCount) + OutputDebugStringW(L"**WARNING** -- not all elements from pSystemDevice displayed\n"); +#endif + + FileNode* pFileNode; + for (auto iter = pSystemDevice->m_vDriverList.begin(); iter != pSystemDevice->m_vDriverList.end(); iter++) + { + pFileNode = *iter; + wcsncpy(szName, pSystemDevice->m_szDescription, 30); + szName[29] = 0; + wcscat_s(szName, L": "); + wcscat_s(szName, pFileNode->m_szName); + + ADD_STRING_LINE_MACRO(szName, pFileNode->m_szPath); + ADD_STRING_LINE_MACRO(szName, pFileNode->m_szName); + ADD_STRING_LINE_MACRO(szName, pFileNode->m_szVersion); + ADD_STRING_LINE_MACRO(szName, pFileNode->m_szLanguageEnglish); + ADD_STRING_LINE_MACRO(szName, pFileNode->m_szLanguageLocalized); + + ADD_UINT_LINE_MACRO(szName, pFileNode->m_FileTime.dwLowDateTime); + ADD_UINT_LINE_MACRO(szName, pFileNode->m_FileTime.dwHighDateTime); + ADD_STRING_LINE_MACRO(szName, pFileNode->m_szDatestampEnglish); + ADD_STRING_LINE_MACRO(szName, pFileNode->m_szDatestampLocalized); + ADD_STRING_LINE_MACRO(szName, pFileNode->m_szAttributes); + ADD_INT_LINE_MACRO(szName, pFileNode->m_lNumBytes); + ADD_INT_LINE_MACRO(szName, pFileNode->m_bExists); + ADD_INT_LINE_MACRO(szName, pFileNode->m_bBeta); + ADD_INT_LINE_MACRO(szName, pFileNode->m_bDebug); + ADD_INT_LINE_MACRO(szName, pFileNode->m_bObsolete); + ADD_INT_LINE_MACRO(szName, pFileNode->m_bProblem); + } + } +} + + + + +//----------------------------------------------------------------------------- +// Name: FillListBoxWithDirectXFilesInfo() +// Desc: +//----------------------------------------------------------------------------- +VOID FillListBoxWithDirectXFilesInfo(HWND hwndList) +{ + CDxDiagInfo* pDxDiag = g_pDxDiagInfo; + WCHAR szTmp[3000]; + + FileNode* pFileNode; + FileInfo* pFileInfo = pDxDiag->m_pFileInfo; + WCHAR szKey[] = L"DxDiag_FileInfo"; + DWORD nElementCount = 0; + + if (pDxDiag->m_pFileInfo == nullptr) + return; + + ADD_EXPANDED_STRING_LINE_MACRO(szKey, pFileInfo->m_szDXFileNotesLocalized); + ADD_EXPANDED_STRING_LINE_MACRO(szKey, pFileInfo->m_szDXFileNotesEnglish); + +#ifdef _DEBUG + // debug check to make sure we display all the info from the object + // you do not need to worry about this. this is for my own verification only + if (nElementCount != pFileInfo->m_nElementCount) + OutputDebugStringW(L"**WARNING** -- not all elements from pFileInfo displayed\n"); +#endif + + for (auto iter = pDxDiag->m_pFileInfo->m_vDxComponentsFiles.begin(); + iter != pDxDiag->m_pFileInfo->m_vDxComponentsFiles.end(); iter++) + { + pFileNode = *iter; + WCHAR* szName = pFileNode->m_szName; + nElementCount = 0; + + ADD_STRING_LINE_MACRO(szName, pFileNode->m_szName); + ADD_STRING_LINE_MACRO(szName, pFileNode->m_szVersion); + ADD_STRING_LINE_MACRO(szName, pFileNode->m_szLanguageEnglish); + ADD_STRING_LINE_MACRO(szName, pFileNode->m_szLanguageLocalized); + ADD_UINT_LINE_MACRO(szName, pFileNode->m_FileTime.dwHighDateTime); + ADD_UINT_LINE_MACRO(szName, pFileNode->m_FileTime.dwLowDateTime); + ADD_STRING_LINE_MACRO(szName, pFileNode->m_szDatestampEnglish); + ADD_STRING_LINE_MACRO(szName, pFileNode->m_szDatestampLocalized); + ADD_STRING_LINE_MACRO(szName, pFileNode->m_szAttributes); + ADD_INT_LINE_MACRO(szName, pFileNode->m_lNumBytes); + ADD_INT_LINE_MACRO(szName, pFileNode->m_bExists); + ADD_INT_LINE_MACRO(szName, pFileNode->m_bBeta); + ADD_INT_LINE_MACRO(szName, pFileNode->m_bDebug); + ADD_INT_LINE_MACRO(szName, pFileNode->m_bObsolete); + ADD_INT_LINE_MACRO(szName, pFileNode->m_bProblem); + +#ifdef _DEBUG + // debug check to make sure we display all the info from the object + // you do not need to worry about this. this is for my own verification only + if (nElementCount != pFileNode->m_nElementCount) + OutputDebugStringW(L"**WARNING** -- not all elements from pFileNode displayed\n"); +#endif + } +} + + + + +//----------------------------------------------------------------------------- +// Name: FillListBoxWithDisplayInfo() +// Desc: +//----------------------------------------------------------------------------- +VOID FillListBoxWithDisplayInfo(HWND hwndList) +{ + CDxDiagInfo* pDxDiag = g_pDxDiagInfo; + WCHAR szTmp[3000]; + + DisplayInfo* pDisplayInfo; + for (auto iter = pDxDiag->m_vDisplayInfo.begin(); iter != pDxDiag->m_vDisplayInfo.end(); iter++) + { + pDisplayInfo = *iter; + WCHAR* szName = pDisplayInfo->m_szDescription; + DWORD nElementCount = 0; + + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szDeviceName); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szDescription); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szKeyDeviceID); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szKeyDeviceKey); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szManufacturer); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szChipType); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szDACType); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szRevision); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szDisplayMemoryLocalized); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szDisplayMemoryEnglish); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szDisplayModeLocalized); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szDisplayModeEnglish); + ADD_UINT_LINE_MACRO(szName, pDisplayInfo->m_dwWidth); + ADD_UINT_LINE_MACRO(szName, pDisplayInfo->m_dwHeight); + ADD_UINT_LINE_MACRO(szName, pDisplayInfo->m_dwBpp); + ADD_UINT_LINE_MACRO(szName, pDisplayInfo->m_dwRefreshRate); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szMonitorName); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szMonitorMaxRes); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szDriverName); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szDriverVersion); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szDriverAttributes); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szDriverLanguageEnglish); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szDriverLanguageLocalized); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szDriverDateEnglish); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szDriverDateLocalized); + ADD_INT_LINE_MACRO(szName, pDisplayInfo->m_lDriverSize); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szMiniVdd); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szMiniVddDateLocalized); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szMiniVddDateEnglish); + ADD_INT_LINE_MACRO(szName, pDisplayInfo->m_lMiniVddSize); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szVdd); + ADD_INT_LINE_MACRO(szName, pDisplayInfo->m_bCanRenderWindow); + ADD_INT_LINE_MACRO(szName, pDisplayInfo->m_bDriverBeta); + ADD_INT_LINE_MACRO(szName, pDisplayInfo->m_bDriverDebug); + ADD_INT_LINE_MACRO(szName, pDisplayInfo->m_bDriverSigned); + ADD_INT_LINE_MACRO(szName, pDisplayInfo->m_bDriverSignedValid); + ADD_UINT_LINE_MACRO(szName, pDisplayInfo->m_dwDDIVersion); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szDDIVersionLocalized); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szDDIVersionEnglish); + ADD_UINT_LINE_MACRO(szName, pDisplayInfo->m_iAdapter); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szVendorId); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szDeviceId); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szSubSysId); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szRevisionId); + ADD_UINT_LINE_MACRO(szName, pDisplayInfo->m_dwWHQLLevel); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szDeviceIdentifier); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szDriverSignDate); + ADD_INT_LINE_MACRO(szName, pDisplayInfo->m_bNoHardware); + ADD_INT_LINE_MACRO(szName, pDisplayInfo->m_bDDAccelerationEnabled); + ADD_INT_LINE_MACRO(szName, pDisplayInfo->m_b3DAccelerationExists); + ADD_INT_LINE_MACRO(szName, pDisplayInfo->m_b3DAccelerationEnabled); + ADD_INT_LINE_MACRO(szName, pDisplayInfo->m_bAGPEnabled); + ADD_INT_LINE_MACRO(szName, pDisplayInfo->m_bAGPExists); + ADD_INT_LINE_MACRO(szName, pDisplayInfo->m_bAGPExistenceValid); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szDXVAModes); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szDDStatusLocalized); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szDDStatusEnglish); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szD3DStatusLocalized); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szD3DStatusEnglish); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szAGPStatusLocalized); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szAGPStatusEnglish); + ADD_EXPANDED_STRING_LINE_MACRO(szName, pDisplayInfo->m_szNotesLocalized); + ADD_EXPANDED_STRING_LINE_MACRO(szName, pDisplayInfo->m_szNotesEnglish); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szRegHelpText); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szTestResultDDLocalized); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szTestResultDDEnglish); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szTestResultD3D7Localized); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szTestResultD3D7English); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szTestResultD3D8Localized); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szTestResultD3D8English); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szTestResultD3D9Localized); + ADD_STRING_LINE_MACRO(szName, pDisplayInfo->m_szTestResultD3D9English); + +#ifdef _DEBUG + // debug check to make sure we display all the info from the object + // you do not need to worry about this. this is for my own verification only + if (nElementCount != pDisplayInfo->m_nElementCount) + OutputDebugStringW(L"**WARNING** -- not all elements from pDisplayInfo displayed\n"); +#endif + + FillListBoxWithDXVAInfo(szName, hwndList, pDisplayInfo->m_vDXVACaps); + } +} + + + + +//----------------------------------------------------------------------------- +// Name: FillListBoxWithDXVAInfo() +// Desc: +//----------------------------------------------------------------------------- +VOID FillListBoxWithDXVAInfo(WCHAR* szParentName, HWND hwndList, std::vector & vDXVACaps) +{ + DWORD dwIndex = 0; + WCHAR szTmp[3000]; + WCHAR szName[256]; + + DxDiag_DXVA_DeinterlaceCaps* pDXVANode; + for (auto iter = vDXVACaps.begin(); iter != vDXVACaps.end(); iter++) + { + pDXVANode = *iter; + swprintf_s(szName, L"%ls : DXVA %d", szParentName, dwIndex); + DWORD nElementCount = 0; + + ADD_STRING_LINE_MACRO(szName, pDXVANode->szGuid); + ADD_STRING_LINE_MACRO(szName, pDXVANode->szD3DInputFormat); + ADD_STRING_LINE_MACRO(szName, pDXVANode->szD3DOutputFormat); + ADD_STRING_LINE_MACRO(szName, pDXVANode->szCaps); + ADD_UINT_LINE_MACRO(szName, pDXVANode->dwNumPreviousOutputFrames); + ADD_UINT_LINE_MACRO(szName, pDXVANode->dwNumForwardRefSamples); + ADD_UINT_LINE_MACRO(szName, pDXVANode->dwNumBackwardRefSamples); + + dwIndex++; + } +} + + + + +//----------------------------------------------------------------------------- +// Name: FillListBoxWithSoundInfo() +// Desc: +//----------------------------------------------------------------------------- +VOID FillListBoxWithSoundInfo(HWND hwndList) +{ + CDxDiagInfo* pDxDiag = g_pDxDiagInfo; + WCHAR szTmp[3000]; + + SoundInfo* pSoundInfo; + for (auto iter = pDxDiag->m_vSoundInfos.begin(); iter != pDxDiag->m_vSoundInfos.end(); iter++) + { + pSoundInfo = *iter; + WCHAR* szName = pSoundInfo->m_szDescription; + DWORD nElementCount = 0; + + ADD_UINT_LINE_MACRO(szName, pSoundInfo->m_dwDevnode); + ADD_STRING_LINE_MACRO(szName, pSoundInfo->m_szGuidDeviceID); + ADD_STRING_LINE_MACRO(szName, pSoundInfo->m_szHardwareID); + ADD_STRING_LINE_MACRO(szName, pSoundInfo->m_szRegKey); + ADD_STRING_LINE_MACRO(szName, pSoundInfo->m_szManufacturerID); + ADD_STRING_LINE_MACRO(szName, pSoundInfo->m_szProductID); + ADD_STRING_LINE_MACRO(szName, pSoundInfo->m_szDescription); + ADD_STRING_LINE_MACRO(szName, pSoundInfo->m_szDriverName); + ADD_STRING_LINE_MACRO(szName, pSoundInfo->m_szDriverPath); + ADD_STRING_LINE_MACRO(szName, pSoundInfo->m_szDriverVersion); + ADD_STRING_LINE_MACRO(szName, pSoundInfo->m_szDriverLanguageEnglish); + ADD_STRING_LINE_MACRO(szName, pSoundInfo->m_szDriverLanguageLocalized); + ADD_STRING_LINE_MACRO(szName, pSoundInfo->m_szDriverAttributes); + ADD_STRING_LINE_MACRO(szName, pSoundInfo->m_szDriverDateEnglish); + ADD_STRING_LINE_MACRO(szName, pSoundInfo->m_szDriverDateLocalized); + ADD_STRING_LINE_MACRO(szName, pSoundInfo->m_szOtherDrivers); + ADD_STRING_LINE_MACRO(szName, pSoundInfo->m_szProvider); + ADD_STRING_LINE_MACRO(szName, pSoundInfo->m_szType); + ADD_INT_LINE_MACRO(szName, pSoundInfo->m_lNumBytes); + ADD_INT_LINE_MACRO(szName, pSoundInfo->m_bDriverBeta); + ADD_INT_LINE_MACRO(szName, pSoundInfo->m_bDriverDebug); + ADD_INT_LINE_MACRO(szName, pSoundInfo->m_bDriverSigned); + ADD_INT_LINE_MACRO(szName, pSoundInfo->m_bDriverSignedValid); + ADD_INT_LINE_MACRO(szName, pSoundInfo->m_lAccelerationLevel); + + ADD_INT_LINE_MACRO(szName, pSoundInfo->m_bDefaultSoundPlayback); + ADD_INT_LINE_MACRO(szName, pSoundInfo->m_bDefaultVoicePlayback); + ADD_INT_LINE_MACRO(szName, pSoundInfo->m_bVoiceManager); + ADD_INT_LINE_MACRO(szName, pSoundInfo->m_bEAX20Listener); + ADD_INT_LINE_MACRO(szName, pSoundInfo->m_bEAX20Source); + ADD_INT_LINE_MACRO(szName, pSoundInfo->m_bI3DL2Listener); + ADD_INT_LINE_MACRO(szName, pSoundInfo->m_bI3DL2Source); + ADD_INT_LINE_MACRO(szName, pSoundInfo->m_bZoomFX); + + ADD_UINT_LINE_MACRO(szName, pSoundInfo->m_dwFlags); + ADD_UINT_LINE_MACRO(szName, pSoundInfo->m_dwMinSecondarySampleRate); + ADD_UINT_LINE_MACRO(szName, pSoundInfo->m_dwMaxSecondarySampleRate); + ADD_UINT_LINE_MACRO(szName, pSoundInfo->m_dwPrimaryBuffers); + ADD_UINT_LINE_MACRO(szName, pSoundInfo->m_dwMaxHwMixingAllBuffers); + ADD_UINT_LINE_MACRO(szName, pSoundInfo->m_dwMaxHwMixingStaticBuffers); + ADD_UINT_LINE_MACRO(szName, pSoundInfo->m_dwMaxHwMixingStreamingBuffers); + ADD_UINT_LINE_MACRO(szName, pSoundInfo->m_dwFreeHwMixingAllBuffers); + ADD_UINT_LINE_MACRO(szName, pSoundInfo->m_dwFreeHwMixingStaticBuffers); + ADD_UINT_LINE_MACRO(szName, pSoundInfo->m_dwFreeHwMixingStreamingBuffers); + ADD_UINT_LINE_MACRO(szName, pSoundInfo->m_dwMaxHw3DAllBuffers); + ADD_UINT_LINE_MACRO(szName, pSoundInfo->m_dwMaxHw3DStaticBuffers); + ADD_UINT_LINE_MACRO(szName, pSoundInfo->m_dwMaxHw3DStreamingBuffers); + ADD_UINT_LINE_MACRO(szName, pSoundInfo->m_dwFreeHw3DAllBuffers); + ADD_UINT_LINE_MACRO(szName, pSoundInfo->m_dwFreeHw3DStaticBuffers); + ADD_UINT_LINE_MACRO(szName, pSoundInfo->m_dwFreeHw3DStreamingBuffers); + ADD_UINT_LINE_MACRO(szName, pSoundInfo->m_dwTotalHwMemBytes); + ADD_UINT_LINE_MACRO(szName, pSoundInfo->m_dwFreeHwMemBytes); + ADD_UINT_LINE_MACRO(szName, pSoundInfo->m_dwMaxContigFreeHwMemBytes); + ADD_UINT_LINE_MACRO(szName, pSoundInfo->m_dwUnlockTransferRateHwBuffers); + ADD_UINT_LINE_MACRO(szName, pSoundInfo->m_dwPlayCpuOverheadSwBuffers); + + ADD_EXPANDED_STRING_LINE_MACRO(szName, pSoundInfo->m_szNotesLocalized); + ADD_EXPANDED_STRING_LINE_MACRO(szName, pSoundInfo->m_szNotesEnglish); + ADD_STRING_LINE_MACRO(szName, pSoundInfo->m_szRegHelpText); + ADD_STRING_LINE_MACRO(szName, pSoundInfo->m_szTestResultLocalized); + ADD_STRING_LINE_MACRO(szName, pSoundInfo->m_szTestResultEnglish); + +#ifdef _DEBUG + // debug check to make sure we display all the info from the object + // you do not need to worry about this. this is for my own verification only + if (nElementCount != pSoundInfo->m_nElementCount) + OutputDebugStringW(L"**WARNING** -- not all elements from pSoundInfo displayed\n"); +#endif + } + + SoundCaptureInfo* pSoundCaptureInfo; + for (auto iterCapture = pDxDiag->m_vSoundCaptureInfos.begin(); iterCapture != pDxDiag->m_vSoundCaptureInfos.end(); + iterCapture++) + { + pSoundCaptureInfo = *iterCapture; + WCHAR* szName = pSoundCaptureInfo->m_szDescription; + DWORD nElementCount = 0; + + ADD_STRING_LINE_MACRO(szName, pSoundCaptureInfo->m_szDescription); + ADD_STRING_LINE_MACRO(szName, pSoundCaptureInfo->m_szGuidDeviceID); + ADD_STRING_LINE_MACRO(szName, pSoundCaptureInfo->m_szDriverName); + ADD_STRING_LINE_MACRO(szName, pSoundCaptureInfo->m_szDriverPath); + ADD_STRING_LINE_MACRO(szName, pSoundCaptureInfo->m_szDriverVersion); + ADD_STRING_LINE_MACRO(szName, pSoundCaptureInfo->m_szDriverLanguageEnglish); + ADD_STRING_LINE_MACRO(szName, pSoundCaptureInfo->m_szDriverLanguageLocalized); + ADD_STRING_LINE_MACRO(szName, pSoundCaptureInfo->m_szDriverAttributes); + ADD_STRING_LINE_MACRO(szName, pSoundCaptureInfo->m_szDriverDateEnglish); + ADD_STRING_LINE_MACRO(szName, pSoundCaptureInfo->m_szDriverDateLocalized); + ADD_INT_LINE_MACRO(szName, pSoundCaptureInfo->m_lNumBytes); + ADD_INT_LINE_MACRO(szName, pSoundCaptureInfo->m_bDriverBeta); + ADD_INT_LINE_MACRO(szName, pSoundCaptureInfo->m_bDriverDebug); + + ADD_INT_LINE_MACRO(szName, pSoundCaptureInfo->m_bDefaultSoundRecording); + ADD_INT_LINE_MACRO(szName, pSoundCaptureInfo->m_bDefaultVoiceRecording); + ADD_UINT_LINE_MACRO(szName, pSoundCaptureInfo->m_dwFlags); + ADD_UINT_LINE_MACRO(szName, pSoundCaptureInfo->m_dwFormats); + +#ifdef _DEBUG + // debug check to make sure we display all the info from the object + // you do not need to worry about this. this is for my own verification only + if (nElementCount != pSoundCaptureInfo->m_nElementCount) + OutputDebugStringW(L"**WARNING** -- not all elements from pSoundCaptureInfo displayed\n"); +#endif + } + +} + + + + +//----------------------------------------------------------------------------- +// Name: FillListBoxWithMusicInfo() +// Desc: +//----------------------------------------------------------------------------- +VOID FillListBoxWithMusicInfo(HWND hwndList) +{ + CDxDiagInfo* pDxDiag = g_pDxDiagInfo; + WCHAR szTmp[3000]; + + MusicInfo* pMusicInfo = pDxDiag->m_pMusicInfo; + WCHAR szKey[] = L"DxDiag_MusicInfo"; + DWORD nElementCount = 0; + + if (pMusicInfo == nullptr) + return; + + ADD_INT_LINE_MACRO(szKey, pMusicInfo->m_bDMusicInstalled); + ADD_STRING_LINE_MACRO(szKey, pMusicInfo->m_szGMFilePath); + ADD_STRING_LINE_MACRO(szKey, pMusicInfo->m_szGMFileVersion); + ADD_INT_LINE_MACRO(szKey, pMusicInfo->m_bAccelerationEnabled); + ADD_INT_LINE_MACRO(szKey, pMusicInfo->m_bAccelerationExists); + ADD_EXPANDED_STRING_LINE_MACRO(szKey, pMusicInfo->m_szNotesLocalized); + ADD_EXPANDED_STRING_LINE_MACRO(szKey, pMusicInfo->m_szNotesEnglish); + ADD_STRING_LINE_MACRO(szKey, pMusicInfo->m_szRegHelpText); + ADD_STRING_LINE_MACRO(szKey, pMusicInfo->m_szTestResultLocalized); + ADD_STRING_LINE_MACRO(szKey, pMusicInfo->m_szTestResultEnglish); + +#ifdef _DEBUG + // debug check to make sure we display all the info from the object + // you do not need to worry about this. this is for my own verification only + if (nElementCount != pMusicInfo->m_nElementCount) + OutputDebugStringW(L"**WARNING** -- not all elements from pMusicInfo displayed\n"); +#endif + + MusicPort* pMusicPort; + for (auto iter = pDxDiag->m_pMusicInfo->m_vMusicPorts.begin(); iter != pDxDiag->m_pMusicInfo->m_vMusicPorts.end(); + iter++) + { + pMusicPort = *iter; + WCHAR* szName = pMusicPort->m_szDescription; + nElementCount = 0; + + ADD_STRING_LINE_MACRO(szName, pMusicPort->m_szGuid); + ADD_INT_LINE_MACRO(szName, pMusicPort->m_bSoftware); + ADD_INT_LINE_MACRO(szName, pMusicPort->m_bKernelMode); + ADD_INT_LINE_MACRO(szName, pMusicPort->m_bUsesDLS); + ADD_INT_LINE_MACRO(szName, pMusicPort->m_bExternal); + ADD_UINT_LINE_MACRO(szName, pMusicPort->m_dwMaxAudioChannels); + ADD_UINT_LINE_MACRO(szName, pMusicPort->m_dwMaxChannelGroups); + ADD_INT_LINE_MACRO(szName, pMusicPort->m_bDefaultPort); + ADD_INT_LINE_MACRO(szName, pMusicPort->m_bOutputPort); + ADD_STRING_LINE_MACRO(szName, pMusicPort->m_szDescription); + +#ifdef _DEBUG + // debug check to make sure we display all the info from the object + // you do not need to worry about this. this is for my own verification only + if (nElementCount != pMusicPort->m_nElementCount) + OutputDebugStringW(L"**WARNING** -- not all elements from pMusicPort displayed\n"); +#endif + } +} + + + + +//----------------------------------------------------------------------------- +// Name: FillListBoxWithInputInfo() +// Desc: +//----------------------------------------------------------------------------- +VOID FillListBoxWithInputInfo(HWND hwndList) +{ + CDxDiagInfo* pDxDiag = g_pDxDiagInfo; + WCHAR szTmp[3000]; + + InputInfo* pInputInfo = pDxDiag->m_pInputInfo; + WCHAR szKey[] = L"DxDiag_InputInfo"; + DWORD nElementCount = 0; + + if (pInputInfo == nullptr) + return; + + ADD_INT_LINE_MACRO(szKey, pInputInfo->m_bPollFlags); + ADD_EXPANDED_STRING_LINE_MACRO(szKey, pInputInfo->m_szInputNotesLocalized); + ADD_EXPANDED_STRING_LINE_MACRO(szKey, pInputInfo->m_szInputNotesEnglish); + ADD_STRING_LINE_MACRO(szKey, pInputInfo->m_szRegHelpText); + +#ifdef _DEBUG + // debug check to make sure we display all the info from the object + // you do not need to worry about this. this is for my own verification only + if (nElementCount != pInputInfo->m_nElementCount) + OutputDebugStringW(L"**WARNING** -- not all elements from pInputInfo displayed\n"); +#endif + + InputDeviceInfo* pInputDevice; + for (auto iter = pDxDiag->m_pInputInfo->m_vDirectInputDevices.begin(); + iter != pDxDiag->m_pInputInfo->m_vDirectInputDevices.end(); iter++) + { + pInputDevice = *iter; + WCHAR* szName = pInputDevice->m_szInstanceName; + nElementCount = 0; + + ADD_STRING_LINE_MACRO(szName, pInputDevice->m_szInstanceName); + ADD_INT_LINE_MACRO(szName, pInputDevice->m_bAttached); + ADD_UINT_LINE_MACRO(szName, pInputDevice->m_dwVendorID); + ADD_UINT_LINE_MACRO(szName, pInputDevice->m_dwProductID); + ADD_UINT_LINE_MACRO(szName, pInputDevice->m_dwJoystickID); + ADD_UINT_LINE_MACRO(szName, pInputDevice->m_dwDevType); + ADD_STRING_LINE_MACRO(szName, pInputDevice->m_szFFDriverName); + ADD_STRING_LINE_MACRO(szName, pInputDevice->m_szFFDriverDateEnglish); + ADD_STRING_LINE_MACRO(szName, pInputDevice->m_szFFDriverVersion); + ADD_INT_LINE_MACRO(szName, pInputDevice->m_lFFDriverSize); + +#ifdef _DEBUG + // debug check to make sure we display all the info from the object + // you do not need to worry about this. this is for my own verification only + if (nElementCount != pInputDevice->m_nElementCount) + OutputDebugStringW(L"**WARNING** -- not all elements from pInputDevice displayed\n"); +#endif + } + + FillListBoxWithInputRelatedInfo(hwndList, pDxDiag->m_pInputInfo->m_vGamePortDevices); + FillListBoxWithInputRelatedInfo(hwndList, pDxDiag->m_pInputInfo->m_vUsbRoot); + FillListBoxWithInputRelatedInfo(hwndList, pDxDiag->m_pInputInfo->m_vPS2Devices); +} + + + + +//----------------------------------------------------------------------------- +// Name: FillListBoxWithInputRelatedInfo() +// Desc: +//----------------------------------------------------------------------------- +VOID FillListBoxWithInputRelatedInfo(HWND hwndList, std::vector & vDeviceList) +{ + WCHAR szTmp[3000]; + + DWORD nElementCount = 0; + + InputRelatedDeviceInfo* pInputRelatedDevice; + for (auto iter = vDeviceList.begin(); iter != vDeviceList.end(); iter++) + { + pInputRelatedDevice = *iter; + WCHAR* szName = pInputRelatedDevice->m_szDescription; + nElementCount = 0; + + ADD_STRING_LINE_MACRO(szName, pInputRelatedDevice->m_szDescription); + ADD_UINT_LINE_MACRO(szName, pInputRelatedDevice->m_dwVendorID); + ADD_UINT_LINE_MACRO(szName, pInputRelatedDevice->m_dwProductID); + ADD_STRING_LINE_MACRO(szName, pInputRelatedDevice->m_szLocation); + ADD_STRING_LINE_MACRO(szName, pInputRelatedDevice->m_szMatchingDeviceId); + ADD_STRING_LINE_MACRO(szName, pInputRelatedDevice->m_szUpperFilters); + ADD_STRING_LINE_MACRO(szName, pInputRelatedDevice->m_szService); + ADD_STRING_LINE_MACRO(szName, pInputRelatedDevice->m_szLowerFilters); + ADD_STRING_LINE_MACRO(szName, pInputRelatedDevice->m_szOEMData); + ADD_STRING_LINE_MACRO(szName, pInputRelatedDevice->m_szFlags1); + ADD_STRING_LINE_MACRO(szName, pInputRelatedDevice->m_szFlags2); + +#ifdef _DEBUG + // debug check to make sure we display all the info from the object + // you do not need to worry about this. this is for my own verification only + if (nElementCount != pInputRelatedDevice->m_nElementCount) + OutputDebugStringW(L"**WARNING** -- not all elements from pInputRelatedDevice displayed\n"); +#endif + + FileNode* pFileNode; + for (auto iterFile = pInputRelatedDevice->m_vDriverList.begin(); + iterFile != pInputRelatedDevice->m_vDriverList.end(); iterFile++) + { + pFileNode = *iterFile; + wcsncpy(szName, pInputRelatedDevice->m_szDescription, 30); + szName[29] = 0; + wcscat_s(szName, MAX_PATH, L": "); + wcscat_s(szName, MAX_PATH, pFileNode->m_szName); + + ADD_STRING_LINE_MACRO(szName, pFileNode->m_szPath); + ADD_STRING_LINE_MACRO(szName, pFileNode->m_szName); + ADD_STRING_LINE_MACRO(szName, pFileNode->m_szVersion); + ADD_STRING_LINE_MACRO(szName, pFileNode->m_szLanguageEnglish); + ADD_STRING_LINE_MACRO(szName, pFileNode->m_szLanguageLocalized); + + ADD_UINT_LINE_MACRO(szName, pFileNode->m_FileTime.dwLowDateTime); + ADD_UINT_LINE_MACRO(szName, pFileNode->m_FileTime.dwHighDateTime); + ADD_STRING_LINE_MACRO(szName, pFileNode->m_szDatestampEnglish); + ADD_STRING_LINE_MACRO(szName, pFileNode->m_szDatestampLocalized); + ADD_STRING_LINE_MACRO(szName, pFileNode->m_szAttributes); + ADD_INT_LINE_MACRO(szName, pFileNode->m_lNumBytes); + ADD_INT_LINE_MACRO(szName, pFileNode->m_bExists); + ADD_INT_LINE_MACRO(szName, pFileNode->m_bBeta); + ADD_INT_LINE_MACRO(szName, pFileNode->m_bDebug); + ADD_INT_LINE_MACRO(szName, pFileNode->m_bObsolete); + ADD_INT_LINE_MACRO(szName, pFileNode->m_bProblem); + } + + if (!pInputRelatedDevice->m_vChildren.empty()) + FillListBoxWithInputRelatedInfo(hwndList, pInputRelatedDevice->m_vChildren); + } +} + + + + +//----------------------------------------------------------------------------- +// Name: FillListBoxWithNetworkInfo() +// Desc: +//----------------------------------------------------------------------------- +VOID FillListBoxWithNetworkInfo(HWND hwndList) +{ + CDxDiagInfo* pDxDiag = g_pDxDiagInfo; + WCHAR szTmp[3000]; + + NetInfo* pNetInfo = pDxDiag->m_pNetInfo; + WCHAR szKey[] = L"DxDiag_NetInfo"; + DWORD nElementCount = 0; + + if (pNetInfo == nullptr) + return; + + ADD_EXPANDED_STRING_LINE_MACRO(szKey, pNetInfo->m_szNetworkNotesLocalized); + ADD_EXPANDED_STRING_LINE_MACRO(szKey, pNetInfo->m_szNetworkNotesEnglish); + ADD_EXPANDED_STRING_LINE_MACRO(szKey, pNetInfo->m_szRegHelpText); + ADD_STRING_LINE_MACRO(szKey, pNetInfo->m_szTestResultLocalized); + ADD_STRING_LINE_MACRO(szKey, pNetInfo->m_szTestResultEnglish); + ADD_STRING_LINE_MACRO(szKey, pNetInfo->m_szVoiceWizardFullDuplexTestLocalized); + ADD_STRING_LINE_MACRO(szKey, pNetInfo->m_szVoiceWizardHalfDuplexTestLocalized); + ADD_STRING_LINE_MACRO(szKey, pNetInfo->m_szVoiceWizardMicTestLocalized); + ADD_STRING_LINE_MACRO(szKey, pNetInfo->m_szVoiceWizardFullDuplexTestEnglish); + ADD_STRING_LINE_MACRO(szKey, pNetInfo->m_szVoiceWizardHalfDuplexTestEnglish); + ADD_STRING_LINE_MACRO(szKey, pNetInfo->m_szVoiceWizardMicTestEnglish); + +#ifdef _DEBUG + // debug check to make sure we display all the info from the object + // you do not need to worry about this. this is for my own verification only + if (nElementCount != pNetInfo->m_nElementCount) + OutputDebugStringW(L"**WARNING** -- not all elements from pNetInfo displayed\n"); +#endif + + NetApp* pNetApp; + for (auto iterNetApp = pDxDiag->m_pNetInfo->m_vNetApps.begin(); iterNetApp != pDxDiag->m_pNetInfo->m_vNetApps.end(); + iterNetApp++) + { + pNetApp = *iterNetApp; + WCHAR* szName = pNetApp->m_szName; + nElementCount = 0; + + ADD_STRING_LINE_MACRO(szName, pNetApp->m_szName); + ADD_STRING_LINE_MACRO(szName, pNetApp->m_szGuid); + ADD_STRING_LINE_MACRO(szName, pNetApp->m_szExeFile); + ADD_STRING_LINE_MACRO(szName, pNetApp->m_szExePath); + ADD_STRING_LINE_MACRO(szName, pNetApp->m_szExeVersionLocalized); + ADD_STRING_LINE_MACRO(szName, pNetApp->m_szExeVersionEnglish); + ADD_STRING_LINE_MACRO(szName, pNetApp->m_szLauncherFile); + ADD_STRING_LINE_MACRO(szName, pNetApp->m_szLauncherPath); + ADD_STRING_LINE_MACRO(szName, pNetApp->m_szLauncherVersionLocalized); + ADD_STRING_LINE_MACRO(szName, pNetApp->m_szLauncherVersionEnglish); + ADD_INT_LINE_MACRO(szName, pNetApp->m_bRegistryOK); + ADD_INT_LINE_MACRO(szName, pNetApp->m_bProblem); + ADD_INT_LINE_MACRO(szName, pNetApp->m_bFileMissing); + ADD_UINT_LINE_MACRO(szName, pNetApp->m_dwDXVer); + +#ifdef _DEBUG + // debug check to make sure we display all the info from the object + // you do not need to worry about this. this is for my own verification only + if (nElementCount != pNetApp->m_nElementCount) + OutputDebugStringW(L"**WARNING** -- not all elements from pNetApp displayed\n"); +#endif + } + + NetSP* pNetSP; + for (auto iterNetSP = pDxDiag->m_pNetInfo->m_vNetSPs.begin(); iterNetSP != pDxDiag->m_pNetInfo->m_vNetSPs.end(); + iterNetSP++) + { + pNetSP = *iterNetSP; + WCHAR* szName = pNetSP->m_szNameEnglish; + nElementCount = 0; + + ADD_STRING_LINE_MACRO(szName, pNetSP->m_szNameLocalized); + ADD_STRING_LINE_MACRO(szName, pNetSP->m_szNameEnglish); + ADD_STRING_LINE_MACRO(szName, pNetSP->m_szGuid); + ADD_STRING_LINE_MACRO(szName, pNetSP->m_szFile); + ADD_STRING_LINE_MACRO(szName, pNetSP->m_szPath); + ADD_STRING_LINE_MACRO(szName, pNetSP->m_szVersionLocalized); + ADD_STRING_LINE_MACRO(szName, pNetSP->m_szVersionEnglish); + ADD_INT_LINE_MACRO(szName, pNetSP->m_bRegistryOK); + ADD_INT_LINE_MACRO(szName, pNetSP->m_bProblem); + ADD_INT_LINE_MACRO(szName, pNetSP->m_bFileMissing); + ADD_INT_LINE_MACRO(szName, pNetSP->m_bInstalled); + ADD_UINT_LINE_MACRO(szName, pNetSP->m_dwDXVer); + +#ifdef _DEBUG + // debug check to make sure we display all the info from the object + // you do not need to worry about this. this is for my own verification only + if (nElementCount != pNetSP->m_nElementCount) + OutputDebugStringW(L"**WARNING** -- not all elements from pNetSP displayed\n"); +#endif + } + + NetAdapter* pNetAdapter; + for (auto iterNetAdapter = pDxDiag->m_pNetInfo->m_vNetAdapters.begin(); + iterNetAdapter != pDxDiag->m_pNetInfo->m_vNetAdapters.end(); iterNetAdapter++) + { + pNetAdapter = *iterNetAdapter; + WCHAR szName[200]; + wcsncpy(szName, pNetAdapter->m_szAdapterName, 50); + szName[49] = 0; + + nElementCount = 0; + + ADD_STRING_LINE_MACRO(szName, pNetAdapter->m_szAdapterName); + ADD_STRING_LINE_MACRO(szName, pNetAdapter->m_szSPNameEnglish); + ADD_STRING_LINE_MACRO(szName, pNetAdapter->m_szSPNameLocalized); + ADD_STRING_LINE_MACRO(szName, pNetAdapter->m_szGuid); + ADD_UINT_LINE_MACRO(szName, pNetAdapter->m_dwFlags); + +#ifdef _DEBUG + // debug check to make sure we display all the info from the object + // you do not need to worry about this. this is for my own verification only + if (nElementCount != pNetAdapter->m_nElementCount) + OutputDebugStringW(L"**WARNING** -- not all elements from pNetAdapter displayed\n"); +#endif + } + + NetVoiceCodec* pNetVoiceCodec; + for (auto iterNetCodec = pDxDiag->m_pNetInfo->m_vNetVoiceCodecs.begin(); + iterNetCodec != pDxDiag->m_pNetInfo->m_vNetVoiceCodecs.end(); iterNetCodec++) + { + pNetVoiceCodec = *iterNetCodec; + WCHAR* szName = pNetVoiceCodec->m_szName; + nElementCount = 0; + + ADD_STRING_LINE_MACRO(szName, pNetVoiceCodec->m_szName); + ADD_STRING_LINE_MACRO(szName, pNetVoiceCodec->m_szGuid); + ADD_STRING_LINE_MACRO(szName, pNetVoiceCodec->m_szDescription); + ADD_UINT_LINE_MACRO(szName, pNetVoiceCodec->m_dwFlags); + ADD_UINT_LINE_MACRO(szName, pNetVoiceCodec->m_dwMaxBitsPerSecond); + +#ifdef _DEBUG + // debug check to make sure we display all the info from the object + // you do not need to worry about this. this is for my own verification only + if (nElementCount != pNetVoiceCodec->m_nElementCount) + OutputDebugStringW(L"**WARNING** -- not all elements from pNetVoiceCodec displayed\n"); +#endif + } +} + + + + +//----------------------------------------------------------------------------- +// Name: FillListBoxWithDirectShowInfo() +// Desc: +//----------------------------------------------------------------------------- +VOID FillListBoxWithDirectShowInfo(HWND hwndList) +{ + CDxDiagInfo* pDxDiag = g_pDxDiagInfo; + WCHAR szTmp[3000]; + + if (pDxDiag->m_pShowInfo == nullptr) + return; + + ShowFilterInfo* pShowFilterInfo; + for (auto iter = pDxDiag->m_pShowInfo->m_vShowFilters.begin(); iter != pDxDiag->m_pShowInfo->m_vShowFilters.end(); + iter++) + { + pShowFilterInfo = *iter; + WCHAR* szName = pShowFilterInfo->m_szName; + DWORD nElementCount = 0; + + ADD_STRING_LINE_MACRO(szName, pShowFilterInfo->m_szName); + ADD_STRING_LINE_MACRO(szName, pShowFilterInfo->m_szVersion); + ADD_STRING_LINE_MACRO(szName, pShowFilterInfo->m_ClsidFilter); + ADD_STRING_LINE_MACRO(szName, pShowFilterInfo->m_szFileName); + ADD_STRING_LINE_MACRO(szName, pShowFilterInfo->m_szFileVersion); + ADD_STRING_LINE_MACRO(szName, pShowFilterInfo->m_szCatName); + ADD_STRING_LINE_MACRO(szName, pShowFilterInfo->m_ClsidCat); + ADD_UINT_LINE_MACRO(szName, pShowFilterInfo->m_dwInputs); + ADD_UINT_LINE_MACRO(szName, pShowFilterInfo->m_dwOutputs); + ADD_UINT_LINE_MACRO(szName, pShowFilterInfo->m_dwMerit); + +#ifdef _DEBUG + // debug check to make sure we display all the info from the object + // you do not need to worry about this. this is for my own verification only + if (nElementCount != pShowFilterInfo->m_nElementCount) + OutputDebugStringW(L"**WARNING** -- not all elements from pShowFilterInfo displayed\n"); +#endif + } +} + + + + +//----------------------------------------------------------------------------- +// Name: AddString() +// Desc: +//----------------------------------------------------------------------------- +VOID AddString(HWND hwndList, WCHAR* szKey, WCHAR* szName, WCHAR* szValue) +{ + LV_ITEM item; + LONG iSubItem; + iSubItem = 0; + item.mask = LVIF_TEXT | LVIF_STATE; + item.iItem = ListView_GetItemCount(hwndList); + item.stateMask = 0xffff; + item.state = 0; + + item.iSubItem = iSubItem++; + item.pszText = szKey; + if (-1 == ListView_InsertItem(hwndList, &item)) + return; + + item.iSubItem = iSubItem++; + item.pszText = szName; + if (-1 == ListView_SetItem(hwndList, &item)) + return; + + item.iSubItem = iSubItem++; + item.pszText = szValue; + if (-1 == ListView_SetItem(hwndList, &item)) + return; +} + + + + +//----------------------------------------------------------------------------- +// Name: AddExpandedString() +// Desc: +//----------------------------------------------------------------------------- +VOID AddExpandedString(HWND hwndList, WCHAR* szKey, WCHAR* szName, WCHAR* szValue) +{ + WCHAR szBuffer[1024 * 7]; + wcsncpy(szBuffer, szValue, 1024 * 7); + szBuffer[1024 * 7 - 1] = 0; + + WCHAR* pEndOfLine; + WCHAR* pCurrent = szBuffer; + WCHAR* pStartOfNext; + + pEndOfLine = wcschr(pCurrent, L'\r'); + if (pEndOfLine == nullptr) + { + AddString(hwndList, szKey, szName, pCurrent); + return; + } + + for (; ; ) + { + *pEndOfLine = 0; + pStartOfNext = pEndOfLine + 2; + + AddString(hwndList, szKey, szName, pCurrent); + + // Advance current + pCurrent = pStartOfNext; + + // Look for the end of the next, and stop if there's no more + pEndOfLine = wcschr(pStartOfNext, L'\r'); + if (pEndOfLine == nullptr) + break; + } +} + + + diff --git a/DxDiag/DxDiagReport/musinfo.h b/DxDiag/DxDiagReport/musinfo.h new file mode 100644 index 00000000..5a384661 --- /dev/null +++ b/DxDiag/DxDiagReport/musinfo.h @@ -0,0 +1,43 @@ +//---------------------------------------------------------------------------- +// File: musinfo.h +// +// Desc: +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License (MIT) +//----------------------------------------------------------------------------- +#pragma once + +struct MusicPort +{ + WCHAR m_szGuid[300]; + BOOL m_bSoftware; + BOOL m_bKernelMode; + BOOL m_bUsesDLS; + BOOL m_bExternal; + DWORD m_dwMaxAudioChannels; + DWORD m_dwMaxChannelGroups; + BOOL m_bDefaultPort; + BOOL m_bOutputPort; + WCHAR m_szDescription[300]; + + DWORD m_nElementCount; +}; + +struct MusicInfo +{ + BOOL m_bDMusicInstalled; + WCHAR m_szGMFilePath[MAX_PATH]; + WCHAR m_szGMFileVersion[100]; + BOOL m_bAccelerationEnabled; + BOOL m_bAccelerationExists; + + WCHAR m_szNotesLocalized[3000]; + WCHAR m_szNotesEnglish[3000]; + WCHAR m_szRegHelpText[3000]; + WCHAR m_szTestResultLocalized[3000]; + WCHAR m_szTestResultEnglish[3000]; + + std::vector m_vMusicPorts; + DWORD m_nElementCount; +}; diff --git a/DxDiag/DxDiagReport/netinfo.h b/DxDiag/DxDiagReport/netinfo.h new file mode 100644 index 00000000..93c83904 --- /dev/null +++ b/DxDiag/DxDiagReport/netinfo.h @@ -0,0 +1,91 @@ +//---------------------------------------------------------------------------- +// File: netinfo.h +// +// Desc: +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License (MIT) +//----------------------------------------------------------------------------- +#pragma once + +struct NetSP +{ + WCHAR m_szNameLocalized[200]; + WCHAR m_szNameEnglish[200]; + WCHAR m_szGuid[100]; + WCHAR m_szFile[100]; + WCHAR m_szPath[MAX_PATH]; + WCHAR m_szVersionLocalized[50]; + WCHAR m_szVersionEnglish[50]; + BOOL m_bRegistryOK; + BOOL m_bProblem; + BOOL m_bFileMissing; + BOOL m_bInstalled; + DWORD m_dwDXVer; + + DWORD m_nElementCount; +}; + +struct NetAdapter +{ + WCHAR m_szAdapterName[200]; + WCHAR m_szSPNameEnglish[200]; + WCHAR m_szSPNameLocalized[200]; + WCHAR m_szGuid[100]; + DWORD m_dwFlags; + + DWORD m_nElementCount; +}; + +struct NetApp +{ + WCHAR m_szName[200]; + WCHAR m_szGuid[100]; + WCHAR m_szExeFile[100]; + WCHAR m_szExePath[MAX_PATH]; + WCHAR m_szExeVersionLocalized[50]; + WCHAR m_szExeVersionEnglish[50]; + WCHAR m_szLauncherFile[100]; + WCHAR m_szLauncherPath[MAX_PATH]; + WCHAR m_szLauncherVersionLocalized[50]; + WCHAR m_szLauncherVersionEnglish[50]; + BOOL m_bRegistryOK; + BOOL m_bProblem; + BOOL m_bFileMissing; + DWORD m_dwDXVer; + + DWORD m_nElementCount; +}; + +struct NetVoiceCodec +{ + WCHAR m_szName[200]; + WCHAR m_szGuid[100]; + WCHAR m_szDescription[500]; + DWORD m_dwFlags; + DWORD m_dwMaxBitsPerSecond; + + DWORD m_nElementCount; +}; + +struct NetInfo +{ + WCHAR m_szNetworkNotesLocalized[3000]; // DirectX file notes (localized) + WCHAR m_szNetworkNotesEnglish[3000]; // DirectX file notes (english) + WCHAR m_szRegHelpText[3000]; + WCHAR m_szTestResultLocalized[3000]; + WCHAR m_szTestResultEnglish[3000]; + WCHAR m_szVoiceWizardFullDuplexTestLocalized[200]; + WCHAR m_szVoiceWizardHalfDuplexTestLocalized[200]; + WCHAR m_szVoiceWizardMicTestLocalized[200]; + WCHAR m_szVoiceWizardFullDuplexTestEnglish[200]; + WCHAR m_szVoiceWizardHalfDuplexTestEnglish[200]; + WCHAR m_szVoiceWizardMicTestEnglish[200]; + + std::vector m_vNetSPs; + std::vector m_vNetApps; + std::vector m_vNetVoiceCodecs; + std::vector m_vNetAdapters; + DWORD m_nElementCount; +}; + diff --git a/DxDiag/DxDiagReport/resource.h b/DxDiag/DxDiagReport/resource.h new file mode 100644 index 00000000..a9f01530 --- /dev/null +++ b/DxDiag/DxDiagReport/resource.h @@ -0,0 +1,19 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by DxDiagReport.rc +// +#define IDI_MAIN 130 +#define IDD_MAIN 131 +#define IDC_LIST 1145 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NO_MFC 1 +#define _APS_NEXT_RESOURCE_VALUE 132 +#define _APS_NEXT_COMMAND_VALUE 40003 +#define _APS_NEXT_CONTROL_VALUE 1146 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/DxDiag/DxDiagReport/showinfo.h b/DxDiag/DxDiagReport/showinfo.h new file mode 100644 index 00000000..e7ab6baf --- /dev/null +++ b/DxDiag/DxDiagReport/showinfo.h @@ -0,0 +1,30 @@ +//---------------------------------------------------------------------------- +// File: showinfo.h +// +// Desc: +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License (MIT) +//----------------------------------------------------------------------------- +#pragma once + +struct ShowFilterInfo +{ + WCHAR m_szName[1024]; // friendly name + WCHAR m_szVersion[32]; // version + WCHAR m_ClsidFilter[300]; // guid + WCHAR m_szFileName[MAX_PATH]; // file name + WCHAR m_szFileVersion[32]; // file version + WCHAR m_szCatName[1024]; // category name + WCHAR m_ClsidCat[300]; // category guid + DWORD m_dwInputs; // number input pins + DWORD m_dwOutputs; // number output pins + DWORD m_dwMerit; // merit - in hex + + DWORD m_nElementCount; +}; + +struct ShowInfo +{ + std::vector m_vShowFilters; +}; diff --git a/DxDiag/DxDiagReport/sndinfo.h b/DxDiag/DxDiagReport/sndinfo.h new file mode 100644 index 00000000..45613ff1 --- /dev/null +++ b/DxDiag/DxDiagReport/sndinfo.h @@ -0,0 +1,102 @@ +//---------------------------------------------------------------------------- +// File: sndinfo.h +// +// Desc: +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License (MIT). +//----------------------------------------------------------------------------- +#pragma once + +struct SoundInfo +{ + DWORD m_dwDevnode; + WCHAR m_szGuidDeviceID[100]; + WCHAR m_szHardwareID[200]; + WCHAR m_szRegKey[200]; + WCHAR m_szManufacturerID[100]; + WCHAR m_szProductID[100]; + WCHAR m_szDescription[200]; + WCHAR m_szDriverName[200]; + WCHAR m_szDriverPath[MAX_PATH + 1]; + WCHAR m_szDriverVersion[100]; + WCHAR m_szDriverLanguageEnglish[100]; + WCHAR m_szDriverLanguageLocalized[100]; + WCHAR m_szDriverAttributes[100]; + WCHAR m_szDriverDateEnglish[60]; + WCHAR m_szDriverDateLocalized[60]; + WCHAR m_szOtherDrivers[200]; + WCHAR m_szProvider[200]; + WCHAR m_szType[100]; // Emulated / vxd / wdm + LONG m_lNumBytes; + BOOL m_bDriverBeta; + BOOL m_bDriverDebug; + BOOL m_bDriverSigned; + BOOL m_bDriverSignedValid; + LONG m_lAccelerationLevel; + DWORD m_dwSpeakerConfig; + + BOOL m_bDefaultSoundPlayback; + BOOL m_bDefaultVoicePlayback; + BOOL m_bVoiceManager; + BOOL m_bEAX20Listener; + BOOL m_bEAX20Source; + BOOL m_bI3DL2Listener; + BOOL m_bI3DL2Source; + BOOL m_bZoomFX; + + DWORD m_dwFlags; + DWORD m_dwMinSecondarySampleRate; + DWORD m_dwMaxSecondarySampleRate; + DWORD m_dwPrimaryBuffers; + DWORD m_dwMaxHwMixingAllBuffers; + DWORD m_dwMaxHwMixingStaticBuffers; + DWORD m_dwMaxHwMixingStreamingBuffers; + DWORD m_dwFreeHwMixingAllBuffers; + DWORD m_dwFreeHwMixingStaticBuffers; + DWORD m_dwFreeHwMixingStreamingBuffers; + DWORD m_dwMaxHw3DAllBuffers; + DWORD m_dwMaxHw3DStaticBuffers; + DWORD m_dwMaxHw3DStreamingBuffers; + DWORD m_dwFreeHw3DAllBuffers; + DWORD m_dwFreeHw3DStaticBuffers; + DWORD m_dwFreeHw3DStreamingBuffers; + DWORD m_dwTotalHwMemBytes; + DWORD m_dwFreeHwMemBytes; + DWORD m_dwMaxContigFreeHwMemBytes; + DWORD m_dwUnlockTransferRateHwBuffers; + DWORD m_dwPlayCpuOverheadSwBuffers; + + WCHAR m_szNotesLocalized[3000]; + WCHAR m_szNotesEnglish[3000]; + WCHAR m_szRegHelpText[3000]; + WCHAR m_szTestResultLocalized[3000]; + WCHAR m_szTestResultEnglish[3000]; + + DWORD m_nElementCount; +}; + +struct SoundCaptureInfo +{ + WCHAR m_szDescription[200]; + WCHAR m_szGuidDeviceID[100]; + WCHAR m_szDriverName[200]; + WCHAR m_szDriverPath[MAX_PATH + 1]; + WCHAR m_szDriverVersion[100]; + WCHAR m_szDriverLanguageEnglish[100]; + WCHAR m_szDriverLanguageLocalized[100]; + WCHAR m_szDriverAttributes[100]; + WCHAR m_szDriverDateEnglish[60]; + WCHAR m_szDriverDateLocalized[60]; + LONG m_lNumBytes; + BOOL m_bDriverBeta; + BOOL m_bDriverDebug; + + BOOL m_bDefaultSoundRecording; + BOOL m_bDefaultVoiceRecording; + + DWORD m_dwFlags; + DWORD m_dwFormats; + + DWORD m_nElementCount; +}; diff --git a/DxDiag/DxDiagReport/sysinfo.h b/DxDiag/DxDiagReport/sysinfo.h new file mode 100644 index 00000000..b39e94bc --- /dev/null +++ b/DxDiag/DxDiagReport/sysinfo.h @@ -0,0 +1,111 @@ +//---------------------------------------------------------------------------- +// File: sysinfo.h +// +// Desc: +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License (MIT). +//----------------------------------------------------------------------------- +#pragma once + +struct LogicalDisk +{ + WCHAR m_szDriveLetter[64]; + WCHAR m_szFreeSpace[128]; + WCHAR m_szMaxSpace[128]; + WCHAR m_szFileSystem[128]; + WCHAR m_szModel[512]; + WCHAR m_szPNPDeviceID[512]; + DWORD m_dwHardDriveIndex; + std::vector m_vDriverList; + + DWORD m_nElementCount; +}; + +struct SystemDevice +{ + WCHAR m_szDescription[500]; + WCHAR m_szDeviceID[300]; + std::vector m_vDriverList; + + DWORD m_nElementCount; +}; + +struct CPUExtendedFunctionBitmask +{ + DWORD dwBits0_31; + DWORD dwBits32_63; + DWORD dwBits64_95; + DWORD dwBits96_127; +}; + +struct SysInfo +{ + DWORD m_dwOSMajorVersion; // OS major version + DWORD m_dwOSMinorVersion; // OS minor version + DWORD m_dwOSBuildNumber; // OS build number + DWORD m_dwOSPlatformID; // OS platform id + DWORD m_dwDirectXVersionMajor; // DirectX major version (ex. 8) -- info in m_szDirectXVersion* + DWORD m_dwDirectXVersionMinor; // DirectX minor version (ex. 1) -- info in m_szDirectXVersion* + WCHAR m_szDirectXVersionLetter[2]; // DirectX letter version (ex. a) -- info in m_szDirectXVersion* + BOOL m_bDebug; // debug version of user.exe -- info in m_szOSEx* + BOOL m_bNECPC98; // info in m_szMachineName* + DWORDLONG m_ullPhysicalMemory; // info in m_szPageFile* + DWORDLONG m_ullUsedPageFile; // info in m_szPageFile* + DWORDLONG m_ullAvailPageFile; // info in m_szPageFile* + BOOL m_bNetMeetingRunning; // info in DX file notes + + BOOL m_bIsD3D8DebugRuntimeAvailable; + BOOL m_bIsD3DDebugRuntime; + BOOL m_bIsDInput8DebugRuntimeAvailable; + BOOL m_bIsDInput8DebugRuntime; + BOOL m_bIsDMusicDebugRuntimeAvailable; + BOOL m_bIsDMusicDebugRuntime; + BOOL m_bIsDDrawDebugRuntime; + BOOL m_bIsDPlayDebugRuntime; + BOOL m_bIsDSoundDebugRuntime; + + LONG m_nD3DDebugLevel; + LONG m_nDDrawDebugLevel; + LONG m_nDIDebugLevel; + LONG m_nDMusicDebugLevel; + LONG m_nDPlayDebugLevel; + LONG m_nDSoundDebugLevel; + LONG m_nDShowDebugLevel; + + // English only or un-localizable strings + WCHAR m_szWindowsDir[MAX_PATH]; // location of windows dir + WCHAR m_szBuildLab[100]; // Win2k build lab (not localizable) + WCHAR m_szDxDiagVersion[100]; // DxDiag version (not localizable) + WCHAR m_szSetupParamEnglish[100]; // setup params (English) + WCHAR m_szProcessorEnglish[200]; // Processor name and speed (english) + WCHAR m_szSystemManufacturerEnglish[200]; // System manufacturer (english) + WCHAR m_szSystemModelEnglish[200]; // System model (english) + WCHAR m_szBIOSEnglish[200]; // BIOS (english) + WCHAR m_szPhysicalMemoryEnglish[100]; // Formatted version of physical memory (english) + WCHAR m_szCSDVersion[200]; // OS version with CSD info (localized) + WCHAR m_szDirectXVersionEnglish[100]; // DirectX version (english) + WCHAR m_szDirectXVersionLongEnglish[100]; // long DirectX version (english) + + // strings localized to OS language + WCHAR m_szMachineNameLocalized[200]; // machine name + WCHAR m_szOSLocalized[100]; // Formatted version of platform (localized) + WCHAR m_szOSExLocalized[100]; // Formatted version of platform, version, build num (localized) + WCHAR m_szOSExLongLocalized[300]; // Formatted version of platform, version, build num, patch, lab (localized) + WCHAR m_szLanguagesLocalized[200]; // m_szLanguages, in local language (localized) + WCHAR m_szPageFileLocalized[100]; // Formatted version of pagefile (localized) + WCHAR m_szTimeLocalized[100]; // Date/time, localized for UI (localized) + + // strings localized to english + WCHAR m_szMachineNameEnglish[200]; // machine name + WCHAR m_szOSEnglish[100]; // Formatted version of platform (english) + WCHAR m_szOSExEnglish[100]; // Formatted version of platform, version, build num (english) + WCHAR m_szOSExLongEnglish[300]; // Formatted version of platform, version, build num, patch, lab (english) + WCHAR m_szLanguagesEnglish[200]; // Formatted version of m_szLanguage, m_szLanguageRegional (english) + WCHAR m_szPageFileEnglish[100]; // Formatted version of pagefile (english) + WCHAR m_szTimeEnglish[100]; // Date/time, dd/mm/yyyy hh:mm:ss for saved report (english) + + CPUExtendedFunctionBitmask m_ExtFuncBitmasks[16]; // 128-bit CPU Extended Function Bitmasks (array of 16-byte structs) + + DWORD m_nElementCount; +};