Return Values
Errors are represented by negative values and cannot be combined.
The following table lists the interfaces to which the error codes listed below apply.
For a list of the error codes each method can return, see the individual method descriptions.
Many of the Microsoft® DirectPlay® samples include a GetDirectPlayErrStr function that converts HRESULT values to string names for the DirectPlay errors. You can copy this code into your own applications for diagnostic traces or error reports.
Success Codes
- DPNSUCCESS_PENDING
- An asynchronous operation has reached the point where it is successfully queued.
- DPN_OK
- The operation completed successfully. This value is equal to the S_OK standard COM return value.
Error Codes
- DPNERR_ABORTED
- The operation was canceled before it could be completed.
- DPNERR_ADDRESSING
- The address specified is invalid.
- DPNERR_ALREADYCONNECTED
- The object is already connected to the session.
- DPNERR_ALREADYCLOSING
- An attempt to call the Close method on a session has been made more than once.
- DPNERR_ALREADYDISCONNECTING
- The client is already disconnecting from the session.
- DPNERR_ALREADYINITIALIZED
- The object has already been initialized.
- DPNERR_BUFFERTOOSMALL
- The supplied buffer is not large enough to contain the requested data.
- DPNERR_CANNOTCANCEL
- The operation could not be canceled.
- DPNERR_CANTCREATEGROUP
- A new group cannot be created.
- DPNERR_CANTCREATEPLAYER
- A new player cannot be created.
- DPNERR_CANTLAUNCHAPPLICATION
- The lobby cannot launch the specified application.
- DPNERR_CONNECTING
- The method is in the process of connecting to the network.
- DPNERR_CONNECTIONLOST
- The service provider connection was reset while data was being sent.
- DPNERR_DATATOOLARGE
- The application data is too large for the service provider's Maximum Transmission Unit.
- DPNERR_DOESNOTEXIST
- Requested element is not part of the address or the requested application GUID is not registered.
- DPNERR_ENUMQUERYTOOLARGE
- The query data specified is too large.
- DPNERR_ENUMRESPONSETOOLARGE
- The response to an enumeration query is too large.
- DPNERR_EXCEPTION
- An exception occurred when processing the request.
- DPNERR_GENERIC
- An undefined error condition occurred.
- DPNERR_GROUPNOTEMPTY
- The specified group is not empty.
- DPNERR_HOSTREJECTEDCONNECTION
- The DPN_MSGID_INDICATE_CONNECT system message returned something other than S_OK in response to a connect request.
- DPNERR_HOSTTERMINATEDSESSION
- The host in a peer session (with host migration enabled) terminated the session.
- DPNERR_INCOMPLETEADDRESS
- The address specified is not complete.
- DPNERR_INVALIDADDRESSFORMAT
- Address format is invalid.
- DPNERR_INVALIDAPPLICATION
- The GUID supplied for the application is invalid.
- DPNERR_INVALIDCOMMAND
- The command specified is invalid.
- DPNERR_INVALIDDEVICEADDRESS
- The address for the local computer or adapter is invalid.
- DPNERR_INVALIDFLAGS
- The flags passed to this method are invalid.
- DPNERR_INVALIDGROUP
- The group ID is not recognized as a valid group ID for this game session.
- DPNERR_INVALIDHANDLE
- The handle specified is invalid.
- DPNERR_INVALIDHOSTADDRESS
- The specified remote address is invalid.
- DPNERR_INVALIDINSTANCE
- The GUID for the application instance is invalid.
- DPNERR_INVALIDINTERFACE
- The interface parameter is invalid. This value will be returned in a connect request if the connecting player was not a client in a client/server game or a peer in a peer-to-peer game.
- DPNERR_INVALIDOBJECT
- The DirectPlay object pointer is invalid.
- DPNERR_INVALIDPARAM
- One or more of the parameters passed to the method are invalid.
- DPNERR_INVALIDPASSWORD
- An invalid password was supplied when attempting to join a session that requires a password.
- DPNERR_INVALIDPLAYER
- The player ID is not recognized as a valid player ID for this game session.
- DPNERR_INVALIDPOINTER
- Pointer specified as a parameter is invalid.
- DPNERR_INVALIDPRIORITY
- The specified priority is not within the range of allowed priorities, which is inclusively from 0 through 65535.
- DPNERR_INVALIDSTRING
- String specified as a parameter is invalid.
- DPNERR_INVALIDURL
- Specified string is not a valid DirectPlay URL.
- DPNERR_INVALIDVERSION
- There was an attempt to connect to an invalid version of DirectPlay.
- DPNERR_NOCAPS
- The communication link that DirectPlay is attempting to use is not capable of this function.
- DPNERR_NOCONNECTION
- No communication link was established.
- DPNERR_NOHOSTPLAYER
- There is currently no player acting as the host of the session.
- DPNERR_NOINTERFACE
- The interface is not supported.
- DPNERR_NORESPONSE
- There was no response from the specified target.
- DPNERR_NOTALLOWED
- Object is read-only; this function is not allowed on this object.
- DPNERR_NOTHOST
- An attempt by the client to connect to a nonhost computer. Additionally, this error value may be returned by a nonhost that tries to set the application description.
- DPNERR_OUTOFMEMORY
- There is insufficient memory to perform the requested operation.
- DPNERR_PENDING
- Not an error, this return indicates that an asynchronous operation has reached the point where it is successfully queued. SUCCEEDED(DPNERR_PENDING) will return TRUE. This error value has been superseded by DPNERR_SUCCESS, which should be used by all new applications. DPNERR_PENDING is only included for backward compatibility.
- DPNERR_PLAYERLOST
- A player has lost the connection to the session.
- DPNERR_PLAYERNOTREACHABLE
- A player has tried to join a peer-peer session where at least one other existing player in the session cannot connect to the joining player.
- DPNERR_SESSIONFULL
- The request to connect to the host or server failed because the maximum number of players allotted for the session has been reached.
- DPNERR_TIMEDOUT
- The operation could not complete because it has timed out.
- DPNERR_UNINITIALIZED
- The requested object has not been initialized.
- DPNERR_UNSUPPORTED
- The function or feature is not available in this implementation or on this service provider.
- DPNERR_USERCANCEL
- The user canceled the operation.
- DV_OK
- The request completed successfully.
- DV_FULLDUPLEX
- The sound card is capable of full-duplex operation.
- DV_HALFDUPLEX
- The sound card can only be run in half-duplex mode.
- DV_PENDING
- An asynchronous operation has reached the point where it is successfully queued.
- DVERR_BUFFERTOOSMALL
- The supplied buffer is not large enough to contain the requested data.
- DVERR_EXCEPTION
- An exception occurred when processing the request.
- DVERR_GENERIC
- An undefined error condition occurred.
- DVERR_INVALIDFLAGS
- The flags passed to this method are invalid.
- DVERR_INVALIDOBJECT
- The DirectPlay object pointer is invalid.
- DVERR_INVALIDPARAM
- One or more of the parameters passed to the method are invalid.
- DVERR_INVALIDPLAYER
- The player ID is not recognized as a valid player ID for this game session.
- DVERR_INVALIDGROUP
- The group ID is not recognized as a valid group ID for this game session.
- DVERR_INVALIDHANDLE
- The handle specified is invalid.
- DVERR_OUTOFMEMORY
- There is insufficient memory to perform the requested operation.
- DVERR_PENDING
- Not an error, this return indicates that an asynchronous operation has reached the point where it is successfully queued. This error value has been deprecated. It has been replaced by DV_PENDING.
- DVERR_NOTSUPPORTED
- The operation is not supported.
- DVERR_NOINTERFACE
- The specified interface is not supported. Could indicate using the wrong version of DirectPlay.
- DVERR_SESSIONLOST
- The transport has lost the connection to the session.
- DVERR_NOVOICESESSION
- The session specified is not a voice session.
- DVERR_CONNECTIONLOST
- The connection to the voice session has been lost.
- DVERR_NOTINITIALIZED
- The IDirectPlayVoiceClient::Initialize or IDirectPlayVoiceServer::Initialize method must be called before calling this method.
- DVERR_CONNECTED
- The DirectPlayVoice object is connected.
- DVERR_NOTCONNECTED
- The DirectPlayVoice object is not connected.
- DVERR_CONNECTABORTING
- The connection is being disconnected.
- DVERR_NOTALLOWED
- The object does not have the permission to perform this operation.
- DVERR_INVALIDTARGET
- The specified target is not a valid player ID or group ID for this voice session.
- DVERR_TRANSPORTNOTHOST
- The object is not the host of the voice session.
- DVERR_COMPRESSIONNOTSUPPORTED
- The specified compression type is not supported on the local computer.
- DVERR_ALREADYPENDING
- An asynchronous call of this type is already pending.
- DVERR_ALREADYINITIALIZED
- The object has already been initialized.
- DVERR_SOUNDINITFAILURE
- A failure was encountered initializing the sound card.
- DVERR_TIMEOUT
- The operation could not be performed in the specified time.
- DVERR_CONNECTABORTED
- The connect operation was canceled before it could be completed.
- DVERR_NO3DSOUND
- The local computer does not support 3-D sound.
- DVERR_ALREADYBUFFERED
- There is already a user buffer for the specified ID.
- DVERR_NOTBUFFERED
- There is no user buffer for the specified ID.
- DVERR_HOSTING
- The object is the host of the session.
- DVERR_NOTHOSTING
- The object is not the host of the session.
- DVERR_INVALIDDEVICE
- The specified device is invalid.
- DVERR_RECORDSYSTEMERROR
- An error in the recording system occurred.
- DVERR_PLAYBACKSYSTEMERROR
- An error in the playback system occurred.
- DVERR_SENDERROR
- An error occurred while sending data.
- DVERR_USERCANCEL
- The user canceled the operation.
- DVERR_UNKNOWN
- An unknown error occurred.
- DVERR_RUNSETUP
- The specified audio configuration has not been tested. Call the IDirectPlayVoiceTest::CheckAudioSetup method.
- DVERR_INCOMPATIBLEVERSION
- The client connected to a voice session that is incompatible with the host.
- DVERR_INITIALIZED
- The Initialize method failed because the object has already been initialized.
- DVERR_INVALIDPOINTER
- The pointer specified is invalid.
- DVERR_NOTRANSPORT
- The specified object is not a valid transport.
- DVERR_NOCALLBACK
- This operation cannot be performed because no callback function was specified.
- DVERR_TRANSPORTNOTINIT
- Specified transport is not yet initialized.
- DVERR_TRANSPORTNOSESSION
- Specified transport is valid but is not connected/hosting.
- DVERR_TRANSPORTNOPLAYER
- Specified transport is connected/hosting but no local player exists.