Module: wine Branch: master Commit: 097a31bb215de0350065415f7d12bc5479a9091d URL: http://source.winehq.org/git/wine.git/?a=commit;h=097a31bb215de0350065415f7d...
Author: Andrew Nguyen anguyen@codeweavers.com Date: Sun Apr 3 20:56:07 2011 -0500
dxdiagn: Add operating system string properties to the DxDiag_SystemInfo container.
---
dlls/dxdiagn/provider.c | 32 ++++++++++++++++++++++++++++++++ dlls/dxdiagn/tests/container.c | 12 ++++++++++++ 2 files changed, 44 insertions(+), 0 deletions(-)
diff --git a/dlls/dxdiagn/provider.c b/dlls/dxdiagn/provider.c index 1252272..459f8e9 100644 --- a/dlls/dxdiagn/provider.c +++ b/dlls/dxdiagn/provider.c @@ -511,6 +511,34 @@ static HRESULT fill_datetime_information(IDxDiagContainerImpl_Container *node) 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 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)) return hr;
+ hr = fill_os_string_information(node, &info); + if (FAILED(hr)) + return hr; + return S_OK; }
diff --git a/dlls/dxdiagn/tests/container.c b/dlls/dxdiagn/tests/container.c index 2b8d6f6..6de80e7 100644 --- a/dlls/dxdiagn/tests/container.c +++ b/dlls/dxdiagn/tests/container.c @@ -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 szPageFileLocalized[] = {'s','z','P','a','g','e','F','i','l','e','L','o','c','a','l','i','z','e','d',0}; static const WCHAR szPageFileEnglish[] = {'s','z','P','a','g','e','F','i','l','e','E','n','g','l','i','s','h',0}; + static const WCHAR szOSLocalized[] = {'s','z','O','S','L','o','c','a','l','i','z','e','d',0}; + static const WCHAR szOSExLocalized[] = {'s','z','O','S','E','x','L','o','c','a','l','i','z','e','d',0}; + static const WCHAR szOSExLongLocalized[] = {'s','z','O','S','E','x','L','o','n','g','L','o','c','a','l','i','z','e','d',0}; + static const WCHAR szOSEnglish[] = {'s','z','O','S','E','n','g','l','i','s','h',0}; + static const WCHAR szOSExEnglish[] = {'s','z','O','S','E','x','E','n','g','l','i','s','h',0}; + static const WCHAR szOSExLongEnglish[] = {'s','z','O','S','E','x','L','o','n','g','E','n','g','l','i','s','h',0};
static const struct { @@ -824,6 +830,12 @@ static void test_DxDiag_SystemInfo(void) {szPhysicalMemoryEnglish, VT_BSTR}, {szPageFileLocalized, VT_BSTR}, {szPageFileEnglish, VT_BSTR}, + {szOSLocalized, VT_BSTR}, + {szOSExLocalized, VT_BSTR}, + {szOSExLongLocalized, VT_BSTR}, + {szOSEnglish, VT_BSTR}, + {szOSExEnglish, VT_BSTR}, + {szOSExLongEnglish, VT_BSTR}, };
HRESULT hr;