mirror of
https://github.com/reactos/reactos.git
synced 2024-08-19 09:59:44 +00:00
[SYSDM]
The maximum length of hardware profiles names is 79 characters. Use a matching string length and set the length of the edit control accordingly. svn path=/trunk/; revision=67825
This commit is contained in:
parent
4f7de22ae4
commit
a37d047ad8
|
@ -11,9 +11,11 @@
|
||||||
|
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
|
#define PROFILE_NAME_LENGTH 80
|
||||||
|
|
||||||
typedef struct _PROFILE
|
typedef struct _PROFILE
|
||||||
{
|
{
|
||||||
WCHAR szFriendlyName[256];
|
WCHAR szFriendlyName[PROFILE_NAME_LENGTH];
|
||||||
WCHAR szName[5];
|
WCHAR szName[5];
|
||||||
DWORD dwProfileNumber;
|
DWORD dwProfileNumber;
|
||||||
DWORD dwPreferenceOrder;
|
DWORD dwPreferenceOrder;
|
||||||
|
@ -37,11 +39,12 @@ OnCopyProfileInit(HWND hwndDlg,
|
||||||
UINT idFrom,
|
UINT idFrom,
|
||||||
UINT idTo)
|
UINT idTo)
|
||||||
{
|
{
|
||||||
WCHAR szNewProfileName[256];
|
WCHAR szNewProfileName[PROFILE_NAME_LENGTH];
|
||||||
|
|
||||||
SetDlgItemText(hwndDlg, idFrom, pProfileData->pProfiles[pProfileData->dwSelectedProfileIndex].szFriendlyName);
|
SetDlgItemText(hwndDlg, idFrom, pProfileData->pProfiles[pProfileData->dwSelectedProfileIndex].szFriendlyName);
|
||||||
|
|
||||||
swprintf(szNewProfileName, L"Profile %lu", pProfileData->dwProfileCount);
|
swprintf(szNewProfileName, L"Profile %lu", pProfileData->dwProfileCount);
|
||||||
|
SendDlgItemMessageW(hwndDlg, idTo, EM_SETLIMITTEXT, PROFILE_NAME_LENGTH - 1, 0);
|
||||||
SetDlgItemText(hwndDlg, idTo, szNewProfileName);
|
SetDlgItemText(hwndDlg, idTo, szNewProfileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,7 +79,7 @@ CopyProfile(
|
||||||
GetDlgItemText(hwndDlg,
|
GetDlgItemText(hwndDlg,
|
||||||
IDC_COPYPROFILETO,
|
IDC_COPYPROFILETO,
|
||||||
pDstProfile->szFriendlyName,
|
pDstProfile->szFriendlyName,
|
||||||
256);
|
PROFILE_NAME_LENGTH);
|
||||||
|
|
||||||
pDstProfile->dwProfileNumber = ++pProfileData->dwLastProfile;
|
pDstProfile->dwProfileNumber = ++pProfileData->dwLastProfile;
|
||||||
swprintf(pDstProfile->szName, L"%04lu", pDstProfile->dwProfileNumber);
|
swprintf(pDstProfile->szName, L"%04lu", pDstProfile->dwProfileNumber);
|
||||||
|
@ -138,7 +141,7 @@ RenameProfile(
|
||||||
GetDlgItemText(hwndDlg,
|
GetDlgItemText(hwndDlg,
|
||||||
IDC_RENPROFEDITTO,
|
IDC_RENPROFEDITTO,
|
||||||
pProfile->szFriendlyName,
|
pProfile->szFriendlyName,
|
||||||
256);
|
PROFILE_NAME_LENGTH);
|
||||||
|
|
||||||
/* Replace the listbox string */
|
/* Replace the listbox string */
|
||||||
SendDlgItemMessageW(pProfileData->hwndProfileDlg, IDC_HRDPROFLSTBOX, LB_DELETESTRING, pProfileData->dwSelectedProfileIndex, 0);
|
SendDlgItemMessageW(pProfileData->hwndProfileDlg, IDC_HRDPROFLSTBOX, LB_DELETESTRING, pProfileData->dwSelectedProfileIndex, 0);
|
||||||
|
@ -288,7 +291,7 @@ GetProfile(
|
||||||
if (lError != ERROR_SUCCESS)
|
if (lError != ERROR_SUCCESS)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
dwSize = 256 * sizeof(WCHAR);
|
dwSize = PROFILE_NAME_LENGTH * sizeof(WCHAR);
|
||||||
lError = RegQueryValueExW(hProfileKey,
|
lError = RegQueryValueExW(hProfileKey,
|
||||||
L"FriendlyName",
|
L"FriendlyName",
|
||||||
NULL,
|
NULL,
|
||||||
|
|
Loading…
Reference in a new issue