mirror of
https://github.com/reactos/reactos.git
synced 2025-05-06 18:31:26 +00:00
[USETUP] Optimize font loading
Reload a new font only if codepage changed.
This commit is contained in:
parent
aaa416d36a
commit
0d51c71ed7
1 changed files with 9 additions and 1 deletions
|
@ -40,6 +40,7 @@ static BOOLEAN InputQueueEmpty;
|
||||||
static BOOLEAN WaitForInput;
|
static BOOLEAN WaitForInput;
|
||||||
static KEYBOARD_INPUT_DATA InputDataQueue; // Only one element!
|
static KEYBOARD_INPUT_DATA InputDataQueue; // Only one element!
|
||||||
static IO_STATUS_BLOCK InputIosb;
|
static IO_STATUS_BLOCK InputIosb;
|
||||||
|
static UINT LastLoadedCodepage;
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
|
@ -670,6 +671,9 @@ SetConsoleOutputCP(
|
||||||
IO_STATUS_BLOCK IoStatusBlock;
|
IO_STATUS_BLOCK IoStatusBlock;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
if (wCodepage == LastLoadedCodepage)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
hConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE);
|
hConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||||
|
|
||||||
Status = NtDeviceIoControlFile(hConsoleOutput,
|
Status = NtDeviceIoControlFile(hConsoleOutput,
|
||||||
|
@ -682,7 +686,11 @@ SetConsoleOutputCP(
|
||||||
sizeof(ULONG),
|
sizeof(ULONG),
|
||||||
NULL,
|
NULL,
|
||||||
0);
|
0);
|
||||||
return NT_SUCCESS(Status);
|
if (!NT_SUCCESS(Status))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
LastLoadedCodepage = wCodepage;
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue