diff options
| author | Wei Mao <[email protected]> | 2017-06-21 09:41:28 -0700 |
|---|---|---|
| committer | Wei Mao <[email protected]> | 2017-06-21 09:46:42 -0700 |
| commit | 6a7b5d032d331efe11d1c8f33f399296e529d9b7 (patch) | |
| tree | ef98ffe35d091fa7711ee7a843ee82d16c8180bd /general/echo/umdf2 | |
| parent | 72d6e020298b18db58119f6b1ab66f1b917f0deb (diff) | |
issue #127: Remove timerConfig.AutomaticSerialization = FALSE from KMDF echo sample
Diffstat (limited to 'general/echo/umdf2')
| -rw-r--r-- | general/echo/umdf2/driver/AutoSync/queue.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/general/echo/umdf2/driver/AutoSync/queue.c b/general/echo/umdf2/driver/AutoSync/queue.c index 3162a683..98860df6 100644 --- a/general/echo/umdf2/driver/AutoSync/queue.c +++ b/general/echo/umdf2/driver/AutoSync/queue.c @@ -79,7 +79,7 @@ Return Value: // with the same lock. // queueAttributes.SynchronizationScope = WdfSynchronizationScopeQueue; - + queueAttributes.EvtDestroyCallback = EchoEvtIoQueueContextDestroy; status = WdfIoQueueCreate( @@ -145,21 +145,18 @@ Return Value: WDF_OBJECT_ATTRIBUTES timerAttributes; // - // Create a WDFTIMER object + // Create a non-periodic timer since WDF does not allow periodic timer + // at passive level, which is the level UMDF callbacks are invoked at. + // The workaround is to always restart the timer in the timer callback. + // + // WDF_TIMER_CONFIG_INIT sets AutomaticSerialization to TRUE by default. // WDF_TIMER_CONFIG_INIT(&timerConfig, EchoEvtTimerFunc); - // - // WDF_OBJECT_ATTRIBUTES_INIT sets AutomaticSerialization to TRUE by default - // WDF_OBJECT_ATTRIBUTES_INIT(&timerAttributes); timerAttributes.ParentObject = Queue; // Synchronize with the I/O Queue - timerAttributes.ExecutionLevel = WdfExecutionLevelPassive; + timerAttributes.ExecutionLevel = WdfExecutionLevelPassive; - // - // Create a non-periodic timer since WDF does not allow periodic timer - // with autosynchronization at passive level - // Status = WdfTimerCreate(&timerConfig, &timerAttributes, Timer // Output handle @@ -530,7 +527,7 @@ Return Value: } // - // Restart the Timer since WDF does not allow periodic timer + // Restart the Timer since WDF does not allow periodic timer // with autosynchronization at passive level // WdfTimerStart(Timer, WDF_REL_TIMEOUT_IN_MS(TIMER_PERIOD)); |
