ReactOS 0.4.15-dev-7934-g1dc8d80
fxiotargetapikm.cpp File Reference
Include dependency graph for fxiotargetapikm.cpp:

Go to the source code of this file.

Functions

 __drv_maxIRQL (DISPATCH_LEVEL) PDEVICE_OBJECT STDCALL WDFEXPORT(WdfIoTargetWdmGetTargetDeviceObject)(__in PWDF_DRIVER_GLOBALS DriverGlobals
 
 FxObjectHandleGetPtrAndGlobals (GetFxDriverGlobals(DriverGlobals), IoTarget, FX_TYPE_IO_TARGET,(PVOID *) &pTarget, &pFxDriverGlobals)
 
 DoTraceLevelMessage (pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGIOTARGET, "enter WDFIOTARGET 0x%p", IoTarget)
 
 DoTraceLevelMessage (pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGIOTARGET, "exit WDFIOTARGET 0x%p, WDM DevObj 0x%p", IoTarget, pDevice)
 
 DoTraceLevelMessage (pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGIOTARGET, "exit WDFIOTARGET 0x%p, WDM PDO 0x%p", IoTarget, pPdo)
 
 DoTraceLevelMessage (pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGIOTARGET, "exit WDFIOTARGET 0x%p, WDM FileObj 0x%p", IoTarget, pFile)
 
 __drv_maxIRQL (PASSIVE_LEVEL) _Must_inspect_result_ NTSTATUS STDCALL WDFEXPORT(WdfIoTargetQueryForInterface)(__in PWDF_DRIVER_GLOBALS DriverGlobals
 
 FxPointerNotNull (pFxDriverGlobals, InterfaceType)
 
 FxPointerNotNull (pFxDriverGlobals, Interface)
 
 if (!NT_SUCCESS(status))
 
 ASSERT (pTopOfStack !=NULL)
 
 ObDereferenceObject (pTopOfStack)
 
_Must_inspect_result_ __in WDFIOTARGET __in DEVICE_REGISTRY_PROPERTY __in ULONG __drv_when (BufferLength !=0, __out_bcount_part_opt(BufferLength, *ResultLength)) __drv_when(BufferLength
 
_Must_inspect_result_ __in WDFIOTARGET __in DEVICE_REGISTRY_PROPERTY __in ULONG __out_opt PVOID __deref_out_range (<=, BufferLength) PULONG ResultLength)
 
_Must_inspect_result_ __in WDFIOTARGET __in DEVICE_REGISTRY_PROPERTY __in __drv_strictTypeMatch (1) POOL_TYPE PoolType
 
 FxPointerNotNull (pFxDriverGlobals, PropertyMemory)
 
 FxVerifierCheckNxPoolType (pFxDriverGlobals, PoolType, pFxDriverGlobals->Tag)
 
 if (pPdo==NULL)
 
 DoTraceLevelMessage (pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGIOTARGET, "exit WDFIOTARGET 0x%p, Property %d, %!STATUS!", IoTarget, DeviceProperty, status)
 

Variables

__in WDFIOTARGET IoTarget
 
FxIoTargetpTarget
 
PDEVICE_OBJECT pDevice = pTarget->GetTargetDevice()
 
PDEVICE_OBJECT pPdo = pTarget->GetTargetPDO()
 
MdFileObject pFile = pTarget->GetTargetFileObject()
 
__in WDFIOTARGET __in LPCGUID InterfaceType
 
__in WDFIOTARGET __in LPCGUID __out PINTERFACE Interface
 
__in WDFIOTARGET __in LPCGUID __out PINTERFACE __in USHORT Size
 
__in WDFIOTARGET __in LPCGUID __out PINTERFACE __in USHORT __in USHORT Version
 
__in WDFIOTARGET __in LPCGUID __out PINTERFACE __in USHORT __in USHORT __in_opt PVOID InterfaceSpecificData
 
PFX_DRIVER_GLOBALS pFxDriverGlobals
 
PDEVICE_OBJECT pTopOfStack = IoGetAttachedDeviceReference(pTarget->GetTargetDevice())
 
NTSTATUS status = FxVerifierCheckIrqlLevel(pFxDriverGlobals, PASSIVE_LEVEL)
 
_Must_inspect_result_ __in WDFIOTARGET __in DEVICE_REGISTRY_PROPERTY DeviceProperty
 
_Must_inspect_result_ __in WDFIOTARGET __in DEVICE_REGISTRY_PROPERTY __in ULONG BufferLength
 
_Must_inspect_result_ __in WDFIOTARGET __in DEVICE_REGISTRY_PROPERTY __in ULONG __out_opt PVOID PropertyBuffer
 
_Must_inspect_result_ __in WDFIOTARGET __in DEVICE_REGISTRY_PROPERTY __in __in_opt PWDF_OBJECT_ATTRIBUTES PropertyMemoryAttributes
 
_Must_inspect_result_ __in WDFIOTARGET __in DEVICE_REGISTRY_PROPERTY __in __in_opt PWDF_OBJECT_ATTRIBUTES __out WDFMEMORY * PropertyMemory
 

Function Documentation

◆ __deref_out_range()

Definition at line 262 of file fxiotargetapikm.cpp.

286{
287 DDI_ENTRY();
288
293
295 IoTarget,
297 (PVOID*) &pTarget,
298 &pGlobals);
299
301 if (BufferLength > 0) {
303 }
304
306 if (!NT_SUCCESS(status)) {
307 return status;
308 }
309
311
312 if (pPdo == NULL) {
314
316 "WDFIOTARGET 0x%p has no PDO (not opened yet?), %!STATUS!",
318
319 return status;
320 }
321
327
329 "exit WDFIOTARGET 0x%p, Property %d, %!STATUS!",
331
332
333
334 return status;
335}
LONG NTSTATUS
Definition: precomp.h:26
static __inline NTSTATUS _GetDeviceProperty(_In_ MdDeviceObject DeviceObject, _In_ DEVICE_REGISTRY_PROPERTY DeviceProperty, _In_ ULONG BufferLength, _Out_opt_ PVOID PropertyBuffer, _Out_ PULONG ResultLength)
__inline MdDeviceObject GetTargetPDO(VOID)
Definition: fxiotarget.hpp:281
#define TRACINGIOTARGET
Definition: dbgtrace.h:72
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
DriverGlobals
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597
#define DDI_ENTRY()
Definition: fxglobalskm.h:56
PFX_DRIVER_GLOBALS pGlobals
FxIoTarget * pTarget
NTSTATUS status
FxObjectHandleGetPtrAndGlobals(GetFxDriverGlobals(DriverGlobals), IoTarget, FX_TYPE_IO_TARGET,(PVOID *) &pTarget, &pFxDriverGlobals)
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGIOTARGET, "enter WDFIOTARGET 0x%p", IoTarget)
PDEVICE_OBJECT pPdo
#define FxPointerNotNull(FxDriverGlobals, Ptr)
Definition: fxmacros.hpp:253
@ FX_TYPE_IO_TARGET
Definition: fxtypes.h:100
__inline NTSTATUS FxVerifierCheckIrqlLevel(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in KIRQL Irql)
Definition: fxverifier.h:158
#define TRACE_LEVEL_VERBOSE
Definition: storswtr.h:30
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
Definition: ps.c:97
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_ PULONG ResultLength
Definition: wdfdevice.h:3776
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ ULONG _Out_ PVOID PropertyBuffer
Definition: wdfdevice.h:4437
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY DeviceProperty
Definition: wdfdevice.h:3769
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3771
_Must_inspect_result_ _In_ WDFDEVICE _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIOTARGET * IoTarget
Definition: wdfiotarget.h:368

