[BLUE] Formatting, no code change

This commit is contained in:
Timo Kreuzer 2018-07-01 10:13:18 +02:00
parent 3904fd6257
commit 64f46045af

View file

@ -24,7 +24,8 @@ VOID LoadFont(PUCHAR Bitplane, PUCHAR FontBitfield);
/* FUNCTIONS ****************************************************************/
VOID
ScrLoadFontTable(UINT32 CodePage)
ScrLoadFontTable(
UINT32 CodePage)
{
PHYSICAL_ADDRESS BaseAddress;
PUCHAR Bitplane;
@ -55,7 +56,10 @@ ScrLoadFontTable(UINT32 CodePage)
/* PRIVATE FUNCTIONS *********************************************************/
NTSTATUS ExtractFont(UINT32 CodePage, PUCHAR FontBitField)
NTSTATUS
ExtractFont(
UINT32 CodePage,
PUCHAR FontBitField)
{
BOOLEAN bFoundFile = FALSE;
HANDLE Handle;
@ -101,25 +105,37 @@ NTSTATUS ExtractFont(UINT32 CodePage, PUCHAR FontBitField)
ZwClose(Handle);
Status = RtlAppendUnicodeToString(&SourceName, L"\\vgafonts.cab");
InitializeObjectAttributes(&ObjectAttributes, &SourceName,
InitializeObjectAttributes(&ObjectAttributes,
&SourceName,
OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
NULL, NULL);
NULL,
NULL);
Status = ZwCreateFile(&Handle,
GENERIC_READ,
&ObjectAttributes, &IoStatusBlock, NULL,
&ObjectAttributes,
&IoStatusBlock,
NULL,
FILE_ATTRIBUTE_NORMAL,
0,
FILE_OPEN,
FILE_SYNCHRONOUS_IO_NONALERT,
NULL, 0);
NULL,
0);
ByteOffset.LowPart = ByteOffset.HighPart = 0;
if (NT_SUCCESS(Status))
{
Status = ZwReadFile(Handle, NULL, NULL, NULL, &IoStatusBlock,
&CabFileHeader, sizeof(CabFileHeader), &ByteOffset, NULL);
Status = ZwReadFile(Handle,
NULL,
NULL,
NULL,
&IoStatusBlock,
&CabFileHeader,
sizeof(CabFileHeader),
&ByteOffset,
NULL);
if (NT_SUCCESS(Status))
{
@ -131,8 +147,15 @@ NTSTATUS ExtractFont(UINT32 CodePage, PUCHAR FontBitField)
while (CabFileHeader.FileCount)
{
Status = ZwReadFile(Handle, NULL, NULL, NULL, &IoStatusBlock,
&CabFile, sizeof(CabFile), &ByteOffset, NULL);
Status = ZwReadFile(Handle,
NULL,
NULL,
NULL,
&IoStatusBlock,
&CabFile,
sizeof(CabFile),
&ByteOffset,
NULL);
if (NT_SUCCESS(Status))
{
@ -140,8 +163,15 @@ NTSTATUS ExtractFont(UINT32 CodePage, PUCHAR FontBitField)
// We assume here that the file name is max. 19 characters (+ 1 NULL character) long.
// This should be enough for our purpose.
Status = ZwReadFile(Handle, NULL, NULL, NULL, &IoStatusBlock,
FileName, sizeof(FileName), &ByteOffset, NULL);
Status = ZwReadFile(Handle,
NULL,
NULL,
NULL,
&IoStatusBlock,
FileName,
sizeof(FileName),
&ByteOffset,
NULL);
if (NT_SUCCESS(Status))
{
@ -169,8 +199,15 @@ NTSTATUS ExtractFont(UINT32 CodePage, PUCHAR FontBitField)
ByteOffset.LowPart += CabFileOffset;
// ByteOffset now contains the offset of the actual data, so we can read the RAW font
Status = ZwReadFile(Handle, NULL, NULL, NULL, &IoStatusBlock,
FontBitField, 2048, &ByteOffset, NULL);
Status = ZwReadFile(Handle,
NULL,
NULL,
NULL,
&IoStatusBlock,
FontBitField,
2048,
&ByteOffset,
NULL);
ZwClose(Handle);
return STATUS_SUCCESS;
}
@ -237,7 +274,9 @@ CloseBitPlane(VOID)
}
VOID
LoadFont(PUCHAR Bitplane, PUCHAR FontBitfield)
LoadFont(
PUCHAR Bitplane,
PUCHAR FontBitfield)
{
UINT32 i, j;