Microsoft DirectX 9.0

IDirectPlay8Peer::GetPlayerContext Method

Retrieves the player context value for the specified peer.


HRESULT GetPlayerContext(      

    const DPNID dpnid,     PVOID *const ppvPlayerContext,     const DWORD dwFlags );


[in] Variable of type DPNID that specifies the identifier of the player to get context data for.
[out] Pointer to the context data of the peer.
[in] Reserved. Must be 0.

Return Value

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

DPNERR_INVALIDPARAMOne or more of the parameters passed to the method are invalid.
DPNERR_INVALIDPLAYERThe player ID is not recognized as a valid player ID for this game session.
DPNERR_NOTREADYThe object is not ready for use.


Player context values are set by pointing the pvPlayerContext member of the DPN_MSGID_CREATE_PLAYER system message to the context value data.

This method returns DPNERR_NOTREADY when it is called before a DPN_MSGID_CREATE_PLAYER message is received by Microsoft?DirectPlay?for the player specified in dpnid. Call IDirectPlay8Peer::GetPlayerContext again allowing task switching so that the thread carrying the message can return.

© 2002 Microsoft Corporation. All rights reserved.