Skip to content

Commit

Permalink
trivial: cleanup comments
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Fleytman <[email protected]>
  • Loading branch information
Dmitry Fleytman committed Mar 25, 2015
1 parent e05ca16 commit ec04c9a
Show file tree
Hide file tree
Showing 26 changed files with 0 additions and 156 deletions.
19 changes: 0 additions & 19 deletions UsbDk/ControlDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ void CUsbDkControlDeviceQueue::DeviceControl(WDFQUEUE Queue,
}
}
}
//------------------------------------------------------------------------------------------------------------

void CUsbDkControlDeviceQueue::CountDevices(CWdfRequest &Request, WDFQUEUE Queue)
{
Expand All @@ -123,7 +122,6 @@ void CUsbDkControlDeviceQueue::CountDevices(CWdfRequest &Request, WDFQUEUE Queue

Request.SetStatus(status);
}
//------------------------------------------------------------------------------------------------------------

void CUsbDkControlDeviceQueue::UpdateRegistryParameters(CWdfRequest &Request, WDFQUEUE Queue)
{
Expand Down Expand Up @@ -158,7 +156,6 @@ void CUsbDkControlDeviceQueue::EnumerateDevices(CWdfRequest &Request, WDFQUEUE Q
Request.SetStatus(STATUS_BUFFER_TOO_SMALL);
}
}
//------------------------------------------------------------------------------------------------------------

template <typename TInputObj, typename TOutputObj>
static void CUsbDkControlDeviceQueue::DoUSBDeviceOp(CWdfRequest &Request,
Expand Down Expand Up @@ -193,7 +190,6 @@ static void CUsbDkControlDeviceQueue::DoUSBDeviceOp(CWdfRequest &Request,
Request.SetOutputDataLen(outputLength);
Request.SetStatus(status);
}
//------------------------------------------------------------------------------------------------------------

void CUsbDkControlDeviceQueue::DoUSBDeviceOp(CWdfRequest &Request, WDFQUEUE Queue, USBDevControlMethod Method)
{
Expand All @@ -212,13 +208,11 @@ void CUsbDkControlDeviceQueue::DoUSBDeviceOp(CWdfRequest &Request, WDFQUEUE Queu

Request.SetStatus(status);
}
//------------------------------------------------------------------------------------------------------------

void CUsbDkControlDeviceQueue::GetConfigurationDescriptor(CWdfRequest &Request, WDFQUEUE Queue)
{
DoUSBDeviceOp<USB_DK_CONFIG_DESCRIPTOR_REQUEST, USB_CONFIGURATION_DESCRIPTOR>(Request, Queue, &CUsbDkControlDevice::GetConfigurationDescriptor);
}
//------------------------------------------------------------------------------------------------------------

ULONG CUsbDkControlDevice::CountDevices()
{
Expand All @@ -232,7 +226,6 @@ ULONG CUsbDkControlDevice::CountDevices()

return numberDevices;
}
//------------------------------------------------------------------------------------------------------------

bool CUsbDkControlDevice::ShouldHide(const USB_DEVICE_DESCRIPTOR &DevDescriptor) const
{
Expand Down Expand Up @@ -280,7 +273,6 @@ bool CUsbDkControlDevice::EnumerateDevices(USB_DK_DEVICE_INFO *outBuff, size_t n
return true;
});
}
//------------------------------------------------------------------------------------------------------------

// EnumUsbDevicesByID runs over the list of USB devices looking for device by ID.
// For each device with matching ID Functor() is called.
Expand Down Expand Up @@ -354,7 +346,6 @@ NTSTATUS CUsbDkControlDevice::GetUsbDeviceConfigurationDescriptor(const USB_DK_D

return result ? STATUS_SUCCESS : STATUS_INVALID_DEVICE_REQUEST;
}
//------------------------------------------------------------------------------------------------------------

void CUsbDkControlDevice::ContextCleanup(_In_ WDFOBJECT DeviceObject)
{
Expand All @@ -365,7 +356,6 @@ void CUsbDkControlDevice::ContextCleanup(_In_ WDFOBJECT DeviceObject)
auto deviceContext = UsbDkControlGetContext(DeviceObject);
delete deviceContext->UsbDkControl;
}
//------------------------------------------------------------------------------------------------------------

NTSTATUS CUsbDkControlDevice::Create(WDFDRIVER Driver)
{
Expand Down Expand Up @@ -467,7 +457,6 @@ void CUsbDkControlDevice::IoInCallerContext(WDFDEVICE Device, WDFREQUEST Request
}
}
}
//-----------------------------------------------------------------------------------------------------

bool CUsbDkControlDevice::FetchBuffersForAddRedirectRequest(CWdfRequest &WdfRequest, PUSB_DK_DEVICE_ID &DeviceId, PULONG64 &RedirectorDevice)
{
Expand Down Expand Up @@ -511,7 +500,6 @@ bool CUsbDkControlDevice::FetchBuffersForAddRedirectRequest(CWdfRequest &WdfRequ

return true;
}
//-----------------------------------------------------------------------------------------------------

CRefCountingHolder<CUsbDkControlDevice> *CUsbDkControlDevice::m_UsbDkControlDevice = nullptr;

Expand Down Expand Up @@ -599,7 +587,6 @@ NTSTATUS CUsbDkControlDevice::GetConfigurationDescriptor(const USB_DK_CONFIG_DES
*OutputBuffLen = NT_SUCCESS(status) ? min(Descriptor->wTotalLength, *OutputBuffLen) : 0;
return status;
}
//-------------------------------------------------------------------------------------------------------------

NTSTATUS CUsbDkControlDevice::AddRedirect(const USB_DK_DEVICE_ID &DeviceId, PHANDLE RedirectorDevice)
{
Expand Down Expand Up @@ -855,7 +842,6 @@ NTSTATUS CUsbDkControlDevice::ReloadPersistentHideRules()
return status;
}

//-------------------------------------------------------------------------------------------------------------

NTSTATUS CUsbDkControlDevice::AddDeviceToSet(const USB_DK_DEVICE_ID &DeviceId, CUsbDkRedirection **NewRedirection)
{
Expand Down Expand Up @@ -890,7 +876,6 @@ NTSTATUS CUsbDkControlDevice::AddDeviceToSet(const USB_DK_DEVICE_ID &DeviceId, C

return STATUS_SUCCESS;
}
//-------------------------------------------------------------------------------------------------------------

NTSTATUS CUsbDkControlDevice::RemoveRedirect(const USB_DK_DEVICE_ID &DeviceId)
{
Expand Down Expand Up @@ -926,7 +911,6 @@ NTSTATUS CUsbDkControlDevice::RemoveRedirect(const USB_DK_DEVICE_ID &DeviceId)
TraceEvents(TRACE_LEVEL_ERROR, TRACE_CONTROLDEVICE, "%!FUNC! failed.");
return STATUS_OBJECT_NAME_NOT_FOUND;
}
//-------------------------------------------------------------------------------------------------------------

bool CUsbDkControlDevice::NotifyRedirectorAttached(CRegText *DeviceID, CRegText *InstanceID, CUsbDkFilterDevice *RedirectorDevice)
{
Expand All @@ -935,13 +919,11 @@ bool CUsbDkControlDevice::NotifyRedirectorAttached(CRegText *DeviceID, CRegText

return m_Redirections.ModifyOne(&ID, [RedirectorDevice](CUsbDkRedirection *R){ R->NotifyRedirectorCreated(RedirectorDevice); });
}
//-------------------------------------------------------------------------------------------------------------

bool CUsbDkControlDevice::NotifyRedirectorRemovalStarted(const USB_DK_DEVICE_ID &ID)
{
return m_Redirections.ModifyOne(&ID, [](CUsbDkRedirection *R){ R->NotifyRedirectionRemovalStarted(); });
}
//-------------------------------------------------------------------------------------------------------------

bool CUsbDkControlDevice::WaitForDetachment(const USB_DK_DEVICE_ID &ID)
{
Expand All @@ -959,7 +941,6 @@ bool CUsbDkControlDevice::WaitForDetachment(const USB_DK_DEVICE_ID &ID)

return res;
}
//-------------------------------------------------------------------------------------------------------------

NTSTATUS CUsbDkRedirection::Create(const USB_DK_DEVICE_ID &Id)
{
Expand Down
2 changes: 0 additions & 2 deletions UsbDk/FilterStrategy.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,13 @@ class CUsbDkFilterStrategy
void ForwardRequest(WDFREQUEST Request);
TChildrenList m_Children;
};
//-----------------------------------------------------------------------------------------

class CUsbDkNullFilterStrategy : public CUsbDkFilterStrategy
{
public:
virtual NTSTATUS MakeAvailable() override
{ return STATUS_SUCCESS; }
};
//-----------------------------------------------------------------------------------------

typedef struct _USBDK_FILTER_REQUEST_CONTEXT {
} USBDK_FILTER_REQUEST_CONTEXT, *PUSBDK_FILTER_REQUEST_CONTEXT;
Expand Down
3 changes: 0 additions & 3 deletions UsbDk/HiderDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ void CUsbDkHiderDeviceQueue::DeviceControl(WDFQUEUE Queue,


}
//------------------------------------------------------------------------------------------------------------

void CUsbDkHiderDevice::ContextCleanup(_In_ WDFOBJECT DeviceObject)
{
Expand All @@ -157,7 +156,6 @@ void CUsbDkHiderDevice::ContextCleanup(_In_ WDFOBJECT DeviceObject)
auto deviceContext = UsbDkHiderGetContext(DeviceObject);
delete deviceContext->UsbDkHider;
}
//------------------------------------------------------------------------------------------------------------

NTSTATUS CUsbDkHiderDevice::Create(WDFDRIVER Driver)
{
Expand Down Expand Up @@ -207,4 +205,3 @@ NTSTATUS CUsbDkHiderDevice::Register()

return status;
}
//-----------------------------------------------------------------------------------------------------
2 changes: 0 additions & 2 deletions UsbDk/Irp.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ class CIrp : public CIrpBase
void DestroyIrp();
void ReleaseTarget();
};
//-------------------------------------------------------------------------------------------------

class CIoControlIrp : public CIrpBase
{
Expand All @@ -123,4 +122,3 @@ class CIoControlIrp : public CIrpBase
CWdmEvent m_Event;
IO_STATUS_BLOCK m_IoControlStatus;
};
//-------------------------------------------------------------------------------------------------
21 changes: 0 additions & 21 deletions UsbDk/RedirectorStrategy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include "UsbDkNames.h"
#include "ControlDevice.h"
#include "WdfRequest.h"
//--------------------------------------------------------------------------------------------------

NTSTATUS CUsbDkRedirectorStrategy::MakeAvailable()
{
Expand All @@ -48,7 +47,6 @@ NTSTATUS CUsbDkRedirectorStrategy::MakeAvailable()

return status;
}
//--------------------------------------------------------------------------------------------------

NTSTATUS CUsbDkRedirectorStrategy::Create(CUsbDkFilterDevice *Owner)
{
Expand Down Expand Up @@ -86,13 +84,11 @@ NTSTATUS CUsbDkRedirectorStrategy::Create(CUsbDkFilterDevice *Owner)
}
return status;
}
//--------------------------------------------------------------------------------------------------

void CUsbDkRedirectorStrategy::Delete()
{
CUsbDkFilterStrategy::Delete();
}
//--------------------------------------------------------------------------------------------------

void CUsbDkRedirectorStrategy::PatchDeviceID(PIRP Irp)
{
Expand Down Expand Up @@ -162,7 +158,6 @@ void CUsbDkRedirectorStrategy::PatchDeviceID(PIRP Irp)
Irp->IoStatus.Information = reinterpret_cast<ULONG_PTR>(Result);
}
}
//--------------------------------------------------------------------------------------------------

NTSTATUS CUsbDkRedirectorStrategy::PNPPreProcess(PIRP Irp)
{
Expand Down Expand Up @@ -191,7 +186,6 @@ NTSTATUS CUsbDkRedirectorStrategy::PNPPreProcess(PIRP Irp)
return CUsbDkFilterStrategy::PNPPreProcess(Irp);
}
}
//--------------------------------------------------------------------------------------------------

