Export (0) Print
Expand All

PeerGroupExportConfig function

The PeerGroupExportConfig function exports the group configuration for a peer as an XML string that contains the identity, group name, and the GMC for the identity.


HRESULT WINAPI PeerGroupExportConfig(
  _In_   HGROUP hGroup,
  _In_   PCWSTR pwzPassword,
  _Out_  PWSTR *ppwzXML


hGroup [in]

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

pwzPassword [in]

Specifies the password used to protect the exported configuration. There are no rules or limits for the formation of this password. This parameter is required.

ppwzXML [out]

Pointer to the returned XML configuration string that contains the identity, group peer name, cloud peer name, group scope, and the GMC for the identity. This parameter is required.

Return value

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

Return codeDescription

One of the parameters is not valid.


There is not enough memory to perform the specified operation.


Access to the identity or group keys is denied. Typically, this is caused by an incorrect access control list (ACL) for the folder that contains the user or computer keys. This can happen when the ACL is reset manually .


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


After being exported, this configuration can be passed out-of-band to another peer, where the configuration of the identity can be established. To import the configuration, pass the XML string returned by this function with the password set on it to PeerGroupImportConfig.

The configuration XML string appears in the following format:

    <!-- UTF-8 encoded peer name of the identity -->
    <!-- UTF-8 encoded peer name of the group -->
    <!-- UTF-8 encoded Unicode name of the cloud -->
    <!-- UTF-8 encoded Unicode name of the scope: global, site-local, link-local -->
    <!-- A DWORD containing cloud-specific settings, represented as a string -->
  <GMC xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="bin.base64">
    <!-- base64/PKCS7 encoded GMC chain -->


Minimum supported client

Windows XP with SP2 [desktop apps only]

Minimum supported server

None supported


Windows XP with SP1 with the Advanced Networking Pack forWindows XP









Community Additions

© 2015 Microsoft