Microsoft DirectX 9.0

IDirectPlay8Peer::SetApplicationDesc Method

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


HRESULT SetApplicationDesc(      

    const DPN_APPLICATION_DESC *const pad,     const DWORD dwFlags );


[in] Pointer to a DPN_APPLICATION_DESC structure that describes the application settings to modify.
[in] Reserved. Must be 0.

Return Value

Returns S_OK if successful, or one of the following error values.

DPNERR_DATATOOLARGEThe application data is too large for the service provider's Maximum Transmission Unit.
DPNERR_INVALIDFLAGSThe flags passed to this method are invalid.
DPNERR_INVALIDPARAMOne or more of the parameters passed to the method are invalid.
DPNERR_NOTHOSTThe 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.


You can use this method to modify only the following members of the DPN_APPLICATION_DESC structure.

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.

© 2002 Microsoft Corporation. All rights reserved.