PeerGroupSetProperties function (p2p.h)

The PeerGroupSetProperties function sets the current peer group properties. In version 1.0 of this API, only the creator of the peer group can perform this operation.

Syntax

NOT_BUILD_WINDOWS_DEPRECATE HRESULT PeerGroupSetProperties(
  [in] HGROUP                 hGroup,
  [in] PPEER_GROUP_PROPERTIES pProperties
);

Parameters

[in] hGroup

Handle to the peer group whose properties are set by a peer. This handle is returned by the PeerGroupCreate, PeerGroupOpen, or PeerGroupJoin function. This parameter is required.

[in] pProperties

Pointer to a peer-populated PEER_GROUP_PROPERTIES structure that contains the new properties. To obtain this structure, a peer must first call PeerGroupGetProperties, change the appropriate fields, and then pass it as this parameter. This parameter is required.

The following members of PEER_GROUP_PROPERTIES cannot be changed:

  • dwSize
  • pwzCloud
  • pwzClassifier
  • pwzGroupPeerName
  • pwzCreatorPeerName

Return value

Returns S_OK if the operation succeeds. Otherwise, the function returns one of the following values.

Return code Description
E_OUTOFMEMORY
There is not enough memory available to complete the operation.
PEER_E_GROUP_NOT_READY
The group is not in a state where peer group properties can be set. For example, PeerGroupJoin has been called, but synchronization with the peer group database is not complete.
PEER_E_INVALID_GROUP
The handle to the peer group is invalid.
PEER_E_INVALID_GROUP_PROPERTIES
One or more of the specified properties is invalid.
PEER_E_NOT_AUTHORIZED
The current identity does not have the authorization to change these properties. In this case, the identity is not the creator of the peer group.
PEER_E_PASSWORD_DOES_NOT_MEET_POLICY
Password specified does not meet system password requirements.
 

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

Remarks

For applications that utilize passwords, it is recommended the passwords are handled securely by calling the CryptoProtectMemory and SecureZeroMemory functions.

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

PEER_GROUP_PROPERTIES

PeerGroupCreate

PeerGroupGetProperties

PeerGroupJoin

PeerGroupOpen