Platform SDK: DirectX |
The IDirectPlay4::SetSessionDesc method changes the properties of the current session. Only the host of the session can change the session properties. If a nonhost attempts to call it, the method returns DPERR_ACCESSDENIED.
The updated session description will be propagated to all the other computers in the session. Each player will receive a DPMSG_SETSESSIONDESC system message.
You can't use SetSessionDesc in a lobby session.
HRESULT SetSessionDesc( LPDPSESSIONDESC2 lpSessDesc, DWORD dwFlags );
Returns DP_OK if successful, or one of the following error values otherwise:
DPERR_ACCESSDENIED |
DPERR_CONNECTIONLOST |
DPERR_INVALIDPARAMS |
DPERR_NOSESSIONS |
This method returns DPERR_ACCESSDENIED if this computer does not have permission to change the session. Only the host can change the session properties. It returns DPERR_INVALIDPARAMS if the application attempts to change a property in the session description that cannot be changed or tries to give a property an invalid value.
Changing the session description will cause a DPMSG_SETSESSIONDESC system message to be generated on all the other computers in the session.
The following members and flags of the DPSESSIONDESC2 structure can be changed using IDirectPlay4::SetSessionDesc:
DPSESSION_NEWPLAYERSDISABLED
DPSESSION_NODATAMESSAGES
DPSESSION_PRIVATE
If the following members and flags of the DPSESSIONDESC2 structure are changed, an error will occur (for example, if the DPSESSION_KEEPALIVE flag is currently set and you try to set this bit, you will not get an error, but if you try to clear this bit, you will get an error and IDirectPlay4::SetSessionDesc will fail):
DPSESSION_KEEPALIVE
The following members of the DPSESSIONDESC2 structure are ignored (that is, it does not matter what you pass in these members; DirectPlay will always use the values passed when IDirectPlay4::Open was called):
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
Header: Declared in dplay.h.
Import Library: Use dplayx.lib.