[NTOS:IO] Improve an alignment
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Thu, 4 Jan 2018 17:29:24 +0000 (18:29 +0100)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Thu, 15 Aug 2019 16:04:57 +0000 (18:04 +0200)
ntoskrnl/io/iomgr/device.c

index 3810dd5..56a4bd7 100644 (file)
@@ -1084,7 +1084,8 @@ IoCreateDevice(IN PDRIVER_OBJECT DriverObject,
     if (DeviceName) ObjectAttributes.Attributes |= OBJ_PERMANENT;
 
     /* Align the Extension Size to 8-bytes */
-    AlignedDeviceExtensionSize = (DeviceExtensionSize + 7) &~ 7;
+    AlignedDeviceExtensionSize = ALIGN_UP_BY(DeviceExtensionSize,
+                                             MEMORY_ALLOCATION_ALIGNMENT);
 
     /* Total Size */
     TotalSize = AlignedDeviceExtensionSize +