From e602d6c4cc539a3fc3dbda5c450fceec8b00cf2d Mon Sep 17 00:00:00 2001 From: Dmitry Fleytman Date: Sun, 27 Apr 2014 13:41:18 +0300 Subject: [PATCH] UsbDk: Trivial: traces cleanup/fixes Signed-off-by: Dmitry Fleytman --- UsbDk/ControlDevice.cpp | 13 +------------ UsbDk/DeviceAccess.cpp | 1 - UsbDk/RedirectorStrategy.cpp | 6 +----- 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/UsbDk/ControlDevice.cpp b/UsbDk/ControlDevice.cpp index 00341be..abc78e5 100644 --- a/UsbDk/ControlDevice.cpp +++ b/UsbDk/ControlDevice.cpp @@ -52,43 +52,36 @@ void CUsbDkControlDeviceQueue::DeviceControl(WDFQUEUE Queue, CWdfRequest WdfRequest(Request); - TraceEvents(TRACE_LEVEL_INFORMATION, TRACE_CONTROLDEVICE, "%!FUNC! Request arrived"); - switch (IoControlCode) { case IOCTL_USBDK_COUNT_DEVICES: { - TraceEvents(TRACE_LEVEL_INFORMATION, TRACE_CONTROLDEVICE, "Called IOCTL_USBDK_COUNT_DEVICES\n"); CountDevices(WdfRequest, Queue); break; } case IOCTL_USBDK_ENUM_DEVICES: { - TraceEvents(TRACE_LEVEL_INFORMATION, TRACE_CONTROLDEVICE, "Called IOCTL_USBDK_ENUM_DEVICES\n"); EnumerateDevices(WdfRequest, Queue); break; } case IOCTL_USBDK_ADD_REDIRECT: { - TraceEvents(TRACE_LEVEL_INFORMATION, TRACE_CONTROLDEVICE, "Called IOCTL_USBDK_ADD_REDIRECT\n"); AddRedirect(WdfRequest, Queue); break; } case IOCTL_USBDK_REMOVE_REDIRECT: { - TraceEvents(TRACE_LEVEL_INFORMATION, TRACE_CONTROLDEVICE, "Called IOCTL_USBDK_REMOVE_REDIRECT\n"); RemoveRedirect(WdfRequest, Queue); break; } case IOCTL_USBDK_GET_CONFIG_DESCRIPTOR: { - TraceEvents(TRACE_LEVEL_INFORMATION, TRACE_CONTROLDEVICE, "Called IOCTL_USBDK_GET_CONFIG_DESCRIPTOR\n"); GetConfigurationDescriptor(WdfRequest, Queue); break; } default: { - TraceEvents(TRACE_LEVEL_INFORMATION, TRACE_CONTROLDEVICE, "Wrong IoControlCode 0x%X\n", IoControlCode); + TraceEvents(TRACE_LEVEL_ERROR, TRACE_CONTROLDEVICE, "Wrong IoControlCode 0x%X\n", IoControlCode); WdfRequest.SetStatus(STATUS_INVALID_DEVICE_REQUEST); break; } @@ -105,8 +98,6 @@ void CUsbDkControlDeviceQueue::CountDevices(CWdfRequest &Request, WDFQUEUE Queue auto devExt = UsbDkControlGetContext(WdfIoQueueGetDevice(Queue)); *numberDevices = devExt->UsbDkControl->CountDevices(); - TraceEvents(TRACE_LEVEL_INFORMATION, TRACE_CONTROLDEVICE, "%!FUNC! CountDevices returned %d", *numberDevices); - Request.SetOutputDataLen(sizeof(*numberDevices)); } @@ -130,8 +121,6 @@ void CUsbDkControlDeviceQueue::EnumerateDevices(CWdfRequest &Request, WDFQUEUE Q auto devExt = UsbDkControlGetContext(WdfIoQueueGetDevice(Queue)); auto res = devExt->UsbDkControl->EnumerateDevices(existingDevices, numberAllocatedDevices, numberExistingDevices); - TraceEvents(TRACE_LEVEL_INFORMATION, TRACE_CONTROLDEVICE, "%!FUNC! EnumerateDevices returned %llu devices", numberExistingDevices); - if (res) { Request.SetOutputDataLen(numberExistingDevices * sizeof(USB_DK_DEVICE_INFO)); diff --git a/UsbDk/DeviceAccess.cpp b/UsbDk/DeviceAccess.cpp index 1fb7129..ae99235 100644 --- a/UsbDk/DeviceAccess.cpp +++ b/UsbDk/DeviceAccess.cpp @@ -245,7 +245,6 @@ NTSTATUS CWdmUsbDeviceAccess::GetConfigurationDescriptor(UCHAR Index, USB_CONFIG return status; } - TraceEvents(TRACE_LEVEL_ERROR, TRACE_DEVACCESS, "%!FUNC! Total descriptor size %d, buffer length %llu", Descriptor.wTotalLength, Length); return STATUS_SUCCESS; } diff --git a/UsbDk/RedirectorStrategy.cpp b/UsbDk/RedirectorStrategy.cpp index f13e95b..c16fb9e 100644 --- a/UsbDk/RedirectorStrategy.cpp +++ b/UsbDk/RedirectorStrategy.cpp @@ -74,8 +74,6 @@ void CUsbDkRedirectorStrategy::Delete() void CUsbDkRedirectorStrategy::PatchDeviceID(PIRP Irp) { - TraceEvents(TRACE_LEVEL_INFORMATION, TRACE_REDIRECTOR, "%!FUNC! Entry"); - //TODO: Put RedHat VID/PID when obtained from USB.org static const WCHAR RedirectorDeviceId[] = L"USB\\Vid_FEED&Pid_CAFE&Rev_0001"; static const WCHAR RedirectorHardwareIds[] = L"USB\\Vid_FEED&Pid_CAFE&Rev_0001\0USB\\Vid_FEED&Pid_CAFE\0"; @@ -273,7 +271,7 @@ NTSTATUS CUsbDkRedirectorStrategy::IoInCallerContextRW(CRedirectorRequest &WdfRe status = LockerFunc(WdfRequest, TransferRequest, context->LockedBuffer); if (!NT_SUCCESS(status)) { - TraceEvents(TRACE_LEVEL_ERROR, TRACE_REDIRECTOR, "%!FUNC! LockUserBufferForRead failed"); + TraceEvents(TRACE_LEVEL_ERROR, TRACE_REDIRECTOR, "%!FUNC! Failed to lock user buffer, %!STATUS!", status); } return status; } @@ -357,8 +355,6 @@ void CUsbDkRedirectorStrategy::IoDeviceControl(WDFREQUEST Request, case IOCTL_USBDK_DEVICE_CONTROL_TRANSFER: { CWdfRequest WdfRequest(Request); - TraceEvents(TRACE_LEVEL_INFORMATION, TRACE_REDIRECTOR, "Called IOCTL_USBDK_DEVICE_CONTROL_TRANSFER\n"); - UsbDkHandleRequestWithInputOutput(WdfRequest, [this](PWDF_USB_CONTROL_SETUP_PACKET Input, size_t InputLength, PWDF_USB_CONTROL_SETUP_PACKET Output, size_t &OutputLength) { return DoControlTransfer(Input, InputLength, Output, OutputLength); });