◆ __drv_maxIRQL() [1/2]

__drv_maxIRQL ( DISPATCH_LEVEL  )

◆ __drv_maxIRQL() [2/2]

__drv_maxIRQL ( PASSIVE_LEVEL  )

◆ __drv_strictTypeMatch()

_Must_inspect_result_ __in WDFIOTARGET __in DEVICE_REGISTRY_PROPERTY __in __drv_strictTypeMatch ( )

◆ __drv_when()

◆ ASSERT()

ASSERT ( pTopOfStack = NULL)

◆ DoTraceLevelMessage() [1/5]

DoTraceLevelMessage ( pFxDriverGlobals  ,
TRACE_LEVEL_VERBOSE  ,
TRACINGIOTARGET  ,
"enter WDFIOTARGET 0x%p"  ,
IoTarget   
)

Referenced by __deref_out_range(), and if().

◆ DoTraceLevelMessage() [2/5]

DoTraceLevelMessage ( pFxDriverGlobals  ,
TRACE_LEVEL_VERBOSE  ,
TRACINGIOTARGET  ,
"exit WDFIOTARGET 0x%  p,
Property d,
%!STATUS!"  ,
IoTarget  ,
DeviceProperty  ,
status   
)

◆ DoTraceLevelMessage() [3/5]

