From e2aa54321af3c43c9494035688e792ab2cd5fbd5 Mon Sep 17 00:00:00 2001 From: Dmitry Borisov Date: Sat, 18 Apr 2026 21:30:58 +0600 Subject: [PATCH] [BOOTVID] Rename some function parameters Delta -> Stride TopDelta -> Height --- drivers/base/bootvid/arm/bootvid.c | 8 ++--- drivers/base/bootvid/common.c | 32 +++++++++---------- drivers/base/bootvid/framebuf/bootvid.c | 14 ++++---- drivers/base/bootvid/i386/pc/vga.c | 16 +++++----- drivers/base/bootvid/i386/pc98/bootvid.c | 12 +++---- drivers/base/bootvid/i386/xbox/bootvid.c | 14 ++++---- drivers/base/bootvid/precomp.h | 2 +- ntoskrnl/inbv/inbv.c | 12 +++---- ntoskrnl/include/internal/inbv.h | 8 ++--- sdk/include/reactos/drivers/bootvid/bootvid.h | 8 ++--- 10 files changed, 63 insertions(+), 63 deletions(-) diff --git a/drivers/base/bootvid/arm/bootvid.c b/drivers/base/bootvid/arm/bootvid.c index 0ad4d5fce57..91c23004f62 100644 --- a/drivers/base/bootvid/arm/bootvid.c +++ b/drivers/base/bootvid/arm/bootvid.c @@ -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); diff --git a/drivers/base/bootvid/common.c b/drivers/base/bootvid/common.c index 0e6a4ed1dde..66e2b3b919e 100644 --- a/drivers/base/bootvid/common.c +++ b/drivers/base/bootvid/common.c @@ -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); } } } diff --git a/drivers/base/bootvid/framebuf/bootvid.c b/drivers/base/bootvid/framebuf/bootvid.c index 90fce23d4d0..f09e80b9605 100644 --- a/drivers/base/bootvid/framebuf/bootvid.c +++ b/drivers/base/bootvid/framebuf/bootvid.c @@ -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)) diff --git a/drivers/base/bootvid/i386/pc/vga.c b/drivers/base/bootvid/i386/pc/vga.c index a7b771f23df..f945008103f 100644 --- a/drivers/base/bootvid/i386/pc/vga.c +++ b/drivers/base/bootvid/i386/pc/vga.c @@ -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; } } } diff --git a/drivers/base/bootvid/i386/pc98/bootvid.c b/drivers/base/bootvid/i386/pc98/bootvid.c index ab2d6c84759..46207ebbce6 100644 --- a/drivers/base/bootvid/i386/pc98/bootvid.c +++ b/drivers/base/bootvid/i386/pc98/bootvid.c @@ -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)) diff --git a/drivers/base/bootvid/i386/xbox/bootvid.c b/drivers/base/bootvid/i386/xbox/bootvid.c index 70af09f66f2..c83fba1e989 100644 --- a/drivers/base/bootvid/i386/xbox/bootvid.c +++ b/drivers/base/bootvid/i386/xbox/bootvid.c @@ -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)) diff --git a/drivers/base/bootvid/precomp.h b/drivers/base/bootvid/precomp.h index 1d2cbc033bd..f463fa9dea2 100644 --- a/drivers/base/bootvid/precomp.h +++ b/drivers/base/bootvid/precomp.h @@ -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 diff --git a/ntoskrnl/inbv/inbv.c b/ntoskrnl/inbv/inbv.c index 3ead8a660db..0d1c4123e1f 100644 --- a/ntoskrnl/inbv/inbv.c +++ b/ntoskrnl/inbv/inbv.c @@ -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); } } diff --git a/ntoskrnl/include/internal/inbv.h b/ntoskrnl/include/internal/inbv.h index 36ac96cabeb..03bff604132 100644 --- a/ntoskrnl/include/internal/inbv.h +++ b/ntoskrnl/include/internal/inbv.h @@ -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 ); // diff --git a/sdk/include/reactos/drivers/bootvid/bootvid.h b/sdk/include/reactos/drivers/bootvid/bootvid.h index 45f975232fd..76a81c09c23 100644 --- a/sdk/include/reactos/drivers/bootvid/bootvid.h +++ b/sdk/include/reactos/drivers/bootvid/bootvid.h @@ -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