This function cannot be called while the thread is using impersonation. The resulting behavior is undefined.You can set CompletionEvent to INVALID_HANDLE_VALUE when calling this function from within the timer callback of another timer as long as the callback function is not executed in the timer thread. However, a deadlock may occur if two callback functions attempt a blocking DeleteTimerQueueTimer call on each others' timers. Furthermore, you cannot make a blocking deletion call on a timer associated with the callback.Be careful when making a blocking DeleteTimerQueueTimer call on a persistent thread. If the timer being deleted was created with WT_EXECUTEINPERSISTENTTHREAD, a deadlock may occur.If there are outstanding callback functions and CompletionEvent is NULL, the function will fail and set the error code to ERROR_IO_PENDING. This indicates that there are outstanding callback functions. Those callbacks either will execute or are in the middle of executing. The timer is cleaned up when the callback function is finished executing.To cancel all timers in a timer queue, call the DeleteTimerQueueEx function.