mirror of
https://github.com/reactos/reactos.git
synced 2024-10-07 18:04:41 +00:00
[USBHUB]
- Partly implement IOCTL_USB_GET_NODE_CONNECTION_NAME - Complete power irps svn path=/trunk/; revision=57616
This commit is contained in:
parent
d0d756519b
commit
b1002c5e57
|
@ -2062,6 +2062,7 @@ USBHUB_FdoHandleDeviceControl(
|
||||||
PUSB_NODE_CONNECTION_INFORMATION NodeConnectionInfo;
|
PUSB_NODE_CONNECTION_INFORMATION NodeConnectionInfo;
|
||||||
PHUB_CHILDDEVICE_EXTENSION ChildDeviceExtension;
|
PHUB_CHILDDEVICE_EXTENSION ChildDeviceExtension;
|
||||||
PUSB_NODE_CONNECTION_DRIVERKEY_NAME NodeKey;
|
PUSB_NODE_CONNECTION_DRIVERKEY_NAME NodeKey;
|
||||||
|
PUSB_NODE_CONNECTION_NAME ConnectionName;
|
||||||
ULONG Index, Length;
|
ULONG Index, Length;
|
||||||
|
|
||||||
// get stack location
|
// get stack location
|
||||||
|
@ -2141,7 +2142,6 @@ USBHUB_FdoHandleDeviceControl(
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// done
|
// done
|
||||||
Irp->IoStatus.Information = sizeof(USB_NODE_INFORMATION);
|
Irp->IoStatus.Information = sizeof(USB_NODE_INFORMATION);
|
||||||
Status = STATUS_SUCCESS;
|
Status = STATUS_SUCCESS;
|
||||||
|
@ -2188,7 +2188,7 @@ USBHUB_FdoHandleDeviceControl(
|
||||||
if (Length + sizeof(USB_NODE_CONNECTION_DRIVERKEY_NAME) > IoStack->Parameters.DeviceIoControl.OutputBufferLength)
|
if (Length + sizeof(USB_NODE_CONNECTION_DRIVERKEY_NAME) > IoStack->Parameters.DeviceIoControl.OutputBufferLength)
|
||||||
{
|
{
|
||||||
// terminate node key name
|
// terminate node key name
|
||||||
NodeKey->DriverKeyName[0] = 0;
|
NodeKey->DriverKeyName[0] = UNICODE_NULL;
|
||||||
Irp->IoStatus.Information = sizeof(USB_NODE_CONNECTION_DRIVERKEY_NAME);
|
Irp->IoStatus.Information = sizeof(USB_NODE_CONNECTION_DRIVERKEY_NAME);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -2203,6 +2203,25 @@ USBHUB_FdoHandleDeviceControl(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
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
|
else
|
||||||
{
|
{
|
||||||
DPRINT1("UNIMPLEMENTED FdoHandleDeviceControl IoCtl %x InputBufferLength %x OutputBufferLength %x\n", IoStack->Parameters.DeviceIoControl.IoControlCode,
|
DPRINT1("UNIMPLEMENTED FdoHandleDeviceControl IoCtl %x InputBufferLength %x OutputBufferLength %x\n", IoStack->Parameters.DeviceIoControl.IoControlCode,
|
||||||
|
|
|
@ -184,8 +184,39 @@ USBHUB_DispatchPower(
|
||||||
PDEVICE_OBJECT DeviceObject,
|
PDEVICE_OBJECT DeviceObject,
|
||||||
PIRP Irp)
|
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);
|
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||||
return STATUS_NOT_SUPPORTED;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
|
|
Loading…
Reference in a new issue