ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

dplayx_messages.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2000 Peter Hunnisett
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018 
00019 #ifndef __WINE_DPLAYX_MESSAGES__
00020 #define __WINE_DPLAYX_MESSAGES__
00021 
00022 #include <stdarg.h>
00023 
00024 #include "windef.h"
00025 #include "winbase.h"
00026 #include "dplay.h"
00027 #include "rpc.h" /* For GUID */
00028 
00029 #include "dplay_global.h"
00030 
00031 DWORD CreateLobbyMessageReceptionThread( HANDLE hNotifyEvent, HANDLE hStart,
00032                                          HANDLE hDeath, HANDLE hConnRead );
00033 
00034 HRESULT DP_MSG_SendRequestPlayerId( IDirectPlay2AImpl* This, DWORD dwFlags,
00035                                     LPDPID lpdipidAllocatedId );
00036 HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlay2AImpl* This, DPID dpidServer );
00037 
00038 void DP_MSG_ReplyReceived( IDirectPlay2AImpl* This, WORD wCommandId,
00039                            LPCVOID lpMsgBody, DWORD dwMsgBodySize );
00040 void DP_MSG_ErrorReceived( IDirectPlay2AImpl* This, WORD wCommandId,
00041                            LPCVOID lpMsgBody, DWORD dwMsgBodySize );
00042 void DP_MSG_ToSelf( IDirectPlay2AImpl* This, DPID dpidSelf );
00043 
00044 /* Timings -> 1000 ticks/sec */
00045 #define DPMSG_WAIT_5_SECS   5000
00046 #define DPMSG_WAIT_30_SECS 30000
00047 #define DPMSG_WAIT_60_SECS 60000
00048 #define DPMSG_DEFAULT_WAIT_TIME DPMSG_WAIT_30_SECS
00049 
00050 /* Message types etc. */
00051 #include "pshpack1.h"
00052 
00053 /* Non provided messages for DPLAY - guess work which may be wrong :( */
00054 #define DPMSGCMD_ENUMSESSIONSREPLY    1
00055 #define DPMSGCMD_ENUMSESSIONSREQUEST  2
00056 #define DPMSGCMD_GETNAMETABLEREPLY    3  /* Contains all existing players in session */
00057 
00058 #define DPMSGCMD_REQUESTNEWPLAYERID   5
00059 
00060 #define DPMSGCMD_NEWPLAYERIDREPLY     7
00061 #define DPMSGCMD_CREATESESSION        8 /* Might be a create nameserver or new player msg */
00062 #define DPMSGCMD_CREATENEWPLAYER      9
00063 #define DPMSGCMD_SYSTEMMESSAGE        10
00064 #define DPMSGCMD_DELETEPLAYER         11
00065 #define DPMSGCMD_DELETEGROUP          12
00066 
00067 #define DPMSGCMD_ENUMGROUPS           17
00068 
00069 #define DPMSGCMD_FORWARDADDPLAYER     19
00070 
00071 #define DPMSGCMD_PLAYERCHAT           22
00072 
00073 #define DPMSGCMD_FORWARDADDPLAYERNACK 36
00074 
00075 #define DPMSGCMD_JUSTENVELOPE         1000
00076 #define DPMSGCMD_JUSTENVELOPEREPLY    1001
00077 
00078 /* This is what DP 6 defines it as. Don't know what it means. All messages
00079  * defined below are DPMSGVER_DP6.
00080  */
00081 #define DPMSGVER_DP6 11
00082 
00083 /* MAGIC number at the start of all dplay packets ("play" in ASCII) */
00084 #define DPMSGMAGIC_DPLAYMSG  0x79616c70
00085 
00086 /* All messages sent from the system are sent with this at the beginning of
00087  * the message.
00088  * Size is 8 bytes
00089  */
00090 typedef struct tagDPMSG_SENDENVELOPE
00091 {
00092   DWORD dwMagic;
00093   WORD  wCommandId;
00094   WORD  wVersion;
00095 } DPMSG_SENDENVELOPE, *LPDPMSG_SENDENVELOPE;
00096 typedef const DPMSG_SENDENVELOPE* LPCDPMSG_SENDENVELOPE;
00097 
00098 /* System messages exchanged between players seems to have this
00099  * payload envelope on top of the basic envelope
00100  */
00101 typedef struct tagDPMSG_SYSMSGENVELOPE
00102 {
00103   DWORD dwPlayerFrom;
00104   DWORD dwPlayerTo;
00105 } DPMSG_SYSMSGENVELOPE, *LPDPMSG_SYSMSGENVELOPE;
00106 typedef const DPMSG_SYSMSGENVELOPE* LPCDPMSG_SYSMSGENVELOPE;
00107 
00108 /* Reply sent in response to an enumsession request */
00109 typedef struct tagDPMSG_ENUMSESSIONSREPLY
00110 {
00111   DPMSG_SENDENVELOPE envelope;
00112 
00113 #if 0
00114   DWORD dwSize;  /* Size of DPSESSIONDESC2 struct */
00115   DWORD dwFlags; /* Sessions flags */
00116 
00117   GUID guidInstance; /* Not 100% sure this is what it is... */
00118 
00119   GUID guidApplication;
00120 
00121   DWORD dwMaxPlayers;
00122   DWORD dwCurrentPlayers;
00123 
00124   BYTE unknown[36];
00125 #else
00126   DPSESSIONDESC2 sd;
00127 #endif
00128 
00129   DWORD dwUnknown;  /* Seems to be equal to 0x5c which is a "\\" */
00130                     /* Encryption package string? */
00131 
00132   /* At the end we have ... */
00133   /* WCHAR wszSessionName[1];  Var length with NULL terminal */
00134 
00135 } DPMSG_ENUMSESSIONSREPLY, *LPDPMSG_ENUMSESSIONSREPLY;
00136 typedef const DPMSG_ENUMSESSIONSREPLY* LPCDPMSG_ENUMSESSIONSREPLY;
00137 
00138 /* Msg sent to find out what sessions are available */
00139 typedef struct tagDPMSG_ENUMSESSIONSREQUEST
00140 {
00141   DPMSG_SENDENVELOPE envelope;
00142 
00143   GUID  guidApplication;
00144 
00145   DWORD dwPasswordSize; /* A Guess. This is 0x00000000. */
00146                         /* This might be the name server DPID which
00147                            is needed for the reply */
00148 
00149   DWORD dwFlags; /* dwFlags from EnumSessions */
00150 
00151 } DPMSG_ENUMSESSIONSREQUEST, *LPDPMSG_ENUMSESSIONSREQUEST;
00152 typedef const DPMSG_ENUMSESSIONSREQUEST* LPCDPMSG_ENUMSESSIONSREQUEST;
00153 
00154 /* Size is 146 received - with 18 or 20 bytes header = ~128 bytes */
00155 typedef struct tagDPMSG_CREATESESSION
00156 {
00157   DPMSG_SENDENVELOPE envelope;
00158 } DPMSG_CREATESESSION, *LPDPMSG_CREATESESSION;
00159 typedef const DPMSG_CREATESESSION* LPCDPMSG_CREATESESSION;
00160 
00161 /* 12 bytes msg */
00162 typedef struct tagDPMSG_REQUESTNEWPLAYERID
00163 {
00164   DPMSG_SENDENVELOPE envelope;
00165 
00166   DWORD dwFlags;  /* dwFlags used for CreatePlayer */
00167 
00168 } DPMSG_REQUESTNEWPLAYERID, *LPDPMSG_REQUESTNEWPLAYERID;
00169 typedef const DPMSG_REQUESTNEWPLAYERID* LPCDPMSG_REQUESTNEWPLAYERID;
00170 
00171 /* 48 bytes msg */
00172 typedef struct tagDPMSG_NEWPLAYERIDREPLY
00173 {
00174   DPMSG_SENDENVELOPE envelope;
00175 
00176   DPID dpidNewPlayerId;
00177 
00178   /* Assume that this is data that is tacked on to the end of the message
00179    * that comes from the SP remote data stored that needs to be propagated.
00180    */
00181   BYTE unknown[36];     /* This appears to always be 0 - not sure though */
00182 } DPMSG_NEWPLAYERIDREPLY, *LPDPMSG_NEWPLAYERIDREPLY;
00183 typedef const DPMSG_NEWPLAYERIDREPLY* LPCDPMSG_NEWPLAYERIDREPLY;
00184 
00185 typedef struct tagDPMSG_FORWARDADDPLAYER
00186 {
00187   DPMSG_SENDENVELOPE envelope;
00188 
00189   DWORD unknown; /* 0 */
00190 
00191   DPID  dpidAppServer; /* Remote application server id */
00192   DWORD unknown2[5]; /* 0x0, 0x1c, 0x6c, 0x50, 0x9 */
00193 
00194   DPID  dpidAppServer2; /* Remote application server id again !? */
00195   DWORD unknown3[5]; /* 0x0, 0x0, 0x20, 0x0, 0x0 */
00196 
00197   DPID  dpidAppServer3; /* Remote application server id again !? */
00198 
00199   DWORD unknown4[12]; /* ??? - Is this a clump of 5 and then 8? */
00200                       /* NOTE: 1 byte in front of the two 0x??090002 entries changes!
00201                       *       Is it a timestamp of some sort? 1st always smaller than
00202                       *       other...
00203                       */
00204 #define FORWARDADDPLAYER_UNKNOWN4_INIT { 0x30, 0xb, 0x0, 0x1e090002, 0x0, 0x0, 0x0, 0x32090002, 0x0, 0x0, 0x0, 0x0 }
00205 
00206   BYTE unknown5[2]; /* 2 bytes at the end. This may be a part of something! ( 0x0, 0x0) */
00207 
00208 } DPMSG_FORWARDADDPLAYER, *LPDPMSG_FORWARDADDPLAYER;
00209 typedef const DPMSG_FORWARDADDPLAYER* LPCDPMSG_FORWARDADDPLAYER;
00210 
00211 /* This is an error message that can be received. Not sure if this is
00212  * specifically for a forward add player or for all errors
00213  */
00214 typedef struct tagDPMSG_FORWARDADDPLAYERNACK
00215 {
00216   DPMSG_SENDENVELOPE envelope;
00217   HRESULT errorCode;
00218 } DPMSG_FORWARDADDPLAYERNACK, *LPDPMSG_FORWARDADDPLAYERNACK;
00219 typedef const DPMSG_FORWARDADDPLAYERNACK* LPCDPMSG_FORWARDADDPLAYERNACK;
00220 
00221 #include "poppack.h"
00222 
00223 #endif

Generated on Sun May 27 2012 04:21:38 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.