#endif /* !LIBCAPTIVE */
}
+#ifndef LIBCAPTIVE
+ /* W32 expects CreatedDeviceObject->DeviceExtension to follow *CreatedDeviceObject!
+ * Undocumented by W32!
+ * See also IoCreateDevice().
+ */
/* free device extension */
if (DeviceObject->DeviceObjectExtension)
ExFreePool (DeviceObject->DeviceObjectExtension);
+#endif /* LIBCAPTIVE */
/* remove device from driver device list */
Previous = DeviceObject->DriverObject->DeviceObject;
assert_irql(PASSIVE_LEVEL);
+ assert(sizeof(CreatedDeviceObject->Queue.Wcb) == 40);
+ assert(sizeof(CreatedDeviceObject->DeviceQueue) == 20);
+ assert(sizeof(CreatedDeviceObject->Dpc) == 32);
+ assert(sizeof(CreatedDeviceObject->DeviceLock) == 16);
+ assert(sizeof(DEVICE_OBJECT) == 184);
+
if (DeviceName != NULL)
{
DPRINT("IoCreateDevice(DriverObject %x, DeviceName %S)\n",DriverObject,
DPRINT("IoCreateDevice(DriverObject %x)\n",DriverObject);
}
+#ifdef LIBCAPTIVE
+ /* W32 expects CreatedDeviceObject->DeviceExtension to follow *CreatedDeviceObject!
+ * Undocumented by W32!
+ * See also IoDeleteDevice().
+ */
+ /* TODO:thread */
+ IoDeviceObjectType->NonpagedPoolCharge = sizeof (DEVICE_OBJECT) + DeviceExtensionSize;
+#endif /* LIBCAPTIVE */
+
if (DeviceName != NULL)
{
InitializeObjectAttributes(&ObjectAttributes,DeviceName,0,NULL,NULL);
(PVOID*)&CreatedDeviceObject);
}
+#ifdef LIBCAPTIVE
+ /* W32 expects CreatedDeviceObject->DeviceExtension to follow *CreatedDeviceObject!
+ * Undocumented by W32!
+ * See also IoDeleteDevice().
+ */
+ /* TODO:thread */
+ IoDeviceObjectType->NonpagedPoolCharge = sizeof (DEVICE_OBJECT); /* restore */
+#endif /* LIBCAPTIVE */
+
*DeviceObject = NULL;
if (!NT_SUCCESS(Status))
CreatedDeviceObject->CurrentIrp = NULL;
CreatedDeviceObject->Flags = 0;
CreatedDeviceObject->Characteristics = DeviceCharacteristics;
+ CreatedDeviceObject->Timer = NULL;
+ CreatedDeviceObject->Vpb = NULL;
+#ifndef LIBCAPTIVE
CreatedDeviceObject->DeviceExtension =
ExAllocatePoolWithTag(NonPagedPool, DeviceExtensionSize,
TAG_DEVICE_EXTENSION);
+#else /* !LIBCAPTIVE */
+ /* W32 expects CreatedDeviceObject->DeviceExtension to follow *CreatedDeviceObject!
+ * Undocumented by W32!
+ * See also IoDeleteDevice().
+ */
+ CreatedDeviceObject->DeviceExtension = (void *)(CreatedDeviceObject+1);
+#endif /* LIBCAPTIVE */
if (DeviceExtensionSize > 0 && CreatedDeviceObject->DeviceExtension == NULL)
{
ExFreePool(CreatedDeviceObject);