[BOOTVID] Rename some function parameters

Delta       -> Stride
TopDelta -> Height
This commit is contained in:
Dmitry Borisov
2026-04-18 21:30:58 +06:00
committed by Carl J. Bialorucki
parent 7d33f7503b
commit e2aa54321a
10 changed files with 63 additions and 63 deletions

View File

@@ -158,7 +158,7 @@ DoScroll(
VOID
PreserveRow(
_In_ ULONG CurrentTop,
_In_ ULONG TopDelta,
_In_ ULONG Height,
_In_ BOOLEAN Restore)
{
PUSHORT Position1, Position2;
@@ -179,7 +179,7 @@ PreserveRow(
}
/* Set the count and loop every pixel */
Count = TopDelta * (SCREEN_WIDTH / 8);
Count = Height * (SCREEN_WIDTH / 8);
while (Count--)
{
/* Write the data back on the other position */
@@ -282,12 +282,12 @@ VidCleanUp(VOID)
VOID
NTAPI
VidScreenToBufferBlt(
_Out_writes_bytes_all_(Delta * Height) PUCHAR Buffer,
_Out_writes_bytes_all_(Height * Stride) PUCHAR Buffer,
_In_ ULONG Left,
_In_ ULONG Top,
_In_ ULONG Width,
_In_ ULONG Height,
_In_ ULONG Delta)
_In_ ULONG Stride)
{
UNIMPLEMENTED;
while (TRUE);

View File

@@ -44,9 +44,9 @@ BitBlt(
_In_ ULONG Top,
_In_ ULONG Width,
_In_ ULONG Height,
_In_reads_bytes_(Delta * Height) PUCHAR Buffer,
_In_reads_bytes_(Height * Stride) PUCHAR Buffer,
_In_ ULONG BitsPerPixel,
_In_ ULONG Delta)
_In_ ULONG Stride)
{
ULONG X, Y, Pixel;
UCHAR Colors;
@@ -61,14 +61,14 @@ BitBlt(
DbgPrint("Unhandled BitBlt\n"
"%lux%lu @ (%lu|%lu)\n"
"Bits Per Pixel %lu\n"
"Buffer: %p. Delta: %lu\n",
"Buffer: %p. Stride: %lu\n",
Width,
Height,
Left,
Top,
BitsPerPixel,
Buffer,
Delta);
Stride);
return;
}
@@ -96,7 +96,7 @@ BitBlt(
}
}
Buffer += Delta;
Buffer += Stride;
}
}
@@ -298,19 +298,19 @@ RleBitBlt(
VOID
NTAPI
VidBufferToScreenBlt(
_In_reads_bytes_(Delta * Height) PUCHAR Buffer,
_In_reads_bytes_(Height * Stride) PUCHAR Buffer,
_In_ ULONG Left,
_In_ ULONG Top,
_In_ ULONG Width,
_In_ ULONG Height,
_In_ ULONG Delta)
_In_ ULONG Stride)
{
/* Make sure we have a width and height */
if (!Width || !Height)
return;
/* Call the helper function */
BitBlt(Left, Top, Width, Height, Buffer, 4, Delta);
BitBlt(Left, Top, Width, Height, Buffer, 4, Stride);
}
VOID
@@ -321,7 +321,7 @@ VidBitBlt(
_In_ ULONG Top)
{
PBITMAPINFOHEADER BitmapInfoHeader;
LONG Delta;
LONG Stride;
PUCHAR BitmapOffset;
ULONG PaletteCount;
@@ -338,12 +338,12 @@ VidBitBlt(
ASSERT((BitmapInfoHeader->biBitCount * BitmapInfoHeader->biPlanes) <= 4);
/*
* Calculate the delta and align it on 32-bytes, then calculate
* Calculate the stride and align it on 32-bytes, then calculate
* the actual start of the bitmap data.
*/
Delta = (BitmapInfoHeader->biBitCount * BitmapInfoHeader->biWidth) + 31;
Delta >>= 3;
Delta &= ~3;
Stride = (BitmapInfoHeader->biBitCount * BitmapInfoHeader->biWidth) + 31;
Stride >>= 3;
Stride &= ~3;
BitmapOffset = Buffer + sizeof(BITMAPINFOHEADER) + PaletteCount * sizeof(ULONG);
/* Check the compression of the bitmap */
@@ -371,8 +371,8 @@ VidBitBlt(
else
{
/* Update buffer offset */
BitmapOffset += ((BitmapInfoHeader->biHeight - 1) * Delta);
Delta *= -1;
BitmapOffset += ((BitmapInfoHeader->biHeight - 1) * Stride);
Stride *= -1;
}
/* Make sure we have a width and a height */
@@ -385,7 +385,7 @@ VidBitBlt(
BitmapInfoHeader->biHeight,
BitmapOffset,
BitmapInfoHeader->biBitCount,
Delta);
Stride);
}
}
}

