ReactOS 0.4.17-dev-966-gf06eace
dplayx_messages.h File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "dplay.h"
#include "rpc.h"
#include "dplay_global.h"
#include "pshpack1.h"
#include "poppack.h"
Include dependency graph for dplayx_messages.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  DPPLAYERINFO
 
struct  DPLAYI_PACKEDPLAYER
 
struct  tagDPMSG_SENDENVELOPE
 
struct  tagDPMSG_SYSMSGENVELOPE
 
struct  tagDPMSG_ENUMSESSIONSREPLY
 
struct  tagDPMSG_ENUMSESSIONSREQUEST
 
struct  tagDPMSG_CREATESESSION
 
struct  tagDPMSG_REQUESTNEWPLAYERID
 
struct  tagDPMSG_NEWPLAYERIDREPLY
 
struct  DPSP_MSG_ADDPLAYERTOGROUP
 
struct  DPSP_MSG_GROUPDATACHANGED
 
struct  tagDPMSG_FORWARDADDPLAYER
 
struct  tagDPMSG_FORWARDADDPLAYERNACK
 
struct  DPLAYI_SUPERPACKEDPLAYER
 
struct  DPSP_MSG_PING
 
struct  DPSP_MSG_ADDFORWARDREPLY
 
struct  DPSP_MSG_SUPERENUMPLAYERSREPLY
 
struct  DPSP_MSG_ADDFORWARD
 
struct  DPSP_MSG_ADDFORWARDACK
 

Macros

#define DPMSG_WAIT_5_SECS   5000
 
#define DPMSG_WAIT_30_SECS   30000
 
#define DPMSG_WAIT_60_SECS   60000
 
#define DPMSG_DEFAULT_WAIT_TIME   DPMSG_WAIT_30_SECS
 
#define DPMSGCMD_ENUMSESSIONSREPLY   1
 
#define DPMSGCMD_ENUMSESSIONSREQUEST   2
 
#define DPMSGCMD_GETNAMETABLEREPLY   3 /* Contains all existing players in session */
 
#define DPMSGCMD_REQUESTNEWPLAYERID   5
 
#define DPMSGCMD_NEWPLAYERIDREPLY   7
 
#define DPMSGCMD_CREATESESSION   8 /* Might be a create nameserver or new player msg */
 
#define DPMSGCMD_CREATENEWPLAYER   9
 
#define DPMSGCMD_SYSTEMMESSAGE   10
 
#define DPMSGCMD_DELETEPLAYER   11
 
#define DPMSGCMD_DELETEGROUP   12
 
#define DPMSGCMD_ADDPLAYERTOGROUP   13
 
#define DPMSGCMD_GROUPDATACHANGED   17
 
#define DPMSGCMD_FORWARDADDPLAYER   19
 
#define DPMSGCMD_PING   22
 
#define DPMSGCMD_PINGREPLY   23
 
#define DPMSGCMD_FORWARDADDPLAYERNACK   36
 
#define DPMSGCMD_SUPERENUMPLAYERSREPLY   41
 
#define DPMSGCMD_ADDFORWARD   46
 
#define DPMSGCMD_ADDFORWARDACK   47
 
#define DPMSGCMD_JUSTENVELOPE   1000
 
#define DPMSGCMD_JUSTENVELOPEREPLY   1001
 
#define DPMSGVER_DP6   11
 
#define DPMSGMAGIC_DPLAYMSG   0x79616c70
 
#define DPLAYI_SUPERPACKEDPLAYER_SHORT_NAME_PRESENT   0x001
 
#define DPLAYI_SUPERPACKEDPLAYER_LONG_NAME_PRESENT   0x002
 
#define DPLAYI_SUPERPACKEDPLAYER_SP_DATA_LENGTH_SIZE(mask)   (((mask) >> 2) & 0x3)
 
#define DPLAYI_SUPERPACKEDPLAYER_PLAYER_DATA_LENGTH_SIZE(mask)   (((mask) >> 4) & 0x3)
 
#define DPLAYI_SUPERPACKEDPLAYER_PLAYER_COUNT_SIZE(mask)   (((mask) >> 6) & 0x3)
 
#define DPLAYI_SUPERPACKEDPLAYER_PARENT_ID_PRESENT   0x100
 
#define DPLAYI_SUPERPACKEDPLAYER_SHORTCUT_COUNT_SIZE(mask)   (((mask) >> 9) & 0x3)
 

Typedefs

typedef struct tagDPMSG_SENDENVELOPE DPMSG_SENDENVELOPE
 
typedef struct tagDPMSG_SENDENVELOPE * LPDPMSG_SENDENVELOPE
 
typedef const DPMSG_SENDENVELOPE * LPCDPMSG_SENDENVELOPE
 
typedef struct tagDPMSG_SYSMSGENVELOPE DPMSG_SYSMSGENVELOPE
 
typedef struct tagDPMSG_SYSMSGENVELOPE * LPDPMSG_SYSMSGENVELOPE
 
typedef const DPMSG_SYSMSGENVELOPE * LPCDPMSG_SYSMSGENVELOPE
 
typedef struct tagDPMSG_ENUMSESSIONSREPLY DPMSG_ENUMSESSIONSREPLY
 
typedef struct tagDPMSG_ENUMSESSIONSREPLY * LPDPMSG_ENUMSESSIONSREPLY
 
typedef const DPMSG_ENUMSESSIONSREPLY * LPCDPMSG_ENUMSESSIONSREPLY
 
typedef struct tagDPMSG_ENUMSESSIONSREQUEST DPMSG_ENUMSESSIONSREQUEST
 
typedef struct tagDPMSG_ENUMSESSIONSREQUEST * LPDPMSG_ENUMSESSIONSREQUEST
 
typedef const DPMSG_ENUMSESSIONSREQUEST * LPCDPMSG_ENUMSESSIONSREQUEST
 
typedef struct tagDPMSG_CREATESESSION DPMSG_CREATESESSION
 
typedef struct tagDPMSG_CREATESESSION * LPDPMSG_CREATESESSION
 
typedef const DPMSG_CREATESESSION * LPCDPMSG_CREATESESSION
 
typedef struct tagDPMSG_REQUESTNEWPLAYERID DPMSG_REQUESTNEWPLAYERID
 
typedef struct tagDPMSG_REQUESTNEWPLAYERID * LPDPMSG_REQUESTNEWPLAYERID
 
typedef const DPMSG_REQUESTNEWPLAYERID * LPCDPMSG_REQUESTNEWPLAYERID
 
typedef struct tagDPMSG_NEWPLAYERIDREPLY DPMSG_NEWPLAYERIDREPLY
 
typedef struct tagDPMSG_NEWPLAYERIDREPLY * LPDPMSG_NEWPLAYERIDREPLY
 
typedef const DPMSG_NEWPLAYERIDREPLY * LPCDPMSG_NEWPLAYERIDREPLY
 
typedef struct tagDPMSG_FORWARDADDPLAYER DPMSG_FORWARDADDPLAYER
 
typedef struct tagDPMSG_FORWARDADDPLAYER * LPDPMSG_FORWARDADDPLAYER
 
typedef const DPMSG_FORWARDADDPLAYER * LPCDPMSG_FORWARDADDPLAYER
 
typedef struct tagDPMSG_FORWARDADDPLAYERNACK DPMSG_FORWARDADDPLAYERNACK
 
typedef struct tagDPMSG_FORWARDADDPLAYERNACK * LPDPMSG_FORWARDADDPLAYERNACK
 
typedef const DPMSG_FORWARDADDPLAYERNACK * LPCDPMSG_FORWARDADDPLAYERNACK
 

Functions

DWORD CreateLobbyMessageReceptionThread (HANDLE hNotifyEvent, HANDLE hStart, HANDLE hDeath, HANDLE hConnRead)
 
DWORD DP_MSG_ComputeMessageSize (SGBUFFER *buffers, DWORD bufferCount)
 
HRESULT DP_MSG_SendRequestPlayerId (IDirectPlayImpl *This, DWORD dwFlags, LPDPID lpdipidAllocatedId)
 
HRESULT DP_MSG_ReadPackedPlayer (char *data, DWORD *offset, DWORD maxSize, DPPLAYERINFO *playerInfo)
 
HRESULT DP_MSG_ForwardPlayerCreation (IDirectPlayImpl *This, DPID dpidServer, WCHAR *password)
 
HRESULT DP_MSG_SendCreatePlayer (IDirectPlayImpl *This, DPID toId, DPID id, DWORD flags, DPNAME *name, void *playerData, DWORD playerDataSize, DPID systemPlayerId)
 
HRESULT DP_MSG_SendAddPlayerToGroup (IDirectPlayImpl *This, DPID toId, DPID playerId, DPID groupId)
 
HRESULT DP_MSG_SendPingReply (IDirectPlayImpl *This, DPID toId, DPID fromId, DWORD tickCount)
 
HRESULT DP_MSG_SendAddForwardAck (IDirectPlayImpl *This, DPID id)
 
void DP_MSG_ReplyReceived (IDirectPlayImpl *This, WORD wCommandId, LPCVOID lpMsgBody, DWORD dwMsgBodySize, const void *msgHeader)
 
void DP_MSG_ToSelf (IDirectPlayImpl *This, DPID dpidSelf)
 

Macro Definition Documentation

◆ DPLAYI_SUPERPACKEDPLAYER_LONG_NAME_PRESENT

#define DPLAYI_SUPERPACKEDPLAYER_LONG_NAME_PRESENT   0x002

Definition at line 288 of file dplayx_messages.h.

◆ DPLAYI_SUPERPACKEDPLAYER_PARENT_ID_PRESENT

#define DPLAYI_SUPERPACKEDPLAYER_PARENT_ID_PRESENT   0x100

Definition at line 292 of file dplayx_messages.h.

◆ DPLAYI_SUPERPACKEDPLAYER_PLAYER_COUNT_SIZE

#define DPLAYI_SUPERPACKEDPLAYER_PLAYER_COUNT_SIZE (   mask)    (((mask) >> 6) & 0x3)

Definition at line 291 of file dplayx_messages.h.

◆ DPLAYI_SUPERPACKEDPLAYER_PLAYER_DATA_LENGTH_SIZE

#define DPLAYI_SUPERPACKEDPLAYER_PLAYER_DATA_LENGTH_SIZE (   mask)    (((mask) >> 4) & 0x3)

Definition at line 290 of file dplayx_messages.h.

◆ DPLAYI_SUPERPACKEDPLAYER_SHORT_NAME_PRESENT

#define DPLAYI_SUPERPACKEDPLAYER_SHORT_NAME_PRESENT   0x001

Definition at line 287 of file dplayx_messages.h.

◆ DPLAYI_SUPERPACKEDPLAYER_SHORTCUT_COUNT_SIZE

#define DPLAYI_SUPERPACKEDPLAYER_SHORTCUT_COUNT_SIZE (   mask)    (((mask) >> 9) & 0x3)

Definition at line 293 of file dplayx_messages.h.

◆ DPLAYI_SUPERPACKEDPLAYER_SP_DATA_LENGTH_SIZE

#define DPLAYI_SUPERPACKEDPLAYER_SP_DATA_LENGTH_SIZE (   mask)    (((mask) >> 2) & 0x3)

Definition at line 289 of file dplayx_messages.h.

◆ DPMSG_DEFAULT_WAIT_TIME

#define DPMSG_DEFAULT_WAIT_TIME   DPMSG_WAIT_30_SECS

Definition at line 74 of file dplayx_messages.h.

◆ DPMSG_WAIT_30_SECS

#define DPMSG_WAIT_30_SECS   30000

Definition at line 72 of file dplayx_messages.h.

◆ DPMSG_WAIT_5_SECS

#define DPMSG_WAIT_5_SECS   5000

Definition at line 71 of file dplayx_messages.h.

◆ DPMSG_WAIT_60_SECS

#define DPMSG_WAIT_60_SECS   60000

Definition at line 73 of file dplayx_messages.h.

◆ DPMSGCMD_ADDFORWARD

#define DPMSGCMD_ADDFORWARD   46

Definition at line 121 of file dplayx_messages.h.

◆ DPMSGCMD_ADDFORWARDACK

#define DPMSGCMD_ADDFORWARDACK   47

Definition at line 122 of file dplayx_messages.h.

◆ DPMSGCMD_ADDPLAYERTOGROUP

#define DPMSGCMD_ADDPLAYERTOGROUP   13

Definition at line 108 of file dplayx_messages.h.

