24#include "../../fxtargetsshared.hpp"
27#if defined(EVENT_TRACING)
28#include "FxIoTargetKm.tmh"
67 if (pContext ==
NULL) {
69 "could not allocate context for request");
103 ioLength = IoBuffer->GetBufferLength();
117 setBufferAndLength =
FALSE;
126 "Could not allocate common buffer");
132 setBufferAndLength =
TRUE;
141 "Could not retrieve io buffer, %!STATUS!",
status);
164 if (setBufferAndLength) {
194 status = IoBuffer->GetOrAllocateMdl(
207 "Could not retrieve io buffer as a PMDL, %!STATUS!",
225 "Could not retrieve io buffer as a PVOID, %!STATUS!",
235 "Trying to format closed WDFIOTARGET %p, %!STATUS!",
264 Request->VerifierSetFormatted();
272 Request->ContextReleaseAndRestore();
292 ULONG inLength, outLength;
312 if (pContext ==
NULL) {
315 "Could not allocate context for request");
362 if (inLength != 0 || outLength != 0) {
363 ULONG allocationLength;
365 allocationLength = (inLength > outLength ? inLength : outLength);
370 setBufferAndLength =
FALSE;
379 "Could not allocate common buffer");
383 setBufferAndLength =
TRUE;
391 "Could not retrieve input buffer, %!STATUS!",
406 "Could not retrieve output buffer, %!STATUS!",
412 if (setBufferAndLength) {
444 "Could not retrieve input buffer as a PVOID, %!STATUS!",
475 "Could not retrieve output buffer as a PMDL, %!STATUS!",
488 "Could not retrieve output buffer as a PVOID, %!STATUS!",
500 "Could not retrieve input buffer as a PVOID, %!STATUS!",
511 Request->VerifierSetFormatted();
519 Request->ContextReleaseAndRestore();
__inline VOID CopyFileObjectAndFlags(__in FxRequestBase *Request)
_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)
_Must_inspect_result_ NTSTATUS FormatIoRequest(__inout FxRequestBase *Request, __in UCHAR MajorCode, __in FxRequestBuffer *IoBuffer, __in_opt PLONGLONG StartingOffset, __in_opt FxFileObject *FileObject=NULL)
PMDL * GetMdlAddressPointer()
VOID SetSystemBuffer(__in PVOID Value)
VOID SetMajorFunction(__in UCHAR MajorFunction)
VOID SetParameterIoctlCode(__in ULONG DeviceIoControlCode)
VOID SetNextParameterWriteLength(__in ULONG IoLength)
VOID SetParameterIoctlInputBufferLength(__in ULONG InputBufferLength)
VOID SetParameterIoctlType3InputBuffer(__in PVOID Type3InputBuffer)
VOID SetUserBuffer(__in PVOID Value)
VOID SetParameterIoctlOutputBufferLength(__in ULONG OutputBufferLength)
VOID ClearNextStackLocation(VOID)
VOID SetNextParameterWriteByteOffsetQuadPart(__in LONGLONG DeviceOffset)
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
#define NT_SUCCESS(StatCode)
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
_Must_inspect_result_ __in WDFIOTARGET __in_opt WDFREQUEST __in ULONG Ioctl
void FxPoolFree(__in_xcount(ptr is at an offset from AllocationStart) PVOID ptr)
#define _Must_inspect_result_
#define UNREFERENCED_PARAMETER(P)
__GNU_EXTENSION typedef __int64 * PLONGLONG
#define IRP_MJ_DEVICE_CONTROL
#define TRACE_LEVEL_ERROR
VOID StoreAndReferenceOtherMemory(__in FxRequestBuffer *Buffer)
BOOLEAN m_CopyBackToBuffer
VOID SetBufferAndLength(__in PVOID Buffer, __in size_t BufferLength, __in BOOLEAN CopyBackToBuffer)
size_t m_BufferToFreeLength
VOID CaptureState(__in FxIrp *Irp)
virtual VOID StoreAndReferenceMemory(__in FxRequestBuffer *Buffer)
struct _IO_STACK_LOCATION::@3979::@3984 Write
struct _IO_STACK_LOCATION::@3979::@3983 Read
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define STATUS_INVALID_DEVICE_STATE
#define STATUS_INSUFFICIENT_RESOURCES
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
_Must_inspect_result_ _In_ WDFQUEUE _In_opt_ WDFREQUEST _In_opt_ WDFFILEOBJECT _Inout_opt_ PWDF_REQUEST_PARAMETERS Parameters
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR OutputBuffer
_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_opt_ PWDF_MEMORY_DESCRIPTOR InputBuffer
#define METHOD_DIRECT_FROM_HARDWARE
#define METHOD_FROM_CTL_CODE(ctrlCode)
#define IRP_MJ_INTERNAL_DEVICE_CONTROL
#define METHOD_DIRECT_TO_HARDWARE