PeerGroupPeerTimeToUniversalTime function (p2p.h)
The PeerGroupPeerTimeToUniversalTime function converts the peer group-maintained reference time value to a localized time value appropriate for display on a peer computer.
Syntax
NOT_BUILD_WINDOWS_DEPRECATE HRESULT PeerGroupPeerTimeToUniversalTime(
[in] HGROUP hGroup,
[in] FILETIME *pftPeerTime,
[out] FILETIME *pftUniversalTime
);
Parameters
[in] hGroup
Handle to the peer group that a peer participates in. This handle is returned by the PeerGroupCreate, PeerGroupOpen, or PeerGroupJoin function. This parameter is required.
[in] pftPeerTime
Pointer to the peer time value—Coordinated Universal Time (UTC)—that is represented as a FILETIME structure. This parameter is required.
[out] pftUniversalTime
Pointer to the returned universal time 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 remote procedure call (RPC) errors or one of the following errors.
Return code | Description |
---|---|
|
One of the parameters is not valid. |
|
The peer group is not in a state that peer time can be retrieved accurately, for example, PeerGroupJoin has been called, but synchronization with the group database has not completed. |
|
The peer 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 computer.
Peer time is a common reference time maintained by a peer group, expressed as UTC. It is often offset from the universal time value, and is used to correct latency issues.
Universal time can be converted to peer time by calling the converse function PeerGroupUniversalTimeToPeerTime.
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 |