From 4c7bbd9c39ae73285faff7fc1184b719a093d3aa Mon Sep 17 00:00:00 2001 From: James Tabor Date: Sun, 5 Jun 2005 15:50:55 +0000 Subject: [PATCH] Adding symbolic link to USBFDO. svn path=/trunk/; revision=15807 --- reactos/drivers/usb/cromwell/uhci/uhci_main.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/reactos/drivers/usb/cromwell/uhci/uhci_main.c b/reactos/drivers/usb/cromwell/uhci/uhci_main.c index f9174255e31..f55d228ca3a 100644 --- a/reactos/drivers/usb/cromwell/uhci/uhci_main.c +++ b/reactos/drivers/usb/cromwell/uhci/uhci_main.c @@ -37,6 +37,8 @@ AddDevice(PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT pdo) NTSTATUS Status; WCHAR DeviceBuffer[20]; UNICODE_STRING DeviceName; + WCHAR LinkDeviceBuffer[20]; + UNICODE_STRING LinkDeviceName; POHCI_DRIVER_EXTENSION DriverExtension; POHCI_DEVICE_EXTENSION DeviceExtension; ULONG Size, DeviceNumber; @@ -62,7 +64,7 @@ AddDevice(PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT pdo) // Create a unicode device name DeviceNumber = 0; //TODO: Allocate new device number every time - swprintf(DeviceBuffer, L"\\Device\\USBPDO-%lu", DeviceNumber); + swprintf(DeviceBuffer, L"\\Device\\USBFDO-%lu", DeviceNumber); RtlInitUnicodeString(&DeviceName, DeviceBuffer); Status = IoCreateDevice(DriverObject, @@ -93,6 +95,16 @@ AddDevice(PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT pdo) DeviceExtension->FunctionalDeviceObject = fdo; DeviceExtension->DriverExtension = DriverExtension; + swprintf(LinkDeviceBuffer, L"\\??\\HCD%lu", DeviceNumber); + RtlInitUnicodeString(&LinkDeviceName, LinkDeviceBuffer); + Status = IoCreateSymbolicLink(&LinkDeviceName, &DeviceName); + + if (!NT_SUCCESS(Status)) + { + DPRINT1("IoCreateSymbolicLink call failed with status 0x%08x\n", Status); + return Status; + } + /* Get bus number from the upper level bus driver. */ Size = sizeof(ULONG); /* Status = IoGetDeviceProperty(