Microsoft DirectX 9.0

IDirectPlay8Peer::TerminateSession Method

Terminates the current Microsoft?DirectPlay?session.


HRESULT TerminateSession(      

    void *const pvTerminateData,     const DWORD dwTerminateDataSize,     const DWORD dwFlags );


[in] Pointer to termination data. This data is also sent in the pvTerminateData member of the DPN_MSGID_TERMINATE_SESSION system message.
[in] Size of data contained in the pvTerminateData parameter.
[in] Reserved. Must be 0.

Return Value

Returns S_OK if successful, or an error value otherwise.


This method may be called only by the host player.

This method terminates the session even if host migration is enabled. To close the host player's connection to the session and allow host migration to take place, call IDirectPlay8Peer::Close instead.

When this method is called, the DPN_MSGID_TERMINATE_SESSION will be sent to the message handler of each player in the session.

Players should call IDirectPlay8Peer::Close after receiving the DPN_MSGID_TERMINATE_SESSION message to uninitialize the IDirectPlay8Peer object.

See Also

Host Migration, Leaving a Peer-to-Peer Session, Terminating a Peer-to-Peer Session

© 2002 Microsoft Corporation. All rights reserved.