Fix reading parameters from registry

CID 1411973

svn path=/trunk/; revision=74987
This commit is contained in:
Pierre Schweitzer 2017-06-10 20:46:28 +00:00
parent be0666cf16
commit fc8affc217

View file

@ -5406,14 +5406,14 @@ RxReadRegistryParameters(
Status = ZwQueryValueKey(KeyHandle, &ParamName, KeyValuePartialInformation, PartialInfo, sizeof(Buffer), &ResultLength); Status = ZwQueryValueKey(KeyHandle, &ParamName, KeyValuePartialInformation, PartialInfo, sizeof(Buffer), &ResultLength);
if (NT_SUCCESS(Status) && PartialInfo->Type == REG_DWORD) if (NT_SUCCESS(Status) && PartialInfo->Type == REG_DWORD)
{ {
DisableByteRangeLockingOnReadOnlyFiles = ((ULONG)PartialInfo->Data != 0); DisableByteRangeLockingOnReadOnlyFiles = (*(PULONG)PartialInfo->Data != 0);
} }
RtlInitUnicodeString(&ParamName, L"ReadAheadGranularity"); RtlInitUnicodeString(&ParamName, L"ReadAheadGranularity");
Status = ZwQueryValueKey(KeyHandle, &ParamName, KeyValuePartialInformation, PartialInfo, sizeof(Buffer), &ResultLength); Status = ZwQueryValueKey(KeyHandle, &ParamName, KeyValuePartialInformation, PartialInfo, sizeof(Buffer), &ResultLength);
if (NT_SUCCESS(Status) && PartialInfo->Type == REG_DWORD) if (NT_SUCCESS(Status) && PartialInfo->Type == REG_DWORD)
{ {
ULONG Granularity = (ULONG)PartialInfo->Data; ULONG Granularity = *(PULONG)PartialInfo->Data;
if (Granularity > 16) if (Granularity > 16)
{ {
@ -5427,7 +5427,7 @@ RxReadRegistryParameters(
Status = ZwQueryValueKey(KeyHandle, &ParamName, KeyValuePartialInformation, PartialInfo, sizeof(Buffer), &ResultLength); Status = ZwQueryValueKey(KeyHandle, &ParamName, KeyValuePartialInformation, PartialInfo, sizeof(Buffer), &ResultLength);
if (NT_SUCCESS(Status) && PartialInfo->Type == REG_DWORD) if (NT_SUCCESS(Status) && PartialInfo->Type == REG_DWORD)
{ {
DisableFlushOnCleanup = ((ULONG)PartialInfo->Data != 0); DisableFlushOnCleanup = (*(PULONG)PartialInfo->Data != 0);
} }
ZwClose(KeyHandle); ZwClose(KeyHandle);