ReactOS  0.4.14-dev-50-g13bb5e2
dplay.c File Reference
#include "config.h"
#include "wine/port.h"
#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/unicode.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 83 of file dplay.c.

◆ DPID_NOPARENT_GROUP

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

Definition at line 80 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:80

Definition at line 81 of file dplay.c.

◆ DPMSG_CREATEGROUP_DWFLAGS

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

Definition at line 86 of file dplay.c.

◆ DPMSG_CREATEPLAYER_DWFLAGS

#define DPMSG_CREATEPLAYER_DWFLAGS (   x)    0

Definition at line 89 of file dplay.c.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 27 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 2055 of file dplay.c.

2061 {
2062  lpDPFAGContext lpCtxt = (lpDPFAGContext)lpContext;
2063 
2064  if( dwPlayerType == DPPLAYERTYPE_GROUP )
2065  {
2067 
2068  /* Enumerate all groups in this group since this will normally only
2069  * be called for top level groups
2070  */
2073 
2074  }
2075  else
2076  {
2077  ERR( "Group callback has dwPlayerType = 0x%08x\n", dwPlayerType );
2078  }
2079 
2080  return TRUE;
2081 }
#define TRUE
Definition: types.h:120
#define DPENUMGROUPS_ALL
Definition: dplay.h:995
IDirectPlayImpl * This
Definition: dplay.c:1998
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:2055
#define DPPLAYERTYPE_GROUP
Definition: dplay.h:1134
DPID idPlayer
Definition: dplay.c:1999
#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 5963 of file dplay.c.

5970 {
5971  lpCreateEnumData lpData = (lpCreateEnumData)lpContext;
5972 
5973  if( IsEqualGUID( lpguidSP, lpData->lpGuid ) )
5974  {
5975  TRACE( "Found SP entry with guid %s\n", debugstr_guid(lpData->lpGuid) );
5976 
5978  dwConnectionSize );
5979  CopyMemory( lpData->lpConn, lpConnection, dwConnectionSize );
5980 
5981  /* Found the record that we were looking for */
5982  return FALSE;
5983  }
5984 
5985  /* Haven't found what were looking for yet */
5986  return TRUE;
5987 }
#define TRUE
Definition: types.h:120
LPCGUID lpGuid
Definition: dplay.c:5959
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
struct tagCreateEnum * lpCreateEnumData
#define CopyMemory
Definition: winbase.h:1633
LPVOID lpConn
Definition: dplay.c:5958
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
#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 1883 of file dplay.c.

1889 {
1890  lpDPRGOPContext lpCtxt = (lpDPRGOPContext)lpContext;
1891 
1892  TRACE( "Removing element:0x%08x (type:0x%08x) from element:0x%08x\n",
1893  dpId, dwPlayerType, lpCtxt->idGroup );
1894 
1895  if( dwPlayerType == DPPLAYERTYPE_GROUP )
1896  {
1898  lpCtxt->idGroup, dpId ) ) )
1899  ERR( "Unable to delete group 0x%08x from group 0x%08x\n", dpId, lpCtxt->idGroup );
1900  }
1902  lpCtxt->idGroup, dpId ) ) )
1903  ERR( "Unable to delete player 0x%08x from grp 0x%08x\n", dpId, lpCtxt->idGroup );
1904 
1905  return TRUE; /* Continue enumeration */
1906 }
#define TRUE
Definition: types.h:120
IDirectPlayImpl * This
Definition: dplay.c:1877
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:1879
#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 5995 of file dplay.c.

5996 {
5997  HRESULT hr;
5998  LPDIRECTPLAY3A lpDP3A;
5999  CreateEnumData cbData;
6000 
6001  TRACE( "lpGUID=%s lplpDP=%p pUnk=%p\n", debugstr_guid(lpGUID), lplpDP, pUnk );
6002 
6003  if( pUnk != NULL )
6004  {
6005  return CLASS_E_NOAGGREGATION;
6006  }
6007 
6008  if( (lplpDP == NULL) || (lpGUID == NULL) )
6009  {
6010  return DPERR_INVALIDPARAMS;
6011  }
6012 
6013  if ( dplay_create( &IID_IDirectPlay, (void**)lplpDP ) != DP_OK )
6014  return DPERR_UNAVAILABLE;
6015 
6016  if( IsEqualGUID( &GUID_NULL, lpGUID ) )
6017  {
6018  /* The GUID_NULL means don't bind a service provider. Just return the
6019  interface as is */
6020  return DP_OK;
6021  }
6022 
6023  /* Bind the desired service provider since lpGUID is non NULL */
6024  TRACE( "Service Provider binding for %s\n", debugstr_guid(lpGUID) );
6025 
6026  /* We're going to use a DP3 interface */
6027  hr = IDirectPlayX_QueryInterface( *lplpDP, &IID_IDirectPlay3A,
6028  (LPVOID*)&lpDP3A );
6029  if( FAILED(hr) )
6030  {
6031  ERR( "Failed to get DP3 interface: %s\n", DPLAYX_HresultToString(hr) );
6032  return hr;
6033  }
6034 
6035  cbData.lpConn = NULL;
6036  cbData.lpGuid = lpGUID;
6037 
6038  /* We were given a service provider, find info about it... */
6040  &cbData, DPCONNECTION_DIRECTPLAY );
6041  if( ( FAILED(hr) ) ||
6042  ( cbData.lpConn == NULL )
6043  )
6044  {
6045  ERR( "Failed to get Enum for SP: %s\n", DPLAYX_HresultToString(hr) );
6046  IDirectPlayX_Release( lpDP3A );
6047  return DPERR_UNAVAILABLE;
6048  }
6049 
6050  /* Initialize the service provider */
6051  hr = IDirectPlayX_InitializeConnection( lpDP3A, cbData.lpConn, 0 );
6052  if( FAILED(hr) )
6053  {
6054  ERR( "Failed to Initialize SP: %s\n", DPLAYX_HresultToString(hr) );
6055  HeapFree( GetProcessHeap(), 0, cbData.lpConn );
6056  IDirectPlayX_Release( lpDP3A );
6057  return hr;
6058  }
6059 
6060  /* Release our version of the interface now that we're done with it */
6061  IDirectPlayX_Release( lpDP3A );
6062  HeapFree( GetProcessHeap(), 0, cbData.lpConn );
6063 
6064  return DP_OK;
6065 }
HRESULT dplay_create(REFIID riid, void **ppv)
Definition: dplay.c:5680
static BOOL CALLBACK cbDPCreateEnumConnections(LPCGUID lpguidSP, LPVOID lpConnection, DWORD dwConnectionSize, LPCDPNAME lpName, DWORD dwFlags, LPVOID lpContext)
Definition: dplay.c:5963
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:5959
#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:395
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:5958
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
#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:394

◆ DirectPlayEnumerateA()

HRESULT WINAPI DirectPlayEnumerateA ( LPDPENUMDPCALLBACKA  lpEnumCallback,
LPVOID  lpContext 
)

Definition at line 5939 of file dplay.c.

5940 {
5941  TRACE("(%p,%p)\n", lpEnumCallback, lpContext);
5942 
5943  return DirectPlayEnumerateAW(lpEnumCallback, NULL, lpContext);
5944 }
static HRESULT DirectPlayEnumerateAW(LPDPENUMDPCALLBACKA lpEnumCallbackA, LPDPENUMDPCALLBACKW lpEnumCallbackW, LPVOID lpContext)
Definition: dplay.c:5771
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 5771 of file dplay.c.

