- DeviceExtension should be NULL if the caller didn't specify any size for one.
authorAlex Ionescu <aionescu@gmail.com>
Fri, 5 Aug 2005 21:16:51 +0000 (21:16 +0000)
committerAlex Ionescu <aionescu@gmail.com>
Fri, 5 Aug 2005 21:16:51 +0000 (21:16 +0000)
svn path=/trunk/; revision=17084

reactos/ntoskrnl/io/device.c

index d4fcc47..ec697dd 100644 (file)
@@ -503,7 +503,9 @@ IoCreateDevice(PDRIVER_OBJECT DriverObject,
     /* Set Device Object Data */
     CreatedDeviceObject->DeviceType = DeviceType;
     CreatedDeviceObject->Characteristics = DeviceCharacteristics;
-    CreatedDeviceObject->DeviceExtension = CreatedDeviceObject + 1;
+    CreatedDeviceObject->DeviceExtension = DeviceExtensionSize ?
+                                           CreatedDeviceObject + 1 :
+                                           NULL;
     CreatedDeviceObject->StackSize = 1;
     CreatedDeviceObject->AlignmentRequirement = 1; /* FIXME */