dxdiagn: Add a physical memory display string property to the DxDiag_SystemInfo container.

oldstable
Andrew Nguyen 2011-04-03 20:55:58 -05:00 committed by Alexandre Julliard
parent bd7ad13bb3
commit 791aa53839
2 changed files with 12 additions and 1 deletions

View File

@ -533,14 +533,17 @@ static HRESULT build_systeminfo_tree(IDxDiagContainerImpl_Container *node)
static const WCHAR dwOSBuildNumber[] = {'d','w','O','S','B','u','i','l','d','N','u','m','b','e','r',0};
static const WCHAR dwOSPlatformID[] = {'d','w','O','S','P','l','a','t','f','o','r','m','I','D',0};
static const WCHAR szCSDVersion[] = {'s','z','C','S','D','V','e','r','s','i','o','n',0};
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 szMachineNameLocalized[] = {'s','z','M','a','c','h','i','n','e','N','a','m','e','L','o','c','a','l','i','z','e','d',0};
static const WCHAR szMachineNameEnglish[] = {'s','z','M','a','c','h','i','n','e','N','a','m','e','E','n','g','l','i','s','h',0};
static const WCHAR physmem_fmtW[] = {'%','u','M','B',' ','R','A','M',0};
HRESULT hr;
MEMORYSTATUSEX msex;
OSVERSIONINFOW info;
DWORD count;
WCHAR buffer[MAX_PATH], computer_name[MAX_COMPUTERNAME_LENGTH + 1];
WCHAR buffer[MAX_PATH], computer_name[MAX_COMPUTERNAME_LENGTH + 1], print_buf[200];
hr = add_ui4_property(node, dwDirectXVersionMajor, 9);
if (FAILED(hr))
@ -612,6 +615,12 @@ static HRESULT build_systeminfo_tree(IDxDiagContainerImpl_Container *node)
if (FAILED(hr))
return hr;
/* FIXME: Roundoff should not be done with truncated division. */
snprintfW(print_buf, sizeof(print_buf)/sizeof(WCHAR), physmem_fmtW, (DWORD)(msex.ullTotalPhys / (1024 * 1024)));
hr = add_bstr_property(node, szPhysicalMemoryEnglish, print_buf);
if (FAILED(hr))
return hr;
GetWindowsDirectoryW(buffer, MAX_PATH);
hr = add_bstr_property(node, szWindowsDir, buffer);

View File

@ -788,6 +788,7 @@ static void test_DxDiag_SystemInfo(void)
static const WCHAR szLanguagesEnglish[] = {'s','z','L','a','n','g','u','a','g','e','s','E','n','g','l','i','s','h',0};
static const WCHAR szTimeLocalized[] = {'s','z','T','i','m','e','L','o','c','a','l','i','z','e','d',0};
static const WCHAR szTimeEnglish[] = {'s','z','T','i','m','e','E','n','g','l','i','s','h',0};
static const WCHAR szPhysicalMemoryEnglish[] = {'s','z','P','h','y','s','i','c','a','l','M','e','m','o','r','y','E','n','g','l','i','s','h',0};
static const struct
{
@ -818,6 +819,7 @@ static void test_DxDiag_SystemInfo(void)
{szLanguagesEnglish, VT_BSTR},
{szTimeLocalized, VT_BSTR},
{szTimeEnglish, VT_BSTR},
{szPhysicalMemoryEnglish, VT_BSTR},
};
HRESULT hr;