5774 {
5775  HKEY hkResult;
5776  static const WCHAR searchSubKey[] = {
5777  'S', 'O', 'F', 'T', 'W', 'A', 'R', 'E', '\\',
5778  'M', 'i', 'c', 'r', 'o', 's', 'o', 'f', 't', '\\',
5779  'D', 'i', 'r', 'e', 'c', 't', 'P', 'l', 'a', 'y', '\\',
5780  'S', 'e', 'r', 'v', 'i', 'c', 'e', ' ', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 's', 0 };
5781  static const WCHAR guidKey[] = { 'G', 'u', 'i', 'd', 0 };
5782  static const WCHAR descW[] = { 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'i', 'o', 'n', 'W', 0 };
5783 
5784  DWORD dwIndex;
5786 
5787  char *descriptionA = NULL;
5788  DWORD max_sizeOfDescriptionA = 0;
5789  WCHAR *descriptionW = NULL;
5790  DWORD max_sizeOfDescriptionW = 0;
5791  DWORD sizeOfSubKeyName;
5792  WCHAR subKeyName[255]; /* 255 is the maximum key size according to MSDN */
5793  LONG ret_value;
5794  static GUID *guid_cache;
5795  static int cache_count;
5796 
5797  if (!lpEnumCallbackA && !lpEnumCallbackW)
5798  {
5799  return DPERR_INVALIDPARAMS;
5800  }
5801 
5802  /* Need to loop over the service providers in the registry */
5803  if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, searchSubKey,
5804  0, KEY_READ, &hkResult) != ERROR_SUCCESS)
5805  {
5806  /* Hmmm. Does this mean that there are no service providers? */
5807  ERR(": no service provider key in the registry - check your Wine installation !!!\n");
5808  return DPERR_GENERIC;
5809  }
5810 
5811  dwIndex = 0;
5812  do
5813  {
5814  sizeOfSubKeyName = ARRAY_SIZE(subKeyName);
5815  ret_value = RegEnumKeyW(hkResult, dwIndex, subKeyName, sizeOfSubKeyName);
5816  dwIndex++;
5817  }
5818  while (ret_value == ERROR_SUCCESS);
5819  /* The game Swing from bug 37185 expects GUID values to persist after
5820  * the end of the enumeration. */
5821  if (cache_count < dwIndex)
5822  {
5823  HeapFree(GetProcessHeap(), 0, guid_cache);
5824  guid_cache = HeapAlloc(GetProcessHeap(), 0, sizeof(GUID) * dwIndex);
5825  if (!guid_cache)
5826  {
5827  ERR(": failed to allocate required memory.\n");
5828  return DPERR_EXCEPTION;
5829  }
5830  cache_count = dwIndex;
5831  }
5832  /* Traverse all the service providers we have available */
5833  dwIndex = 0;
5834  while (1)
5835  {
5836  HKEY hkServiceProvider;
5837  WCHAR guidKeyContent[(2 * 16) + 1 + 6 /* This corresponds to '{....-..-..-..-......}' */ ];
5838  DWORD sizeOfGuidKeyContent = sizeof(guidKeyContent);
5839 
5840  sizeOfSubKeyName = ARRAY_SIZE(subKeyName);
5841  ret_value = RegEnumKeyExW(hkResult, dwIndex, subKeyName, &sizeOfSubKeyName,
5842  NULL, NULL, NULL, &filetime);
5843  if (ret_value == ERROR_NO_MORE_ITEMS)
5844  break;
5845  else if (ret_value != ERROR_SUCCESS)
5846  {
5847  ERR(": could not enumerate on service provider key.\n");
5848  return DPERR_EXCEPTION;
5849  }
5850  TRACE(" this time through sub-key %s.\n", debugstr_w(subKeyName));
5851 
5852  /* Open the key for this service provider */
5853  if (RegOpenKeyExW(hkResult, subKeyName, 0, KEY_READ, &hkServiceProvider) != ERROR_SUCCESS)
5854  {
5855  ERR(": could not open registry key for service provider %s.\n", debugstr_w(subKeyName));
5856  continue;
5857  }
5858 
5859  /* Get the GUID from the registry */
5860  if (RegQueryValueExW(hkServiceProvider, guidKey,
5861  NULL, NULL, (LPBYTE) guidKeyContent, &sizeOfGuidKeyContent) != ERROR_SUCCESS)
5862  {
5863  ERR(": missing GUID registry data member for service provider %s.\n", debugstr_w(subKeyName));
5864  continue;
5865  }
5866  if (sizeOfGuidKeyContent != sizeof(guidKeyContent))
5867  {
5868  ERR(": invalid format for the GUID registry data member for service provider %s (%s).\n", debugstr_w(subKeyName), debugstr_w(guidKeyContent));
5869  continue;
5870  }
5871  CLSIDFromString(guidKeyContent, &guid_cache[dwIndex]);
5872 
5873  /* The enumeration will return FALSE if we are not to continue.
5874  *
5875  * Note: on my windows box, major / minor version is 6 / 0 for all service providers
5876  * and have no relation to any of the two dwReserved1 and dwReserved2 keys.
5877  * I think that it simply means that they are in-line with DirectX 6.0
5878  */
5879  if (lpEnumCallbackA)
5880  {
5881  DWORD sizeOfDescription = 0;
5882 
5883  /* Note that this is the A case of this function, so use the A variant to get the description string */
5884  if (RegQueryValueExA(hkServiceProvider, "DescriptionA",
5885  NULL, NULL, NULL, &sizeOfDescription) != ERROR_SUCCESS)
5886  {
5887  ERR(": missing 'DescriptionA' registry data member for service provider %s.\n", debugstr_w(subKeyName));
5888  continue;
5889  }
5890  if (sizeOfDescription > max_sizeOfDescriptionA)
5891  {
5892  HeapFree(GetProcessHeap(), 0, descriptionA);
5893  max_sizeOfDescriptionA = sizeOfDescription;
5894  }
5895  descriptionA = HeapAlloc(GetProcessHeap(), 0, sizeOfDescription);
5896  RegQueryValueExA(hkServiceProvider, "DescriptionA",
5897  NULL, NULL, (LPBYTE) descriptionA, &sizeOfDescription);
5898 
5899  if (!lpEnumCallbackA(&guid_cache[dwIndex], descriptionA, 6, 0, lpContext))
5900  goto end;
5901  }
5902  else
5903  {
5904  DWORD sizeOfDescription = 0;
5905 
5906  if (RegQueryValueExW(hkServiceProvider, descW,
5907  NULL, NULL, NULL, &sizeOfDescription) != ERROR_SUCCESS)
5908  {
5909  ERR(": missing 'DescriptionW' registry data member for service provider %s.\n", debugstr_w(subKeyName));
5910  continue;
5911  }
5912  if (sizeOfDescription > max_sizeOfDescriptionW)
5913  {
5915  max_sizeOfDescriptionW = sizeOfDescription;
5916  }
5917  descriptionW = HeapAlloc(GetProcessHeap(), 0, sizeOfDescription);
5918  RegQueryValueExW(hkServiceProvider, descW,
5919  NULL, NULL, (LPBYTE) descriptionW, &sizeOfDescription);
5920 
5921  if (!lpEnumCallbackW(&guid_cache[dwIndex], descriptionW, 6, 0, lpContext))
5922  goto end;
5923  }
5924 
5925  dwIndex++;
5926  }
5927 
5928  end:
5929  HeapFree(GetProcessHeap(), 0, descriptionA);
5931 
5932  return DP_OK;
5933 }
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:395
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:30
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
Definition: compobj.c:2247
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:394
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by DirectPlayEnumerateA(), and DirectPlayEnumerateW().

◆ DirectPlayEnumerateW()

HRESULT WINAPI DirectPlayEnumerateW ( LPDPENUMDPCALLBACKW  lpEnumCallback,
LPVOID  lpContext 
)

Definition at line 5949 of file dplay.c.

5950 {
5951  TRACE("(%p,%p)\n", lpEnumCallback, lpContext);
5952 
5953  return DirectPlayEnumerateAW(NULL, lpEnumCallback, lpContext);
5954 }
static HRESULT DirectPlayEnumerateAW(LPDPENUMDPCALLBACKA lpEnumCallbackA, LPDPENUMDPCALLBACKW lpEnumCallbackW, LPVOID lpContext)
Definition: dplay.c:5771
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 4201 of file dplay.c.

4203 {
4204  DPCOMPOUNDADDRESSELEMENT dpCompoundAddress;
4205  HRESULT hr;
4206 
4207  dpCompoundAddress.dwDataSize = sizeof( GUID );
4208  dpCompoundAddress.guidDataType = DPAID_ServiceProvider;
4209  dpCompoundAddress.lpData = lpcSpGuid;
4210 
4211  *lplpAddrBuf = NULL;
4212  *lpdwBufSize = 0;
4213 
4214  hr = DPL_CreateCompoundAddress( &dpCompoundAddress, 1, *lplpAddrBuf,
4215  lpdwBufSize, TRUE );
4216 
4217  if( hr != DPERR_BUFFERTOOSMALL )
4218  {
4219  ERR( "can't get buffer size: %s\n", DPLAYX_HresultToString( hr ) );
4220  return FALSE;
4221  }
4222 
4223  /* Now allocate the buffer */
4224  *lplpAddrBuf = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
4225  *lpdwBufSize );
4226 
4227  hr = DPL_CreateCompoundAddress( &dpCompoundAddress, 1, *lplpAddrBuf,
4228  lpdwBufSize, TRUE );
4229  if( FAILED(hr) )
4230  {
4231  ERR( "can't create address: %s\n", DPLAYX_HresultToString( hr ) );
4232  return FALSE;
4233  }
4234 
4235  return TRUE;
4236 }
#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:395
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 3869 of file dplay.c.

