mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[DXDIAG] Minor code style fixes
This commit is contained in:
parent
50b0332438
commit
a03d1860f2
1 changed files with 25 additions and 25 deletions
|
@ -199,26 +199,26 @@ InitializeSystemPage(HWND hwndDlg)
|
||||||
|
|
||||||
/* set date/time */
|
/* set date/time */
|
||||||
szTime[0] = L'\0';
|
szTime[0] = L'\0';
|
||||||
Length = GetDateFormat(LOCALE_SYSTEM_DEFAULT, DATE_LONGDATE, NULL, NULL, szTime, sizeof(szTime) / sizeof(WCHAR));
|
Length = GetDateFormat(LOCALE_SYSTEM_DEFAULT, DATE_LONGDATE, NULL, NULL, szTime, _countof(szTime));
|
||||||
if (Length)
|
if (Length)
|
||||||
{
|
{
|
||||||
szTime[Length-1] = L',';
|
szTime[Length-1] = L',';
|
||||||
szTime[Length++] = L' ';
|
szTime[Length++] = L' ';
|
||||||
}
|
}
|
||||||
Length = GetTimeFormatW(LOCALE_SYSTEM_DEFAULT, TIME_FORCE24HOURFORMAT|LOCALE_NOUSEROVERRIDE, NULL, NULL, &szTime[Length], (sizeof(szTime) / sizeof(WCHAR)));
|
Length = GetTimeFormatW(LOCALE_SYSTEM_DEFAULT, TIME_FORCE24HOURFORMAT|LOCALE_NOUSEROVERRIDE, NULL, NULL, szTime + Length, _countof(szTime));
|
||||||
szTime[199] = L'\0';
|
szTime[_countof(szTime)-1] = L'\0';
|
||||||
SendDlgItemMessageW(hwndDlg, IDC_STATIC_TIME, WM_SETTEXT, 0, (LPARAM)szTime);
|
SendDlgItemMessageW(hwndDlg, IDC_STATIC_TIME, WM_SETTEXT, 0, (LPARAM)szTime);
|
||||||
|
|
||||||
/* set computer name */
|
/* set computer name */
|
||||||
szTime[0] = L'\0';
|
szTime[0] = L'\0';
|
||||||
Length = sizeof(szTime) / sizeof(WCHAR);
|
Length = _countof(szTime);
|
||||||
if (GetComputerNameW(szTime, &Length))
|
if (GetComputerNameW(szTime, &Length))
|
||||||
SendDlgItemMessageW(hwndDlg, IDC_STATIC_COMPUTER, WM_SETTEXT, 0, (LPARAM)szTime);
|
SendDlgItemMessageW(hwndDlg, IDC_STATIC_COMPUTER, WM_SETTEXT, 0, (LPARAM)szTime);
|
||||||
|
|
||||||
/* set product name */
|
/* set product name */
|
||||||
if (GetRegValue(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", L"ProductName", REG_SZ, szOSName, sizeof(szOSName)))
|
if (GetRegValue(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", L"ProductName", REG_SZ, szOSName, sizeof(szOSName)))
|
||||||
{
|
{
|
||||||
if (LoadStringW(hInst, IDS_OS_VERSION, szFormat, sizeof(szFormat) / sizeof(WCHAR)))
|
if (LoadStringW(hInst, IDS_OS_VERSION, szFormat, _countof(szFormat)))
|
||||||
{
|
{
|
||||||
WCHAR szCpuName[50];
|
WCHAR szCpuName[50];
|
||||||
|
|
||||||
|
@ -229,14 +229,14 @@ InitializeSystemPage(HWND hwndDlg)
|
||||||
|
|
||||||
if (GetVersionEx(&VersionInfo))
|
if (GetVersionEx(&VersionInfo))
|
||||||
{
|
{
|
||||||
szTime[(sizeof(szTime) / sizeof(WCHAR))-1] = L'\0';
|
szTime[_countof(szTime)-1] = L'\0';
|
||||||
wsprintfW(szTime, szFormat, szOSName, szCpuName, VersionInfo.dwMajorVersion, VersionInfo.dwMinorVersion, VersionInfo.dwBuildNumber);
|
wsprintfW(szTime, szFormat, szOSName, szCpuName, VersionInfo.dwMajorVersion, VersionInfo.dwMinorVersion, VersionInfo.dwBuildNumber);
|
||||||
SendDlgItemMessageW(hwndDlg, IDC_STATIC_OS, WM_SETTEXT, 0, (LPARAM)szTime);
|
SendDlgItemMessageW(hwndDlg, IDC_STATIC_OS, WM_SETTEXT, 0, (LPARAM)szTime);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* If the version of the OS cannot be retrieved for some reason, then just give the OS Name and Architecture */
|
/* If the version of the OS cannot be retrieved for some reason, then just give the OS Name and Architecture */
|
||||||
szTime[(sizeof(szTime) / sizeof(WCHAR))-1] = L'\0';
|
szTime[_countof(szTime)-1] = L'\0';
|
||||||
wsprintfW(szTime, L"%s %s", szOSName, szCpuName);
|
wsprintfW(szTime, L"%s %s", szOSName, szCpuName);
|
||||||
SendDlgItemMessageW(hwndDlg, IDC_STATIC_OS, WM_SETTEXT, 0, (LPARAM)szTime);
|
SendDlgItemMessageW(hwndDlg, IDC_STATIC_OS, WM_SETTEXT, 0, (LPARAM)szTime);
|
||||||
}
|
}
|
||||||
|
@ -244,15 +244,15 @@ InitializeSystemPage(HWND hwndDlg)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (LoadStringW(hInst, IDS_VERSION_UNKNOWN, szTime, sizeof(szTime) / sizeof(WCHAR)))
|
if (LoadStringW(hInst, IDS_VERSION_UNKNOWN, szTime, _countof(szTime)))
|
||||||
{
|
{
|
||||||
szTime[(sizeof(szTime) / sizeof(WCHAR))-1] = L'\0';
|
szTime[_countof(szTime)-1] = L'\0';
|
||||||
SendDlgItemMessage(hwndDlg, IDC_STATIC_VERSION, WM_SETTEXT, 0, (LPARAM)szTime);
|
SendDlgItemMessage(hwndDlg, IDC_STATIC_VERSION, WM_SETTEXT, 0, (LPARAM)szTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME set product language/local language */
|
/* FIXME set product language/local language */
|
||||||
if (GetLocaleInfo(LOCALE_SYSTEM_DEFAULT,LOCALE_SLANGUAGE , szTime, sizeof(szTime) / sizeof(WCHAR)))
|
if (GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_SLANGUAGE, szTime, _countof(szTime)))
|
||||||
SendDlgItemMessageW(hwndDlg, IDC_STATIC_LANG, WM_SETTEXT, 0, (LPARAM)szTime);
|
SendDlgItemMessageW(hwndDlg, IDC_STATIC_LANG, WM_SETTEXT, 0, (LPARAM)szTime);
|
||||||
|
|
||||||
/* prepare SMBIOS data */
|
/* prepare SMBIOS data */
|
||||||
|
@ -266,7 +266,7 @@ InitializeSystemPage(HWND hwndDlg)
|
||||||
szTime, _countof(szTime), FALSE);
|
szTime, _countof(szTime), FALSE);
|
||||||
if (Length > 0)
|
if (Length > 0)
|
||||||
{
|
{
|
||||||
szTime[199] = L'\0';
|
szTime[_countof(szTime)-1] = L'\0';
|
||||||
SendDlgItemMessageW(hwndDlg, IDC_STATIC_MANU, WM_SETTEXT, 0, (LPARAM)szTime);
|
SendDlgItemMessageW(hwndDlg, IDC_STATIC_MANU, WM_SETTEXT, 0, (LPARAM)szTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -306,13 +306,13 @@ InitializeSystemPage(HWND hwndDlg)
|
||||||
szTime + Index, StrLength, TRUE);
|
szTime + Index, StrLength, TRUE);
|
||||||
if (Length > 0)
|
if (Length > 0)
|
||||||
{
|
{
|
||||||
if (Index + StrLength > (sizeof(szTime)/sizeof(WCHAR))- 15)
|
if (Index + StrLength > _countof(szTime) - 15)
|
||||||
{
|
{
|
||||||
//FIXME retrieve BiosMajorRelease, BiosMinorRelease
|
//FIXME retrieve BiosMajorRelease, BiosMinorRelease
|
||||||
//StrLength = wcslen(&szTime[Index]);
|
//StrLength = wcslen(szTime + Index);
|
||||||
//szTime[Index+StrLength] = L' ';
|
//szTime[Index+StrLength] = L' ';
|
||||||
//wcscpy(&szTime[Index+StrLength], L"Ver: "); //FIXME NON-NLS
|
//wcscpy(szTime + Index + StrLength, L"Ver: "); //FIXME NON-NLS
|
||||||
//szTime[(sizeof(szTime)/sizeof(WCHAR))-1] = L'\0';
|
//szTime[_countof(szTime)-1] = L'\0';
|
||||||
}
|
}
|
||||||
SendDlgItemMessageW(hwndDlg, IDC_STATIC_BIOS, WM_SETTEXT, 0, (LPARAM)szTime);
|
SendDlgItemMessageW(hwndDlg, IDC_STATIC_BIOS, WM_SETTEXT, 0, (LPARAM)szTime);
|
||||||
}
|
}
|
||||||
|
@ -329,11 +329,11 @@ InitializeSystemPage(HWND hwndDlg)
|
||||||
szFormat[0] = L'\0';
|
szFormat[0] = L'\0';
|
||||||
GetSystemInfo(&SysInfo);
|
GetSystemInfo(&SysInfo);
|
||||||
if (SysInfo.dwNumberOfProcessors > 1)
|
if (SysInfo.dwNumberOfProcessors > 1)
|
||||||
LoadStringW(hInst, IDS_FORMAT_MPPROC, szFormat, sizeof(szFormat) / sizeof(WCHAR));
|
LoadStringW(hInst, IDS_FORMAT_MPPROC, szFormat, _countof(szFormat));
|
||||||
else
|
else
|
||||||
LoadStringW(hInst, IDS_FORMAT_UNIPROC, szFormat, sizeof(szFormat) / sizeof(WCHAR));
|
LoadStringW(hInst, IDS_FORMAT_UNIPROC, szFormat, _countof(szFormat));
|
||||||
|
|
||||||
szFormat[(sizeof(szFormat)/sizeof(WCHAR))-1] = L'\0';
|
szFormat[_countof(szFormat)-1] = L'\0';
|
||||||
wsprintfW(szTime, szFormat, szDesc, SysInfo.dwNumberOfProcessors);
|
wsprintfW(szTime, szFormat, szDesc, SysInfo.dwNumberOfProcessors);
|
||||||
SendDlgItemMessageW(hwndDlg, IDC_STATIC_PROC, WM_SETTEXT, 0, (LPARAM)szTime);
|
SendDlgItemMessageW(hwndDlg, IDC_STATIC_PROC, WM_SETTEXT, 0, (LPARAM)szTime);
|
||||||
}
|
}
|
||||||
|
@ -343,36 +343,36 @@ InitializeSystemPage(HWND hwndDlg)
|
||||||
mem.dwLength = sizeof(mem);
|
mem.dwLength = sizeof(mem);
|
||||||
if (GlobalMemoryStatusEx(&mem))
|
if (GlobalMemoryStatusEx(&mem))
|
||||||
{
|
{
|
||||||
if (LoadStringW(hInst, IDS_FORMAT_MB, szFormat, sizeof(szFormat) / sizeof(WCHAR)))
|
if (LoadStringW(hInst, IDS_FORMAT_MB, szFormat, _countof(szFormat)))
|
||||||
{
|
{
|
||||||
/* set total mem string */
|
/* set total mem string */
|
||||||
szFormat[(sizeof(szFormat) / sizeof(WCHAR))-1] = L'\0';
|
szFormat[_countof(szFormat)-1] = L'\0';
|
||||||
wsprintfW(szTime, szFormat, (mem.ullTotalPhys/1048576));
|
wsprintfW(szTime, szFormat, (mem.ullTotalPhys/1048576));
|
||||||
SendDlgItemMessageW(hwndDlg, IDC_STATIC_MEM, WM_SETTEXT, 0, (LPARAM)szTime);
|
SendDlgItemMessageW(hwndDlg, IDC_STATIC_MEM, WM_SETTEXT, 0, (LPARAM)szTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LoadStringW(hInst, IDS_FORMAT_SWAP, szFormat, sizeof(szFormat) / sizeof(WCHAR)))
|
if (LoadStringW(hInst, IDS_FORMAT_SWAP, szFormat, _countof(szFormat)))
|
||||||
{
|
{
|
||||||
/* set swap string */
|
/* set swap string */
|
||||||
AvailableBytes = (mem.ullTotalPageFile-mem.ullTotalPhys)/1048576;
|
AvailableBytes = (mem.ullTotalPageFile-mem.ullTotalPhys)/1048576;
|
||||||
UsedBytes = (mem.ullTotalPageFile-mem.ullAvailPageFile)/1048576;
|
UsedBytes = (mem.ullTotalPageFile-mem.ullAvailPageFile)/1048576;
|
||||||
|
|
||||||
szFormat[(sizeof(szFormat) / sizeof(WCHAR))-1] = L'\0';
|
szFormat[_countof(szFormat)-1] = L'\0';
|
||||||
wsprintfW(szTime, szFormat, (UsedBytes), (AvailableBytes));
|
wsprintfW(szTime, szFormat, (UsedBytes), (AvailableBytes));
|
||||||
SendDlgItemMessageW(hwndDlg, IDC_STATIC_SWAP, WM_SETTEXT, 0, (LPARAM)szTime);
|
SendDlgItemMessageW(hwndDlg, IDC_STATIC_SWAP, WM_SETTEXT, 0, (LPARAM)szTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* set directx version string */
|
/* set directx version string */
|
||||||
wcscpy(szTime, L"ReactX ");
|
wcscpy(szTime, L"ReactX ");
|
||||||
if (GetDirectXVersion(&szTime[7]))
|
if (GetDirectXVersion(szTime + 7))
|
||||||
{
|
{
|
||||||
SendDlgItemMessage(hwndDlg, IDC_STATIC_VERSION, WM_SETTEXT, 0, (LPARAM)szTime);
|
SendDlgItemMessage(hwndDlg, IDC_STATIC_VERSION, WM_SETTEXT, 0, (LPARAM)szTime);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (LoadStringW(hInst, IDS_VERSION_UNKNOWN, szTime, sizeof(szTime) / sizeof(WCHAR)))
|
if (LoadStringW(hInst, IDS_VERSION_UNKNOWN, szTime, _countof(szTime)))
|
||||||
{
|
{
|
||||||
szTime[(sizeof(szTime) / sizeof(WCHAR))-1] = L'\0';
|
szTime[_countof(szTime)-1] = L'\0';
|
||||||
SendDlgItemMessage(hwndDlg, IDC_STATIC_VERSION, WM_SETTEXT, 0, (LPARAM)szTime);
|
SendDlgItemMessage(hwndDlg, IDC_STATIC_VERSION, WM_SETTEXT, 0, (LPARAM)szTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue