question

RussellKaplan-0852 avatar image
0 Votes"
RussellKaplan-0852 asked ·

DeleteTimerQueueTimer Possible FALSE return conditions

DeleteTimerQueueTimer is documented as returning FALSE with GetLastError value ERROR_IO_PENDING when the callback is queued to run or is running (when using NULL as the notification completion handle). The documentation indicates that if the routine returns FALSE with a different GetLastError value, it should be retried. However, the documentation does not really provide any reasons why a different GetLastError would be returned, or why a retry (how many?) would stand any better chance of success. The questions then are assuming a valid timer queue handle, and timer handle, and NULL as the completion notification what are the other possible GetLastError return values, other than ERROR_IO_PENDING. If a GetLastError returns FALSE with a GetLastError being something other than ERROR_IO_PENDING, and the call is not retried, is there a possibility then that the timer callback will actually fire in the future, assuming it hasn't fired yet (or is not queued to fire).

windows-api-general
· 1
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

This is probably something you need to ask for clarification of by the documentation. I'd try using the "Is this page helpful" (No) on the documentation page.


0 Votes 0 ·

1 Answer

SongZhu-MSFT avatar image
0 Votes"
SongZhu-MSFT answered ·

When calling Win32 Api, the error and the reason are written in System Error Codes. You can use the error code to determine the cause of the error when you encounter an error.

The reason for the additional label ERROR_IO_PENDING is that when the error is returned, it does not mean that the function call failed. It is that the current timer queue is busy and cannot be processed immediately. However, it has been successfully submitted and will be processed when the subsequent timer queue is free.

Other possible errors were not submitted successfully. So they were not successfully deleted from the timer queue, and the timer will not be deleted in the future, so it is recommended that you try to call the function again.


If the answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.




·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.