3870 {
3871  DWORD dwSize = 0;
3872 
3873  if( lpSessDesc == NULL )
3874  {
3875  /* Hmmm..don't need any size? */
3876  ERR( "NULL lpSessDesc\n" );
3877  return dwSize;
3878  }
3879 
3880  dwSize += sizeof( *lpSessDesc );
3881 
3882  if( bAnsi )
3883  {
3884  if( lpSessDesc->u1.lpszSessionNameA )
3885  {
3886  dwSize += lstrlenA( lpSessDesc->u1.lpszSessionNameA ) + 1;
3887  }
3888 
3889  if( lpSessDesc->u2.lpszPasswordA )
3890  {
3891  dwSize += lstrlenA( lpSessDesc->u2.lpszPasswordA ) + 1;
3892  }
3893  }
3894  else /* UNICODE */
3895  {
3896  if( lpSessDesc->u1.lpszSessionName )
3897  {
3898  dwSize += sizeof( WCHAR ) *
3899  ( lstrlenW( lpSessDesc->u1.lpszSessionName ) + 1 );
3900  }
3901 
3902  if( lpSessDesc->u2.lpszPassword )
3903  {
3904  dwSize += sizeof( WCHAR ) *
3905  ( lstrlenW( lpSessDesc->u2.lpszPassword ) + 1 );
3906  }
3907  }
3908 
3909  return dwSize;
3910 }
LPWSTR lpszSessionName
Definition: dplay.h:243
#define lstrlenW
Definition: compat.h:407
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 1402 of file dplay.c.

1403 {
1404  if( lpSrc == NULL )
1405  {
1406  ZeroMemory( lpDst, sizeof( *lpDst ) );
1407  lpDst->dwSize = sizeof( *lpDst );
1408  return TRUE;
1409  }
1410 
1411  if( lpSrc->dwSize != sizeof( *lpSrc) )
1412  {
1413  return FALSE;
1414  }
1415 
1416  /* Delete any existing pointers */
1417  HeapFree( GetProcessHeap(), 0, lpDst->u1.lpszShortNameA );
1418  HeapFree( GetProcessHeap(), 0, lpDst->u2.lpszLongNameA );
1419 
1420  /* Copy as required */
1421  CopyMemory( lpDst, lpSrc, lpSrc->dwSize );
1422 
1423  if( bAnsi )
1424  {
1425  if( lpSrc->u1.lpszShortNameA )
1426  {
1427  lpDst->u1.lpszShortNameA = HeapAlloc( GetProcessHeap(), 0,
1428  strlen(lpSrc->u1.lpszShortNameA)+1 );
1429  strcpy( lpDst->u1.lpszShortNameA, lpSrc->u1.lpszShortNameA );
1430  }
1431  if( lpSrc->u2.lpszLongNameA )
1432  {
1433  lpDst->u2.lpszLongNameA = HeapAlloc( GetProcessHeap(), 0,
1434  strlen(lpSrc->u2.lpszLongNameA)+1 );
1435  strcpy( lpDst->u2.lpszLongNameA, lpSrc->u2.lpszLongNameA );
1436  }
1437  }
1438  else
1439  {
1440  if( lpSrc->u1.lpszShortNameA )
1441  {
1442  lpDst->u1.lpszShortName = HeapAlloc( GetProcessHeap(), 0,
1443  (strlenW(lpSrc->u1.lpszShortName)+1)*sizeof(WCHAR) );
1444  strcpyW( lpDst->u1.lpszShortName, lpSrc->u1.lpszShortName );
1445  }
1446  if( lpSrc->u2.lpszLongNameA )
1447  {
1448  lpDst->u2.lpszLongName = HeapAlloc( GetProcessHeap(), 0,
1449  (strlenW(lpSrc->u2.lpszLongName)+1)*sizeof(WCHAR) );
1450  strcpyW( lpDst->u2.lpszLongName, lpSrc->u2.lpszLongName );
1451  }
1452  }
1453 
1454  return TRUE;
1455 }
#define TRUE
Definition: types.h:120
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define ZeroMemory
Definition: winbase.h:1635
LPSTR lpszLongNameA
Definition: dplay.h:200
smooth NULL
Definition: ftsmooth.c:416
LPSTR lpszShortNameA
Definition: dplay.h:194
#define GetProcessHeap()
Definition: compat.h:395
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:1633
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
LPWSTR lpszShortName
Definition: dplay.h:193
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:394

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 3913 of file dplay.c.

3915 {
3916  BYTE* lpStartOfFreeSpace;
3917 
3918  if( lpSessionDest == NULL )
3919  {
3920  ERR( "NULL lpSessionDest\n" );
3921  return;
3922  }
3923 
3924  CopyMemory( lpSessionDest, lpSessionSrc, sizeof( *lpSessionSrc ) );
3925 
3926  lpStartOfFreeSpace = ((BYTE*)lpSessionDest) + sizeof( *lpSessionSrc );
3927 
3928  if( bAnsi )
3929  {
3930  if( lpSessionSrc->u1.lpszSessionNameA )
3931  {
3932  lstrcpyA( (LPSTR)lpStartOfFreeSpace,
3933  lpSessionDest->u1.lpszSessionNameA );
3934  lpSessionDest->u1.lpszSessionNameA = (LPSTR)lpStartOfFreeSpace;
3935  lpStartOfFreeSpace +=
3936  lstrlenA( lpSessionDest->u1.lpszSessionNameA ) + 1;
3937  }
3938 
3939  if( lpSessionSrc->u2.lpszPasswordA )
3940  {
3941  lstrcpyA( (LPSTR)lpStartOfFreeSpace,
3942  lpSessionDest->u2.lpszPasswordA );
3943  lpSessionDest->u2.lpszPasswordA = (LPSTR)lpStartOfFreeSpace;
3944  }
3945  }
3946  else /* UNICODE */
3947  {
3948  if( lpSessionSrc->u1.lpszSessionName )
3949  {
3950  lstrcpyW( (LPWSTR)lpStartOfFreeSpace,
3951  lpSessionDest->u1.lpszSessionName );
3952  lpSessionDest->u1.lpszSessionName = (LPWSTR)lpStartOfFreeSpace;
3953  lpStartOfFreeSpace += sizeof(WCHAR) *
3954  ( lstrlenW( lpSessionDest->u1.lpszSessionName ) + 1 );
3955  }
3956 
3957  if( lpSessionSrc->u2.lpszPassword )
3958  {
3959  lstrcpyW( (LPWSTR)lpStartOfFreeSpace,
3960  lpSessionDest->u2.lpszPassword );
3961  lpSessionDest->u2.lpszPassword = (LPWSTR)lpStartOfFreeSpace;
3962  }
3963  }
3964 }
char * LPSTR
Definition: xmlstorage.h:182
#define lstrlenW
Definition: compat.h:407
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define CopyMemory
Definition: winbase.h:1633
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:406
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 129 of file dplay.c.

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

1004 {
1005  lpGroupData lpGData;
1006 
1007  /* Allocate the new space and add to end of high level group list */
1008  lpGData = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpGData ) );
1009 
1010  if( lpGData == NULL )
1011  {
1012  return NULL;
1013  }
1014 
1015  DPQ_INIT(lpGData->groups);
1016  DPQ_INIT(lpGData->players);
1017 
1018  /* Set the desired player ID - no sanity checking to see if it exists */
1019  lpGData->dpid = *lpid;
1020 
1021  DP_CopyDPNAMEStruct( &lpGData->name, lpName, bAnsi );
1022 
1023  /* FIXME: Should we check that the parent exists? */
1024  lpGData->parent = idParent;
1025 
1026  /* FIXME: Should we validate the dwFlags? */
1027  lpGData->dwFlags = dwFlags;
1028 
1029  TRACE( "Created group id 0x%08x\n", *lpid );
1030 
1031  return lpGData;
1032 }
#define DPQ_INIT(head)
Definition: dplayx_queue.h:54
_In_ LPCSTR lpName
Definition: winbase.h:2729
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:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static BOOL DP_CopyDPNAMEStruct(LPDPNAME lpDst, const DPNAME *lpSrc, BOOL bAnsi)
Definition: dplay.c:1402
_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 1302 of file dplay.c.

1304 {
1305  lpPlayerData lpPData;
1306 
1307  TRACE( "(%p)->(%p,%p,%u)\n", This, lpid, lpName, bAnsi );
1308 
1309  /* Allocate the storage for the player and associate it with list element */
1310  lpPData = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpPData ) );
1311  if( lpPData == NULL )
1312  {
1313  return NULL;
1314  }
1315 
1316  /* Set the desired player ID */
1317  lpPData->dpid = *lpid;
1318 
1319  DP_CopyDPNAMEStruct( &lpPData->name, lpName, bAnsi );
1320 
1321  lpPData->dwFlags = dwFlags;
1322 
1323  /* If we were given an event handle, duplicate it */
1324  if( hEvent != 0 )
1325  {
1327  GetCurrentProcess(), &lpPData->hEvent,
1329  )
1330  {
1331  /* FIXME: Memory leak */
1332  ERR( "Can't duplicate player msg handle %p\n", hEvent );
1333  }
1334  }
1335 
1336  /* Initialize the SP data section */
1338 
1339  TRACE( "Created player id 0x%08x\n", *lpid );
1340 
1342  This->dp2->lpSessionDesc->dwCurrentPlayers++;
1343 
1344  return lpPData;
1345 }
LPVOID DPSP_CreateSPPlayerData(void) DECLSPEC_HIDDEN
Definition: dplaysp.c:711
_In_ LPCSTR lpName
Definition: winbase.h:2729
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:395
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:1402
_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 1349 of file dplay.c.

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

