PUSBHARDWAREDEVICE m_Hardware;
PHUBCONTROLLER m_HubController;
ULONG m_FDODeviceNumber;
- LPCWSTR m_USBType;
+ LPCSTR m_USBType;
};
//=================================================================================================
Status = m_Hardware->Initialize(m_DriverObject, m_FunctionalDeviceObject, m_PhysicalDeviceObject, m_NextDeviceObject);
if (!NT_SUCCESS(Status))
{
- DPRINT1("[%S] Failed to initialize hardware object %x\n", m_Hardware->GetUSBType(), Status);
+ DPRINT1("[%s] Failed to initialize hardware object %x\n", Status);
//
// failed to initialize hardware object, detach from device stack
//
PC_ASSERT(DeviceExtension->IsFDO);
- DPRINT1("[%S] HandleDeviceControl>Type: IoCtl %x InputBufferLength %lu OutputBufferLength %lu\n", m_USBType,
+ DPRINT1("[%s] HandleDeviceControl>Type: IoCtl %x InputBufferLength %lu OutputBufferLength %lu\n", m_USBType,
IoStack->Parameters.DeviceIoControl.IoControlCode,
IoStack->Parameters.DeviceIoControl.InputBufferLength,
IoStack->Parameters.DeviceIoControl.OutputBufferLength);
//
// informal debug print
//
- DPRINT1("[%S] Result %S\n", m_USBType, DriverKey->DriverKeyName);
+ DPRINT1("[%s] Result %S\n", m_USBType, DriverKey->DriverKeyName);
}
}
PC_ASSERT(IoStack->Parameters.DeviceIoControl.OutputBufferLength - sizeof(ULONG) - sizeof(WCHAR) >= ResultLength);
DriverKey->DriverKeyName[ResultLength / sizeof(WCHAR)] = L'\0';
- DPRINT1("[%S] Result %S\n", m_USBType, DriverKey->DriverKeyName);
+ DPRINT1("[%s] Result %S\n", m_USBType, DriverKey->DriverKeyName);
}
//
{
case IRP_MN_START_DEVICE:
{
- DPRINT("[%S] HandlePnp IRP_MN_START FDO\n", m_USBType);
+ DPRINT("[%s] HandlePnp IRP_MN_START FDO\n", m_USBType);
//
// first start lower device object
Status = SetSymbolicLink(TRUE);
}
- DPRINT("[%S] HandlePnp IRP_MN_START FDO: Status %x\n", m_USBType ,Status);
+ DPRINT("[%s] HandlePnp IRP_MN_START FDO: Status %x\n", m_USBType ,Status);
break;
}
case IRP_MN_QUERY_DEVICE_RELATIONS:
{
- DPRINT("[%S] HandlePnp IRP_MN_QUERY_DEVICE_RELATIONS Type %lx\n", m_USBType, IoStack->Parameters.QueryDeviceRelations.Type);
+ DPRINT("[%s] HandlePnp IRP_MN_QUERY_DEVICE_RELATIONS Type %lx\n", m_USBType, IoStack->Parameters.QueryDeviceRelations.Type);
if (m_HubController == NULL)
{
}
case IRP_MN_STOP_DEVICE:
{
- DPRINT("[%S] HandlePnp IRP_MN_STOP_DEVICE\n", m_USBType);
+ DPRINT("[%s] HandlePnp IRP_MN_STOP_DEVICE\n", m_USBType);
if (m_Hardware)
{
IoSkipCurrentIrpStackLocation(Irp);
return IoCallDriver(m_NextDeviceObject, Irp);
#else
- DPRINT1("[%S] Denying controller removal due to reinitialization bugs\n", m_USBType);
+ DPRINT1("[%s] Denying controller removal due to reinitialization bugs\n", m_USBType);
Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_UNSUCCESSFUL;
}
case IRP_MN_REMOVE_DEVICE:
{
- DPRINT("[%S] HandlePnp IRP_MN_REMOVE_DEVICE FDO\n", m_USBType);
+ DPRINT("[%s] HandlePnp IRP_MN_REMOVE_DEVICE FDO\n", m_USBType);
//
// delete the symbolic link
//
// construct device name
//
- swprintf(CharDeviceName, L"\\Device\\USBFDO-%lu", UsbDeviceNumber);
+ swprintf(CharDeviceName, L"\\Device\\USBFDO-%d", UsbDeviceNumber);
//
// initialize device name
//
if (!NT_SUCCESS(Status))
{
- DPRINT1("[%S] CreateFDO: Failed to create %wZ, Status %x\n", m_USBType, &DeviceName, Status);
+ DPRINT1("[%s] CreateFDO: Failed to create %wZ, Status %x\n", m_USBType, &DeviceName, Status);
return Status;
}
}
//
m_FDODeviceNumber = UsbDeviceNumber;
- DPRINT("[%S] CreateFDO: DeviceName %wZ\n", m_USBType, &DeviceName);
+ DPRINT("[%s] CreateFDO: DeviceName %wZ\n", m_USBType, &DeviceName);
/* done */
return Status;
//
// create legacy link
//
- swprintf(LinkName, L"\\DosDevices\\HCD%lu", m_FDODeviceNumber);
- swprintf(FDOName, L"\\Device\\USBFDO-%lu", m_FDODeviceNumber);
+ swprintf(LinkName, L"\\DosDevices\\HCD%d", m_FDODeviceNumber);
+ swprintf(FDOName, L"\\Device\\USBFDO-%d", m_FDODeviceNumber);
RtlInitUnicodeString(&Link, LinkName);
RtlInitUnicodeString(&FDO, FDOName);
//
// create legacy link
//
- swprintf(LinkName, L"\\DosDevices\\HCD%lu", m_FDODeviceNumber);
+ swprintf(LinkName, L"\\DosDevices\\HCD%d", m_FDODeviceNumber);
RtlInitUnicodeString(&Link, LinkName);
//
PULONG m_DeviceAddressBitmapBuffer;
LIST_ENTRY m_UsbDeviceList;
PIRP m_PendingSCEIrp;
- LPCWSTR m_USBType;
+ LPCSTR m_USBType;
//Internal Functions
// Get the number of ports and check each one for device connected
//
m_Hardware->GetDeviceDetails(NULL, NULL, &PortCount, NULL);
- DPRINT1("[%S] SCE Request %p TransferBufferLength %lu Flags %x MDL %p\n", m_USBType, Urb->UrbBulkOrInterruptTransfer.TransferBuffer, Urb->UrbBulkOrInterruptTransfer.TransferBufferLength, Urb->UrbBulkOrInterruptTransfer.TransferFlags, Urb->UrbBulkOrInterruptTransfer.TransferBufferMDL);
+ DPRINT1("[%s] SCE Request %p TransferBufferLength %lu Flags %x MDL %p\n", m_USBType, Urb->UrbBulkOrInterruptTransfer.TransferBuffer, Urb->UrbBulkOrInterruptTransfer.TransferBufferLength, Urb->UrbBulkOrInterruptTransfer.TransferFlags, Urb->UrbBulkOrInterruptTransfer.TransferBufferMDL);
TransferBuffer = (PUCHAR)Urb->UrbBulkOrInterruptTransfer.TransferBuffer;
{
m_Hardware->GetPortStatus(PortId, &PortStatus, &PortChange);
- DPRINT1("[%S] Port %lu: Status %x, Change %x\n", m_USBType, PortId, PortStatus, PortChange);
+ DPRINT1("[%s] Port %d: Status %x, Change %x\n", m_USBType, PortId, PortStatus, PortChange);
//
//
if (PortChange != 0)
{
- DPRINT1("[%S] Change state on port %lu\n", m_USBType, PortId);
+ DPRINT1("[%s] Change state on port %d\n", m_USBType, PortId);
// Set the value for the port number
*TransferBuffer = 1 << ((PortId + 1) & 7);
Changed = TRUE;
{
case IRP_MN_START_DEVICE:
{
- DPRINT("[%S] HandlePnp IRP_MN_START_DEVICE\n", m_USBType);
+ DPRINT("[%s] HandlePnp IRP_MN_START_DEVICE\n", m_USBType);
//
// register device interface
//
}
case IRP_MN_QUERY_ID:
{
- DPRINT("[%S] HandlePnp IRP_MN_QUERY_ID Type %x\n", m_USBType, IoStack->Parameters.QueryId.IdType);
+ DPRINT("[%s] HandlePnp IRP_MN_QUERY_ID Type %x\n", m_USBType, IoStack->Parameters.QueryId.IdType);
if (IoStack->Parameters.QueryId.IdType == BusQueryDeviceID)
{
if (!NT_SUCCESS(Status))
{
- DPRINT1("[%S] HandlePnp> failed to get hardware id %x\n", m_USBType, Status);
+ DPRINT1("[%s] HandlePnp> failed to get hardware id %x\n", m_USBType, Status);
VendorID = 0x8086;
DeviceID = 0x3A37;
}
Index++;
- DPRINT1("[%S] Name %S\n", m_USBType, Buffer);
+ DPRINT1("[%s] Name %S\n", m_USBType, Buffer);
//
// allocate buffer
}
case IRP_MN_QUERY_CAPABILITIES:
{
- DPRINT("[%S] HandlePnp IRP_MN_QUERY_CAPABILITIES\n", m_USBType);
+ DPRINT("[%s] HandlePnp IRP_MN_QUERY_CAPABILITIES\n", m_USBType);
DeviceCapabilities = (PDEVICE_CAPABILITIES)IoStack->Parameters.DeviceCapabilities.Capabilities;
}
case IRP_MN_QUERY_INTERFACE:
{
- DPRINT("[%S] HandlePnp IRP_MN_QUERY_INTERFACE\n", m_USBType);
+ DPRINT("[%s] HandlePnp IRP_MN_QUERY_INTERFACE\n", m_USBType);
//
// handle device interface requests
}
case IRP_MN_REMOVE_DEVICE:
{
- DPRINT("[%S] HandlePnp IRP_MN_REMOVE_DEVICE\n", m_USBType);
+ DPRINT("[%s] HandlePnp IRP_MN_REMOVE_DEVICE\n", m_USBType);
//
// deactivate device interface for BUS PDO
}
case IRP_MN_QUERY_DEVICE_RELATIONS:
{
- DPRINT("[%S] HandlePnp IRP_MN_QUERY_DEVICE_RELATIONS Type %x\n", m_USBType, IoStack->Parameters.QueryDeviceRelations.Type);
+ DPRINT("[%s] HandlePnp IRP_MN_QUERY_DEVICE_RELATIONS Type %x\n", m_USBType, IoStack->Parameters.QueryDeviceRelations.Type);
if (IoStack->Parameters.QueryDeviceRelations.Type == TargetDeviceRelation)
{
}
case IRP_MN_QUERY_BUS_INFORMATION:
{
- DPRINT("[%S] HandlePnp IRP_MN_QUERY_BUS_INFORMATION\n", m_USBType);
+ DPRINT("[%s] HandlePnp IRP_MN_QUERY_BUS_INFORMATION\n", m_USBType);
//
// allocate buffer for bus information
}
case IRP_MN_STOP_DEVICE:
{
- DPRINT("[%S] HandlePnp IRP_MN_STOP_DEVICE\n", m_USBType);
+ DPRINT("[%s] HandlePnp IRP_MN_STOP_DEVICE\n", m_USBType);
//
// stop device
//
}
case IRP_MN_SURPRISE_REMOVAL:
{
- DPRINT("[%S] HandlePnp IRP_MN_SURPRISE_REMOVAL\n", m_USBType);
+ DPRINT("[%s] HandlePnp IRP_MN_SURPRISE_REMOVAL\n", m_USBType);
Status = STATUS_SUCCESS;
break;
}
if (!EndPointDesc)
{
- DPRINT1("[%S] Error No EndpointDesc\n", m_USBType);
+ DPRINT1("[%s] Error No EndpointDesc\n", m_USBType);
Urb->UrbIsochronousTransfer.Hdr.Status = USBD_STATUS_INVALID_PIPE_HANDLE;
return STATUS_INVALID_PARAMETER;
}
// sanity checks
//
ASSERT(EndPointDesc);
- DPRINT("[%S] HandleIsochronousTransfer EndPointDesc %p Address %x bmAttributes %x\n", m_USBType, EndPointDesc, EndPointDesc->bEndpointAddress, EndPointDesc->bmAttributes);
+ DPRINT("[%s] HandleIsochronousTransfer EndPointDesc %p Address %x bmAttributes %x\n", m_USBType, EndPointDesc, EndPointDesc->bEndpointAddress, EndPointDesc->bmAttributes);
ASSERT((EndPointDesc->bmAttributes & USB_ENDPOINT_TYPE_MASK) == USB_ENDPOINT_TYPE_ISOCHRONOUS);
//
//
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
{
- DPRINT1("[%S] HandleIsochronousTransfer invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
+ DPRINT1("[%s] HandleIsochronousTransfer invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
//
// invalid device handle
//
// Else pend the IRP, to be completed when a device connects or disconnects.
//
- DPRINT("[%S] Pending SCE Irp\n", m_USBType);
+ DPRINT("[%s] Pending SCE Irp\n", m_USBType);
m_PendingSCEIrp = Irp;
IoMarkIrpPending(Irp);
return STATUS_PENDING;
//
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
{
- DPRINT1("[%S] HandleBulkOrInterruptTransfer invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
+ DPRINT1("[%s] HandleBulkOrInterruptTransfer invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
//
// invalid device handle
ULONG NumPort;
ULONG PortId;
- DPRINT("[%S] HandleClassOther> Request %x Value %x\n", m_USBType, Urb->UrbControlVendorClassRequest.Request, Urb->UrbControlVendorClassRequest.Value);
+ DPRINT("[%s] HandleClassOther> Request %x Value %x\n", m_USBType, Urb->UrbControlVendorClassRequest.Request, Urb->UrbControlVendorClassRequest.Value);
//
// get number of ports available
//
// request contains buffer of 2 ushort which are used from submitting port status and port change status
//
- DPRINT("[%S] PortId %x PortStatus %x PortChange %x\n", m_USBType, PortId, PortStatus, PortChange);
+ DPRINT("[%s] PortId %x PortStatus %x PortChange %x\n", m_USBType, PortId, PortStatus, PortChange);
Buffer = (PUSHORT)Urb->UrbControlVendorClassRequest.TransferBuffer;
//
Status = m_Hardware->ClearPortStatus(PortId, C_PORT_RESET);
break;
default:
- DPRINT("[%S] Unknown Value for Clear Feature %x \n", m_USBType, Urb->UrbControlVendorClassRequest.Value);
+ DPRINT("[%s] Unknown Value for Clear Feature %x \n", m_USBType, Urb->UrbControlVendorClassRequest.Value);
break;
}
break;
}
default:
- DPRINT1("[%S] Unsupported request id %x\n", m_USBType, Urb->UrbControlVendorClassRequest.Value);
+ DPRINT1("[%s] Unsupported request id %x\n", m_USBType, Urb->UrbControlVendorClassRequest.Value);
PC_ASSERT(FALSE);
}
break;
}
default:
- DPRINT1("[%S] HandleClassOther Unknown request code %x\n", m_USBType, Urb->UrbControlVendorClassRequest.Request);
+ DPRINT1("[%s] HandleClassOther Unknown request code %x\n", m_USBType, Urb->UrbControlVendorClassRequest.Request);
PC_ASSERT(0);
Status = STATUS_INVALID_DEVICE_REQUEST;
}
//
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
{
- DPRINT1("[%S] HandleSelectConfiguration invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
+ DPRINT1("[%s] HandleSelectConfiguration invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
//
// invalid device handle
//
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
{
- DPRINT1("[%S] HandleSelectInterface invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
+ DPRINT1("[%s] HandleSelectInterface invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
//
// invalid device handle
//
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
{
- DPRINT1("[%S] HandleGetStatusFromDevice invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
+ DPRINT1("[%s] HandleGetStatusFromDevice invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
//
// invalid device handle
//
Status = UsbDevice->SubmitSetupPacket(&CtrlSetup, Urb->UrbControlDescriptorRequest.TransferBufferLength, Urb->UrbControlDescriptorRequest.TransferBuffer);
ASSERT(Status == STATUS_SUCCESS);
- DPRINT1("[%S] HandleGetStatusFromDevice Status %x Length %lu DeviceStatus %x\n", m_USBType, Status, Urb->UrbControlDescriptorRequest.TransferBufferLength, *DeviceStatus);
+ DPRINT1("[%s] HandleGetStatusFromDevice Status %x Length %lu DeviceStatus %x\n", m_USBType, Status, Urb->UrbControlDescriptorRequest.TransferBufferLength, *DeviceStatus);
//
// done
PUSBDEVICE UsbDevice;
USB_DEFAULT_PIPE_SETUP_PACKET CtrlSetup;
- DPRINT("[%S] HandleClassDevice Request %x Class %x\n", m_USBType, Urb->UrbControlVendorClassRequest.Request, Urb->UrbControlVendorClassRequest.Value >> 8);
+ DPRINT("[%s] HandleClassDevice Request %x Class %x\n", m_USBType, Urb->UrbControlVendorClassRequest.Request, Urb->UrbControlVendorClassRequest.Value >> 8);
//
// check class request type
//
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
{
- DPRINT1("[%S] HandleClassDevice invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
+ DPRINT1("[%s] HandleClassDevice invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
//
// invalid device handle
{
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
{
- DPRINT1("[%S] HandleClassDevice invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
+ DPRINT1("[%s] HandleClassDevice invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
//
// invalid device handle
//
break;
}
default:
- DPRINT1("[%S] HandleClassDevice Class %x not implemented\n", m_USBType, Urb->UrbControlVendorClassRequest.Value >> 8);
+ DPRINT1("[%s] HandleClassDevice Class %x not implemented\n", m_USBType, Urb->UrbControlVendorClassRequest.Value >> 8);
break;
}
break;
//
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
{
- DPRINT1("[%S] HandleClassDevice invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
+ DPRINT1("[%s] HandleClassDevice invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
//
// invalid device handle
//
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
{
- DPRINT1("[%S] HandleGetDescriptorFromInterface invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
+ DPRINT1("[%s] HandleGetDescriptorFromInterface invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
//
// invalid device handle
Status = UsbDevice->SubmitSetupPacket(&CtrlSetup, Urb->UrbControlDescriptorRequest.TransferBufferLength, Urb->UrbControlDescriptorRequest.TransferBuffer);
if (!NT_SUCCESS(Status))
{
- DPRINT1("[%S] HandleGetDescriptorFromInterface failed with %x\n", m_USBType, Status);
+ DPRINT1("[%s] HandleGetDescriptorFromInterface failed with %x\n", m_USBType, Status);
}
//
PUSBDEVICE UsbDevice;
ULONG Length, BufferLength;
- DPRINT("[%S] HandleGetDescriptor Type %x\n", m_USBType, Urb->UrbControlDescriptorRequest.DescriptorType);
+ DPRINT("[%s] HandleGetDescriptor Type %x\n", m_USBType, Urb->UrbControlDescriptorRequest.DescriptorType);
//
// check descriptor type
//
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
{
- DPRINT1("[%S] HandleGetDescriptor invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
+ DPRINT1("[%s] HandleGetDescriptor invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
//
// invalid device handle
//
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
{
- DPRINT1("[%S] USB_CONFIGURATION_DESCRIPTOR_TYPE invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
+ DPRINT1("[%s] USB_CONFIGURATION_DESCRIPTOR_TYPE invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
//
// invalid device handle
//
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
{
- DPRINT1("[%S] USB_STRING_DESCRIPTOR_TYPE invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
+ DPRINT1("[%s] USB_STRING_DESCRIPTOR_TYPE invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
//
// invalid device handle
break;
}
default:
- DPRINT1("[%S] CHubController::HandleGetDescriptor DescriptorType %x unimplemented\n", m_USBType, Urb->UrbControlDescriptorRequest.DescriptorType);
+ DPRINT1("[%s] CHubController::HandleGetDescriptor DescriptorType %x unimplemented\n", m_USBType, Urb->UrbControlDescriptorRequest.DescriptorType);
break;
}
//
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
{
- DPRINT1("[%S] HandleClassEndpoint invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
+ DPRINT1("[%s] HandleClassEndpoint invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
//
// invalid device handle
DPRINT1("URB_FUNCTION_CLASS_ENDPOINT\n");
DPRINT1("TransferFlags %x\n", Urb->UrbControlVendorClassRequest.TransferFlags);
DPRINT1("TransferBufferLength %x\n", Urb->UrbControlVendorClassRequest.TransferBufferLength);
- DPRINT1("TransferBuffer %p\n", Urb->UrbControlVendorClassRequest.TransferBuffer);
- DPRINT1("TransferBufferMDL %p\n", Urb->UrbControlVendorClassRequest.TransferBufferMDL);
+ DPRINT1("TransferBuffer %x\n", Urb->UrbControlVendorClassRequest.TransferBuffer);
+ DPRINT1("TransferBufferMDL %x\n", Urb->UrbControlVendorClassRequest.TransferBufferMDL);
DPRINT1("RequestTypeReservedBits %x\n", Urb->UrbControlVendorClassRequest.RequestTypeReservedBits);
DPRINT1("Request %x\n", Urb->UrbControlVendorClassRequest.Request);
DPRINT1("Value %x\n", Urb->UrbControlVendorClassRequest.Value);
//
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
{
- DPRINT1("[%S] HandleVendorDevice invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
+ DPRINT1("[%s] HandleVendorDevice invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
//
// invalid device handle
//
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
{
- DPRINT1("[%S] HandleSyncResetAndClearStall invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
+ DPRINT1("[%s] HandleSyncResetAndClearStall invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
//
// invalid device handle
//
// failed
//
- DPRINT1("[%S] failed to reset pipe %x\n", m_USBType, Status);
+ DPRINT1("[%s] failed to reset pipe %x\n", m_USBType, Status);
}
//
Status = HandleClearStall(Irp, Urb);
}
- DPRINT1("[%S] URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL Status %x\n", m_USBType, Status);
+ DPRINT1("[%s] URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL Status %x\n", m_USBType, Status);
//
// reset data toggle
//
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
{
- DPRINT1("[%S] HandleAbortPipe invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
+ DPRINT1("[%s] HandleAbortPipe invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
//
// invalid device handle
// issue request
//
Status = UsbDevice->AbortPipe(EndpointDescriptor);
- DPRINT1("[%S] URB_FUNCTION_ABORT_PIPE Status %x\n", m_USBType, Status);
+ DPRINT1("[%s] URB_FUNCTION_ABORT_PIPE Status %x\n", m_USBType, Status);
//
// done
//
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
{
- DPRINT1("[%S] HandleClearStall invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
+ DPRINT1("[%s] HandleClearStall invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
//
// invalid device handle
// get device
//
UsbDevice = PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle);
- DPRINT1("[%S] URB_FUNCTION_SYNC_CLEAR_STALL\n", m_USBType);
+ DPRINT1("[%s] URB_FUNCTION_SYNC_CLEAR_STALL\n", m_USBType);
//
// initialize setup packet
//
Status = UsbDevice->SubmitSetupPacket(&CtrlSetup, 0, 0);
- DPRINT1("[%S] URB_FUNCTION_CLEAR_STALL Status %x\n", m_USBType, Status);
+ DPRINT1("[%s] URB_FUNCTION_CLEAR_STALL Status %x\n", m_USBType, Status);
//
// done
//
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
{
- DPRINT1("[%S] HandleClassInterface invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
+ DPRINT1("[%s] HandleClassInterface invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
//
// invalid device handle
DPRINT1("URB_FUNCTION_CLASS_INTERFACE\n");
DPRINT1("TransferFlags %x\n", Urb->UrbControlVendorClassRequest.TransferFlags);
DPRINT1("TransferBufferLength %x\n", Urb->UrbControlVendorClassRequest.TransferBufferLength);
- DPRINT1("TransferBuffer %p\n", Urb->UrbControlVendorClassRequest.TransferBuffer);
- DPRINT1("TransferBufferMDL %p\n", Urb->UrbControlVendorClassRequest.TransferBufferMDL);
+ DPRINT1("TransferBuffer %x\n", Urb->UrbControlVendorClassRequest.TransferBuffer);
+ DPRINT1("TransferBufferMDL %x\n", Urb->UrbControlVendorClassRequest.TransferBufferMDL);
DPRINT1("RequestTypeReservedBits %x\n", Urb->UrbControlVendorClassRequest.RequestTypeReservedBits);
DPRINT1("Request %x\n", Urb->UrbControlVendorClassRequest.Request);
DPRINT1("Value %x\n", Urb->UrbControlVendorClassRequest.Value);
//
// display error
//
- DPRINT1("[%S] URB_FUNCTION_CLASS_INTERFACE failed with Urb Status %x\n", m_USBType, Urb->UrbHeader.Status);
+ DPRINT1("[%s] URB_FUNCTION_CLASS_INTERFACE failed with Urb Status %x\n", m_USBType, Urb->UrbHeader.Status);
}
//
Status = HandleVendorDevice(Irp, Urb);
break;
default:
- DPRINT1("[%S] IOCTL_INTERNAL_USB_SUBMIT_URB Function %x NOT IMPLEMENTED\n", m_USBType, Urb->UrbHeader.Function);
+ DPRINT1("[%s] IOCTL_INTERNAL_USB_SUBMIT_URB Function %x NOT IMPLEMENTED\n", m_USBType, Urb->UrbHeader.Function);
break;
}
//
}
case IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE:
{
- DPRINT("[%S] IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE %p\n", m_USBType, this);
+ DPRINT("[%s] IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE %p\n", m_USBType, this);
if (IoStack->Parameters.Others.Argument1)
{
}
case IOCTL_INTERNAL_USB_GET_ROOTHUB_PDO:
{
- DPRINT("[%S] IOCTL_INTERNAL_USB_GET_ROOTHUB_PDO\n", m_USBType);
+ DPRINT("[%s] IOCTL_INTERNAL_USB_GET_ROOTHUB_PDO\n", m_USBType);
//
// this is the first request send, it delivers the PDO to the caller
}
case IOCTL_INTERNAL_USB_GET_HUB_COUNT:
{
- DPRINT("[%S] IOCTL_INTERNAL_USB_GET_HUB_COUNT\n", m_USBType);
+ DPRINT("[%s] IOCTL_INTERNAL_USB_GET_HUB_COUNT\n", m_USBType);
//
// after IOCTL_INTERNAL_USB_GET_ROOTHUB_PDO is delivered, the usbhub driver
}
case IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION:
{
- DPRINT1("[%S] IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION UNIMPLEMENTED\n", m_USBType);
+ DPRINT1("[%s] IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION UNIMPLEMENTED\n", m_USBType);
Status = STATUS_SUCCESS;
break;
}
default:
{
- DPRINT1("[%S] HandleDeviceControl>Type: IoCtl %x InputBufferLength %lu OutputBufferLength %lu NOT IMPLEMENTED\n", m_USBType,
+ DPRINT1("[%s] HandleDeviceControl>Type: IoCtl %x InputBufferLength %lu OutputBufferLength %lu NOT IMPLEMENTED\n", m_USBType,
IoStack->Parameters.DeviceIoControl.IoControlCode,
IoStack->Parameters.DeviceIoControl.InputBufferLength,
IoStack->Parameters.DeviceIoControl.OutputBufferLength);
//
// construct device name
//
- swprintf(CharDeviceName, L"\\Device\\USBPDO-%lu", UsbDeviceNumber);
+ swprintf(CharDeviceName, L"\\Device\\USBPDO-%d", UsbDeviceNumber);
//
// initialize device name
ULONG m_PortStatus;
PUSBQUEUE m_Queue;
PDMAMEMORYMANAGER m_DmaManager;
- LPCWSTR m_USBType;
+ LPCSTR m_USBType;
PUSB_CONFIGURATION m_ConfigurationDescriptors;
};
//
// failed to get usb queue
//
- DPRINT1("[%S] GetUsbQueue failed with %x\n", m_USBType, Status);
+ DPRINT1("[%s] GetUsbQueue failed with %x\n", m_USBType, Status);
return Status;
}
//
// failed to get dma manager
//
- DPRINT1("[%S] GetDMA failed with %x\n", m_USBType, Status);
+ DPRINT1("[%s] GetDMA failed with %x\n", m_USBType, Status);
return Status;
}
//
// failed to get device descriptor
//
- DPRINT1("[%S] Failed to get device descriptor with %x\n", m_USBType, Status);
+ DPRINT1("[%s] Failed to get device descriptor with %x\n", m_USBType, Status);
return Status;
}
return Usb20Device;
}
- DPRINT1("[%S] GetType Unknown bcdUSB Type %x\n", m_USBType, m_DeviceDescriptor.bcdUSB);
+ DPRINT1("[%s] GetType Unknown bcdUSB Type %x\n", m_USBType, m_DeviceDescriptor.bcdUSB);
//PC_ASSERT(FALSE);
return Usb11Device;
UCHAR OldAddress;
UCHAR Index;
- DPRINT1("[%S] SetDeviceAddress> Address %x\n", m_USBType, DeviceAddress);
+ DPRINT1("[%s] SetDeviceAddress> Address %x\n", m_USBType, DeviceAddress);
CtrlSetup = (PUSB_DEFAULT_PIPE_SETUP_PACKET)ExAllocatePoolWithTag(NonPagedPool, sizeof(USB_DEFAULT_PIPE_SETUP_PACKET), TAG_USBLIB);
if (!CtrlSetup)
if (!NT_SUCCESS(Status))
{
// failed to set device address
- DPRINT1("[%S] SetDeviceAddress> failed to set device address with %lx Address %x\n", m_USBType, Status, DeviceAddress);
+ DPRINT1("[%s] SetDeviceAddress> failed to set device address with %lx Address %x\n", m_USBType, Status, DeviceAddress);
return Status;
}
Status = CreateDeviceDescriptor();
if (!NT_SUCCESS(Status))
{
- DPRINT1("[%S] SetDeviceAddress failed to retrieve device descriptor with device address set Error %lx\n", m_USBType, Status);
+ DPRINT1("[%s] SetDeviceAddress failed to retrieve device descriptor with device address set Error %lx\n", m_USBType, Status);
// return error status
return Status;
}
m_DeviceDescriptor.bNumConfigurations == 0)
{
// failed to retrieve device descriptor
- DPRINT1("[%S] SetDeviceAddress> device returned bogus device descriptor\n", m_USBType);
+ DPRINT1("[%s] SetDeviceAddress> device returned bogus device descriptor\n", m_USBType);
DumpDeviceDescriptor(&m_DeviceDescriptor);
// return error status
Status = CreateConfigurationDescriptor(Index);
if (!NT_SUCCESS(Status))
{
- DPRINT1("[%S] SetDeviceAddress> failed to retrieve configuration %lu\n", m_USBType, Index);
+ DPRINT1("[%s] SetDeviceAddress> failed to retrieve configuration %lu\n", m_USBType, Index);
break;
}
}
//
// no queue, wtf?
//
- DPRINT1("[%S] CommitIrp> no queue / dma !!!\n", m_USBType);
+ DPRINT1("[%s] CommitIrp> no queue / dma !!!\n", m_USBType);
return STATUS_UNSUCCESSFUL;
}
//
// failed to build request
//
- DPRINT1("[%S] CommitIrp> CreateUSBRequest failed with %lx\n", m_USBType, Status);
+ DPRINT1("[%s] CommitIrp> CreateUSBRequest failed with %lx\n", m_USBType, Status);
return Status;
}
//
// failed to add request
//
- DPRINT1("[%S] failed add request to queue with %lx\n", m_USBType, Status);
+ DPRINT1("[%s] failed add request to queue with %lx\n", m_USBType, Status);
Request->Release();
return Status;
}
//
// no queue, wtf?
//
- DPRINT1("[%S] CommitSetupPacket> no queue!!!\n", m_USBType);
+ DPRINT1("[%s] CommitSetupPacket> no queue!!!\n", m_USBType);
return STATUS_UNSUCCESSFUL;
}
//
// failed to build request
//
- DPRINT1("[%S] CommitSetupPacket> CreateUSBRequest failed with %x\n", m_USBType, Status);
+ DPRINT1("[%s] CommitSetupPacket> CreateUSBRequest failed with %x\n", m_USBType, Status);
return Status;
}
//
// failed to initialize request
//
- DPRINT1("[%S] CommitSetupPacket failed to initialize usb request with %x\n", m_USBType, Status);
+ DPRINT1("[%s] CommitSetupPacket failed to initialize usb request with %x\n", m_USBType, Status);
Request->Release();
return Status;
}
//
// failed to add request
//
- DPRINT1("[%S] CommitSetupPacket> failed add request to queue with %x\n", m_USBType, Status);
+ DPRINT1("[%s] CommitSetupPacket> failed add request to queue with %x\n", m_USBType, Status);
Request->Release();
return Status;
}
//
// failed to get partial configuration descriptor
//
- DPRINT1("[%S] Failed to get partial configuration descriptor Status %x Index %x\n", m_USBType, Status, Index);
+ DPRINT1("[%s] Failed to get partial configuration descriptor Status %x Index %x\n", m_USBType, Status, Index);
ExFreePoolWithTag(ConfigurationDescriptor, TAG_USBLIB);
return Status;
}
//
// failed to get full configuration descriptor
//
- DPRINT1("[%S] Failed to get full configuration descriptor Status %x Index %x\n", m_USBType, Status, Index);
+ DPRINT1("[%s] Failed to get full configuration descriptor Status %x Index %x\n", m_USBType, Status, Index);
ExFreePoolWithTag(ConfigurationDescriptor, TAG_USBLIB);
return Status;
}
if (EndpointDescriptor->bLength == 0 || EndpointDescriptor->bDescriptorType == USB_INTERFACE_DESCRIPTOR_TYPE)
{
// bogus configuration descriptor
- DPRINT1("[%S] Bogus descriptor found in InterfaceNumber %x Alternate %x EndpointIndex %x bLength %x bDescriptorType %x\n", m_USBType, InterfaceDescriptor->bInterfaceNumber, InterfaceDescriptor->bAlternateSetting, PipeIndex,
+ DPRINT1("[%s] Bogus descriptor found in InterfaceNumber %x Alternate %x EndpointIndex %x bLength %x bDescriptorType %x\n", m_USBType, InterfaceDescriptor->bInterfaceNumber, InterfaceDescriptor->bAlternateSetting, PipeIndex,
EndpointDescriptor->bLength, EndpointDescriptor->bDescriptorType);
// failed
if (!Found)
{
- DPRINT1("[%S] invalid configuration value %u\n", m_USBType, ConfigurationDescriptor->bConfigurationValue);
+ DPRINT1("[%s] invalid configuration value %u\n", m_USBType, ConfigurationDescriptor->bConfigurationValue);
return STATUS_INVALID_PARAMETER;
}
if (!ConfigurationDescriptor)
{
// unconfigure request
- DPRINT1("[%S] SelectConfiguration Unconfigure Request Status %lx\n", m_USBType, Status);
+ DPRINT1("[%s] SelectConfiguration Unconfigure Request Status %lx\n", m_USBType, Status);
m_ConfigurationIndex = 0;
return Status;
}
// informal debug print
- DPRINT1("[%S] SelectConfiguration New Configuration %x Old Configuration %x Result %lx\n", m_USBType, ConfigurationIndex, m_ConfigurationIndex, Status);
+ DPRINT1("[%s] SelectConfiguration New Configuration %x Old Configuration %x Result %lx\n", m_USBType, ConfigurationIndex, m_ConfigurationIndex, Status);
if (!NT_SUCCESS(Status))
{
//
if (!NT_SUCCESS(Status))
{
// failed
- DPRINT1("[%S] Failed to copy interface descriptor Index %lu InterfaceDescriptor %p InterfaceInfo %p\n", m_USBType, ConfigurationIndex, InterfaceDescriptor, InterfaceInfo);
+ DPRINT1("[%s] Failed to copy interface descriptor Index %lu InterfaceDescriptor %p InterfaceInfo %p\n", m_USBType, ConfigurationIndex, InterfaceDescriptor, InterfaceInfo);
break;
}
if (!Found)
{
// invalid handle passed
- DPRINT1("[%S] Invalid configuration handle passed %p\n", m_USBType, ConfigurationHandle);
+ DPRINT1("[%s] Invalid configuration handle passed %p\n", m_USBType, ConfigurationHandle);
return STATUS_INVALID_PARAMETER;
}
Status = CommitSetupPacket(&CtrlSetup, NULL, 0, NULL);
// informal debug print
- DPRINT1("[%S] SelectInterface AlternateSetting %x InterfaceNumber %x Status %lx\n", m_USBType, InterfaceInfo->AlternateSetting, InterfaceInfo->InterfaceNumber, Status);
+ DPRINT1("[%s] SelectInterface AlternateSetting %x InterfaceNumber %x Status %lx\n", m_USBType, InterfaceInfo->AlternateSetting, InterfaceInfo->InterfaceNumber, Status);
#if 0
if (!NT_SUCCESS(Status))
{
InterfaceDescriptor = USBD_ParseConfigurationDescriptor(m_ConfigurationDescriptors[ConfigurationIndex].ConfigurationDescriptor, InterfaceInfo->InterfaceNumber, InterfaceInfo->AlternateSetting);
if (!InterfaceDescriptor)
{
- DPRINT1("[%S] No such interface Alternate %x InterfaceNumber %x\n", m_USBType, InterfaceInfo->AlternateSetting, InterfaceInfo->InterfaceNumber);
+ DPRINT1("[%s] No such interface Alternate %x InterfaceNumber %x\n", m_USBType, InterfaceInfo->AlternateSetting, InterfaceInfo->InterfaceNumber);
return STATUS_UNSUCCESSFUL;
}
if (!NT_SUCCESS(Status))
{
// failed
- DPRINT1("[%S] Failed to build interface descriptor Status %x\n", m_USBType, Status);
+ DPRINT1("[%s] Failed to build interface descriptor Status %x\n", m_USBType, Status);
return Status;
}
}