[RDBSS]
authorPierre Schweitzer <pierre@reactos.org>
Sat, 10 Jun 2017 20:46:28 +0000 (20:46 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Sat, 10 Jun 2017 20:46:28 +0000 (20:46 +0000)
Fix reading parameters from registry

CID 1411973

svn path=/trunk/; revision=74987

reactos/sdk/lib/drivers/rdbsslib/rdbss.c

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