Referenced by DP_DeleteGroup(), and DP_DeletePlayer().

◆ DP_DeleteGroup()

static void DP_DeleteGroup ( IDirectPlayImpl This,
DPID  dpid 
)
static

Definition at line 1035 of file dplay.c.

1036 {
1037  lpGroupList lpGList;
1038 
1039  TRACE( "(%p)->(0x%08x)\n", This, dpid );
1040 
1041  DPQ_REMOVE_ENTRY( This->dp2->lpSysGroup->groups, groups, lpGData->dpid, ==, dpid, lpGList );
1042 
1043  if( lpGList == NULL )
1044  {
1045  ERR( "DPID 0x%08x not found\n", dpid );
1046  return;
1047  }
1048 
1049  if( --(lpGList->lpGData->uRef) )
1050  {
1051  FIXME( "Why is this not the last reference to group?\n" );
1052  DebugBreak();
1053  }
1054 
1055  /* Delete player */
1056  DP_DeleteDPNameStruct( &lpGList->lpGData->name );
1057  HeapFree( GetProcessHeap(), 0, lpGList->lpGData );
1058 
1059  /* Remove and Delete Player List object */
1060  HeapFree( GetProcessHeap(), 0, lpGList );
1061 
1062 }
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:395
static void DP_DeleteDPNameStruct(LPDPNAME lpDPName)
Definition: dplay.c:1349
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:394

Referenced by DP_IF_DestroyGroup().

◆ DP_DeletePlayer()

static void DP_DeletePlayer ( IDirectPlayImpl This,
DPID  dpid 
)
static

Definition at line 1356 of file dplay.c.

1357 {
1358  lpPlayerList lpPList;
1359 
1360  TRACE( "(%p)->(0x%08x)\n", This, dpid );
1361 
1362  DPQ_REMOVE_ENTRY( This->dp2->lpSysGroup->players, players, lpPData->dpid, ==, dpid, lpPList );
1363 
1364  if( lpPList == NULL )
1365  {
1366  ERR( "DPID 0x%08x not found\n", dpid );
1367  return;
1368  }
1369 
1370  /* Verify that this is the last reference to the data */
1371  if( --(lpPList->lpPData->uRef) )
1372  {
1373  FIXME( "Why is this not the last reference to player?\n" );
1374  DebugBreak();
1375  }
1376 
1377  /* Delete player */
1378  DP_DeleteDPNameStruct( &lpPList->lpPData->name );
1379 
1380  CloseHandle( lpPList->lpPData->hEvent );
1381  HeapFree( GetProcessHeap(), 0, lpPList->lpPData );
1382 
1383  /* Delete Player List object */
1384  HeapFree( GetProcessHeap(), 0, lpPList );
1385 }
#define CloseHandle
Definition: compat.h:398
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:395
static void DP_DeleteDPNameStruct(LPDPNAME lpDPName)
Definition: dplay.c:1349
#define ERR(fmt,...)
Definition: debug.h:109
#define HeapFree(x, y, z)
Definition: compat.h:394
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 205 of file dplay.c.

206 {
207  IDirectPlayImpl *This = lpDP;
208 
209  if( This->dp2->hEnumSessionThread != INVALID_HANDLE_VALUE )
210  {
211  TerminateThread( This->dp2->hEnumSessionThread, 0 );
212  CloseHandle( This->dp2->hEnumSessionThread );
213  }
214 
215  /* Finish with the SP - have it shutdown */
216  if( This->dp2->spData.lpCB->ShutdownEx )
217  {
219 
220  TRACE( "Calling SP ShutdownEx\n" );
221 
222  data.lpISP = This->dp2->spData.lpISP;
223 
224  (*This->dp2->spData.lpCB->ShutdownEx)( &data );
225  }
226  else if (This->dp2->spData.lpCB->Shutdown ) /* obsolete interface */
227  {
228  TRACE( "Calling obsolete SP Shutdown\n" );
229  (*This->dp2->spData.lpCB->Shutdown)();
230  }
231 
232  /* Unload the SP (if it exists) */
233  if( This->dp2->hServiceProvider != 0 )
234  {
235  FreeLibrary( This->dp2->hServiceProvider );
236  }
237 
238  /* Unload the Lobby Provider (if it exists) */
239  if( This->dp2->hDPLobbyProvider != 0 )
240  {
241  FreeLibrary( This->dp2->hDPLobbyProvider );
242  }
243 
244  /* FIXME: Need to delete receive and send msgs queue contents */
245 
246  NS_DeleteSessionCache( This->dp2->lpNameServerData );
247 
248  HeapFree( GetProcessHeap(), 0, This->dp2->dplspData.lpCB);
249  HeapFree( GetProcessHeap(), 0, This->dp2->lpSessionDesc );
250 
251  IDirectPlaySP_Release( This->dp2->spData.lpISP );
252 
253  /* Delete the contents */
254  HeapFree( GetProcessHeap(), 0, This->dp2 );
255 
256  return TRUE;
257 }
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
BOOL WINAPI TerminateThread(IN HANDLE hThread, IN DWORD dwExitCode)
Definition: thread.c:586
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
void NS_DeleteSessionCache(LPVOID lpNSInfo)
Definition: name_server.c:284
#define TRACE(s)
Definition: solgame.cpp:4
#define FreeLibrary(x)
Definition: compat.h:405
#define GetProcessHeap()
Definition: compat.h:395
#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:394

Referenced by dplay_destroy().

◆ DP_EnumSessionsSendAsyncRequestThread()

static DWORD CALLBACK DP_EnumSessionsSendAsyncRequestThread ( LPVOID  lpContext)
static

Definition at line 2327 of file dplay.c.

2328 {
2329  EnumSessionAsyncCallbackData* data = lpContext;
2330  HANDLE hSuicideRequest = data->hSuicideRequest;
2331  DWORD dwTimeout = data->dwTimeout;
2332 
2333  TRACE( "Thread started with timeout = 0x%08x\n", dwTimeout );
2334 
2335  for( ;; )
2336  {
2337  HRESULT hr;
2338 
2339  /* Sleep up to dwTimeout waiting for request to terminate thread */
2340  if( WaitForSingleObject( hSuicideRequest, dwTimeout ) == WAIT_OBJECT_0 )
2341  {
2342  TRACE( "Thread terminating on terminate request\n" );
2343  break;
2344  }
2345 
2346  /* Now resend the enum request */
2347  hr = NS_SendSessionRequestBroadcast( &data->requestGuid,
2348  data->dwEnumSessionFlags,
2349  data->lpSpData );
2350 
2351  if( FAILED(hr) )
2352  {
2353  ERR( "Enum broadcase request failed: %s\n", DPLAYX_HresultToString(hr) );
2354  /* FIXME: Should we kill this thread? How to inform the main thread? */
2355  }
2356 
2357  }
2358 
2359  TRACE( "Thread terminating\n" );
2360 
2361  /* Clean up the thread data */
2362  CloseHandle( hSuicideRequest );
2363  HeapFree( GetProcessHeap(), 0, lpContext );
2364 
2365  /* FIXME: Need to have some notification to main app thread that this is
2366  * dead. It would serve two purposes. 1) allow sync on termination
2367  * so that we don't actually send something to ourselves when we
2368  * become name server (race condition) and 2) so that if we die
2369  * abnormally something else will be able to tell.
2370  */
2371 
2372  return 1;
2373 }
#define CloseHandle
Definition: compat.h:398
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:197
#define TRACE(s)
Definition: solgame.cpp:4
#define WAIT_OBJECT_0
Definition: winbase.h:387
#define GetProcessHeap()
Definition: compat.h:395
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:394

Referenced by IDirectPlay4Impl_EnumSessions().

◆ DP_FindAnyGroup()

static lpGroupData DP_FindAnyGroup ( IDirectPlayImpl This,
DPID  dpid 
)
static

Definition at line 1064 of file dplay.c.

1065 {
1066  lpGroupList lpGroups;
1067 
1068  TRACE( "(%p)->(0x%08x)\n", This, dpid );
1069 
1070  if( dpid == DPID_SYSTEM_GROUP )
1071  {
1072  return This->dp2->lpSysGroup;
1073  }
1074  else
1075  {
1076  DPQ_FIND_ENTRY( This->dp2->lpSysGroup->groups, groups, lpGData->dpid, ==, dpid, lpGroups );
1077  }
1078 
1079  if( lpGroups == NULL )
1080  {
1081  return NULL;
1082  }
1083 
1084  return lpGroups->lpGData;
1085 }
#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:81
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 1387 of file dplay.c.

