mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 17:03:02 +00:00
[BLUE] Formatting, no code change
This commit is contained in:
parent
3904fd6257
commit
64f46045af
1 changed files with 87 additions and 48 deletions
|
@ -24,7 +24,8 @@ VOID LoadFont(PUCHAR Bitplane, PUCHAR FontBitfield);
|
||||||
/* FUNCTIONS ****************************************************************/
|
/* FUNCTIONS ****************************************************************/
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
ScrLoadFontTable(UINT32 CodePage)
|
ScrLoadFontTable(
|
||||||
|
UINT32 CodePage)
|
||||||
{
|
{
|
||||||
PHYSICAL_ADDRESS BaseAddress;
|
PHYSICAL_ADDRESS BaseAddress;
|
||||||
PUCHAR Bitplane;
|
PUCHAR Bitplane;
|
||||||
|
@ -55,7 +56,10 @@ ScrLoadFontTable(UINT32 CodePage)
|
||||||
|
|
||||||
/* PRIVATE FUNCTIONS *********************************************************/
|
/* PRIVATE FUNCTIONS *********************************************************/
|
||||||
|
|
||||||
NTSTATUS ExtractFont(UINT32 CodePage, PUCHAR FontBitField)
|
NTSTATUS
|
||||||
|
ExtractFont(
|
||||||
|
UINT32 CodePage,
|
||||||
|
PUCHAR FontBitField)
|
||||||
{
|
{
|
||||||
BOOLEAN bFoundFile = FALSE;
|
BOOLEAN bFoundFile = FALSE;
|
||||||
HANDLE Handle;
|
HANDLE Handle;
|
||||||
|
@ -101,25 +105,37 @@ NTSTATUS ExtractFont(UINT32 CodePage, PUCHAR FontBitField)
|
||||||
ZwClose(Handle);
|
ZwClose(Handle);
|
||||||
|
|
||||||
Status = RtlAppendUnicodeToString(&SourceName, L"\\vgafonts.cab");
|
Status = RtlAppendUnicodeToString(&SourceName, L"\\vgafonts.cab");
|
||||||
InitializeObjectAttributes(&ObjectAttributes, &SourceName,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
|
&SourceName,
|
||||||
OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
|
OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
|
||||||
NULL, NULL);
|
NULL,
|
||||||
|
NULL);
|
||||||
|
|
||||||
Status = ZwCreateFile(&Handle,
|
Status = ZwCreateFile(&Handle,
|
||||||
GENERIC_READ,
|
GENERIC_READ,
|
||||||
&ObjectAttributes, &IoStatusBlock, NULL,
|
&ObjectAttributes,
|
||||||
|
&IoStatusBlock,
|
||||||
|
NULL,
|
||||||
FILE_ATTRIBUTE_NORMAL,
|
FILE_ATTRIBUTE_NORMAL,
|
||||||
0,
|
0,
|
||||||
FILE_OPEN,
|
FILE_OPEN,
|
||||||
FILE_SYNCHRONOUS_IO_NONALERT,
|
FILE_SYNCHRONOUS_IO_NONALERT,
|
||||||
NULL, 0);
|
NULL,
|
||||||
|
0);
|
||||||
|
|
||||||
ByteOffset.LowPart = ByteOffset.HighPart = 0;
|
ByteOffset.LowPart = ByteOffset.HighPart = 0;
|
||||||
|
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
Status = ZwReadFile(Handle, NULL, NULL, NULL, &IoStatusBlock,
|
Status = ZwReadFile(Handle,
|
||||||
&CabFileHeader, sizeof(CabFileHeader), &ByteOffset, NULL);
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
&IoStatusBlock,
|
||||||
|
&CabFileHeader,
|
||||||
|
sizeof(CabFileHeader),
|
||||||
|
&ByteOffset,
|
||||||
|
NULL);
|
||||||
|
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
@ -131,8 +147,15 @@ NTSTATUS ExtractFont(UINT32 CodePage, PUCHAR FontBitField)
|
||||||
|
|
||||||
while (CabFileHeader.FileCount)
|
while (CabFileHeader.FileCount)
|
||||||
{
|
{
|
||||||
Status = ZwReadFile(Handle, NULL, NULL, NULL, &IoStatusBlock,
|
Status = ZwReadFile(Handle,
|
||||||
&CabFile, sizeof(CabFile), &ByteOffset, NULL);
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
&IoStatusBlock,
|
||||||
|
&CabFile,
|
||||||
|
sizeof(CabFile),
|
||||||
|
&ByteOffset,
|
||||||
|
NULL);
|
||||||
|
|
||||||
if (NT_SUCCESS(Status))
|
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.
|
// We assume here that the file name is max. 19 characters (+ 1 NULL character) long.
|
||||||
// This should be enough for our purpose.
|
// This should be enough for our purpose.
|
||||||
Status = ZwReadFile(Handle, NULL, NULL, NULL, &IoStatusBlock,
|
Status = ZwReadFile(Handle,
|
||||||
FileName, sizeof(FileName), &ByteOffset, NULL);
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
&IoStatusBlock,
|
||||||
|
FileName,
|
||||||
|
sizeof(FileName),
|
||||||
|
&ByteOffset,
|
||||||
|
NULL);
|
||||||
|
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
@ -169,8 +199,15 @@ NTSTATUS ExtractFont(UINT32 CodePage, PUCHAR FontBitField)
|
||||||
ByteOffset.LowPart += CabFileOffset;
|
ByteOffset.LowPart += CabFileOffset;
|
||||||
|
|
||||||
// ByteOffset now contains the offset of the actual data, so we can read the RAW font
|
// ByteOffset now contains the offset of the actual data, so we can read the RAW font
|
||||||
Status = ZwReadFile(Handle, NULL, NULL, NULL, &IoStatusBlock,
|
Status = ZwReadFile(Handle,
|
||||||
FontBitField, 2048, &ByteOffset, NULL);
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
&IoStatusBlock,
|
||||||
|
FontBitField,
|
||||||
|
2048,
|
||||||
|
&ByteOffset,
|
||||||
|
NULL);
|
||||||
ZwClose(Handle);
|
ZwClose(Handle);
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -237,7 +274,9 @@ CloseBitPlane(VOID)
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
LoadFont(PUCHAR Bitplane, PUCHAR FontBitfield)
|
LoadFont(
|
||||||
|
PUCHAR Bitplane,
|
||||||
|
PUCHAR FontBitfield)
|
||||||
{
|
{
|
||||||
UINT32 i, j;
|
UINT32 i, j;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue