https://git.reactos.org/?p=reactos.git;a=commitdiff;h=da9384b918842ef2d0fdb…
commit da9384b918842ef2d0fdbbd2c5b01486315da542
Author: Dmitry Borisov <di.sean(a)protonmail.com>
AuthorDate: Sat Jun 20 22:12:56 2020 +0600
Commit: Stanislav Motylkov <x86corez(a)gmail.com>
CommitDate: Wed Jul 29 19:10:38 2020 +0300
[BOOTVID] Annotate some functions to avoid confusing (#2936)
Also fix some magic constants.
---
drivers/base/bootvid/arm/bootvid.c | 2 +-
drivers/base/bootvid/common.c | 8 ++++----
drivers/base/bootvid/i386/pc/vga.c | 2 +-
drivers/base/bootvid/i386/pc98/bootvid.c | 4 ++--
drivers/base/bootvid/i386/xbox/bootvid.c | 4 ++--
sdk/include/reactos/drivers/bootvid/bootvid.h | 8 ++++----
6 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/base/bootvid/arm/bootvid.c b/drivers/base/bootvid/arm/bootvid.c
index d34f08140a5..b56e4e2499d 100644
--- a/drivers/base/bootvid/arm/bootvid.c
+++ b/drivers/base/bootvid/arm/bootvid.c
@@ -255,7 +255,7 @@ VidCleanUp(VOID)
VOID
NTAPI
VidScreenToBufferBlt(
- _Out_ PUCHAR Buffer,
+ _Out_writes_bytes_(Delta * Height) PUCHAR Buffer,
_In_ ULONG Left,
_In_ ULONG Top,
_In_ ULONG Width,
diff --git a/drivers/base/bootvid/common.c b/drivers/base/bootvid/common.c
index 7979ea42a04..87257167ec0 100644
--- a/drivers/base/bootvid/common.c
+++ b/drivers/base/bootvid/common.c
@@ -51,7 +51,7 @@ BitBlt(
_In_ ULONG Top,
_In_ ULONG Width,
_In_ ULONG Height,
- _In_ PUCHAR Buffer,
+ _In_reads_bytes_(Delta * Height) PUCHAR Buffer,
_In_ ULONG BitsPerPixel,
_In_ ULONG Delta)
{
@@ -318,7 +318,7 @@ VidSetTextColor(
VOID
NTAPI
VidDisplayStringXY(
- _In_ PUCHAR String,
+ _In_z_ PUCHAR String,
_In_ ULONG Left,
_In_ ULONG Top,
_In_ BOOLEAN Transparent)
@@ -368,7 +368,7 @@ VidSetScrollRegion(
VOID
NTAPI
VidDisplayString(
- _In_ PUCHAR String)
+ _In_z_ PUCHAR String)
{
/* Start looping the string */
for (; *String; ++String)
@@ -446,7 +446,7 @@ VidDisplayString(
VOID
NTAPI
VidBufferToScreenBlt(
- _In_ PUCHAR Buffer,
+ _In_reads_bytes_(Delta * Height) PUCHAR Buffer,
_In_ ULONG Left,
_In_ ULONG Top,
_In_ ULONG Width,
diff --git a/drivers/base/bootvid/i386/pc/vga.c b/drivers/base/bootvid/i386/pc/vga.c
index 3f6c9bc703c..9eb394626e6 100644
--- a/drivers/base/bootvid/i386/pc/vga.c
+++ b/drivers/base/bootvid/i386/pc/vga.c
@@ -331,7 +331,7 @@ VidCleanUp(VOID)
VOID
NTAPI
VidScreenToBufferBlt(
- _Out_ PUCHAR Buffer,
+ _Out_writes_bytes_(Delta * Height) PUCHAR Buffer,
_In_ ULONG Left,
_In_ ULONG Top,
_In_ ULONG Width,
diff --git a/drivers/base/bootvid/i386/pc98/bootvid.c
b/drivers/base/bootvid/i386/pc98/bootvid.c
index e4b8b1b834b..459c8e07ca4 100644
--- a/drivers/base/bootvid/i386/pc98/bootvid.c
+++ b/drivers/base/bootvid/i386/pc98/bootvid.c
@@ -411,7 +411,7 @@ VidResetDisplay(
VOID
NTAPI
VidScreenToBufferBlt(
- _Out_ PUCHAR Buffer,
+ _Out_writes_bytes_(Delta * Height) PUCHAR Buffer,
_In_ ULONG Left,
_In_ ULONG Top,
_In_ ULONG Width,
@@ -430,7 +430,7 @@ VidScreenToBufferBlt(
{
OutputBuffer = Buffer + Y * Delta;
- for (X = 0; X < Width; X += 2)
+ for (X = 0; X < Width; X += sizeof(USHORT))
{
Px = READ_REGISTER_USHORT(PixelsPosition++);
*OutputBuffer++ = (FIRSTBYTE(Px) << 4) | (SECONDBYTE(Px) & 0x0F);
diff --git a/drivers/base/bootvid/i386/xbox/bootvid.c
b/drivers/base/bootvid/i386/xbox/bootvid.c
index 5fddab54769..61e94a44d08 100644
--- a/drivers/base/bootvid/i386/xbox/bootvid.c
+++ b/drivers/base/bootvid/i386/xbox/bootvid.c
@@ -412,7 +412,7 @@ VidSolidColorFill(
VOID
NTAPI
VidScreenToBufferBlt(
- _Out_ PUCHAR Buffer,
+ _Out_writes_bytes_(Delta * Height) PUCHAR Buffer,
_In_ ULONG Left,
_In_ ULONG Top,
_In_ ULONG Width,
@@ -430,7 +430,7 @@ VidScreenToBufferBlt(
PUCHAR Buf = Buffer + y * Delta;
/* Start the X inner loop */
- for (ULONG x = 0; x < Width; x += 2)
+ for (ULONG x = 0; x < Width; x += sizeof(USHORT))
{
/* Read the current value */
*Buf = (*Back++ & 0xF) << 4;
diff --git a/sdk/include/reactos/drivers/bootvid/bootvid.h
b/sdk/include/reactos/drivers/bootvid/bootvid.h
index 6df26e96739..6747fd415b4 100644
--- a/sdk/include/reactos/drivers/bootvid/bootvid.h
+++ b/sdk/include/reactos/drivers/bootvid/bootvid.h
@@ -30,7 +30,7 @@ VidSetTextColor(
VOID
NTAPI
VidDisplayStringXY(
- _In_ PUCHAR String,
+ _In_z_ PUCHAR String,
_In_ ULONG Left,
_In_ ULONG Top,
_In_ BOOLEAN Transparent);
@@ -50,7 +50,7 @@ VidCleanUp(VOID);
VOID
NTAPI
VidBufferToScreenBlt(
- _In_ PUCHAR Buffer,
+ _In_reads_bytes_(Delta * Height) PUCHAR Buffer,
_In_ ULONG Left,
_In_ ULONG Top,
_In_ ULONG Width,
@@ -60,7 +60,7 @@ VidBufferToScreenBlt(
VOID
NTAPI
VidDisplayString(
- _In_ PUCHAR String);
+ _In_z_ PUCHAR String);
VOID
NTAPI
@@ -72,7 +72,7 @@ VidBitBlt(
VOID
NTAPI
VidScreenToBufferBlt(
- _Out_ PUCHAR Buffer,
+ _Out_writes_bytes_(Delta * Height) PUCHAR Buffer,
_In_ ULONG Left,
_In_ ULONG Top,
_In_ ULONG Width,