2 * PROJECT: ReactOS Universal Serial Bus Bulk Enhanced Host Controller Interface
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: drivers/usb/usbccgp/pdo.c
5 * PURPOSE: USB device driver.
7 * Michael Martin (michael.martin@reactos.org)
8 * Johannes Anderwald (johannes.anderwald@reactos.org)
15 USBCCGP_PdoHandleQueryDeviceText(
16 IN PDEVICE_OBJECT DeviceObject
,
20 PPDO_DEVICE_EXTENSION PDODeviceExtension
;
21 LPWSTR GenericString
= L
"Composite USB Device";
23 // get device extension
25 PDODeviceExtension
= (PPDO_DEVICE_EXTENSION
)DeviceObject
->DeviceExtension
;
28 // is there a device description
30 if (PDODeviceExtension
->FunctionDescriptor
->FunctionDescription
.Length
)
35 Buffer
= AllocateItem(NonPagedPool
, PDODeviceExtension
->FunctionDescriptor
->FunctionDescription
.Length
+ sizeof(WCHAR
));
41 return STATUS_INSUFFICIENT_RESOURCES
;
47 Irp
->IoStatus
.Information
= (ULONG_PTR
)Buffer
;
48 RtlCopyMemory(Buffer
, PDODeviceExtension
->FunctionDescriptor
->FunctionDescription
.Buffer
, PDODeviceExtension
->FunctionDescriptor
->FunctionDescription
.Length
);
49 return STATUS_SUCCESS
;
53 // FIXME use GenericCompositeUSBDeviceString
56 Buffer
= AllocateItem(PagedPool
, (wcslen(GenericString
) + 1) * sizeof(WCHAR
));
62 return STATUS_INSUFFICIENT_RESOURCES
;
64 RtlCopyMemory(Buffer
, GenericString
, (wcslen(GenericString
) + 1) * sizeof(WCHAR
));
65 Irp
->IoStatus
.Information
= (ULONG_PTR
)Buffer
;
67 return STATUS_SUCCESS
;
71 USBCCGP_PdoHandleDeviceRelations(
72 IN PDEVICE_OBJECT DeviceObject
,
75 PDEVICE_RELATIONS DeviceRelations
;
76 PIO_STACK_LOCATION IoStack
;
78 DPRINT1("USBCCGP_PdoHandleDeviceRelations\n");
81 // get current irp stack location
83 IoStack
= IoGetCurrentIrpStackLocation(Irp
);
86 // check if relation type is BusRelations
88 if (IoStack
->Parameters
.QueryDeviceRelations
.Type
!= TargetDeviceRelation
)
91 // PDO handles only target device relation
93 return Irp
->IoStatus
.Status
;
97 // allocate device relations
99 DeviceRelations
= (PDEVICE_RELATIONS
)AllocateItem(PagedPool
, sizeof(DEVICE_RELATIONS
));
100 if (!DeviceRelations
)
105 return STATUS_INSUFFICIENT_RESOURCES
;
109 // initialize device relations
111 DeviceRelations
->Count
= 1;
112 DeviceRelations
->Objects
[0] = DeviceObject
;
113 ObReferenceObject(DeviceObject
);
118 Irp
->IoStatus
.Information
= (ULONG_PTR
)DeviceRelations
;
121 // completed successfully
123 return STATUS_SUCCESS
;
127 USBCCGP_PdoAppendInterfaceNumber(
129 IN ULONG InterfaceNumber
,
130 OUT LPWSTR
*OutString
)
132 ULONG Length
= 0, StringLength
;
136 // count length of string
141 StringLength
= wcslen(String
) + 1;
142 Length
+= StringLength
;
143 Length
+= 6; //&MI_XX
144 String
+= StringLength
;
148 // now allocate the buffer
150 String
= AllocateItem(NonPagedPool
, (Length
+ 2) * sizeof(WCHAR
));
156 return STATUS_INSUFFICIENT_RESOURCES
;
166 StringLength
= swprintf(String
, L
"%s&MI_%02x", DeviceId
) + 1;
167 Length
= wcslen(DeviceId
) + 1;
168 DPRINT1("String %p\n", String
);
173 String
+= StringLength
;
180 return STATUS_SUCCESS
;
185 USBCCGP_PdoHandleQueryId(
186 PDEVICE_OBJECT DeviceObject
,
189 PIO_STACK_LOCATION IoStack
;
190 PUNICODE_STRING DeviceString
= NULL
;
191 PPDO_DEVICE_EXTENSION PDODeviceExtension
;
196 // get current irp stack location
198 IoStack
= IoGetCurrentIrpStackLocation(Irp
);
201 // get device extension
203 PDODeviceExtension
= (PPDO_DEVICE_EXTENSION
)DeviceObject
->DeviceExtension
;
206 if (IoStack
->Parameters
.QueryId
.IdType
== BusQueryDeviceID
)
209 // handle query device id
211 Status
= USBCCGP_SyncForwardIrp(PDODeviceExtension
->NextDeviceObject
, Irp
);
212 if (NT_SUCCESS(Status
))
217 Buffer
= AllocateItem(NonPagedPool
, (wcslen((LPWSTR
)Irp
->IoStatus
.Information
) + 7) * sizeof(WCHAR
));
221 // append interface number
223 ASSERT(Irp
->IoStatus
.Information
);
224 swprintf(Buffer
, L
"%s&MI_%02x", (LPWSTR
)Irp
->IoStatus
.Information
, PDODeviceExtension
->FunctionDescriptor
->FunctionNumber
);
225 DPRINT1("BusQueryDeviceID %S\n", Buffer
);
227 ExFreePool((PVOID
)Irp
->IoStatus
.Information
);
228 Irp
->IoStatus
.Information
= (ULONG_PTR
)Buffer
;
235 Status
= STATUS_INSUFFICIENT_RESOURCES
;
240 else if (IoStack
->Parameters
.QueryId
.IdType
== BusQueryHardwareIDs
)
243 // handle instance id
245 DeviceString
= &PDODeviceExtension
->FunctionDescriptor
->HardwareId
;
247 else if (IoStack
->Parameters
.QueryId
.IdType
== BusQueryInstanceID
)
250 // handle instance id
252 Buffer
= AllocateItem(NonPagedPool
, 5 * sizeof(WCHAR
));
258 return STATUS_INSUFFICIENT_RESOURCES
;
262 // use function number
264 swprintf(Buffer
, L
"%04x", PDODeviceExtension
->FunctionDescriptor
->FunctionNumber
);
265 Irp
->IoStatus
.Information
= (ULONG_PTR
)Buffer
;
266 return STATUS_SUCCESS
;
268 else if (IoStack
->Parameters
.QueryId
.IdType
== BusQueryCompatibleIDs
)
271 // handle instance id
273 DeviceString
= &PDODeviceExtension
->FunctionDescriptor
->CompatibleId
;
279 ASSERT(DeviceString
!= NULL
);
284 Buffer
= AllocateItem(NonPagedPool
, DeviceString
->Length
+ sizeof(WCHAR
));
290 return STATUS_INSUFFICIENT_RESOURCES
;
296 RtlCopyMemory(Buffer
, DeviceString
->Buffer
, DeviceString
->Length
);
297 Irp
->IoStatus
.Information
= (ULONG_PTR
)Buffer
;
299 return STATUS_SUCCESS
;
304 PDEVICE_OBJECT DeviceObject
,
307 PIO_STACK_LOCATION IoStack
;
308 PPDO_DEVICE_EXTENSION PDODeviceExtension
;
312 // get current stack location
314 IoStack
= IoGetCurrentIrpStackLocation(Irp
);
317 // get device extension
319 PDODeviceExtension
= (PPDO_DEVICE_EXTENSION
)DeviceObject
->DeviceExtension
;
324 ASSERT(PDODeviceExtension
->Common
.IsFDO
== FALSE
);
326 switch(IoStack
->MinorFunction
)
328 case IRP_MN_QUERY_DEVICE_RELATIONS
:
331 // handle device relations
333 Status
= USBCCGP_PdoHandleDeviceRelations(DeviceObject
, Irp
);
336 case IRP_MN_QUERY_DEVICE_TEXT
:
339 // handle query device text
341 Status
= USBCCGP_PdoHandleQueryDeviceText(DeviceObject
, Irp
);
344 case IRP_MN_QUERY_ID
:
349 Status
= USBCCGP_PdoHandleQueryId(DeviceObject
, Irp
);
352 case IRP_MN_REMOVE_DEVICE
:
354 DPRINT1("IRP_MN_REMOVE_DEVICE\n");
356 /* Complete the IRP */
357 Irp
->IoStatus
.Status
= STATUS_SUCCESS
;
358 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);
360 /* Delete the device object */
361 IoDeleteDevice(DeviceObject
);
363 return STATUS_SUCCESS
;
365 case IRP_MN_QUERY_CAPABILITIES
:
368 // copy device capabilities
370 RtlCopyMemory(IoStack
->Parameters
.DeviceCapabilities
.Capabilities
, &PDODeviceExtension
->Capabilities
, sizeof(DEVICE_CAPABILITIES
));
372 /* Complete the IRP */
373 Irp
->IoStatus
.Status
= STATUS_SUCCESS
;
374 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);
375 return STATUS_SUCCESS
;
377 case IRP_MN_START_DEVICE
:
382 DPRINT1("[USBCCGP] PDO IRP_MN_START\n");
383 Status
= STATUS_SUCCESS
;
391 Status
= Irp
->IoStatus
.Status
;
398 if (Status
!= STATUS_PENDING
)
403 Irp
->IoStatus
.Status
= Status
;
408 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);
419 USBCCGP_BuildConfigurationDescriptor(
420 PDEVICE_OBJECT DeviceObject
,
423 PIO_STACK_LOCATION IoStack
;
424 PPDO_DEVICE_EXTENSION PDODeviceExtension
;
425 PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor
;
426 PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor
;
427 ULONG TotalSize
, Index
;
433 // get current stack location
435 IoStack
= IoGetCurrentIrpStackLocation(Irp
);
437 DPRINT1("USBCCGP_BuildConfigurationDescriptor\n");
440 // get device extension
442 PDODeviceExtension
= (PPDO_DEVICE_EXTENSION
)DeviceObject
->DeviceExtension
;
445 // get configuration descriptor
447 ConfigurationDescriptor
= PDODeviceExtension
->ConfigurationDescriptor
;
450 // calculate size of configuration descriptor
452 TotalSize
= sizeof(USB_CONFIGURATION_DESCRIPTOR
);
454 for(Index
= 0; Index
< PDODeviceExtension
->FunctionDescriptor
->NumberOfInterfaces
; Index
++)
457 // get current interface descriptor
459 InterfaceDescriptor
= PDODeviceExtension
->FunctionDescriptor
->InterfaceDescriptorList
[Index
];
462 // add to size and move to next descriptor
464 TotalSize
+= InterfaceDescriptor
->bLength
;
465 InterfaceDescriptor
= (PUSB_INTERFACE_DESCRIPTOR
)((ULONG_PTR
)InterfaceDescriptor
+ InterfaceDescriptor
->bLength
);
469 if ((ULONG_PTR
)InterfaceDescriptor
>= ((ULONG_PTR
)ConfigurationDescriptor
+ ConfigurationDescriptor
->wTotalLength
))
472 // reached end of configuration descriptor
478 // association descriptors are removed
480 if (InterfaceDescriptor
->bDescriptorType
!= USB_INTERFACE_ASSOCIATION_DESCRIPTOR_TYPE
)
482 if (InterfaceDescriptor
->bDescriptorType
== USB_INTERFACE_DESCRIPTOR_TYPE
)
485 // reached next descriptor
493 TotalSize
+= InterfaceDescriptor
->bLength
;
497 // move to next descriptor
499 InterfaceDescriptor
= (PUSB_INTERFACE_DESCRIPTOR
)((ULONG_PTR
)InterfaceDescriptor
+ InterfaceDescriptor
->bLength
);
504 // now allocate temporary buffer for the configuration descriptor
506 Buffer
= AllocateItem(NonPagedPool
, TotalSize
);
510 // failed to allocate buffer
512 DPRINT1("[USBCCGP] Failed to allocate %lu Bytes\n", TotalSize
);
513 return STATUS_INSUFFICIENT_RESOURCES
;
517 // first copy the configuration descriptor
519 RtlCopyMemory(Buffer
, ConfigurationDescriptor
, sizeof(USB_CONFIGURATION_DESCRIPTOR
));
520 BufferPtr
= (PUCHAR
)((ULONG_PTR
)Buffer
+ ConfigurationDescriptor
->bLength
);
522 for(Index
= 0; Index
< PDODeviceExtension
->FunctionDescriptor
->NumberOfInterfaces
; Index
++)
525 // get current interface descriptor
527 InterfaceDescriptor
= PDODeviceExtension
->FunctionDescriptor
->InterfaceDescriptorList
[Index
];
530 // copy descriptor and move to next descriptor
532 RtlCopyMemory(BufferPtr
, InterfaceDescriptor
, InterfaceDescriptor
->bLength
);
533 BufferPtr
+= InterfaceDescriptor
->bLength
;
534 InterfaceDescriptor
= (PUSB_INTERFACE_DESCRIPTOR
)((ULONG_PTR
)InterfaceDescriptor
+ InterfaceDescriptor
->bLength
);
538 if ((ULONG_PTR
)InterfaceDescriptor
>= ((ULONG_PTR
)ConfigurationDescriptor
+ ConfigurationDescriptor
->wTotalLength
))
541 // reached end of configuration descriptor
547 // association descriptors are removed
549 if (InterfaceDescriptor
->bDescriptorType
!= USB_INTERFACE_ASSOCIATION_DESCRIPTOR_TYPE
)
551 if (InterfaceDescriptor
->bDescriptorType
== USB_INTERFACE_DESCRIPTOR_TYPE
)
554 // reached next descriptor
562 RtlCopyMemory(BufferPtr
, InterfaceDescriptor
, InterfaceDescriptor
->bLength
);
563 BufferPtr
+= InterfaceDescriptor
->bLength
;
567 // move to next descriptor
569 InterfaceDescriptor
= (PUSB_INTERFACE_DESCRIPTOR
)((ULONG_PTR
)InterfaceDescriptor
+ InterfaceDescriptor
->bLength
);
574 // modify configuration descriptor
576 ConfigurationDescriptor
= Buffer
;
577 ConfigurationDescriptor
->wTotalLength
= TotalSize
;
578 ConfigurationDescriptor
->bNumInterfaces
= PDODeviceExtension
->FunctionDescriptor
->NumberOfInterfaces
;
583 Urb
= (PURB
)IoStack
->Parameters
.Others
.Argument1
;
589 RtlCopyMemory(Urb
->UrbControlDescriptorRequest
.TransferBuffer
, Buffer
, min(TotalSize
, Urb
->UrbControlDescriptorRequest
.TransferBufferLength
));
594 Urb
->UrbControlDescriptorRequest
.TransferBufferLength
= TotalSize
;
604 return STATUS_SUCCESS
;
608 USBCCGP_PDOSelectConfiguration(
609 PDEVICE_OBJECT DeviceObject
,
612 PIO_STACK_LOCATION IoStack
;
613 PPDO_DEVICE_EXTENSION PDODeviceExtension
;
615 PUSBD_INTERFACE_INFORMATION InterfaceInformation
;
616 ULONG InterfaceInformationCount
, Index
, InterfaceIndex
;
617 PUSBD_INTERFACE_LIST_ENTRY Entry
;
618 ULONG NeedSelect
, FoundInterface
;
622 // get current stack location
624 IoStack
= IoGetCurrentIrpStackLocation(Irp
);
627 // get device extension
629 PDODeviceExtension
= (PPDO_DEVICE_EXTENSION
)DeviceObject
->DeviceExtension
;
634 Urb
= (PURB
)IoStack
->Parameters
.Others
.Argument1
;
638 // is there already an configuration handle
640 if (Urb
->UrbSelectConfiguration
.ConfigurationHandle
)
645 return STATUS_SUCCESS
;
649 // count interface information
651 InterfaceInformationCount
= 0;
652 InterfaceInformation
= &Urb
->UrbSelectConfiguration
.Interface
;
655 InterfaceInformationCount
++;
656 InterfaceInformation
= (PUSBD_INTERFACE_INFORMATION
)((ULONG_PTR
)InterfaceInformation
+ InterfaceInformation
->Length
);
657 }while((ULONG_PTR
)InterfaceInformation
< (ULONG_PTR
)Urb
+ Urb
->UrbSelectConfiguration
.Hdr
.Length
);
660 // check all interfaces
662 InterfaceInformation
= &Urb
->UrbSelectConfiguration
.Interface
;
665 DPRINT1("Count %x\n", InterfaceInformationCount
);
668 DPRINT1("[USBCCGP] SelectConfiguration Function %x InterfaceNumber %x Alternative %x\n", PDODeviceExtension
->FunctionDescriptor
->FunctionNumber
, InterfaceInformation
->InterfaceNumber
, InterfaceInformation
->AlternateSetting
);
671 // search for the interface in the local interface list
673 FoundInterface
= FALSE
;
674 for(InterfaceIndex
= 0; InterfaceIndex
< PDODeviceExtension
->FunctionDescriptor
->NumberOfInterfaces
; InterfaceIndex
++)
676 if (PDODeviceExtension
->FunctionDescriptor
->InterfaceDescriptorList
[InterfaceIndex
]->bInterfaceNumber
== InterfaceInformation
->InterfaceNumber
)
678 // found interface entry
679 FoundInterface
= TRUE
;
689 DPRINT1("InterfaceInformation InterfaceNumber %x Alternative %x NumberOfPipes %x not found\n", InterfaceInformation
->InterfaceNumber
, InterfaceInformation
->AlternateSetting
, InterfaceInformation
->NumberOfPipes
);
691 return STATUS_INVALID_PARAMETER
;
695 // now query the total interface list
698 for(InterfaceIndex
= 0; InterfaceIndex
< PDODeviceExtension
->InterfaceListCount
; InterfaceIndex
++)
700 if (PDODeviceExtension
->InterfaceList
[InterfaceIndex
].Interface
->InterfaceNumber
== InterfaceInformation
->InterfaceNumber
)
705 Entry
= &PDODeviceExtension
->InterfaceList
[InterfaceIndex
];
716 // corruption detected
722 if (Entry
->InterfaceDescriptor
->bAlternateSetting
== InterfaceInformation
->AlternateSetting
)
725 for(InterfaceIndex
= 0; InterfaceIndex
< InterfaceInformation
->NumberOfPipes
; InterfaceIndex
++)
727 if (InterfaceInformation
->Pipes
[InterfaceIndex
].MaximumTransferSize
!= Entry
->Interface
->Pipes
[InterfaceIndex
].MaximumTransferSize
)
739 // need select as the interface number differ
747 // interface is already selected
749 RtlCopyMemory(InterfaceInformation
, Entry
->Interface
, min(InterfaceInformation
->Length
, Entry
->Interface
->Length
));
756 DPRINT1("Selecting InterfaceIndex %lu AlternateSetting %lu NumberOfPipes %lu\n", InterfaceInformation
->InterfaceNumber
, InterfaceInformation
->AlternateSetting
, InterfaceInformation
->NumberOfPipes
);
757 ASSERT(InterfaceInformation
->Length
== Entry
->Interface
->Length
);
762 NewUrb
= AllocateItem(NonPagedPool
, GET_SELECT_INTERFACE_REQUEST_SIZE(InterfaceInformation
->NumberOfPipes
));
768 return STATUS_INSUFFICIENT_RESOURCES
;
772 // now prepare interface urb
774 UsbBuildSelectInterfaceRequest(NewUrb
, GET_SELECT_INTERFACE_REQUEST_SIZE(InterfaceInformation
->NumberOfPipes
), PDODeviceExtension
->ConfigurationHandle
, InterfaceInformation
->InterfaceNumber
, InterfaceInformation
->AlternateSetting
);
777 // now select the interface
779 Status
= USBCCGP_SyncUrbRequest(PDODeviceExtension
->NextDeviceObject
, NewUrb
);
780 DPRINT1("SelectInterface Status %x\n", Status
);
785 if (NT_SUCCESS(Status
))
788 // update configuration info
790 ASSERT(Entry
->Interface
->Length
== NewUrb
->UrbSelectInterface
.Interface
.Length
);
791 ASSERT(InterfaceInformation
->Length
== NewUrb
->UrbSelectInterface
.Interface
.Length
);
792 RtlCopyMemory(Entry
->Interface
, &NewUrb
->UrbSelectInterface
.Interface
, NewUrb
->UrbSelectInterface
.Interface
.Length
);
795 // update provided interface information
797 RtlCopyMemory(InterfaceInformation
, Entry
->Interface
, Entry
->Interface
->Length
);
807 // move to next information
809 InterfaceInformation
= (PUSBD_INTERFACE_INFORMATION
)((ULONG_PTR
)InterfaceInformation
+ InterfaceInformation
->Length
);
811 }while(Index
< InterfaceInformationCount
);
814 // store configuration handle
816 Urb
->UrbSelectConfiguration
.ConfigurationHandle
= PDODeviceExtension
->ConfigurationHandle
;
818 DPRINT1("[USBCCGP] SelectConfiguration Function %x Completed\n", PDODeviceExtension
->FunctionDescriptor
->FunctionNumber
);
823 return STATUS_SUCCESS
;
827 PDO_HandleInternalDeviceControl(
828 PDEVICE_OBJECT DeviceObject
,
831 PIO_STACK_LOCATION IoStack
;
832 PPDO_DEVICE_EXTENSION PDODeviceExtension
;
837 // get current stack location
839 IoStack
= IoGetCurrentIrpStackLocation(Irp
);
842 // get device extension
844 PDODeviceExtension
= (PPDO_DEVICE_EXTENSION
)DeviceObject
->DeviceExtension
;
846 if (IoStack
->Parameters
.DeviceIoControl
.IoControlCode
== IOCTL_INTERNAL_USB_SUBMIT_URB
)
851 Urb
= (PURB
)IoStack
->Parameters
.Others
.Argument1
;
853 DPRINT("IOCTL_INTERNAL_USB_SUBMIT_URB Function %x\n", Urb
->UrbHeader
.Function
);
855 if (Urb
->UrbHeader
.Function
== URB_FUNCTION_SELECT_CONFIGURATION
)
858 // select configuration
860 Status
= USBCCGP_PDOSelectConfiguration(DeviceObject
, Irp
);
861 Irp
->IoStatus
.Status
= Status
;
862 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);
865 else if (Urb
->UrbHeader
.Function
== URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE
)
867 if(Urb
->UrbControlDescriptorRequest
.DescriptorType
== USB_DEVICE_DESCRIPTOR_TYPE
)
870 // is the buffer big enough
872 if (Urb
->UrbControlDescriptorRequest
.TransferBufferLength
< sizeof(USB_DEVICE_DESCRIPTOR
))
875 // invalid buffer size
877 DPRINT1("[USBCCGP] invalid device descriptor size %lu\n", Urb
->UrbControlDescriptorRequest
.TransferBufferLength
);
878 Urb
->UrbControlDescriptorRequest
.TransferBufferLength
= sizeof(USB_DEVICE_DESCRIPTOR
);
879 Irp
->IoStatus
.Status
= STATUS_INVALID_BUFFER_SIZE
;
880 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);
881 return STATUS_INVALID_BUFFER_SIZE
;
885 // copy device descriptor
887 ASSERT(Urb
->UrbControlDescriptorRequest
.TransferBuffer
);
888 RtlCopyMemory(Urb
->UrbControlDescriptorRequest
.TransferBuffer
, &PDODeviceExtension
->DeviceDescriptor
, sizeof(USB_DEVICE_DESCRIPTOR
));
889 Irp
->IoStatus
.Status
= STATUS_SUCCESS
;
890 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);
891 return STATUS_SUCCESS
;
893 else if (Urb
->UrbControlDescriptorRequest
.DescriptorType
== USB_CONFIGURATION_DESCRIPTOR_TYPE
)
896 // build configuration descriptor
898 Status
= USBCCGP_BuildConfigurationDescriptor(DeviceObject
, Irp
);
899 Irp
->IoStatus
.Status
= Status
;
900 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);
906 IoSkipCurrentIrpStackLocation(Irp
);
907 Status
= IoCallDriver(PDODeviceExtension
->NextDeviceObject
, Irp
);
914 DPRINT1("IOCTL %x\n", IoStack
->Parameters
.DeviceIoControl
.IoControlCode
);
915 DPRINT1("InputBufferLength %lu\n", IoStack
->Parameters
.DeviceIoControl
.InputBufferLength
);
916 DPRINT1("OutputBufferLength %lu\n", IoStack
->Parameters
.DeviceIoControl
.OutputBufferLength
);
917 DPRINT1("Type3InputBuffer %p\n", IoStack
->Parameters
.DeviceIoControl
.Type3InputBuffer
);
921 Irp
->IoStatus
.Status
= STATUS_NOT_IMPLEMENTED
;
922 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);
923 return STATUS_NOT_IMPLEMENTED
;
929 PDEVICE_OBJECT DeviceObject
,
932 PIO_STACK_LOCATION IoStack
;
935 /* get stack location */
936 IoStack
= IoGetCurrentIrpStackLocation(Irp
);
938 switch(IoStack
->MajorFunction
)
941 return PDO_HandlePnp(DeviceObject
, Irp
);
942 case IRP_MJ_INTERNAL_DEVICE_CONTROL
:
943 return PDO_HandleInternalDeviceControl(DeviceObject
, Irp
);
945 DPRINT1("PDO_Dispatch Function %x not implemented\n", IoStack
->MajorFunction
);
947 Status
= Irp
->IoStatus
.Status
;
948 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);