PeerGraphImportDatabase function (p2p.h)

The PeerGraphImportDatabase function imports a file that contains the information from a peer graph database. This function can only be called if the application has not yet called the PeerGraphListen or PeerGraphConnect function.

Syntax

NOT_BUILD_WINDOWS_DEPRECATE HRESULT PeerGraphImportDatabase(
  [in] HGRAPH hGraph,
  [in] PCWSTR pwzFilePath
);

Parameters

[in] hGraph

Handle to the peer graph.

[in] pwzFilePath

Pointer to a string that contains the path to the file in which the imported data is stored.

Return value

If the function call succeeds, the return value is S_OK. Otherwise, it returns either one of the WinErr.h values or one of the following values.

Return code Description
E_INVALIDARG
One of the parameters is not valid.
PEER_E_GRAPH_IN_USE
The graph is currently being used, and cannot be imported. Either PeerGraphListen or PeerGraphConnect has been called.
PEER_E_INVALID_DATABASE
The specified database is not valid.
PEER_E_INVALID_GRAPH
The handle to the peer graph is invalid.
PEER_E_NOT_INITIALIZED
The graph must be initialized with a call to PeerGraphStartup before using this function.

Remarks

The PeerGraphImportDatabase function cannot be used to import a database from a different peer graph. PeerGraphImportDatabase must be called after PeerGraphOpen, not after PeerGraphCreate.

The database being imported must have the same peer graph ID and peer ID.

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

PeerGraphExportDatabase