Commit c49ddccb authored by Dāvis Mosāns's avatar Dāvis Mosāns Committed by Brad King
Browse files

ConsoleBuf: Fix test registry restoration

If FaceName wasn't previously present we need to remove it.

Change-Id: I1e463f2b159de15838efe9f504ab5340aa5f2342
parent fb8530ed
......@@ -423,6 +423,7 @@ static int testConsole()
const DWORD TestFontSize = 0x000c0000;
HKEY hConsoleKey;
WCHAR FaceName[200];
FaceName[0] = 0;
DWORD FaceNameSize = sizeof(FaceName);
DWORD FontFamily = TestFontFamily;
DWORD FontSize = TestFontSize;
......@@ -526,8 +527,12 @@ static int testConsole()
KEY_WRITE, &hConsoleKey) == ERROR_SUCCESS) {
RegSetValueExW(hConsoleKey, L"FontFamily", 0, REG_DWORD,
(BYTE *)&FontFamily, sizeof(FontFamily));
RegSetValueExW(hConsoleKey, L"FaceName", 0, REG_SZ,
(BYTE *)FaceName, FaceNameSize);
if (FaceName[0] != 0) {
RegSetValueExW(hConsoleKey, L"FaceName", 0, REG_SZ,
(BYTE *)FaceName, FaceNameSize);
} else {
RegDeleteValueW(hConsoleKey, L"FaceName");
}
RegSetValueExW(hConsoleKey, L"FontSize", 0, REG_DWORD,
(BYTE *)&FontSize, sizeof(FontSize));
RegCloseKey(hConsoleKey);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment