[BOOTVID] Annotate some functions to avoid confusing (#2936)
authorDmitry Borisov <di.sean@protonmail.com>
Sat, 20 Jun 2020 16:12:56 +0000 (22:12 +0600)
committerStanislav Motylkov <x86corez@gmail.com>
Wed, 29 Jul 2020 16:10:38 +0000 (19:10 +0300)
Also fix some magic constants.

drivers/base/bootvid/arm/bootvid.c
drivers/base/bootvid/common.c
drivers/base/bootvid/i386/pc/vga.c
drivers/base/bootvid/i386/pc98/bootvid.c
drivers/base/bootvid/i386/xbox/bootvid.c
sdk/include/reactos/drivers/bootvid/bootvid.h

index d34f081..b56e4e2 100644 (file)
@@ -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,
index 7979ea4..8725716 100644 (file)
@@ -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,
index 3f6c9bc..9eb3946 100644 (file)
@@ -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,
index e4b8b1b..459c8e0 100644 (file)
@@ -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);
index 5fddab5..61e94a4 100644 (file)
@@ -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;
index 6df26e9..6747fd4 100644 (file)
@@ -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,