Microsoft DirectX 8.1 (C++) |
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.
typedef struct { DWORD dwSize; DPNID dpnidSender; PVOID pvPlayerContext; PBYTE pReceiveData; DWORD dwReceiveDataSize; DPNHANDLE hBufferHandle; } DPNMSG_RECEIVE, *PDPNMSG_RECEIVE;
Return DPNSUCCESS_PENDING to transfer ownership of the data buffer to your application. Otherwise, return DPN_OK.
Because you should not spend large amounts of time processing messages, you should copy the 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.
Windows NT/2000/XP: Available as a redistributable for Windows 2000 and later.
Windows 98/Me: Available as a redistributable for Windows 98 and later.
Header: Declared in Dplay8.h.