mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Adding symbolic link to USBFDO.
svn path=/trunk/; revision=15807
This commit is contained in:
parent
34fea9606b
commit
4c7bbd9c39
1 changed files with 13 additions and 1 deletions
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue