3.2.5.1 W32TimeSync (Opnum 0)

The W32TimeSync method is invoked to request that the time service immediately initiate an attempt to synchronize its time. The MIDL syntax of this method is specified as follows.

 unsigned long W32TimeSync(
   [in] handle_t hBinding,
   [in] unsigned long uWait,
   [in] unsigned long ulFlags
 );

hBinding: RPC primitive binding handle, as specified in [C706] part 3, sections Interface Definition Language and Stubs.

uWait: Blocking status of the call. The value MUST be one of the following.

Value

Meaning

0

Method MUST return RPC_S_OK without waiting for the outcome of time synchronization. In this case, the final outcome of the attempt is not available to the caller.

Non-zero

0 < value

Method MUST NOT return until time synchronization is complete.

The server must block the response to the caller until the attempt at time synchronization is complete, regardless of the status. An implementation can choose to respond to the caller after an implementation-specific timeout occurs.<34>

ulFlags: Time synchronization behaviors.

The following values SHOULD be mutually exclusive. When multiple values are set, the value whose bit is least significant SHOULD take precedence.<35>

Note The TimeSyncFlag_SoftResync value MUST NOT be used in conjunction with any other value in the following table.

Value

Meaning

TimeSyncFlag_SoftResync

0x00000000

The time service MUST synchronize itself with the currently available time samples. It MUST NOT poll the network or hardware time providers for new time data.

TimeSyncFlag_HardResync

0x00000001

The time service MUST discard its old time samples and MUST acquire new samples from the network or hardware time providers.

TimeSyncFlag_Rediscover

0x00000004

Identical to the TimeSyncFlag_HardResync flag, except that the time service MUST attempt to discover new network time sources prior to discarding and reacquiring new time samples.

TimeSyncFlag_UpdateAndResync

0x00000008

Identical to the TimeSyncFlag_Rediscover flag, except that prior to attempting to discover new time sources, the time service MUST update its configuration.

TimeSyncFlag_ForceResync

0x00000010

Identical to the TimeSyncFlag_HardResync flag, except that it causes the processing of the next time sample to ignore any phase correction boundaries imposed by W32Time.

The following value can be joined in a bitwise OR with the preceding values. If uWait is set to zero, the following value MUST be ignored.

Value

Meaning

TimeSyncFlag_ReturnResult

0x00000002

Used only for synchronous calls. If set, the method MUST return one of the following return values.

Return Values: If the TimeSyncFlag_ReturnResult flag is specified, the return value MUST be one of the following specific TimeSync_ReturnResult codes. Otherwise, this method MUST return zero on success or an implementation-specific nonzero error code on failure.<36>

Return value/code

Description

0x00000000

ResyncResult_Success

Synchronization between the time provider and the caller was successful. For asynchronous calls, this result does not guarantee that the server has acquired a new time sample. It merely states that the synchronization attempt has been successfully initiated.

0x00000001

ResyncResult_NoData

The time service could not obtain a new time sample from the time provider.

0x00000002

ResyncResult_StaleData

The time service received data that was time stamped earlier than the last good sample.

0x00000003

ResyncResult_ChangeTooBig

The time service received data in which the time difference from the local clock was too large to trust.

0x00000004

ResyncResult_Shutdown

The time service was shutting down.

The time service MUST immediately attempt to synchronize time with its time sources, as specified by the flags provided in the method invocation. For more information on the flags, see the ulFlags table in this section.<37>