◆ DPMSGCMD_CREATENEWPLAYER

#define DPMSGCMD_CREATENEWPLAYER   9

Definition at line 104 of file dplayx_messages.h.

◆ DPMSGCMD_CREATESESSION

#define DPMSGCMD_CREATESESSION   8 /* Might be a create nameserver or new player msg */

Definition at line 103 of file dplayx_messages.h.

◆ DPMSGCMD_DELETEGROUP

#define DPMSGCMD_DELETEGROUP   12

Definition at line 107 of file dplayx_messages.h.

◆ DPMSGCMD_DELETEPLAYER

#define DPMSGCMD_DELETEPLAYER   11

Definition at line 106 of file dplayx_messages.h.

◆ DPMSGCMD_ENUMSESSIONSREPLY

#define DPMSGCMD_ENUMSESSIONSREPLY   1

Definition at line 96 of file dplayx_messages.h.

◆ DPMSGCMD_ENUMSESSIONSREQUEST

#define DPMSGCMD_ENUMSESSIONSREQUEST   2

Definition at line 97 of file dplayx_messages.h.

◆ DPMSGCMD_FORWARDADDPLAYER

#define DPMSGCMD_FORWARDADDPLAYER   19

Definition at line 112 of file dplayx_messages.h.

◆ DPMSGCMD_FORWARDADDPLAYERNACK

#define DPMSGCMD_FORWARDADDPLAYERNACK   36

Definition at line 117 of file dplayx_messages.h.

◆ DPMSGCMD_GETNAMETABLEREPLY

#define DPMSGCMD_GETNAMETABLEREPLY   3 /* Contains all existing players in session */

Definition at line 98 of file dplayx_messages.h.

◆ DPMSGCMD_GROUPDATACHANGED

#define DPMSGCMD_GROUPDATACHANGED   17

Definition at line 110 of file dplayx_messages.h.

◆ DPMSGCMD_JUSTENVELOPE

#define DPMSGCMD_JUSTENVELOPE   1000

Definition at line 124 of file dplayx_messages.h.

◆ DPMSGCMD_JUSTENVELOPEREPLY

#define DPMSGCMD_JUSTENVELOPEREPLY   1001

Definition at line 125 of file dplayx_messages.h.

◆ DPMSGCMD_NEWPLAYERIDREPLY

#define DPMSGCMD_NEWPLAYERIDREPLY   7

Definition at line 102 of file dplayx_messages.h.

◆ DPMSGCMD_PING

#define DPMSGCMD_PING   22

Definition at line 114 of file dplayx_messages.h.

◆ DPMSGCMD_PINGREPLY

#define DPMSGCMD_PINGREPLY   23

Definition at line 115 of file dplayx_messages.h.

◆ DPMSGCMD_REQUESTNEWPLAYERID

#define DPMSGCMD_REQUESTNEWPLAYERID   5

Definition at line 100 of file dplayx_messages.h.

◆ DPMSGCMD_SUPERENUMPLAYERSREPLY

#define DPMSGCMD_SUPERENUMPLAYERSREPLY   41

Definition at line 119 of file dplayx_messages.h.

◆ DPMSGCMD_SYSTEMMESSAGE

#define DPMSGCMD_SYSTEMMESSAGE   10

Definition at line 105 of file dplayx_messages.h.

◆ DPMSGMAGIC_DPLAYMSG

#define DPMSGMAGIC_DPLAYMSG   0x79616c70

Definition at line 133 of file dplayx_messages.h.

◆ DPMSGVER_DP6

#define DPMSGVER_DP6   11

Definition at line 130 of file dplayx_messages.h.

Typedef Documentation

◆ DPMSG_CREATESESSION

◆ DPMSG_ENUMSESSIONSREPLY

◆ DPMSG_ENUMSESSIONSREQUEST

◆ DPMSG_FORWARDADDPLAYER

◆ DPMSG_FORWARDADDPLAYERNACK

◆ DPMSG_NEWPLAYERIDREPLY

◆ DPMSG_REQUESTNEWPLAYERID

◆ DPMSG_SENDENVELOPE

◆ DPMSG_SYSMSGENVELOPE

◆ LPCDPMSG_CREATESESSION

◆ LPCDPMSG_ENUMSESSIONSREPLY

◆ LPCDPMSG_ENUMSESSIONSREQUEST

◆ LPCDPMSG_FORWARDADDPLAYER

◆ LPCDPMSG_FORWARDADDPLAYERNACK

◆ LPCDPMSG_NEWPLAYERIDREPLY

◆ LPCDPMSG_REQUESTNEWPLAYERID

◆ LPCDPMSG_SENDENVELOPE

Definition at line 145 of file dplayx_messages.h.

◆ LPCDPMSG_SYSMSGENVELOPE

◆ LPDPMSG_CREATESESSION

◆ LPDPMSG_ENUMSESSIONSREPLY

◆ LPDPMSG_ENUMSESSIONSREQUEST

◆ LPDPMSG_FORWARDADDPLAYER

◆ LPDPMSG_FORWARDADDPLAYERNACK

◆ LPDPMSG_NEWPLAYERIDREPLY

◆ LPDPMSG_REQUESTNEWPLAYERID

◆ LPDPMSG_SENDENVELOPE

◆ LPDPMSG_SYSMSGENVELOPE

Function Documentation

◆ CreateLobbyMessageReceptionThread()

DWORD CreateLobbyMessageReceptionThread ( HANDLE  hNotifyEvent,
HANDLE  hStart,
HANDLE  hDeath,
HANDLE  hConnRead 
)

Definition at line 57 of file dplayx_messages.c.

