ReactOS 0.4.16-dev-109-gf4cb10f
fxtimerapi.cpp File Reference
#include "coreprivshared.hpp"
#include "fxtimer.hpp"
Include dependency graph for fxtimerapi.cpp:

Go to the source code of this file.

Functions

_Must_inspect_result_ __drv_maxIRQL (DISPATCH_LEVEL) NTSTATUS STDCALL WDFEXPORT(WdfTimerCreate)(__in PWDF_DRIVER_GLOBALS DriverGlobals
 
 if (!NT_SUCCESS(status))
 
 FxObjectHandleGetPtrAndGlobals (pFxDriverGlobals, Attributes->ParentObject, FX_TYPE_OBJECT,(PVOID *)&pParent, &pFxDriverGlobals)
 
 FxPointerNotNull (pFxDriverGlobals, Config)
 
 FxPointerNotNull (pFxDriverGlobals, Timer)
 
 if (Config->Size !=sizeof(WDF_TIMER_CONFIG) &&Config->Size !=sizeof(WDF_TIMER_CONFIG_V1_7) &&Config->Size !=sizeof(WDF_TIMER_CONFIG_V1_11))
 
 if (Config->Period > MAXLONG)
 
 if (Config->Size > sizeof(WDF_TIMER_CONFIG_V1_7) &&(pFxDriverGlobals->IsVersionGreaterThanOrEqualTo(1, 13)==FALSE))
 
 if (Config->Size > sizeof(WDF_TIMER_CONFIG_V1_11))
 
 if (Config->Period > 0 &&Attributes->ExecutionLevel==WdfExecutionLevelPassive)
 
 FxObjectHandleGetPtr (GetFxDriverGlobals(DriverGlobals), Timer, FX_TYPE_TIMER,(PVOID *)&pFxTimer)
 
return pFxTimer Start (li)
 
 __drv_when (Wait==__true, __drv_maxIRQL(PASSIVE_LEVEL)) __drv_when(Wait
 
 FxObjectHandleGetPtrAndGlobals (GetFxDriverGlobals(DriverGlobals), Timer, FX_TYPE_TIMER,(PVOID *)&pFxTimer, &pFxDriverGlobals)
 
 if (Wait)
 
return pFxTimer Stop (Wait)
 
return pFxTimer GetObject ()
 

Variables

_Must_inspect_result_ __in PWDF_TIMER_CONFIG Config
 
_Must_inspect_result_ __in PWDF_TIMER_CONFIG __in PWDF_OBJECT_ATTRIBUTES Attributes
 
_Must_inspect_result_ __in PWDF_TIMER_CONFIG __in PWDF_OBJECT_ATTRIBUTES __out WDFTIMER * Timer
 
PFX_DRIVER_GLOBALS pFxDriverGlobals = GetFxDriverGlobals(DriverGlobals)
 
FxObjectpParent
 
NTSTATUS status
 
__in WDFTIMER __in LONGLONG DueTime
 
FxTimerpFxTimer
 
LARGE_INTEGER li
 
li QuadPart = DueTime
 
__in WDFTIMER __in BOOLEAN Wait
 

Function Documentation

◆ __drv_maxIRQL()

◆ __drv_when()

__drv_when ( Wait  = = __true,
__drv_maxIRQL(PASSIVE_LEVEL  
)

◆ FxObjectHandleGetPtr()

FxObjectHandleGetPtr ( GetFxDriverGlobals(DriverGlobals ,
Timer  ,
FX_TYPE_TIMER  ,
(PVOID *)&  pFxTimer 
)

◆ FxObjectHandleGetPtrAndGlobals() [1/2]

FxObjectHandleGetPtrAndGlobals ( GetFxDriverGlobals(DriverGlobals ,
Timer  ,
FX_TYPE_TIMER  ,
(PVOID *)&  pFxTimer,
pFxDriverGlobals 
)

◆ FxObjectHandleGetPtrAndGlobals() [2/2]

FxObjectHandleGetPtrAndGlobals ( pFxDriverGlobals  ,
Attributes->  ParentObject,
FX_TYPE_OBJECT  ,
(PVOID *)&  pParent,
pFxDriverGlobals 
)

◆ FxPointerNotNull() [1/2]

FxPointerNotNull ( pFxDriverGlobals  ,
Config   
)

◆ FxPointerNotNull() [2/2]

FxPointerNotNull ( pFxDriverGlobals  ,
Timer   
)

◆ GetObject()

return pFxTimer GetObject ( )

◆ if() [1/7]

if ( NT_SUCCESSstatus)

Definition at line 93 of file fxtimerapi.cpp.

93 {
94 return status;
95 }
NTSTATUS status
Definition: fxtimerapi.cpp:86

◆ if() [2/7]

if ( Config->  Period,
0 &&Attributes->  ExecutionLevel = WdfExecutionLevelPassive 
)

Definition at line 184 of file fxtimerapi.cpp.

185 {
187
190 "Passive level periodic timer is not supported. "
191 "Use one shot timer and queue the next timer from the callback "
192 "or use a dedicated thread, %!STATUS!",
193 status);
194
195 return status;
196 }
#define TRACINGDEVICE
Definition: dbgtrace.h:58
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
PFX_DRIVER_GLOBALS pFxDriverGlobals
Definition: fxtimerapi.cpp:84
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:423
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
Definition: ps.c:97

◆ if() [3/7]

if ( Config->  Period,
MAXLONG   
)

Definition at line 119 of file fxtimerapi.cpp.

119 {
121
124 "Period value %u for a periodic timer cannot be greater than "
125 "MAXLONG, %!STATUS!", Config->Period, status);
126
127 return status;
128 }
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_CHILD_LIST_CONFIG Config
Definition: wdfchildlist.h:476

◆ if() [4/7]

Definition at line 106 of file fxtimerapi.cpp.

108 {
110
113 "PWDF_TIMER_CONFIG Size %d, expected %d, %!STATUS!",
114 Config->Size, sizeof(WDF_TIMER_CONFIG), status);
115
116 return status;
117 }
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133

◆ if() [5/7]

if ( Config->  Size,
sizeof(WDF_TIMER_CONFIG_V1_11  
)

Definition at line 149 of file fxtimerapi.cpp.

149 {
150
151#if (FX_CORE_MODE == FX_CORE_USER_MODE)
152 if (Config->UseHighResolutionTimer) {
153
157 "UseHighResolutionTimer option is not supported for UMDF "
158 "%!STATUS!", status);
159 return status;
160 }
161#endif
162
163 if ((Config->TolerableDelay > 0) &&
164 (Config->UseHighResolutionTimer)) {
165
167
170 "UseHighResolutionTimer option sepcified with non zero tolerable delay %u "
171 "%!STATUS!", Config->TolerableDelay, status);
172
173 return status;
174 }
175 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:239

◆ if() [6/7]

if ( Config->  Size,
sizeof(WDF_TIMER_CONFIG_V1_7) &&(pFxDriverGlobals->IsVersionGreaterThanOrEqualTo(1, 13)==FALSE  
)

Definition at line 134 of file fxtimerapi.cpp.

135 {
136 if (Config->TolerableDelay > MAXLONG) {
137
139
142 "TolerableDelay value %u cannot be greater than MAXLONG, "
143 "%!STATUS!", Config->TolerableDelay, status);
144
145 return status;
146 }
147 }
#define MAXLONG
Definition: umtypes.h:116

◆ if() [7/7]

if ( Wait  )

Definition at line 289 of file fxtimerapi.cpp.

289 {
291 if (!NT_SUCCESS(status)) {
292 return FALSE;
293 }
294 }
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
__inline NTSTATUS FxVerifierCheckIrqlLevel(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in KIRQL Irql)
Definition: fxverifier.h:158

◆ Start()

return pFxTimer Start ( li  )

◆ Stop()

Variable Documentation

◆ Attributes

◆ Config

◆ DueTime

Initial value:
{
#define DDI_ENTRY()
Definition: fxglobalskm.h:56

Definition at line 210 of file fxtimerapi.cpp.

◆ li

◆ pFxDriverGlobals

Definition at line 84 of file fxtimerapi.cpp.

Referenced by if().

◆ pFxTimer

FxTimer * pFxTimer

Definition at line 234 of file fxtimerapi.cpp.

Referenced by FxTimer::_Create().

◆ pParent

FxObject* pParent

Definition at line 85 of file fxtimerapi.cpp.

◆ QuadPart

li QuadPart = DueTime

Definition at line 242 of file fxtimerapi.cpp.

◆ status

Initial value:
@ FX_VALIDATE_OPTION_PARENT_REQUIRED
_Must_inspect_result_ NTSTATUS __inline FxValidateObjectAttributesForParentHandle(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_OBJECT_ATTRIBUTES Attributes, __in ULONG Flags=FX_VALIDATE_OPTION_NONE_SPECIFIED)
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes

Definition at line 86 of file fxtimerapi.cpp.

Referenced by if().

◆ Timer

__in WDFTIMER Timer
Initial value:

Definition at line 51 of file fxtimerapi.cpp.

◆ Wait

__in WDFTIMER __in BOOLEAN Wait
Initial value:

Definition at line 257 of file fxtimerapi.cpp.