Microsoft DirectX 9.0

IDirectPlay8Peer Interface

Applications use the methods of the IDirectPlay8Peer interface to create a peer-to-peer Microsoft?DirectPlay?session.

IDirectPlay8Peer Members


Adds a peer to a group.

When this method is called, all peers connected to the application receive a DPN_MSGID_ADD_PLAYER_TO_GROUP message.


Cancels asynchronous requests. For instance, several methods of the IDirectPlay8Peer interface run asynchronously by default. Depending on the situation, you might want to cancel requests before they are processed. All the methods of this interface that can run asynchronously return an hAsyncHandle parameter.

Specific requests are canceled by passing the hAsyncHandle of the request in this method's hAsyncHandle parameter. You can cancel all pending asynchronous operations by calling this method, specifying NULL in the hAsyncHandle parameter, and specifying DPNCANCEL_ALL_OPERATIONS in the dwFlags parameter. If a specific handle is provided to this method, no flags should be set.


Closes the open connection to a session and uninitializes the IDirectPlay8Peer object. This method must be called on any object successfully initialized with IDirectPlay8Peer::Initialize.


Establishes the connection to all the peers in a peer-to-peer session. Once a connection is established, the communication channel on the interface is open and the application should expect messages to arrive immediately. No messages can be sent by way of the IDirectPlay8Peer::SendTo method until the connection has completed.


Creates a group in the current session. A group is a logical collection of players.


Deletes a group created by the IDirectPlay8Peer::CreateGroup method. This method can be called by any peer in the session.


Deletes a peer from the session.


Retrieves a list of all players in a group.


Enumerates applications that host DirectPlay games.


Retrieves a list of all the player and/or group identifiers for the session.


Enumerates all the registered service providers available to the application.


Retrieves the full application description for the connected application.


Retrieves the DPN_CAPS or DPN_CAPS_EX structure for the current interface.


Retrieves statistical information about the connection between the local application and the specified remote player.


Retrieves the group context value for the specified group.


Retrieves a block of data associated with a group, including the group name.

This method is typically called after a DPN_MSGID_GROUP_INFO system message is received indicating that the group data has been modified.


Retrieves the local addresses being used to host the session.


Retrieves the address for the specified remote player in the session.


Retrieves peer information set for the specified peer.


Retrieves the player context value for the specified peer.


Used by the application to monitor the size of the send queue.


Retrieves the DPN_SP_CAPS structure for the specified service provider.


Creates a new peer-to-peer session, hosted by the local computer.


Registers an entry point in the peer's code that receives all the messages from the IDirectPlay8Peer interface and from remote peers. This method must be called before calling any other methods of this interface.


Allows launched applications to automatically propagate game status to the lobby.


Removes a peer from a group.

When this method is called all peers connected to the application receive a DPN_MSGID_REMOVE_PLAYER_FROM_GROUP message.


Retrieves message buffers provided to the application through the pReceiveData member of the DPN_MSGID_RECEIVE system message. If the user's message handler returns DPNSUCCESS_PENDING to the RECEIVE callback, DirectPlay assumes that ownership of the buffer is transferred to the application, and neither frees nor modifies it until ownership is returned to DirectPlay through this call.


Transmits data to another peer or group within the session by sending a message to the appropriate message handlers. The message can be sent synchronously or asynchronously.


Changes the settings for the application that is being hosted. Only some settings can be changed.


Sets the DPN_CAPS or DPN_CAPS_EX structure for the current interface.


Sets a block of data associated with a group, including the name of the group.

Calling this method generates a DPN_MSGID_GROUP_INFO message, which is sent to all the peers connected to the application.


Sets the static settings of the local peer. Call this method before connecting to relay basic player information with the application. When the peer successfully connects with the application, information set through this method can be retrieved by other players by calling the IDirectPlay8Peer::GetPeerInfo method.


Sets the DPN_SP_CAPS structure for the specified service provider.


Terminates the current DirectPlay session.

Interface Information

Inherits fromIUnknown
Minimum operating systems Windows 98, Pocket PC 2002

© 2002 Microsoft Corporation. All rights reserved.