https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fb4a6e38c7c6e3db13fb0…
commit fb4a6e38c7c6e3db13fb07222d813ca979d17b18
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Wed Jan 2 20:53:42 2019 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Wed Jan 2 21:12:21 2019 +0100
[WIN32SS:NTUSER] Remove some hardcoded buffer sizes + number of chars vs. bytes
mixup.
---
win32ss/user/ntuser/display.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/win32ss/user/ntuser/display.c b/win32ss/user/ntuser/display.c
index e511600149..8ef37c9c4b 100644
--- a/win32ss/user/ntuser/display.c
+++ b/win32ss/user/ntuser/display.c
@@ -169,7 +169,7 @@ InitVideo(VOID)
Status =
RegOpenKey(L"\\REGISTRY\\MACHINE\\SYSTEM\\CurrentControlSet\\Control",
&hkey);
if (NT_SUCCESS(Status))
{
- cbValue = 256;
+ cbValue = sizeof(awcBuffer);
Status = RegQueryValue(hkey, L"SystemStartOptions", REG_SZ, awcBuffer,
&cbValue);
if (NT_SUCCESS(Status))
{
@@ -193,11 +193,11 @@ InitVideo(VOID)
}
/* Read the name of the VGA adapter */
- cbValue = 20;
+ cbValue = sizeof(awcDeviceName);
Status = RegQueryValue(hkey, L"VgaCompatible", REG_SZ, awcDeviceName,
&cbValue);
if (NT_SUCCESS(Status))
{
- iVGACompatible = _wtoi(&awcDeviceName[13]);
+ iVGACompatible =
_wtoi(&awcDeviceName[sizeof("\\Device\\Video")-1]);
ERR("VGA adapter = %lu\n", iVGACompatible);
}