typedef struct tag_USBDK_REDIRECTOR_REQUEST_CONTEXT
{
Expand Down Expand Up @@ -274,7 +268,6 @@ static NTSTATUS CRedirectorRequest::FetchTransferRequest(USB_DK_TRANSFER_REQUEST

return status;
}
//--------------------------------------------------------------------------------------------------

template <typename TRetrieverFunc, typename TLockerFunc>
NTSTATUS CUsbDkRedirectorStrategy::IoInCallerContextRW(CRedirectorRequest &WdfRequest,
Expand Down Expand Up @@ -328,7 +321,6 @@ NTSTATUS CUsbDkRedirectorStrategy::IoInCallerContextRW(CRedirectorRequest &WdfRe

return status;
}
//--------------------------------------------------------------------------------------------------

template <typename TLockerFunc>
NTSTATUS CUsbDkRedirectorStrategy::IoInCallerContextRWIsoTransfer(CRedirectorRequest &WdfRequest, USB_DK_TRANSFER_REQUEST &TransferRequest,
Expand Down Expand Up @@ -365,7 +357,6 @@ NTSTATUS CUsbDkRedirectorStrategy::IoInCallerContextRWIsoTransfer(CRedirectorReq

return status;
}
//--------------------------------------------------------------------------------------------------

NTSTATUS CUsbDkRedirectorStrategy::IoInCallerContextRWControlTransfer(CRedirectorRequest &WdfRequest, USB_DK_TRANSFER_REQUEST &TransferRequest)
{
Expand Down Expand Up @@ -421,7 +412,6 @@ NTSTATUS CUsbDkRedirectorStrategy::IoInCallerContextRWControlTransfer(CRedirecto

return status;
}
//--------------------------------------------------------------------------------------------------

void CUsbDkRedirectorStrategy::IoInCallerContext(WDFDEVICE Device, WDFREQUEST Request)
{
Expand Down Expand Up @@ -466,7 +456,6 @@ void CUsbDkRedirectorStrategy::IoInCallerContext(WDFDEVICE Device, WDFREQUEST Re
WdfRequest.SetStatus(status);
}
}
//--------------------------------------------------------------------------------------------------

void CUsbDkRedirectorStrategy::DoControlTransfer(CRedirectorRequest &WdfRequest, WDFMEMORY DataBuffer)
{
Expand Down Expand Up @@ -509,7 +498,6 @@ void CUsbDkRedirectorStrategy::DoControlTransfer(CRedirectorRequest &WdfRequest,

WdfRequest.SetStatus(status);
}
//--------------------------------------------------------------------------------------------------

void CUsbDkRedirectorStrategy::IoDeviceControl(WDFREQUEST Request,
size_t OutputBufferLength, size_t InputBufferLength,
Expand Down Expand Up @@ -552,7 +540,6 @@ void CUsbDkRedirectorStrategy::IoDeviceControl(WDFREQUEST Request,
}
}
}
//--------------------------------------------------------------------------------------------------

void CUsbDkRedirectorStrategy::WritePipe(WDFREQUEST Request, size_t Length)
{
Expand Down Expand Up @@ -617,7 +604,6 @@ void CUsbDkRedirectorStrategy::WritePipe(WDFREQUEST Request, size_t Length)
WdfRequest.SetStatus(STATUS_INVALID_PARAMETER);
}
}
//--------------------------------------------------------------------------------------------------

void CUsbDkRedirectorStrategy::ReadPipe(WDFREQUEST Request, size_t Length)
{
Expand Down Expand Up @@ -681,7 +667,6 @@ void CUsbDkRedirectorStrategy::ReadPipe(WDFREQUEST Request, size_t Length)
WdfRequest.SetStatus(STATUS_INVALID_PARAMETER);
}
}
//--------------------------------------------------------------------------------------------------

void CUsbDkRedirectorStrategy::IsoRWCompletion(WDFREQUEST Request, WDFIOTARGET, PWDF_REQUEST_COMPLETION_PARAMS CompletionParams, WDFCONTEXT)
{
Expand Down Expand Up @@ -716,13 +701,11 @@ void CUsbDkRedirectorStrategy::IsoRWCompletion(WDFREQUEST Request, WDFIOTARGET,

WdfRequest.SetStatus(status);
}
//--------------------------------------------------------------------------------------------------

size_t CUsbDkRedirectorStrategy::GetRequestContextSize()
{
return sizeof(USBDK_REDIRECTOR_REQUEST_CONTEXT);
}
//--------------------------------------------------------------------------------------------------

void CUsbDkRedirectorStrategy::OnClose()
{
Expand All @@ -735,7 +718,6 @@ void CUsbDkRedirectorStrategy::OnClose()
TraceEvents(TRACE_LEVEL_ERROR, TRACE_REDIRECTOR, "%!FUNC! RemoveRedirect failed: %!STATUS!", status);
}
}
//--------------------------------------------------------------------------------------------------

void CUsbDkRedirectorQueueData::SetCallbacks(WDF_IO_QUEUE_CONFIG &QueueConfig)
{
Expand All @@ -744,7 +726,6 @@ void CUsbDkRedirectorQueueData::SetCallbacks(WDF_IO_QUEUE_CONFIG &QueueConfig)
QueueConfig.EvtIoRead = [](WDFQUEUE Q, WDFREQUEST R, size_t L)
{ UsbDkFilterGetContext(WdfIoQueueGetDevice(Q))->UsbDkFilter->m_Strategy->ReadPipe(R, L); };
}
//--------------------------------------------------------------------------------------------------

NTSTATUS CUsbDkRedirectorQueueData::SetDispatching()
{
Expand All @@ -761,11 +742,9 @@ NTSTATUS CUsbDkRedirectorQueueData::SetDispatching()
}
return status;
}
//--------------------------------------------------------------------------------------------------

void CUsbDkRedirectorQueueConfig::SetCallbacks(WDF_IO_QUEUE_CONFIG &QueueConfig)
{
QueueConfig.EvtIoDeviceControl = [](WDFQUEUE Q, WDFREQUEST R, size_t OL, size_t IL, ULONG CTL)
{ UsbDkFilterGetContext(WdfIoQueueGetDevice(Q))->UsbDkFilter->m_Strategy->IoDeviceControl(R, OL, IL, CTL); };;
}
//--------------------------------------------------------------------------------------------------
2 changes: 0 additions & 2 deletions UsbDk/RedirectorStrategy.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class CUsbDkRedirectorQueueData : public CWdfSpecificQueue, public CAllocatable<
CUsbDkRedirectorQueueData(const CUsbDkRedirectorQueueData&) = delete;
CUsbDkRedirectorQueueData& operator= (const CUsbDkRedirectorQueueData&) = delete;
};
//--------------------------------------------------------------------------------------------------

class CUsbDkRedirectorQueueConfig : public CWdfDefaultQueue, public CAllocatable<PagedPool, 'SQRH'>
{
Expand All @@ -57,7 +56,6 @@ class CUsbDkRedirectorQueueConfig : public CWdfDefaultQueue, public CAllocatable
CUsbDkRedirectorQueueConfig(const CUsbDkRedirectorQueueConfig&) = delete;
CUsbDkRedirectorQueueConfig& operator= (const CUsbDkRedirectorQueueConfig&) = delete;
};
//--------------------------------------------------------------------------------------------------

class CRedirectorRequest;

Expand Down
Loading

0 comments on commit ec04c9a

Please sign in to comment.