mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +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 KEYBOARD_INPUT_DATA InputDataQueue; // Only one element!
|
||||
static IO_STATUS_BLOCK InputIosb;
|
||||
static UINT LastLoadedCodepage;
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
|
@ -670,6 +671,9 @@ SetConsoleOutputCP(
|
|||
IO_STATUS_BLOCK IoStatusBlock;
|
||||
NTSTATUS Status;
|
||||
|
||||
if (wCodepage == LastLoadedCodepage)
|
||||
return TRUE;
|
||||
|
||||
hConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
|
||||
Status = NtDeviceIoControlFile(hConsoleOutput,
|
||||
|
@ -682,7 +686,11 @@ SetConsoleOutputCP(
|
|||
sizeof(ULONG),
|
||||
NULL,
|
||||
0);
|
||||
return NT_SUCCESS(Status);
|
||||
if (!NT_SUCCESS(Status))
|
||||
return FALSE;
|
||||
|
||||
LastLoadedCodepage = wCodepage;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue