IoCreateDevice(): Fixed some missing PDEVICE_OBJECT initializations
authorshort <>
Mon, 4 Nov 2002 15:01:50 +0000 (15:01 +0000)
committershort <>
Mon, 4 Nov 2002 15:01:50 +0000 (15:01 +0000)
ntoskrnl/io/device.c

index 27ee41a..21201ed 100644 (file)
@@ -668,9 +668,12 @@ IoCreateDevice(PDRIVER_OBJECT DriverObject,
      }
   
   CreatedDeviceObject->Type = DeviceType;
+  CreatedDeviceObject->Size = sizeof (*CreatedDeviceObject);
+  CreatedDeviceObject->ReferenceCount = 0;     /* or 1? it is floating unused this way */
   CreatedDeviceObject->DriverObject = DriverObject;
   CreatedDeviceObject->CurrentIrp = NULL;
   CreatedDeviceObject->Flags = 0;
+  CreatedDeviceObject->Characteristics = DeviceCharacteristics;
 
   CreatedDeviceObject->DeviceExtension = 
     ExAllocatePoolWithTag(NonPagedPool, DeviceExtensionSize,