Microsoft DirectX 9.0 SDK Update (Summer 2003) |
IDirectPlay8Peer::TerminateSession Method
Terminates the current Microsoft® DirectPlay® session.
Syntax
HRESULT TerminateSession(
void *const pvTerminateData, const DWORD dwTerminateDataSize, const DWORD dwFlags );
Parameters
- pvTerminateData
- [in] Pointer to termination data. This data is also sent in the pvTerminateData member of the DPN_MSGID_TERMINATE_SESSION system message.
- dwTerminateDataSize
- [in] Size of data contained in the pvTerminateData parameter.
- dwFlags
- [in] Reserved. Must be 0.
Return Value
Returns S_OK if successful, or an error value otherwise.
Remarks
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