1388 {
1389  lpPlayerList lpPlayers;
1390 
1391  TRACE( "(%p)->(0x%08x)\n", This, dpid );
1392 
1393  if(This->dp2->lpSysGroup == NULL)
1394  return NULL;
1395 
1396  DPQ_FIND_ENTRY( This->dp2->lpSysGroup->players, players, lpPData->dpid, ==, dpid, lpPlayers );
1397 
1398  return lpPlayers;
1399 }
#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 1783 of file dplay.c.

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

Referenced by DP_IF_CreateGroup().

◆ DP_GetSessionDesc()

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

Definition at line 3094 of file dplay.c.

3096 {
3097  DWORD dwRequiredSize;
3098 
3099  TRACE( "(%p)->(%p,%p,%u)\n", This, lpData, lpdwDataSize, bAnsi );
3100 
3101  if( This->dp2->connectionInitialized == NO_PROVIDER )
3102  {
3103  return DPERR_UNINITIALIZED;
3104  }
3105 
3106  if( ( lpData == NULL ) && ( lpdwDataSize == NULL ) )
3107  {
3108  return DPERR_INVALIDPARAMS;
3109  }
3110 
3111  /* FIXME: Get from This->dp2->lpSessionDesc */
3112  dwRequiredSize = DP_CalcSessionDescSize( This->dp2->lpSessionDesc, bAnsi );
3113 
3114  if ( ( lpData == NULL ) ||
3115  ( *lpdwDataSize < dwRequiredSize )
3116  )
3117  {
3118  *lpdwDataSize = dwRequiredSize;
3119  return DPERR_BUFFERTOOSMALL;
3120  }
3121 
3122  DP_CopySessionDesc( lpData, This->dp2->lpSessionDesc, bAnsi );
3123 
3124  return DP_OK;
3125 }
#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:3869
#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:3913

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 4587 of file dplay.c.

4592 {
4593  /* Looking for the GUID of the provider to load */
4594  if( ( IsEqualGUID( guidDataType, &DPAID_ServiceProvider ) ) ||
4595  ( IsEqualGUID( guidDataType, &DPAID_LobbyProvider ) )
4596  )
4597  {
4598  TRACE( "Found SP/LP (%s) %s (data size = 0x%08x)\n",
4599  debugstr_guid( guidDataType ), debugstr_guid( lpData ), dwDataSize );
4600 
4601  if( dwDataSize != sizeof( GUID ) )
4602  {
4603  ERR( "Invalid sp/lp guid size 0x%08x\n", dwDataSize );
4604  }
4605 
4606  memcpy( lpContext, lpData, dwDataSize );
4607 
4608  /* There shouldn't be more than 1 GUID/compound address */
4609  return FALSE;
4610  }
4611 
4612  /* Still waiting for what we want */
4613  return TRUE;
4614 }
#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:4021

Referenced by IDirectPlay4Impl_InitializeConnection().

◆ DP_GetSPPlayerData()

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

Definition at line 5721 of file dplay.c.

5722 {
5723  lpPlayerList lpPlayer = DP_FindPlayer( lpDP, idPlayer );
5724 
5725  if( lpPlayer == NULL )
5726  {
5727  return DPERR_INVALIDPLAYER;
5728  }
5729 
5730  *lplpData = lpPlayer->lpPData->lpSPPlayerData;
5731 
5732  return DP_OK;
5733 }
#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:1387
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 273 of file dplay.c.

276 {
277  TRACE( "(%p)->(%p,0x%08x,%p,%u,%u)\n",
278  This, lpcMessageBody, dwMessageBodySize, lpcMessageHeader, wCommandId,
279  wVersion );
280 
281  switch( wCommandId )
282  {
283  /* Name server needs to handle this request */
285  /* Reply expected */
286  NS_ReplyToEnumSessionsRequest( lpcMessageBody, lplpReply, lpdwMsgSize, This );
287  break;
288 
289  /* Name server needs to handle this request */
291  /* No reply expected */
292  NS_AddRemoteComputerAsNameServer( lpcMessageHeader,
293  This->dp2->spData.dwSPHeaderSize,
294  lpcMessageBody,
295  This->dp2->lpNameServerData );
296  break;
297 
299  {
300  LPCDPMSG_REQUESTNEWPLAYERID lpcMsg = lpcMessageBody;
301 
302  LPDPMSG_NEWPLAYERIDREPLY lpReply;
303 
304  *lpdwMsgSize = This->dp2->spData.dwSPHeaderSize + sizeof( *lpReply );
305 
306  *lplpReply = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, *lpdwMsgSize );
307 
308  FIXME( "Ignoring dwFlags 0x%08x in request msg\n",
309  lpcMsg->dwFlags );
310 
311  /* Setup the reply */
312  lpReply = (LPDPMSG_NEWPLAYERIDREPLY)( (BYTE*)(*lplpReply) +
313  This->dp2->spData.dwSPHeaderSize );
314 
317  lpReply->envelope.wVersion = DPMSGVER_DP6;
318 
319  lpReply->dpidNewPlayerId = DP_NextObjectId();
320 
321  TRACE( "Allocating new playerid 0x%08x from remote request\n",
322  lpReply->dpidNewPlayerId );
323  break;
324  }
325 
328  DP_MSG_ReplyReceived( This, wCommandId, lpcMessageBody, dwMessageBodySize );
329  break;
330 
332  TRACE( "GOT THE SELF MESSAGE: %p -> 0x%08x\n", lpcMessageHeader, ((const DWORD *)lpcMessageHeader)[1] );
333  NS_SetLocalAddr( This->dp2->lpNameServerData, lpcMessageHeader, 20 );
334  DP_MSG_ReplyReceived( This, wCommandId, lpcMessageBody, dwMessageBodySize );
335 
337  TRACE( "Sending message to self to get my addr\n" );
338  DP_MSG_ToSelf( This, 1 ); /* This is a hack right now */
339  break;
340 
342  DP_MSG_ErrorReceived( This, wCommandId, lpcMessageBody, dwMessageBodySize );
343  break;
344 
345  default:
346  FIXME( "Unknown wCommandId %u. Ignoring message\n", wCommandId );
347  DebugBreak();
348  break;
349  }
350 
351  /* FIXME: There is code in dplaysp.c to handle dplay commands. Move to here. */
352 
353  return DP_OK;
354 }
void NS_ReplyToEnumSessionsRequest(const void *lpcMsg, void **lplpReplyData, DWORD *lpdwReplySize, IDirectPlayImpl *lpDP)
Definition: name_server.c:359
#define DPMSGCMD_ENUMSESSIONSREPLY
void NS_SetLocalAddr(LPVOID lpNSInfo, LPCVOID lpHdr, DWORD dwHdrSize)
Definition: name_server.c:185
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:267
#define DPMSGCMD_JUSTENVELOPE
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
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:88
#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 1087 of file dplay.c.

