ReactOS 0.4.17-dev-966-gf06eace
dplay_global.h File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wine/dplaysp.h"
#include "wine/list.h"
#include "lobbysp.h"
#include "dplayx_queue.h"
Include dependency graph for dplay_global.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  DPCONNECTION
 
struct  tagEnumSessionAsyncCallbackData
 
struct  tagDP_MSG_REPLY_STRUCT
 
struct  tagDP_MSG_REPLY_STRUCT_LIST
 
struct  PlayerData
 
struct  PlayerList
 
struct  GroupData
 
struct  GroupList
 
struct  DPMSG
 
struct  tagDirectPlay2Data
 
struct  IDirectPlayImpl
 

Typedefs

typedef struct tagEnumSessionAsyncCallbackData EnumSessionAsyncCallbackData
 
typedef struct tagDP_MSG_REPLY_STRUCT DP_MSG_REPLY_STRUCT
 
typedef struct tagDP_MSG_REPLY_STRUCT * LPDP_MSG_REPLY_STRUCT
 
typedef struct tagDP_MSG_REPLY_STRUCT_LIST DP_MSG_REPLY_STRUCT_LIST
 
typedef struct tagDP_MSG_REPLY_STRUCT_LIST * LPDP_MSG_REPLY_STRUCT_LIST
 
typedef struct PlayerData * lpPlayerData
 
typedef struct PlayerList * lpPlayerList
 
typedef struct GroupData GroupData
 
typedef struct GroupData * lpGroupData
 
typedef struct GroupList * lpGroupList
 
typedef DWORD FN_COPY_MESSAGE(DPMSG_GENERIC *genericDst, DPMSG_GENERIC *genericSrc, DWORD genericSize, BOOL ansi)
 
typedef struct DPMSG * LPDPMSG
 
typedef struct tagDirectPlay2Data DirectPlay2Data
 
typedef struct IDirectPlayImpl IDirectPlayImpl
 

Enumerations

enum  SPSTATE { NO_PROVIDER = 0 , DP_SERVICE_PROVIDER = 1 , DP_LOBBY_PROVIDER = 2 }
 

Functions

HRESULT DPL_EnumAddress (LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, LPCVOID lpAddress, DWORD dwAddressSize, LPVOID lpContext)
 
HRESULT DP_HandleMessage (IDirectPlayImpl *This, void *messageBody, DWORD dwMessageBodySize, void *messageHeader, WORD wCommandId, WORD wVersion, void **lplpReply, DWORD *lpdwMsgSize)
 
DPSESSIONDESC2 * DP_DuplicateSessionDesc (const DPSESSIONDESC2 *src, BOOL dstAnsi, BOOL srcAnsi)
 
HRESULT DP_HandleGameMessage (IDirectPlayImpl *This, void *messageBody, DWORD messageBodySize, DPID fromId, DPID toId)
 
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)
 
HRESULT DP_CreateGroup (IDirectPlayImpl *This, void *msgHeader, const DPID *lpid, const DPNAME *lpName, void *data, DWORD dataSize, DWORD dwFlags, DPID idParent, BOOL bAnsi)
 
HRESULT DP_AddPlayerToGroup (IDirectPlayImpl *This, DPID group, DPID player)
 
void DP_FreeConnections (void)
 
HRESULT DP_GetSPPlayerData (IDirectPlayImpl *lpDP, DPID idPlayer, void **lplpData)
 
HRESULT DP_SetSPPlayerData (IDirectPlayImpl *lpDP, DPID idPlayer, void *lpData)
 
LPVOID DPSP_CreateSPPlayerData (void)
 
HRESULT dplay_create (REFIID riid, void **ppv)
 
HRESULT dplobby_create (REFIID riid, void **ppv)
 
HRESULT dplaysp_create (REFIID riid, void **ppv, IDirectPlayImpl *dp)
 
HRESULT dplobbysp_create (REFIID riid, void **ppv, IDirectPlayImpl *dp)
 

Typedef Documentation

◆ DirectPlay2Data

◆ DP_MSG_REPLY_STRUCT

◆ DP_MSG_REPLY_STRUCT_LIST

◆ EnumSessionAsyncCallbackData

◆ FN_COPY_MESSAGE

typedef DWORD FN_COPY_MESSAGE(DPMSG_GENERIC *genericDst, DPMSG_GENERIC *genericSrc, DWORD genericSize, BOOL ansi)

Definition at line 150 of file dplay_global.h.

◆ GroupData

Definition at line 139 of file dplay_global.h.

◆ IDirectPlayImpl

◆ LPDP_MSG_REPLY_STRUCT

◆ LPDP_MSG_REPLY_STRUCT_LIST

◆ LPDPMSG

typedef struct DPMSG* LPDPMSG

Definition at line 162 of file dplay_global.h.

◆ lpGroupData

Definition at line 140 of file dplay_global.h.

◆ lpGroupList

Definition at line 148 of file dplay_global.h.

◆ lpPlayerData

Definition at line 100 of file dplay_global.h.

◆ lpPlayerList

Definition at line 108 of file dplay_global.h.

Enumeration Type Documentation

◆ SPSTATE

Enumerator
NO_PROVIDER 
DP_SERVICE_PROVIDER 
DP_LOBBY_PROVIDER 

Definition at line 164 of file dplay_global.h.

165{
166 NO_PROVIDER = 0,
169};
@ DP_LOBBY_PROVIDER
Definition: dplay_global.h:168
@ NO_PROVIDER
Definition: dplay_global.h:166
@ DP_SERVICE_PROVIDER
Definition: dplay_global.h:167

Function Documentation

◆ DP_AddPlayerToGroup()

HRESULT DP_AddPlayerToGroup ( IDirectPlayImpl *  This,
DPID  group,
DPID  player 
)

Definition at line 1210 of file dplay.c.

