Microsoft DirectX 9.0 SDK Update (Summer 2003) |
IDirectPlay8Peer::SetApplicationDesc Method
Changes the settings for the application that is being hosted. Only some settings can be changed.
Syntax
HRESULT SetApplicationDesc(
const DPN_APPLICATION_DESC *const pad, const DWORD dwFlags );
Parameters
- pad
- [in] Pointer to a DPN_APPLICATION_DESC structure that describes the application settings to modify.
- dwFlags
- [in] Reserved. Must be 0.
Return Value
Returns S_OK if successful, or one of the following error values.
DPNERR_DATATOOLARGE The application data is too large for the service provider's Maximum Transmission Unit. DPNERR_INVALIDFLAGS The flags passed to this method are invalid. DPNERR_INVALIDPARAM One or more of the parameters passed to the method are invalid. DPNERR_NOTHOST The client attempted to connect to a nonhost computer. Additionally, this error value may be returned by a nonhost that tried to set the application description.
Remarks
You can use this method to modify only the following members of the DPN_APPLICATION_DESC structure.
- dwMaxPlayers
- pwszSessionName
- pwszPassword
- pvApplicationReservedData
- dwApplicationReservedDataSize
When IDirectPlay8Peer::SetApplicationDesc is called, Microsoft® DirectPlay® makes a copy of the data pad points to. You do not need to save the DPN_APPLICATION_DESC structure once IDirectPlay8Peer::SetApplicationDesc returns.
You cannot set the dwMaxPlayers member to a smaller value than the current number of players in the session.
The maximum size of the application data that you assign to the pvApplicationReservedData member of the DPN_APPLICATION_DESC structure is limited by the service provider's Maximum Transmission Unit. If your application data is too large, the method will fail and return DPNERR_DATATOOLARGE.
To avoid accidentally overwriting the application description, applications should call IDirectPlay8Peer::GetApplicationDesc and fill in the DPN_APPLICATION_DESC structure before calling IDirectPlay8Peer::SetApplicationDesc.