1 /*++ 2 3 Copyright (c) Microsoft Corporation 4 5 ModuleName: 6 7 MxTimer.h 8 9 Abstract: 10 11 Mode agnostic definiton of timer 12 13 See MxTimerKm.h and MxTimerUm.h for 14 mode specific implementations 15 16 Author: 17 18 19 Revision History: 20 21 22 23 --*/ 24 25 #pragma once 26 27 class MxTimer 28 { 29 private: 30 // 31 // Handle to the timer object 32 // 33 MdTimer m_Timer; 34 35 public: 36 37 __inline 38 MxTimer( 39 VOID 40 ); 41 42 __inline 43 ~MxTimer( 44 VOID 45 ); 46 47 CHECK_RETURN_IF_USER_MODE 48 __inline 49 NTSTATUS 50 Initialize( 51 __in_opt PVOID TimerContext, 52 __in MdDeferredRoutine TimerCallback, 53 __in LONG Period 54 ); 55 56 CHECK_RETURN_IF_USER_MODE 57 __inline 58 NTSTATUS 59 InitializeEx( 60 __in_opt PVOID TimerContext, 61 __in MdExtCallbackType TimerCallback, 62 __in LONG Period, 63 __in ULONG TolerableDelay, 64 __in BOOLEAN UseHighResolutionTimer 65 ); 66 67 __inline 68 VOID 69 Start( 70 __in LARGE_INTEGER DueTime, 71 __in ULONG TolerableDelay = 0 72 ); 73 74 __inline 75 BOOLEAN 76 StartWithReturn( 77 __in LARGE_INTEGER DueTime, 78 __in ULONG TolerableDelay = 0 79 ); 80 81 _Must_inspect_result_ 82 __inline 83 BOOLEAN 84 Stop( 85 VOID 86 ); 87 88 __inline 89 VOID 90 FlushQueuedDpcs( 91 VOID 92 ); 93 }; 94 95 96