PeerGraphCreate function (p2p.h)

The PeerGraphCreate function creates a new peer graph. An application can specify information about a peer graph, and the type of security that a peer graph uses. A handle to a peer graph is returned, but a network connection is not established.

Syntax

NOT_BUILD_WINDOWS_DEPRECATE HRESULT PeerGraphCreate(
  [in]  PPEER_GRAPH_PROPERTIES   pGraphProperties,
  [in]  PCWSTR                   pwzDatabaseName,
  [in]  PPEER_SECURITY_INTERFACE pSecurityInterface,
  [out] HGRAPH                   *phGraph
);

Parameters

[in] pGraphProperties

All of the properties of a peer graph in the PEER_GRAPH_PROPERTIES structure.

[in] pwzDatabaseName

The name of a record database to associate with a peer graph when it is created. The record database name must be a valid file name. Do not include a path with the file name. For a complete list of rules regarding file names, see the Naming a File item in the list of Graphing Reference_Links.

[in] pSecurityInterface

The information about a security provider for a peer graph in the PEER_SECURITY_INTERFACE structure.

[out] phGraph

Receives a handle to the peer graph that is created. When this handle is not required anymore, free it by calling PeerGraphClose.

Return value

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

Return code Description
E_INVALIDARG
One of the parameters is not valid.
E_OUTOFMEMORY
There is not enough memory to perform a specified operation.
PEER_E_DUPLICATE_GRAPH
A database with a specified peer graph ID that already exists.
PEER_E_NOT_INITIALIZED
The peer graph must be initialized with a call to PeerGraphStartup before using this function.

Remarks

If you develop your own Security Service Provider (SSP), your application must not call the Peer Graphing API to access data in the peer graphing database, because that can cause a deadlock situation. Instead, the application must use a cached copy of the information. The cached copy is not created by the Peer Graphing API. The application must provide a mechanism for caching this data.

After PeerGraphCreate is called, the application can subscribe to events before it calls PeerGraphListen.

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 P2PGraph.lib
DLL P2PGraph.dll

See also

PEER_GRAPH_PROPERTIES

PEER_SECURITY_INTERFACE

PeerGraphClose

PeerGraphConnect

PeerGraphListen

PeerGraphOpen