[BLUE] Use ByteOffset.QuadPrt instead of ByteOffset.LowPart

This commit is contained in:
Timo Kreuzer 2018-07-01 10:47:48 +02:00
parent 741c3c0022
commit 3a85d2764c

View file

@ -146,15 +146,13 @@ ExtractFont(
FILE_SYNCHRONOUS_IO_NONALERT, FILE_SYNCHRONOUS_IO_NONALERT,
NULL, NULL,
0); 0);
ByteOffset.LowPart = ByteOffset.HighPart = 0;
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT1("Error: Cannot open vgafonts.cab (0x%lx)\n", Status); DPRINT1("Error: Cannot open vgafonts.cab (0x%lx)\n", Status);
return Status; return Status;
} }
ByteOffset.QuadPart = 0;
Status = ZwReadFile(Handle, Status = ZwReadFile(Handle,
NULL, NULL,
NULL, NULL,
@ -173,14 +171,14 @@ ExtractFont(
if (CabFileHeader.Signature != CAB_SIGNATURE) if (CabFileHeader.Signature != CAB_SIGNATURE)
{ {
DPRINT1("Error: CAB signature is missing!\n"); DPRINT1("Invalid CAB signature: 0x%lx!\n", CabFileHeader.Signature);
Status = STATUS_UNSUCCESSFUL; Status = STATUS_UNSUCCESSFUL;
goto Exit; goto Exit;
} }
// We have a valid CAB file! // We have a valid CAB file!
// Read the file table now and decrement the file count on every file. When it's zero, we read the complete table. // Read the file table now and decrement the file count on every file. When it's zero, we read the complete table.
ByteOffset.LowPart = CabFileHeader.FileTableOffset; ByteOffset.QuadPart = CabFileHeader.FileTableOffset;
while (CabFileHeader.FileCount) while (CabFileHeader.FileCount)
{ {
@ -196,7 +194,7 @@ ExtractFont(
if (NT_SUCCESS(Status)) if (NT_SUCCESS(Status))
{ {
ByteOffset.LowPart += sizeof(CabFile); ByteOffset.QuadPart += sizeof(CabFile);
// 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.
@ -224,7 +222,7 @@ ExtractFont(
} }
} }
ByteOffset.LowPart += strlen(FileName) + 1; ByteOffset.QuadPart += strlen(FileName) + 1;
} }
} }
@ -232,8 +230,8 @@ ExtractFont(
} }
// 8 = Size of a CFFOLDER structure (see cabman). As we don't need the values of that structure, just increase the offset here. // 8 = Size of a CFFOLDER structure (see cabman). As we don't need the values of that structure, just increase the offset here.
ByteOffset.LowPart += 8; ByteOffset.QuadPart += 8;
ByteOffset.LowPart += CabFileOffset; ByteOffset.QuadPart += 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, Status = ZwReadFile(Handle,