Rediger

Del via


Creating a Time Provider

A time provider is implemented as a DLL. Each DLL can support multiple time providers. Each provider is responsible for its own configuration and synchronization.

Time providers must implement the following callback functions:

After it has loaded the provider DLL, the time provider manager calls TimeProvOpen, passing the name of the provider and pointers to the following functions:

These functions are for use by the time provider. The time provider uses TimeProvOpen to return a provider handle that the time provider manager uses when sending commands to the time provider. The handle value is defined by the time provider and is used primarily to distinguish between different providers implemented in the same DLL. The time provider can log significant events using LogTimeProvEventFunc.

The time provider manager uses TimeProvCommand to send commands to the time provider. When the time provider needs to notify the time provider manager that it has time samples available, it calls AlertSamplesAvailFunc. The time provider manager then calls TimeProvCommand with the TPC_GetSamples command to retrieve the time samples. It can take up to 16 seconds for the time provider manager to request the sample. Therefore, the application should not wait for the request.

To ensure accuracy, the time provider should retrieve all time-related information using GetTimeSysInfoFunc.

When it is time to shut down the time provider, the time provider manager calls TimeProvClose.