ReactOS  0.4.14-dev-593-g1793dcc
dplay.c File Reference
#include <stdarg.h>
#include <string.h>
#include "windef.h"
#include "winerror.h"
#include "winbase.h"
#include "winnt.h"
#include "winreg.h"
#include "winnls.h"
#include "wine/debug.h"
#include "dplayx_global.h"
#include "name_server.h"
#include "dplayx_queue.h"
#include "wine/dplaysp.h"
#include "dplay_global.h"
Include dependency graph for dplay.c:

Go to the source code of this file.

Classes

struct  _DPRGOPContext
 
struct  _DPFAGContext
 
struct  tagCreateEnum
 

Macros

#define COBJMACROS
 
#define NONAMELESSUNION
 
#define DPID_NOPARENT_GROUP   0 /* Magic number to indicate no parent of group */
 
#define DPID_SYSTEM_GROUP
 
#define DPID_NAME_SERVER   0x19a9d65b /* Don't ask me why */
 
#define DPMSG_CREATEGROUP_DWFLAGS(x)   ( (x) & DPGROUP_HIDDEN )
 
#define DPMSG_CREATEPLAYER_DWFLAGS(x)   0
 

Typedefs

typedef struct _DPRGOPContext DPRGOPContext
 
typedef struct _DPRGOPContextlpDPRGOPContext
 
typedef struct _DPFAGContext DPFAGContext
 
typedef struct _DPFAGContextlpDPFAGContext
 
typedef struct tagCreateEnum CreateEnumData
 
typedef struct tagCreateEnumlpCreateEnumData
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (dplay)
 
HRESULT DPL_CreateCompoundAddress (LPCDPCOMPOUNDADDRESSELEMENT lpElements, DWORD dwElementCount, LPVOID lpAddress, LPDWORD lpdwAddressSize, BOOL bAnsiInterface)
 
static lpPlayerList DP_FindPlayer (IDirectPlayImpl *This, DPID dpid)
 
static BOOL DP_CopyDPNAMEStruct (LPDPNAME lpDst, const DPNAME *lpSrc, BOOL bAnsi)
 
static void DP_SetGroupData (lpGroupData lpGData, DWORD dwFlags, LPVOID lpData, DWORD dwDataSize)
 
static void DP_DeleteDPNameStruct (LPDPNAME lpDPName)
 
static BOOL CALLBACK cbDeletePlayerFromAllGroups (DPID dpId, DWORD dwPlayerType, LPCDPNAME lpName, DWORD dwFlags, LPVOID lpContext)
 
static lpGroupData DP_FindAnyGroup (IDirectPlayImpl *This, DPID dpid)
 
static HRESULT DP_SetSessionDesc (IDirectPlayImpl *This, const DPSESSIONDESC2 *lpSessDesc, DWORD dwFlags, BOOL bInitial, BOOL bAnsi)
 
static HRESULT DP_SP_SendEx (IDirectPlayImpl *This, DWORD dwFlags, void *lpData, DWORD dwDataSize, DWORD dwPriority, DWORD dwTimeout, void *lpContext, DWORD *lpdwMsgID)
 
static BOOL DP_BuildSPCompoundAddr (LPGUID lpcSpGuid, LPVOID *lplpAddrBuf, LPDWORD lpdwBufSize)
 
static DPID DP_GetRemoteNextObjectId (void)
 
static DWORD DP_CalcSessionDescSize (LPCDPSESSIONDESC2 lpSessDesc, BOOL bAnsi)
 
static void DP_CopySessionDesc (LPDPSESSIONDESC2 destSessionDesc, LPCDPSESSIONDESC2 srcSessDesc, BOOL bAnsi)
 
static IDirectPlayImplimpl_from_IDirectPlay (IDirectPlay *iface)
 
static IDirectPlayImplimpl_from_IDirectPlay2 (IDirectPlay2 *iface)
 
static IDirectPlayImplimpl_from_IDirectPlay2A (IDirectPlay2A *iface)
 
static IDirectPlayImplimpl_from_IDirectPlay3A (IDirectPlay3A *iface)
 
static IDirectPlayImplimpl_from_IDirectPlay3 (IDirectPlay3 *iface)
 
static IDirectPlayImplimpl_from_IDirectPlay4A (IDirectPlay4A *iface)
 
static IDirectPlayImplimpl_from_IDirectPlay4 (IDirectPlay4 *iface)
 
static BOOL DP_CreateDirectPlay2 (LPVOID lpDP)
 
 DPQ_DECL_DELETECB (cbDeleteElemFromHeap, LPVOID)
 
static BOOL DP_DestroyDirectPlay2 (LPVOID lpDP)
 
static void dplay_destroy (IDirectPlayImpl *obj)
 
static DPID DP_NextObjectId (void)
 
HRESULT DP_HandleMessage (IDirectPlayImpl *This, const void *lpcMessageBody, DWORD dwMessageBodySize, const void *lpcMessageHeader, WORD wCommandId, WORD wVersion, void **lplpReply, DWORD *lpdwMsgSize)
 