1089 {
1090  lpGroupData lpGData;
1091 
1092  TRACE( "(%p)->(%p,%p,%p,%p,0x%08x,0x%08x,%u)\n",
1093  This, lpMsgHdr, lpidGroup, lpGroupName, lpData, dwDataSize,
1094  dwFlags, bAnsi );
1095 
1096  if( This->dp2->connectionInitialized == NO_PROVIDER )
1097  {
1098  return DPERR_UNINITIALIZED;
1099  }
1100 
1101  /* If the name is not specified, we must provide one */
1102  if( DPID_UNKNOWN == *lpidGroup )
1103  {
1104  /* If we are the name server, we decide on the group ids. If not, we
1105  * must ask for one before attempting a creation.
1106  */
1107  if( This->dp2->bHostInterface )
1108  {
1109  *lpidGroup = DP_NextObjectId();
1110  }
1111  else
1112  {
1113  *lpidGroup = DP_GetRemoteNextObjectId();
1114  }
1115  }
1116 
1117  lpGData = DP_CreateGroup( This, lpidGroup, lpGroupName, dwFlags,
1118  DPID_NOPARENT_GROUP, bAnsi );
1119 
1120  if( lpGData == NULL )
1121  {
1122  return DPERR_CANTADDPLAYER; /* yes player not group */
1123  }
1124 
1125  if( DPID_SYSTEM_GROUP == *lpidGroup )
1126  {
1127  This->dp2->lpSysGroup = lpGData;
1128  TRACE( "Inserting system group\n" );
1129  }
1130  else
1131  {
1132  /* Insert into the system group */
1133  lpGroupList lpGroup = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpGroup ) );
1134  lpGroup->lpGData = lpGData;
1135 
1136  DPQ_INSERT( This->dp2->lpSysGroup->groups, lpGroup, groups );
1137  }
1138 
1139  /* Something is now referencing this data */
1140  lpGData->uRef++;
1141 
1142  /* Set all the important stuff for the group */
1143  DP_SetGroupData( lpGData, DPSET_REMOTE, lpData, dwDataSize );
1144 
1145  /* FIXME: We should only create the system group if GetCaps returns
1146  * DPCAPS_GROUPOPTIMIZED.
1147  */
1148 
1149  /* Let the SP know that we've created this group */
1150  if( This->dp2->spData.lpCB->CreateGroup )
1151  {
1153  DWORD dwCreateFlags = 0;
1154 
1155  TRACE( "Calling SP CreateGroup\n" );
1156 
1157  if( *lpidGroup == DPID_NOPARENT_GROUP )
1158  dwCreateFlags |= DPLAYI_GROUP_SYSGROUP;
1159 
1160  if( lpMsgHdr == NULL )
1161  dwCreateFlags |= DPLAYI_PLAYER_PLAYERLOCAL;
1162 
1163  if( dwFlags & DPGROUP_HIDDEN )
1164  dwCreateFlags |= DPLAYI_GROUP_HIDDEN;
1165 
1166  data.idGroup = *lpidGroup;
1167  data.dwFlags = dwCreateFlags;
1168  data.lpSPMessageHeader = lpMsgHdr;
1169  data.lpISP = This->dp2->spData.lpISP;
1170 
1171  (*This->dp2->spData.lpCB->CreateGroup)( &data );
1172  }
1173 
1174  /* Inform all other peers of the creation of a new group. If there are
1175  * no peers keep this event quiet.
1176  * Also if this message was sent to us, don't rebroadcast.
1177  */
1178  if( ( lpMsgHdr == NULL ) &&
1179  This->dp2->lpSessionDesc &&
1180  ( This->dp2->lpSessionDesc->dwFlags & DPSESSION_MULTICASTSERVER ) )
1181  {
1183  msg.dwType = DPSYS_CREATEPLAYERORGROUP;
1184 
1185  msg.dwPlayerType = DPPLAYERTYPE_GROUP;
1186  msg.dpId = *lpidGroup;
1187  msg.dwCurrentPlayers = 0; /* FIXME: Incorrect? */
1188  msg.lpData = lpData;
1189  msg.dwDataSize = dwDataSize;
1190  msg.dpnName = *lpGroupName;
1191  msg.dpIdParent = DPID_NOPARENT_GROUP;
1192  msg.dwFlags = DPMSG_CREATEGROUP_DWFLAGS( dwFlags );
1193 
1194  /* FIXME: Correct to just use send effectively? */
1195  /* FIXME: Should size include data w/ message or just message "header" */
1196  /* FIXME: Check return code */
1197  IDirectPlayX_SendEx( &This->IDirectPlay4_iface, DPID_SERVERPLAYER, DPID_ALLPLAYERS, 0, &msg,
1198  sizeof( msg ), 0, 0, NULL, NULL );
1199  }
1200 
1201  return DP_OK;
1202 }
#define DPGROUP_HIDDEN
Definition: dplay.h:1013
#define DPSET_REMOTE
Definition: dplay.h:1056
#define DPMSG_CREATEGROUP_DWFLAGS(x)
Definition: dplay.c:86
#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:81
#define DPSYS_CREATEPLAYERORGROUP
Definition: dplay.h:1085
smooth NULL
Definition: ftsmooth.c:416
static DPID DP_NextObjectId(void)
Definition: dplay.c:267
#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:395
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:1783
_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:1002
#define DPLAYI_GROUP_HIDDEN
Definition: dplaysp.h:63
#define DPID_NOPARENT_GROUP
Definition: dplay.c:80
static void DP_SetGroupData(lpGroupData lpGData, DWORD dwFlags, LPVOID lpData, DWORD dwDataSize)
Definition: dplay.c:1260
#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 4023 of file dplay.c.

4026 {
4027  lpGroupData lpGParentData;
4028  lpGroupList lpGList;
4029  lpGroupData lpGData;
4030 
4031  TRACE( "(%p)->(0x%08x,%p,%p,%p,0x%08x,0x%08x,%u)\n",
4032  This, idParentGroup, lpidGroup, lpGroupName, lpData,
4033  dwDataSize, dwFlags, bAnsi );
4034 
4035  if( This->dp2->connectionInitialized == NO_PROVIDER )
4036  {
4037  return DPERR_UNINITIALIZED;
4038  }
4039 
4040  /* Verify that the specified parent is valid */
4041  if( ( lpGParentData = DP_FindAnyGroup(This, idParentGroup ) ) == NULL )
4042  return DPERR_INVALIDGROUP;
4043 
4044  lpGData = DP_CreateGroup(This, lpidGroup, lpGroupName, dwFlags, idParentGroup, bAnsi );
4045 
4046  if( lpGData == NULL )
4047  {
4048  return DPERR_CANTADDPLAYER; /* yes player not group */
4049  }
4050 
4051  /* Something else is referencing this data */
4052  lpGData->uRef++;
4053 
4054  DP_SetGroupData( lpGData, DPSET_REMOTE, lpData, dwDataSize );
4055 
4056  /* The list has now been inserted into the interface group list. We now
4057  need to put a "shortcut" to this group in the parent group */
4058  lpGList = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpGList ) );
4059  if( lpGList == NULL )
4060  {
4061  FIXME( "Memory leak\n" );
4062  return DPERR_CANTADDPLAYER; /* yes player not group */
4063  }
4064 
4065  lpGList->lpGData = lpGData;
4066 
4067  DPQ_INSERT( lpGParentData->groups, lpGList, groups );
4068 
4069  /* Let the SP know that we've created this group */
4070  if( This->dp2->spData.lpCB->CreateGroup )
4071  {
4073 
4074  TRACE( "Calling SP CreateGroup\n" );
4075 
4076  data.idGroup = *lpidGroup;
4077  data.dwFlags = dwFlags;
4078  data.lpSPMessageHeader = lpMsgHdr;
4079  data.lpISP = This->dp2->spData.lpISP;
4080 
4081  (*This->dp2->spData.lpCB->CreateGroup)( &data );
4082  }
4083 
4084  /* Inform all other peers of the creation of a new group. If there are
4085  * no peers keep this quiet.
4086  */
4087  if( This->dp2->lpSessionDesc &&
4088  ( This->dp2->lpSessionDesc->dwFlags & DPSESSION_MULTICASTSERVER ) )
4089  {
4091 
4092  msg.dwType = DPSYS_CREATEPLAYERORGROUP;
4093  msg.dwPlayerType = DPPLAYERTYPE_GROUP;
4094  msg.dpId = *lpidGroup;
4095  msg.dwCurrentPlayers = idParentGroup; /* FIXME: Incorrect? */
4096  msg.lpData = lpData;
4097  msg.dwDataSize = dwDataSize;
4098  msg.dpnName = *lpGroupName;
4099 
4100  /* FIXME: Correct to just use send effectively? */
4101  /* FIXME: Should size include data w/ message or just message "header" */
4102  /* FIXME: Check return code */
4103  IDirectPlayX_SendEx( &This->IDirectPlay4_iface, DPID_SERVERPLAYER, DPID_ALLPLAYERS, 0, &msg,
4104  sizeof( msg ), 0, 0, NULL, NULL );
4105  }
4106 
4107  return DP_OK;
4108 }
#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:1064
#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:395
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:1002
static void DP_SetGroupData(lpGroupData lpGData, DWORD dwFlags, LPVOID lpData, DWORD dwDataSize)
Definition: dplay.c:1260
#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 1501 of file dplay.c.

