ReactOS  0.4.15-dev-1632-g4e289ce
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!",
317  IoTarget, status);
318 
319  return status;
320  }
321 
324  BufferLength,
326  ResultLength);
327 
329  "exit WDFIOTARGET 0x%p, Property %d, %!STATUS!",
331 
332 
333 
334  return status;
335 }
#define DDI_ENTRY()
Definition: fxglobalskm.h:56
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3767
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY DeviceProperty
Definition: wdfdevice.h:3767
FxObjectHandleGetPtrAndGlobals(GetFxDriverGlobals(DriverGlobals), IoTarget, FX_TYPE_IO_TARGET,(PVOID *) &pTarget, &pFxDriverGlobals)
LONG NTSTATUS
Definition: precomp.h:26
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
DriverGlobals
PDEVICE_OBJECT pPdo
__inline MdDeviceObject GetTargetPDO(VOID)
Definition: fxiotarget.hpp:281
FxPointerNotNull(pFxDriverGlobals, InterfaceType)
FxIoTarget * pTarget
#define TRACE_LEVEL_VERBOSE
Definition: storswtr.h:30
__inline NTSTATUS FxVerifierCheckIrqlLevel(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in KIRQL Irql)
Definition: fxverifier.h:158
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ ULONG _Out_ PVOID PropertyBuffer
Definition: wdfdevice.h:4431
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
PFX_DRIVER_GLOBALS pGlobals
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
#define NULL
Definition: types.h:112
NTSTATUS status
static __inline NTSTATUS _GetDeviceProperty(_In_ MdDeviceObject DeviceObject, _In_ DEVICE_REGISTRY_PROPERTY DeviceProperty, _In_ ULONG BufferLength, _Out_opt_ PVOID PropertyBuffer, _Out_ PULONG ResultLength)
_Must_inspect_result_ _In_ WDFDEVICE _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIOTARGET * IoTarget
Definition: wdfiotarget.h:363
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_ PULONG ResultLength
Definition: wdfdevice.h:3776
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGIOTARGET, "enter WDFIOTARGET 0x%p", IoTarget)
#define TRACINGIOTARGET
Definition: dbgtrace.h:72
Definition: ps.c:97

◆ __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,
WDM DevObj 0x%p"  ,
IoTarget  ,
pDevice   
)

◆ DoTraceLevelMessage() [3/5]

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

◆ 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,
Property d,
%!STATUS!"  ,
IoTarget  ,
DeviceProperty  ,
status   
)

◆ FxObjectHandleGetPtrAndGlobals()

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

Referenced by __deref_out_range().

◆ FxPointerNotNull() [1/3]

FxPointerNotNull ( pFxDriverGlobals  ,
InterfaceType   
)

Referenced by __deref_out_range().

◆ FxPointerNotNull() [2/3]

FxPointerNotNull ( pFxDriverGlobals  ,
Interface   
)

◆ 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  }
NTSTATUS status

◆ 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!",
414  IoTarget, status);
415 
416  return status;
417  }
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
PFX_DRIVER_GLOBALS pFxDriverGlobals
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
NTSTATUS status
_Must_inspect_result_ _In_ WDFDEVICE _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIOTARGET * IoTarget
Definition: wdfiotarget.h:363
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGIOTARGET, "enter WDFIOTARGET 0x%p", IoTarget)
#define TRACINGIOTARGET
Definition: dbgtrace.h:72
Definition: ps.c:97

◆ ObDereferenceObject()

ObDereferenceObject ( pTopOfStack  )

Variable Documentation

◆ BufferLength

◆ DeviceProperty

◆ Interface

Definition at line 176 of file fxiotargetapikm.cpp.

◆ InterfaceSpecificData

◆ InterfaceType

Definition at line 176 of file fxiotargetapikm.cpp.

◆ IoTarget

Initial value:

Definition at line 56 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:
{
#define DDI_ENTRY()
Definition: fxglobalskm.h:56

Definition at line 377 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 176 of file fxiotargetapikm.cpp.

◆ status

◆ Version

Definition at line 176 of file fxiotargetapikm.cpp.