| 1 | // $Id: dplay_global.h,v 1.2 2000-09-24 22:47:40 hugh Exp $
|
|---|
| 2 | #ifndef __WINE_DPLAY_GLOBAL_INCLUDED
|
|---|
| 3 | #define __WINE_DPLAY_GLOBAL_INCLUDED
|
|---|
| 4 |
|
|---|
| 5 | #include "dplaysp.h"
|
|---|
| 6 | #include "dplayx_queue.h"
|
|---|
| 7 |
|
|---|
| 8 | extern HRESULT DPL_EnumAddress( LPDPENUMADDRESSCALLBACK lpEnumAddressCallback,
|
|---|
| 9 | LPCVOID lpAddress, DWORD dwAddressSize,
|
|---|
| 10 | LPVOID lpContext );
|
|---|
| 11 |
|
|---|
| 12 | extern DWORD DP_CalcSessionDescSize( LPCDPSESSIONDESC2 lpSessDesc, BOOL bAnsi );
|
|---|
| 13 |
|
|---|
| 14 | /*****************************************************************************
|
|---|
| 15 | * Predeclare the interface implementation structures
|
|---|
| 16 | */
|
|---|
| 17 | typedef struct IDirectPlay2Impl IDirectPlay2AImpl;
|
|---|
| 18 | typedef struct IDirectPlay2Impl IDirectPlay2Impl;
|
|---|
| 19 | typedef struct IDirectPlay3Impl IDirectPlay3AImpl;
|
|---|
| 20 | typedef struct IDirectPlay3Impl IDirectPlay3Impl;
|
|---|
| 21 | typedef struct IDirectPlay4Impl IDirectPlay4AImpl;
|
|---|
| 22 | typedef struct IDirectPlay4Impl IDirectPlay4Impl;
|
|---|
| 23 |
|
|---|
| 24 | typedef struct tagDirectPlayIUnknownData
|
|---|
| 25 | {
|
|---|
| 26 | ULONG ulObjRef;
|
|---|
| 27 | CRITICAL_SECTION DP_lock;
|
|---|
| 28 | } DirectPlayIUnknownData;
|
|---|
| 29 |
|
|---|
| 30 | typedef struct tagEnumSessionAsyncCallbackData
|
|---|
| 31 | {
|
|---|
| 32 | LPSPINITDATA lpSpData;
|
|---|
| 33 | GUID requestGuid;
|
|---|
| 34 | DWORD dwEnumSessionFlags;
|
|---|
| 35 | DWORD dwTimeout;
|
|---|
| 36 | HANDLE hSuicideRequest;
|
|---|
| 37 | } EnumSessionAsyncCallbackData;
|
|---|
| 38 |
|
|---|
| 39 | struct PlayerData
|
|---|
| 40 | {
|
|---|
| 41 | /* Individual player information */
|
|---|
| 42 | DPID dpid;
|
|---|
| 43 |
|
|---|
| 44 | DPNAME name;
|
|---|
| 45 | HANDLE hEvent;
|
|---|
| 46 |
|
|---|
| 47 | ULONG uRef; /* What is the reference count on this data? */
|
|---|
| 48 |
|
|---|
| 49 | /* View of local data */
|
|---|
| 50 | LPVOID lpLocalData;
|
|---|
| 51 | DWORD dwLocalDataSize;
|
|---|
| 52 |
|
|---|
| 53 | /* View of remote data */
|
|---|
| 54 | LPVOID lpRemoteData;
|
|---|
| 55 | DWORD dwRemoteDataSize;
|
|---|
| 56 |
|
|---|
| 57 | DWORD dwFlags; /* Special remarks about the type of player */
|
|---|
| 58 | };
|
|---|
| 59 | typedef struct PlayerData* lpPlayerData;
|
|---|
| 60 |
|
|---|
| 61 | struct PlayerList
|
|---|
| 62 | {
|
|---|
| 63 | DPQ_ENTRY(PlayerList) players;
|
|---|
| 64 |
|
|---|
| 65 | lpPlayerData lpPData;
|
|---|
| 66 | };
|
|---|
| 67 | typedef struct PlayerList* lpPlayerList;
|
|---|
| 68 |
|
|---|
| 69 | struct GroupData
|
|---|
| 70 | {
|
|---|
| 71 | /* Internal information */
|
|---|
| 72 | DPID parent; /* If parent == 0 it's a top level group */
|
|---|
| 73 |
|
|---|
| 74 | ULONG uRef; /* Reference count */
|
|---|
| 75 |
|
|---|
| 76 | DPQ_HEAD(GroupList) groups; /* A group has [0..n] groups */
|
|---|
| 77 | DPQ_HEAD(PlayerList) players; /* A group has [0..n] players */
|
|---|
| 78 |
|
|---|
| 79 | DPID idGroupOwner; /* ID of player who owns the group */
|
|---|
| 80 |
|
|---|
| 81 | DWORD dwFlags; /* Flags describing anything special about the group */
|
|---|
| 82 |
|
|---|
| 83 | DPID dpid;
|
|---|
| 84 | DPNAME name;
|
|---|
| 85 |
|
|---|
| 86 | /* View of local data */
|
|---|
| 87 | LPVOID lpLocalData;
|
|---|
| 88 | DWORD dwLocalDataSize;
|
|---|
| 89 |
|
|---|
| 90 | /* View of remote data */
|
|---|
| 91 | LPVOID lpRemoteData;
|
|---|
| 92 | DWORD dwRemoteDataSize;
|
|---|
| 93 | };
|
|---|
| 94 | typedef struct GroupData GroupData;
|
|---|
| 95 | typedef struct GroupData* lpGroupData;
|
|---|
| 96 |
|
|---|
| 97 | struct GroupList
|
|---|
| 98 | {
|
|---|
| 99 | DPQ_ENTRY(GroupList) groups;
|
|---|
| 100 |
|
|---|
| 101 | lpGroupData lpGData;
|
|---|
| 102 | };
|
|---|
| 103 | typedef struct GroupList* lpGroupList;
|
|---|
| 104 |
|
|---|
| 105 | struct DPMSG
|
|---|
| 106 | {
|
|---|
| 107 | DPQ_ENTRY( DPMSG ) msgs;
|
|---|
| 108 | DPMSG_GENERIC* msg;
|
|---|
| 109 | };
|
|---|
| 110 | typedef struct DPMSG* LPDPMSG;
|
|---|
| 111 |
|
|---|
| 112 | /* Contains all dp1 and dp2 data members */
|
|---|
| 113 | typedef struct tagDirectPlay2Data
|
|---|
| 114 | {
|
|---|
| 115 | BOOL bConnectionOpen;
|
|---|
| 116 |
|
|---|
| 117 | /* For async EnumSessions requests */
|
|---|
| 118 | HANDLE hEnumSessionThread;
|
|---|
| 119 | HANDLE hKillEnumSessionThreadEvent;
|
|---|
| 120 |
|
|---|
| 121 | LPVOID lpNameServerData; /* DPlay interface doesn't know contents */
|
|---|
| 122 |
|
|---|
| 123 | BOOL bHostInterface; /* Did this interface create the session */
|
|---|
| 124 |
|
|---|
| 125 | lpGroupData lpSysGroup; /* System group with _everything_ in it */
|
|---|
| 126 |
|
|---|
| 127 | LPDPSESSIONDESC2 lpSessionDesc;
|
|---|
| 128 |
|
|---|
| 129 | /* I/O Msg queues */
|
|---|
| 130 | DPQ_HEAD( DPMSG ) receiveMsgs; /* Msg receive queue */
|
|---|
| 131 | DPQ_HEAD( DPMSG ) sendMsgs; /* Msg send pending queue */
|
|---|
| 132 |
|
|---|
| 133 | /* Information about the service provider active on this connection */
|
|---|
| 134 | SPINITDATA spData;
|
|---|
| 135 |
|
|---|
| 136 | /* Our service provider */
|
|---|
| 137 | HMODULE hServiceProvider;
|
|---|
| 138 |
|
|---|
| 139 | BOOL bConnectionInitialized;
|
|---|
| 140 |
|
|---|
| 141 |
|
|---|
| 142 | /* proof of concept for message reception */
|
|---|
| 143 | HANDLE hMsgReceipt;
|
|---|
| 144 | LPVOID lpMsgReceived;
|
|---|
| 145 | } DirectPlay2Data;
|
|---|
| 146 |
|
|---|
| 147 | typedef struct tagDirectPlay3Data
|
|---|
| 148 | {
|
|---|
| 149 | BOOL dummy;
|
|---|
| 150 | } DirectPlay3Data;
|
|---|
| 151 | typedef struct tagDirectPlay4Data
|
|---|
| 152 | {
|
|---|
| 153 | BOOL dummy;
|
|---|
| 154 | } DirectPlay4Data;
|
|---|
| 155 |
|
|---|
| 156 | #define DP_IMPL_FIELDS \
|
|---|
| 157 | ULONG ulInterfaceRef; \
|
|---|
| 158 | DirectPlayIUnknownData* unk; \
|
|---|
| 159 | DirectPlay2Data* dp2; \
|
|---|
| 160 | DirectPlay3Data* dp3; \
|
|---|
| 161 | DirectPlay4Data* dp4;
|
|---|
| 162 |
|
|---|
| 163 | struct IDirectPlay2Impl
|
|---|
| 164 | {
|
|---|
| 165 | ICOM_VFIELD(IDirectPlay2);
|
|---|
| 166 | DP_IMPL_FIELDS
|
|---|
| 167 | };
|
|---|
| 168 |
|
|---|
| 169 | struct IDirectPlay3Impl
|
|---|
| 170 | {
|
|---|
| 171 | ICOM_VFIELD(IDirectPlay3);
|
|---|
| 172 | DP_IMPL_FIELDS
|
|---|
| 173 | };
|
|---|
| 174 |
|
|---|
| 175 | struct IDirectPlay4Impl
|
|---|
| 176 | {
|
|---|
| 177 | ICOM_VFIELD(IDirectPlay4);
|
|---|
| 178 | DP_IMPL_FIELDS
|
|---|
| 179 | };
|
|---|
| 180 |
|
|---|
| 181 | /* Forward declarations of virtual tables */
|
|---|
| 182 | extern ICOM_VTABLE(IDirectPlay2) directPlay2AVT;
|
|---|
| 183 | extern ICOM_VTABLE(IDirectPlay3) directPlay3AVT;
|
|---|
| 184 | extern ICOM_VTABLE(IDirectPlay4) directPlay4AVT;
|
|---|
| 185 |
|
|---|
| 186 | extern ICOM_VTABLE(IDirectPlay2) directPlay2WVT;
|
|---|
| 187 | extern ICOM_VTABLE(IDirectPlay3) directPlay3WVT;
|
|---|
| 188 | extern ICOM_VTABLE(IDirectPlay4) directPlay4WVT;
|
|---|
| 189 |
|
|---|
| 190 |
|
|---|
| 191 | HRESULT DP_HandleMessage( IDirectPlay2Impl* This, LPCVOID lpMessageBody,
|
|---|
| 192 | DWORD dwMessageBodySize, LPCVOID lpMessageHeader,
|
|---|
| 193 | WORD wCommandId, WORD wVersion,
|
|---|
| 194 | LPVOID* lplpReply, LPDWORD lpdwMsgSize );
|
|---|
| 195 |
|
|---|
| 196 |
|
|---|
| 197 | #endif /* __WINE_DPLAY_GLOBAL_INCLUDED */
|
|---|