1212{
1213 DPMSG_ADDPLAYERTOGROUP addPlayerToGroupMsg;
1214 lpGroupData gdata;
1216 lpPlayerList newplist;
1217 HRESULT hr;
1218
1219 /* Find the group */
1220 if ( ( gdata = DP_FindAnyGroup( This, group ) ) == NULL )
1221 return DPERR_INVALIDGROUP;
1222
1223 /* Find the player */
1224 if ( ( plist = DP_FindPlayer( This, player ) ) == NULL )
1225 return DPERR_INVALIDPLAYER;
1226
1227 /* Create a player list (ie "shortcut" ) */
1228 newplist = calloc( 1, sizeof( *newplist ) );
1229 if ( !newplist )
1230 return DPERR_CANTADDPLAYER;
1231
1232 /* Add the shortcut */
1233 plist->lpPData->uRef++;
1234 newplist->lpPData = plist->lpPData;
1235
1236 /* Add the player to the list of players for this group */
1237 DPQ_INSERT(gdata->players, newplist, players);
1238
1239 /* Let the SP know that we've added a player to the group */
1240 if ( This->dp2->spData.lpCB->AddPlayerToGroup )
1241 {
1243
1244 TRACE( "Calling SP AddPlayerToGroup\n" );
1245
1246 data.idPlayer = player;
1247 data.idGroup = group;
1248 data.lpISP = This->dp2->spData.lpISP;
1249
1250 hr = (*This->dp2->spData.lpCB->AddPlayerToGroup)( &data );
1251 if ( FAILED( hr ) )
1252 {
1253 DPQ_REMOVE( gdata->players, newplist, players );
1254 --plist->lpPData->uRef;
1255 free( newplist );
1256 return hr;
1257 }
1258 }
1259
1260 addPlayerToGroupMsg.dwType = DPSYS_ADDPLAYERTOGROUP;
1261 addPlayerToGroupMsg.dpIdGroup = group;
1262 addPlayerToGroupMsg.dpIdPlayer = player;
1263
1264 hr = DP_QueueMessage( This, DPID_SYSMSG, DPID_ALLPLAYERS, 0, &addPlayerToGroupMsg,
1266 if ( FAILED( hr ) )
1267 {
1268 if ( This->dp2->spData.lpCB->RemovePlayerFromGroup )
1269 {
1271 data.idPlayer = player;
1272 data.idGroup = group;
1273 data.lpISP = This->dp2->spData.lpISP;
1274 This->dp2->spData.lpCB->RemovePlayerFromGroup( &data );
1275 }
1276 DPQ_REMOVE( gdata->players, newplist, players );
1277 --plist->lpPData->uRef;
1278 free( newplist );
1279 return hr;
1280 }
1281
1282 return DP_OK;
#define free
Definition: debug_ros.c:5
HRESULT hr
Definition: delayimp.cpp:582
#define NULL
Definition: types.h:112
static lpGroupData DP_FindAnyGroup(IDirectPlayImpl *This, DPID dpid)
Definition: dplay.c:1554
static HRESULT DP_QueueMessage(IDirectPlayImpl *This, DPID fromId, DPID toId, DPID excludeId, void *msg, FN_COPY_MESSAGE *copyMessage, DWORD genericSize)
Definition: dplay.c:361
static DWORD DP_CopyGeneric(DPMSG_GENERIC *genericDst, DPMSG_GENERIC *genericSrc, DWORD genericSize, BOOL ansi)
Definition: dplay.c:390
static lpPlayerList DP_FindPlayer(IDirectPlayImpl *This, DPID dpid)
Definition: dplay.c:2002
#define DPERR_CANTADDPLAYER
Definition: dplay.h:93
#define DPERR_INVALIDGROUP
Definition: dplay.h:105
#define DPID_SYSMSG
Definition: dplay.h:161
#define DP_OK
Definition: dplay.h:88
#define DPERR_INVALIDPLAYER
Definition: dplay.h:104
#define DPID_ALLPLAYERS
Definition: dplay.h:162
#define DPSYS_ADDPLAYERTOGROUP
Definition: dplay.h:1091
#define DPQ_INSERT(a, b, c)
Definition: dplayx_queue.h:34
#define DPQ_REMOVE(head, elm, field)
Definition: dplayx_queue.h:82
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLboolean GLuint group
Definition: glext.h:11120
#define FAILED(hr)
Definition: intsafe.h:51
#define calloc
Definition: rosglue.h:14
static Parse plist[]
Definition: dwarfinfo.c:339
#define TRACE(s)
Definition: solgame.cpp:4
lpPlayerData lpPData
Definition: dplay_global.h:106

Referenced by DP_MSG_ForwardPlayerCreation(), and IDirectPlay4Impl_AddPlayerToGroup().

◆ DP_CreateGroup()

HRESULT DP_CreateGroup ( IDirectPlayImpl *  This,
void *  msgHeader,
const DPID *  lpid,
const DPNAME *  lpName,
void *  data,
DWORD  dataSize,
DWORD  dwFlags,
DPID  idParent,
BOOL  bAnsi 
)

Definition at line 1386 of file dplay.c.

1390{
1391 struct GroupList *groupList = NULL;
1392 struct GroupData *parent = NULL;
1393 lpGroupData lpGData;
1394 HRESULT hr;
1395
1396 if( DPID_SYSTEM_GROUP != *lpid )
1397 {
1398 parent = DP_FindAnyGroup( This, idParent );
1399 if( !parent )
1400 return DPERR_INVALIDGROUP;
1401 }
1402
1403 /* Allocate the new space and add to end of high level group list */
1404 lpGData = calloc( 1, sizeof( *lpGData ) );
1405
1406 if( lpGData == NULL )
1407 {
1408 return DPERR_OUTOFMEMORY;
1409 }
1410
1411 DPQ_INIT(lpGData->groups);
1412 DPQ_INIT(lpGData->players);
1413
1414 /* Set the desired player ID - no sanity checking to see if it exists */
1415 lpGData->dpid = *lpid;
1416
1417 lpGData->name = DP_DuplicateName( lpName, FALSE, bAnsi );
1418 if ( !lpGData->name )
1419 {
1420 free( lpGData );
1421 return DPERR_OUTOFMEMORY;
1422 }
1423
1424 lpGData->nameA = DP_DuplicateName( lpName, TRUE, bAnsi );
1425 if ( !lpGData->nameA )
1426 {
1427 free( lpGData->name );
1428 free( lpGData );
1429 return DPERR_OUTOFMEMORY;
1430 }
1431
1432 lpGData->parent = idParent;
1433
1434 /* FIXME: Should we validate the dwFlags? */
1435 lpGData->dwFlags = dwFlags;
1436
1437 /* Initialize the SP data section */
1439 if ( !lpGData->lpSPPlayerData )
1440 {
1441 free( lpGData->nameA );
1442 free( lpGData->name );
1443 free( lpGData );
1444 return DPERR_OUTOFMEMORY;
1445 }
1446
1447 if( DPID_SYSTEM_GROUP == *lpid )
1448 {
1449 This->dp2->lpSysGroup = lpGData;
1450 TRACE( "Inserting system group\n" );
1451 }
1452 else
1453 {
1454 /* Insert into the parent group */
1455 groupList = calloc( 1, sizeof( *groupList ) );
1456 if( !groupList )
1457 {
1458 free( lpGData->nameA );
1459 free( lpGData->name );
1460 free( lpGData );
1461 return DPERR_OUTOFMEMORY;
1462 }
1463 groupList->lpGData = lpGData;
1464
1465 DPQ_INSERT( parent->groups, groupList, groups );
1466 }
1467
1468 /* Something is now referencing this data */
1469 lpGData->uRef++;
1470
1472
1473 /* FIXME: We should only create the system group if GetCaps returns
1474 * DPCAPS_GROUPOPTIMIZED.
1475 */
1476
1477 /* Let the SP know that we've created this group */
1478 if( This->dp2->spData.lpCB->CreateGroup )
1479 {
1481 DWORD dwCreateFlags = 0;
1482
1483 TRACE( "Calling SP CreateGroup\n" );
1484
1485 if( !parent )
1486 dwCreateFlags |= DPLAYI_GROUP_SYSGROUP;
1487
1488 if( !msgHeader )
1489 dwCreateFlags |= DPLAYI_PLAYER_PLAYERLOCAL;
1490
1491 if( dwFlags & DPGROUP_HIDDEN )
1492 dwCreateFlags |= DPLAYI_GROUP_HIDDEN;
1493
1494 data.idGroup = *lpid;
1495 data.dwFlags = dwCreateFlags;
1496 data.lpSPMessageHeader = msgHeader;
1497 data.lpISP = This->dp2->spData.lpISP;
1498
1499 hr = (*This->dp2->spData.lpCB->CreateGroup)( &data );
1500 if( FAILED( hr ) )
1501 {
1502 if( groupList )
1503 {
1504 DPQ_REMOVE( parent->groups, groupList, groups );
1505 free( groupList );
1506 }
1507 else
1508 {
1509 This->dp2->lpSysGroup = NULL;
1510 }
1511 free( lpGData->nameA );
1512 free( lpGData->name );
1513 free( lpGData );
1514 return hr;
1515 }
1516 }
1517
1518 TRACE( "Created group id 0x%08lx\n", *lpid );
1519
1520 return DP_OK;
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define DPID_SYSTEM_GROUP
Definition: dplay.c:75
static void DP_SetGroupData(lpGroupData lpGData, DWORD dwFlags, LPVOID lpData, DWORD dwDataSize)
Definition: dplay.c:1707
static DPNAME * DP_DuplicateName(const DPNAME *src, BOOL dstAnsi, BOOL srcAnsi)
Definition: dplay.c:2044
#define DPGROUP_HIDDEN
Definition: dplay.h:1013
#define DPSET_REMOTE
Definition: dplay.h:1056
#define DPERR_OUTOFMEMORY
Definition: dplay.h:109
LPVOID DPSP_CreateSPPlayerData(void)
Definition: dplaysp.c:721
#define DPLAYI_GROUP_HIDDEN
Definition: dplaysp.h:63
#define DPLAYI_GROUP_SYSGROUP
Definition: dplaysp.h:60
#define DPLAYI_PLAYER_PLAYERLOCAL
Definition: dplaysp.h:59
#define DPQ_INIT(head)
Definition: dplayx_queue.h:54
r parent
Definition: btrfs.c:3010
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizei GLuint * groups
Definition: glext.h:11113
GLenum GLsizei dataSize
Definition: glext.h:11123
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
Definition: netsh.h:141
LPVOID lpSPPlayerData
Definition: dplay_global.h:137
DWORD dwFlags
Definition: dplay_global.h:122
DPNAME * nameA
Definition: dplay_global.h:126
ULONG uRef
Definition: dplay_global.h:115
DPNAME * name
Definition: dplay_global.h:125
lpGroupData lpGData
Definition: dplay_global.h:146
_In_ LPCSTR lpName
Definition: winbase.h:2519

Referenced by DP_IF_CreateGroup(), DP_IF_CreateGroupInGroup(), and DP_MSG_ForwardPlayerCreation().

◆ DP_CreatePlayer()

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 at line 1823 of file dplay.c.

1827{
1828 lpPlayerData lpPData;
1829 lpPlayerList lpPList;
1830 HRESULT hr;
1831
1832 TRACE( "(%p)->(%p,%p,%u)\n", This, lpid, lpName, bAnsi );
1833
1834 /* Allocate the storage for the player and associate it with list element */
1835 lpPData = calloc( 1, sizeof( *lpPData ) );
1836 if( lpPData == NULL )
1837 return DPERR_OUTOFMEMORY;
1838
1839 /* Set the desired player ID */
1840 lpPData->dpid = *lpid;
1841
1842 lpPData->name = DP_DuplicateName( lpName, FALSE, bAnsi );
1843 if ( !lpPData->name )
1844 {
1845 free( lpPData );
1846 return DPERR_OUTOFMEMORY;
1847 }
1848
1849 lpPData->nameA = DP_DuplicateName( lpName, TRUE, bAnsi );
1850 if ( !lpPData->nameA )
1851 {
1852 free( lpPData->name );
1853 free( lpPData );
1854 return DPERR_OUTOFMEMORY;
1855 }
1856
1857 lpPData->dwFlags = dwFlags;
1858
1859 /* If we were given an event handle, duplicate it */
1860 if( hEvent != 0 )
1861 {
1863 GetCurrentProcess(), &lpPData->hEvent,
1865 )
1866 {
1867 /* FIXME: Memory leak */
1868 ERR( "Can't duplicate player msg handle %p\n", hEvent );
1869 }
1870 }
1871
1872 /* Initialize the SP data section */
1874
1875 /* Create the list object and link it in */
1876 lpPList = calloc( 1, sizeof( *lpPList ) );
1877 if( !lpPList )
1878 {
1879 free( lpPData->lpSPPlayerData );
1880 CloseHandle( lpPData->hEvent );
1881 free( lpPData->nameA );
1882 free( lpPData->name );
1883 free( lpPData );
1884 return DPERR_OUTOFMEMORY;
1885 }
1886
1887 lpPData->uRef = 1;
1888 lpPList->lpPData = lpPData;
1889
1890 /* Add the player to the system group */
1891 DPQ_INSERT( This->dp2->lpSysGroup->players, lpPList, players );
1892
1894
1895 hr = IDirectPlaySP_SetSPPlayerData( This->dp2->spData.lpISP, *lpid, spData, spDataSize,
1896 DPSET_REMOTE );
1897 if ( FAILED( hr ) )
1898 {
1899 free( lpPData->lpRemoteData );
1900 DPQ_REMOVE( This->dp2->lpSysGroup->players, lpPList, players );
1901 free( lpPList );
1902 free( lpPData->lpSPPlayerData );
1903 CloseHandle( lpPData->hEvent );
1904 free( lpPData->nameA );
1905 free( lpPData->name );
1906 free( lpPData );
1907 return hr;
1908 }
1909
1910 hr = DP_CreateSPPlayer( This, *lpid, dwFlags, msgHeader );
1911 if ( FAILED( hr ) )
1912 {
1913 free( lpPData->lpRemoteData );
1914 DPQ_REMOVE( This->dp2->lpSysGroup->players, lpPList, players );
1915 free( lpPList );
1916 free( lpPData->lpSPPlayerData );
1917 CloseHandle( lpPData->hEvent );
1918 free( lpPData->nameA );
1919 free( lpPData->name );
1920 free( lpPData );
1921 return hr;
1922 }
1923
1925 {
1927 DWORD currentPlayers;
1928
1929 currentPlayers = This->dp2->lpSessionDesc->dwCurrentPlayers;
1931 ++currentPlayers;
1932
1934 msg.dwPlayerType = DPPLAYERTYPE_PLAYER;
1935 msg.dpId = *lpid;
1936 msg.dwCurrentPlayers = currentPlayers;
1937 msg.lpData = data;
1938 msg.dwDataSize = dataSize;
1939 msg.dpnName = *lpPData->name;
1940 msg.dpIdParent = 0;
1941 msg.dwFlags = dwFlags;
1942
1945 if ( FAILED( hr ) )
1946 {
1947 DP_DeleteSPPlayer( This, *lpid );
1948 free( lpPData->lpLocalData );
1949 free( lpPData->lpRemoteData );
1950 DPQ_REMOVE( This->dp2->lpSysGroup->players, lpPList, players );
1951 free( lpPList );
1952 CloseHandle( lpPData->hEvent );
1953 free( lpPData->nameA );
1954 free( lpPData->name );
1955 free( lpPData );
1956 return hr;
1957 }
1958
1959 This->dp2->lpSessionDesc->dwCurrentPlayers++;
1960 }
1961
1962 TRACE( "Created player id 0x%08lx\n", *lpid );
1963
1964 if( playerData )
1965 *playerData = lpPData;
1966
1967 return DP_OK;
#define msg(x)
Definition: auth_time.c:54
#define ERR(fmt,...)
Definition: precomp.h:57
#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
static HRESULT DP_CreateSPPlayer(IDirectPlayImpl *This, DPID dpid, DWORD flags, void *msgHeader)
Definition: dplay.c:1748
static DWORD DP_CopyCreatePlayerOrGroup(DPMSG_GENERIC *genericDst, DPMSG_GENERIC *genericSrc, DWORD genericSize, BOOL ansi)
Definition: dplay.c:401
static void DP_SetPlayerData(lpPlayerData lpPData, DWORD dwFlags, LPVOID lpData, DWORD dwDataSize)
Definition: dplay.c:2061
static void DP_DeleteSPPlayer(IDirectPlayImpl *This, DPID dpid)
Definition: dplay.c:1803
#define DPPLAYERTYPE_PLAYER
Definition: dplay.h:1135
#define DPSYS_CREATEPLAYERORGROUP
Definition: dplay.h:1085
#define IDirectPlaySP_SetSPPlayerData(p, a, b, c, d)
Definition: dplaysp.h:106
#define DPLAYI_PLAYER_SYSPLAYER
Definition: dplaysp.h:56
static HANDLE hEvent
Definition: comm.c:54
ULONG uRef
Definition: dplay_global.h:85
LPVOID lpRemoteData
Definition: dplay_global.h:92
LPVOID lpSPPlayerData
Definition: dplay_global.h:96
LPVOID lpLocalData
Definition: dplay_global.h:88
DPNAME * nameA
Definition: dplay_global.h:82
DPNAME * name
Definition: dplay_global.h:81
HANDLE hEvent
Definition: dplay_global.h:83
DWORD dwFlags
Definition: dplay_global.h:98
#define DUPLICATE_SAME_ACCESS

Referenced by DP_HandleMessage(), DP_IF_CreatePlayer(), DP_MSG_ForwardPlayerCreation(), and DP_SecureOpen().

◆ DP_DuplicateSessionDesc()

DPSESSIONDESC2 * DP_DuplicateSessionDesc ( const DPSESSIONDESC2 *  src,
BOOL  dstAnsi,
BOOL  srcAnsi 
)

Definition at line 4579 of file dplay.c.

4581{
4583 DWORD size;
4584
4585 size = DP_CopySessionDesc( NULL, src, dstAnsi, srcAnsi );
4586
4587 dst = malloc( size );
4588 if ( !dst )
4589 return NULL;
4590
4591 DP_CopySessionDesc( dst, src, dstAnsi, srcAnsi );
4592
4593 return dst;
#define malloc
Definition: debug_ros.c:4
static DWORD DP_CopySessionDesc(LPDPSESSIONDESC2 destSessionDesc, LPCDPSESSIONDESC2 srcSessDesc, BOOL dstAnsi, BOOL srcAnsi)
Definition: dplay.c:4563
GLenum src
Definition: glext.h:6340
GLsizeiptr size
Definition: glext.h:5919
GLenum GLenum dst
Definition: glext.h:6340

Referenced by DP_SecureOpen(), DP_SetSessionDesc(), and NS_AddRemoteComputerAsNameServer().

◆ DP_FreeConnections()

void DP_FreeConnections ( void  )

Definition at line 5133 of file dplay.c.

5135{
5136 struct list *connections;
5137
5139 return;
5140
5142
5143 while ( !list_empty( connections ) )
5144 {
5146
5147 list_remove( &connection->entry );
5148 free( connection->nameA.lpszShortNameA );
5149 free( connection->name.lpszShortName );
5150 free( connection->path );
5151 free( connection->address );
5152 free( connection );
5153 }
static void list_remove(struct list_entry *entry)
Definition: list.h:90
static int list_empty(struct list_entry *head)
Definition: list.h:58
Definition: list.h:39
static const WCHAR connections[]
Definition: connections.c:41
HINTERNET connection
Definition: port.c:65
static struct list * DP_GetConnections(void)
Definition: dplay.c:5123
static BOOL connectionsInitialized
Definition: dplay.c:5106
uint32_t entry
Definition: isohybrid.c:63
__WINE_SERVER_LIST_INLINE struct list * list_tail(const struct list *list)
Definition: list.h:139
#define LIST_ENTRY(type)
Definition: queue.h:175

Referenced by DllMain().

◆ DP_GetSPPlayerData()

HRESULT DP_GetSPPlayerData ( IDirectPlayImpl *  lpDP,
DPID  idPlayer,
void **  lplpData 
)

Definition at line 6462 of file dplay.c.

6464{
6465 struct GroupData *group;
6466 lpPlayerList lpPlayer;
6467
6468 EnterCriticalSection( &lpDP->lock );
6469
6470 lpPlayer = DP_FindPlayer( lpDP, idPlayer );
6471 if( lpPlayer )
6472 {
6473 *lplpData = lpPlayer->lpPData->lpSPPlayerData;
6474 LeaveCriticalSection( &lpDP->lock );
6475 return DP_OK;
6476 }
6477
6478 group = DP_FindAnyGroup( lpDP, idPlayer );
6479 if( group )
6480 {
6481 *lplpData = group->lpSPPlayerData;
6482 LeaveCriticalSection( &lpDP->lock );
6483 return DP_OK;
6484 }
6485
6486 LeaveCriticalSection( &lpDP->lock );
6487
6488 return DPERR_INVALIDPLAYER;
CRITICAL_SECTION lock
Definition: dplay_global.h:224
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)

Referenced by IDirectPlaySPImpl_GetSPPlayerData(), and IDirectPlaySPImpl_SetSPPlayerData().

◆ DP_HandleGameMessage()

HRESULT DP_HandleGameMessage ( IDirectPlayImpl *  This,
void *  messageBody,
DWORD  messageBodySize,
DPID  fromId,
DPID  toId 
)

Definition at line 695 of file dplay.c.

698{
700 DWORD msgSize;
701 HRESULT hr;
702
703 TRACE( "(%p)->(%p,0x%08lx,0x%08lx,0x%08lx)\n", This, messageBody, messageBodySize, fromId, toId );
704
705 msg = (DPMSG_GENERIC *) ((char *) messageBody + sizeof( DPMSG_SYSMSGENVELOPE ));
706 msgSize = messageBodySize - sizeof( DPMSG_SYSMSGENVELOPE );
707
708 EnterCriticalSection( &This->lock );
709
710 hr = DP_QueueMessage( This, fromId, toId, 0, msg, DP_CopyGeneric, msgSize );
711
712 LeaveCriticalSection( &This->lock );
713
714 return hr;
struct tagDPMSG_SYSMSGENVELOPE DPMSG_SYSMSGENVELOPE

Referenced by IDirectPlaySPImpl_HandleMessage().

◆ DP_HandleMessage()

HRESULT DP_HandleMessage ( IDirectPlayImpl *  This,
void *  messageBody,
DWORD  dwMessageBodySize,
void *  messageHeader,
WORD  wCommandId,
WORD  wVersion,
void **  lplpReply,
DWORD *  lpdwMsgSize 
)

Definition at line 453 of file dplay.c.

457{
458 TRACE( "(%p)->(%p,0x%08lx,%p,%u,%u)\n",
459 This, messageBody, dwMessageBodySize, messageHeader, wCommandId,
460 wVersion );
461
462 switch( wCommandId )
463 {
464 /* Name server needs to handle this request */
466 /* Reply expected */
467 NS_ReplyToEnumSessionsRequest( messageBody, lplpReply, lpdwMsgSize, This );
468 break;
469
470 /* Name server needs to handle this request */
472 EnterCriticalSection( &This->lock );
473
474 /* No reply expected */
476 This->dp2->spData.dwSPHeaderSize,
477 messageBody,
478 dwMessageBodySize,
479 This->dp2->lpNameServerData );
480
481 LeaveCriticalSection( &This->lock );
482 break;
483
485 {
486 LPCDPMSG_REQUESTNEWPLAYERID lpcMsg = messageBody;
487
489
490 *lpdwMsgSize = This->dp2->spData.dwSPHeaderSize + sizeof( *lpReply );
491
492 *lplpReply = calloc( 1, *lpdwMsgSize );
493
494 FIXME( "Ignoring dwFlags 0x%08lx in request msg\n",
495 lpcMsg->dwFlags );
496
497 /* Setup the reply */
498 lpReply = (LPDPMSG_NEWPLAYERIDREPLY)( (BYTE*)(*lplpReply) +
499 This->dp2->spData.dwSPHeaderSize );
500
503 lpReply->envelope.wVersion = DPMSGVER_DP6;
504
505 lpReply->dpidNewPlayerId = DP_NextObjectId();
506
507 TRACE( "Allocating new playerid 0x%08lx from remote request\n",
508 lpReply->dpidNewPlayerId );
509 break;
510 }
511
514 DPPLAYERINFO playerInfo;
515 DWORD offset = 0;
516 HRESULT hr;
517
518 if( dwMessageBodySize < sizeof( DPMSG_CREATESESSION ) )
519 return DPERR_GENERIC;
520 msg = (DPMSG_CREATESESSION *)messageBody;
521 offset += sizeof( DPMSG_CREATESESSION );
522
523 hr = DP_MSG_ReadPackedPlayer( (char *)messageBody, &offset, dwMessageBodySize, &playerInfo );
524 if ( FAILED( hr ) )
525 return hr;
526
527 if ( dwMessageBodySize - offset < 6 )
528 return DPERR_GENERIC;
529
530 EnterCriticalSection( &This->lock );
531
532 if ( !This->dp2->bConnectionOpen )
533 {
534 LeaveCriticalSection( &This->lock );
535 return DP_OK;
536 }
537
538 hr = DP_CreatePlayer( This, messageHeader, &msg->playerId, &playerInfo.name,
539 playerInfo.playerData, playerInfo.playerDataLength, playerInfo.spData,
540 playerInfo.spDataLength, playerInfo.flags & ~DPLAYI_PLAYER_PLAYERLOCAL,
541 NULL, NULL, FALSE );
542
543 if ( FAILED( hr ) )
544 {
545 LeaveCriticalSection( &This->lock );
546 return hr;
547 }
548
549 LeaveCriticalSection( &This->lock );
550
551 break;
552 }
553
558 DP_MSG_ReplyReceived( This, wCommandId, messageBody, dwMessageBodySize, messageHeader );
559 break;
560
562 DPMSG_SETPLAYERORGROUPDATA setPlayerOrGroupDataMsg;
564 struct GroupData *group;
565 HRESULT hr;
566 void *data;
567
568 if( dwMessageBodySize < sizeof( DPSP_MSG_GROUPDATACHANGED ) )
569 return DPERR_GENERIC;
570 msg = (DPSP_MSG_GROUPDATACHANGED *)messageBody;
571
572 if( dwMessageBodySize < msg->dataOffset )
573 return DPERR_GENERIC;
574 if( dwMessageBodySize - msg->dataOffset < msg->dataSize )
575 return DPERR_GENERIC;
576 data = (char *)messageBody + msg->dataOffset;
577
578 EnterCriticalSection( &This->lock );
579
580 if( !This->dp2->bConnectionOpen )
581 {
582 LeaveCriticalSection( &This->lock );
583 return DP_OK;
584 }
585
586 group = DP_FindAnyGroup( This, msg->groupId );
587 if( !group )
588 {
589 LeaveCriticalSection( &This->lock );
590 return DPERR_GENERIC;
591 }
592
593 DP_SetGroupData( group, DPSET_REMOTE, data, msg->dataSize );
594
595 setPlayerOrGroupDataMsg.dwType = DPSYS_SETPLAYERORGROUPDATA;
596 setPlayerOrGroupDataMsg.dwPlayerType = DPPLAYERTYPE_GROUP;
597 setPlayerOrGroupDataMsg.dpId = msg->groupId;
598 setPlayerOrGroupDataMsg.lpData = data;
599 setPlayerOrGroupDataMsg.dwDataSize = msg->dataSize;
600
601 hr = DP_QueueMessage( This, DPID_SYSMSG, DPID_ALLPLAYERS, 0, &setPlayerOrGroupDataMsg,
603 if ( FAILED( hr ) )
604 {
605 LeaveCriticalSection( &This->lock );
606 return hr;
607 }
608
609 LeaveCriticalSection( &This->lock );
610
611 break;
612 }
613
615 TRACE( "GOT THE SELF MESSAGE: %p -> 0x%08lx\n", messageHeader, ((const DWORD *)messageHeader)[1] );
616 NS_SetLocalAddr( This->dp2->lpNameServerData, messageHeader, 20 );
617 DP_MSG_ReplyReceived( This, wCommandId, messageBody, dwMessageBodySize, messageHeader );
618
620 TRACE( "Sending message to self to get my addr\n" );
621 DP_MSG_ToSelf( This, 1 ); /* This is a hack right now */
622 break;
623
624 case DPMSGCMD_PING: {
625 const DPSP_MSG_PING *msg;
626
627 if( dwMessageBodySize < sizeof( DPSP_MSG_PING ) )
628 return DPERR_GENERIC;
629 msg = (const DPSP_MSG_PING *)messageBody;
630
631 EnterCriticalSection( &This->lock );
632
633 if ( !This->dp2->bConnectionOpen )
634 {
635 LeaveCriticalSection( &This->lock );
636 return DP_OK;
637 }
638
639 LeaveCriticalSection( &This->lock );
640
641 DP_MSG_SendPingReply( This, msg->fromId, This->dp2->systemPlayerId, msg->tickCount );
642
643 break;
644 }
645
646 case DPMSGCMD_ADDFORWARD: {
648 DPPLAYERINFO playerInfo;
649 DWORD offset = 0;
650 HRESULT hr;
651
652 if( dwMessageBodySize < sizeof( DPSP_MSG_ADDFORWARD ) )
653 return DPERR_GENERIC;
654 msg = (DPSP_MSG_ADDFORWARD *) messageBody;
655 offset += sizeof( DPSP_MSG_ADDFORWARD );
656
657 hr = DP_MSG_ReadPackedPlayer( (char *) messageBody, &offset, dwMessageBodySize, &playerInfo );
658 if ( FAILED( hr ) )
659 return hr;
660
661 EnterCriticalSection( &This->lock );
662
663 if ( !This->dp2->bConnectionOpen )
664 {
665 LeaveCriticalSection( &This->lock );
666 return DP_OK;
667 }
668
669 hr = DP_CreatePlayer( This, messageHeader, &msg->playerId, &playerInfo.name,
670 playerInfo.playerData, playerInfo.playerDataLength, playerInfo.spData,
671 playerInfo.spDataLength, playerInfo.flags & ~DPLAYI_PLAYER_PLAYERLOCAL,
672 NULL, NULL, FALSE );
673 if ( FAILED( hr ) )
674 {
675 LeaveCriticalSection( &This->lock );
676 return hr;
677 }
678
679 LeaveCriticalSection( &This->lock );
680
681 DP_MSG_SendAddForwardAck( This, msg->playerId );
682
683 break;
684 }
685
686 default:
687 FIXME( "Unknown wCommandId %u. Ignoring message\n", wCommandId );
688 break;
689 }
690
691 /* FIXME: There is code in dplaysp.c to handle dplay commands. Move to here. */
692
693 return DP_OK;
#define FIXME(fmt,...)
Definition: precomp.h:53
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
static DWORD DP_CopySetPlayerOrGroupData(DPMSG_GENERIC *genericDst, DPMSG_GENERIC *genericSrc, DWORD genericSize, BOOL ansi)
Definition: dplay.c:429
static DPID DP_NextObjectId(void)
Definition: dplay.c:255
#define DPERR_GENERIC
Definition: dplay.h:99
#define DPPLAYERTYPE_GROUP
Definition: dplay.h:1134
#define DPSYS_SETPLAYERORGROUPDATA
Definition: dplay.h:1103
HRESULT DP_MSG_ReadPackedPlayer(char *data, DWORD *inoutOffset, DWORD maxSize, DPPLAYERINFO *playerInfo)
void DP_MSG_ReplyReceived(IDirectPlayImpl *This, WORD wCommandId, const void *lpcMsgBody, DWORD dwMsgBodySize, const void *msgHeader)
void DP_MSG_ToSelf(IDirectPlayImpl *This, DPID dpidSelf)
HRESULT DP_MSG_SendPingReply(IDirectPlayImpl *This, DPID toId, DPID fromId, DWORD tickCount)
HRESULT DP_MSG_SendAddForwardAck(IDirectPlayImpl *This, DPID id)
#define DPMSGCMD_GROUPDATACHANGED
#define DPMSGCMD_SUPERENUMPLAYERSREPLY
#define DPMSGVER_DP6
#define DPMSGCMD_ENUMSESSIONSREQUEST
#define DPMSGCMD_CREATESESSION
#define DPMSGCMD_PING
#define DPMSGCMD_GETNAMETABLEREPLY
struct tagDPMSG_CREATESESSION DPMSG_CREATESESSION
#define DPMSGCMD_FORWARDADDPLAYER
#define DPMSGCMD_ENUMSESSIONSREPLY
#define DPMSGCMD_REQUESTNEWPLAYERID
#define DPMSGCMD_NEWPLAYERIDREPLY
#define DPMSGCMD_ADDFORWARD
#define DPMSGCMD_JUSTENVELOPE
#define DPMSGCMD_FORWARDADDPLAYERNACK
struct tagDPMSG_NEWPLAYERIDREPLY * LPDPMSG_NEWPLAYERIDREPLY
#define DPMSGMAGIC_DPLAYMSG
GLintptr offset
Definition: glext.h:5920
void NS_ReplyToEnumSessionsRequest(const void *lpcMsg, void **lplpReplyData, DWORD *lpdwReplySize, IDirectPlayImpl *lpDP)
Definition: name_server.c:371
void NS_AddRemoteComputerAsNameServer(LPCVOID lpcNSAddrHdr, DWORD dwHdrSize, LPCDPMSG_ENUMSESSIONSREPLY lpcMsg, DWORD msgSize, LPVOID lpNSInfo)
Definition: name_server.c:101
void NS_SetLocalAddr(LPVOID lpNSInfo, LPCVOID lpHdr, DWORD dwHdrSize)
Definition: name_server.c:180
DWORD playerDataLength
DPMSG_SENDENVELOPE envelope
unsigned char BYTE
Definition: xxhash.c:193

Referenced by IDirectPlaySPImpl_HandleMessage().

◆ DP_SetSPPlayerData()

HRESULT DP_SetSPPlayerData ( IDirectPlayImpl *  lpDP,
DPID  idPlayer,
void *  lpData 
)

Definition at line 6490 of file dplay.c.

6492{
6493 struct GroupData *group;
6494 lpPlayerList lpPlayer;
6495
6496 EnterCriticalSection( &lpDP->lock );
6497
6498 lpPlayer = DP_FindPlayer( lpDP, idPlayer );
6499 if( lpPlayer )
6500 {
6501 lpPlayer->lpPData->lpSPPlayerData = lpData;
6502 LeaveCriticalSection( &lpDP->lock );
6503 return DP_OK;
6504 }
6505
6506 group = DP_FindAnyGroup( lpDP, idPlayer );
6507 if( group )
6508 {
6509 group->lpSPPlayerData = lpData;
6510 LeaveCriticalSection( &lpDP->lock );
6511 return DP_OK;
6512 }
6513
6514 LeaveCriticalSection( &lpDP->lock );
6515
6516 return DPERR_INVALIDPLAYER;

Referenced by IDirectPlaySPImpl_SetSPPlayerData().

◆ DPL_EnumAddress()

HRESULT DPL_EnumAddress ( LPDPENUMADDRESSCALLBACK  lpEnumAddressCallback,
LPCVOID  lpAddress,
DWORD  dwAddressSize,
LPVOID  lpContext 
)

Definition at line 368 of file dplobby.c.

370{
371 DWORD dwTotalSizeEnumerated = 0;
372
373 /* FIXME: First chunk is always the total size chunk - Should we report it? */
374
375 while ( dwTotalSizeEnumerated < dwAddressSize )
376 {
377 const DPADDRESS* lpElements = lpAddress;
378 DWORD dwSizeThisEnumeration;
379
380 /* Invoke the enum method. If false is returned, stop enumeration */
381 if ( !lpEnumAddressCallback( &lpElements->guidDataType,
382 lpElements->dwDataSize,
383 (const BYTE *)lpElements + sizeof( DPADDRESS ),
384 lpContext ) )
385 {
386 break;
387 }
388
389 dwSizeThisEnumeration = sizeof( DPADDRESS ) + lpElements->dwDataSize;
390 lpAddress = (const BYTE*) lpAddress + dwSizeThisEnumeration;
391 dwTotalSizeEnumerated += dwSizeThisEnumeration;
392 }
393
394 return DP_OK;
395}
struct tagDPADDRESS DPADDRESS
GUID guidDataType
Definition: dplobby.h:252
DWORD dwDataSize
Definition: dplobby.h:253

Referenced by IDirectPlay4Impl_InitializeConnection(), IDirectPlayLobby3AImpl_EnumAddress(), IDirectPlayLobby3Impl_EnumAddress(), and IDirectPlaySPImpl_EnumAddress().

◆ dplay_create()

HRESULT dplay_create ( REFIID  riid,
void **  ppv 
)

Definition at line 6428 of file dplay.c.

6430{
6432 HRESULT hr;
6433
6434 TRACE( "(%s, %p)\n", debugstr_guid( riid ), ppv );
6435
6436 *ppv = NULL;
6437 obj = malloc( sizeof( *obj ) );
6438 if ( !obj )
6439 return DPERR_OUTOFMEMORY;
6440
6441 obj->IDirectPlay_iface.lpVtbl = &dp_vt;
6442 obj->IDirectPlay2A_iface.lpVtbl = &dp2A_vt;
6443 obj->IDirectPlay2_iface.lpVtbl = &dp2_vt;
6444 obj->IDirectPlay3A_iface.lpVtbl = &dp3A_vt;
6445 obj->IDirectPlay3_iface.lpVtbl = &dp3_vt;
6446 obj->IDirectPlay4A_iface.lpVtbl = &dp4A_vt;
6447 obj->IDirectPlay4_iface.lpVtbl = &dp4_vt;
6448 obj->ref = 1;
6449
6451 obj->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": IDirectPlayImpl.lock");
6452
6453 if ( DP_CreateDirectPlay2( obj ) )
6454 hr = IDirectPlayX_QueryInterface( &obj->IDirectPlay4_iface, riid, ppv );
6455 else
6457 IDirectPlayX_Release( &obj->IDirectPlay4_iface );
6458
6459 return hr;
BOOL WINAPI InitializeCriticalSectionEx(OUT LPCRITICAL_SECTION lpCriticalSection, IN DWORD dwSpinCount, IN DWORD flags)
Definition: sync.c:107
static BOOL DP_CreateDirectPlay2(LPVOID lpDP)
Definition: dplay.c:122
static const IDirectPlay4Vtbl dp4_vt
Definition: dplay.c:6314
static const IDirectPlay2Vtbl dp2_vt
Definition: dplay.c:6140
static const IDirectPlay3Vtbl dp3_vt
Definition: dplay.c:6212
static const IDirectPlay2Vtbl dp2A_vt
Definition: dplay.c:6176
static const IDirectPlay3Vtbl dp3A_vt
Definition: dplay.c:6263
static const IDirectPlayVtbl dp_vt
Definition: dplay.c:916
static const IDirectPlay4Vtbl dp4A_vt
Definition: dplay.c:6371
#define IDirectPlayX_Release(p)
Definition: dplay.h:866
#define IDirectPlayX_QueryInterface(p, a, b)
Definition: dplay.h:864
#define DPERR_NOMEMORY
Definition: dplay.h:108
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
#define DWORD_PTR
Definition: treelist.c:76
#define RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO
Definition: winnt_old.h:1156

Referenced by DirectPlayCreate(), and DPL_ConnectEx().

◆ dplaysp_create()

HRESULT dplaysp_create ( REFIID  riid,
void **  ppv,
IDirectPlayImpl *  dp 
)

Definition at line 696 of file dplaysp.c.

697{
699 HRESULT hr;
700
701 TRACE( "(%s, %p)\n", debugstr_guid( riid ), ppv );
702
703 *ppv = NULL;
704 obj = calloc( 1, sizeof( *obj ) );
705 if ( !obj )
706 return DPERR_OUTOFMEMORY;
707
708 obj->IDirectPlaySP_iface.lpVtbl = &directPlaySPVT;
709 obj->ref = 1;
710 obj->dplay = dp;
711
712 hr = IDirectPlaySP_QueryInterface( &obj->IDirectPlaySP_iface, riid, ppv );
713 IDirectPlaySP_Release( &obj->IDirectPlaySP_iface );
714
715 return hr;
716}
static const IDirectPlaySPVtbl directPlaySPVT
Definition: dplaysp.c:677
#define IDirectPlaySP_QueryInterface(p, a, b)
Definition: dplaysp.h:95
#define IDirectPlaySP_Release(p)
Definition: dplaysp.h:97

Referenced by DP_CreateDirectPlay2().

◆ dplobby_create()

HRESULT dplobby_create ( REFIID  riid,
void **  ppv 
)

Definition at line 1401 of file dplobby.c.

1402{
1404 HRESULT hr;
1405
1406 TRACE( "(%s, %p)\n", debugstr_guid( riid ), ppv );
1407
1408 *ppv = NULL;
1409 obj = malloc( sizeof( *obj ) );
1410 if ( !obj )
1411 return DPERR_OUTOFMEMORY;
1412
1413 obj->IDirectPlayLobby3_iface.lpVtbl = &dpl3_vt;
1414 obj->IDirectPlayLobby3A_iface.lpVtbl = &dpl3A_vt;
1415 obj->msgtid = 0;
1416 obj->ref = 1;
1417
1419 obj->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": IDirectPlayLobbyImpl.lock");
1420 DPQ_INIT( obj->msgs );
1421
1422 hr = IDirectPlayLobby_QueryInterface( &obj->IDirectPlayLobby3_iface, riid, ppv );
1423 IDirectPlayLobby_Release( &obj->IDirectPlayLobby3_iface );
1424
1425 return hr;
1426}
static const IDirectPlayLobby3Vtbl dpl3_vt
Definition: dplobby.c:1378
static const IDirectPlayLobby3Vtbl dpl3A_vt
Definition: dplobby.c:1355
#define IDirectPlayLobby_Release(p)
Definition: dplobby.h:456
#define IDirectPlayLobby_QueryInterface(p, a, b)
Definition: dplobby.h:454

Referenced by DirectPlayLobbyCreateA(), and DirectPlayLobbyCreateW().

◆ dplobbysp_create()

HRESULT dplobbysp_create ( REFIID  riid,
void **  ppv,
IDirectPlayImpl *  dp 
)

Definition at line 230 of file lobbysp.c.

231{
233 HRESULT hr;
234
235 TRACE( "(%s, %p)\n", debugstr_guid( riid ), ppv );
236
237 *ppv = NULL;
238 obj = malloc( sizeof( *obj ) );
239 if ( !obj )
240 return DPERR_OUTOFMEMORY;
241
242 obj->IDPLobbySP_iface.lpVtbl = &dpLobbySPVT;
243 obj->ref = 1;
244 obj->dplay = dp;
245
246 hr = IDPLobbySP_QueryInterface( &obj->IDPLobbySP_iface, riid, ppv );
247 IDPLobbySP_Release( &obj->IDPLobbySP_iface );
248
249 return hr;
250}
static const IDPLobbySPVtbl dpLobbySPVT
Definition: lobbysp.c:207
#define IDPLobbySP_QueryInterface(p, a, b)
Definition: lobbysp.h:492
#define IDPLobbySP_Release(p)
Definition: lobbysp.h:494

Referenced by DP_CreateDirectPlay2().

◆ DPSP_CreateSPPlayerData()

LPVOID DPSP_CreateSPPlayerData ( void  )

Definition at line 721 of file dplaysp.c.

722{
723 TRACE( "Creating SPPlayer data struct\n" );
724 return calloc( 1, sizeof( DP_SPPLAYERDATA ) );
725}

Referenced by DP_CreateGroup(), and DP_CreatePlayer().