PUSB_NODE_CONNECTION_INFORMATION NodeConnectionInfo;
PHUB_CHILDDEVICE_EXTENSION ChildDeviceExtension;
PUSB_NODE_CONNECTION_DRIVERKEY_NAME NodeKey;
+ PUSB_NODE_CONNECTION_NAME ConnectionName;
ULONG Index, Length;
// get stack location
}
break;
}
-
// done
Irp->IoStatus.Information = sizeof(USB_NODE_INFORMATION);
Status = STATUS_SUCCESS;
if (Length + sizeof(USB_NODE_CONNECTION_DRIVERKEY_NAME) > IoStack->Parameters.DeviceIoControl.OutputBufferLength)
{
// terminate node key name
- NodeKey->DriverKeyName[0] = 0;
+ NodeKey->DriverKeyName[0] = UNICODE_NULL;
Irp->IoStatus.Information = sizeof(USB_NODE_CONNECTION_DRIVERKEY_NAME);
}
else
}
}
}
+ else if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_USB_GET_NODE_CONNECTION_NAME)
+ {
+ if (IoStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(USB_NODE_CONNECTION_NAME))
+ {
+ // buffer too small
+ Status = STATUS_BUFFER_TOO_SMALL;
+ }
+ else
+ {
+ // FIXME support hubs
+ ConnectionName = (PUSB_NODE_CONNECTION_NAME)Irp->AssociatedIrp.SystemBuffer;
+ ConnectionName->ActualLength = 0;
+ ConnectionName->NodeName[0] = UNICODE_NULL;
+
+ // done
+ Irp->IoStatus.Information = sizeof(USB_NODE_CONNECTION_NAME);
+ Status = STATUS_SUCCESS;
+ }
+ }
else
{
DPRINT1("UNIMPLEMENTED FdoHandleDeviceControl IoCtl %x InputBufferLength %x OutputBufferLength %x\n", IoStack->Parameters.DeviceIoControl.IoControlCode,
PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{
+ PIO_STACK_LOCATION IoStack;
+
+ IoStack = IoGetCurrentIrpStackLocation(Irp);
+ DPRINT1("Power Function %x\n", IoStack->MinorFunction);
+
+ if (IoStack->MinorFunction == IRP_MN_SET_POWER)
+ {
+ PoStartNextPowerIrp(Irp);
+ Irp->IoStatus.Status = STATUS_SUCCESS;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return STATUS_SUCCESS;
+
+ }
+ else if (IoStack->MinorFunction == IRP_MN_QUERY_POWER)
+ {
+ PoStartNextPowerIrp(Irp);
+ Irp->IoStatus.Status = STATUS_SUCCESS;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return STATUS_SUCCESS;
+
+ }
+ else if (IoStack->MinorFunction == IRP_MN_WAIT_WAKE)
+ {
+ PoStartNextPowerIrp(Irp);
+ Irp->IoStatus.Status = STATUS_SUCCESS;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return STATUS_SUCCESS;
+ }
+
+ PoStartNextPowerIrp(Irp);
+ Irp->IoStatus.Status = STATUS_SUCCESS;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
- return STATUS_NOT_SUPPORTED;
+ return STATUS_SUCCESS;
}
VOID