IDirectPlay8Peer::GetPlayerContext Method

DirectPlay

 
Microsoft DirectX 9.0 SDK Update (Summer 2003)

IDirectPlay8Peer::GetPlayerContext Method


Retrieves the player context value for the specified peer.

Syntax

HRESULT GetPlayerContext(      
    const DPNID dpnid,     PVOID *const ppvPlayerContext,     const DWORD dwFlags );

Parameters

dpnid
[in] Variable of type DPNID that specifies the identifier of the player to get context data for.
ppvPlayerContext
[out] Pointer to the context data of the peer.
dwFlags
[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.

Remarks

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.



© 2003 Microsoft Corporation. All rights reserved.