[WIN32SS:NTUSER] Remove some hardcoded buffer sizes + number of chars vs. bytes mixup.

This commit is contained in:
Hermès Bélusca-Maïto 2019-01-02 20:53:42 +01:00
parent cc3fbfefac
commit fb4a6e38c7
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0

View file

@ -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);
}