PeerGroupUniversalTimeToPeerTime function (p2p.h)

The PeerGroupUniversalTimeToPeerTime function converts a local time value from a peer's computer to a common peer group time value.

Syntax

NOT_BUILD_WINDOWS_DEPRECATE HRESULT PeerGroupUniversalTimeToPeerTime(
  [in]  HGROUP   hGroup,
  [in]  FILETIME *pftUniversalTime,
  [out] FILETIME *pftPeerTime
);

Parameters

[in] hGroup

Handle to the peer group a peer participates in. This handle is returned by the PeerGroupCreate, PeerGroupOpen, or PeerGroupJoin function. This parameter is required.

[in] pftUniversalTime

Pointer to the universal time value, represented as a FILETIME structure. This parameter is required.

[out] pftPeerTime

Pointer to the returned peer time—Greenwich Mean Time (GMT) value that is represented as a FILETIME structure. This parameter is NULL if an error occurs.

Return value

Returns S_OK if the function succeeds. Otherwise, the function returns either one of the RPC errors or one of the following values.

Return code Description
E_INVALIDARG
One of the parameters is not valid.
PEER_E_GROUP_NOT_READY
The peer group is not in a state where peer time can be accurately calculated. For example, PeerGroupJoin has been called, but synchronization with the peer group database has not completed.
PEER_E_NOT_INITIALIZED
The group must be initialized with a call to PeerGroupStartup before using this function.
 

Cryptography-specific errors can be returned from the Microsoft RSA Base Provider. These errors are prefixed with CRYPT_* and defined in Winerror.h.

Remarks

Universal time is the universal time value maintained on a peer's computer.

Peer time is a common reference time maintained by a peer group, expressed as Coordinated Universal Time (UTC). It is often offset from the universal time value, and is used to correct latency issues.

Peer time can be converted to universal time by calling the converse function PeerGroupPeerTimeToUniversalTime.

Requirements

Requirement Value
Minimum supported client Windows XP with SP2 [desktop apps only],Windows XP with SP1 with the Advanced Networking Pack forWindows XP
Minimum supported server None supported
Target Platform Windows
Header p2p.h
Library P2P.lib
DLL P2P.dll

See also

PeerGroupPeerTimeToUniversalTime