2002-03-10 00:29:33 +01:00
|
|
|
/*
|
|
|
|
* Copyright 2000 Peter Hunnisett
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2002-03-10 00:29:33 +01:00
|
|
|
*/
|
|
|
|
|
2000-08-25 23:58:05 +02:00
|
|
|
#ifndef __WINE_DPLAY_GLOBAL_INCLUDED
|
|
|
|
#define __WINE_DPLAY_GLOBAL_INCLUDED
|
|
|
|
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
2008-07-22 21:23:05 +02:00
|
|
|
#include "wine/dplaysp.h"
|
2001-04-12 23:10:54 +02:00
|
|
|
#include "lobbysp.h"
|
2000-08-25 23:58:05 +02:00
|
|
|
#include "dplayx_queue.h"
|
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
extern HRESULT DPL_EnumAddress( LPDPENUMADDRESSCALLBACK lpEnumAddressCallback,
|
|
|
|
LPCVOID lpAddress, DWORD dwAddressSize,
|
2011-05-13 17:05:24 +02:00
|
|
|
LPVOID lpContext ) DECLSPEC_HIDDEN;
|
2000-08-25 23:58:05 +02:00
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* Predeclare the interface implementation structures
|
|
|
|
*/
|
|
|
|
typedef struct IDirectPlay2Impl IDirectPlay2AImpl;
|
|
|
|
typedef struct IDirectPlay2Impl IDirectPlay2Impl;
|
|
|
|
typedef struct IDirectPlay3Impl IDirectPlay3AImpl;
|
|
|
|
typedef struct IDirectPlay3Impl IDirectPlay3Impl;
|
|
|
|
typedef struct IDirectPlay4Impl IDirectPlay4AImpl;
|
|
|
|
typedef struct IDirectPlay4Impl IDirectPlay4Impl;
|
|
|
|
|
|
|
|
typedef struct tagDirectPlayIUnknownData
|
|
|
|
{
|
2005-07-13 13:59:15 +02:00
|
|
|
LONG ulObjRef;
|
2000-08-25 23:58:05 +02:00
|
|
|
CRITICAL_SECTION DP_lock;
|
|
|
|
} DirectPlayIUnknownData;
|
|
|
|
|
|
|
|
typedef struct tagEnumSessionAsyncCallbackData
|
|
|
|
{
|
|
|
|
LPSPINITDATA lpSpData;
|
|
|
|
GUID requestGuid;
|
|
|
|
DWORD dwEnumSessionFlags;
|
|
|
|
DWORD dwTimeout;
|
|
|
|
HANDLE hSuicideRequest;
|
|
|
|
} EnumSessionAsyncCallbackData;
|
|
|
|
|
2000-10-19 22:20:58 +02:00
|
|
|
typedef struct tagDP_MSG_REPLY_STRUCT
|
|
|
|
{
|
|
|
|
HANDLE hReceipt;
|
|
|
|
WORD wExpectedReply;
|
|
|
|
LPVOID lpReplyMsg;
|
|
|
|
DWORD dwMsgBodySize;
|
|
|
|
/* FIXME: Is the message header required as well? */
|
|
|
|
} DP_MSG_REPLY_STRUCT, *LPDP_MSG_REPLY_STRUCT;
|
|
|
|
|
|
|
|
typedef struct tagDP_MSG_REPLY_STRUCT_LIST
|
|
|
|
{
|
2002-06-01 01:06:46 +02:00
|
|
|
DPQ_ENTRY(tagDP_MSG_REPLY_STRUCT_LIST) replysExpected;
|
2000-10-19 22:20:58 +02:00
|
|
|
DP_MSG_REPLY_STRUCT replyExpected;
|
|
|
|
} DP_MSG_REPLY_STRUCT_LIST, *LPDP_MSG_REPLY_STRUCT_LIST;
|
|
|
|
|
2000-08-25 23:58:05 +02:00
|
|
|
struct PlayerData
|
|
|
|
{
|
|
|
|
/* Individual player information */
|
|
|
|
DPID dpid;
|
|
|
|
|
|
|
|
DPNAME name;
|
|
|
|
HANDLE hEvent;
|
|
|
|
|
2000-08-30 01:55:06 +02:00
|
|
|
ULONG uRef; /* What is the reference count on this data? */
|
|
|
|
|
2000-08-25 23:58:05 +02:00
|
|
|
/* View of local data */
|
|
|
|
LPVOID lpLocalData;
|
|
|
|
DWORD dwLocalDataSize;
|
|
|
|
|
|
|
|
/* View of remote data */
|
|
|
|
LPVOID lpRemoteData;
|
|
|
|
DWORD dwRemoteDataSize;
|
|
|
|
|
2000-10-19 22:20:58 +02:00
|
|
|
/* SP data on a per player basis */
|
|
|
|
LPVOID lpSPPlayerData;
|
|
|
|
|
2000-08-25 23:58:05 +02:00
|
|
|
DWORD dwFlags; /* Special remarks about the type of player */
|
|
|
|
};
|
|
|
|
typedef struct PlayerData* lpPlayerData;
|
|
|
|
|
|
|
|
struct PlayerList
|
|
|
|
{
|
|
|
|
DPQ_ENTRY(PlayerList) players;
|
|
|
|
|
|
|
|
lpPlayerData lpPData;
|
|
|
|
};
|
|
|
|
typedef struct PlayerList* lpPlayerList;
|
|
|
|
|
|
|
|
struct GroupData
|
|
|
|
{
|
|
|
|
/* Internal information */
|
|
|
|
DPID parent; /* If parent == 0 it's a top level group */
|
|
|
|
|
2000-08-30 01:55:06 +02:00
|
|
|
ULONG uRef; /* Reference count */
|
|
|
|
|
2000-08-25 23:58:05 +02:00
|
|
|
DPQ_HEAD(GroupList) groups; /* A group has [0..n] groups */
|
|
|
|
DPQ_HEAD(PlayerList) players; /* A group has [0..n] players */
|
|
|
|
|
|
|
|
DPID idGroupOwner; /* ID of player who owns the group */
|
|
|
|
|
|
|
|
DWORD dwFlags; /* Flags describing anything special about the group */
|
|
|
|
|
|
|
|
DPID dpid;
|
|
|
|
DPNAME name;
|
|
|
|
|
|
|
|
/* View of local data */
|
|
|
|
LPVOID lpLocalData;
|
|
|
|
DWORD dwLocalDataSize;
|
|
|
|
|
|
|
|
/* View of remote data */
|
|
|
|
LPVOID lpRemoteData;
|
|
|
|
DWORD dwRemoteDataSize;
|
|
|
|
};
|
|
|
|
typedef struct GroupData GroupData;
|
|
|
|
typedef struct GroupData* lpGroupData;
|
|
|
|
|
|
|
|
struct GroupList
|
|
|
|
{
|
|
|
|
DPQ_ENTRY(GroupList) groups;
|
|
|
|
|
|
|
|
lpGroupData lpGData;
|
|
|
|
};
|
|
|
|
typedef struct GroupList* lpGroupList;
|
|
|
|
|
|
|
|
struct DPMSG
|
|
|
|
{
|
|
|
|
DPQ_ENTRY( DPMSG ) msgs;
|
|
|
|
DPMSG_GENERIC* msg;
|
|
|
|
};
|
|
|
|
typedef struct DPMSG* LPDPMSG;
|
|
|
|
|
2001-04-12 23:10:54 +02:00
|
|
|
enum SPSTATE
|
|
|
|
{
|
|
|
|
NO_PROVIDER = 0,
|
|
|
|
DP_SERVICE_PROVIDER = 1,
|
|
|
|
DP_LOBBY_PROVIDER = 2
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Contains all data members. FIXME: Rename me */
|
2000-08-25 23:58:05 +02:00
|
|
|
typedef struct tagDirectPlay2Data
|
|
|
|
{
|
|
|
|
BOOL bConnectionOpen;
|
|
|
|
|
|
|
|
/* For async EnumSessions requests */
|
|
|
|
HANDLE hEnumSessionThread;
|
|
|
|
HANDLE hKillEnumSessionThreadEvent;
|
2007-03-30 15:00:06 +02:00
|
|
|
DWORD dwEnumSessionLock;
|
2000-08-25 23:58:05 +02:00
|
|
|
|
|
|
|
LPVOID lpNameServerData; /* DPlay interface doesn't know contents */
|
|
|
|
|
|
|
|
BOOL bHostInterface; /* Did this interface create the session */
|
|
|
|
|
|
|
|
lpGroupData lpSysGroup; /* System group with _everything_ in it */
|
|
|
|
|
|
|
|
LPDPSESSIONDESC2 lpSessionDesc;
|
|
|
|
|
|
|
|
/* I/O Msg queues */
|
|
|
|
DPQ_HEAD( DPMSG ) receiveMsgs; /* Msg receive queue */
|
|
|
|
DPQ_HEAD( DPMSG ) sendMsgs; /* Msg send pending queue */
|
|
|
|
|
|
|
|
/* Information about the service provider active on this connection */
|
|
|
|
SPINITDATA spData;
|
2001-04-12 23:10:54 +02:00
|
|
|
BOOL bSPInitialized;
|
|
|
|
|
|
|
|
/* Information about the lobby server that's attached to this DP object */
|
|
|
|
SPDATA_INIT dplspData;
|
|
|
|
BOOL bDPLSPInitialized;
|
2000-08-25 23:58:05 +02:00
|
|
|
|
|
|
|
/* Our service provider */
|
|
|
|
HMODULE hServiceProvider;
|
|
|
|
|
2001-04-12 23:10:54 +02:00
|
|
|
/* Our DP lobby provider */
|
|
|
|
HMODULE hDPLobbyProvider;
|
|
|
|
|
|
|
|
enum SPSTATE connectionInitialized;
|
2000-08-30 01:55:06 +02:00
|
|
|
|
2000-10-19 22:20:58 +02:00
|
|
|
/* Expected messages queue */
|
|
|
|
DPQ_HEAD( tagDP_MSG_REPLY_STRUCT_LIST ) replysExpected;
|
2000-08-25 23:58:05 +02:00
|
|
|
} DirectPlay2Data;
|
|
|
|
|
|
|
|
typedef struct tagDirectPlay3Data
|
|
|
|
{
|
|
|
|
BOOL dummy;
|
|
|
|
} DirectPlay3Data;
|
|
|
|
typedef struct tagDirectPlay4Data
|
|
|
|
{
|
|
|
|
BOOL dummy;
|
|
|
|
} DirectPlay4Data;
|
|
|
|
|
|
|
|
#define DP_IMPL_FIELDS \
|
2005-07-13 13:59:15 +02:00
|
|
|
LONG ulInterfaceRef; \
|
2000-08-25 23:58:05 +02:00
|
|
|
DirectPlayIUnknownData* unk; \
|
|
|
|
DirectPlay2Data* dp2; \
|
|
|
|
DirectPlay3Data* dp3; \
|
|
|
|
DirectPlay4Data* dp4;
|
|
|
|
|
|
|
|
struct IDirectPlay2Impl
|
|
|
|
{
|
2005-06-01 21:57:42 +02:00
|
|
|
const IDirectPlay2Vtbl *lpVtbl;
|
2000-08-25 23:58:05 +02:00
|
|
|
DP_IMPL_FIELDS
|
|
|
|
};
|
|
|
|
|
|
|
|
struct IDirectPlay3Impl
|
|
|
|
{
|
2005-06-01 21:57:42 +02:00
|
|
|
const IDirectPlay3Vtbl *lpVtbl;
|
2000-08-25 23:58:05 +02:00
|
|
|
DP_IMPL_FIELDS
|
|
|
|
};
|
|
|
|
|
|
|
|
struct IDirectPlay4Impl
|
|
|
|
{
|
2005-06-01 21:57:42 +02:00
|
|
|
const IDirectPlay4Vtbl *lpVtbl;
|
2000-08-25 23:58:05 +02:00
|
|
|
DP_IMPL_FIELDS
|
|
|
|
};
|
|
|
|
|
2000-08-30 01:55:06 +02:00
|
|
|
HRESULT DP_HandleMessage( IDirectPlay2Impl* This, LPCVOID lpMessageBody,
|
|
|
|
DWORD dwMessageBodySize, LPCVOID lpMessageHeader,
|
2002-06-01 01:06:46 +02:00
|
|
|
WORD wCommandId, WORD wVersion,
|
2011-05-13 17:05:24 +02:00
|
|
|
LPVOID* lplpReply, LPDWORD lpdwMsgSize ) DECLSPEC_HIDDEN;
|
2000-08-30 01:55:06 +02:00
|
|
|
|
2000-10-19 22:20:58 +02:00
|
|
|
/* DP SP external interfaces into DirectPlay */
|
2011-05-13 17:05:24 +02:00
|
|
|
extern HRESULT DP_GetSPPlayerData( IDirectPlay2Impl* lpDP, DPID idPlayer, LPVOID* lplpData ) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT DP_SetSPPlayerData( IDirectPlay2Impl* lpDP, DPID idPlayer, LPVOID lpData ) DECLSPEC_HIDDEN;
|
2000-10-19 22:20:58 +02:00
|
|
|
|
|
|
|
/* DP external interfaces to call into DPSP interface */
|
2011-05-13 17:05:24 +02:00
|
|
|
extern LPVOID DPSP_CreateSPPlayerData(void) DECLSPEC_HIDDEN;
|
2000-08-30 01:55:06 +02:00
|
|
|
|
2000-08-25 23:58:05 +02:00
|
|
|
#endif /* __WINE_DPLAY_GLOBAL_INCLUDED */
|