/* PRIVATE FUNCTIONS **********************************************************/
+VOID
+NTAPI
+IopReadyDeviceObjects(IN PDRIVER_OBJECT Driver)
+{
+ PDEVICE_OBJECT DeviceObject;
+ PAGED_CODE();
+
+ /* Set the driver as initialized */
+ Driver->Flags |= DRVO_INITIALIZED;
+ DeviceObject = Driver->DeviceObject;
+ while (DeviceObject)
+ {
+ /* Set every device as initialized too */
+ DeviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
+ DeviceObject = DeviceObject->NextDevice;
+ }
+}
+
VOID
NTAPI
IopDeleteDevice(IN PVOID ObjectBody)
{
NTSTATUS Status;
IO_STACK_LOCATION Stack = {0};
- IO_STATUS_BLOCK IoStatusBlock;
PDEVICE_RELATIONS DeviceRelations;
PDEVICE_OBJECT DeviceObject = NULL;
if (!DeviceObject) return STATUS_NO_SUCH_DEVICE;
/* Define input parameters */
+ Stack.MajorFunction = IRP_MJ_PNP;
+ Stack.MinorFunction = IRP_MN_QUERY_DEVICE_RELATIONS;
Stack.Parameters.QueryDeviceRelations.Type = TargetDeviceRelation;
Stack.FileObject = FileObject;
/* Call the driver to query all relations (IRP_MJ_PNP) */
- Status = IopInitiatePnpIrp(DeviceObject,
- &IoStatusBlock,
- IRP_MN_QUERY_DEVICE_RELATIONS,
- &Stack);
+ Status = IopSynchronousCall(DeviceObject,
+ &Stack,
+ (PVOID)&DeviceRelations);
if (!NT_SUCCESS(Status)) return Status;
- /* Get returned pointer to DEVICE_RELATIONS */
- DeviceRelations = (PDEVICE_RELATIONS)IoStatusBlock.Information;
-
/* Make sure it's not NULL and contains only one object */
ASSERT(DeviceRelations);
ASSERT(DeviceRelations->Count == 1);