Skip to content

Commit

Permalink
FilterDevice: Use generic WDF request context
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Fleytman <[email protected]>
  • Loading branch information
Dmitry Fleytman committed Feb 10, 2016
1 parent 32e0830 commit 603d98e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion UsbDk/FilterDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ NTSTATUS CUsbDkFilterDeviceInit::Configure(ULONG InstanceNumber)
PAGED_CODE();

WDF_OBJECT_ATTRIBUTES requestAttributes;
WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&requestAttributes, USBDK_FILTER_REQUEST_CONTEXT);
WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&requestAttributes, WDF_REQUEST_CONTEXT);
requestAttributes.ContextSizeOverride = CUsbDkFilterDevice::CStrategist::GetRequestContextSize();

SetRequestAttributes(requestAttributes);
Expand Down
5 changes: 0 additions & 5 deletions UsbDk/FilterStrategy.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,3 @@ class CUsbDkNullFilterStrategy : public CUsbDkFilterStrategy
virtual NTSTATUS MakeAvailable() override
{ return STATUS_SUCCESS; }
};

typedef struct _USBDK_FILTER_REQUEST_CONTEXT {
} USBDK_FILTER_REQUEST_CONTEXT, *PUSBDK_FILTER_REQUEST_CONTEXT;

WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(USBDK_FILTER_REQUEST_CONTEXT, UsbDkFilterRequestGetContext);
2 changes: 1 addition & 1 deletion UsbDk/RedirectorStrategy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ class CRedirectorRequest : public CWdfRequest
{}

PUSBDK_REDIRECTOR_REQUEST_CONTEXT Context() const
{ return reinterpret_cast<PUSBDK_REDIRECTOR_REQUEST_CONTEXT>(UsbDkFilterRequestGetContext(m_Request)); }
{ return reinterpret_cast<PUSBDK_REDIRECTOR_REQUEST_CONTEXT>(CWdfRequest::Context()); }

private:
void SetBytesWritten(size_t numBytes);
Expand Down

0 comments on commit 603d98e

Please sign in to comment.