DoTraceLevelMessage ( pFxDriverGlobals  ,
TRACE_LEVEL_VERBOSE  ,
TRACINGIOTARGET  ,
"exit WDFIOTARGET 0x%  p,
WDM DevObj 0x%p"  ,
IoTarget  ,
pDevice   
)

◆ DoTraceLevelMessage() [4/5]

DoTraceLevelMessage ( pFxDriverGlobals  ,
TRACE_LEVEL_VERBOSE  ,
TRACINGIOTARGET  ,
"exit WDFIOTARGET 0x%  p,
WDM FileObj 0x%p"  ,
IoTarget  ,
pFile   
)

◆ DoTraceLevelMessage() [5/5]

DoTraceLevelMessage ( pFxDriverGlobals  ,
TRACE_LEVEL_VERBOSE  ,
TRACINGIOTARGET  ,
"exit WDFIOTARGET 0x%  p,
WDM PDO 0x%p"  ,
IoTarget  ,
pPdo   
)

◆ FxObjectHandleGetPtrAndGlobals()

FxObjectHandleGetPtrAndGlobals ( GetFxDriverGlobals(DriverGlobals ,
IoTarget  ,
FX_TYPE_IO_TARGET  ,
(PVOID *) &  pTarget,
pFxDriverGlobals 
)

Referenced by __deref_out_range().

◆ FxPointerNotNull() [1/3]

FxPointerNotNull ( pFxDriverGlobals  ,
Interface   
)

◆ FxPointerNotNull() [2/3]

FxPointerNotNull ( pFxDriverGlobals  ,
InterfaceType   
)

◆ FxPointerNotNull() [3/3]

FxPointerNotNull ( pFxDriverGlobals  ,
PropertyMemory   
)

◆ FxVerifierCheckNxPoolType()

FxVerifierCheckNxPoolType ( pFxDriverGlobals  ,
PoolType  ,
pFxDriverGlobals->  Tag 
)

◆ if() [1/2]

if ( NT_SUCCESSstatus)

Definition at line 227 of file fxiotargetapikm.cpp.

227 {
228 return status;
229 }

◆ if() [2/2]

if ( pPdo  = NULL)

Definition at line 409 of file fxiotargetapikm.cpp.

409 {
411
413 "WDFIOTARGET %p has no PDO (not opened yet?), %!STATUS!",
415
416 return status;
417 }
PFX_DRIVER_GLOBALS pFxDriverGlobals

◆ ObDereferenceObject()

ObDereferenceObject ( pTopOfStack  )

Variable Documentation

◆ BufferLength

◆ DeviceProperty

◆ Interface

Definition at line 180 of file fxiotargetapikm.cpp.

◆ InterfaceSpecificData

◆ InterfaceType

Definition at line 178 of file fxiotargetapikm.cpp.

◆ IoTarget

Initial value:

Definition at line 41 of file fxiotargetapikm.cpp.

◆ pDevice

return pDevice = pTarget->GetTargetDevice()

Definition at line 59 of file fxiotargetapikm.cpp.

◆ pFile

◆ pFxDriverGlobals

PFX_DRIVER_GLOBALS pFxDriverGlobals

Definition at line 213 of file fxiotargetapikm.cpp.

Referenced by if().

◆ pPdo

pPdo = pTarget->GetTargetPDO()

Definition at line 104 of file fxiotargetapikm.cpp.

Referenced by __deref_out_range().

◆ PropertyBuffer

◆ PropertyMemory

Initial value:

Definition at line 355 of file fxiotargetapikm.cpp.

◆ PropertyMemoryAttributes

◆ pTarget

FxIoTarget* pTarget

Definition at line 58 of file fxiotargetapikm.cpp.

Referenced by __deref_out_range().

◆ pTopOfStack

◆ Size

Definition at line 182 of file fxiotargetapikm.cpp.

◆ status

◆ Version

Definition at line 184 of file fxiotargetapikm.cpp.