1504 {
1505  HRESULT hr = DP_OK;
1506  lpPlayerData lpPData;
1507  lpPlayerList lpPList;
1508  DWORD dwCreateFlags = 0;
1509 
1510  TRACE( "(%p)->(%p,%p,%p,%p,0x%08x,0x%08x,%u)\n",
1511  This, lpidPlayer, lpPlayerName, hEvent, lpData,
1512  dwDataSize, dwFlags, bAnsi );
1513  if( This->dp2->connectionInitialized == NO_PROVIDER )
1514  {
1515  return DPERR_UNINITIALIZED;
1516  }
1517 
1518  if( dwFlags == 0 )
1519  {
1521  }
1522 
1523  if( lpidPlayer == NULL )
1524  {
1525  return DPERR_INVALIDPARAMS;
1526  }
1527 
1528 
1529  /* Determine the creation flags for the player. These will be passed
1530  * to the name server if requesting a player id and to the SP when
1531  * informing it of the player creation
1532  */
1533  {
1535  {
1536  if( *lpidPlayer == DPID_SERVERPLAYER )
1537  {
1538  /* Server player for the host interface */
1539  dwCreateFlags |= DPLAYI_PLAYER_APPSERVER;
1540  }
1541  else if( *lpidPlayer == DPID_NAME_SERVER )
1542  {
1543  /* Name server - master of everything */
1545  }
1546  else
1547  {
1548  /* Server player for a non host interface */
1549  dwCreateFlags |= DPLAYI_PLAYER_SYSPLAYER;
1550  }
1551  }
1552 
1553  if( lpMsgHdr == NULL )
1554  dwCreateFlags |= DPLAYI_PLAYER_PLAYERLOCAL;
1555  }
1556 
1557  /* Verify we know how to handle all the flags */
1558  if( !( ( dwFlags & DPPLAYER_SERVERPLAYER ) ||
1560  )
1561  )
1562  {
1563  /* Assume non fatal failure */
1564  ERR( "unknown dwFlags = 0x%08x\n", dwFlags );
1565  }
1566 
1567  /* If the name is not specified, we must provide one */
1568  if( *lpidPlayer == DPID_UNKNOWN )
1569  {
1570  /* If we are the session master, we dish out the group/player ids */
1571  if( This->dp2->bHostInterface )
1572  {
1573  *lpidPlayer = DP_NextObjectId();
1574  }
1575  else
1576  {
1577  hr = DP_MSG_SendRequestPlayerId( This, dwCreateFlags, lpidPlayer );
1578 
1579  if( FAILED(hr) )
1580  {
1581  ERR( "Request for ID failed: %s\n", DPLAYX_HresultToString( hr ) );
1582  return hr;
1583  }
1584  }
1585  }
1586  else
1587  {
1588  /* FIXME: Would be nice to perhaps verify that we don't already have
1589  * this player.
1590  */
1591  }
1592 
1593  /* We pass creation flags, so we can distinguish sysplayers and not count them in the current
1594  player total */
1595  lpPData = DP_CreatePlayer( This, lpidPlayer, lpPlayerName, dwCreateFlags,
1596  hEvent, bAnsi );
1597  /* Create the list object and link it in */
1598  lpPList = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpPList ) );
1599  if( !lpPData || !lpPList )
1600  {
1601  HeapFree( GetProcessHeap(), 0, lpPData );
1602  HeapFree( GetProcessHeap(), 0, lpPList );
1603  return DPERR_CANTADDPLAYER;
1604  }
1605 
1606  lpPData->uRef = 1;
1607  lpPList->lpPData = lpPData;
1608 
1609  /* Add the player to the system group */
1610  DPQ_INSERT( This->dp2->lpSysGroup->players, lpPList, players );
1611 
1612  /* Update the information and send it to all players in the session */
1613  DP_SetPlayerData( lpPData, DPSET_REMOTE, lpData, dwDataSize );
1614 
1615  /* Let the SP know that we've created this player */
1616  if( This->dp2->spData.lpCB->CreatePlayer )
1617  {
1619 
1620  data.idPlayer = *lpidPlayer;
1621  data.dwFlags = dwCreateFlags;
1622  data.lpSPMessageHeader = lpMsgHdr;
1623  data.lpISP = This->dp2->spData.lpISP;
1624 
1625  TRACE( "Calling SP CreatePlayer 0x%08x: dwFlags: 0x%08x lpMsgHdr: %p\n",
1626  *lpidPlayer, data.dwFlags, data.lpSPMessageHeader );
1627 
1628  hr = (*This->dp2->spData.lpCB->CreatePlayer)( &data );
1629  }
1630 
1631  if( FAILED(hr) )
1632  {
1633  ERR( "Failed to create player with sp: %s\n", DPLAYX_HresultToString(hr) );
1634  return hr;
1635  }
1636 
1637  /* Now let the SP know that this player is a member of the system group */
1638  if( This->dp2->spData.lpCB->AddPlayerToGroup )
1639  {
1641 
1642  data.idPlayer = *lpidPlayer;
1643  data.idGroup = DPID_SYSTEM_GROUP;
1644  data.lpISP = This->dp2->spData.lpISP;
1645 
1646  TRACE( "Calling SP AddPlayerToGroup (sys group)\n" );
1647 
1648  hr = (*This->dp2->spData.lpCB->AddPlayerToGroup)( &data );
1649  }
1650 
1651  if( FAILED(hr) )
1652  {
1653  ERR( "Failed to add player to sys group with sp: %s\n",
1655  return hr;
1656  }
1657 
1658 #if 1
1659  if( !This->dp2->bHostInterface )
1660  {
1661  /* Let the name server know about the creation of this player */
1662  /* FIXME: Is this only to be done for the creation of a server player or
1663  * is this used for regular players? If only for server players, move
1664  * this call to DP_SecureOpen(...);
1665  */
1666 #if 0
1667  TRACE( "Sending message to self to get my addr\n" );
1668  DP_MSG_ToSelf( This, *lpidPlayer ); /* This is a hack right now */
1669 #endif
1670 
1671  hr = DP_MSG_ForwardPlayerCreation( This, *lpidPlayer);
1672  }
1673 #else
1674  /* Inform all other peers of the creation of a new player. If there are
1675  * no peers keep this quiet.
1676  * Also, if this was a remote event, no need to rebroadcast it.
1677  */
1678  if( ( lpMsgHdr == NULL ) &&
1679  This->dp2->lpSessionDesc &&
1680  ( This->dp2->lpSessionDesc->dwFlags & DPSESSION_MULTICASTSERVER ) )
1681  {
1683  msg.dwType = DPSYS_CREATEPLAYERORGROUP;
1684 
1685  msg.dwPlayerType = DPPLAYERTYPE_PLAYER;
1686  msg.dpId = *lpidPlayer;
1687  msg.dwCurrentPlayers = 0; /* FIXME: Incorrect */
1688  msg.lpData = lpData;
1689  msg.dwDataSize = dwDataSize;
1690  msg.dpnName = *lpPlayerName;
1691  msg.dpIdParent = DPID_NOPARENT_GROUP;
1692  msg.dwFlags = DPMSG_CREATEPLAYER_DWFLAGS( dwFlags );
1693 
1694  /* FIXME: Correct to just use send effectively? */
1695  /* FIXME: Should size include data w/ message or just message "header" */
1696  /* FIXME: Check return code */
1697  hr = IDirectPlayX_SendEx( &This->IDirectPlay4_iface, DPID_SERVERPLAYER, DPID_ALLPLAYERS, 0,
1698  &msg, sizeof( msg ), 0, 0, NULL, NULL );
1699  }
1700 #endif
1701 
1702  return hr;
1703 }
#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:89
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:81
#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:267
#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:395
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:80
#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:1302
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
static void DP_SetPlayerData(lpPlayerData lpPData, DWORD dwFlags, LPVOID lpData, DWORD dwDataSize)
Definition: dplay.c:1458
#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:394
#define DPQ_INSERT(a, b, c)
Definition: dplayx_queue.h:34
#define DPID_NAME_SERVER
Definition: dplay.c:83
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 1908 of file dplay.c.

1909 {
1910  lpGroupData lpGData;
1912 
1913  FIXME( "(%p)->(%p,0x%08x,%u): semi stub\n",
1914  This, lpMsgHdr, idGroup, bAnsi );
1915 
1916  /* Find the group */
1917  if( ( lpGData = DP_FindAnyGroup( This, idGroup ) ) == NULL )
1918  {
1919  return DPERR_INVALIDPLAYER; /* yes player */
1920  }
1921 
1922  context.This = This;
1923  context.bAnsi = bAnsi;
1924  context.idGroup = idGroup;
1925 
1926  /* Remove all players that this group has */
1927  IDirectPlayX_EnumGroupPlayers( &This->IDirectPlay4_iface, idGroup, NULL, cbRemoveGroupOrPlayer,
1928  &context, 0 );
1929 
1930  /* Remove all links to groups that this group has since this is dp3 */
1931  IDirectPlayX_EnumGroupsInGroup( &This->IDirectPlay4_iface, idGroup, NULL, cbRemoveGroupOrPlayer,
1932  (void*)&context, 0 );
1933 
1934  /* Remove this group from the parent group - if it has one */
1935  if( ( idGroup != DPID_SYSTEM_GROUP ) && ( lpGData->parent != DPID_SYSTEM_GROUP ) )
1936  IDirectPlayX_DeleteGroupFromGroup( &This->IDirectPlay4_iface, lpGData->parent, idGroup );
1937 
1938  /* Now delete this group data and list from the system group */
1939  DP_DeleteGroup( This, idGroup );
1940 
1941  /* Let the SP know that we've destroyed this group */
1942  if( This->dp2->spData.lpCB->DeleteGroup )
1943  {
1945 
1946  FIXME( "data.dwFlags is incorrect\n" );
1947 
1948  data.idGroup = idGroup;
1949  data.dwFlags = 0;
1950  data.lpISP = This->dp2->spData.lpISP;
1951 
1952  (*This->dp2->spData.lpCB->DeleteGroup)( &data );
1953  }
1954 
1955  FIXME( "Send out a DESTORYPLAYERORGROUP message\n" );
1956 
1957  return DP_OK;
1958 }
#define DPERR_INVALIDPLAYER
Definition: dplay.h:104
static lpGroupData DP_FindAnyGroup(IDirectPlayImpl *This, DPID dpid)
Definition: dplay.c:1064
Definition: http.c:6587
#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:81
#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:1883
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:1035

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 2003 of file dplay.c.

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

