DPN_MSGID_RECEIVE Message

DirectPlay

 
Microsoft DirectX 9.0 SDK Update (Summer 2003)

DPN_MSGID_RECEIVE Message


Microsoft® DirectPlay® generates the DPN_MSGID_RECEIVE message when a message has been processed by the receiver.

The DPNMSG_RECEIVE structure contains information for the DPN_MSGID_RECEIVE system message.

Syntax

typedef struct _DPNMSG_RECEIVE {
    DWORD dwSize;
    DPNID dpnidSender;
    PVOID pvPlayerContext;
    PBYTE pReceiveData;
    DWORD dwReceiveDataSize;
    DPNHANDLE hBufferHandle;
    DWORD dwReceiveFlags;
}  DPNMSG_RECEIVE, *PDPNMSG_RECEIVE;

Members

dwSize
Size of this structure.
dpnidSender
DPNID of the player that sent the message.
pvPlayerContext
Player context value of the player that sent the message.
pReceiveData
Pointer to the message data buffer. This buffer is normally only valid while the DPN_MSGID_RECEIVE message is being processed by the callback message handler.
dwReceiveDataSize
Size of the data, in bytes, of the pReceiveData member.
hBufferHandle
Buffer handle to the pReceiveData member. If you have returned DPNSUCCESS_PENDING , pass this value to the appropriate ReturnBuffer method to notify DirectPlay to free the buffer.
dwReceiveFlags
The following flags can be specified to describe how messages are received.
DPNRECEIVE_GUARANTEED
The message received was sent guaranteed.
DPNRECEIVE_COALESCED
The message received was coalesced for sending.

Remarks

Return from the message callback function with DPN_OK.

Because you should not spend large amounts of time processing messages, you should copy this data, and process the message. Alternatively, you can return DPNSUCCESS_PENDING from the callback message handler. Doing so transfers ownership of the buffer to the application. If you return DPNSUCCESS_PENDING, you must call IDirectPlay8Peer::ReturnBuffer, IDirectPlay8Client::ReturnBuffer, or IDirectPlay8Server::ReturnBuffer when you are finished with the buffer. Pass the method the value you receive in the hBufferHandle member to identify the buffer. If you fail to call ReturnBuffer, you will create a memory leak.

Message Information

Headerdplay8.h
Minimum operating systems Windows 98, Pocket PC 2002

© 2003 Microsoft Corporation. All rights reserved.