static HRESULT WINAPI IDirectPlayImpl_QueryInterface (IDirectPlay *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI IDirectPlayImpl_AddRef (IDirectPlay *iface)
 
static ULONG WINAPI IDirectPlayImpl_Release (IDirectPlay *iface)
 
static HRESULT WINAPI IDirectPlayImpl_AddPlayerToGroup (IDirectPlay *iface, DPID group, DPID player)
 
static HRESULT WINAPI IDirectPlayImpl_Close (IDirectPlay *iface)
 
static HRESULT WINAPI IDirectPlayImpl_CreatePlayer (IDirectPlay *iface, DPID *player, LPSTR name, LPSTR fullname, HANDLE *event)
 
static HRESULT WINAPI IDirectPlayImpl_CreateGroup (IDirectPlay *iface, DPID *group, LPSTR name, LPSTR fullname)
 
static HRESULT WINAPI IDirectPlayImpl_DeletePlayerFromGroup (IDirectPlay *iface, DPID group, DPID player)
 
static HRESULT WINAPI IDirectPlayImpl_DestroyPlayer (IDirectPlay *iface, DPID player)
 
static HRESULT WINAPI IDirectPlayImpl_DestroyGroup (IDirectPlay *iface, DPID group)
 
static HRESULT WINAPI IDirectPlayImpl_EnableNewPlayers (IDirectPlay *iface, BOOL enable)
 
static HRESULT WINAPI IDirectPlayImpl_EnumGroupPlayers (IDirectPlay *iface, DPID group, LPDPENUMPLAYERSCALLBACK enumplayercb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlayImpl_EnumGroups (IDirectPlay *iface, DWORD session, LPDPENUMPLAYERSCALLBACK enumplayercb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlayImpl_EnumPlayers (IDirectPlay *iface, DWORD session, LPDPENUMPLAYERSCALLBACK enumplayercb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlayImpl_EnumSessions (IDirectPlay *iface, DPSESSIONDESC *sdesc, DWORD timeout, LPDPENUMSESSIONSCALLBACK enumsessioncb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlayImpl_GetCaps (IDirectPlay *iface, DPCAPS *caps)
 
static HRESULT WINAPI IDirectPlayImpl_GetMessageCount (IDirectPlay *iface, DPID player, DWORD *count)
 
static HRESULT WINAPI IDirectPlayImpl_GetPlayerCaps (IDirectPlay *iface, DPID player, DPCAPS *caps)
 
static HRESULT WINAPI IDirectPlayImpl_GetPlayerName (IDirectPlay *iface, DPID player, LPSTR name, DWORD *size_name, LPSTR fullname, DWORD *size_fullname)
 
static HRESULT WINAPI IDirectPlayImpl_Initialize (IDirectPlay *iface, GUID *guid)
 
static HRESULT WINAPI IDirectPlayImpl_Open (IDirectPlay *iface, DPSESSIONDESC *sdesc)
 
static HRESULT WINAPI IDirectPlayImpl_Receive (IDirectPlay *iface, DPID *from, DPID *to, DWORD flags, void *data, DWORD *size)
 
static HRESULT WINAPI IDirectPlayImpl_SaveSession (IDirectPlay *iface, LPSTR reserved)
 
static HRESULT WINAPI IDirectPlayImpl_Send (IDirectPlay *iface, DPID from, DPID to, DWORD flags, void *data, DWORD size)
 
static HRESULT WINAPI IDirectPlayImpl_SetPlayerName (IDirectPlay *iface, DPID player, LPSTR name, LPSTR fullname)
 
static HRESULT WINAPI IDirectPlay2AImpl_QueryInterface (IDirectPlay2A *iface, REFIID riid, void **ppv)
 
static HRESULT WINAPI IDirectPlay2Impl_QueryInterface (IDirectPlay2 *iface, REFIID riid, void **ppv)
 
static HRESULT WINAPI IDirectPlay3AImpl_QueryInterface (IDirectPlay3A *iface, REFIID riid, void **ppv)
 
static HRESULT WINAPI IDirectPlay3Impl_QueryInterface (IDirectPlay3 *iface, REFIID riid, void **ppv)
 
static HRESULT WINAPI IDirectPlay4AImpl_QueryInterface (IDirectPlay4A *iface, REFIID riid, void **ppv)
 
static HRESULT WINAPI IDirectPlay4Impl_QueryInterface (IDirectPlay4 *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI IDirectPlay2AImpl_AddRef (IDirectPlay2A *iface)
 
static ULONG WINAPI IDirectPlay2Impl_AddRef (IDirectPlay2 *iface)
 
static ULONG WINAPI IDirectPlay3AImpl_AddRef (IDirectPlay3A *iface)
 
static ULONG WINAPI IDirectPlay3Impl_AddRef (IDirectPlay3 *iface)
 
static ULONG WINAPI IDirectPlay4AImpl_AddRef (IDirectPlay4A *iface)
 
static ULONG WINAPI IDirectPlay4Impl_AddRef (IDirectPlay4 *iface)
 
static ULONG WINAPI IDirectPlay2AImpl_Release (IDirectPlay2A *iface)
 
static ULONG WINAPI IDirectPlay2Impl_Release (IDirectPlay2 *iface)
 
static ULONG WINAPI IDirectPlay3AImpl_Release (IDirectPlay3A *iface)
 
static ULONG WINAPI IDirectPlay3Impl_Release (IDirectPlay3 *iface)
 
static ULONG WINAPI IDirectPlay4AImpl_Release (IDirectPlay4A *iface)
 
static ULONG WINAPI IDirectPlay4Impl_Release (IDirectPlay4 *iface)
 
static HRESULT WINAPI IDirectPlay2AImpl_AddPlayerToGroup (IDirectPlay2A *iface, DPID group, DPID player)
 
static HRESULT WINAPI IDirectPlay2Impl_AddPlayerToGroup (IDirectPlay2 *iface, DPID group, DPID player)
 
static HRESULT WINAPI IDirectPlay3AImpl_AddPlayerToGroup (IDirectPlay3A *iface, DPID group, DPID player)
 
static HRESULT WINAPI IDirectPlay3Impl_AddPlayerToGroup (IDirectPlay3 *iface, DPID group, DPID player)
 
static HRESULT WINAPI IDirectPlay4AImpl_AddPlayerToGroup (IDirectPlay4A *iface, DPID group, DPID player)
 
static HRESULT WINAPI IDirectPlay4Impl_AddPlayerToGroup (IDirectPlay4 *iface, DPID group, DPID player)
 
static HRESULT WINAPI IDirectPlay2AImpl_Close (IDirectPlay2A *iface)
 
static HRESULT WINAPI IDirectPlay2Impl_Close (IDirectPlay2 *iface)
 
static HRESULT WINAPI IDirectPlay3AImpl_Close (IDirectPlay3A *iface)
 
static HRESULT WINAPI IDirectPlay3Impl_Close (IDirectPlay3 *iface)
 
static HRESULT WINAPI IDirectPlay4AImpl_Close (IDirectPlay4A *iface)
 
static HRESULT WINAPI IDirectPlay4Impl_Close (IDirectPlay4 *iface)
 
static lpGroupData DP_CreateGroup (IDirectPlayImpl *This, const DPID *lpid, const DPNAME *lpName, DWORD dwFlags, DPID idParent, BOOL bAnsi)
 
static void DP_DeleteGroup (IDirectPlayImpl *This, DPID dpid)
 
static HRESULT DP_IF_CreateGroup (IDirectPlayImpl *This, void *lpMsgHdr, DPID *lpidGroup, DPNAME *lpGroupName, void *lpData, DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi)
 
static HRESULT WINAPI IDirectPlay2AImpl_CreateGroup (IDirectPlay2A *iface, DPID *lpidGroup, DPNAME *name, void *data, DWORD size, DWORD flags)
 
static HRESULT WINAPI IDirectPlay2Impl_CreateGroup (IDirectPlay2 *iface, DPID *lpidGroup, DPNAME *name, void *data, DWORD size, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3AImpl_CreateGroup (IDirectPlay3A *iface, DPID *group, DPNAME *name, void *data, DWORD size, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3Impl_CreateGroup (IDirectPlay3 *iface, DPID *lpidGroup, DPNAME *name, void *data, DWORD size, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4AImpl_CreateGroup (IDirectPlay4A *iface, DPID *lpidGroup, DPNAME *lpGroupName, void *lpData, DWORD dwDataSize, DWORD dwFlags)
 
static HRESULT WINAPI IDirectPlay4Impl_CreateGroup (IDirectPlay4 *iface, DPID *lpidGroup, DPNAME *lpGroupName, void *lpData, DWORD dwDataSize, DWORD dwFlags)
 
static lpPlayerData DP_CreatePlayer (IDirectPlayImpl *This, DPID *lpid, DPNAME *lpName, DWORD dwFlags, HANDLE hEvent, BOOL bAnsi)
 
static void DP_DeletePlayer (IDirectPlayImpl *This, DPID dpid)
 
static void DP_SetPlayerData (lpPlayerData lpPData, DWORD dwFlags, LPVOID lpData, DWORD dwDataSize)
 
static HRESULT DP_IF_CreatePlayer (IDirectPlayImpl *This, void *lpMsgHdr, DPID *lpidPlayer, DPNAME *lpPlayerName, HANDLE hEvent, void *lpData, DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi)
 
static HRESULT WINAPI IDirectPlay2AImpl_CreatePlayer (IDirectPlay2A *iface, DPID *lpidPlayer, DPNAME *name, HANDLE event, void *data, DWORD size, DWORD flags)
 
static HRESULT WINAPI IDirectPlay2Impl_CreatePlayer (IDirectPlay2 *iface, DPID *lpidPlayer, DPNAME *name, HANDLE event, void *data, DWORD size, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3AImpl_CreatePlayer (IDirectPlay3A *iface, DPID *lpidPlayer, DPNAME *name, HANDLE event, void *data, DWORD size, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3Impl_CreatePlayer (IDirectPlay3 *iface, DPID *lpidPlayer, DPNAME *name, HANDLE event, void *data, DWORD size, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4AImpl_CreatePlayer (IDirectPlay4A *iface, DPID *lpidPlayer, DPNAME *lpPlayerName, HANDLE hEvent, void *lpData, DWORD dwDataSize, DWORD dwFlags)
 
static HRESULT WINAPI IDirectPlay4Impl_CreatePlayer (IDirectPlay4 *iface, DPID *lpidPlayer, DPNAME *lpPlayerName, HANDLE hEvent, void *lpData, DWORD dwDataSize, DWORD dwFlags)
 
static HRESULT WINAPI IDirectPlay2AImpl_DeletePlayerFromGroup (IDirectPlay2A *iface, DPID group, DPID player)
 
static HRESULT WINAPI IDirectPlay2Impl_DeletePlayerFromGroup (IDirectPlay2 *iface, DPID group, DPID player)
 
static HRESULT WINAPI IDirectPlay3AImpl_DeletePlayerFromGroup (IDirectPlay3A *iface, DPID group, DPID player)
 
static HRESULT WINAPI IDirectPlay3Impl_DeletePlayerFromGroup (IDirectPlay3 *iface, DPID group, DPID player)
 
static HRESULT WINAPI IDirectPlay4AImpl_DeletePlayerFromGroup (IDirectPlay4A *iface, DPID group, DPID player)
 
static HRESULT WINAPI IDirectPlay4Impl_DeletePlayerFromGroup (IDirectPlay4 *iface, DPID group, DPID player)
 
static BOOL CALLBACK cbRemoveGroupOrPlayer (DPID dpId, DWORD dwPlayerType, LPCDPNAME lpName, DWORD dwFlags, LPVOID lpContext)
 
static HRESULT DP_IF_DestroyGroup (IDirectPlayImpl *This, void *lpMsgHdr, DPID idGroup, BOOL bAnsi)
 
static HRESULT WINAPI IDirectPlay2AImpl_DestroyGroup (IDirectPlay2A *iface, DPID group)
 
static HRESULT WINAPI IDirectPlay2Impl_DestroyGroup (IDirectPlay2 *iface, DPID group)
 
static HRESULT WINAPI IDirectPlay3AImpl_DestroyGroup (IDirectPlay3A *iface, DPID group)
 
static HRESULT WINAPI IDirectPlay3Impl_DestroyGroup (IDirectPlay3 *iface, DPID group)
 
static HRESULT WINAPI IDirectPlay4AImpl_DestroyGroup (IDirectPlay4A *iface, DPID idGroup)
 
static HRESULT WINAPI IDirectPlay4Impl_DestroyGroup (IDirectPlay4 *iface, DPID idGroup)
 
static HRESULT DP_IF_DestroyPlayer (IDirectPlayImpl *This, void *lpMsgHdr, DPID idPlayer, BOOL bAnsi)
 
static HRESULT WINAPI IDirectPlay2AImpl_DestroyPlayer (IDirectPlay2A *iface, DPID player)
 
static HRESULT WINAPI IDirectPlay2Impl_DestroyPlayer (IDirectPlay2 *iface, DPID player)
 
static HRESULT WINAPI IDirectPlay3AImpl_DestroyPlayer (IDirectPlay3A *iface, DPID player)
 
static HRESULT WINAPI IDirectPlay3Impl_DestroyPlayer (IDirectPlay3 *iface, DPID player)
 
static HRESULT WINAPI IDirectPlay4AImpl_DestroyPlayer (IDirectPlay4A *iface, DPID idPlayer)
 
static HRESULT WINAPI IDirectPlay4Impl_DestroyPlayer (IDirectPlay4 *iface, DPID idPlayer)
 
static HRESULT WINAPI IDirectPlay2AImpl_EnumGroupPlayers (IDirectPlay2A *iface, DPID group, GUID *instance, LPDPENUMPLAYERSCALLBACK2 enumplayercb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlay2Impl_EnumGroupPlayers (IDirectPlay2 *iface, DPID group, GUID *instance, LPDPENUMPLAYERSCALLBACK2 enumplayercb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3AImpl_EnumGroupPlayers (IDirectPlay3A *iface, DPID group, GUID *instance, LPDPENUMPLAYERSCALLBACK2 enumplayercb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3Impl_EnumGroupPlayers (IDirectPlay3 *iface, DPID group, GUID *instance, LPDPENUMPLAYERSCALLBACK2 enumplayercb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4AImpl_EnumGroupPlayers (IDirectPlay4A *iface, DPID group, GUID *instance, LPDPENUMPLAYERSCALLBACK2 enumplayercb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4Impl_EnumGroupPlayers (IDirectPlay4 *iface, DPID group, GUID *instance, LPDPENUMPLAYERSCALLBACK2 enumplayercb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlay2AImpl_EnumGroups (IDirectPlay2A *iface, GUID *instance, LPDPENUMPLAYERSCALLBACK2 enumplayercb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlay2Impl_EnumGroups (IDirectPlay2 *iface, GUID *instance, LPDPENUMPLAYERSCALLBACK2 enumplayercb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3AImpl_EnumGroups (IDirectPlay3A *iface, GUID *instance, LPDPENUMPLAYERSCALLBACK2 enumplayercb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3Impl_EnumGroups (IDirectPlay3 *iface, GUID *instance, LPDPENUMPLAYERSCALLBACK2 enumplayercb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4AImpl_EnumGroups (IDirectPlay4A *iface, GUID *instance, LPDPENUMPLAYERSCALLBACK2 enumplayercb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4Impl_EnumGroups (IDirectPlay4 *iface, GUID *instance, LPDPENUMPLAYERSCALLBACK2 enumplayercb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlay2AImpl_EnumPlayers (IDirectPlay2A *iface, GUID *instance, LPDPENUMPLAYERSCALLBACK2 enumplayercb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlay2Impl_EnumPlayers (IDirectPlay2 *iface, GUID *instance, LPDPENUMPLAYERSCALLBACK2 enumplayercb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3AImpl_EnumPlayers (IDirectPlay3A *iface, GUID *instance, LPDPENUMPLAYERSCALLBACK2 enumplayercb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3Impl_EnumPlayers (IDirectPlay3 *iface, GUID *instance, LPDPENUMPLAYERSCALLBACK2 enumplayercb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4AImpl_EnumPlayers (IDirectPlay4A *iface, GUID *instance, LPDPENUMPLAYERSCALLBACK2 enumplayercb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4Impl_EnumPlayers (IDirectPlay4 *iface, GUID *instance, LPDPENUMPLAYERSCALLBACK2 enumplayercb, void *context, DWORD flags)
 
static void DP_InvokeEnumSessionCallbacks (LPDPENUMSESSIONSCALLBACK2 lpEnumSessionsCallback2, LPVOID lpNSInfo, DWORD dwTimeout, LPVOID lpContext)
 
static DWORD CALLBACK DP_EnumSessionsSendAsyncRequestThread (LPVOID lpContext)
 
static void DP_KillEnumSessionThread (IDirectPlayImpl *This)
 
static HRESULT WINAPI IDirectPlay2AImpl_EnumSessions (IDirectPlay2A *iface, DPSESSIONDESC2 *sdesc, DWORD timeout, LPDPENUMSESSIONSCALLBACK2 enumsessioncb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlay2Impl_EnumSessions (IDirectPlay2 *iface, DPSESSIONDESC2 *sdesc, DWORD timeout, LPDPENUMSESSIONSCALLBACK2 enumsessioncb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3AImpl_EnumSessions (IDirectPlay3A *iface, DPSESSIONDESC2 *sdesc, DWORD timeout, LPDPENUMSESSIONSCALLBACK2 enumsessioncb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3Impl_EnumSessions (IDirectPlay3 *iface, DPSESSIONDESC2 *sdesc, DWORD timeout, LPDPENUMSESSIONSCALLBACK2 enumsessioncb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4AImpl_EnumSessions (IDirectPlay4A *iface, DPSESSIONDESC2 *sdesc, DWORD timeout, LPDPENUMSESSIONSCALLBACK2 enumsessioncb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4Impl_EnumSessions (IDirectPlay4 *iface, DPSESSIONDESC2 *sdesc, DWORD timeout, LPDPENUMSESSIONSCALLBACK2 enumsessioncb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlay2AImpl_GetCaps (IDirectPlay2A *iface, DPCAPS *caps, DWORD flags)
 
static HRESULT WINAPI IDirectPlay2Impl_GetCaps (IDirectPlay2 *iface, DPCAPS *caps, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3AImpl_GetCaps (IDirectPlay3A *iface, DPCAPS *caps, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3Impl_GetCaps (IDirectPlay3 *iface, DPCAPS *caps, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4AImpl_GetCaps (IDirectPlay4A *iface, DPCAPS *caps, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4Impl_GetCaps (IDirectPlay4 *iface, DPCAPS *caps, DWORD flags)
 
static HRESULT WINAPI IDirectPlay2AImpl_GetGroupData (IDirectPlay2A *iface, DPID group, void *data, DWORD *size, DWORD flags)
 
static HRESULT WINAPI IDirectPlay2Impl_GetGroupData (IDirectPlay2 *iface, DPID group, void *data, DWORD *size, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3AImpl_GetGroupData (IDirectPlay3A *iface, DPID group, void *data, DWORD *size, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3Impl_GetGroupData (IDirectPlay3 *iface, DPID group, void *data, DWORD *size, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4AImpl_GetGroupData (IDirectPlay4A *iface, DPID group, void *data, DWORD *size, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4Impl_GetGroupData (IDirectPlay4 *iface, DPID group, void *data, DWORD *size, DWORD flags)
 
static HRESULT DP_IF_GetGroupName (IDirectPlayImpl *This, DPID idGroup, void *lpData, DWORD *lpdwDataSize, BOOL bAnsi)
 
static HRESULT WINAPI IDirectPlay2AImpl_GetGroupName (IDirectPlay2A *iface, DPID group, void *data, DWORD *size)
 
static HRESULT WINAPI IDirectPlay2Impl_GetGroupName (IDirectPlay2 *iface, DPID group, void *data, DWORD *size)
 
static HRESULT WINAPI IDirectPlay3AImpl_GetGroupName (IDirectPlay3A *iface, DPID group, void *data, DWORD *size)
 
static HRESULT WINAPI IDirectPlay3Impl_GetGroupName (IDirectPlay3 *iface, DPID group, void *data, DWORD *size)
 
static HRESULT WINAPI IDirectPlay4AImpl_GetGroupName (IDirectPlay4A *iface, DPID idGroup, void *lpData, DWORD *lpdwDataSize)
 
static HRESULT WINAPI IDirectPlay4Impl_GetGroupName (IDirectPlay4 *iface, DPID idGroup, void *lpData, DWORD *lpdwDataSize)
 
static HRESULT WINAPI IDirectPlay2AImpl_GetMessageCount (IDirectPlay2A *iface, DPID player, DWORD *count)
 
static HRESULT WINAPI IDirectPlay2Impl_GetMessageCount (IDirectPlay2 *iface, DPID player, DWORD *count)
 
static HRESULT WINAPI IDirectPlay3AImpl_GetMessageCount (IDirectPlay3A *iface, DPID player, DWORD *count)
 
static HRESULT WINAPI IDirectPlay3Impl_GetMessageCount (IDirectPlay3 *iface, DPID player, DWORD *count)
 
static HRESULT WINAPI IDirectPlay4AImpl_GetMessageCount (IDirectPlay4A *iface, DPID player, DWORD *count)
 
static HRESULT WINAPI IDirectPlay4Impl_GetMessageCount (IDirectPlay4 *iface, DPID player, DWORD *count)
 
static HRESULT WINAPI IDirectPlay2AImpl_GetPlayerAddress (IDirectPlay2A *iface, DPID player, void *data, DWORD *size)
 
static HRESULT WINAPI IDirectPlay2Impl_GetPlayerAddress (IDirectPlay2 *iface, DPID player, void *data, DWORD *size)
 
static HRESULT WINAPI IDirectPlay3AImpl_GetPlayerAddress (IDirectPlay3A *iface, DPID player, void *data, DWORD *size)
 
static HRESULT WINAPI IDirectPlay3Impl_GetPlayerAddress (IDirectPlay3 *iface, DPID player, void *data, DWORD *size)
 
static HRESULT WINAPI IDirectPlay4AImpl_GetPlayerAddress (IDirectPlay4A *iface, DPID player, void *data, DWORD *size)
 
static HRESULT WINAPI IDirectPlay4Impl_GetPlayerAddress (IDirectPlay4 *iface, DPID player, void *data, DWORD *size)
 
static HRESULT WINAPI IDirectPlay2AImpl_GetPlayerCaps (IDirectPlay2A *iface, DPID player, DPCAPS *caps, DWORD flags)
 
static HRESULT WINAPI IDirectPlay2Impl_GetPlayerCaps (IDirectPlay2 *iface, DPID player, DPCAPS *caps, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3AImpl_GetPlayerCaps (IDirectPlay3A *iface, DPID player, DPCAPS *caps, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3Impl_GetPlayerCaps (IDirectPlay3 *iface, DPID player, DPCAPS *caps, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4AImpl_GetPlayerCaps (IDirectPlay4A *iface, DPID player, DPCAPS *caps, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4Impl_GetPlayerCaps (IDirectPlay4 *iface, DPID player, DPCAPS *caps, DWORD flags)
 
static HRESULT WINAPI IDirectPlay2AImpl_GetPlayerData (IDirectPlay2A *iface, DPID player, void *data, DWORD *size, DWORD flags)
 
static HRESULT WINAPI IDirectPlay2Impl_GetPlayerData (IDirectPlay2 *iface, DPID player, void *data, DWORD *size, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3AImpl_GetPlayerData (IDirectPlay3A *iface, DPID player, void *data, DWORD *size, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3Impl_GetPlayerData (IDirectPlay3 *iface, DPID player, void *data, DWORD *size, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4AImpl_GetPlayerData (IDirectPlay4A *iface, DPID player, void *data, DWORD *size, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4Impl_GetPlayerData (IDirectPlay4 *iface, DPID player, void *data, DWORD *size, DWORD flags)
 
static HRESULT DP_IF_GetPlayerName (IDirectPlayImpl *This, DPID idPlayer, void *lpData, DWORD *lpdwDataSize, BOOL bAnsi)
 
static HRESULT WINAPI IDirectPlay2AImpl_GetPlayerName (IDirectPlay2A *iface, DPID player, void *data, DWORD *size)
 
static HRESULT WINAPI IDirectPlay2Impl_GetPlayerName (IDirectPlay2 *iface, DPID player, void *data, DWORD *size)
 
static HRESULT WINAPI IDirectPlay3AImpl_GetPlayerName (IDirectPlay3A *iface, DPID player, void *data, DWORD *size)
 
static HRESULT WINAPI IDirectPlay3Impl_GetPlayerName (IDirectPlay3 *iface, DPID player, void *data, DWORD *size)
 
static HRESULT WINAPI IDirectPlay4AImpl_GetPlayerName (IDirectPlay4A *iface, DPID idPlayer, void *lpData, DWORD *lpdwDataSize)
 
static HRESULT WINAPI IDirectPlay4Impl_GetPlayerName (IDirectPlay4 *iface, DPID idPlayer, void *lpData, DWORD *lpdwDataSize)
 
static HRESULT DP_GetSessionDesc (IDirectPlayImpl *This, void *lpData, DWORD *lpdwDataSize, BOOL bAnsi)
 
static HRESULT WINAPI IDirectPlay2AImpl_GetSessionDesc (IDirectPlay2A *iface, void *data, DWORD *size)
 
static HRESULT WINAPI IDirectPlay2Impl_GetSessionDesc (IDirectPlay2 *iface, void *data, DWORD *size)
 
static HRESULT WINAPI IDirectPlay3AImpl_GetSessionDesc (IDirectPlay3A *iface, void *data, DWORD *size)
 
static HRESULT WINAPI IDirectPlay3Impl_GetSessionDesc (IDirectPlay3 *iface, void *data, DWORD *size)
 
static HRESULT WINAPI IDirectPlay4AImpl_GetSessionDesc (IDirectPlay4A *iface, void *lpData, DWORD *lpdwDataSize)
 
static HRESULT WINAPI IDirectPlay4Impl_GetSessionDesc (IDirectPlay4 *iface, void *lpData, DWORD *lpdwDataSize)
 
static HRESULT WINAPI IDirectPlay2AImpl_Initialize (IDirectPlay2A *iface, GUID *guid)
 
static HRESULT WINAPI IDirectPlay2Impl_Initialize (IDirectPlay2 *iface, GUID *guid)
 
static HRESULT WINAPI IDirectPlay3AImpl_Initialize (IDirectPlay3A *iface, GUID *guid)
 
static HRESULT WINAPI IDirectPlay3Impl_Initialize (IDirectPlay3 *iface, GUID *guid)
 
static HRESULT WINAPI IDirectPlay4AImpl_Initialize (IDirectPlay4A *iface, GUID *guid)
 
static HRESULT WINAPI IDirectPlay4Impl_Initialize (IDirectPlay4 *iface, GUID *guid)
 
static HRESULT DP_SecureOpen (IDirectPlayImpl *This, const DPSESSIONDESC2 *lpsd, DWORD dwFlags, const DPSECURITYDESC *lpSecurity, const DPCREDENTIALS *lpCredentials, BOOL bAnsi)
 
static HRESULT WINAPI IDirectPlay2AImpl_Open (IDirectPlay2A *iface, DPSESSIONDESC2 *sdesc, DWORD flags)
 
static HRESULT WINAPI IDirectPlay2Impl_Open (IDirectPlay2 *iface, DPSESSIONDESC2 *sdesc, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3AImpl_Open (IDirectPlay3A *iface, DPSESSIONDESC2 *sdesc, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3Impl_Open (IDirectPlay3 *iface, DPSESSIONDESC2 *sdesc, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4AImpl_Open (IDirectPlay4A *iface, DPSESSIONDESC2 *sdesc, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4Impl_Open (IDirectPlay4 *iface, DPSESSIONDESC2 *sdesc, DWORD flags)
 
static HRESULT DP_IF_Receive (IDirectPlayImpl *This, DPID *lpidFrom, DPID *lpidTo, DWORD dwFlags, void *lpData, DWORD *lpdwDataSize, BOOL bAnsi)
 
static HRESULT WINAPI IDirectPlay2AImpl_Receive (IDirectPlay2A *iface, DPID *from, DPID *to, DWORD flags, void *data, DWORD *size)
 
static HRESULT WINAPI IDirectPlay2Impl_Receive (IDirectPlay2 *iface, DPID *from, DPID *to, DWORD flags, void *data, DWORD *size)
 
static HRESULT WINAPI IDirectPlay3AImpl_Receive (IDirectPlay3A *iface, DPID *from, DPID *to, DWORD flags, void *data, DWORD *size)
 
static HRESULT WINAPI IDirectPlay3Impl_Receive (IDirectPlay3 *iface, DPID *from, DPID *to, DWORD flags, void *data, DWORD *size)
 
static HRESULT WINAPI IDirectPlay4AImpl_Receive (IDirectPlay4A *iface, DPID *lpidFrom, DPID *lpidTo, DWORD dwFlags, void *lpData, DWORD *lpdwDataSize)
 
static HRESULT WINAPI IDirectPlay4Impl_Receive (IDirectPlay4 *iface, DPID *lpidFrom, DPID *lpidTo, DWORD dwFlags, void *lpData, DWORD *lpdwDataSize)
 
static HRESULT WINAPI IDirectPlay2AImpl_Send (IDirectPlay2A *iface, DPID from, DPID to, DWORD flags, void *data, DWORD size)
 
static HRESULT WINAPI IDirectPlay2Impl_Send (IDirectPlay2 *iface, DPID from, DPID to, DWORD flags, void *data, DWORD size)
 
static HRESULT WINAPI IDirectPlay3AImpl_Send (IDirectPlay3A *iface, DPID from, DPID to, DWORD flags, void *data, DWORD size)
 
static HRESULT WINAPI IDirectPlay3Impl_Send (IDirectPlay3 *iface, DPID from, DPID to, DWORD flags, void *data, DWORD size)
 
static HRESULT WINAPI IDirectPlay4AImpl_Send (IDirectPlay4A *iface, DPID from, DPID to, DWORD flags, void *data, DWORD size)
 
static HRESULT WINAPI IDirectPlay4Impl_Send (IDirectPlay4 *iface, DPID from, DPID to, DWORD flags, void *data, DWORD size)
 
static HRESULT WINAPI IDirectPlay2AImpl_SetGroupData (IDirectPlay2A *iface, DPID group, void *data, DWORD size, DWORD flags)
 
static HRESULT WINAPI IDirectPlay2Impl_SetGroupData (IDirectPlay2 *iface, DPID group, void *data, DWORD size, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3AImpl_SetGroupData (IDirectPlay3A *iface, DPID group, void *data, DWORD size, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3Impl_SetGroupData (IDirectPlay3 *iface, DPID group, void *data, DWORD size, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4AImpl_SetGroupData (IDirectPlay4A *iface, DPID group, void *data, DWORD size, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4Impl_SetGroupData (IDirectPlay4 *iface, DPID group, void *data, DWORD size, DWORD flags)
 
static HRESULT DP_IF_SetGroupName (IDirectPlayImpl *This, DPID idGroup, DPNAME *lpGroupName, DWORD dwFlags, BOOL bAnsi)
 
static HRESULT WINAPI IDirectPlay2AImpl_SetGroupName (IDirectPlay2A *iface, DPID group, DPNAME *name, DWORD flags)
 
static HRESULT WINAPI IDirectPlay2Impl_SetGroupName (IDirectPlay2 *iface, DPID group, DPNAME *name, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3AImpl_SetGroupName (IDirectPlay3A *iface, DPID group, DPNAME *name, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3Impl_SetGroupName (IDirectPlay3 *iface, DPID group, DPNAME *name, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4AImpl_SetGroupName (IDirectPlay4A *iface, DPID idGroup, DPNAME *lpGroupName, DWORD dwFlags)
 
static HRESULT WINAPI IDirectPlay4Impl_SetGroupName (IDirectPlay4 *iface, DPID idGroup, DPNAME *lpGroupName, DWORD dwFlags)
 
static HRESULT WINAPI IDirectPlay2AImpl_SetPlayerData (IDirectPlay2A *iface, DPID player, void *data, DWORD size, DWORD flags)
 
static HRESULT WINAPI IDirectPlay2Impl_SetPlayerData (IDirectPlay2 *iface, DPID player, void *data, DWORD size, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3AImpl_SetPlayerData (IDirectPlay3A *iface, DPID player, void *data, DWORD size, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3Impl_SetPlayerData (IDirectPlay3 *iface, DPID player, void *data, DWORD size, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4AImpl_SetPlayerData (IDirectPlay4A *iface, DPID player, void *data, DWORD size, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4Impl_SetPlayerData (IDirectPlay4 *iface, DPID player, void *data, DWORD size, DWORD flags)
 
static HRESULT DP_IF_SetPlayerName (IDirectPlayImpl *This, DPID idPlayer, DPNAME *lpPlayerName, DWORD dwFlags, BOOL bAnsi)
 
static HRESULT WINAPI IDirectPlay2AImpl_SetPlayerName (IDirectPlay2A *iface, DPID player, DPNAME *name, DWORD flags)
 
static HRESULT WINAPI IDirectPlay2Impl_SetPlayerName (IDirectPlay2 *iface, DPID player, DPNAME *name, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3AImpl_SetPlayerName (IDirectPlay3A *iface, DPID player, DPNAME *name, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3Impl_SetPlayerName (IDirectPlay3 *iface, DPID player, DPNAME *name, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4AImpl_SetPlayerName (IDirectPlay4A *iface, DPID idPlayer, DPNAME *lpPlayerName, DWORD dwFlags)
 
static HRESULT WINAPI IDirectPlay4Impl_SetPlayerName (IDirectPlay4 *iface, DPID idPlayer, DPNAME *lpPlayerName, DWORD dwFlags)
 
static HRESULT WINAPI IDirectPlay2AImpl_SetSessionDesc (IDirectPlay2A *iface, DPSESSIONDESC2 *sdesc, DWORD flags)
 
static HRESULT WINAPI IDirectPlay2Impl_SetSessionDesc (IDirectPlay2 *iface, DPSESSIONDESC2 *sdesc, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3AImpl_SetSessionDesc (IDirectPlay3A *iface, DPSESSIONDESC2 *sdesc, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3Impl_SetSessionDesc (IDirectPlay3 *iface, DPSESSIONDESC2 *sdesc, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4AImpl_SetSessionDesc (IDirectPlay4A *iface, DPSESSIONDESC2 *lpSessDesc, DWORD dwFlags)
 
static HRESULT WINAPI IDirectPlay4Impl_SetSessionDesc (IDirectPlay4 *iface, DPSESSIONDESC2 *lpSessDesc, DWORD dwFlags)
 
static HRESULT WINAPI IDirectPlay3AImpl_AddGroupToGroup (IDirectPlay3A *iface, DPID parent, DPID group)
 
static HRESULT WINAPI IDirectPlay3Impl_AddGroupToGroup (IDirectPlay3 *iface, DPID parent, DPID group)
 
static HRESULT WINAPI IDirectPlay4AImpl_AddGroupToGroup (IDirectPlay4A *iface, DPID parent, DPID group)
 
static HRESULT WINAPI IDirectPlay4Impl_AddGroupToGroup (IDirectPlay4 *iface, DPID parent, DPID group)
 
static HRESULT DP_IF_CreateGroupInGroup (IDirectPlayImpl *This, void *lpMsgHdr, DPID idParentGroup, DPID *lpidGroup, DPNAME *lpGroupName, void *lpData, DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi)
 
static HRESULT WINAPI IDirectPlay3AImpl_CreateGroupInGroup (IDirectPlay3A *iface, DPID parent, DPID *group, DPNAME *name, void *data, DWORD size, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3Impl_CreateGroupInGroup (IDirectPlay3 *iface, DPID parent, DPID *group, DPNAME *name, void *data, DWORD size, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4AImpl_CreateGroupInGroup (IDirectPlay4A *iface, DPID idParentGroup, DPID *lpidGroup, DPNAME *lpGroupName, void *lpData, DWORD dwDataSize, DWORD dwFlags)
 
static HRESULT WINAPI IDirectPlay4Impl_CreateGroupInGroup (IDirectPlay4 *iface, DPID idParentGroup, DPID *lpidGroup, DPNAME *lpGroupName, void *lpData, DWORD dwDataSize, DWORD dwFlags)
 
static HRESULT WINAPI IDirectPlay3AImpl_DeleteGroupFromGroup (IDirectPlay3A *iface, DPID parent, DPID group)
 
static HRESULT WINAPI IDirectPlay3Impl_DeleteGroupFromGroup (IDirectPlay3 *iface, DPID parent, DPID group)
 
static HRESULT WINAPI IDirectPlay4AImpl_DeleteGroupFromGroup (IDirectPlay4A *iface, DPID parent, DPID group)
 
static HRESULT WINAPI IDirectPlay4Impl_DeleteGroupFromGroup (IDirectPlay4 *iface, DPID parent, DPID group)
 
static HRESULT WINAPI IDirectPlay3AImpl_EnumConnections (IDirectPlay3A *iface, const GUID *application, LPDPENUMCONNECTIONSCALLBACK enumcb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3Impl_EnumConnections (IDirectPlay3 *iface, const GUID *application, LPDPENUMCONNECTIONSCALLBACK enumcb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4AImpl_EnumConnections (IDirectPlay4A *iface, const GUID *lpguidApplication, LPDPENUMCONNECTIONSCALLBACK lpEnumCallback, void *lpContext, DWORD dwFlags)
 
static HRESULT WINAPI IDirectPlay4Impl_EnumConnections (IDirectPlay4 *iface, const GUID *application, LPDPENUMCONNECTIONSCALLBACK enumcb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3AImpl_EnumGroupsInGroup (IDirectPlay3A *iface, DPID group, GUID *instance, LPDPENUMPLAYERSCALLBACK2 enumplayercb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3Impl_EnumGroupsInGroup (IDirectPlay3 *iface, DPID group, GUID *instance, LPDPENUMPLAYERSCALLBACK2 enumplayercb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4AImpl_EnumGroupsInGroup (IDirectPlay4A *iface, DPID group, GUID *instance, LPDPENUMPLAYERSCALLBACK2 enumplayercb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4Impl_EnumGroupsInGroup (IDirectPlay4 *iface, DPID group, GUID *instance, LPDPENUMPLAYERSCALLBACK2 enumplayercb, void *context, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3AImpl_GetGroupConnectionSettings (IDirectPlay3A *iface, DWORD flags, DPID group, void *data, DWORD *size)
 
static HRESULT WINAPI IDirectPlay3Impl_GetGroupConnectionSettings (IDirectPlay3 *iface, DWORD flags, DPID group, void *data, DWORD *size)
 
static HRESULT WINAPI IDirectPlay4AImpl_GetGroupConnectionSettings (IDirectPlay4A *iface, DWORD flags, DPID group, void *data, DWORD *size)
 
static HRESULT WINAPI IDirectPlay4Impl_GetGroupConnectionSettings (IDirectPlay4 *iface, DWORD flags, DPID group, void *data, DWORD *size)
 
static BOOL CALLBACK DP_GetSpLpGuidFromCompoundAddress (REFGUID guidDataType, DWORD dwDataSize, LPCVOID lpData, LPVOID lpContext)
 
static HMODULE DP_LoadSP (LPCGUID lpcGuid, LPSPINITDATA lpSpData, LPBOOL lpbIsDpSp)
 
static HRESULT DP_InitializeDPSP (IDirectPlayImpl *This, HMODULE hServiceProvider)
 
static HRESULT DP_InitializeDPLSP (IDirectPlayImpl *This, HMODULE hLobbyProvider)
 
static HRESULT WINAPI IDirectPlay3AImpl_InitializeConnection (IDirectPlay3A *iface, void *connection, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3Impl_InitializeConnection (IDirectPlay3 *iface, void *connection, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4AImpl_InitializeConnection (IDirectPlay4A *iface, void *connection, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4Impl_InitializeConnection (IDirectPlay4 *iface, void *connection, DWORD flags)
 
static HRESULT WINAPI IDirectPlay3AImpl_SecureOpen (IDirectPlay3A *iface, const DPSESSIONDESC2 *sdesc, DWORD flags, const DPSECURITYDESC *security, const DPCREDENTIALS *credentials)
 
static HRESULT WINAPI IDirectPlay3Impl_SecureOpen (IDirectPlay3 *iface, const DPSESSIONDESC2 *sdesc, DWORD flags, const DPSECURITYDESC *security, const DPCREDENTIALS *credentials)
 
static HRESULT WINAPI IDirectPlay4AImpl_SecureOpen (IDirectPlay4A *iface, const DPSESSIONDESC2 *lpsd, DWORD dwFlags, const DPSECURITYDESC *lpSecurity, const DPCREDENTIALS *lpCredentials)
 
static HRESULT WINAPI IDirectPlay4Impl_SecureOpen (IDirectPlay4 *iface, const DPSESSIONDESC2 *lpsd, DWORD dwFlags, const DPSECURITYDESC *lpSecurity, const DPCREDENTIALS *lpCredentials)
 
static HRESULT WINAPI IDirectPlay3AImpl_SendChatMessage (IDirectPlay3A *iface, DPID from, DPID to, DWORD flags, DPCHAT *chatmsg)
 
static HRESULT WINAPI IDirectPlay3Impl_SendChatMessage (IDirectPlay3 *iface, DPID from, DPID to, DWORD flags, DPCHAT *chatmsg)
 
static HRESULT WINAPI IDirectPlay4AImpl_SendChatMessage (IDirectPlay4A *iface, DPID from, DPID to, DWORD flags, DPCHAT *chatmsg)
 
static HRESULT WINAPI IDirectPlay4Impl_SendChatMessage (IDirectPlay4 *iface, DPID from, DPID to, DWORD flags, DPCHAT *chatmsg)
 
static HRESULT WINAPI IDirectPlay3AImpl_SetGroupConnectionSettings (IDirectPlay3A *iface, DWORD flags, DPID group, DPLCONNECTION *connection)
 
static HRESULT WINAPI IDirectPlay3Impl_SetGroupConnectionSettings (IDirectPlay3 *iface, DWORD flags, DPID group, DPLCONNECTION *connection)
 
static HRESULT WINAPI IDirectPlay4AImpl_SetGroupConnectionSettings (IDirectPlay4A *iface, DWORD flags, DPID group, DPLCONNECTION *connection)
 
static HRESULT WINAPI IDirectPlay4Impl_SetGroupConnectionSettings (IDirectPlay4 *iface, DWORD flags, DPID group, DPLCONNECTION *connection)
 
static HRESULT WINAPI IDirectPlay3AImpl_StartSession (IDirectPlay3A *iface, DWORD flags, DPID group)
 
static HRESULT WINAPI IDirectPlay3Impl_StartSession (IDirectPlay3 *iface, DWORD flags, DPID group)
 
static HRESULT WINAPI IDirectPlay4AImpl_StartSession (IDirectPlay4A *iface, DWORD flags, DPID group)
 
static HRESULT WINAPI IDirectPlay4Impl_StartSession (IDirectPlay4 *iface, DWORD flags, DPID group)
 
static HRESULT WINAPI IDirectPlay3AImpl_GetGroupFlags (IDirectPlay3A *iface, DPID group, DWORD *flags)
 
static HRESULT WINAPI IDirectPlay3Impl_GetGroupFlags (IDirectPlay3 *iface, DPID group, DWORD *flags)
 
static HRESULT WINAPI IDirectPlay4AImpl_GetGroupFlags (IDirectPlay4A *iface, DPID group, DWORD *flags)
 
static HRESULT WINAPI IDirectPlay4Impl_GetGroupFlags (IDirectPlay4 *iface, DPID group, DWORD *flags)
 
static HRESULT WINAPI IDirectPlay3AImpl_GetGroupParent (IDirectPlay3A *iface, DPID group, DPID *parent)
 
static HRESULT WINAPI IDirectPlay3Impl_GetGroupParent (IDirectPlay3 *iface, DPID group, DPID *parent)
 
static HRESULT WINAPI IDirectPlay4AImpl_GetGroupParent (IDirectPlay4A *iface, DPID group, DPID *parent)
 
static HRESULT WINAPI IDirectPlay4Impl_GetGroupParent (IDirectPlay4 *iface, DPID group, DPID *parent)
 
static HRESULT WINAPI IDirectPlay3AImpl_GetPlayerAccount (IDirectPlay3A *iface, DPID player, DWORD flags, void *data, DWORD *size)
 
static HRESULT WINAPI IDirectPlay3Impl_GetPlayerAccount (IDirectPlay3 *iface, DPID player, DWORD flags, void *data, DWORD *size)
 
static HRESULT WINAPI IDirectPlay4AImpl_GetPlayerAccount (IDirectPlay4A *iface, DPID player, DWORD flags, void *data, DWORD *size)
 
static HRESULT WINAPI IDirectPlay4Impl_GetPlayerAccount (IDirectPlay4 *iface, DPID player, DWORD flags, void *data, DWORD *size)
 
static HRESULT WINAPI IDirectPlay3AImpl_GetPlayerFlags (IDirectPlay3A *iface, DPID player, DWORD *flags)
 
static HRESULT WINAPI IDirectPlay3Impl_GetPlayerFlags (IDirectPlay3 *iface, DPID player, DWORD *flags)
 
static HRESULT WINAPI IDirectPlay4AImpl_GetPlayerFlags (IDirectPlay4A *iface, DPID player, DWORD *flags)
 
static HRESULT WINAPI IDirectPlay4Impl_GetPlayerFlags (IDirectPlay4 *iface, DPID player, DWORD *flags)
 
static HRESULT WINAPI IDirectPlay4AImpl_GetGroupOwner (IDirectPlay4A *iface, DPID group, DPID *owner)
 
static HRESULT WINAPI IDirectPlay4Impl_GetGroupOwner (IDirectPlay4 *iface, DPID group, DPID *owner)
 
static HRESULT WINAPI IDirectPlay4AImpl_SetGroupOwner (IDirectPlay4A *iface, DPID group, DPID owner)
 
static HRESULT WINAPI IDirectPlay4Impl_SetGroupOwner (IDirectPlay4 *iface, DPID group, DPID owner)
 
static HRESULT WINAPI IDirectPlay4AImpl_SendEx (IDirectPlay4A *iface, DPID from, DPID to, DWORD flags, void *data, DWORD size, DWORD priority, DWORD timeout, void *context, DWORD *msgid)
 
static HRESULT WINAPI IDirectPlay4Impl_SendEx (IDirectPlay4 *iface, DPID from, DPID to, DWORD flags, void *data, DWORD size, DWORD priority, DWORD timeout, void *context, DWORD *msgid)
 
static HRESULT WINAPI IDirectPlay4AImpl_GetMessageQueue (IDirectPlay4A *iface, DPID from, DPID to, DWORD flags, DWORD *msgs, DWORD *bytes)
 
static HRESULT WINAPI IDirectPlay4Impl_GetMessageQueue (IDirectPlay4 *iface, DPID from, DPID to, DWORD flags, DWORD *msgs, DWORD *bytes)
 
static HRESULT dplay_cancelmsg (IDirectPlayImpl *This, DWORD msgid, DWORD flags, DWORD minprio, DWORD maxprio)
 
static HRESULT WINAPI IDirectPlay4AImpl_CancelMessage (IDirectPlay4A *iface, DWORD msgid, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4Impl_CancelMessage (IDirectPlay4 *iface, DWORD msgid, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4AImpl_CancelPriority (IDirectPlay4A *iface, DWORD minprio, DWORD maxprio, DWORD flags)
 
static HRESULT WINAPI IDirectPlay4Impl_CancelPriority (IDirectPlay4 *iface, DWORD minprio, DWORD maxprio, DWORD flags)
 
HRESULT dplay_create (REFIID riid, void **ppv)
 
HRESULT DP_GetSPPlayerData (IDirectPlayImpl *lpDP, DPID idPlayer, void **lplpData)
 
HRESULT DP_SetSPPlayerData (IDirectPlayImpl *lpDP, DPID idPlayer, void *lpData)
 
static HRESULT DirectPlayEnumerateAW (LPDPENUMDPCALLBACKA lpEnumCallbackA, LPDPENUMDPCALLBACKW lpEnumCallbackW, LPVOID lpContext)
 
HRESULT WINAPI DirectPlayEnumerateA (LPDPENUMDPCALLBACKA lpEnumCallback, LPVOID lpContext)
 
HRESULT WINAPI DirectPlayEnumerateW (LPDPENUMDPCALLBACKW lpEnumCallback, LPVOID lpContext)
 
static BOOL CALLBACK cbDPCreateEnumConnections (LPCGUID lpguidSP, LPVOID lpConnection, DWORD dwConnectionSize, LPCDPNAME lpName, DWORD dwFlags, LPVOID lpContext)
 
HRESULT WINAPI DirectPlayCreate (LPGUID lpGUID, LPDIRECTPLAY *lplpDP, IUnknown *pUnk)
 

Variables

static LONG kludgePlayerGroupId = 1000
 
static const IDirectPlayVtbl dp_vt
 
static const IDirectPlay2Vtbl dp2_vt
 
static const IDirectPlay2Vtbl dp2A_vt
 
static const IDirectPlay3Vtbl dp3_vt
 
static const IDirectPlay3Vtbl dp3A_vt
 
static const IDirectPlay4Vtbl dp4_vt
 
static const IDirectPlay4Vtbl dp4A_vt
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 20 of file dplay.c.

◆ DPID_NAME_SERVER

#define DPID_NAME_SERVER   0x19a9d65b /* Don't ask me why */

Definition at line 80 of file dplay.c.

◆ DPID_NOPARENT_GROUP

#define DPID_NOPARENT_GROUP   0 /* Magic number to indicate no parent of group */

Definition at line 77 of file dplay.c.

◆ DPID_SYSTEM_GROUP

#define DPID_SYSTEM_GROUP
Value:
DPID_NOPARENT_GROUP /* If system group is supported
we don't have to change much */
#define DPID_NOPARENT_GROUP
Definition: dplay.c:77

Definition at line 78 of file dplay.c.

◆ DPMSG_CREATEGROUP_DWFLAGS

#define DPMSG_CREATEGROUP_DWFLAGS (   x)    ( (x) & DPGROUP_HIDDEN )

Definition at line 83 of file dplay.c.

◆ DPMSG_CREATEPLAYER_DWFLAGS

#define DPMSG_CREATEPLAYER_DWFLAGS (   x)    0

Definition at line 86 of file dplay.c.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 25 of file dplay.c.

Typedef Documentation

◆ CreateEnumData

◆ DPFAGContext

◆ DPRGOPContext

◆ lpCreateEnumData

◆ lpDPFAGContext

◆ lpDPRGOPContext

Function Documentation

◆ cbDeletePlayerFromAllGroups()

static BOOL CALLBACK cbDeletePlayerFromAllGroups ( DPID  dpId,
DWORD  dwPlayerType,
LPCDPNAME  lpName,
DWORD  dwFlags,
LPVOID  lpContext 
)
static

Definition at line 2052 of file dplay.c.

2058 {
2059  lpDPFAGContext lpCtxt = (lpDPFAGContext)lpContext;
2060 
2061  if( dwPlayerType == DPPLAYERTYPE_GROUP )
2062  {
2064 
2065  /* Enumerate all groups in this group since this will normally only
2066  * be called for top level groups
2067  */
2070 
2071  }
2072  else
2073  {
2074  ERR( "Group callback has dwPlayerType = 0x%08x\n", dwPlayerType );
2075  }
2076 
2077  return TRUE;
2078 }
#define TRUE
Definition: types.h:120
#define DPENUMGROUPS_ALL
Definition: dplay.h:995
IDirectPlayImpl * This
Definition: dplay.c:1995
IDirectPlay4 IDirectPlay4_iface
Definition: dplay_global.h:191
smooth NULL
Definition: ftsmooth.c:416
static BOOL CALLBACK cbDeletePlayerFromAllGroups(DPID dpId, DWORD dwPlayerType, LPCDPNAME lpName, DWORD dwFlags, LPVOID lpContext)
Definition: dplay.c:2052
#define DPPLAYERTYPE_GROUP
Definition: dplay.h:1134
DPID idPlayer
Definition: dplay.c:1996
#define ERR(fmt,...)
Definition: debug.h:109
#define IDirectPlayX_EnumGroupsInGroup(p, a, b, c, d, e)
Definition: dplay.h:902
struct _DPFAGContext * lpDPFAGContext
#define IDirectPlayX_DeletePlayerFromGroup(p, a, b)
Definition: dplay.h:872

Referenced by DP_IF_DestroyPlayer().

◆ cbDPCreateEnumConnections()

static BOOL CALLBACK cbDPCreateEnumConnections ( LPCGUID  lpguidSP,
LPVOID  lpConnection,
DWORD  dwConnectionSize,
LPCDPNAME  lpName,
DWORD  dwFlags,
LPVOID  lpContext 
)
static

Definition at line 5960 of file dplay.c.

5967 {
5968  lpCreateEnumData lpData = (lpCreateEnumData)lpContext;
5969 
5970  if( IsEqualGUID( lpguidSP, lpData->lpGuid ) )
5971  {
5972  TRACE( "Found SP entry with guid %s\n", debugstr_guid(lpData->lpGuid) );
5973 
5975  dwConnectionSize );
5976  CopyMemory( lpData->lpConn, lpConnection, dwConnectionSize );
5977 
5978  /* Found the record that we were looking for */
5979  return FALSE;
5980  }
5981 
5982  /* Haven't found what were looking for yet */
5983  return TRUE;
5984 }
#define TRUE
Definition: types.h:120
LPCGUID lpGuid
Definition: dplay.c:5956
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
struct tagCreateEnum * lpCreateEnumData
#define CopyMemory
Definition: winbase.h:1640
LPVOID lpConn
Definition: dplay.c:5955
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
#define HEAP_ZERO_MEMORY
Definition: compat.h:123

Referenced by DirectPlayCreate().

◆ cbRemoveGroupOrPlayer()

static BOOL CALLBACK cbRemoveGroupOrPlayer ( DPID  dpId,
DWORD  dwPlayerType,
LPCDPNAME  lpName,
DWORD  dwFlags,
LPVOID  lpContext 
)
static

Definition at line 1880 of file dplay.c.

1886 {
1887  lpDPRGOPContext lpCtxt = (lpDPRGOPContext)lpContext;
1888 
1889  TRACE( "Removing element:0x%08x (type:0x%08x) from element:0x%08x\n",
1890  dpId, dwPlayerType, lpCtxt->idGroup );
1891 
1892  if( dwPlayerType == DPPLAYERTYPE_GROUP )
1893  {
1895  lpCtxt->idGroup, dpId ) ) )
1896  ERR( "Unable to delete group 0x%08x from group 0x%08x\n", dpId, lpCtxt->idGroup );
1897  }
1899  lpCtxt->idGroup, dpId ) ) )
1900  ERR( "Unable to delete player 0x%08x from grp 0x%08x\n", dpId, lpCtxt->idGroup );
1901 
1902  return TRUE; /* Continue enumeration */
1903 }
#define TRUE
Definition: types.h:120
IDirectPlayImpl * This
Definition: dplay.c:1874
struct _DPRGOPContext * lpDPRGOPContext
#define IDirectPlayX_DeleteGroupFromGroup(p, a, b)
Definition: dplay.h:900
IDirectPlay4 IDirectPlay4_iface
Definition: dplay_global.h:191
#define DPPLAYERTYPE_GROUP
Definition: dplay.h:1134
DPID idGroup
Definition: dplay.c:1876
#define TRACE(s)
Definition: solgame.cpp:4
#define ERR(fmt,...)
Definition: debug.h:109
#define IDirectPlayX_DeletePlayerFromGroup(p, a, b)
Definition: dplay.h:872

Referenced by DP_IF_DestroyGroup().

◆ DirectPlayCreate()

HRESULT WINAPI DirectPlayCreate ( LPGUID  lpGUID,
LPDIRECTPLAY lplpDP,
IUnknown pUnk 
)

Definition at line 5992 of file dplay.c.

5993 {
5994  HRESULT hr;
5995  LPDIRECTPLAY3A lpDP3A;
5996  CreateEnumData cbData;
5997 
5998  TRACE( "lpGUID=%s lplpDP=%p pUnk=%p\n", debugstr_guid(lpGUID), lplpDP, pUnk );
5999 
6000  if( pUnk != NULL )
6001  {
6002  return CLASS_E_NOAGGREGATION;
6003  }
6004 
6005  if( (lplpDP == NULL) || (lpGUID == NULL) )
6006  {
6007  return DPERR_INVALIDPARAMS;
6008  }
6009 
6010  if ( dplay_create( &IID_IDirectPlay, (void**)lplpDP ) != DP_OK )
6011  return DPERR_UNAVAILABLE;
6012 
6013  if( IsEqualGUID( &GUID_NULL, lpGUID ) )
6014  {
6015  /* The GUID_NULL means don't bind a service provider. Just return the
6016  interface as is */
6017  return DP_OK;
6018  }
6019 
6020  /* Bind the desired service provider since lpGUID is non NULL */
6021  TRACE( "Service Provider binding for %s\n", debugstr_guid(lpGUID) );
6022 
6023  /* We're going to use a DP3 interface */
6024  hr = IDirectPlayX_QueryInterface( *lplpDP, &IID_IDirectPlay3A,
6025  (LPVOID*)&lpDP3A );
6026  if( FAILED(hr) )
6027  {
6028  ERR( "Failed to get DP3 interface: %s\n", DPLAYX_HresultToString(hr) );
6029  return hr;
6030  }
6031 
6032  cbData.lpConn = NULL;
6033  cbData.lpGuid = lpGUID;
6034 
6035  /* We were given a service provider, find info about it... */
6037  &cbData, DPCONNECTION_DIRECTPLAY );
6038  if( ( FAILED(hr) ) ||
6039  ( cbData.lpConn == NULL )
6040  )
6041  {
6042  ERR( "Failed to get Enum for SP: %s\n", DPLAYX_HresultToString(hr) );
6043  IDirectPlayX_Release( lpDP3A );
6044  return DPERR_UNAVAILABLE;
6045  }
6046 
6047  /* Initialize the service provider */
6048  hr = IDirectPlayX_InitializeConnection( lpDP3A, cbData.lpConn, 0 );
6049  if( FAILED(hr) )
6050  {
6051  ERR( "Failed to Initialize SP: %s\n", DPLAYX_HresultToString(hr) );
6052  HeapFree( GetProcessHeap(), 0, cbData.lpConn );
6053  IDirectPlayX_Release( lpDP3A );
6054  return hr;
6055  }
6056 
6057  /* Release our version of the interface now that we're done with it */
6058  IDirectPlayX_Release( lpDP3A );
6059  HeapFree( GetProcessHeap(), 0, cbData.lpConn );
6060 
6061  return DP_OK;
6062 }
HRESULT dplay_create(REFIID riid, void **ppv)
Definition: dplay.c:5677
static BOOL CALLBACK cbDPCreateEnumConnections(LPCGUID lpguidSP, LPVOID lpConnection, DWORD dwConnectionSize, LPCDPNAME lpName, DWORD dwFlags, LPVOID lpContext)
Definition: dplay.c:5960
HRESULT hr
Definition: shlfolder.c:183
#define DPCONNECTION_DIRECTPLAY
Definition: dplay.h:982
#define DPERR_INVALIDPARAMS
Definition: dplay.h:103
LPCSTR DPLAYX_HresultToString(HRESULT hr)
#define IDirectPlayX_Release(p)
Definition: dplay.h:866
#define IDirectPlayX_InitializeConnection(p, a, b)
Definition: dplay.h:904
LPCGUID lpGuid
Definition: dplay.c:5956
#define DP_OK
Definition: dplay.h:88
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
static void *static void *static LPDIRECTPLAY * lplpDP
Definition: dplayx.c:30
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
LONG HRESULT
Definition: typedefs.h:77
struct IDirectPlay3 * LPDIRECTPLAY3A
Definition: dplay.h:53
#define GUID_NULL
Definition: ks.h:106
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
#define ERR(fmt,...)
Definition: debug.h:109
LPVOID lpConn
Definition: dplay.c:5955
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
#define DPERR_UNAVAILABLE
Definition: dplay.h:117
#define IDirectPlayX_EnumConnections(p, a, b, c, d)
Definition: dplay.h:901
#define IDirectPlayX_QueryInterface(p, a, b)
Definition: dplay.h:864
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:30
#define HeapFree(x, y, z)
Definition: compat.h:402

◆ DirectPlayEnumerateA()

HRESULT WINAPI DirectPlayEnumerateA ( LPDPENUMDPCALLBACKA  lpEnumCallback,
LPVOID  lpContext 
)

Definition at line 5936 of file dplay.c.

5937 {
5938  TRACE("(%p,%p)\n", lpEnumCallback, lpContext);
5939 
5940  return DirectPlayEnumerateAW(lpEnumCallback, NULL, lpContext);
5941 }
static HRESULT DirectPlayEnumerateAW(LPDPENUMDPCALLBACKA lpEnumCallbackA, LPDPENUMDPCALLBACKW lpEnumCallbackW, LPVOID lpContext)
Definition: dplay.c:5768
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4

◆ DirectPlayEnumerateAW()

static HRESULT DirectPlayEnumerateAW ( LPDPENUMDPCALLBACKA  lpEnumCallbackA,
LPDPENUMDPCALLBACKW  lpEnumCallbackW,
LPVOID  lpContext 
)
static

Definition at line 5768 of file dplay.c.

5771 {
5772  HKEY hkResult;
5773  static const WCHAR searchSubKey[] = {
5774  'S', 'O', 'F', 'T', 'W', 'A', 'R', 'E', '\\',
5775  'M', 'i', 'c', 'r', 'o', 's', 'o', 'f', 't', '\\',
5776  'D', 'i', 'r', 'e', 'c', 't', 'P', 'l', 'a', 'y', '\\',
5777  'S', 'e', 'r', 'v', 'i', 'c', 'e', ' ', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 's', 0 };
5778  static const WCHAR guidKey[] = { 'G', 'u', 'i', 'd', 0 };
5779  static const WCHAR descW[] = { 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'i', 'o', 'n', 'W', 0 };
5780 
5781  DWORD dwIndex;
5783 
5784  char *descriptionA = NULL;
5785  DWORD max_sizeOfDescriptionA = 0;
5786  WCHAR *descriptionW = NULL;
5787  DWORD max_sizeOfDescriptionW = 0;
5788  DWORD sizeOfSubKeyName;
5789  WCHAR subKeyName[255]; /* 255 is the maximum key size according to MSDN */
5790  LONG ret_value;
5791  static GUID *guid_cache;
5792  static int cache_count;
5793 
5794  if (!lpEnumCallbackA && !lpEnumCallbackW)
5795  {
5796  return DPERR_INVALIDPARAMS;
5797  }
5798 
5799  /* Need to loop over the service providers in the registry */
5800  if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, searchSubKey,
5801  0, KEY_READ, &hkResult) != ERROR_SUCCESS)
5802  {
5803  /* Hmmm. Does this mean that there are no service providers? */
5804  ERR(": no service provider key in the registry - check your Wine installation !!!\n");
5805  return DPERR_GENERIC;
5806  }
5807 
5808  dwIndex = 0;
5809  do
5810  {
5811  sizeOfSubKeyName = ARRAY_SIZE(subKeyName);
5812  ret_value = RegEnumKeyW(hkResult, dwIndex, subKeyName, sizeOfSubKeyName);
5813  dwIndex++;
5814  }
5815  while (ret_value == ERROR_SUCCESS);
5816  /* The game Swing from bug 37185 expects GUID values to persist after
5817  * the end of the enumeration. */
5818  if (cache_count < dwIndex)
5819  {
5820  HeapFree(GetProcessHeap(), 0, guid_cache);
5821  guid_cache = HeapAlloc(GetProcessHeap(), 0, sizeof(GUID) * dwIndex);
5822  if (!guid_cache)
5823  {
5824  ERR(": failed to allocate required memory.\n");
5825  return DPERR_EXCEPTION;
5826  }
5827  cache_count = dwIndex;
5828  }
5829  /* Traverse all the service providers we have available */
5830  dwIndex = 0;
5831  while (1)
5832  {
5833  HKEY hkServiceProvider;
5834  WCHAR guidKeyContent[(2 * 16) + 1 + 6 /* This corresponds to '{....-..-..-..-......}' */ ];
5835  DWORD sizeOfGuidKeyContent = sizeof(guidKeyContent);
5836 
5837  sizeOfSubKeyName = ARRAY_SIZE(subKeyName);
5838  ret_value = RegEnumKeyExW(hkResult, dwIndex, subKeyName, &sizeOfSubKeyName,
5839  NULL, NULL, NULL, &filetime);
5840  if (ret_value == ERROR_NO_MORE_ITEMS)
5841  break;
5842  else if (ret_value != ERROR_SUCCESS)
5843  {
5844  ERR(": could not enumerate on service provider key.\n");
5845  return DPERR_EXCEPTION;
5846  }
5847  TRACE(" this time through sub-key %s.\n", debugstr_w(subKeyName));
5848 
5849  /* Open the key for this service provider */
5850  if (RegOpenKeyExW(hkResult, subKeyName, 0, KEY_READ, &hkServiceProvider) != ERROR_SUCCESS)
5851  {
5852  ERR(": could not open registry key for service provider %s.\n", debugstr_w(subKeyName));
5853  continue;
5854  }
5855 
5856  /* Get the GUID from the registry */
5857  if (RegQueryValueExW(hkServiceProvider, guidKey,
5858  NULL, NULL, (LPBYTE) guidKeyContent, &sizeOfGuidKeyContent) != ERROR_SUCCESS)
5859  {
5860  ERR(": missing GUID registry data member for service provider %s.\n", debugstr_w(subKeyName));
5861  continue;
5862  }
5863  if (sizeOfGuidKeyContent != sizeof(guidKeyContent))
5864  {
5865  ERR(": invalid format for the GUID registry data member for service provider %s (%s).\n", debugstr_w(subKeyName), debugstr_w(guidKeyContent));
5866  continue;
5867  }
5868  CLSIDFromString(guidKeyContent, &guid_cache[dwIndex]);
5869 
5870  /* The enumeration will return FALSE if we are not to continue.
5871  *
5872  * Note: on my windows box, major / minor version is 6 / 0 for all service providers
5873  * and have no relation to any of the two dwReserved1 and dwReserved2 keys.
5874  * I think that it simply means that they are in-line with DirectX 6.0
5875  */
5876  if (lpEnumCallbackA)
5877  {
5878  DWORD sizeOfDescription = 0;
5879 
5880  /* Note that this is the A case of this function, so use the A variant to get the description string */
5881  if (RegQueryValueExA(hkServiceProvider, "DescriptionA",
5882  NULL, NULL, NULL, &sizeOfDescription) != ERROR_SUCCESS)
5883  {
5884  ERR(": missing 'DescriptionA' registry data member for service provider %s.\n", debugstr_w(subKeyName));
5885  continue;
5886  }
5887  if (sizeOfDescription > max_sizeOfDescriptionA)
5888  {
5889  HeapFree(GetProcessHeap(), 0, descriptionA);
5890  max_sizeOfDescriptionA = sizeOfDescription;
5891  }
5892  descriptionA = HeapAlloc(GetProcessHeap(), 0, sizeOfDescription);
5893  RegQueryValueExA(hkServiceProvider, "DescriptionA",
5894  NULL, NULL, (LPBYTE) descriptionA, &sizeOfDescription);
5895 
5896  if (!lpEnumCallbackA(&guid_cache[dwIndex], descriptionA, 6, 0, lpContext))
5897  goto end;
5898  }
5899  else
5900  {
5901  DWORD sizeOfDescription = 0;
5902 
5903  if (RegQueryValueExW(hkServiceProvider, descW,
5904  NULL, NULL, NULL, &sizeOfDescription) != ERROR_SUCCESS)
5905  {
5906  ERR(": missing 'DescriptionW' registry data member for service provider %s.\n", debugstr_w(subKeyName));
5907  continue;
5908  }
5909  if (sizeOfDescription > max_sizeOfDescriptionW)
5910  {
5912  max_sizeOfDescriptionW = sizeOfDescription;
5913  }
5914  descriptionW = HeapAlloc(GetProcessHeap(), 0, sizeOfDescription);
5915  RegQueryValueExW(hkServiceProvider, descW,
5916  NULL, NULL, (LPBYTE) descriptionW, &sizeOfDescription);
5917 
5918  if (!lpEnumCallbackW(&guid_cache[dwIndex], descriptionW, 6, 0, lpContext))
5919  goto end;
5920  }
5921 
5922  dwIndex++;
5923  }
5924 
5925  end:
5926  HeapFree(GetProcessHeap(), 0, descriptionA);
5928 
5929  return DP_OK;
5930 }
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4023
#define ERROR_SUCCESS
Definition: deptool.c:10
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:95
#define KEY_READ
Definition: nt_native.h:1023
#define DPERR_INVALIDPARAMS
Definition: dplay.h:103
GLuint GLuint end
Definition: gl.h:1545
unsigned char * LPBYTE
Definition: typedefs.h:52
#define DP_OK
Definition: dplay.h:88
long LONG
Definition: pedump.c:60
#define debugstr_w
Definition: kernel32.h:32
#define DPERR_EXCEPTION
Definition: dplay.h:98
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
#define DPERR_GENERIC
Definition: dplay.h:99
LONG WINAPI RegEnumKeyW(HKEY hKey, DWORD dwIndex, LPWSTR lpName, DWORD cbName)
Definition: reg.c:2416
#define ERR(fmt,...)
Definition: debug.h:109
#define ARRAY_SIZE(a)
Definition: main.h:24
static const WCHAR descriptionW[]
Definition: error.c:32
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
Definition: compobj.c:2338
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2527
#define HeapFree(x, y, z)
Definition: compat.h:402
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by DirectPlayEnumerateA(), and DirectPlayEnumerateW().

◆ DirectPlayEnumerateW()

HRESULT WINAPI DirectPlayEnumerateW ( LPDPENUMDPCALLBACKW  lpEnumCallback,
LPVOID  lpContext 
)

Definition at line 5946 of file dplay.c.

5947 {
5948  TRACE("(%p,%p)\n", lpEnumCallback, lpContext);
5949 
5950  return DirectPlayEnumerateAW(NULL, lpEnumCallback, lpContext);
5951 }
static HRESULT DirectPlayEnumerateAW(LPDPENUMDPCALLBACKA lpEnumCallbackA, LPDPENUMDPCALLBACKW lpEnumCallbackW, LPVOID lpContext)
Definition: dplay.c:5768
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4

◆ DP_BuildSPCompoundAddr()

static BOOL DP_BuildSPCompoundAddr ( LPGUID  lpcSpGuid,
LPVOID lplpAddrBuf,
LPDWORD  lpdwBufSize 
)
static

Definition at line 4198 of file dplay.c.

4200 {
4201  DPCOMPOUNDADDRESSELEMENT dpCompoundAddress;
4202  HRESULT hr;
4203 
4204  dpCompoundAddress.dwDataSize = sizeof( GUID );
4205  dpCompoundAddress.guidDataType = DPAID_ServiceProvider;
4206  dpCompoundAddress.lpData = lpcSpGuid;
4207 
4208  *lplpAddrBuf = NULL;
4209  *lpdwBufSize = 0;
4210 
4211  hr = DPL_CreateCompoundAddress( &dpCompoundAddress, 1, *lplpAddrBuf,
4212  lpdwBufSize, TRUE );
4213 
4214  if( hr != DPERR_BUFFERTOOSMALL )
4215  {
4216  ERR( "can't get buffer size: %s\n", DPLAYX_HresultToString( hr ) );
4217  return FALSE;
4218  }
4219 
4220  /* Now allocate the buffer */
4221  *lplpAddrBuf = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
4222  *lpdwBufSize );
4223 
4224  hr = DPL_CreateCompoundAddress( &dpCompoundAddress, 1, *lplpAddrBuf,
4225  lpdwBufSize, TRUE );
4226  if( FAILED(hr) )
4227  {
4228  ERR( "can't create address: %s\n", DPLAYX_HresultToString( hr ) );
4229  return FALSE;
4230  }
4231 
4232  return TRUE;
4233 }
#define TRUE
Definition: types.h:120
HRESULT hr
Definition: shlfolder.c:183
#define DPERR_BUFFERTOOSMALL
Definition: dplay.h:92
LPCSTR DPLAYX_HresultToString(HRESULT hr)
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
#define ERR(fmt,...)
Definition: debug.h:109
struct _GUID GUID
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
HRESULT DPL_CreateCompoundAddress(LPCDPCOMPOUNDADDRESSELEMENT lpElements, DWORD dwElementCount, LPVOID lpAddress, LPDWORD lpdwAddressSize, BOOL bAnsiInterface)
Definition: dplobby.c:1660

Referenced by IDirectPlay4AImpl_EnumConnections(), and IDirectPlay4Impl_EnumSessions().

◆ DP_CalcSessionDescSize()

static DWORD DP_CalcSessionDescSize ( LPCDPSESSIONDESC2  lpSessDesc,
BOOL  bAnsi 
)
static

Definition at line 3866 of file dplay.c.

3867 {
3868  DWORD dwSize = 0;
3869 
3870  if( lpSessDesc == NULL )
3871  {
3872  /* Hmmm..don't need any size? */
3873  ERR( "NULL lpSessDesc\n" );
3874  return dwSize;
3875  }
3876 
3877  dwSize += sizeof( *lpSessDesc );
3878 
3879  if( bAnsi )
3880  {
3881  if( lpSessDesc->u1.lpszSessionNameA )
3882  {
3883  dwSize += lstrlenA( lpSessDesc->u1.lpszSessionNameA ) + 1;
3884  }
3885 
3886  if( lpSessDesc->u2.lpszPasswordA )
3887  {
3888  dwSize += lstrlenA( lpSessDesc->u2.lpszPasswordA ) + 1;
3889  }
3890  }
3891  else /* UNICODE */
3892  {
3893  if( lpSessDesc->u1.lpszSessionName )
3894  {
3895  dwSize += sizeof( WCHAR ) *
3896  ( lstrlenW( lpSessDesc->u1.lpszSessionName ) + 1 );
3897  }
3898 
3899  if( lpSessDesc->u2.lpszPassword )
3900  {
3901  dwSize += sizeof( WCHAR ) *
3902  ( lstrlenW( lpSessDesc->u2.lpszPassword ) + 1 );
3903  }
3904  }
3905 
3906  return dwSize;
3907 }
LPWSTR lpszSessionName
Definition: dplay.h:243
#define lstrlenW
Definition: compat.h:415
LPSTR lpszSessionNameA
Definition: dplay.h:244
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ERR(fmt,...)
Definition: debug.h:109
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
LPSTR lpszPasswordA
Definition: dplay.h:250
LPWSTR lpszPassword
Definition: dplay.h:249
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54

Referenced by DP_GetSessionDesc(), and DP_SetSessionDesc().

◆ DP_CopyDPNAMEStruct()

static BOOL DP_CopyDPNAMEStruct ( LPDPNAME  lpDst,
const DPNAME lpSrc,
BOOL  bAnsi 
)
static

Definition at line 1399 of file dplay.c.

1400 {
1401  if( lpSrc == NULL )
1402  {
1403  ZeroMemory( lpDst, sizeof( *lpDst ) );
1404  lpDst->dwSize = sizeof( *lpDst );
1405  return TRUE;
1406  }
1407 
1408  if( lpSrc->dwSize != sizeof( *lpSrc) )
1409  {
1410  return FALSE;
1411  }
1412 
1413  /* Delete any existing pointers */
1414  HeapFree( GetProcessHeap(), 0, lpDst->u1.lpszShortNameA );
1415  HeapFree( GetProcessHeap(), 0, lpDst->u2.lpszLongNameA );
1416 
1417  /* Copy as required */
1418  CopyMemory( lpDst, lpSrc, lpSrc->dwSize );
1419 
1420  if( bAnsi )
1421  {
1422  if( lpSrc->u1.lpszShortNameA )
1423  {
1424  lpDst->u1.lpszShortNameA = HeapAlloc( GetProcessHeap(), 0,
1425  strlen(lpSrc->u1.lpszShortNameA)+1 );
1426  strcpy( lpDst->u1.lpszShortNameA, lpSrc->u1.lpszShortNameA );
1427  }
1428  if( lpSrc->u2.lpszLongNameA )
1429  {
1430  lpDst->u2.lpszLongNameA = HeapAlloc( GetProcessHeap(), 0,
1431  strlen(lpSrc->u2.lpszLongNameA)+1 );
1432  strcpy( lpDst->u2.lpszLongNameA, lpSrc->u2.lpszLongNameA );
1433  }
1434  }
1435  else
1436  {
1437  if( lpSrc->u1.lpszShortNameA )
1438  {
1439  lpDst->u1.lpszShortName = HeapAlloc( GetProcessHeap(), 0,
1440  (lstrlenW(lpSrc->u1.lpszShortName)+1)*sizeof(WCHAR) );
1441  lstrcpyW( lpDst->u1.lpszShortName, lpSrc->u1.lpszShortName );
1442  }
1443  if( lpSrc->u2.lpszLongNameA )
1444  {
1445  lpDst->u2.lpszLongName = HeapAlloc( GetProcessHeap(), 0,
1446  (lstrlenW(lpSrc->u2.lpszLongName)+1)*sizeof(WCHAR) );
1447  lstrcpyW( lpDst->u2.lpszLongName, lpSrc->u2.lpszLongName );
1448  }
1449  }
1450 
1451  return TRUE;
1452 }
#define TRUE
Definition: types.h:120
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define ZeroMemory
Definition: winbase.h:1642
LPSTR lpszLongNameA
Definition: dplay.h:200
#define lstrlenW
Definition: compat.h:415
smooth NULL
Definition: ftsmooth.c:416
LPSTR lpszShortNameA
Definition: dplay.h:194
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LPWSTR lpszLongName
Definition: dplay.h:199
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define CopyMemory
Definition: winbase.h:1640
LPWSTR lpszShortName
Definition: dplay.h:193
#define lstrcpyW
Definition: compat.h:414
DWORD dwSize
Definition: dplay.h:188
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by DP_CreateGroup(), DP_CreatePlayer(), DP_IF_SetGroupName(), and DP_IF_SetPlayerName().

◆ DP_CopySessionDesc()

static void DP_CopySessionDesc ( LPDPSESSIONDESC2  destSessionDesc,
LPCDPSESSIONDESC2  srcSessDesc,
BOOL  bAnsi 
)
static

Definition at line 3910 of file dplay.c.

3912 {
3913  BYTE* lpStartOfFreeSpace;
3914 
3915  if( lpSessionDest == NULL )
3916  {
3917  ERR( "NULL lpSessionDest\n" );
3918  return;
3919  }
3920 
3921  CopyMemory( lpSessionDest, lpSessionSrc, sizeof( *lpSessionSrc ) );
3922 
3923  lpStartOfFreeSpace = ((BYTE*)lpSessionDest) + sizeof( *lpSessionSrc );
3924 
3925  if( bAnsi )
3926  {
3927  if( lpSessionSrc->u1.lpszSessionNameA )
3928  {
3929  lstrcpyA( (LPSTR)lpStartOfFreeSpace,
3930  lpSessionDest->u1.lpszSessionNameA );
3931  lpSessionDest->u1.lpszSessionNameA = (LPSTR)lpStartOfFreeSpace;
3932  lpStartOfFreeSpace +=
3933  lstrlenA( lpSessionDest->u1.lpszSessionNameA ) + 1;
3934  }
3935 
3936  if( lpSessionSrc->u2.lpszPasswordA )
3937  {
3938  lstrcpyA( (LPSTR)lpStartOfFreeSpace,
3939  lpSessionDest->u2.lpszPasswordA );
3940  lpSessionDest->u2.lpszPasswordA = (LPSTR)lpStartOfFreeSpace;
3941  }
3942  }
3943  else /* UNICODE */
3944  {
3945  if( lpSessionSrc->u1.lpszSessionName )
3946  {
3947  lstrcpyW( (LPWSTR)lpStartOfFreeSpace,
3948  lpSessionDest->u1.lpszSessionName );
3949  lpSessionDest->u1.lpszSessionName = (LPWSTR)lpStartOfFreeSpace;
3950  lpStartOfFreeSpace += sizeof(WCHAR) *
3951  ( lstrlenW( lpSessionDest->u1.lpszSessionName ) + 1 );
3952  }
3953 
3954  if( lpSessionSrc->u2.lpszPassword )
3955  {
3956  lstrcpyW( (LPWSTR)lpStartOfFreeSpace,
3957  lpSessionDest->u2.lpszPassword );
3958  lpSessionDest->u2.lpszPassword = (LPWSTR)lpStartOfFreeSpace;
3959  }
3960  }
3961 }
char * LPSTR
Definition: xmlstorage.h:182
#define lstrlenW
Definition: compat.h:415
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define CopyMemory
Definition: winbase.h:1640
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
unsigned char BYTE
Definition: mem.h:68
#define ERR(fmt,...)
Definition: debug.h:109
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
#define lstrcpyW
Definition: compat.h:414
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by DP_GetSessionDesc(), and DP_SetSessionDesc().

◆ DP_CreateDirectPlay2()

static BOOL DP_CreateDirectPlay2 ( LPVOID  lpDP)
static

Definition at line 126 of file dplay.c.

127 {
128  IDirectPlayImpl *This = lpDP;
129 
130  This->dp2 = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->dp2) ) );
131  if ( This->dp2 == NULL )
132  {
133  return FALSE;
134  }
135 
136  This->dp2->bConnectionOpen = FALSE;
137 
138  This->dp2->hEnumSessionThread = INVALID_HANDLE_VALUE;
139  This->dp2->dwEnumSessionLock = 0;
140 
141  This->dp2->bHostInterface = FALSE;
142 
143  DPQ_INIT(This->dp2->receiveMsgs);
144  DPQ_INIT(This->dp2->sendMsgs);
145  DPQ_INIT(This->dp2->repliesExpected);
146 
147  if( !NS_InitializeSessionCache( &This->dp2->lpNameServerData ) )
148  {
149  /* FIXME: Memory leak */
150  return FALSE;
151  }
152 
153  /* Provide an initial session desc with nothing in it */
154  This->dp2->lpSessionDesc = HeapAlloc( GetProcessHeap(),
156  sizeof( *This->dp2->lpSessionDesc ) );
157  if( This->dp2->lpSessionDesc == NULL )
158  {
159  /* FIXME: Memory leak */
160  return FALSE;
161  }
162  This->dp2->lpSessionDesc->dwSize = sizeof( *This->dp2->lpSessionDesc );
163 
164  /* We are emulating a dp 6 implementation */
165  This->dp2->spData.dwSPVersion = DPSP_MAJORVERSION;
166 
167  This->dp2->spData.lpCB = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
168  sizeof( *This->dp2->spData.lpCB ) );
169  This->dp2->spData.lpCB->dwSize = sizeof( *This->dp2->spData.lpCB );
170  This->dp2->spData.lpCB->dwVersion = DPSP_MAJORVERSION;
171 
172  /* This is the pointer to the service provider */
173  if ( FAILED( dplaysp_create( &IID_IDirectPlaySP, (void**)&This->dp2->spData.lpISP, This ) ) )
174  {
175  /* FIXME: Memory leak */
176  return FALSE;
177  }
178 
179  /* Setup lobby provider information */
180  This->dp2->dplspData.dwSPVersion = DPSP_MAJORVERSION;
181  This->dp2->dplspData.lpCB = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
182  sizeof( *This->dp2->dplspData.lpCB ) );
183  This->dp2->dplspData.lpCB->dwSize = sizeof( *This->dp2->dplspData.lpCB );
184 
185  if( FAILED( dplobbysp_create( &IID_IDPLobbySP, (void**)&This->dp2->dplspData.lpISP, This ) )
186  )
187  {
188  /* FIXME: Memory leak */
189  return FALSE;
190  }
191 
192  return TRUE;
193 }
#define TRUE
Definition: types.h:120
#define DPQ_INIT(head)
Definition: dplayx_queue.h:54
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
HRESULT dplobbysp_create(REFIID riid, void **ppv, IDirectPlayImpl *dp) DECLSPEC_HIDDEN
Definition: lobbysp.c:230
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define DPSP_MAJORVERSION
Definition: dplaysp.h:40
BOOL NS_InitializeSessionCache(LPVOID *lplpNSInfo)
Definition: name_server.c:263
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
HRESULT dplaysp_create(REFIID riid, void **ppv, IDirectPlayImpl *dp) DECLSPEC_HIDDEN
Definition: dplaysp.c:686

Referenced by dplay_create().

◆ DP_CreateGroup()

static lpGroupData DP_CreateGroup ( IDirectPlayImpl This,
const DPID lpid,
const DPNAME lpName,
DWORD  dwFlags,
DPID  idParent,
BOOL  bAnsi 
)
static

Definition at line 999 of file dplay.c.

1001 {
1002  lpGroupData lpGData;
1003 
1004  /* Allocate the new space and add to end of high level group list */
1005  lpGData = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpGData ) );
1006 
1007  if( lpGData == NULL )
1008  {
1009  return NULL;
1010  }
1011 
1012  DPQ_INIT(lpGData->groups);
1013  DPQ_INIT(lpGData->players);
1014 
1015  /* Set the desired player ID - no sanity checking to see if it exists */
1016  lpGData->dpid = *lpid;
1017 
1018  DP_CopyDPNAMEStruct( &lpGData->name, lpName, bAnsi );
1019 
1020  /* FIXME: Should we check that the parent exists? */
1021  lpGData->parent = idParent;
1022 
1023  /* FIXME: Should we validate the dwFlags? */
1024  lpGData->dwFlags = dwFlags;
1025 
1026  TRACE( "Created group id 0x%08x\n", *lpid );
1027 
1028  return lpGData;
1029 }
#define DPQ_INIT(head)
Definition: dplayx_queue.h:54
_In_ LPCSTR lpName
Definition: winbase.h:2746
DWORD dwFlags
Definition: dplay_global.h:103
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static BOOL DP_CopyDPNAMEStruct(LPDPNAME lpDst, const DPNAME *lpSrc, BOOL bAnsi)
Definition: dplay.c:1399
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
DPID parent
Definition: dplay_global.h:94
DPNAME name
Definition: dplay_global.h:106
#define HEAP_ZERO_MEMORY
Definition: compat.h:123

Referenced by DP_IF_CreateGroup(), and DP_IF_CreateGroupInGroup().

◆ DP_CreatePlayer()

static lpPlayerData DP_CreatePlayer ( IDirectPlayImpl This,
DPID lpid,
DPNAME lpName,
DWORD  dwFlags,
HANDLE  hEvent,
BOOL  bAnsi 
)
static

Definition at line 1299 of file dplay.c.

1301 {
1302  lpPlayerData lpPData;
1303 
1304  TRACE( "(%p)->(%p,%p,%u)\n", This, lpid, lpName, bAnsi );
1305 
1306  /* Allocate the storage for the player and associate it with list element */
1307  lpPData = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpPData ) );
1308  if( lpPData == NULL )
1309  {
1310  return NULL;
1311  }
1312 
1313  /* Set the desired player ID */
1314  lpPData->dpid = *lpid;
1315 
1316  DP_CopyDPNAMEStruct( &lpPData->name, lpName, bAnsi );
1317 
1318  lpPData->dwFlags = dwFlags;
1319 
1320  /* If we were given an event handle, duplicate it */
1321  if( hEvent != 0 )
1322  {
1324  GetCurrentProcess(), &lpPData->hEvent,
1326  )
1327  {
1328  /* FIXME: Memory leak */
1329  ERR( "Can't duplicate player msg handle %p\n", hEvent );
1330  }
1331  }
1332 
1333  /* Initialize the SP data section */
1335 
1336  TRACE( "Created player id 0x%08x\n", *lpid );
1337 
1339  This->dp2->lpSessionDesc->dwCurrentPlayers++;
1340 
1341  return lpPData;
1342 }
LPVOID DPSP_CreateSPPlayerData(void) DECLSPEC_HIDDEN
Definition: dplaysp.c:711
_In_ LPCSTR lpName
Definition: winbase.h:2746
DWORD dwFlags
Definition: dplay_global.h:79
LPVOID lpSPPlayerData
Definition: dplay_global.h:77
static HANDLE hEvent
Definition: comm.c:54
#define DUPLICATE_SAME_ACCESS
#define DPLAYI_PLAYER_SYSPLAYER
Definition: dplaysp.h:56
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HANDLE WINAPI GetCurrentProcess(VOID)
Definition: proc.c:1138
static BOOL DP_CopyDPNAMEStruct(LPDPNAME lpDst, const DPNAME *lpSrc, BOOL bAnsi)
Definition: dplay.c:1399
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define ERR(fmt,...)
Definition: debug.h:109
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
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
DPNAME name
Definition: dplay_global.h:63
HANDLE hEvent
Definition: dplay_global.h:64

Referenced by DP_IF_CreatePlayer().

◆ DP_DeleteDPNameStruct()

static void DP_DeleteDPNameStruct ( LPDPNAME  lpDPName)
static

Definition at line 1346 of file dplay.c.

1347 {
1350 }
LPSTR lpszLongNameA
Definition: dplay.h:200
LPSTR lpszShortNameA
Definition: dplay.h:194
#define GetProcessHeap()
Definition: compat.h:403
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by DP_DeleteGroup(), and DP_DeletePlayer().

◆ DP_DeleteGroup()

static void DP_DeleteGroup ( IDirectPlayImpl This,
DPID  dpid 
)
static

Definition at line 1032 of file dplay.c.

1033 {
1034  lpGroupList lpGList;
1035 
1036  TRACE( "(%p)->(0x%08x)\n", This, dpid );
1037 
1038  DPQ_REMOVE_ENTRY( This->dp2->lpSysGroup->groups, groups, lpGData->dpid, ==, dpid, lpGList );
1039 
1040  if( lpGList == NULL )
1041  {
1042  ERR( "DPID 0x%08x not found\n", dpid );
1043  return;
1044  }
1045 
1046  if( --(lpGList->lpGData->uRef) )
1047  {
1048  FIXME( "Why is this not the last reference to group?\n" );
1049  DebugBreak();
1050  }
1051 
1052  /* Delete player */
1053  DP_DeleteDPNameStruct( &lpGList->lpGData->name );
1054  HeapFree( GetProcessHeap(), 0, lpGList->lpGData );
1055 
1056  /* Remove and Delete Player List object */
1057  HeapFree( GetProcessHeap(), 0, lpGList );
1058 
1059 }
lpGroupData lpGData
Definition: dplay_global.h:123
#define DPQ_REMOVE_ENTRY(head, elm, field, fieldCompareOperator, fieldToCompare, rc)
Definition: dplayx_queue.h:162
GLsizei GLuint * groups
Definition: glext.h:11113
#define FIXME(fmt,...)
Definition: debug.h:110
void WINAPI DebugBreak(void)
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
static void DP_DeleteDPNameStruct(LPDPNAME lpDPName)
Definition: dplay.c:1346
ULONG uRef
Definition: dplay_global.h:96
#define ERR(fmt,...)
Definition: debug.h:109
DPNAME name
Definition: dplay_global.h:106
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by DP_IF_DestroyGroup().

◆ DP_DeletePlayer()

static void DP_DeletePlayer ( IDirectPlayImpl This,
DPID  dpid 
)
static

Definition at line 1353 of file dplay.c.

1354 {
1355  lpPlayerList lpPList;
1356 
1357  TRACE( "(%p)->(0x%08x)\n", This, dpid );
1358 
1359  DPQ_REMOVE_ENTRY( This->dp2->lpSysGroup->players, players, lpPData->dpid, ==, dpid, lpPList );
1360 
1361  if( lpPList == NULL )
1362  {
1363  ERR( "DPID 0x%08x not found\n", dpid );
1364  return;
1365  }
1366 
1367  /* Verify that this is the last reference to the data */
1368  if( --(lpPList->lpPData->uRef) )
1369  {
1370  FIXME( "Why is this not the last reference to player?\n" );
1371  DebugBreak();
1372  }
1373 
1374  /* Delete player */
1375  DP_DeleteDPNameStruct( &lpPList->lpPData->name );
1376 
1377  CloseHandle( lpPList->lpPData->hEvent );
1378  HeapFree( GetProcessHeap(), 0, lpPList->lpPData );
1379 
1380  /* Delete Player List object */
1381  HeapFree( GetProcessHeap(), 0, lpPList );
1382 }
#define CloseHandle
Definition: compat.h:406
ULONG uRef
Definition: dplay_global.h:66
lpPlayerData lpPData
Definition: dplay_global.h:87
#define DPQ_REMOVE_ENTRY(head, elm, field, fieldCompareOperator, fieldToCompare, rc)
Definition: dplayx_queue.h:162
#define FIXME(fmt,...)
Definition: debug.h:110
void WINAPI DebugBreak(void)
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
static void DP_DeleteDPNameStruct(LPDPNAME lpDPName)
Definition: dplay.c:1346
#define ERR(fmt,...)
Definition: debug.h:109
#define HeapFree(x, y, z)
Definition: compat.h:402
DPNAME name
Definition: dplay_global.h:63
HANDLE hEvent
Definition: dplay_global.h:64

Referenced by DP_IF_DestroyPlayer().

◆ DP_DestroyDirectPlay2()

static BOOL DP_DestroyDirectPlay2 ( LPVOID  lpDP)
static

Definition at line 202 of file dplay.c.

203 {
204  IDirectPlayImpl *This = lpDP;
205 
206  if( This->dp2->hEnumSessionThread != INVALID_HANDLE_VALUE )
207  {
208  TerminateThread( This->dp2->hEnumSessionThread, 0 );
209  CloseHandle( This->dp2->hEnumSessionThread );
210  }
211 
212  /* Finish with the SP - have it shutdown */
213  if( This->dp2->spData.lpCB->ShutdownEx )
214  {
216 
217  TRACE( "Calling SP ShutdownEx\n" );
218 
219  data.lpISP = This->dp2->spData.lpISP;
220 
221  (*This->dp2->spData.lpCB->ShutdownEx)( &data );
222  }
223  else if (This->dp2->spData.lpCB->Shutdown ) /* obsolete interface */
224  {
225  TRACE( "Calling obsolete SP Shutdown\n" );
226  (*This->dp2->spData.lpCB->Shutdown)();
227  }
228 
229  /* Unload the SP (if it exists) */
230  if( This->dp2->hServiceProvider != 0 )
231  {
232  FreeLibrary( This->dp2->hServiceProvider );
233  }
234 
235  /* Unload the Lobby Provider (if it exists) */
236  if( This->dp2->hDPLobbyProvider != 0 )
237  {
238  FreeLibrary( This->dp2->hDPLobbyProvider );
239  }
240 
241  /* FIXME: Need to delete receive and send msgs queue contents */
242 
243  NS_DeleteSessionCache( This->dp2->lpNameServerData );
244 
245  HeapFree( GetProcessHeap(), 0, This->dp2->dplspData.lpCB);
246  HeapFree( GetProcessHeap(), 0, This->dp2->lpSessionDesc );
247 
248  IDirectPlaySP_Release( This->dp2->spData.lpISP );
249 
250  /* Delete the contents */
251  HeapFree( GetProcessHeap(), 0, This->dp2 );
252 
253  return TRUE;
254 }
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:406
BOOL WINAPI TerminateThread(IN HANDLE hThread, IN DWORD dwExitCode)
Definition: thread.c:586
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
void NS_DeleteSessionCache(LPVOID lpNSInfo)
Definition: name_server.c:283
#define TRACE(s)
Definition: solgame.cpp:4
#define FreeLibrary(x)
Definition: compat.h:413
#define GetProcessHeap()
Definition: compat.h:403
#define IDirectPlaySP_Release(p)
Definition: dplaysp.h:97
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by dplay_destroy().

◆ DP_EnumSessionsSendAsyncRequestThread()

static DWORD CALLBACK DP_EnumSessionsSendAsyncRequestThread ( LPVOID  lpContext)
static

Definition at line 2324 of file dplay.c.

2325 {
2326  EnumSessionAsyncCallbackData* data = lpContext;
2327  HANDLE hSuicideRequest = data->hSuicideRequest;
2328  DWORD dwTimeout = data->dwTimeout;
2329 
2330  TRACE( "Thread started with timeout = 0x%08x\n", dwTimeout );
2331 
2332  for( ;; )
2333  {
2334  HRESULT hr;
2335 
2336  /* Sleep up to dwTimeout waiting for request to terminate thread */
2337  if( WaitForSingleObject( hSuicideRequest, dwTimeout ) == WAIT_OBJECT_0 )
2338  {
2339  TRACE( "Thread terminating on terminate request\n" );
2340  break;
2341  }
2342 
2343  /* Now resend the enum request */
2344  hr = NS_SendSessionRequestBroadcast( &data->requestGuid,
2345  data->dwEnumSessionFlags,
2346  data->lpSpData );
2347 
2348  if( FAILED(hr) )
2349  {
2350  ERR( "Enum broadcase request failed: %s\n", DPLAYX_HresultToString(hr) );
2351  /* FIXME: Should we kill this thread? How to inform the main thread? */
2352  }
2353 
2354  }
2355 
2356  TRACE( "Thread terminating\n" );
2357 
2358  /* Clean up the thread data */
2359  CloseHandle( hSuicideRequest );
2360  HeapFree( GetProcessHeap(), 0, lpContext );
2361 
2362  /* FIXME: Need to have some notification to main app thread that this is
2363  * dead. It would serve two purposes. 1) allow sync on termination
2364  * so that we don't actually send something to ourselves when we
2365  * become name server (race condition) and 2) so that if we die
2366  * abnormally something else will be able to tell.
2367  */
2368 
2369  return 1;
2370 }
#define CloseHandle
Definition: compat.h:406
HRESULT hr
Definition: shlfolder.c:183
LPCSTR DPLAYX_HresultToString(HRESULT hr)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
HRESULT NS_SendSessionRequestBroadcast(LPCGUID lpcGuid, DWORD dwFlags, const SPINITDATA *lpSpData)
Definition: name_server.c:196
#define TRACE(s)
Definition: solgame.cpp:4
#define WAIT_OBJECT_0
Definition: winbase.h:387
#define GetProcessHeap()
Definition: compat.h:403
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define ERR(fmt,...)
Definition: debug.h:109
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD dwTimeout
Definition: wincrypt.h:6081
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by IDirectPlay4Impl_EnumSessions().

◆ DP_FindAnyGroup()

static lpGroupData DP_FindAnyGroup ( IDirectPlayImpl This,
DPID  dpid 
)
static

Definition at line 1061 of file dplay.c.

1062 {
1063  lpGroupList lpGroups;
1064 
1065  TRACE( "(%p)->(0x%08x)\n", This, dpid );
1066 
1067  if( dpid == DPID_SYSTEM_GROUP )
1068  {
1069  return This->dp2->lpSysGroup;
1070  }
1071  else
1072  {
1073  DPQ_FIND_ENTRY( This->dp2->lpSysGroup->groups, groups, lpGData->dpid, ==, dpid, lpGroups );
1074  }
1075 
1076  if( lpGroups == NULL )
1077  {
1078  return NULL;
1079  }
1080 
1081  return lpGroups->lpGData;
1082 }
#define DPQ_FIND_ENTRY(head, elm, field, fieldCompareOperator, fieldToCompare, rc)
Definition: dplayx_queue.h:100
lpGroupData lpGData
Definition: dplay_global.h:123
GLsizei GLuint * groups
Definition: glext.h:11113
#define DPID_SYSTEM_GROUP
Definition: dplay.c:78
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by DP_IF_CreateGroupInGroup(), DP_IF_DestroyGroup(), DP_IF_GetGroupName(), DP_IF_SetGroupName(), IDirectPlay4Impl_AddGroupToGroup(), IDirectPlay4Impl_AddPlayerToGroup(), IDirectPlay4Impl_DeleteGroupFromGroup(), IDirectPlay4Impl_DeletePlayerFromGroup(), IDirectPlay4Impl_EnumGroupPlayers(), IDirectPlay4Impl_EnumGroupsInGroup(), IDirectPlay4Impl_GetGroupData(), IDirectPlay4Impl_GetGroupParent(), IDirectPlay4Impl_SendEx(), and IDirectPlay4Impl_SetGroupData().

◆ DP_FindPlayer()

static lpPlayerList DP_FindPlayer ( IDirectPlayImpl This,
DPID  dpid 
)
static

Definition at line 1384 of file dplay.c.

1385 {
1386  lpPlayerList lpPlayers;
1387 
1388  TRACE( "(%p)->(0x%08x)\n", This, dpid );
1389 
1390  if(This->dp2->lpSysGroup == NULL)
1391  return NULL;
1392 
1393  DPQ_FIND_ENTRY( This->dp2->lpSysGroup->players, players, lpPData->dpid, ==, dpid, lpPlayers );
1394 
1395  return lpPlayers;
1396 }
#define DPQ_FIND_ENTRY(head, elm, field, fieldCompareOperator, fieldToCompare, rc)
Definition: dplayx_queue.h:100
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by DP_GetSPPlayerData(), DP_IF_DestroyPlayer(), DP_IF_GetPlayerName(), DP_IF_SetPlayerName(), DP_SetSPPlayerData(), IDirectPlay4Impl_AddPlayerToGroup(), IDirectPlay4Impl_DeletePlayerFromGroup(), IDirectPlay4Impl_GetPlayerData(), IDirectPlay4Impl_SendEx(), and IDirectPlay4Impl_SetPlayerData().

◆ DP_GetRemoteNextObjectId()

static DPID DP_GetRemoteNextObjectId ( void  )
static

Definition at line 1780 of file dplay.c.

1781 {
1782  FIXME( ":stub\n" );
1783 
1784  /* Hack solution */
1785  return DP_NextObjectId();
1786 }
#define FIXME(fmt,...)
Definition: debug.h:110
static DPID DP_NextObjectId(void)
Definition: dplay.c:264

Referenced by DP_IF_CreateGroup().

◆ DP_GetSessionDesc()

static HRESULT DP_GetSessionDesc ( IDirectPlayImpl This,
void lpData,
DWORD lpdwDataSize,
BOOL  bAnsi 
)
static

Definition at line 3091 of file dplay.c.

3093 {
3094  DWORD dwRequiredSize;
3095 
3096  TRACE( "(%p)->(%p,%p,%u)\n", This, lpData, lpdwDataSize, bAnsi );
3097 
3098  if( This->dp2->connectionInitialized == NO_PROVIDER )
3099  {
3100  return DPERR_UNINITIALIZED;
3101  }
3102 
3103  if( ( lpData == NULL ) && ( lpdwDataSize == NULL ) )
3104  {
3105  return DPERR_INVALIDPARAMS;
3106  }
3107 
3108  /* FIXME: Get from This->dp2->lpSessionDesc */
3109  dwRequiredSize = DP_CalcSessionDescSize( This->dp2->lpSessionDesc, bAnsi );
3110 
3111  if ( ( lpData == NULL ) ||
3112  ( *lpdwDataSize < dwRequiredSize )
3113  )
3114  {
3115  *lpdwDataSize = dwRequiredSize;
3116  return DPERR_BUFFERTOOSMALL;
3117  }
3118 
3119  DP_CopySessionDesc( lpData, This->dp2->lpSessionDesc, bAnsi );
3120 
3121  return DP_OK;
3122 }
#define DPERR_UNINITIALIZED
Definition: dplay.h:125
#define DPERR_BUFFERTOOSMALL
Definition: dplay.h:92
#define DPERR_INVALIDPARAMS
Definition: dplay.h:103
#define DP_OK
Definition: dplay.h:88
smooth NULL
Definition: ftsmooth.c:416
static DWORD DP_CalcSessionDescSize(LPCDPSESSIONDESC2 lpSessDesc, BOOL bAnsi)
Definition: dplay.c:3866
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
static void DP_CopySessionDesc(LPDPSESSIONDESC2 destSessionDesc, LPCDPSESSIONDESC2 srcSessDesc, BOOL bAnsi)
Definition: dplay.c:3910

Referenced by IDirectPlay4AImpl_GetSessionDesc(), and IDirectPlay4Impl_GetSessionDesc().

◆ DP_GetSpLpGuidFromCompoundAddress()

static BOOL CALLBACK DP_GetSpLpGuidFromCompoundAddress ( REFGUID  guidDataType,
DWORD  dwDataSize,
LPCVOID  lpData,
LPVOID  lpContext 
)
static

Definition at line 4584 of file dplay.c.

4589 {
4590  /* Looking for the GUID of the provider to load */
4591  if( ( IsEqualGUID( guidDataType, &DPAID_ServiceProvider ) ) ||
4592  ( IsEqualGUID( guidDataType, &DPAID_LobbyProvider ) )
4593  )
4594  {
4595  TRACE( "Found SP/LP (%s) %s (data size = 0x%08x)\n",
4596  debugstr_guid( guidDataType ), debugstr_guid( lpData ), dwDataSize );
4597 
4598  if( dwDataSize != sizeof( GUID ) )
4599  {
4600  ERR( "Invalid sp/lp guid size 0x%08x\n", dwDataSize );
4601  }
4602 
4603  memcpy( lpContext, lpData, dwDataSize );
4604 
4605  /* There shouldn't be more than 1 GUID/compound address */
4606  return FALSE;
4607  }
4608 
4609  /* Still waiting for what we want */
4610  return TRUE;
4611 }
#define TRUE
Definition: types.h:120
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define ERR(fmt,...)
Definition: debug.h:109
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

Referenced by IDirectPlay4Impl_InitializeConnection().

◆ DP_GetSPPlayerData()

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

Definition at line 5718 of file dplay.c.

5719 {
5720  lpPlayerList lpPlayer = DP_FindPlayer( lpDP, idPlayer );
5721 
5722  if( lpPlayer == NULL )
5723  {
5724  return DPERR_INVALIDPLAYER;
5725  }
5726 
5727  *lplpData = lpPlayer->lpPData->lpSPPlayerData;
5728 
5729  return DP_OK;
5730 }
#define DPERR_INVALIDPLAYER
Definition: dplay.h:104
lpPlayerData lpPData
Definition: dplay_global.h:87
LPVOID lpSPPlayerData
Definition: dplay_global.h:77
#define DP_OK
Definition: dplay.h:88
static lpPlayerList DP_FindPlayer(IDirectPlayImpl *This, DPID dpid)
Definition: dplay.c:1384
smooth NULL
Definition: ftsmooth.c:416

Referenced by IDirectPlaySPImpl_GetSPPlayerData(), and IDirectPlaySPImpl_SetSPPlayerData().

◆ DP_HandleMessage()

HRESULT DP_HandleMessage ( IDirectPlayImpl This,
const void lpcMessageBody,
DWORD  dwMessageBodySize,
const void lpcMessageHeader,
WORD  wCommandId,
WORD  wVersion,
void **  lplpReply,
DWORD lpdwMsgSize 
)

Definition at line 270 of file dplay.c.

273 {
274  TRACE( "(%p)->(%p,0x%08x,%p,%u,%u)\n",
275  This, lpcMessageBody, dwMessageBodySize, lpcMessageHeader, wCommandId,
276  wVersion );
277 
278  switch( wCommandId )
279  {
280  /* Name server needs to handle this request */
282  /* Reply expected */
283  NS_ReplyToEnumSessionsRequest( lpcMessageBody, lplpReply, lpdwMsgSize, This );
284  break;
285 
286  /* Name server needs to handle this request */
288  /* No reply expected */
289  NS_AddRemoteComputerAsNameServer( lpcMessageHeader,
290  This->dp2->spData.dwSPHeaderSize,
291  lpcMessageBody,
292  This->dp2->lpNameServerData );
293  break;
294 
296  {
297  LPCDPMSG_REQUESTNEWPLAYERID lpcMsg = lpcMessageBody;
298 
299  LPDPMSG_NEWPLAYERIDREPLY lpReply;
300 
301  *lpdwMsgSize = This->dp2->spData.dwSPHeaderSize + sizeof( *lpReply );
302 
303  *lplpReply = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, *lpdwMsgSize );
304 
305  FIXME( "Ignoring dwFlags 0x%08x in request msg\n",
306  lpcMsg->dwFlags );
307 
308  /* Setup the reply */
309  lpReply = (LPDPMSG_NEWPLAYERIDREPLY)( (BYTE*)(*lplpReply) +
310  This->dp2->spData.dwSPHeaderSize );
311 
314  lpReply->envelope.wVersion = DPMSGVER_DP6;
315 
316  lpReply->dpidNewPlayerId = DP_NextObjectId();
317 
318  TRACE( "Allocating new playerid 0x%08x from remote request\n",
319  lpReply->dpidNewPlayerId );
320  break;
321  }
322 
325  DP_MSG_ReplyReceived( This, wCommandId, lpcMessageBody, dwMessageBodySize );
326  break;
327 
329  TRACE( "GOT THE SELF MESSAGE: %p -> 0x%08x\n", lpcMessageHeader, ((const DWORD *)lpcMessageHeader)[1] );
330  NS_SetLocalAddr( This->dp2->lpNameServerData, lpcMessageHeader, 20 );
331  DP_MSG_ReplyReceived( This, wCommandId, lpcMessageBody, dwMessageBodySize );
332 
334  TRACE( "Sending message to self to get my addr\n" );
335  DP_MSG_ToSelf( This, 1 ); /* This is a hack right now */
336  break;
337 
339  DP_MSG_ErrorReceived( This, wCommandId, lpcMessageBody, dwMessageBodySize );
340  break;
341 
342  default:
343  FIXME( "Unknown wCommandId %u. Ignoring message\n", wCommandId );
344  DebugBreak();
345  break;
346  }
347 
348  /* FIXME: There is code in dplaysp.c to handle dplay commands. Move to here. */
349 
350  return DP_OK;
351 }
void NS_ReplyToEnumSessionsRequest(const void *lpcMsg, void **lplpReplyData, DWORD *lpdwReplySize, IDirectPlayImpl *lpDP)
Definition: name_server.c:358
#define DPMSGCMD_ENUMSESSIONSREPLY
void NS_SetLocalAddr(LPVOID lpNSInfo, LPCVOID lpHdr, DWORD dwHdrSize)
Definition: name_server.c:184
struct tagDPMSG_NEWPLAYERIDREPLY * LPDPMSG_NEWPLAYERIDREPLY
void DP_MSG_ReplyReceived(IDirectPlayImpl *This, WORD wCommandId, const void *lpcMsgBody, DWORD dwMsgBodySize)
#define DPMSGCMD_ENUMSESSIONSREQUEST
#define DP_OK
Definition: dplay.h:88
void DP_MSG_ToSelf(IDirectPlayImpl *This, DPID dpidSelf)
#define FIXME(fmt,...)
Definition: debug.h:110
void WINAPI DebugBreak(void)
#define DPMSGCMD_FORWARDADDPLAYERNACK
static DPID DP_NextObjectId(void)
Definition: dplay.c:264
#define DPMSGCMD_JUSTENVELOPE
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define DPMSGVER_DP6
DPMSG_SENDENVELOPE envelope
unsigned long DWORD
Definition: ntddk_ex.h:95
#define DPMSGMAGIC_DPLAYMSG
#define DPMSGCMD_REQUESTNEWPLAYERID
unsigned char BYTE
Definition: mem.h:68
void DP_MSG_ErrorReceived(IDirectPlayImpl *This, WORD wCommandId, const void *lpMsgBody, DWORD dwMsgBodySize)
void NS_AddRemoteComputerAsNameServer(LPCVOID lpcNSAddrHdr, DWORD dwHdrSize, LPCDPMSG_ENUMSESSIONSREPLY lpcMsg, LPVOID lpNSInfo)
Definition: name_server.c:87
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define DPMSGCMD_GETNAMETABLEREPLY
#define DPMSGCMD_FORWARDADDPLAYER
#define DPMSGCMD_NEWPLAYERIDREPLY

Referenced by IDirectPlaySPImpl_HandleMessage().

◆ DP_IF_CreateGroup()

static HRESULT DP_IF_CreateGroup ( IDirectPlayImpl This,
void lpMsgHdr,
DPID lpidGroup,
DPNAME lpGroupName,
void lpData,
DWORD  dwDataSize,
DWORD  dwFlags,
BOOL  bAnsi 
)
static

Definition at line 1084 of file dplay.c.

1086 {
1087  lpGroupData lpGData;
1088 
1089  TRACE( "(%p)->(%p,%p,%p,%p,0x%08x,0x%08x,%u)\n",
1090  This, lpMsgHdr, lpidGroup, lpGroupName, lpData, dwDataSize,
1091  dwFlags, bAnsi );
1092 
1093  if( This->dp2->connectionInitialized == NO_PROVIDER )
1094  {
1095  return DPERR_UNINITIALIZED;
1096  }
1097 
1098  /* If the name is not specified, we must provide one */
1099  if( DPID_UNKNOWN == *lpidGroup )
1100  {
1101  /* If we are the name server, we decide on the group ids. If not, we
1102  * must ask for one before attempting a creation.
1103  */
1104  if( This->dp2->bHostInterface )
1105  {
1106  *lpidGroup = DP_NextObjectId();
1107  }
1108  else
1109  {
1110  *lpidGroup = DP_GetRemoteNextObjectId();
1111  }
1112  }
1113 
1114  lpGData = DP_CreateGroup( This, lpidGroup, lpGroupName, dwFlags,
1115  DPID_NOPARENT_GROUP, bAnsi );
1116 
1117  if( lpGData == NULL )
1118  {
1119  return DPERR_CANTADDPLAYER; /* yes player not group */
1120  }
1121 
1122  if( DPID_SYSTEM_GROUP == *lpidGroup )
1123  {
1124  This->dp2->lpSysGroup = lpGData;
1125  TRACE( "Inserting system group\n" );
1126  }
1127  else
1128  {
1129  /* Insert into the system group */
1130  lpGroupList lpGroup = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpGroup ) );
1131  lpGroup->lpGData = lpGData;
1132 
1133  DPQ_INSERT( This->dp2->lpSysGroup->groups, lpGroup, groups );
1134  }
1135 
1136  /* Something is now referencing this data */
1137  lpGData->uRef++;
1138 
1139  /* Set all the important stuff for the group */
1140  DP_SetGroupData( lpGData, DPSET_REMOTE, lpData, dwDataSize );
1141 
1142  /* FIXME: We should only create the system group if GetCaps returns
1143  * DPCAPS_GROUPOPTIMIZED.
1144  */
1145 
1146  /* Let the SP know that we've created this group */
1147  if( This->dp2->spData.lpCB->CreateGroup )
1148  {
1150  DWORD dwCreateFlags = 0;
1151 
1152  TRACE( "Calling SP CreateGroup\n" );
1153 
1154  if( *lpidGroup == DPID_NOPARENT_GROUP )
1155  dwCreateFlags |= DPLAYI_GROUP_SYSGROUP;
1156 
1157  if( lpMsgHdr == NULL )
1158  dwCreateFlags |= DPLAYI_PLAYER_PLAYERLOCAL;
1159 
1160  if( dwFlags & DPGROUP_HIDDEN )
1161  dwCreateFlags |= DPLAYI_GROUP_HIDDEN;
1162 
1163  data.idGroup = *lpidGroup;
1164  data.dwFlags = dwCreateFlags;
1165  data.lpSPMessageHeader = lpMsgHdr;
1166  data.lpISP = This->dp2->spData.lpISP;
1167 
1168  (*This->dp2->spData.lpCB->CreateGroup)( &data );
1169  }
1170 
1171  /* Inform all other peers of the creation of a new group. If there are
1172  * no peers keep this event quiet.
1173  * Also if this message was sent to us, don't rebroadcast.
1174  */
1175  if( ( lpMsgHdr == NULL ) &&
1176  This->dp2->lpSessionDesc &&
1177  ( This->dp2->lpSessionDesc->dwFlags & DPSESSION_MULTICASTSERVER ) )
1178  {
1180  msg.dwType = DPSYS_CREATEPLAYERORGROUP;
1181 
1182  msg.dwPlayerType = DPPLAYERTYPE_GROUP;
1183  msg.dpId = *lpidGroup;
1184  msg.dwCurrentPlayers = 0; /* FIXME: Incorrect? */
1185  msg.lpData = lpData;
1186  msg.dwDataSize = dwDataSize;
1187  msg.dpnName = *lpGroupName;
1188  msg.dpIdParent = DPID_NOPARENT_GROUP;
1189  msg.dwFlags = DPMSG_CREATEGROUP_DWFLAGS( dwFlags );
1190 
1191  /* FIXME: Correct to just use send effectively? */
1192  /* FIXME: Should size include data w/ message or just message "header" */
1193  /* FIXME: Check return code */
1194  IDirectPlayX_SendEx( &This->IDirectPlay4_iface, DPID_SERVERPLAYER, DPID_ALLPLAYERS, 0, &msg,
1195  sizeof( msg ), 0, 0, NULL, NULL );
1196  }
1197 
1198  return DP_OK;
1199 }
#define DPGROUP_HIDDEN
Definition: dplay.h:1013
#define DPSET_REMOTE
Definition: dplay.h:1056
#define DPMSG_CREATEGROUP_DWFLAGS(x)
Definition: dplay.c:83
#define DPERR_UNINITIALIZED
Definition: dplay.h:125
#define DPLAYI_GROUP_SYSGROUP
Definition: dplaysp.h:60
lpGroupData lpGData
Definition: dplay_global.h:123
#define DPID_ALLPLAYERS
Definition: dplay.h:162
GLsizei GLuint * groups
Definition: glext.h:11113
#define DP_OK
Definition: dplay.h:88
#define DPID_SYSTEM_GROUP
Definition: dplay.c:78
#define DPSYS_CREATEPLAYERORGROUP
Definition: dplay.h:1085
smooth NULL
Definition: ftsmooth.c:416
static DPID DP_NextObjectId(void)
Definition: dplay.c:264
#define DPSESSION_MULTICASTSERVER
Definition: dplay.h:276
#define IDirectPlayX_SendEx(p, a, b, c, d, e, f, g, h, i)
Definition: dplay.h:916
#define DPPLAYERTYPE_GROUP
Definition: dplay.h:1134
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define DPID_SERVERPLAYER
Definition: dplay.h:163
ULONG uRef
Definition: dplay_global.h:96
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static DPID DP_GetRemoteNextObjectId(void)
Definition: dplay.c:1780
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
static lpGroupData DP_CreateGroup(IDirectPlayImpl *This, const DPID *lpid, const DPNAME *lpName, DWORD dwFlags, DPID idParent, BOOL bAnsi)
Definition: dplay.c:999
#define DPLAYI_GROUP_HIDDEN
Definition: dplaysp.h:63
#define DPID_NOPARENT_GROUP
Definition: dplay.c:77
static void DP_SetGroupData(lpGroupData lpGData, DWORD dwFlags, LPVOID lpData, DWORD dwDataSize)
Definition: dplay.c:1257
#define DPLAYI_PLAYER_PLAYERLOCAL
Definition: dplaysp.h:59
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define msg(x)
Definition: auth_time.c:54
#define DPERR_CANTADDPLAYER
Definition: dplay.h:93
#define DPID_UNKNOWN
Definition: dplay.h:164
#define DPQ_INSERT(a, b, c)
Definition: dplayx_queue.h:34

Referenced by DP_SecureOpen(), IDirectPlay4AImpl_CreateGroup(), IDirectPlay4Impl_CreateGroup(), and IDirectPlaySPImpl_HandleMessage().

◆ DP_IF_CreateGroupInGroup()

static HRESULT DP_IF_CreateGroupInGroup ( IDirectPlayImpl This,
void lpMsgHdr,
DPID  idParentGroup,
DPID lpidGroup,
DPNAME lpGroupName,
void lpData,
DWORD  dwDataSize,
DWORD  dwFlags,
BOOL  bAnsi 
)
static

Definition at line 4020 of file dplay.c.

4023 {
4024  lpGroupData lpGParentData;
4025  lpGroupList lpGList;
4026  lpGroupData lpGData;
4027 
4028  TRACE( "(%p)->(0x%08x,%p,%p,%p,0x%08x,0x%08x,%u)\n",
4029  This, idParentGroup, lpidGroup, lpGroupName, lpData,
4030  dwDataSize, dwFlags, bAnsi );
4031 
4032  if( This->dp2->connectionInitialized == NO_PROVIDER )
4033  {
4034  return DPERR_UNINITIALIZED;
4035  }
4036 
4037  /* Verify that the specified parent is valid */
4038  if( ( lpGParentData = DP_FindAnyGroup(This, idParentGroup ) ) == NULL )
4039  return DPERR_INVALIDGROUP;
4040 
4041  lpGData = DP_CreateGroup(This, lpidGroup, lpGroupName, dwFlags, idParentGroup, bAnsi );
4042 
4043  if( lpGData == NULL )
4044  {
4045  return DPERR_CANTADDPLAYER; /* yes player not group */
4046  }
4047 
4048  /* Something else is referencing this data */
4049  lpGData->uRef++;
4050 
4051  DP_SetGroupData( lpGData, DPSET_REMOTE, lpData, dwDataSize );
4052 
4053  /* The list has now been inserted into the interface group list. We now
4054  need to put a "shortcut" to this group in the parent group */
4055  lpGList = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpGList ) );
4056  if( lpGList == NULL )
4057  {
4058  FIXME( "Memory leak\n" );
4059  return DPERR_CANTADDPLAYER; /* yes player not group */
4060  }
4061 
4062  lpGList->lpGData = lpGData;
4063 
4064  DPQ_INSERT( lpGParentData->groups, lpGList, groups );
4065 
4066  /* Let the SP know that we've created this group */
4067  if( This->dp2->spData.lpCB->CreateGroup )
4068  {
4070 
4071  TRACE( "Calling SP CreateGroup\n" );
4072 
4073  data.idGroup = *lpidGroup;
4074  data.dwFlags = dwFlags;
4075  data.lpSPMessageHeader = lpMsgHdr;
4076  data.lpISP = This->dp2->spData.lpISP;
4077 
4078  (*This->dp2->spData.lpCB->CreateGroup)( &data );
4079  }
4080 
4081  /* Inform all other peers of the creation of a new group. If there are
4082  * no peers keep this quiet.
4083  */
4084  if( This->dp2->lpSessionDesc &&
4085  ( This->dp2->lpSessionDesc->dwFlags & DPSESSION_MULTICASTSERVER ) )
4086  {
4088 
4089  msg.dwType = DPSYS_CREATEPLAYERORGROUP;
4090  msg.dwPlayerType = DPPLAYERTYPE_GROUP;
4091  msg.dpId = *lpidGroup;
4092  msg.dwCurrentPlayers = idParentGroup; /* FIXME: Incorrect? */
4093  msg.lpData = lpData;
4094  msg.dwDataSize = dwDataSize;
4095  msg.dpnName = *lpGroupName;
4096 
4097  /* FIXME: Correct to just use send effectively? */
4098  /* FIXME: Should size include data w/ message or just message "header" */
4099  /* FIXME: Check return code */
4100  IDirectPlayX_SendEx( &This->IDirectPlay4_iface, DPID_SERVERPLAYER, DPID_ALLPLAYERS, 0, &msg,
4101  sizeof( msg ), 0, 0, NULL, NULL );
4102  }
4103 
4104  return DP_OK;
4105 }
#define DPSET_REMOTE
Definition: dplay.h:1056
#define DPERR_UNINITIALIZED
Definition: dplay.h:125
static lpGroupData DP_FindAnyGroup(IDirectPlayImpl *This, DPID dpid)
Definition: dplay.c:1061
#define DPERR_INVALIDGROUP
Definition: dplay.h:105
lpGroupData lpGData
Definition: dplay_global.h:123
#define DPID_ALLPLAYERS
Definition: dplay.h:162
GLsizei GLuint * groups
Definition: glext.h:11113
#define DP_OK
Definition: dplay.h:88
#define DPSYS_CREATEPLAYERORGROUP
Definition: dplay.h:1085
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define DPSESSION_MULTICASTSERVER
Definition: dplay.h:276
#define IDirectPlayX_SendEx(p, a, b, c, d, e, f, g, h, i)
Definition: dplay.h:916
#define DPPLAYERTYPE_GROUP
Definition: dplay.h:1134
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define DPID_SERVERPLAYER
Definition: dplay.h:163
ULONG uRef
Definition: dplay_global.h:96
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
static lpGroupData DP_CreateGroup(IDirectPlayImpl *This, const DPID *lpid, const DPNAME *lpName, DWORD dwFlags, DPID idParent, BOOL bAnsi)
Definition: dplay.c:999
static void DP_SetGroupData(lpGroupData lpGData, DWORD dwFlags, LPVOID lpData, DWORD dwDataSize)
Definition: dplay.c:1257
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define msg(x)
Definition: auth_time.c:54
#define DPERR_CANTADDPLAYER
Definition: dplay.h:93
#define DPQ_INSERT(a, b, c)
Definition: dplayx_queue.h:34

Referenced by IDirectPlay4AImpl_CreateGroupInGroup(), IDirectPlay4Impl_CreateGroupInGroup(), and IDirectPlaySPImpl_HandleMessage().

◆ DP_IF_CreatePlayer()

static HRESULT DP_IF_CreatePlayer ( IDirectPlayImpl This,
void lpMsgHdr,
DPID lpidPlayer,
DPNAME lpPlayerName,
HANDLE  hEvent,
void lpData,
DWORD  dwDataSize,
DWORD  dwFlags,
BOOL  bAnsi 
)
static

Definition at line 1498 of file dplay.c.

1501 {
1502  HRESULT hr = DP_OK;
1503  lpPlayerData lpPData;
1504  lpPlayerList lpPList;
1505  DWORD dwCreateFlags = 0;
1506 
1507  TRACE( "(%p)->(%p,%p,%p,%p,0x%08x,0x%08x,%u)\n",
1508  This, lpidPlayer, lpPlayerName, hEvent, lpData,
1509  dwDataSize, dwFlags, bAnsi );
1510  if( This->dp2->connectionInitialized == NO_PROVIDER )
1511  {
1512  return DPERR_UNINITIALIZED;
1513  }
1514 
1515  if( dwFlags == 0 )
1516  {
1518  }
1519 
1520  if( lpidPlayer == NULL )
1521  {
1522  return DPERR_INVALIDPARAMS;
1523  }
1524 
1525 
1526  /* Determine the creation flags for the player. These will be passed
1527  * to the name server if requesting a player id and to the SP when
1528  * informing it of the player creation
1529  */
1530  {
1532  {
1533  if( *lpidPlayer == DPID_SERVERPLAYER )
1534  {
1535  /* Server player for the host interface */
1536  dwCreateFlags |= DPLAYI_PLAYER_APPSERVER;
1537  }
1538  else if( *lpidPlayer == DPID_NAME_SERVER )
1539  {
1540  /* Name server - master of everything */
1542  }
1543  else
1544  {
1545  /* Server player for a non host interface */
1546  dwCreateFlags |= DPLAYI_PLAYER_SYSPLAYER;
1547  }
1548  }
1549 
1550  if( lpMsgHdr == NULL )
1551  dwCreateFlags |= DPLAYI_PLAYER_PLAYERLOCAL;
1552  }
1553 
1554  /* Verify we know how to handle all the flags */
1555  if( !( ( dwFlags & DPPLAYER_SERVERPLAYER ) ||
1557  )
1558  )
1559  {
1560  /* Assume non fatal failure */
1561  ERR( "unknown dwFlags = 0x%08x\n", dwFlags );
1562  }
1563 
1564  /* If the name is not specified, we must provide one */
1565  if( *lpidPlayer == DPID_UNKNOWN )
1566  {
1567  /* If we are the session master, we dish out the group/player ids */
1568  if( This->dp2->bHostInterface )
1569  {
1570  *lpidPlayer = DP_NextObjectId();
1571  }
1572  else
1573  {
1574  hr = DP_MSG_SendRequestPlayerId( This, dwCreateFlags, lpidPlayer );
1575 
1576  if( FAILED(hr) )
1577  {
1578  ERR( "Request for ID failed: %s\n", DPLAYX_HresultToString( hr ) );
1579  return hr;
1580  }
1581  }
1582  }
1583  else
1584  {
1585  /* FIXME: Would be nice to perhaps verify that we don't already have
1586  * this player.
1587  */
1588  }
1589 
1590  /* We pass creation flags, so we can distinguish sysplayers and not count them in the current
1591  player total */
1592  lpPData = DP_CreatePlayer( This, lpidPlayer, lpPlayerName, dwCreateFlags,
1593  hEvent, bAnsi );
1594  /* Create the list object and link it in */
1595  lpPList = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpPList ) );
1596  if( !lpPData || !lpPList )
1597  {
1598  HeapFree( GetProcessHeap(), 0, lpPData );
1599  HeapFree( GetProcessHeap(), 0, lpPList );
1600  return DPERR_CANTADDPLAYER;
1601  }
1602 
1603  lpPData->uRef = 1;
1604  lpPList->lpPData = lpPData;
1605 
1606  /* Add the player to the system group */
1607  DPQ_INSERT( This->dp2->lpSysGroup->players, lpPList, players );
1608 
1609  /* Update the information and send it to all players in the session */
1610  DP_SetPlayerData( lpPData, DPSET_REMOTE, lpData, dwDataSize );
1611 
1612  /* Let the SP know that we've created this player */
1613  if( This->dp2->spData.lpCB->CreatePlayer )
1614  {
1616 
1617  data.idPlayer = *lpidPlayer;
1618  data.dwFlags = dwCreateFlags;
1619  data.lpSPMessageHeader = lpMsgHdr;
1620  data.lpISP = This->dp2->spData.lpISP;
1621 
1622  TRACE( "Calling SP CreatePlayer 0x%08x: dwFlags: 0x%08x lpMsgHdr: %p\n",
1623  *lpidPlayer, data.dwFlags, data.lpSPMessageHeader );
1624 
1625  hr = (*This->dp2->spData.lpCB->CreatePlayer)( &data );
1626  }
1627 
1628  if( FAILED(hr) )
1629  {
1630  ERR( "Failed to create player with sp: %s\n", DPLAYX_HresultToString(hr) );
1631  return hr;
1632  }
1633 
1634  /* Now let the SP know that this player is a member of the system group */
1635  if( This->dp2->spData.lpCB->AddPlayerToGroup )
1636  {
1638 
1639  data.idPlayer = *lpidPlayer;
1640  data.idGroup = DPID_SYSTEM_GROUP;
1641  data.lpISP = This->dp2->spData.lpISP;
1642 
1643  TRACE( "Calling SP AddPlayerToGroup (sys group)\n" );
1644 
1645  hr = (*This->dp2->spData.lpCB->AddPlayerToGroup)( &data );
1646  }
1647 
1648  if( FAILED(hr) )
1649  {
1650  ERR( "Failed to add player to sys group with sp: %s\n",
1652  return hr;
1653  }
1654 
1655 #if 1
1656  if( !This->dp2->bHostInterface )
1657  {
1658  /* Let the name server know about the creation of this player */
1659  /* FIXME: Is this only to be done for the creation of a server player or
1660  * is this used for regular players? If only for server players, move
1661  * this call to DP_SecureOpen(...);
1662  */
1663 #if 0
1664  TRACE( "Sending message to self to get my addr\n" );
1665  DP_MSG_ToSelf( This, *lpidPlayer ); /* This is a hack right now */
1666 #endif
1667 
1668  hr = DP_MSG_ForwardPlayerCreation( This, *lpidPlayer);
1669  }
1670 #else
1671  /* Inform all other peers of the creation of a new player. If there are
1672  * no peers keep this quiet.
1673  * Also, if this was a remote event, no need to rebroadcast it.
1674  */
1675  if( ( lpMsgHdr == NULL ) &&
1676  This->dp2->lpSessionDesc &&
1677  ( This->dp2->lpSessionDesc->dwFlags & DPSESSION_MULTICASTSERVER ) )
1678  {
1680  msg.dwType = DPSYS_CREATEPLAYERORGROUP;
1681 
1682  msg.dwPlayerType = DPPLAYERTYPE_PLAYER;
1683  msg.dpId = *lpidPlayer;
1684  msg.dwCurrentPlayers = 0; /* FIXME: Incorrect */
1685  msg.lpData = lpData;
1686  msg.dwDataSize = dwDataSize;
1687  msg.dpnName = *lpPlayerName;
1688  msg.dpIdParent = DPID_NOPARENT_GROUP;
1689  msg.dwFlags = DPMSG_CREATEPLAYER_DWFLAGS( dwFlags );
1690 
1691  /* FIXME: Correct to just use send effectively? */
1692  /* FIXME: Should size include data w/ message or just message "header" */
1693  /* FIXME: Check return code */
1694  hr = IDirectPlayX_SendEx( &This->IDirectPlay4_iface, DPID_SERVERPLAYER, DPID_ALLPLAYERS, 0,
1695  &msg, sizeof( msg ), 0, 0, NULL, NULL );
1696  }
1697 #endif
1698 
1699  return hr;
1700 }
#define DPSET_REMOTE
Definition: dplay.h:1056
#define DPLAYI_PLAYER_APPSERVER
Definition: dplaysp.h:62
#define DPERR_UNINITIALIZED
Definition: dplay.h:125
HRESULT hr
Definition: shlfolder.c:183
#define DPERR_INVALIDPARAMS
Definition: dplay.h:103
HRESULT DP_MSG_SendRequestPlayerId(IDirectPlayImpl *This, DWORD dwFlags, DPID *lpdpidAllocatedId)
ULONG uRef
Definition: dplay_global.h:66
LPCSTR DPLAYX_HresultToString(HRESULT hr)
lpPlayerData lpPData
Definition: dplay_global.h:87
#define DPID_ALLPLAYERS
Definition: dplay.h:162
#define DPMSG_CREATEPLAYER_DWFLAGS(x)
Definition: dplay.c:86
static HANDLE hEvent
Definition: comm.c:54
#define DP_OK
Definition: dplay.h:88
#define DPLAYI_PLAYER_SYSPLAYER
Definition: dplaysp.h:56
#define DPID_SYSTEM_GROUP
Definition: dplay.c:78
#define DPSYS_CREATEPLAYERORGROUP
Definition: dplay.h:1085
void DP_MSG_ToSelf(IDirectPlayImpl *This, DPID dpidSelf)
smooth NULL
Definition: ftsmooth.c:416
static DPID DP_NextObjectId(void)
Definition: dplay.c:264
#define DPSESSION_MULTICASTSERVER
Definition: dplay.h:276
#define IDirectPlayX_SendEx(p, a, b, c, d, e, f, g, h, i)
Definition: dplay.h:916
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
#define DPID_SERVERPLAYER
Definition: dplay.h:163
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define DPPLAYERTYPE_PLAYER
Definition: dplay.h:1135
#define DPPLAYER_SERVERPLAYER
Definition: dplay.h:1005
#define ERR(fmt,...)
Definition: debug.h:109
#define DPLAYI_PLAYER_NAMESRVR
Definition: dplaysp.h:57
#define DPID_NOPARENT_GROUP
Definition: dplay.c:77
#define DPLAYI_PLAYER_PLAYERLOCAL
Definition: dplaysp.h:59
static lpPlayerData DP_CreatePlayer(IDirectPlayImpl *This, DPID *lpid, DPNAME *lpName, DWORD dwFlags, HANDLE hEvent, BOOL bAnsi)
Definition: dplay.c:1299
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
static void DP_SetPlayerData(lpPlayerData lpPData, DWORD dwFlags, LPVOID lpData, DWORD dwDataSize)
Definition: dplay.c:1455
#define msg(x)
Definition: auth_time.c:54
#define DPERR_CANTADDPLAYER
Definition: dplay.h:93
#define DPPLAYER_SPECTATOR
Definition: dplay.h:1006
#define DPID_UNKNOWN
Definition: dplay.h:164
#define HeapFree(x, y, z)
Definition: compat.h:402
#define DPQ_INSERT(a, b, c)
Definition: dplayx_queue.h:34
#define DPID_NAME_SERVER
Definition: dplay.c:80
HRESULT DP_MSG_ForwardPlayerCreation(IDirectPlayImpl *This, DPID dpidServer)

Referenced by DP_SecureOpen(), IDirectPlay4AImpl_CreatePlayer(), IDirectPlay4Impl_CreatePlayer(), and IDirectPlaySPImpl_HandleMessage().

◆ DP_IF_DestroyGroup()

static HRESULT DP_IF_DestroyGroup ( IDirectPlayImpl This,
void lpMsgHdr,
DPID  idGroup,
BOOL  bAnsi 
)
static

Definition at line 1905 of file dplay.c.

1906 {
1907  lpGroupData lpGData;
1909 
1910  FIXME( "(%p)->(%p,0x%08x,%u): semi stub\n",
1911  This, lpMsgHdr, idGroup, bAnsi );
1912 
1913  /* Find the group */
1914  if( ( lpGData = DP_FindAnyGroup( This, idGroup ) ) == NULL )
1915  {
1916  return DPERR_INVALIDPLAYER; /* yes player */
1917  }
1918 
1919  context.This = This;
1920  context.bAnsi = bAnsi;
1921  context.idGroup = idGroup;
1922 
1923  /* Remove all players that this group has */
1924  IDirectPlayX_EnumGroupPlayers( &This->IDirectPlay4_iface, idGroup, NULL, cbRemoveGroupOrPlayer,
1925  &context, 0 );
1926 
1927  /* Remove all links to groups that this group has since this is dp3 */
1928  IDirectPlayX_EnumGroupsInGroup( &This->IDirectPlay4_iface, idGroup, NULL, cbRemoveGroupOrPlayer,
1929  (void*)&context, 0 );
1930 
1931  /* Remove this group from the parent group - if it has one */
1932  if( ( idGroup != DPID_SYSTEM_GROUP ) && ( lpGData->parent != DPID_SYSTEM_GROUP ) )
1933  IDirectPlayX_DeleteGroupFromGroup( &This->IDirectPlay4_iface, lpGData->parent, idGroup );
1934 
1935  /* Now delete this group data and list from the system group */
1936  DP_DeleteGroup( This, idGroup );
1937 
1938  /* Let the SP know that we've destroyed this group */
1939  if( This->dp2->spData.lpCB->DeleteGroup )
1940  {
1942 
1943  FIXME( "data.dwFlags is incorrect\n" );
1944 
1945  data.idGroup = idGroup;
1946  data.dwFlags = 0;
1947  data.lpISP = This->dp2->spData.lpISP;
1948 
1949  (*This->dp2->spData.lpCB->DeleteGroup)( &data );
1950  }
1951 
1952  FIXME( "Send out a DESTORYPLAYERORGROUP message\n" );
1953 
1954  return DP_OK;
1955 }
#define DPERR_INVALIDPLAYER
Definition: dplay.h:104
static lpGroupData DP_FindAnyGroup(IDirectPlayImpl *This, DPID dpid)
Definition: dplay.c:1061
Definition: http.c:7098
#define IDirectPlayX_EnumGroupPlayers(p, a, b, c, d, e)
Definition: dplay.h:875
#define IDirectPlayX_DeleteGroupFromGroup(p, a, b)
Definition: dplay.h:900
#define DP_OK
Definition: dplay.h:88
#define DPID_SYSTEM_GROUP
Definition: dplay.c:78
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
static BOOL CALLBACK cbRemoveGroupOrPlayer(DPID dpId, DWORD dwPlayerType, LPCDPNAME lpName, DWORD dwFlags, LPVOID lpContext)
Definition: dplay.c:1880
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
DPID parent
Definition: dplay_global.h:94
#define IDirectPlayX_EnumGroupsInGroup(p, a, b, c, d, e)
Definition: dplay.h:902
static void DP_DeleteGroup(IDirectPlayImpl *This, DPID dpid)
Definition: dplay.c:1032

Referenced by IDirectPlay4AImpl_DestroyGroup(), IDirectPlay4Impl_DestroyGroup(), and IDirectPlaySPImpl_HandleMessage().

◆ DP_IF_DestroyPlayer()

static HRESULT DP_IF_DestroyPlayer ( IDirectPlayImpl This,
void lpMsgHdr,
DPID  idPlayer,
BOOL  bAnsi 
)
static

Definition at line 2000 of file dplay.c.

2002 {
2003  DPFAGContext cbContext;
2004 
2005  FIXME( "(%p)->(%p,0x%08x,%u): semi stub\n",
2006  This, lpMsgHdr, idPlayer, bAnsi );
2007 
2008  if( This->dp2->connectionInitialized == NO_PROVIDER )
2009  {
2010  return DPERR_UNINITIALIZED;
2011  }
2012 
2013  if( DP_FindPlayer( This, idPlayer ) == NULL )
2014  {
2015  return DPERR_INVALIDPLAYER;
2016  }
2017 
2018  /* FIXME: If the player is remote, we must be the host to delete this */
2019 
2020  cbContext.This = This;
2021  cbContext.idPlayer = idPlayer;
2022  cbContext.bAnsi = bAnsi;
2023 
2024  /* Find each group and call DeletePlayerFromGroup if the player is a
2025  member of the group */
2026  IDirectPlayX_EnumGroups( &This->IDirectPlay4_iface, NULL, cbDeletePlayerFromAllGroups, &cbContext,
2027  DPENUMGROUPS_ALL );
2028 
2029  /* Now delete player and player list from the sys group */
2030  DP_DeletePlayer( This, idPlayer );
2031 
2032  /* Let the SP know that we've destroyed this group */
2033  if( This->dp2->spData.lpCB->DeletePlayer )
2034  {
2036 
2037  FIXME( "data.dwFlags is incorrect\n" );
2038 
2039  data.idPlayer = idPlayer;
2040  data.dwFlags = 0;
2041  data.lpISP = This->dp2->spData.lpISP;
2042 
2043  (*This->dp2->spData.lpCB->DeletePlayer)( &data );
2044  }
2045 
2046  FIXME( "Send a DELETEPLAYERORGROUP msg\n" );
2047 
2048  return DP_OK;
2049 }
#define DPERR_UNINITIALIZED
Definition: dplay.h:125
#define DPENUMGROUPS_ALL
Definition: dplay.h:995
#define DPERR_INVALIDPLAYER
Definition: dplay.h:104
IDirectPlayImpl * This
Definition: dplay.c:1995
static void DP_DeletePlayer(IDirectPlayImpl *This, DPID dpid)
Definition: dplay.c:1353
#define DP_OK
Definition: dplay.h:88
#define FIXME(fmt,...)
Definition: debug.h:110
static lpPlayerList DP_FindPlayer(IDirectPlayImpl *This, DPID dpid)
Definition: dplay.c:1384
smooth NULL
Definition: ftsmooth.c:416
static BOOL CALLBACK cbDeletePlayerFromAllGroups(DPID dpId, DWORD dwPlayerType, LPCDPNAME lpName, DWORD dwFlags, LPVOID lpContext)
Definition: dplay.c:2052
DPID idPlayer
Definition: dplay.c:1996
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
BOOL bAnsi
Definition: dplay.c:1997
#define IDirectPlayX_EnumGroups(p, a, b, c, d)
Definition: dplay.h:876

Referenced by IDirectPlay4AImpl_DestroyPlayer(), IDirectPlay4Impl_DestroyPlayer(), and IDirectPlaySPImpl_HandleMessage().

◆ DP_IF_GetGroupName()

static HRESULT DP_IF_GetGroupName ( IDirectPlayImpl This,
DPID  idGroup,
void lpData,
DWORD lpdwDataSize,
BOOL  bAnsi 
)
static

Definition at line 2661 of file dplay.c.

2663 {
2664  lpGroupData lpGData;
2665  LPDPNAME lpName = lpData;
2666  DWORD dwRequiredDataSize;
2667 
2668  FIXME("(%p)->(0x%08x,%p,%p,%u) ANSI ignored\n",
2669  This, idGroup, lpData, lpdwDataSize, bAnsi );
2670 
2671  if( ( lpGData = DP_FindAnyGroup( This, idGroup ) ) == NULL )
2672  {
2673  return DPERR_INVALIDGROUP;
2674  }
2675 
2676  dwRequiredDataSize = lpGData->name.dwSize;
2677 
2678  if( lpGData->name.u1.lpszShortNameA )
2679  {
2680  dwRequiredDataSize += strlen( lpGData->name.u1.lpszShortNameA ) + 1;
2681  }
2682 
2683  if( lpGData->name.u2.lpszLongNameA )
2684  {
2685  dwRequiredDataSize += strlen( lpGData->name.u2.lpszLongNameA ) + 1;
2686  }
2687 
2688  if( ( lpData == NULL ) ||
2689  ( *lpdwDataSize < dwRequiredDataSize )
2690  )
2691  {
2692  *lpdwDataSize = dwRequiredDataSize;
2693  return DPERR_BUFFERTOOSMALL;
2694  }
2695 
2696  /* Copy the structure */
2697  CopyMemory( lpName, &lpGData->name, lpGData->name.dwSize );
2698 
2699  if( lpGData->name.u1.lpszShortNameA )
2700  {
2701  strcpy( ((char*)lpName)+lpGData->name.dwSize,
2702  lpGData->name.u1.lpszShortNameA );
2703  }
2704  else
2705  {
2706  lpName->u1.lpszShortNameA = NULL;
2707  }
2708 
2709  if( lpGData->name.u1.lpszShortNameA )
2710  {
2711  strcpy( ((char*)lpName)+lpGData->name.dwSize,
2712  lpGData->name.u2.lpszLongNameA );
2713  }
2714  else
2715  {
2716  lpName->u2.lpszLongNameA = NULL;
2717  }
2718 
2719  return DP_OK;
2720 }
static lpGroupData DP_FindAnyGroup(IDirectPlayImpl *This, DPID dpid)
Definition: dplay.c:1061
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define DPERR_BUFFERTOOSMALL
Definition: dplay.h:92
#define DPERR_INVALIDGROUP
Definition: dplay.h:105
_In_ LPCSTR lpName
Definition: winbase.h:2746
LPSTR lpszLongNameA
Definition: dplay.h:200
#define DP_OK
Definition: dplay.h:88
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
LPSTR lpszShortNameA
Definition: dplay.h:194
#define CopyMemory
Definition: winbase.h:1640
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD dwSize
Definition: dplay.h:188
DPNAME name
Definition: dplay_global.h:106
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388

Referenced by IDirectPlay4AImpl_GetGroupName(), and IDirectPlay4Impl_GetGroupName().

◆ DP_IF_GetPlayerName()

static HRESULT DP_IF_GetPlayerName ( IDirectPlayImpl This,
DPID  idPlayer,
void lpData,
DWORD lpdwDataSize,
BOOL  bAnsi 
)
static

Definition at line 2983 of file dplay.c.

2985 {
2986  lpPlayerList lpPList;
2987  LPDPNAME lpName = lpData;
2988  DWORD dwRequiredDataSize;
2989 
2990  FIXME( "(%p)->(0x%08x,%p,%p,%u): ANSI\n",
2991  This, idPlayer, lpData, lpdwDataSize, bAnsi );
2992 
2993  if( This->dp2->connectionInitialized == NO_PROVIDER )
2994  {
2995  return DPERR_UNINITIALIZED;
2996  }
2997 
2998  if( ( lpPList = DP_FindPlayer( This, idPlayer ) ) == NULL )
2999  {
3000  return DPERR_INVALIDPLAYER;
3001  }
3002 
3003  dwRequiredDataSize = lpPList->lpPData->name.dwSize;
3004 
3005  if( lpPList->lpPData->name.u1.lpszShortNameA )
3006  {
3007  dwRequiredDataSize += strlen( lpPList->lpPData->name.u1.lpszShortNameA ) + 1;
3008  }
3009 
3010  if( lpPList->lpPData->name.u2.lpszLongNameA )
3011  {
3012  dwRequiredDataSize += strlen( lpPList->lpPData->name.u2.lpszLongNameA ) + 1;
3013  }
3014 
3015  if( ( lpData == NULL ) ||
3016  ( *lpdwDataSize < dwRequiredDataSize )
3017  )
3018  {
3019  *lpdwDataSize = dwRequiredDataSize;
3020  return DPERR_BUFFERTOOSMALL;
3021  }
3022 
3023  /* Copy the structure */
3024  CopyMemory( lpName, &lpPList->lpPData->name, lpPList->lpPData->name.dwSize );
3025 
3026  if( lpPList->lpPData->name.u1.lpszShortNameA )
3027  {
3028  strcpy( ((char*)lpName)+lpPList->lpPData->name.dwSize,
3029  lpPList->lpPData->name.u1.lpszShortNameA );
3030  }
3031  else
3032  {
3033  lpName->u1.lpszShortNameA = NULL;
3034  }
3035 
3036  if( lpPList->lpPData->name.u1.lpszShortNameA )
3037  {
3038  strcpy( ((char*)lpName)+lpPList->lpPData->name.dwSize,
3039  lpPList->lpPData->name.u2.lpszLongNameA );
3040  }
3041  else
3042  {
3043  lpName->u2.lpszLongNameA = NULL;
3044  }
3045 
3046  return DP_OK;
3047 }
#define DPERR_UNINITIALIZED
Definition: dplay.h:125
#define DPERR_INVALIDPLAYER
Definition: dplay.h:104
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define DPERR_BUFFERTOOSMALL
Definition: dplay.h:92
_In_ LPCSTR lpName
Definition: winbase.h:2746
LPSTR lpszLongNameA
Definition: dplay.h:200
lpPlayerData lpPData
Definition: dplay_global.h:87
#define DP_OK
Definition: dplay.h:88
#define FIXME(fmt,...)
Definition: debug.h:110
static lpPlayerList DP_FindPlayer(IDirectPlayImpl *This, DPID dpid)
Definition: dplay.c:1384
smooth NULL
Definition: ftsmooth.c:416
LPSTR lpszShortNameA
Definition: dplay.h:194
#define CopyMemory
Definition: winbase.h:1640
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD dwSize
Definition: dplay.h:188
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
DPNAME name
Definition: dplay_global.h:63

Referenced by IDirectPlay4AImpl_GetPlayerName(), and IDirectPlay4Impl_GetPlayerName().

◆ DP_IF_Receive()

static HRESULT DP_IF_Receive ( IDirectPlayImpl This,
DPID lpidFrom,
DPID lpidTo,
DWORD  dwFlags,
void lpData,
DWORD lpdwDataSize,
BOOL  bAnsi 
)
static

Definition at line 3356 of file dplay.c.

3358 {
3359  LPDPMSG lpMsg = NULL;
3360 
3361  FIXME( "(%p)->(%p,%p,0x%08x,%p,%p,%u): stub\n",
3362  This, lpidFrom, lpidTo, dwFlags, lpData, lpdwDataSize, bAnsi );
3363 
3364  if( This->dp2->connectionInitialized == NO_PROVIDER )
3365  {
3366  return DPERR_UNINITIALIZED;
3367  }
3368 
3369  if( dwFlags == 0 )
3370  {
3372  }
3373 
3374  /* If the lpData is NULL, we must be peeking the message */
3375  if( ( lpData == NULL ) &&
3376  !( dwFlags & DPRECEIVE_PEEK )
3377  )
3378  {
3379  return DPERR_INVALIDPARAMS;
3380  }
3381 
3382  if( dwFlags & DPRECEIVE_ALL )
3383  {
3384  lpMsg = This->dp2->receiveMsgs.lpQHFirst;
3385 
3386  if( !( dwFlags & DPRECEIVE_PEEK ) )
3387  {
3388  FIXME( "Remove from queue\n" );
3389  }
3390  }
3391  else if( ( dwFlags & DPRECEIVE_TOPLAYER ) ||
3393  )
3394  {
3395  FIXME( "Find matching message 0x%08x\n", dwFlags );
3396  }
3397  else
3398  {
3399  ERR( "Hmmm..dwFlags 0x%08x\n", dwFlags );
3400  }
3401 
3402  if( lpMsg == NULL )
3403  {
3404  return DPERR_NOMESSAGES;
3405  }
3406 
3407  /* Copy into the provided buffer */
3408  if (lpData) CopyMemory( lpData, lpMsg->msg, *lpdwDataSize );
3409 
3410  return DP_OK;
3411 }
#define DPERR_UNINITIALIZED
Definition: dplay.h:125
#define DPRECEIVE_ALL
Definition: dplay.h:1031
#define DPRECEIVE_TOPLAYER
Definition: dplay.h:1032
#define DPERR_INVALIDPARAMS
Definition: dplay.h:103
#define DPERR_NOMESSAGES
Definition: dplay.h:110
#define DP_OK
Definition: dplay.h:88
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define DPRECEIVE_PEEK
Definition: dplay.h:1034
DPMSG_GENERIC * msg
Definition: dplay_global.h:130
#define CopyMemory
Definition: winbase.h:1640
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define DPRECEIVE_FROMPLAYER
Definition: dplay.h:1033
#define ERR(fmt,...)
Definition: debug.h:109

Referenced by IDirectPlay4AImpl_Receive(), and IDirectPlay4Impl_Receive().

◆ DP_IF_SetGroupName()

static HRESULT DP_IF_SetGroupName ( IDirectPlayImpl This,
DPID  idGroup,
DPNAME lpGroupName,
DWORD  dwFlags,
BOOL  bAnsi 
)
static

Definition at line 3565 of file dplay.c.

3567 {
3568  lpGroupData lpGData;
3569 
3570  TRACE( "(%p)->(0x%08x,%p,0x%08x,%u)\n", This, idGroup,
3571  lpGroupName, dwFlags, bAnsi );
3572 
3573  if( ( lpGData = DP_FindAnyGroup( This, idGroup ) ) == NULL )
3574  {
3575  return DPERR_INVALIDGROUP;
3576  }
3577 
3578  DP_CopyDPNAMEStruct( &lpGData->name, lpGroupName, bAnsi );
3579 
3580  /* Should send a DPMSG_SETPLAYERORGROUPNAME message */
3581  FIXME( "Message not sent and dwFlags ignored\n" );
3582 
3583  return DP_OK;
3584 }
static lpGroupData DP_FindAnyGroup(IDirectPlayImpl *This, DPID dpid)
Definition: dplay.c:1061
#define DPERR_INVALIDGROUP
Definition: dplay.h:105
#define DP_OK
Definition: dplay.h:88
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
static BOOL DP_CopyDPNAMEStruct(LPDPNAME lpDst, const DPNAME *lpSrc, BOOL bAnsi)
Definition: dplay.c:1399
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
DPNAME name
Definition: dplay_global.h:106

Referenced by IDirectPlay4AImpl_SetGroupName(), IDirectPlay4Impl_SetGroupName(), and IDirectPlaySPImpl_HandleMessage().

◆ DP_IF_SetPlayerName()

static HRESULT DP_IF_SetPlayerName ( IDirectPlayImpl This,
DPID  idPlayer,
DPNAME lpPlayerName,
DWORD  dwFlags,
BOOL  bAnsi 
)
static

Definition at line 3698 of file dplay.c.

3700 {
3701  lpPlayerList lpPList;
3702 
3703  TRACE( "(%p)->(0x%08x,%p,0x%08x,%u)\n",
3704  This, idPlayer, lpPlayerName, dwFlags, bAnsi );
3705 
3706  if( This->dp2->connectionInitialized == NO_PROVIDER )
3707  {
3708  return DPERR_UNINITIALIZED;
3709  }
3710 
3711  if( ( lpPList = DP_FindPlayer( This, idPlayer ) ) == NULL )
3712  {
3713  return DPERR_INVALIDGROUP;
3714  }
3715 
3716  DP_CopyDPNAMEStruct( &lpPList->lpPData->name, lpPlayerName, bAnsi );
3717 
3718  /* Should send a DPMSG_SETPLAYERORGROUPNAME message */
3719  FIXME( "Message not sent and dwFlags ignored\n" );
3720 
3721  return DP_OK;
3722 }
#define DPERR_UNINITIALIZED
Definition: dplay.h:125
#define DPERR_INVALIDGROUP
Definition: dplay.h:105
lpPlayerData lpPData
Definition: dplay_global.h:87
#define DP_OK
Definition: dplay.h:88
#define FIXME(fmt,...)
Definition: debug.h:110
static lpPlayerList DP_FindPlayer(IDirectPlayImpl *This, DPID dpid)
Definition: dplay.c:1384
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
static BOOL DP_CopyDPNAMEStruct(LPDPNAME lpDst, const DPNAME *lpSrc, BOOL bAnsi)
Definition: dplay.c:1399
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
DPNAME name
Definition: dplay_global.h:63

Referenced by IDirectPlay4AImpl_SetPlayerName(), IDirectPlay4Impl_SetPlayerName(), and IDirectPlaySPImpl_HandleMessage().

◆ DP_InitializeDPLSP()

static HRESULT DP_InitializeDPLSP ( IDirectPlayImpl This,
HMODULE  hLobbyProvider