23#include "../fxtargetsshared.hpp"
115 "Action %d undefined or out of range",
Action);
175 "Action %d undefined or out of range",
Action);
256 "Expected non NULL TargetDeviceObject in OpenParams, %!STATUS!",
264 if (FxDriverGlobals->IsUserModeDriver) {
268 "The open type WdfIoTargetOpenUseExistingDevice is not "
269 "supported in UMDF drivers. It is supported in KMDF "
270 "drivers only, %!STATUS!",
283 "OpenParams %p TargetFileObject is NULL but a state callback "
284 "(query remove %p, remove canceled %p, remove complete %p)"
285 " was specified, %!STATUS!",
297 OpenParams->TargetDeviceName.MaximumLength == 0) {
301 "Expected valid OpenParams TargetDeviceName string, %!STATUS!",
311 if (FxDriverGlobals->IsUserModeDriver ==
FALSE) {
315 "The open type WdfIoTargetOpenLocalTargetByFile is not "
316 "supported in KMDF drivers. It is supported in UMDF "
317 "drivers only, %!STATUS!",
329 "The open type is WdfIoTargetOpenLocalTargetByFile but a state"
330 " callback (query remove %p, remove canceled %p, remove"
331 " complete %p) was specified, %!STATUS!",
358 "OpenParams Type (%d) incorrect, %!STATUS!",
416 "WDFDEVICE 0x%p",
Device);
491 "enter WDFIOTARGET 0x%p",
IoTarget);
511 "OpenParams size (%d) incorrect, expected %d, %!STATUS!",
553WDFEXPORT(WdfIoTargetCloseForQueryRemove)(
589 "enter WDFIOTARGET 0x%p",
IoTarget);
635 "enter WDFIOTARGET 0x%p",
IoTarget);
682 "enter WDFIOTARGET 0x%p",
IoTarget);
767 "Failed to initialize FxSyncRequest for WDFIOTARGET "
773 "enter: WDFIOTARGET 0x%p, WDFREQUEST 0x%p, MJ code 0x%x",
787 "invalid options, %!STATUS!",
status);
791 if (IoBuffer !=
NULL) {
799 "invalid input buffer descriptor 0x%p, %!STATUS!",
816 "WDFIOTARGET 0x%p, WDFREQUEST 0x%p being submitted",
828 "could not format MJ 0x%x request, %!STATUS!",
898 "enter: WDFIOTARGET 0x%p, WDFREQUEST 0x%p, MJ code 0x%x, WDFMEMORY 0x%p",
906 if (IoBuffer !=
NULL) {
910 (
PVOID*) &pIoMemory);
912 status = pIoMemory->ValidateMemoryOffsets(IoBufferOffsets);
915 "invalid memory offsets, %!STATUS!",
924 ioBuf.
SetMemory(pIoMemory, IoBufferOffsets);
946 "exit WDFIOTARGET 0x%p, WDFREQUEST 0x%p, %!STATUS!",
956WDFEXPORT(WdfIoTargetSendReadSynchronously)(
989WDFEXPORT(WdfIoTargetFormatRequestForRead)(
1020WDFEXPORT(WdfIoTargetSendWriteSynchronously)(
1053WDFEXPORT(WdfIoTargetFormatRequestForWrite)(
1151 "Failed to initialize FxSyncRequest for WDFIOTARGET "
1157 "enter: WDFIOTARGET 0x%p, WDFREQUEST 0x%p, IOCTL 0x%x, "
1171 "invalid options, %!STATUS!",
status);
1183 "invalid input buffer descriptor 0x%p, %!STATUS!",
1197 "invalid output buffer descriptor 0x%p, %!STATUS!",
1211 "WDFIOTARGET 0x%p, WDFREQUEST 0x%p being submitted",
1213 request.m_TrueRequest->GetTraceObjectHandle());
1223 "could not format IOCTL 0x%x request, %!STATUS!",
1292 IFxMemory *pInputMemory, *pOutputMemory;
1304 "enter: WDFIOTARGET 0x%p, WDFREQUEST 0x%p, IOCTL 0x%x, internal %d, input "
1305 "WDFMEMORY 0x%p, output WDFMEMORY 0x%p",
1317 (
PVOID*) &pInputMemory);
1322 "Invalid input memory offsets, %!STATUS!",
1338 (
PVOID*) &pOutputMemory);
1343 "Invalid output memory offsets, %!STATUS!",
1393 "Exit WDFIOTARGET 0x%p, WDFREQUEST 0x%p, %!STATUS!",
1403WDFEXPORT(WdfIoTargetSendIoctlSynchronously)(
1441WDFEXPORT(WdfIoTargetFormatRequestForIoctl)(
1477WDFEXPORT(WdfIoTargetSendInternalIoctlSynchronously)(
1515WDFEXPORT(WdfIoTargetFormatRequestForInternalIoctl)(
1551WDFEXPORT(WdfIoTargetSendInternalIoctlOthersSynchronously)(
1627 "Failed to initialize FxSyncRequest for WDFIOTARGET "
1633 "enter: WDFIOTARGET 0x%p, WDFREQUEST 0x%p, IOCTL 0x%x, Args %p %p %p",
1647 "Invalid options, %!STATUS!",
status);
1662 "invalid OtherArg1 buffer descriptor 0x%p, %!STATUS!",
1677 "invalid OtherArg2 buffer descriptor 0x%p, %!STATUS!",
1692 "invalid OtherArg4 buffer descriptor 0x%p, %!STATUS!",
1707 "WDFIOTARGET 0x%p, WDFREQUEST 0x%p being submitted",
1709 request.m_TrueRequest->GetTraceObjectHandle());
1719 "Could not format IOCTL 0x%x request, %!STATUS!",
1730WDFEXPORT(WdfIoTargetFormatRequestForInternalIoctlOthers)(
1809 "Enter: WDFIOTARGET 0x%p, WDFREQUEST 0x%p, IOCTL 0x%x, "
1810 "WDFMEMORY 1 0x%p, 2 0x%p, 3 0x%p",
1840 "Invalid OtherArg%d memory offsets, %!STATUS!",
1858 "Exit: WDFIOTARGET %p, WDFREQUEST %p, IOCTL 0x%x, "
1859 "Arg Handles %p %p %p, status %!STATUS!",
1870WDFEXPORT(WdfIoTargetSelfAssignDefaultIoQueue)(
1938 "Input WDFQUEUE 0x%p belongs to WDFDEVICE 0x%p, but "
1939 "Self Io Target 0x%p corresponds to the WDFDEVICE 0x%p, %!STATUS!",
1957 "Queue cannot be configured for automatic dispatching"
1958 " after WdfControlDeviceFinishInitializing"
1959 "is called on the WDFDEVICE %p is called %!STATUS!",
1973 "Queue cannot be configured for automatic dispatching"
1974 "after the WDFDEVICE %p is started, %!STATUS!",
1988WDFEXPORT(WdfIoTargetWdmGetTargetFileHandle)(
2021 "enter WDFIOTARGET 0x%p",
IoTarget);
2026 "exit WDFIOTARGET 0x%p, WDM file handle 0x%p",
WDFDEVICE __inline GetHandle(VOID)
MdDeviceObject __inline GetDeviceObject(VOID)
__inline CfxDevice * GetDevice(VOID)
static _Must_inspect_result_ NTSTATUS _Create(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_OBJECT_ATTRIBUTES Attributes, __in FxDeviceBase *Device, __out FxIoTargetRemote **Target)
VOID SetDispatchQueue(_In_ FxIoQueue *DispatchQueue)
virtual VOID Stop(__in WDF_IO_TARGET_SENT_IO_ACTION Action)
WDFIOTARGET GetHandle(VOID)
_Must_inspect_result_ NTSTATUS SubmitSync(__in FxRequestBase *Request, __in_opt PWDF_REQUEST_SEND_OPTIONS Options=NULL, __out_opt PULONG Action=NULL)
__inline WDF_IO_TARGET_STATE GetState(VOID)
__inline WDFDEVICE GetDeviceHandle(VOID)
_Must_inspect_result_ NTSTATUS FormatInternalIoctlOthersRequest(__in FxRequestBase *Request, __in ULONG Ioctl, __in FxRequestBuffer *Buffers)
_Must_inspect_result_ NTSTATUS FormatIoctlRequest(__in FxRequestBase *Request, __in ULONG Ioctl, __in BOOLEAN Internal, __in FxRequestBuffer *InputBuffer, __in FxRequestBuffer *OutputBuffer, __in_opt FxFileObject *FileObject=NULL)
virtual VOID Purge(__in WDF_IO_TARGET_PURGE_IO_ACTION Action)
virtual _Must_inspect_result_ NTSTATUS Start(VOID)
_Must_inspect_result_ NTSTATUS FormatIoRequest(__inout FxRequestBase *Request, __in UCHAR MajorCode, __in FxRequestBuffer *IoBuffer, __in_opt PLONGLONG StartingOffset, __in_opt FxFileObject *FileObject=NULL)
CfxDevice * GetDevice(VOID)
__inline FxRequestContext * GetContext(VOID)
_Must_inspect_result_ NTSTATUS ValidateMemoryOffsets(__in_opt PWDFMEMORY_OFFSET Offsets)
#define NT_SUCCESS(StatCode)
#define __drv_when(cond, annotes)
#define _IRQL_requires_max_(irql)
#define __drv_maxIRQL(irql)
#define __drv_strictTypeMatch(mode)
#define DO_DEVICE_INITIALIZING
MxDeviceObject deviceObject
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
#define DDI_ENTRY_IMPERSONATION_OK()
WDFMEMORY memoryHandles[FX_REQUEST_NUM_OTHER_PARAMS]
_Must_inspect_result_ __in WDFIOTARGET __in_opt WDFREQUEST __in ULONG __in_opt PWDF_MEMORY_DESCRIPTOR __in_opt PWDF_MEMORY_DESCRIPTOR OtherArg2
_Must_inspect_result_ __in WDFDEVICE __in_opt PWDF_OBJECT_ATTRIBUTES IoTargetAttributes
_Must_inspect_result_ _In_ WDFIOTARGET _In_ WDFQUEUE Queue
PWDFMEMORY_OFFSET offsets[FX_REQUEST_NUM_OTHER_PARAMS]
_Must_inspect_result_ __in WDFIOTARGET __in_opt WDFREQUEST __in ULONG __in_opt PWDF_MEMORY_DESCRIPTOR __in_opt PWDF_MEMORY_DESCRIPTOR __in_opt PWDF_REQUEST_SEND_OPTIONS __out_opt PULONG_PTR BytesReturned
_Must_inspect_result_ __in WDFIOTARGET __in_opt WDFREQUEST __in_opt PWDF_MEMORY_DESCRIPTOR __in_opt PLONGLONG DeviceOffset
PFX_DRIVER_GLOBALS pGlobals
_Must_inspect_result_ NTSTATUS FxIoTargetSendIoctl(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in WDFIOTARGET IoTarget, __in_opt WDFREQUEST Request, __in ULONG Ioctl, __in BOOLEAN Internal, __in_opt PWDF_MEMORY_DESCRIPTOR InputBuffer, __in_opt PWDF_MEMORY_DESCRIPTOR OutputBuffer, __in_opt PWDF_REQUEST_SEND_OPTIONS RequestOptions, __out_opt PULONG_PTR BytesReturned)
FxObjectHandleGetPtrAndGlobals(GetFxDriverGlobals(DriverGlobals), Device, FX_TYPE_DEVICE_BASE,(PWDFOBJECT) &pDevice, &pFxDriverGlobals)
static _Must_inspect_result_ NTSTATUS FxIoTargetFormatIoctl(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in WDFIOTARGET IoTarget, __in WDFREQUEST Request, __in ULONG Ioctl, __in BOOLEAN Internal, __in_opt WDFMEMORY InputBuffer, __in_opt PWDFMEMORY_OFFSET InputBufferOffsets, __in_opt WDFMEMORY OutputBuffer, __in_opt PWDFMEMORY_OFFSET OutputBufferOffsets)
_Must_inspect_result_ __in WDFIOTARGET __in_opt WDFREQUEST __in_opt PWDF_MEMORY_DESCRIPTOR __in_opt PLONGLONG __in_opt PWDF_REQUEST_SEND_OPTIONS __out_opt PULONG_PTR BytesWritten
FxInternalIoctlOthersContext context
_Must_inspect_result_ __in WDFIOTARGET __in PWDF_IO_TARGET_OPEN_PARAMS OpenParams
_Must_inspect_result_ __in WDFIOTARGET __in WDFREQUEST __in_opt WDFMEMORY __in_opt PWDFMEMORY_OFFSET InputBufferOffsets
_Must_inspect_result_ __in WDFIOTARGET __in_opt WDFREQUEST __in_opt PWDF_MEMORY_DESCRIPTOR InputBuffer
_Must_inspect_result_ __in WDFIOTARGET __in_opt WDFREQUEST __in_opt PWDF_MEMORY_DESCRIPTOR OutputBuffer
_Must_inspect_result_ NTSTATUS FxIoTargetValidateOpenParams(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_IO_TARGET_OPEN_PARAMS OpenParams)
_Must_inspect_result_ __in WDFIOTARGET __in_opt WDFREQUEST Request
FxInternalIoctlParams InternalIoctlParams
_Must_inspect_result_ __in WDFDEVICE Device
_Must_inspect_result_ __in WDFIOTARGET __in WDFREQUEST __in ULONG __in_opt WDFMEMORY __in_opt PWDFMEMORY_OFFSET __in_opt WDFMEMORY __in_opt PWDFMEMORY_OFFSET __in_opt WDFMEMORY __in_opt PWDFMEMORY_OFFSET OtherArg4Offsets
_Must_inspect_result_ __in WDFIOTARGET __in_opt WDFREQUEST __in ULONG __in_opt PWDF_MEMORY_DESCRIPTOR OtherArg1
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGIOTARGET, "WDFDEVICE 0x%p", Device)
_Must_inspect_result_ __in WDFIOTARGET __in_opt WDFREQUEST __in ULONG Ioctl
static _Must_inspect_result_ NTSTATUS FxIoTargetFormatIo(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in WDFIOTARGET IoTarget, __inout WDFREQUEST Request, __in UCHAR MajorCode, __inout_opt WDFMEMORY IoBuffer, __in_opt PWDFMEMORY_OFFSET IoBufferOffsets, __in_opt PLONGLONG DeviceOffset)
_Must_inspect_result_ __in WDFIOTARGET __in_opt WDFREQUEST __in ULONG __in_opt PWDF_MEMORY_DESCRIPTOR __in_opt PWDF_MEMORY_DESCRIPTOR __in_opt PWDF_MEMORY_DESCRIPTOR OtherArg4
IFxMemory * pMemory[FX_REQUEST_NUM_OTHER_PARAMS]
FxIoTargetSelf * pTargetSelf
_Must_inspect_result_ __in WDFIOTARGET __in_opt WDFREQUEST __in_opt PWDF_MEMORY_DESCRIPTOR __in_opt PLONGLONG __in_opt PWDF_REQUEST_SEND_OPTIONS RequestOptions
FxObjectHandleGetPtr(GetFxDriverGlobals(DriverGlobals), IoTarget, FX_TYPE_IO_TARGET,(PVOID *) &pTarget)
WDF_IO_TARGET_OPEN_PARAMS openParams
static _Must_inspect_result_ NTSTATUS FxIoTargetSendIo(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in WDFIOTARGET IoTarget, __inout_opt WDFREQUEST Request, __in UCHAR MajorCode, __inout_opt PWDF_MEMORY_DESCRIPTOR IoBuffer, __in_opt PLONGLONG DeviceOffset, __in_opt PWDF_REQUEST_SEND_OPTIONS RequestOptions, __out_opt PULONG_PTR BytesReturned)
_Must_inspect_result_ __in WDFIOTARGET __in_opt WDFREQUEST __in_opt PWDF_MEMORY_DESCRIPTOR __in_opt PLONGLONG __in_opt PWDF_REQUEST_SEND_OPTIONS __out_opt PULONG_PTR BytesRead
_Must_inspect_result_ __in WDFIOTARGET __in WDFREQUEST __in_opt WDFMEMORY __in_opt PWDFMEMORY_OFFSET OutputBufferOffsets
_Must_inspect_result_ __in WDFIOTARGET __in WDFREQUEST __in ULONG __in_opt WDFMEMORY __in_opt PWDFMEMORY_OFFSET OtherArg1Offsets
_Must_inspect_result_ __in WDFIOTARGET __in WDFREQUEST __in ULONG __in_opt WDFMEMORY __in_opt PWDFMEMORY_OFFSET __in_opt WDFMEMORY __in_opt PWDFMEMORY_OFFSET OtherArg2Offsets
_Must_inspect_result_ __in WDFIOTARGET IoTarget
PFX_DRIVER_GLOBALS pFxDriverGlobals
@ FxIoTargetRemoteCloseReasonPlainClose
@ FxIoTargetRemoteCloseReasonQueryRemove
#define FxPointerNotNull(FxDriverGlobals, Ptr)
#define FX_REQUEST_NUM_OTHER_PARAMS
NTSTATUS __inline FxValidateRequestOptions(_In_ PFX_DRIVER_GLOBALS FxDriverGlobals, _In_ PWDF_REQUEST_SEND_OPTIONS Options, _In_opt_ FxRequestBase *Request=NULL)
@ FX_TYPE_IO_TARGET_REMOTE
_Must_inspect_result_ NTSTATUS __inline FxValidateUnicodeString(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PCUNICODE_STRING String)
_Must_inspect_result_ NTSTATUS FxValidateObjectAttributes(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_OBJECT_ATTRIBUTES Attributes, __in ULONG Flags=FX_VALIDATE_OPTION_NONE_SPECIFIED)
__inline NTSTATUS FxVerifierCheckIrqlLevel(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in KIRQL Irql)
#define _Must_inspect_result_
__GNU_EXTENSION typedef __int64 * PLONGLONG
#define TRACE_LEVEL_VERBOSE
#define TRACE_LEVEL_ERROR
VOID SetMemory(__in IFxMemory *Memory, __in PWDFMEMORY_OFFSET Offsets)
NTSTATUS ValidateMemoryDescriptor(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_MEMORY_DESCRIPTOR Descriptor, __in ULONG Flags=0x0)
WDF_REQUEST_COMPLETION_PARAMS m_CompletionParams
VOID FormatReadParams(__in_opt IFxMemory *ReadMemory, __in_opt PWDFMEMORY_OFFSET ReadOffsets)
VOID FormatOtherParams(__in FxInternalIoctlParams *InternalIoctlParams)
VOID FormatWriteParams(__in_opt IFxMemory *WriteMemory, __in_opt PWDFMEMORY_OFFSET WriteOffsets)
_Must_inspect_result_ BOOLEAN IsVersionGreaterThanOrEqualTo(__in ULONG Major, __in ULONG Minor)
struct _WDF_REQUEST_COMPLETION_PARAMS::@3889::@3892 Ioctl
union _WDF_REQUEST_COMPLETION_PARAMS::@3889 Parameters
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define STATUS_INVALID_DEVICE_REQUEST
#define STATUS_INVALID_PARAMETER
#define STATUS_INVALID_DEVICE_STATE
#define STATUS_INFO_LENGTH_MISMATCH
struct _WDF_IO_TARGET_OPEN_PARAMS_V1_11 WDF_IO_TARGET_OPEN_PARAMS_V1_11
_Must_inspect_result_ _In_ WDFDEVICE Device
_Must_inspect_result_ _In_ WDFDEVICE _In_ PIRP _In_ WDFQUEUE Queue
@ WdfRequestTypeDeviceControlInternal
@ WdfRequestTypeDeviceControl
enum _WDF_IO_TARGET_PURGE_IO_ACTION WDF_IO_TARGET_PURGE_IO_ACTION
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_ ULONG _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PWDF_MEMORY_DESCRIPTOR OtherArg2
@ WdfIoTargetOpenLocalTargetByFile
@ WdfIoTargetOpenUseExistingDevice
_Must_inspect_result_ _In_ WDFIOTARGET _In_ PWDF_IO_TARGET_OPEN_PARAMS OpenParams
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_ ULONG _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesReturned
struct _WDF_IO_TARGET_OPEN_PARAMS WDF_IO_TARGET_OPEN_PARAMS
@ WdfIoTargetCancelSentIo
@ WdfIoTargetWaitForSentIoToComplete
@ WdfIoTargetSentIoUndefined
@ WdfIoTargetLeaveSentIoPending
enum _WDF_IO_TARGET_SENT_IO_ACTION WDF_IO_TARGET_SENT_IO_ACTION
_Must_inspect_result_ _In_ WDFDEVICE _In_opt_ PWDF_OBJECT_ATTRIBUTES IoTargetAttributes
_Must_inspect_result_ _In_ WDFDEVICE _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIOTARGET * IoTarget
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR OutputBuffer
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
@ WdfIoTargetPurgeIoUndefined
@ WdfIoTargetPurgeIoAndWait
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesWritten
WDF_EXTERN_C_START enum _WDF_IO_TARGET_STATE WDF_IO_TARGET_STATE
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_ ULONG _In_opt_ PWDF_MEMORY_DESCRIPTOR OtherArg1
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG DeviceOffset
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_ ULONG _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PWDF_MEMORY_DESCRIPTOR OtherArg4
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesRead
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR InputBuffer
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS RequestOptions