59{
60 DWORD dwMsgThreadId;
61 LPMSGTHREADINFO lpThreadInfo;
63
64 lpThreadInfo = malloc( sizeof( *lpThreadInfo ) );
65 if( lpThreadInfo == NULL )
66 {
67 return 0;
68 }
69
70 /* The notify event may or may not exist. Depends if async comm or not */
71 if( hNotifyEvent &&
72 !DuplicateHandle( GetCurrentProcess(), hNotifyEvent,
73 GetCurrentProcess(), &lpThreadInfo->hNotifyEvent,
75 {
76 ERR( "Unable to duplicate event handle\n" );
77 goto error;
78 }
79
80 /* These 3 handles don't need to be duplicated because we don't keep a
81 * reference to them where they're created. They're created specifically
82 * for the message thread
83 */
84 lpThreadInfo->hStart = hStart;
85 lpThreadInfo->hDeath = hDeath;
86 lpThreadInfo->hSettingRead = hConnRead;
87
88 hThread = CreateThread( NULL, /* Security attribs */
89 0, /* Stack */
90 DPL_MSG_ThreadMain, /* Msg reception function */
91 lpThreadInfo, /* Msg reception func parameter */
92 0, /* Flags */
93 &dwMsgThreadId /* Updated with thread id */
94 );
95 if ( hThread == NULL )
96 {
97 ERR( "Unable to create msg thread\n" );
98 goto error;
99 }
100
102
103 return dwMsgThreadId;
104
105error:
106
107 free( lpThreadInfo );
108
109 return 0;
110}
#define ERR(fmt,...)
Definition: precomp.h:57
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define CloseHandle
Definition: compat.h:739
#define GetCurrentProcess()
Definition: compat.h:759
BOOL WINAPI DuplicateHandle(IN HANDLE hSourceProcessHandle, IN HANDLE hSourceHandle, IN HANDLE hTargetProcessHandle, OUT LPHANDLE lpTargetHandle, IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwOptions)
Definition: handle.c:149
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
static DWORD CALLBACK DPL_MSG_ThreadMain(LPVOID lpContext)
unsigned long DWORD
Definition: ntddk_ex.h:95
#define error(str)
Definition: mkdosfs.c:1605
HANDLE hThread
Definition: wizard.c:28
#define DUPLICATE_SAME_ACCESS

Referenced by IDirectPlayLobby3AImpl_RunApplication().

◆ DP_MSG_ComputeMessageSize()

DWORD DP_MSG_ComputeMessageSize ( SGBUFFER *  buffers,
DWORD  bufferCount 
)

Definition at line 222 of file dplayx_messages.c.

223{
224 DWORD size = 0;
225 DWORD i;
226 for ( i = 0; i < bufferCount; ++i )
227 size += buffers[ i ].len;
228 return size;
229}
GLsizeiptr size
Definition: glext.h:5919
GLenum GLsizei len
Definition: glext.h:6722
const GLuint * buffers
Definition: glext.h:5916
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248

Referenced by DP_MSG_ForwardPlayerCreation(), DP_MSG_SendAddForwardAck(), DP_MSG_SendAddPlayerToGroup(), DP_MSG_SendCreatePlayer(), DP_MSG_SendPingReply(), DP_MSG_SendRequestPlayerId(), DP_MSG_ToSelf(), and IDirectPlay4Impl_SendEx().

◆ DP_MSG_ForwardPlayerCreation()

HRESULT DP_MSG_ForwardPlayerCreation ( IDirectPlayImpl *  This,
DPID  dpidServer,
WCHAR *  password 
)

Definition at line 550 of file dplayx_messages.c.

551{
552 LPVOID lpMsg;
554 DWORD dwMsgSize;
555 DPLAYI_PACKEDPLAYER playerInfo;
556 void *spPlayerData;
557 DWORD spPlayerDataSize;
558 void *msgHeader;
559 HRESULT hr;
560
561 hr = IDirectPlaySP_GetSPPlayerData( This->dp2->spData.lpISP, dpidServer,
562 &spPlayerData, &spPlayerDataSize, DPSET_REMOTE );
563 if( FAILED( hr ) )
564 return hr;
565
569 msgBody.toId = 0;
570 msgBody.playerId = dpidServer;
571 msgBody.groupId = 0;
572 msgBody.createOffset = sizeof( msgBody );
573 msgBody.passwordOffset = sizeof( msgBody ) + sizeof( playerInfo ) + spPlayerDataSize;
574
575 playerInfo.size = sizeof( playerInfo ) + spPlayerDataSize;
577 playerInfo.id = dpidServer;
578 playerInfo.shortNameLength = 0;
579 playerInfo.longNameLength = 0;
580 playerInfo.spDataLength = spPlayerDataSize;
581 playerInfo.playerDataLength = 0;
582 playerInfo.playerCount = 0;
583 playerInfo.systemPlayerId = dpidServer;
584 playerInfo.fixedSize = sizeof( playerInfo );
585 playerInfo.version = DPMSGVER_DP6;
586 playerInfo.parentId = 0;
587
588 /* Send the message */
589 {
592 SGBUFFER buffers[ 6 ] = { 0 };
593 DPSP_SENDEXDATA data = { 0 };
594
595 buffers[ 0 ].len = This->dp2->spData.dwSPHeaderSize;
596 buffers[ 1 ].len = sizeof( msgBody );
597 buffers[ 1 ].pData = (UCHAR *) &msgBody;
598 buffers[ 2 ].len = sizeof( playerInfo );
599 buffers[ 2 ].pData = (UCHAR *) &playerInfo;
600 buffers[ 3 ].len = spPlayerDataSize;
601 buffers[ 3 ].pData = (UCHAR *) spPlayerData;
602 buffers[ 4 ].len = (password ? (lstrlenW( password ) + 1) : 1) * sizeof( WCHAR );
603 buffers[ 4 ].pData = (UCHAR *) (password ? password : L"");
604 buffers[ 5 ].len = sizeof( This->dp2->lpSessionDesc->dwReserved1 );
605 buffers[ 5 ].pData = (UCHAR *) &This->dp2->lpSessionDesc->dwReserved1;
606
607 data.lpISP = This->dp2->spData.lpISP;
608 data.dwFlags = DPSEND_GUARANTEED;
609 data.idPlayerTo = 0; /* Name server */
610 data.idPlayerFrom = dpidServer; /* Sending from session server */
611 data.lpSendBuffers = buffers;
612 data.cBuffers = ARRAYSIZE( buffers );
613 data.dwMessageSize = DP_MSG_ComputeMessageSize( data.lpSendBuffers, data.cBuffers );
614 data.bSystemMessage = TRUE; /* Allow reply to be sent */
615
616 TRACE( "Sending forward player request with 0x%08lx\n", dpidServer );
617
620 replyCommands, ARRAYSIZE( replyCommands ),
621 &lpMsg, &dwMsgSize, &msgHeader );
622 }
623
624 /* Need to examine the data and extract the new player id */
625 if( lpMsg != NULL )
626 {
627 DPMSG_SENDENVELOPE *envelope;
628
629 if( dwMsgSize < sizeof( DPMSG_SENDENVELOPE ) )
630 {
631 free( msgHeader );
632 free( lpMsg );
633 return DPERR_GENERIC;
634 }
635 envelope = (DPMSG_SENDENVELOPE *) lpMsg;
636
638 {
639 DPSP_MSG_SUPERENUMPLAYERSREPLY *enumPlayersReply;
641 int i;
642
643 if( dwMsgSize < sizeof( DPSP_MSG_SUPERENUMPLAYERSREPLY ) )
644 {
645 free( msgHeader );
646 free( lpMsg );
647 return DPERR_GENERIC;
648 }
649 enumPlayersReply = (DPSP_MSG_SUPERENUMPLAYERSREPLY *) envelope;
650
651 offset = enumPlayersReply->packedOffset;
652 for( i = 0; i < enumPlayersReply->playerCount; ++i )
653 {
654 DPPLAYERINFO playerInfo;
655
656 hr = DP_MSG_ReadSuperPackedPlayer( (char *) enumPlayersReply, &offset, dwMsgSize,
657 &playerInfo );
658 if( FAILED( hr ) )
659 {
660 free( msgHeader );
661 free( lpMsg );
662 return hr;
663 }
664
665 if ( playerInfo.id == dpidServer )
666 continue;
667
668 hr = DP_CreatePlayer( This, msgHeader, &playerInfo.id, &playerInfo.name,
669 playerInfo.playerData, playerInfo.playerDataLength, playerInfo.spData,
670 playerInfo.spDataLength, playerInfo.flags & ~DPLAYI_PLAYER_PLAYERLOCAL, NULL,
671 NULL, FALSE );
672 if( FAILED( hr ) )
673 {
674 free( msgHeader );
675 free( lpMsg );
676 return hr;
677 }
678 }
679 for( i = 0; i < enumPlayersReply->groupCount; ++i )
680 {
681 DPPLAYERINFO playerInfo;
682 int j;
683
684 hr = DP_MSG_ReadSuperPackedPlayer( (char *) enumPlayersReply, &offset, dwMsgSize,
685 &playerInfo );
686 if( FAILED( hr ) )
687 {
688 free( msgHeader );
689 free( lpMsg );
690 return hr;
691 }
692
693 hr = DP_CreateGroup( This, msgHeader, &playerInfo.id, &playerInfo.name,
694 playerInfo.playerData, playerInfo.playerDataLength,
695 playerInfo.flags & ~DPLAYI_PLAYER_PLAYERLOCAL, playerInfo.parentId,
696 FALSE );
697 if( FAILED( hr ) )
698 {
699 free( msgHeader );
700 free( lpMsg );
701 return hr;
702 }
703
704 for( j = 0; j < playerInfo.playerCount; ++j )
705 {
706 hr = DP_AddPlayerToGroup( This, playerInfo.id, playerInfo.playerIds[ j ] );
707 if( FAILED( hr ) )
708 {
709 free( msgHeader );
710 free( lpMsg );
711 return hr;
712 }
713 }
714 }
715 }
716 else if( envelope->wCommandId == DPMSGCMD_GETNAMETABLEREPLY )
717 {
718 FIXME( "Name Table reply received: stub\n" );
719 }
720 else if( envelope->wCommandId == DPMSGCMD_FORWARDADDPLAYERNACK )
721 {
722 DPSP_MSG_ADDFORWARDREPLY *addForwardReply;
723
724 if( dwMsgSize < sizeof( DPSP_MSG_ADDFORWARDREPLY ) )
725 {
726 free( msgHeader );
727 free( lpMsg );
728 return DPERR_GENERIC;
729 }
730 addForwardReply = (DPSP_MSG_ADDFORWARDREPLY *) envelope;
731
732 hr = addForwardReply->error;
733
734 free( msgHeader );
735 free( lpMsg );
736
737 return hr;
738 }
739 free( msgHeader );
740 free( lpMsg );
741 }
742
743 return hr;
744}
#define FIXME(fmt,...)
Definition: precomp.h:53
static UCHAR password[]
Definition: bcrypt.c:520
#define ARRAYSIZE(a)
Definition: cat.c:25
HRESULT hr
Definition: delayimp.cpp:582
#define TRUE
Definition: types.h:120
#define lstrlenW
Definition: compat.h:750
HRESULT DP_CreatePlayer(IDirectPlayImpl *This, void *msgHeader, DPID *lpid, DPNAME *lpName, void *data, DWORD dataSize, void *spData, DWORD spDataSize, DWORD dwFlags, HANDLE hEvent, struct PlayerData **playerData, BOOL bAnsi)
Definition: dplay.c:1823
HRESULT DP_AddPlayerToGroup(IDirectPlayImpl *This, DPID group, DPID player)
Definition: dplay.c:1210
HRESULT DP_CreateGroup(IDirectPlayImpl *This, void *msgHeader, const DPID *lpid, const DPNAME *lpName, void *data, DWORD dataSize, DWORD dwFlags, DPID idParent, BOOL bAnsi)
Definition: dplay.c:1386
#define DPERR_GENERIC
Definition: dplay.h:99
#define DPSET_REMOTE
Definition: dplay.h:1056
#define DPSEND_GUARANTEED
Definition: dplay.h:1038
#define IDirectPlaySP_GetSPPlayerData(p, a, b, c, d)
Definition: dplaysp.h:104
#define DPLAYI_PLAYER_PLAYERLOCAL
Definition: dplaysp.h:59
#define DPLAYI_PLAYER_SYSPLAYER
Definition: dplaysp.h:56
static HRESULT DP_MSG_ExpectReply(IDirectPlayImpl *This, DPSP_SENDEXDATA *data, DWORD dwWaitTime, WORD *replyCommandIds, DWORD replyCommandIdCount, void **lplpReplyMsg, DWORD *lpdwMsgBodySize, void **replyMsgHeader)
static HRESULT DP_MSG_ReadSuperPackedPlayer(char *data, DWORD *inoutOffset, DWORD maxSize, DPPLAYERINFO *playerInfo)
DWORD DP_MSG_ComputeMessageSize(SGBUFFER *buffers, DWORD bufferCount)
#define DPMSGCMD_SUPERENUMPLAYERSREPLY
#define DPMSGVER_DP6
#define DPMSGCMD_GETNAMETABLEREPLY
#define DPMSGCMD_FORWARDADDPLAYER
#define DPMSG_WAIT_60_SECS
#define DPMSGCMD_FORWARDADDPLAYERNACK
#define DPMSGMAGIC_DPLAYMSG
#define L(x)
Definition: resources.c:13
unsigned short WORD
Definition: ntddk_ex.h:93
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLintptr offset
Definition: glext.h:5920
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define FAILED(hr)
Definition: intsafe.h:51
short WCHAR
Definition: pedump.c:58
#define TRACE(s)
Definition: solgame.cpp:4
DWORD playerDataLength
DPMSG_SENDENVELOPE envelope
unsigned char UCHAR
Definition: typedefs.h:53

Referenced by DP_SecureOpen().

◆ DP_MSG_ReadPackedPlayer()

HRESULT DP_MSG_ReadPackedPlayer ( char *  data,
DWORD *  offset,
DWORD  maxSize,
DPPLAYERINFO *  playerInfo 
)

Definition at line 376 of file dplayx_messages.c.

378{
379 DPLAYI_PACKEDPLAYER *packedPlayer;
380 DWORD offset = *inoutOffset;
381 HRESULT hr;
382
383 memset( playerInfo, 0, sizeof( DPPLAYERINFO ) );
384
385 if( maxSize - offset < sizeof( DPLAYI_PACKEDPLAYER ) )
386 return DPERR_GENERIC;
387 packedPlayer = (DPLAYI_PACKEDPLAYER *) &data[ offset ];
388 offset += sizeof( DPLAYI_PACKEDPLAYER );
389
390 playerInfo->flags = packedPlayer->flags;
391 playerInfo->id = packedPlayer->id;
392 playerInfo->versionOrSystemPlayerId = packedPlayer->version;
393 playerInfo->playerDataLength = packedPlayer->playerDataLength;
394 playerInfo->spDataLength = packedPlayer->spDataLength;
395 playerInfo->playerCount = packedPlayer->playerCount;
396 playerInfo->parentId = packedPlayer->parentId;
397
398 if( packedPlayer->shortNameLength )
399 {
400 hr = DP_MSG_ReadSizedString( data, &offset, maxSize, packedPlayer->shortNameLength,
401 &playerInfo->name.lpszShortName );
402 if( FAILED( hr ) )
403 return hr;
404 }
405
406 if( packedPlayer->longNameLength )
407 {
408 hr = DP_MSG_ReadSizedString( data, &offset, maxSize, packedPlayer->longNameLength,
409 &playerInfo->name.lpszLongName );
410 if( FAILED( hr ) )
411 return hr;
412 }
413
414 if( playerInfo->spDataLength )
415 {
416 if( maxSize - offset < playerInfo->spDataLength )
417 return DPERR_GENERIC;
418 playerInfo->spData = &data[ offset ];
419 offset += playerInfo->spDataLength;
420 }
421
422 if( playerInfo->playerDataLength )
423 {
424 if( maxSize - offset < playerInfo->playerDataLength )
425 return DPERR_GENERIC;
426 playerInfo->playerData = &data[ offset ];
427 offset += playerInfo->playerDataLength;
428 }
429
430 if( playerInfo->playerCount )
431 {
432 if( UINT_MAX / sizeof( DPID ) < playerInfo->playerCount )
433 return DPERR_GENERIC;
434 if( maxSize - offset < playerInfo->playerCount * sizeof( DPID ) )
435 return DPERR_GENERIC;
436 playerInfo->playerIds = (DPID *) &data[ offset ];
437 offset += playerInfo->playerCount * sizeof( DPID );
438 }
439
440 *inoutOffset = offset;
441
442 return S_OK;
443}
#define UINT_MAX
Definition: limits.h:27
DWORD DPID
Definition: dplay.h:158
static HRESULT DP_MSG_ReadSizedString(char *data, DWORD *inoutOffset, DWORD maxSize, DWORD size, WCHAR **string)
#define S_OK
Definition: intsafe.h:52
#define memset(x, y, z)
Definition: compat.h:39
DWORD versionOrSystemPlayerId
LPWSTR lpszLongName
Definition: dplay.h:199
LPWSTR lpszShortName
Definition: dplay.h:193

Referenced by DP_HandleMessage().

◆ DP_MSG_ReplyReceived()

void DP_MSG_ReplyReceived ( IDirectPlayImpl *  This,
WORD  wCommandId,
LPCVOID  lpMsgBody,
DWORD  dwMsgBodySize,
const void *  msgHeader 
)

◆ DP_MSG_SendAddForwardAck()

HRESULT DP_MSG_SendAddForwardAck ( IDirectPlayImpl *  This,
DPID  id 
)

Definition at line 918 of file dplayx_messages.c.

919{
920 SGBUFFER buffers[ 2 ] = { 0 };
922 DPSP_SENDEXDATA sendData;
923 HRESULT hr;
924
925 msg.envelope.dwMagic = DPMSGMAGIC_DPLAYMSG;
926 msg.envelope.wCommandId = DPMSGCMD_ADDFORWARDACK;
927 msg.envelope.wVersion = DPMSGVER_DP6;
928 msg.id = id;
929
930 buffers[ 0 ].len = This->dp2->spData.dwSPHeaderSize;
931 buffers[ 0 ].pData = NULL;
932 buffers[ 1 ].len = sizeof( msg );
933 buffers[ 1 ].pData = (UCHAR *)&msg;
934
935 sendData.lpISP = This->dp2->spData.lpISP;
936 sendData.dwFlags = DPSEND_GUARANTEED;
937 sendData.idPlayerTo = 0;
938 sendData.idPlayerFrom = This->dp2->systemPlayerId;
939 sendData.lpSendBuffers = buffers;
940 sendData.cBuffers = ARRAYSIZE( buffers );
941 sendData.dwMessageSize = DP_MSG_ComputeMessageSize( sendData.lpSendBuffers, sendData.cBuffers );
942 sendData.dwPriority = 0;
943 sendData.dwTimeout = 0;
944 sendData.lpDPContext = NULL;
945 sendData.lpdwSPMsgID = NULL;
946 sendData.bSystemMessage = TRUE;
947
948 hr = (*This->dp2->spData.lpCB->SendEx)( &sendData );
949 if( FAILED( hr ) )
950 {
951 ERR( "Send failed: %s\n", DPLAYX_HresultToString( hr ) );
952 return hr;
953 }
954
955 return DP_OK;
956}
#define msg(x)
Definition: auth_time.c:54
#define DP_OK
Definition: dplay.h:88
LPCSTR DPLAYX_HresultToString(HRESULT hr)
#define DPMSGCMD_ADDFORWARDACK
GLuint id
Definition: glext.h:5910
LPDWORD lpdwSPMsgID
Definition: dplaysp.h:248
IDirectPlaySP * lpISP
Definition: dplaysp.h:238
DWORD dwMessageSize
Definition: dplaysp.h:244
LPSGBUFFER lpSendBuffers
Definition: dplaysp.h:242
LPVOID lpDPContext
Definition: dplaysp.h:247

Referenced by DP_HandleMessage().

◆ DP_MSG_SendAddPlayerToGroup()

HRESULT DP_MSG_SendAddPlayerToGroup ( IDirectPlayImpl *  This,
DPID  toId,
DPID  playerId,
DPID  groupId 
)

Definition at line 834 of file dplayx_messages.c.

835{
836 DPSP_SENDTOGROUPEXDATA sendData;
838 SGBUFFER buffers[ 2 ] = { 0 };
839 HRESULT hr;
840
841 msg.envelope.dwMagic = DPMSGMAGIC_DPLAYMSG;
842 msg.envelope.wCommandId = DPMSGCMD_ADDPLAYERTOGROUP;
843 msg.envelope.wVersion = DPMSGVER_DP6;
844 msg.toId = 0;
845 msg.playerId = playerId;
846 msg.groupId = groupId;
847 msg.createOffset = 0;
848 msg.passwordOffset = 0;
849
850 buffers[ 0 ].len = This->dp2->spData.dwSPHeaderSize;
851 buffers[ 0 ].pData = NULL;
852 buffers[ 1 ].len = sizeof( msg );
853 buffers[ 1 ].pData = (UCHAR *)&msg;
854
855 sendData.lpISP = This->dp2->spData.lpISP;
856 sendData.dwFlags = DPSEND_GUARANTEED;
857 sendData.idGroupTo = toId;
858 sendData.idPlayerFrom = This->dp2->systemPlayerId;
859 sendData.lpSendBuffers = buffers;
860 sendData.cBuffers = ARRAYSIZE( buffers );
861 sendData.dwMessageSize = DP_MSG_ComputeMessageSize( sendData.lpSendBuffers, sendData.cBuffers );
862 sendData.dwPriority = 0;
863 sendData.dwTimeout = 0;
864 sendData.lpDPContext = NULL;
865 sendData.lpdwSPMsgID = NULL;
866
867 hr = (*This->dp2->spData.lpCB->SendToGroupEx)( &sendData );
868 if( FAILED( hr ) )
869 {
870 ERR( "SendToGroupEx failed: %s\n", DPLAYX_HresultToString( hr ) );
871 return hr;
872 }
873
874 return DP_OK;
875}
#define DPMSGCMD_ADDPLAYERTOGROUP
LPSGBUFFER lpSendBuffers
Definition: dplaysp.h:258
IDirectPlaySP * lpISP
Definition: dplaysp.h:254

Referenced by IDirectPlay4Impl_AddPlayerToGroup().

◆ DP_MSG_SendCreatePlayer()

HRESULT DP_MSG_SendCreatePlayer ( IDirectPlayImpl *  This,
DPID  toId,
DPID  id,
DWORD  flags,
DPNAME *  name,
void *  playerData,
DWORD  playerDataSize,
DPID  systemPlayerId 
)

Definition at line 746 of file dplayx_messages.c.

749{
750 DPSP_SENDTOGROUPEXDATA sendData;
751 DPLAYI_PACKEDPLAYER playerInfo;
752 SGBUFFER buffers[ 8 ] = { 0 };
753 UCHAR reserved[ 6 ] = { 0 };
754 DWORD shortNameLength = 0;
755 DWORD longNameLength = 0;
757 DWORD spPlayerDataSize;
758 void *spPlayerData;
759 HRESULT hr;
760
761 hr = IDirectPlaySP_GetSPPlayerData( This->dp2->spData.lpISP, id, &spPlayerData, &spPlayerDataSize,
762 DPSET_REMOTE );
763 if( FAILED( hr ) )
764 return hr;
765
766 if ( name->lpszShortName )
767 shortNameLength = ( lstrlenW( name->lpszShortName ) + 1 ) * sizeof( WCHAR );
768
769 if ( name->lpszLongName )
770 longNameLength = ( lstrlenW( name->lpszLongName ) + 1 ) * sizeof( WCHAR );
771
772 msg.envelope.dwMagic = DPMSGMAGIC_DPLAYMSG;
773 msg.envelope.wCommandId = DPMSGCMD_CREATESESSION;
774 msg.envelope.wVersion = DPMSGVER_DP6;
775 msg.toId = 0;
776 msg.playerId = id;
777 msg.groupId = 0;
778 msg.createOffset = sizeof( DPMSG_CREATESESSION );
779 msg.passwordOffset = 0;
780
781 playerInfo.size = sizeof( DPLAYI_PACKEDPLAYER ) + shortNameLength + longNameLength
782 + spPlayerDataSize + playerDataSize;
783 playerInfo.flags = flags;
784 playerInfo.id = id;
785 playerInfo.shortNameLength = shortNameLength;
786 playerInfo.longNameLength = longNameLength;
787 playerInfo.spDataLength = spPlayerDataSize;
788 playerInfo.playerDataLength = playerDataSize;
789 playerInfo.playerCount = 0;
790 playerInfo.systemPlayerId = systemPlayerId;
791 playerInfo.fixedSize = sizeof( DPLAYI_PACKEDPLAYER );
792 playerInfo.version = DPMSGVER_DP6;
793 playerInfo.parentId = 0;
794
795 buffers[ 0 ].len = This->dp2->spData.dwSPHeaderSize;
796 buffers[ 0 ].pData = NULL;
797 buffers[ 1 ].len = sizeof( msg );
798 buffers[ 1 ].pData = (UCHAR *)&msg;
799 buffers[ 2 ].len = sizeof( playerInfo );
800 buffers[ 2 ].pData = (UCHAR *)&playerInfo;
801 buffers[ 3 ].len = shortNameLength;
802 buffers[ 3 ].pData = (UCHAR *)name->lpszShortName;
803 buffers[ 4 ].len = longNameLength;
804 buffers[ 4 ].pData = (UCHAR *)name->lpszLongName;
805 buffers[ 5 ].len = spPlayerDataSize;
806 buffers[ 5 ].pData = spPlayerData;
807 buffers[ 6 ].len = playerDataSize;
808 buffers[ 6 ].pData = playerData;
809 buffers[ 7 ].len = sizeof( reserved );
810 buffers[ 7 ].pData = reserved;
811
812 sendData.lpISP = This->dp2->spData.lpISP;
813 sendData.dwFlags = DPSEND_GUARANTEED;
814 sendData.idGroupTo = toId;
815 sendData.idPlayerFrom = This->dp2->systemPlayerId;
816 sendData.lpSendBuffers = buffers;
817 sendData.cBuffers = ARRAYSIZE( buffers );
818 sendData.dwMessageSize = DP_MSG_ComputeMessageSize( sendData.lpSendBuffers, sendData.cBuffers );
819 sendData.dwPriority = 0;
820 sendData.dwTimeout = 0;
821 sendData.lpDPContext = NULL;
822 sendData.lpdwSPMsgID = NULL;
823
824 hr = (*This->dp2->spData.lpCB->SendToGroupEx)( &sendData );
825 if( FAILED( hr ) )
826 {
827 ERR( "SendToGroupEx failed: %s\n", DPLAYX_HresultToString( hr ) );
828 return hr;
829 }
830
831 return DP_OK;
832}
#define DPMSGCMD_CREATESESSION
struct tagDPMSG_CREATESESSION DPMSG_CREATESESSION
r reserved
Definition: btrfs.c:3006
GLbitfield flags
Definition: glext.h:7161
Definition: name.c:39

Referenced by DP_IF_CreatePlayer().

◆ DP_MSG_SendPingReply()

HRESULT DP_MSG_SendPingReply ( IDirectPlayImpl *  This,
DPID  toId,
DPID  fromId,
DWORD  tickCount 
)

Definition at line 877 of file dplayx_messages.c.

878{
879 SGBUFFER buffers[ 2 ] = { 0 };
880 DPSP_SENDEXDATA sendData;
882 HRESULT hr;
883
884 msg.envelope.dwMagic = DPMSGMAGIC_DPLAYMSG;
885 msg.envelope.wCommandId = DPMSGCMD_PINGREPLY;
886 msg.envelope.wVersion = DPMSGVER_DP6;
887 msg.fromId = fromId;
888 msg.tickCount = tickCount;
889
890 buffers[ 0 ].len = This->dp2->spData.dwSPHeaderSize;
891 buffers[ 0 ].pData = NULL;
892 buffers[ 1 ].len = sizeof( msg );
893 buffers[ 1 ].pData = (UCHAR *)&msg;
894
895 sendData.lpISP = This->dp2->spData.lpISP;
896 sendData.dwFlags = 0;
897 sendData.idPlayerTo = toId;
898 sendData.idPlayerFrom = This->dp2->systemPlayerId;
899 sendData.lpSendBuffers = buffers;
900 sendData.cBuffers = ARRAYSIZE( buffers );
901 sendData.dwMessageSize = DP_MSG_ComputeMessageSize( sendData.lpSendBuffers, sendData.cBuffers );
902 sendData.dwPriority = 0;
903 sendData.dwTimeout = 0;
904 sendData.lpDPContext = NULL;
905 sendData.lpdwSPMsgID = NULL;
906 sendData.bSystemMessage = TRUE;
907
908 hr = (*This->dp2->spData.lpCB->SendEx)( &sendData );
909 if( FAILED( hr ) )
910 {
911 ERR( "Send failed: %s\n", DPLAYX_HresultToString( hr ) );
912 return hr;
913 }
914
915 return DP_OK;
916}
#define DPMSGCMD_PINGREPLY

Referenced by DP_HandleMessage().

◆ DP_MSG_SendRequestPlayerId()

HRESULT DP_MSG_SendRequestPlayerId ( IDirectPlayImpl *  This,
DWORD  dwFlags,
LPDPID  lpdipidAllocatedId 
)

◆ DP_MSG_ToSelf()

void DP_MSG_ToSelf ( IDirectPlayImpl *  This,
DPID  dpidSelf 
)

Definition at line 1046 of file dplayx_messages.c.

1047{
1048 LPVOID lpMsg;
1049 void *msgHeader;
1050 DPMSG_SENDENVELOPE msgBody;
1051 DWORD dwMsgSize;
1052
1053 /* Compose dplay message envelope */
1054 msgBody.dwMagic = DPMSGMAGIC_DPLAYMSG;
1056 msgBody.wVersion = DPMSGVER_DP6;
1057
1058 /* Send the message to ourselves */
1059 {
1060 WORD replyCommand = DPMSGCMD_JUSTENVELOPE;
1061 SGBUFFER buffers[ 2 ] = { 0 };
1062 DPSP_SENDEXDATA data = { 0 };
1063
1064 buffers[ 0 ].len = This->dp2->spData.dwSPHeaderSize;
1065 buffers[ 1 ].len = sizeof( msgBody );
1066 buffers[ 1 ].pData = (UCHAR *) &msgBody;
1067
1068 data.lpISP = This->dp2->spData.lpISP;
1069 data.dwFlags = 0;
1070 data.idPlayerTo = dpidSelf; /* Sending to session server */
1071 data.idPlayerFrom = 0; /* Sending from session server */
1072 data.lpSendBuffers = buffers;
1073 data.cBuffers = ARRAYSIZE( buffers );
1074 data.dwMessageSize = DP_MSG_ComputeMessageSize( data.lpSendBuffers, data.cBuffers );
1075 data.bSystemMessage = TRUE; /* Allow reply to be sent */
1076
1079 &replyCommand, 1,
1080 &lpMsg, &dwMsgSize, &msgHeader );
1081 }
1082}
#define DPMSG_WAIT_5_SECS
#define DPMSGCMD_JUSTENVELOPE

Referenced by DP_HandleMessage().