dxdiagn: Add operating system string properties to the DxDiag_SystemInfo container.

This commit is contained in:
Andrew Nguyen 2011-04-03 20:56:07 -05:00 committed by Alexandre Julliard
parent ca854b82cf
commit 097a31bb21
2 changed files with 44 additions and 0 deletions

View File

@ -511,6 +511,34 @@ static HRESULT fill_datetime_information(IDxDiagContainerImpl_Container *node)
return S_OK; return S_OK;
} }
static HRESULT fill_os_string_information(IDxDiagContainerImpl_Container *node, OSVERSIONINFOW *info)
{
static const WCHAR winxpW[] = {'W','i','n','d','o','w','s',' ','X','P',' ','P','r','o','f','e','s','s','i','o','n','a','l',0};
static const WCHAR szOSLocalized[] = {'s','z','O','S','L','o','c','a','l','i','z','e','d',0};
static const WCHAR szOSExLocalized[] = {'s','z','O','S','E','x','L','o','c','a','l','i','z','e','d',0};
static const WCHAR szOSExLongLocalized[] = {'s','z','O','S','E','x','L','o','n','g','L','o','c','a','l','i','z','e','d',0};
static const WCHAR szOSEnglish[] = {'s','z','O','S','E','n','g','l','i','s','h',0};
static const WCHAR szOSExEnglish[] = {'s','z','O','S','E','x','E','n','g','l','i','s','h',0};
static const WCHAR szOSExLongEnglish[] = {'s','z','O','S','E','x','L','o','n','g','E','n','g','l','i','s','h',0};
static const WCHAR *prop_list[] = {szOSLocalized, szOSExLocalized, szOSExLongLocalized,
szOSEnglish, szOSExEnglish, szOSExLongEnglish};
size_t i;
HRESULT hr;
/* FIXME: OS detection should be performed, and localized OS strings
* should contain translated versions of the "build" phrase. */
for (i = 0; i < sizeof(prop_list)/sizeof(prop_list[0]); i++)
{
hr = add_bstr_property(node, prop_list[i], winxpW);
if (FAILED(hr))
return hr;
}
return S_OK;
}
static HRESULT build_systeminfo_tree(IDxDiagContainerImpl_Container *node) static HRESULT build_systeminfo_tree(IDxDiagContainerImpl_Container *node)
{ {
static const WCHAR dwDirectXVersionMajor[] = {'d','w','D','i','r','e','c','t','X','V','e','r','s','i','o','n','M','a','j','o','r',0}; static const WCHAR dwDirectXVersionMajor[] = {'d','w','D','i','r','e','c','t','X','V','e','r','s','i','o','n','M','a','j','o','r',0};
@ -665,6 +693,10 @@ static HRESULT build_systeminfo_tree(IDxDiagContainerImpl_Container *node)
if (FAILED(hr)) if (FAILED(hr))
return hr; return hr;
hr = fill_os_string_information(node, &info);
if (FAILED(hr))
return hr;
return S_OK; return S_OK;
} }

View File

@ -791,6 +791,12 @@ static void test_DxDiag_SystemInfo(void)
static const WCHAR szPhysicalMemoryEnglish[] = {'s','z','P','h','y','s','i','c','a','l','M','e','m','o','r','y','E','n','g','l','i','s','h',0}; static const WCHAR szPhysicalMemoryEnglish[] = {'s','z','P','h','y','s','i','c','a','l','M','e','m','o','r','y','E','n','g','l','i','s','h',0};
static const WCHAR szPageFileLocalized[] = {'s','z','P','a','g','e','F','i','l','e','L','o','c','a','l','i','z','e','d',0}; static const WCHAR szPageFileLocalized[] = {'s','z','P','a','g','e','F','i','l','e','L','o','c','a','l','i','z','e','d',0};
static const WCHAR szPageFileEnglish[] = {'s','z','P','a','g','e','F','i','l','e','E','n','g','l','i','s','h',0}; static const WCHAR szPageFileEnglish[] = {'s','z','P','a','g','e','F','i','l','e','E','n','g','l','i','s','h',0};
static const WCHAR szOSLocalized[] = {'s','z','O','S','L','o','c','a','l','i','z','e','d',0};
static const WCHAR szOSExLocalized[] = {'s','z','O','S','E','x','L','o','c','a','l','i','z','e','d',0};
static const WCHAR szOSExLongLocalized[] = {'s','z','O','S','E','x','L','o','n','g','L','o','c','a','l','i','z','e','d',0};
static const WCHAR szOSEnglish[] = {'s','z','O','S','E','n','g','l','i','s','h',0};
static const WCHAR szOSExEnglish[] = {'s','z','O','S','E','x','E','n','g','l','i','s','h',0};
static const WCHAR szOSExLongEnglish[] = {'s','z','O','S','E','x','L','o','n','g','E','n','g','l','i','s','h',0};
static const struct static const struct
{ {
@ -824,6 +830,12 @@ static void test_DxDiag_SystemInfo(void)
{szPhysicalMemoryEnglish, VT_BSTR}, {szPhysicalMemoryEnglish, VT_BSTR},
{szPageFileLocalized, VT_BSTR}, {szPageFileLocalized, VT_BSTR},
{szPageFileEnglish, VT_BSTR}, {szPageFileEnglish, VT_BSTR},
{szOSLocalized, VT_BSTR},
{szOSExLocalized, VT_BSTR},
{szOSExLongLocalized, VT_BSTR},
{szOSEnglish, VT_BSTR},
{szOSExEnglish, VT_BSTR},
{szOSExLongEnglish, VT_BSTR},
}; };
HRESULT hr; HRESULT hr;