Author: janderwald
Date: Mon Apr 28 12:16:57 2008
New Revision: 33181
URL:
http://svn.reactos.org/svn/reactos?rev=33181&view=rev
Log:
- implement more details for display adapter page
- enlarge general details groupbox
Modified:
trunk/reactos/base/applications/dxdiag/display.c
trunk/reactos/base/applications/dxdiag/lang/de-DE.rc
trunk/reactos/base/applications/dxdiag/lang/en-US.rc
trunk/reactos/base/applications/dxdiag/lang/fr-FR.rc
trunk/reactos/base/applications/dxdiag/lang/pl-PL.rc
trunk/reactos/base/applications/dxdiag/lang/ru-RU.rc
trunk/reactos/base/applications/dxdiag/resource.h
trunk/reactos/base/applications/dxdiag/system.c
Modified: trunk/reactos/base/applications/dxdiag/display.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/dxdiag/d…
==============================================================================
--- trunk/reactos/base/applications/dxdiag/display.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/dxdiag/display.c [iso-8859-1] Mon Apr 28 12:16:57
2008
@@ -20,6 +20,70 @@
SP_DEVINFO_DATA InfoData;
DWORD dwIndex = 0;
WCHAR szText[100];
+ WCHAR szFormat[30];
+ HKEY hKey;
+ DWORD dwMemory;
+ DEVMODE DevMode;
+
+ DISPLAY_DEVICEW DispDevice;
+
+ /* query display device adapter */
+ ZeroMemory(&DispDevice, sizeof(DISPLAY_DEVICEW));
+ DispDevice.cb = sizeof(DISPLAY_DEVICEW);
+ if (!EnumDisplayDevicesW(NULL, 0, &DispDevice, 0))
+ return FALSE;
+
+ if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, &DispDevice.DeviceKey[18], 0, KEY_READ,
&hKey) != ERROR_SUCCESS)
+ return FALSE;
+
+ if (GetRegValue(hKey, NULL, L"HardwareInformation.ChipType", REG_BINARY,
szText, sizeof(szText)))
+ {
+ /* set chip type */
+ SendDlgItemMessageW(hwndDlg, IDC_STATIC_ADAPTER_CHIP, WM_SETTEXT, 0,
(LPARAM)szText);
+ }
+
+ if (GetRegValue(hKey, NULL, L"HardwareInformation.DacType", REG_BINARY,
szText, sizeof(szText)))
+ {
+ /* set DAC type */
+ SendDlgItemMessageW(hwndDlg, IDC_STATIC_ADAPTER_DAC, WM_SETTEXT, 0,
(LPARAM)szText);
+ }
+
+ if (GetRegValue(hKey, NULL, L"HardwareInformation.MemorySize", REG_BINARY,
&dwMemory, sizeof(dwMemory)))
+ {
+ /* set chip memory size */
+ if (dwMemory > (1048576))
+ {
+ /* buggy ATI driver requires that */
+ dwMemory /= 1048576;
+ }
+ szFormat[0] = L'\0';
+ if (LoadStringW(hInst, IDS_FORMAT_ADAPTER_MEM, szFormat,
sizeof(szFormat)/sizeof(WCHAR)))
+ szFormat[(sizeof(szFormat)/sizeof(WCHAR))-1] = L'\0';
+ swprintf(szText, szFormat, dwMemory);
+ SendDlgItemMessageW(hwndDlg, IDC_STATIC_ADAPTER_MEM, WM_SETTEXT, 0,
(LPARAM)szText);
+ }
+
+ /* retrieve current display mode */
+ DevMode.dmSize = sizeof(DEVMODE);
+ if (EnumDisplaySettingsW(DispDevice.DeviceName, ENUM_CURRENT_SETTINGS,
&DevMode))
+ {
+ szFormat[0] = L'\0';
+ if (LoadStringW(hInst, IDS_FORMAT_ADAPTER_MODE, szFormat,
sizeof(szFormat)/sizeof(WCHAR)))
+ szFormat[(sizeof(szFormat)/sizeof(WCHAR))-1] = L'\0';
+ swprintf(szText, szFormat, DevMode.dmPelsWidth, DevMode.dmPelsHeight,
DevMode.dmBitsPerPel, DevMode.dmDisplayFrequency);
+ SendDlgItemMessageW(hwndDlg, IDC_STATIC_ADAPTER_MODE, WM_SETTEXT, 0,
(LPARAM)szText);
+ }
+
+ /* query attached monitor */
+ wcscpy(szText, DispDevice.DeviceName);
+ ZeroMemory(&DispDevice, sizeof(DISPLAY_DEVICEW));
+ DispDevice.cb = sizeof(DISPLAY_DEVICEW);
+ if (EnumDisplayDevicesW(szText, 0, &DispDevice, 0))
+ {
+ /* set monitor name */
+ SendDlgItemMessageW(hwndDlg, IDC_STATIC_ADAPTER_MONITOR, WM_SETTEXT, 0,
(LPARAM)DispDevice.DeviceString);
+ }
+
hInfo = SetupDiGetClassDevsW(&GUID_DEVCLASS_DISPLAY, NULL, hwndDlg,
DIGCF_PRESENT|DIGCF_PROFILE);
if (hInfo == INVALID_HANDLE_VALUE)
@@ -37,11 +101,15 @@
if (SetupDiGetDeviceRegistryPropertyW(hInfo, &InfoData, SPDRP_DEVICEDESC,
NULL, (PBYTE)szText, sizeof(szText), NULL))
SendDlgItemMessageW(hwndDlg, IDC_STATIC_ADAPTER_ID, WM_SETTEXT, 0,
(LPARAM)szText);
+ /* set the manufacturer name */
+ if (SetupDiGetDeviceRegistryPropertyW(hInfo, &InfoData, SPDRP_MFG, NULL,
(PBYTE)szText, sizeof(szText), NULL))
+ SendDlgItemMessageW(hwndDlg, IDC_STATIC_ADAPTER_VENDOR, WM_SETTEXT, 0,
(LPARAM)szText);
+
+ /* FIXME
+ * we currently enumerate only the first adapter
+ */
+ break;
}
- /* FIXME
- * only enumerate the first display adapter
- */
- break;
if (GetLastError() == ERROR_NO_MORE_ITEMS)
break;
Modified: trunk/reactos/base/applications/dxdiag/lang/de-DE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/dxdiag/l…
==============================================================================
--- trunk/reactos/base/applications/dxdiag/lang/de-DE.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/dxdiag/lang/de-DE.rc [iso-8859-1] Mon Apr 28 12:16:57
2008
@@ -49,7 +49,7 @@
STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN
FONT 8, "MS Shell Dlg"
BEGIN
- GROUPBOX "Gerät", -1, 10, 10, 220, 100
+ GROUPBOX "Gerät", -1, 10, 10, 250, 100
RTEXT "Name:", -1, 20, 25, 70, 10
RTEXT "Hersteller:", -1, 20, 35, 70, 10
RTEXT "Chiptyp:", -1, 20, 45, 70, 10
@@ -57,29 +57,29 @@
RTEXT "Gesamtspeicher ca.:", -1, 20, 65, 70, 10
RTEXT "Anzeigemodus:", -1, 20, 75, 70, 10
RTEXT "Monitor:", -1, 20, 85, 70, 10
- LTEXT "", IDC_STATIC_ADAPTER_ID, 95, 25, 130, 10
- LTEXT "", IDC_STATIC_ADAPTER_VENDOR, 95, 35, 130, 10
- LTEXT "", IDC_STATIC_ADAPTER_CHIP, 95, 45, 130, 10
- LTEXT "", IDC_STATIC_ADAPTER_DAC, 95, 55, 130, 10
- LTEXT "", IDC_STATIC_ADAPTER_MEM, 95, 65, 130, 10
- LTEXT "", IDC_STATIC_ADAPTER_MODE, 95, 75, 130, 10
- LTEXT "", IDC_STATIC_ADAPTER_MONITOR, 95, 85, 130, 10
+ LTEXT "", IDC_STATIC_ADAPTER_ID, 95, 25, 150, 10
+ LTEXT "", IDC_STATIC_ADAPTER_VENDOR, 95, 35, 150, 10
+ LTEXT "", IDC_STATIC_ADAPTER_CHIP, 95, 45, 150, 10
+ LTEXT "", IDC_STATIC_ADAPTER_DAC, 95, 55, 150, 10
+ LTEXT "", IDC_STATIC_ADAPTER_MEM, 95, 65, 150, 10
+ LTEXT "", IDC_STATIC_ADAPTER_MODE, 95, 75, 150, 10
+ LTEXT "", IDC_STATIC_ADAPTER_MONITOR, 95, 85, 150, 10
- GROUPBOX "Treiber", -1, 240, 10, 220, 100
- RTEXT "Hauptreiber:", -1, 245, 30, 55, 10
- RTEXT "Version:", -1, 245, 40, 55, 10
- RTEXT "Datum:", -1, 245, 50, 55, 10
- RTEXT "Mit WHQL-Logo:", -1, 245, 60, 55, 10
- RTEXT "Mini-VDD:", -1, 245, 70, 55, 10
- RTEXT "VDD:", -1, 245, 80, 55, 10
- RTEXT "DDI-Version:", -1, 245, 90, 55, 10
- LTEXT "", IDC_STATIC_ADAPTER_DRIVER, 305, 30, 130, 10
- LTEXT "", IDC_STATIC_ADAPTER_VERSION, 305, 40, 130, 10
- LTEXT "", IDC_STATIC_ADAPTER_DATE, 305, 50, 130, 10
- LTEXT "", IDC_STATIC_ADAPTER_LOGO, 305, 60, 130, 10
- LTEXT "", IDC_STATIC_ADAPTER_MINIVDD, 305, 70, 130, 10
- LTEXT "", IDC_STATIC_ADAPTER_VDD, 305, 80, 130, 10
- LTEXT "", IDC_STATIC_ADAPTER_DDI, 305, 90, 130, 10
+ GROUPBOX "Treiber", -1, 270, 10, 220, 100
+ RTEXT "Hauptreiber:", -1, 275, 25, 55, 10
+ RTEXT "Version:", -1, 275, 35, 55, 10
+ RTEXT "Datum:", -1, 275, 45, 55, 10
+ RTEXT "Mit WHQL-Logo:", -1, 275, 55, 55, 10
+ RTEXT "Mini-VDD:", -1, 275, 65, 55, 10
+ RTEXT "VDD:", -1, 275, 75, 55, 10
+ RTEXT "DDI-Version:", -1, 275, 85, 55, 10
+ LTEXT "", IDC_STATIC_ADAPTER_DRIVER, 335, 25, 100, 10
+ LTEXT "", IDC_STATIC_ADAPTER_VERSION, 335, 35, 100, 10
+ LTEXT "", IDC_STATIC_ADAPTER_DATE, 335, 45, 100, 10
+ LTEXT "", IDC_STATIC_ADAPTER_LOGO, 335, 55, 100, 10
+ LTEXT "", IDC_STATIC_ADAPTER_MINIVDD, 335, 65, 100, 10
+ LTEXT "", IDC_STATIC_ADAPTER_VDD, 335, 75, 100, 10
+ LTEXT "", IDC_STATIC_ADAPTER_DDI, 335, 85, 100, 10
GROUPBOX "ReactX-Funktionen", -1, 10, 115, 450, 60
RTEXT "DirectDraw-Beschleunigung:", -1, 15, 130, 110, 12
@@ -186,4 +186,6 @@
IDS_DDOFFSCREEN_RESULT "Did you see white moving reactangle?"
IDS_DDFULLSCREEN_DESCRIPTION "This test will use DirectDraw to draw in a fullscreen
mode. Moving white rectangle should be drawn. Continue?"
IDS_DDFULLSCREEN_RESULT "Did you see white moving reactangle in a fullscreen
mode?"
+ IDS_FORMAT_ADAPTER_MEM "%u MB"
+ IDS_FORMAT_ADAPTER_MODE "%04u x %04u (%u bit)(%uHz)"
END
Modified: trunk/reactos/base/applications/dxdiag/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/dxdiag/l…
==============================================================================
--- trunk/reactos/base/applications/dxdiag/lang/en-US.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/dxdiag/lang/en-US.rc [iso-8859-1] Mon Apr 28 12:16:57
2008
@@ -49,7 +49,7 @@
STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN
FONT 8, "MS Shell Dlg"
BEGIN
- GROUPBOX "Device", -1, 10, 10, 220, 100
+ GROUPBOX "Device", -1, 10, 10, 250, 100
RTEXT "Name:", -1, 20, 25, 70, 10
RTEXT "Manufacturer:", -1, 20, 35, 70, 10
RTEXT "Chip Type:", -1, 20, 45, 70, 10
@@ -57,29 +57,29 @@
RTEXT "Approx. Total Memory:", -1, 20, 65, 70, 10
RTEXT "Current Display Mode:", -1, 20, 75, 70, 10
RTEXT "Monitor:", -1, 20, 85, 70, 10
- LTEXT "", IDC_STATIC_ADAPTER_ID, 95, 25, 130, 10
- LTEXT "", IDC_STATIC_ADAPTER_VENDOR, 95, 35, 130, 10
- LTEXT "", IDC_STATIC_ADAPTER_CHIP, 95, 45, 130, 10
- LTEXT "", IDC_STATIC_ADAPTER_DAC, 95, 55, 130, 10
- LTEXT "", IDC_STATIC_ADAPTER_MEM, 95, 65, 130, 10
- LTEXT "", IDC_STATIC_ADAPTER_MODE, 95, 75, 130, 10
- LTEXT "", IDC_STATIC_ADAPTER_MONITOR, 95, 85, 130, 10
+ LTEXT "", IDC_STATIC_ADAPTER_ID, 95, 25, 150, 10
+ LTEXT "", IDC_STATIC_ADAPTER_VENDOR, 95, 35, 150, 10
+ LTEXT "", IDC_STATIC_ADAPTER_CHIP, 95, 45, 150, 10
+ LTEXT "", IDC_STATIC_ADAPTER_DAC, 95, 55, 150, 10
+ LTEXT "", IDC_STATIC_ADAPTER_MEM, 95, 65, 150, 10
+ LTEXT "", IDC_STATIC_ADAPTER_MODE, 95, 75, 150, 10
+ LTEXT "", IDC_STATIC_ADAPTER_MONITOR, 95, 85, 150, 10
- GROUPBOX "Driver", -1, 240, 10, 220, 100
- RTEXT "Main Driver:", -1, 245, 30, 55, 10
- RTEXT "Version:", -1, 245, 40, 55, 10
- RTEXT "Date:", -1, 245, 50, 55, 10
- RTEXT "WHQL-Logo:", -1, 245, 60, 55, 10
- RTEXT "Mini-VDD:", -1, 245, 70, 55, 10
- RTEXT " vvdddVDD:", -1, 245, 80, 55, 10
- RTEXT "DDI Version:", -1, 245, 90, 55, 10
- LTEXT "", IDC_STATIC_ADAPTER_DRIVER, 305, 30, 130, 10
- LTEXT "", IDC_STATIC_ADAPTER_VERSION, 305, 40, 130, 10
- LTEXT "", IDC_STATIC_ADAPTER_DATE, 305, 50, 130, 10
- LTEXT "", IDC_STATIC_ADAPTER_LOGO, 305, 60, 130, 10
- LTEXT "", IDC_STATIC_ADAPTER_MINIVDD, 305, 70, 130, 10
- LTEXT "", IDC_STATIC_ADAPTER_VDD, 305, 80, 130, 10
- LTEXT "", IDC_STATIC_ADAPTER_DDI, 305, 90, 130, 10
+ GROUPBOX "Driver", -1, 270, 10, 220, 100
+ RTEXT "Main Driver:", -1, 275, 25, 55, 10
+ RTEXT "Version:", -1, 275, 35, 55, 10
+ RTEXT "Date:", -1, 275, 45, 55, 10
+ RTEXT "WHQL-Logo:", -1, 275, 55, 55, 10
+ RTEXT "Mini-VDD:", -1, 275, 65, 55, 10
+ RTEXT " vvdddVDD:", -1, 275, 75, 55, 10
+ RTEXT "DDI Version:", -1, 275, 85, 55, 10
+ LTEXT "", IDC_STATIC_ADAPTER_DRIVER, 335, 35, 100, 10
+ LTEXT "", IDC_STATIC_ADAPTER_VERSION, 335, 35, 100, 10
+ LTEXT "", IDC_STATIC_ADAPTER_DATE, 335, 45, 100, 10
+ LTEXT "", IDC_STATIC_ADAPTER_LOGO, 335, 55, 100, 10
+ LTEXT "", IDC_STATIC_ADAPTER_MINIVDD, 335, 65, 100, 10
+ LTEXT "", IDC_STATIC_ADAPTER_VDD, 335, 75, 100, 10
+ LTEXT "", IDC_STATIC_ADAPTER_DDI, 335, 85, 100, 10
GROUPBOX "ReactX-Features", -1, 10, 115, 450, 60
RTEXT "DirectDraw Acceleration:", -1, 15, 130, 110, 12
@@ -186,4 +186,6 @@
IDS_DDOFFSCREEN_RESULT "Did you see white moving reactangle?"
IDS_DDFULLSCREEN_DESCRIPTION "This test will use DirectDraw to draw in a fullscreen
mode. Moving white rectangle should be drawn. Continue?"
IDS_DDFULLSCREEN_RESULT "Did you see white moving reactangle in a fullscreen
mode?"
+ IDS_FORMAT_ADAPTER_MEM "%u MB"
+ IDS_FORMAT_ADAPTER_MODE "%04u x %04u (%u bit)(%uHz)"
END
Modified: trunk/reactos/base/applications/dxdiag/lang/fr-FR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/dxdiag/l…
==============================================================================
--- trunk/reactos/base/applications/dxdiag/lang/fr-FR.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/dxdiag/lang/fr-FR.rc [iso-8859-1] Mon Apr 28 12:16:57
2008
@@ -186,4 +186,6 @@
IDS_DDOFFSCREEN_RESULT "Did you see white moving reactangle?"
IDS_DDFULLSCREEN_DESCRIPTION "This test will use DirectDraw to draw in a fullscreen
mode. Moving white rectangle should be drawn. Continue?"
IDS_DDFULLSCREEN_RESULT "Did you see white moving reactangle in a fullscreen
mode?"
+ IDS_FORMAT_ADAPTER_MEM "%u MB"
+ IDS_FORMAT_ADAPTER_MODE "%04u x %04u (%u bit)(%uHz)"
END
Modified: trunk/reactos/base/applications/dxdiag/lang/pl-PL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/dxdiag/l…
==============================================================================
--- trunk/reactos/base/applications/dxdiag/lang/pl-PL.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/dxdiag/lang/pl-PL.rc [iso-8859-1] Mon Apr 28 12:16:57
2008
@@ -193,4 +193,6 @@
IDS_DDOFFSCREEN_RESULT "Did you see white moving reactangle?"
IDS_DDFULLSCREEN_DESCRIPTION "This test will use DirectDraw to draw in a fullscreen
mode. Moving white rectangle should be drawn. Continue?"
IDS_DDFULLSCREEN_RESULT "Did you see white moving reactangle in a fullscreen
mode?"
+ IDS_FORMAT_ADAPTER_MEM "%u MB"
+ IDS_FORMAT_ADAPTER_MODE "%04u x %04u (%u bit)(%uHz)"
END
Modified: trunk/reactos/base/applications/dxdiag/lang/ru-RU.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/dxdiag/l…
==============================================================================
--- trunk/reactos/base/applications/dxdiag/lang/ru-RU.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/dxdiag/lang/ru-RU.rc [iso-8859-1] Mon Apr 28 12:16:57
2008
@@ -177,6 +177,7 @@
IDS_DIRECTPLAY_MODEMCONN "Modem Connection For DirectPlay"
IDS_DIRECTPLAY_SERIALCONN "Serial Connection For DirectPlay"
IDS_REG_SUCCESS "OK"
+ IDS_REG_FAIL "Îøèáêà"
IDS_DDTEST_ERROR "Ñáîé â ïðîâåðêå!"
IDS_DDTEST_DESCRIPTION "Áóäåò ïðîèçâåäåíà ïðîâåðêà DirecDraw íà ýòîì óñòðîéñòâå.
Ïðîäîëæèòü?"
IDS_DDPRIMARY_DESCRIPTION "This test will use DirectDraw to draw on primary
surface. Black and white rectangles should be drawn. Continue?"
@@ -185,5 +186,6 @@
IDS_DDOFFSCREEN_RESULT "Did you see white moving reactangle?"
IDS_DDFULLSCREEN_DESCRIPTION "This test will use DirectDraw to draw in a fullscreen
mode. Moving white rectangle should be drawn. Continue?"
IDS_DDFULLSCREEN_RESULT "Did you see white moving reactangle in a fullscreen
mode?"
- IDS_REG_FAIL "Îøèáêà"
+ IDS_FORMAT_ADAPTER_MEM "%u MB"
+ IDS_FORMAT_ADAPTER_MODE "%04u x %04u (%u bit)(%uHz)"
END
Modified: trunk/reactos/base/applications/dxdiag/resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/dxdiag/r…
==============================================================================
--- trunk/reactos/base/applications/dxdiag/resource.h [iso-8859-1] (original)
+++ trunk/reactos/base/applications/dxdiag/resource.h [iso-8859-1] Mon Apr 28 12:16:57
2008
@@ -119,6 +119,8 @@
#define IDS_DDFULLSCREEN_DESCRIPTION 10122
#define IDS_DDFULLSCREEN_RESULT 10123
#define IDS_DDTEST_TITLE 10124
+#define IDS_FORMAT_ADAPTER_MEM 10125
+#define IDS_FORMAT_ADAPTER_MODE 10126
/* icon resource constants */
#define IDI_APPICON 20000
Modified: trunk/reactos/base/applications/dxdiag/system.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/dxdiag/s…
==============================================================================
--- trunk/reactos/base/applications/dxdiag/system.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/dxdiag/system.c [iso-8859-1] Mon Apr 28 12:16:57 2008
@@ -30,6 +30,9 @@
if (res != ERROR_SUCCESS)
return FALSE;
+
+ if (Size == sizeof(DWORD))
+ return TRUE;
Result[(Size / sizeof(WCHAR))-1] = L'\0';
return TRUE;