2666 {
2667  lpGroupData lpGData;
2668  LPDPNAME lpName = lpData;
2669  DWORD dwRequiredDataSize;
2670 
2671  FIXME("(%p)->(0x%08x,%p,%p,%u) ANSI ignored\n",
2672  This, idGroup, lpData, lpdwDataSize, bAnsi );
2673 
2674  if( ( lpGData = DP_FindAnyGroup( This, idGroup ) ) == NULL )
2675  {
2676  return DPERR_INVALIDGROUP;
2677  }
2678 
2679  dwRequiredDataSize = lpGData->name.dwSize;
2680 
2681  if( lpGData->name.u1.lpszShortNameA )
2682  {
2683  dwRequiredDataSize += strlen( lpGData->name.u1.lpszShortNameA ) + 1;
2684  }
2685 
2686  if( lpGData->name.u2.lpszLongNameA )
2687  {
2688  dwRequiredDataSize += strlen( lpGData->name.u2.lpszLongNameA ) + 1;
2689  }
2690 
2691  if( ( lpData == NULL ) ||
2692  ( *lpdwDataSize < dwRequiredDataSize )
2693  )
2694  {
2695  *lpdwDataSize = dwRequiredDataSize;
2696  return DPERR_BUFFERTOOSMALL;
2697  }
2698 
2699  /* Copy the structure */
2700  CopyMemory( lpName, &lpGData->name, lpGData->name.dwSize );
2701 
2702  if( lpGData->name.u1.lpszShortNameA )
2703  {
2704  strcpy( ((char*)lpName)+lpGData->name.dwSize,
2705  lpGData->name.u1.lpszShortNameA );
2706  }
2707  else
2708  {
2709  lpName->u1.lpszShortNameA = NULL;
2710  }
2711 
2712  if( lpGData->name.u1.lpszShortNameA )
2713  {
2714  strcpy( ((char*)lpName)+lpGData->name.dwSize,
2715  lpGData->name.u2.lpszLongNameA );
2716  }
2717  else
2718  {
2719  lpName->u2.lpszLongNameA = NULL;
2720  }
2721 
2722  return DP_OK;
2723 }
static lpGroupData DP_FindAnyGroup(IDirectPlayImpl *This, DPID dpid)
Definition: dplay.c:1064
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:2729
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:1633
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 2986 of file dplay.c.

2988 {
2989  lpPlayerList lpPList;
2990  LPDPNAME lpName = lpData;
2991  DWORD dwRequiredDataSize;
2992 
2993  FIXME( "(%p)->(0x%08x,%p,%p,%u): ANSI\n",
2994  This, idPlayer, lpData, lpdwDataSize, bAnsi );
2995 
2996  if( This->dp2->connectionInitialized == NO_PROVIDER )
2997  {
2998  return DPERR_UNINITIALIZED;
2999  }
3000 
3001  if( ( lpPList = DP_FindPlayer( This, idPlayer ) ) == NULL )
3002  {
3003  return DPERR_INVALIDPLAYER;
3004  }
3005 
3006  dwRequiredDataSize = lpPList->lpPData->name.dwSize;
3007 
3008  if( lpPList->lpPData->name.u1.lpszShortNameA )
3009  {
3010  dwRequiredDataSize += strlen( lpPList->lpPData->name.u1.lpszShortNameA ) + 1;
3011  }
3012 
3013  if( lpPList->lpPData->name.u2.lpszLongNameA )
3014  {
3015  dwRequiredDataSize += strlen( lpPList->lpPData->name.u2.lpszLongNameA ) + 1;
3016  }
3017 
3018  if( ( lpData == NULL ) ||
3019  ( *lpdwDataSize < dwRequiredDataSize )
3020  )
3021  {
3022  *lpdwDataSize = dwRequiredDataSize;
3023  return DPERR_BUFFERTOOSMALL;
3024  }
3025 
3026  /* Copy the structure */
3027  CopyMemory( lpName, &lpPList->lpPData->name, lpPList->lpPData->name.dwSize );
3028 
3029  if( lpPList->lpPData->name.u1.lpszShortNameA )
3030  {
3031  strcpy( ((char*)lpName)+lpPList->lpPData->name.dwSize,
3032  lpPList->lpPData->name.u1.lpszShortNameA );
3033  }
3034  else
3035  {
3036  lpName->u1.lpszShortNameA = NULL;
3037  }
3038 
3039  if( lpPList->lpPData->name.u1.lpszShortNameA )
3040  {
3041  strcpy( ((char*)lpName)+lpPList->lpPData->name.dwSize,
3042  lpPList->lpPData->name.u2.lpszLongNameA );
3043  }
3044  else
3045  {
3046  lpName->u2.lpszLongNameA = NULL;
3047  }
3048 
3049  return DP_OK;
3050 }
#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:2729
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:1387
smooth NULL
Definition: ftsmooth.c:416
LPSTR lpszShortNameA
Definition: dplay.h:194
#define CopyMemory
Definition: winbase.h:1633
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 3359 of file dplay.c.

3361 {
3362  LPDPMSG lpMsg = NULL;
3363 
3364  FIXME( "(%p)->(%p,%p,0x%08x,%p,%p,%u): stub\n",
3365  This, lpidFrom, lpidTo, dwFlags, lpData, lpdwDataSize, bAnsi );
3366 
3367  if( This->dp2->connectionInitialized == NO_PROVIDER )
3368  {
3369  return DPERR_UNINITIALIZED;
3370  }
3371 
3372  if( dwFlags == 0 )
3373  {
3375  }
3376 
3377  /* If the lpData is NULL, we must be peeking the message */
3378  if( ( lpData == NULL ) &&
3379  !( dwFlags & DPRECEIVE_PEEK )
3380  )
3381  {
3382  return DPERR_INVALIDPARAMS;
3383  }
3384 
3385  if( dwFlags & DPRECEIVE_ALL )
3386  {
3387  lpMsg = This->dp2->receiveMsgs.lpQHFirst;
3388 
3389  if( !( dwFlags & DPRECEIVE_PEEK ) )
3390  {
3391  FIXME( "Remove from queue\n" );
3392  }
3393  }
3394  else if( ( dwFlags & DPRECEIVE_TOPLAYER ) ||
3396  )
3397  {
3398  FIXME( "Find matching message 0x%08x\n", dwFlags );
3399  }
3400  else
3401  {
3402  ERR( "Hmmm..dwFlags 0x%08x\n", dwFlags );
3403  }
3404 
3405  if( lpMsg == NULL )
3406  {
3407  return DPERR_NOMESSAGES;
3408  }
3409 
3410  /* Copy into the provided buffer */
3411  if (lpData) CopyMemory( lpData, lpMsg->msg, *lpdwDataSize );
3412 
3413  return DP_OK;
3414 }
#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:1633
_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 3568 of file dplay.c.

3570 {
3571  lpGroupData lpGData;
3572 
3573  TRACE( "(%p)->(0x%08x,%p,0x%08x,%u)\n", This, idGroup,
3574  lpGroupName, dwFlags, bAnsi );
3575 
3576  if( ( lpGData = DP_FindAnyGroup( This, idGroup ) ) == NULL )
3577  {
3578  return DPERR_INVALIDGROUP;
3579  }
3580 
3581  DP_CopyDPNAMEStruct( &lpGData->name, lpGroupName, bAnsi );
3582 
3583  /* Should send a DPMSG_SETPLAYERORGROUPNAME message */
3584  FIXME( "Message not sent and dwFlags ignored\n" );
3585 
3586  return DP_OK;
3587 }
static lpGroupData DP_FindAnyGroup(IDirectPlayImpl *This, DPID dpid)
Definition: dplay.c:1064
#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:1402
_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 3701 of file dplay.c.

3703 {
3704  lpPlayerList lpPList;
3705 
3706  TRACE( "(%p)->(0x%08x,%p,0x%08x,%u)\n",
3707  This, idPlayer, lpPlayerName, dwFlags, bAnsi );
3708 
3709  if( This->dp2->connectionInitialized == NO_PROVIDER )
3710  {
3711  return DPERR_UNINITIALIZED;
3712  }
3713 
3714  if( ( lpPList = DP_FindPlayer( This, idPlayer ) ) == NULL )
3715  {
3716  return DPERR_INVALIDGROUP;
3717  }
3718 
3719  DP_CopyDPNAMEStruct( &lpPList->lpPData->name, lpPlayerName, bAnsi );
3720 
3721  /* Should send a DPMSG_SETPLAYERORGROUPNAME message */
3722  FIXME( "Message not sent and dwFlags ignored\n" );
3723 
3724  return DP_OK;
3725 }
#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:1387
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:1402
_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 
)