[in] Time of the first notification, in 100-nanosecond units. Must be greater than zero and less than MAX_TIME.

rtPeriodTime

[in] Time between notifications, in 100-nanosecond units. Must be greater than zero.

hSemaphore

[in] Handle to a semaphore, created by the caller.

pdwAdviseCookie

[out] Pointer to a variable that receives an identifier for the advise request.

Return Value

Returns an HRESULT value. Possible values include the following.

Return code

Description

S_OK

Success.

E_INVALIDARG

Invalid time values.

E_OUTOFMEMORY

Failure.

E_POINTER

NULL pointer argument.

Remarks

At each notification time, the clock releases the semaphore specified in the hSemaphore parameter. When no further notifications are required, call IReferenceClock::Unadvise and pass the pdwAdviseToken value returned from this call.

The following code example creates an advise request that signals five seconds from the time it is created, and again every second thereafter: