mirror of
https://github.com/reactos/reactos.git
synced 2024-09-28 13:34:53 +00:00
[CONCFG]: Use 'Success' boolean variable instead of an obscure 'RetVal'.
svn path=/trunk/; revision=74367
This commit is contained in:
parent
417e293fac
commit
aac777cc7f
|
@ -121,7 +121,7 @@ ConCfgOpenUserSettings(LPCWSTR ConsoleTitle,
|
|||
REGSAM samDesired,
|
||||
BOOLEAN Create)
|
||||
{
|
||||
BOOLEAN RetVal = TRUE;
|
||||
BOOLEAN Success = TRUE;
|
||||
NTSTATUS Status;
|
||||
WCHAR szBuffer[MAX_PATH] = L"Console\\";
|
||||
WCHAR szBuffer2[MAX_PATH] = L"";
|
||||
|
@ -164,35 +164,35 @@ ConCfgOpenUserSettings(LPCWSTR ConsoleTitle,
|
|||
if (Create)
|
||||
{
|
||||
/* Create the key */
|
||||
RetVal = (RegCreateKeyExW(hKey,
|
||||
szBuffer,
|
||||
0, NULL,
|
||||
REG_OPTION_NON_VOLATILE,
|
||||
samDesired,
|
||||
NULL,
|
||||
hSubKey,
|
||||
NULL) == ERROR_SUCCESS);
|
||||
Success = (RegCreateKeyExW(hKey,
|
||||
szBuffer,
|
||||
0, NULL,
|
||||
REG_OPTION_NON_VOLATILE,
|
||||
samDesired,
|
||||
NULL,
|
||||
hSubKey,
|
||||
NULL) == ERROR_SUCCESS);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Open the key */
|
||||
RetVal = (RegOpenKeyExW(hKey,
|
||||
szBuffer,
|
||||
0,
|
||||
samDesired,
|
||||
hSubKey) == ERROR_SUCCESS);
|
||||
Success = (RegOpenKeyExW(hKey,
|
||||
szBuffer,
|
||||
0,
|
||||
samDesired,
|
||||
hSubKey) == ERROR_SUCCESS);
|
||||
}
|
||||
|
||||
/* Close the parent key and return success or not */
|
||||
NtClose(hKey);
|
||||
return RetVal;
|
||||
return Success;
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
ConCfgReadUserSettings(IN OUT PCONSOLE_STATE_INFO ConsoleInfo,
|
||||
IN BOOLEAN DefaultSettings)
|
||||
{
|
||||
BOOLEAN RetVal = FALSE;
|
||||
BOOLEAN Success = FALSE;
|
||||
HKEY hKey;
|
||||
DWORD dwNumSubKeys = 0;
|
||||
DWORD dwIndex;
|
||||
|
@ -251,99 +251,99 @@ ConCfgReadUserSettings(IN OUT PCONSOLE_STATE_INFO ConsoleInfo,
|
|||
if (dwColorIndex < ARRAYSIZE(ConsoleInfo->ColorTable))
|
||||
{
|
||||
ConsoleInfo->ColorTable[dwColorIndex] = Value;
|
||||
RetVal = TRUE;
|
||||
Success = TRUE;
|
||||
}
|
||||
}
|
||||
if (!wcscmp(szValueName, L"FaceName"))
|
||||
{
|
||||
wcsncpy(ConsoleInfo->FaceName, szValue, LF_FACESIZE);
|
||||
ConsoleInfo->FaceName[LF_FACESIZE - 1] = UNICODE_NULL;
|
||||
RetVal = TRUE;
|
||||
Success = TRUE;
|
||||
}
|
||||
else if (!wcscmp(szValueName, L"FontFamily"))
|
||||
{
|
||||
ConsoleInfo->FontFamily = Value;
|
||||
RetVal = TRUE;
|
||||
Success = TRUE;
|
||||
}
|
||||
else if (!wcscmp(szValueName, L"FontSize"))
|
||||
{
|
||||
ConsoleInfo->FontSize.X = LOWORD(Value); // Width
|
||||
ConsoleInfo->FontSize.Y = HIWORD(Value); // Height
|
||||
RetVal = TRUE;
|
||||
Success = TRUE;
|
||||
}
|
||||
else if (!wcscmp(szValueName, L"FontWeight"))
|
||||
{
|
||||
ConsoleInfo->FontWeight = Value;
|
||||
RetVal = TRUE;
|
||||
Success = TRUE;
|
||||
}
|
||||
else if (!wcscmp(szValueName, L"HistoryBufferSize"))
|
||||
{
|
||||
ConsoleInfo->HistoryBufferSize = Value;
|
||||
RetVal = TRUE;
|
||||
Success = TRUE;
|
||||
}
|
||||
else if (!wcscmp(szValueName, L"NumberOfHistoryBuffers"))
|
||||
{
|
||||
ConsoleInfo->NumberOfHistoryBuffers = Value;
|
||||
RetVal = TRUE;
|
||||
Success = TRUE;
|
||||
}
|
||||
else if (!wcscmp(szValueName, L"HistoryNoDup"))
|
||||
{
|
||||
ConsoleInfo->HistoryNoDup = !!Value;
|
||||
RetVal = TRUE;
|
||||
Success = TRUE;
|
||||
}
|
||||
else if (!wcscmp(szValueName, L"QuickEdit"))
|
||||
{
|
||||
ConsoleInfo->QuickEdit = !!Value;
|
||||
RetVal = TRUE;
|
||||
Success = TRUE;
|
||||
}
|
||||
else if (!wcscmp(szValueName, L"InsertMode"))
|
||||
{
|
||||
ConsoleInfo->InsertMode = !!Value;
|
||||
RetVal = TRUE;
|
||||
Success = TRUE;
|
||||
}
|
||||
else if (!wcscmp(szValueName, L"ScreenBufferSize"))
|
||||
{
|
||||
ConsoleInfo->ScreenBufferSize.X = LOWORD(Value);
|
||||
ConsoleInfo->ScreenBufferSize.Y = HIWORD(Value);
|
||||
RetVal = TRUE;
|
||||
Success = TRUE;
|
||||
}
|
||||
else if (!wcscmp(szValueName, L"FullScreen"))
|
||||
{
|
||||
ConsoleInfo->FullScreen = Value;
|
||||
RetVal = TRUE;
|
||||
Success = TRUE;
|
||||
}
|
||||
else if (!wcscmp(szValueName, L"WindowPosition"))
|
||||
{
|
||||
ConsoleInfo->AutoPosition = FALSE;
|
||||
ConsoleInfo->WindowPosition.x = LOWORD(Value);
|
||||
ConsoleInfo->WindowPosition.y = HIWORD(Value);
|
||||
RetVal = TRUE;
|
||||
Success = TRUE;
|
||||
}
|
||||
else if (!wcscmp(szValueName, L"WindowSize"))
|
||||
{
|
||||
ConsoleInfo->WindowSize.X = LOWORD(Value);
|
||||
ConsoleInfo->WindowSize.Y = HIWORD(Value);
|
||||
RetVal = TRUE;
|
||||
Success = TRUE;
|
||||
}
|
||||
else if (!wcscmp(szValueName, L"CursorSize"))
|
||||
{
|
||||
ConsoleInfo->CursorSize = min(max(Value, 0), 100);
|
||||
RetVal = TRUE;
|
||||
Success = TRUE;
|
||||
}
|
||||
else if (!wcscmp(szValueName, L"ScreenColors"))
|
||||
{
|
||||
ConsoleInfo->ScreenAttributes = (USHORT)Value;
|
||||
RetVal = TRUE;
|
||||
Success = TRUE;
|
||||
}
|
||||
else if (!wcscmp(szValueName, L"PopupColors"))
|
||||
{
|
||||
ConsoleInfo->PopupAttributes = (USHORT)Value;
|
||||
RetVal = TRUE;
|
||||
Success = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
RegCloseKey(hKey);
|
||||
return RetVal;
|
||||
return Success;
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
|
|
Loading…
Reference in a new issue