View File

@@ -362,7 +362,7 @@ SetPixel(
VOID
PreserveRow(
_In_ ULONG CurrentTop,
_In_ ULONG TopDelta,
_In_ ULONG Height,
_In_ BOOLEAN Restore)
{
PUCHAR NewPosition, OldPosition;
@@ -382,14 +382,14 @@ PreserveRow(
}
/* Set the count and copy the pixel data back to the other position in the backbuffer */
ULONG Count = TopDelta * SCREEN_WIDTH;
ULONG Count = Height * SCREEN_WIDTH;
RtlCopyMemory(NewPosition, OldPosition, Count);
/* On restore, mirror the backbuffer changes to the framebuffer */
if (Restore)
{
NewPosition = BB_PIXEL(0, CurrentTop);
for (ULONG y = 0; y < TopDelta; ++y)
for (ULONG y = 0; y < Height; ++y)
{
PULONG Frame = (PULONG)FB_PIXEL(0, CurrentTop + y);
PULONG Pixel = Frame;
@@ -505,24 +505,24 @@ VidSolidColorFill(
VOID
NTAPI
VidScreenToBufferBlt(
_Out_writes_bytes_all_(Delta * Height) PUCHAR Buffer,
_Out_writes_bytes_all_(Height * Stride) PUCHAR Buffer,
_In_ ULONG Left,
_In_ ULONG Top,
_In_ ULONG Width,
_In_ ULONG Height,
_In_ ULONG Delta)
_In_ ULONG Stride)
{
ULONG x, y;
/* Clear the destination buffer */
RtlZeroMemory(Buffer, Delta * Height);
RtlZeroMemory(Buffer, Height * Stride);
/* Start the outer Y height loop */
for (y = 0; y < Height; ++y)
{
/* Set current scanline */
PUCHAR Back = BB_PIXEL(Left, Top + y);
PUCHAR Buf = Buffer + y * Delta;
PUCHAR Buf = Buffer + y * Stride;
/* Start the X inner loop */
for (x = 0; x < Width; x += sizeof(USHORT))

View File

@@ -270,7 +270,7 @@ DoScroll(
VOID
PreserveRow(
_In_ ULONG CurrentTop,
_In_ ULONG TopDelta,
_In_ ULONG Height,
_In_ BOOLEAN Restore)
{
PUCHAR Position1, Position2;
@@ -300,7 +300,7 @@ PreserveRow(
}
/* Set the count and loop every pixel */
Count = TopDelta * (SCREEN_WIDTH / 8);
Count = Height * (SCREEN_WIDTH / 8);
#if defined(_M_IX86) || defined(_M_AMD64)
__movsb(Position1, Position2, Count);
#else
@@ -330,12 +330,12 @@ VidCleanUp(VOID)
VOID
NTAPI
VidScreenToBufferBlt(
_Out_writes_bytes_all_(Delta * Height) PUCHAR Buffer,
_Out_writes_bytes_all_(Height * Stride) PUCHAR Buffer,
_In_ ULONG Left,
_In_ ULONG Top,
_In_ ULONG Width,
_In_ ULONG Height,
_In_ ULONG Delta)
_In_ ULONG Stride)
{
ULONG Plane;
ULONG XDistance;
@@ -349,6 +349,9 @@ VidScreenToBufferBlt(
ULONG b;
ULONG x, y;
/* Clear the destination buffer */
RtlZeroMemory(Buffer, Height * Stride);
/* Calculate total distance to copy on X */
XDistance = Left + Width - 1;
@@ -356,9 +359,6 @@ VidScreenToBufferBlt(
LeftDelta = Left & 7;
RightDelta = 8 - LeftDelta;
/* Clear the destination buffer */
RtlZeroMemory(Buffer, Delta * Height);
/* Calculate the pixel offset and convert the X distance into byte form */
PixelOffset = Top * (SCREEN_WIDTH / 8) + (Left >> 3);
XDistance >>= 3;
@@ -419,7 +419,7 @@ VidScreenToBufferBlt(
/* Update pixel position */
PixelPosition += (SCREEN_WIDTH / 8);
i += Delta;
i += Stride;
}
}
}

View File

@@ -298,11 +298,11 @@ DisplayCharacter(
VOID
PreserveRow(
_In_ ULONG CurrentTop,
_In_ ULONG TopDelta,
_In_ ULONG Height,
_In_ BOOLEAN Restore)
{
PULONG OldPosition, NewPosition;
ULONG PixelCount = TopDelta * (SCREEN_WIDTH / sizeof(ULONG));
ULONG PixelCount = Height * (SCREEN_WIDTH / sizeof(ULONG));
if (Restore)
{
@@ -417,12 +417,12 @@ ResetDisplay(
VOID
NTAPI
VidScreenToBufferBlt(
_Out_writes_bytes_all_(Delta * Height) PUCHAR Buffer,
_Out_writes_bytes_all_(Height * Stride) PUCHAR Buffer,
_In_ ULONG Left,
_In_ ULONG Top,
_In_ ULONG Width,
_In_ ULONG Height,
_In_ ULONG Delta)
_In_ ULONG Stride)
{
ULONG X, Y;
PUCHAR OutputBuffer;
@@ -430,11 +430,11 @@ VidScreenToBufferBlt(
PUSHORT PixelsPosition;
/* Clear the destination buffer */
RtlZeroMemory(Buffer, Delta * Height);
RtlZeroMemory(Buffer, Height * Stride);
for (Y = 0; Y < Height; Y++)
{
OutputBuffer = Buffer + Y * Delta;
OutputBuffer = Buffer + Y * Stride;
PixelsPosition = (PUSHORT)(FrameBuffer + FB_OFFSET(Left, Top + Y));
for (X = 0; X < Width; X += sizeof(USHORT))

View File

@@ -267,7 +267,7 @@ SetPixel(
VOID
PreserveRow(
_In_ ULONG CurrentTop,
_In_ ULONG TopDelta,
_In_ ULONG Height,
_In_ BOOLEAN Restore)
{
PUCHAR NewPosition, OldPosition;
@@ -287,7 +287,7 @@ PreserveRow(
}
/* Set the count and loop every pixel of backbuffer */
ULONG Count = TopDelta * SCREEN_WIDTH;
ULONG Count = Height * SCREEN_WIDTH;
RtlCopyMemory(NewPosition, OldPosition, Count);
@@ -296,7 +296,7 @@ PreserveRow(
NewPosition = BackBuffer + BB_OFFSET(0, CurrentTop);
/* Set the count and loop every pixel of framebuffer */
for (ULONG y = 0; y < TopDelta; y++)
for (ULONG y = 0; y < Height; y++)
{
PULONG Frame = (PULONG)(FrameBufferStart + FB_OFFSET(0, CurrentTop + y));
@@ -401,22 +401,22 @@ VidSolidColorFill(
VOID
NTAPI
VidScreenToBufferBlt(
_Out_writes_bytes_all_(Delta * Height) PUCHAR Buffer,
_Out_writes_bytes_all_(Height * Stride) PUCHAR Buffer,
_In_ ULONG Left,
_In_ ULONG Top,
_In_ ULONG Width,
_In_ ULONG Height,
_In_ ULONG Delta)
_In_ ULONG Stride)
{
/* Clear the destination buffer */
RtlZeroMemory(Buffer, Delta * Height);
RtlZeroMemory(Buffer, Height * Stride);
/* Start the outer Y height loop */
for (ULONG y = 0; y < Height; y++)
{
/* Set current scanline */
PUCHAR Back = BackBuffer + BB_OFFSET(Left, Top + y);
PUCHAR Buf = Buffer + y * Delta;
PUCHAR Buf = Buffer + y * Stride;
/* Start the X inner loop */
for (ULONG x = 0; x < Width; x += sizeof(USHORT))

View File

@@ -84,7 +84,7 @@ extern const RGBQUAD VidpDefaultPalette[BV_MAX_COLORS];
VOID
PreserveRow(
_In_ ULONG CurrentTop,
_In_ ULONG TopDelta,
_In_ ULONG Height,
_In_ BOOLEAN Restore);
VOID

View File

@@ -557,38 +557,38 @@ InbvBitBlt(
VOID
NTAPI
InbvBufferToScreenBlt(
_In_reads_bytes_(Delta * Height) PUCHAR Buffer,
_In_reads_bytes_(Height * Stride) PUCHAR Buffer,
_In_ ULONG X,
_In_ ULONG Y,
_In_ ULONG Width,
_In_ ULONG Height,
_In_ ULONG Delta)
_In_ ULONG Stride)
{
/* Check if we're installed and we own it */
if (InbvBootDriverInstalled &&
(InbvDisplayState == INBV_DISPLAY_STATE_OWNED))
{
/* Do the blit */
VidBufferToScreenBlt(Buffer, X, Y, Width, Height, Delta);
VidBufferToScreenBlt(Buffer, X, Y, Width, Height, Stride);
}
}
VOID
NTAPI
InbvScreenToBufferBlt(
_Out_writes_bytes_all_(Delta * Height) PUCHAR Buffer,
_Out_writes_bytes_all_(Height * Stride) PUCHAR Buffer,
_In_ ULONG X,
_In_ ULONG Y,
_In_ ULONG Width,
_In_ ULONG Height,
_In_ ULONG Delta)
_In_ ULONG Stride)
{
/* Check if we're installed and we own it */
if (InbvBootDriverInstalled &&
(InbvDisplayState == INBV_DISPLAY_STATE_OWNED))
{
/* Do the blit */
VidScreenToBufferBlt(Buffer, X, Y, Width, Height, Delta);
VidScreenToBufferBlt(Buffer, X, Y, Width, Height, Stride);
}
}

View File

@@ -56,23 +56,23 @@ InbvBitBlt(
VOID
NTAPI
InbvBufferToScreenBlt(
_In_reads_bytes_(Delta * Height) PUCHAR Buffer,
_In_reads_bytes_(Height * Stride) PUCHAR Buffer,
_In_ ULONG X,
_In_ ULONG Y,
_In_ ULONG Width,
_In_ ULONG Height,
_In_ ULONG Delta
_In_ ULONG Stride
);
VOID
NTAPI
InbvScreenToBufferBlt(
_Out_writes_bytes_all_(Delta * Height) PUCHAR Buffer,
_Out_writes_bytes_all_(Height * Stride) PUCHAR Buffer,
_In_ ULONG X,
_In_ ULONG Y,
_In_ ULONG Width,
_In_ ULONG Height,
_In_ ULONG Delta
_In_ ULONG Stride
);
//

View File

@@ -62,22 +62,22 @@ VidBitBlt(
VOID
NTAPI
VidBufferToScreenBlt(
_In_reads_bytes_(Delta * Height) PUCHAR Buffer,
_In_reads_bytes_(Height * Stride) PUCHAR Buffer,
_In_ ULONG Left,
_In_ ULONG Top,
_In_ ULONG Width,
_In_ ULONG Height,
_In_ ULONG Delta);
_In_ ULONG Stride);
VOID
NTAPI
VidScreenToBufferBlt(
_Out_writes_bytes_all_(Delta * Height) PUCHAR Buffer,
_Out_writes_bytes_all_(Height * Stride) PUCHAR Buffer,
_In_ ULONG Left,
_In_ ULONG Top,
_In_ ULONG Width,
_In_ ULONG Height,
_In_ ULONG Delta);
_In_ ULONG Stride);
VOID
NTAPI