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

Go to the source code of this file.

Classes

struct  _DPRGOPContext
 
struct  _DPFAGContext
 
struct  tagCreateEnum
 

Macros

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

Typedefs

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

Functions

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

Variables

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

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 20 of file dplay.c.

◆ DPID_NAME_SERVER

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

Definition at line 79 of file dplay.c.

◆ DPID_NOPARENT_GROUP

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

Definition at line 77 of file dplay.c.

◆ DPID_SYSTEM_GROUP

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

Definition at line 78 of file dplay.c.

◆ DPMSG_CREATEGROUP_DWFLAGS

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

Definition at line 82 of file dplay.c.

◆ DPMSG_CREATEPLAYER_DWFLAGS

#define DPMSG_CREATEPLAYER_DWFLAGS (   x)    0

Definition at line 85 of file dplay.c.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 25 of file dplay.c.

Typedef Documentation

◆ CreateEnumData

◆ DPFAGContext

◆ DPRGOPContext

◆ lpCreateEnumData

◆ lpDPFAGContext

◆ lpDPRGOPContext

Function Documentation

◆ cbDeletePlayerFromAllGroups()

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

Definition at line 2051 of file dplay.c.

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

Referenced by cbDeletePlayerFromAllGroups(), and DP_IF_DestroyPlayer().

◆ cbDPCreateEnumConnections()

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

Definition at line 5959 of file dplay.c.

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

Referenced by DirectPlayCreate().

◆ cbRemoveGroupOrPlayer()

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

Definition at line 1879 of file dplay.c.

1886{
1887 lpDPRGOPContext lpCtxt = (lpDPRGOPContext)lpContext;
1888
1889 TRACE( "Removing element:0x%08x (type:0x%08x) from element:0x%08x\n",
1890 dpId, dwPlayerType, lpCtxt->idGroup );
1891
1892 if( dwPlayerType == DPPLAYERTYPE_GROUP )
1893 {
1895 lpCtxt->idGroup, dpId ) ) )
1896 ERR( "Unable to delete group 0x%08x from group 0x%08x\n", dpId, lpCtxt->idGroup );
1897 }
1899 lpCtxt->idGroup, dpId ) ) )
1900 ERR( "Unable to delete player 0x%08x from grp 0x%08x\n", dpId, lpCtxt->idGroup );
1901
1902 return TRUE; /* Continue enumeration */
struct _DPRGOPContext * lpDPRGOPContext
#define IDirectPlayX_DeleteGroupFromGroup(p, a, b)
Definition: dplay.h:900
#define FAILED(hr)
Definition: intsafe.h:51
IDirectPlayImpl * This
Definition: dplay.c:1873
DPID idGroup
Definition: dplay.c:1875

Referenced by DP_IF_DestroyGroup().

◆ DirectPlayCreate()

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

Definition at line 5990 of file dplay.c.

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

◆ DirectPlayEnumerateA()

HRESULT WINAPI DirectPlayEnumerateA ( LPDPENUMDPCALLBACKA  lpEnumCallback,
LPVOID  lpContext 
)

Definition at line 5935 of file dplay.c.

5937{
5938 TRACE("(%p,%p)\n", lpEnumCallback, lpContext);
5939
5940 return DirectPlayEnumerateAW(lpEnumCallback, NULL, lpContext);
static HRESULT DirectPlayEnumerateAW(LPDPENUMDPCALLBACKA lpEnumCallbackA, LPDPENUMDPCALLBACKW lpEnumCallbackW, LPVOID lpContext)
Definition: dplay.c:5767

◆ DirectPlayEnumerateAW()

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

Definition at line 5767 of file dplay.c.

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

Referenced by DirectPlayEnumerateA(), and DirectPlayEnumerateW().

◆ DirectPlayEnumerateW()

HRESULT WINAPI DirectPlayEnumerateW ( LPDPENUMDPCALLBACKW  lpEnumCallback,
LPVOID  lpContext 
)

Definition at line 5945 of file dplay.c.

5947{
5948 TRACE("(%p,%p)\n", lpEnumCallback, lpContext);
5949
5950 return DirectPlayEnumerateAW(NULL, lpEnumCallback, lpContext);

◆ DP_BuildSPCompoundAddr()

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

Definition at line 4197 of file dplay.c.

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

Referenced by IDirectPlay4AImpl_EnumConnections(), and IDirectPlay4Impl_EnumSessions().

◆ DP_CalcSessionDescSize()

static DWORD DP_CalcSessionDescSize ( LPCDPSESSIONDESC2  lpSessDesc,
BOOL  bAnsi 
)
static

Definition at line 3865 of file dplay.c.

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

Referenced by DP_GetSessionDesc(), and DP_SetSessionDesc().

◆ DP_CopyDPNAMEStruct()

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

Definition at line 1398 of file dplay.c.

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

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

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

Referenced by DP_GetSessionDesc(), and DP_SetSessionDesc().

◆ DP_CreateDirectPlay2()

static BOOL DP_CreateDirectPlay2 ( LPVOID  lpDP)
static

Definition at line 125 of file dplay.c.

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

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

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

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

1301{
1302 lpPlayerData lpPData;
1303
1304 TRACE( "(%p)->(%p,%p,%u)\n", This, lpid, lpName, bAnsi );
1305
1306 /* Allocate the storage for the player and associate it with list element */
1307 lpPData = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpPData ) );
1308 if( lpPData == NULL )
1309 {
1310 return NULL;
1311 }
1312
1313 /* Set the desired player ID */
1314 lpPData->dpid = *lpid;
1315
1316 DP_CopyDPNAMEStruct( &lpPData->name, lpName, bAnsi );
1317
1318 lpPData->dwFlags = dwFlags;
1319
1320 /* If we were given an event handle, duplicate it */
1321 if( hEvent != 0 )
1322 {
1324 GetCurrentProcess(), &lpPData->hEvent,
1326 )
1327 {
1328 /* FIXME: Memory leak */
1329 ERR( "Can't duplicate player msg handle %p\n", hEvent );
1330 }
1331 }
1332
1333 /* Initialize the SP data section */
1335
1336 TRACE( "Created player id 0x%08x\n", *lpid );
1337
1339 This->dp2->lpSessionDesc->dwCurrentPlayers++;
1340
1341 return lpPData;
#define GetCurrentProcess()
Definition: compat.h:759
BOOL WINAPI DuplicateHandle(IN HANDLE hSourceProcessHandle, IN HANDLE hSourceHandle, IN HANDLE hTargetProcessHandle, OUT LPHANDLE lpTargetHandle, IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwOptions)
Definition: handle.c:149
LPVOID DPSP_CreateSPPlayerData(void) DECLSPEC_HIDDEN
Definition: dplaysp.c:711
#define DPLAYI_PLAYER_SYSPLAYER
Definition: dplaysp.h:56
static HANDLE hEvent
Definition: comm.c:54
DPNAME name
Definition: dplay_global.h:63
LPVOID lpSPPlayerData
Definition: dplay_global.h:77
HANDLE hEvent
Definition: dplay_global.h:64
DWORD dwFlags
Definition: dplay_global.h:79
#define DUPLICATE_SAME_ACCESS

Referenced by DP_IF_CreatePlayer().

◆ DP_DeleteDPNameStruct()

static void DP_DeleteDPNameStruct ( LPDPNAME  lpDPName)
static

Definition at line 1345 of file dplay.c.

Referenced by DP_DeleteGroup(), and DP_DeletePlayer().

◆ DP_DeleteGroup()

static void DP_DeleteGroup ( IDirectPlayImpl This,
DPID  dpid 
)
static

Definition at line 1031 of file dplay.c.

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

Referenced by DP_IF_DestroyGroup().

◆ DP_DeletePlayer()

static void DP_DeletePlayer ( IDirectPlayImpl This,
DPID  dpid 
)
static

Definition at line 1352 of file dplay.c.

1354{
1355 lpPlayerList lpPList;
1356
1357 TRACE( "(%p)->(0x%08x)\n", This, dpid );
1358
1359 DPQ_REMOVE_ENTRY( This->dp2->lpSysGroup->players, players, lpPData->dpid, ==, dpid, lpPList );
1360
1361 if( lpPList == NULL )
1362 {
1363 ERR( "DPID 0x%08x not found\n", dpid );
1364 return;
1365 }
1366
1367 /* Verify that this is the last reference to the data */
1368 if( --(lpPList->lpPData->uRef) )
1369 {
1370 FIXME( "Why is this not the last reference to player?\n" );
1371 DebugBreak();
1372 }
1373
1374 /* Delete player */
1375 DP_DeleteDPNameStruct( &lpPList->lpPData->name );
1376
1377 CloseHandle( lpPList->lpPData->hEvent );
1378 HeapFree( GetProcessHeap(), 0, lpPList->lpPData );
1379
1380 /* Delete Player List object */
1381 HeapFree( GetProcessHeap(), 0, lpPList );
#define CloseHandle
Definition: compat.h:739
ULONG uRef
Definition: dplay_global.h:66
lpPlayerData lpPData
Definition: dplay_global.h:87

Referenced by DP_IF_DestroyPlayer().

◆ DP_DestroyDirectPlay2()

static BOOL DP_DestroyDirectPlay2 ( LPVOID  lpDP)
static

Definition at line 201 of file dplay.c.

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

Referenced by dplay_destroy().

◆ DP_EnumSessionsSendAsyncRequestThread()

static DWORD CALLBACK DP_EnumSessionsSendAsyncRequestThread ( LPVOID  lpContext)
static

Definition at line 2323 of file dplay.c.

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

Referenced by IDirectPlay4Impl_EnumSessions().

◆ DP_FindAnyGroup()

static lpGroupData DP_FindAnyGroup ( IDirectPlayImpl This,
DPID  dpid 
)
static

Definition at line 1060 of file dplay.c.

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

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

1385{
1386 lpPlayerList lpPlayers;
1387
1388 TRACE( "(%p)->(0x%08x)\n", This, dpid );
1389
1390 if(This->dp2->lpSysGroup == NULL)
1391 return NULL;
1392
1393 DPQ_FIND_ENTRY( This->dp2->lpSysGroup->players, players, lpPData->dpid, ==, dpid, lpPlayers );
1394
1395 return lpPlayers;

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

1781{
1782 FIXME( ":stub\n" );
1783
1784 /* Hack solution */
1785 return DP_NextObjectId();
static DPID DP_NextObjectId(void)
Definition: dplay.c:263

Referenced by DP_IF_CreateGroup().

◆ DP_GetSessionDesc()

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

Definition at line 3090 of file dplay.c.

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

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

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

Referenced by IDirectPlay4Impl_InitializeConnection().

◆ DP_GetSPPlayerData()

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

Definition at line 5717 of file dplay.c.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

3567{
3568 lpGroupData lpGData;
3569
3570 TRACE( "(%p)->(0x%08x,%p,0x%08x,%u)\n", This, idGroup,
3571 lpGroupName, dwFlags, bAnsi );
3572
3573 if( ( lpGData = DP_FindAnyGroup( This, idGroup ) ) == NULL )
3574 {
3575 return DPERR_INVALIDGROUP;
3576 }
3577
3578 DP_CopyDPNAMEStruct( &lpGData->name, lpGroupName, bAnsi );
3579
3580 /* Should send a DPMSG_SETPLAYERORGROUPNAME message */
3581 FIXME( "Message not sent and dwFlags ignored\n" );
3582
3583 return DP_OK;

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

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

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

◆ DP_InitializeDPLSP()

static HRESULT DP_InitializeDPLSP ( IDirectPlayImpl This,
HMODULE  hLobbyProvider 
)
static

Definition at line 4784 of file dplay.c.

4786{
4787 HRESULT hr;
4788 LPSP_INIT DPLSPInit;
4789
4790 /* Initialize the service provider by calling SPInit */
4791 DPLSPInit = (LPSP_INIT)GetProcAddress( hLobbyProvider, "DPLSPInit" );
4792
4793 if( DPLSPInit == NULL )
4794 {
4795 ERR( "Service provider doesn't provide DPLSPInit interface?\n" );
4796 FreeLibrary( hLobbyProvider );
4797 return DPERR_UNAVAILABLE;
4798 }
4799
4800 TRACE( "Calling DPLSPInit (DPL SP entry point)\n" );
4801
4802 hr = (*DPLSPInit)( &This->dp2->dplspData );
4803
4804 if( FAILED(hr) )
4805 {
4806 ERR( "DPL SP Initialization failed: %s\n", DPLAYX_HresultToString(hr) );
4807 FreeLibrary( hLobbyProvider );
4808 return hr;
4809 }
4810
4811 /* FIXME: Need to verify the sanity of the returned callback table
4812 * using IsBadCodePtr */
4813
4814 This->dp2->bDPLSPInitialized = TRUE;
4815
4816 /* This interface is now initialized as a lobby object */
4817 This->dp2->connectionInitialized = DP_LOBBY_PROVIDER;
4818
4819 /* Store the handle of the module so that we can unload it later */
4820 This->dp2->hDPLobbyProvider = hLobbyProvider;
4821
4822 return hr;
#define GetProcAddress(x, y)
Definition: compat.h:753
@ DP_LOBBY_PROVIDER
Definition: dplay_global.h:138
HRESULT(WINAPI * LPSP_INIT)(LPSPDATA_INIT)
Definition: lobbysp.h:460

Referenced by IDirectPlay4Impl_InitializeConnection().

◆ DP_InitializeDPSP()

static HRESULT DP_InitializeDPSP ( IDirectPlayImpl This,
HMODULE  hServiceProvider 
)
static

Definition at line 4745 of file dplay.c.

4747{
4748 HRESULT hr;
4749 LPDPSP_SPINIT SPInit;
4750
4751 /* Initialize the service provider by calling SPInit */
4752 SPInit = (LPDPSP_SPINIT)GetProcAddress( hServiceProvider, "SPInit" );
4753
4754 if( SPInit == NULL )
4755 {
4756 ERR( "Service provider doesn't provide SPInit interface?\n" );
4757 FreeLibrary( hServiceProvider );
4758 return DPERR_UNAVAILABLE;
4759 }
4760
4761 TRACE( "Calling SPInit (DP SP entry point)\n" );
4762
4763 hr = (*SPInit)( &This->dp2->spData );
4764
4765 if( FAILED(hr) )
4766 {
4767 ERR( "DP SP Initialization failed: %s\n", DPLAYX_HresultToString(hr) );
4768 FreeLibrary( hServiceProvider );
4769 return hr;
4770 }
4771
4772 /* FIXME: Need to verify the sanity of the returned callback table
4773 * using IsBadCodePtr */
4774 This->dp2->bSPInitialized = TRUE;
4775
4776 /* This interface is now initialized as a DP object */
4777 This->dp2->connectionInitialized = DP_SERVICE_PROVIDER;
4778
4779 /* Store the handle of the module so that we can unload it later */
4780 This->dp2->hServiceProvider = hServiceProvider;
4781
4782 return hr;
@ DP_SERVICE_PROVIDER
Definition: dplay_global.h:137
HRESULT(WINAPI * LPDPSP_SPINIT)(LPSPINITDATA)
Definition: dplaysp.h:366

Referenced by IDirectPlay4Impl_InitializeConnection().

◆ DP_InvokeEnumSessionCallbacks()

static void DP_InvokeEnumSessionCallbacks ( LPDPENUMSESSIONSCALLBACK2  lpEnumSessionsCallback2,
LPVOID  lpNSInfo,
DWORD  dwTimeout,
LPVOID  lpContext 
)
static

Definition at line 2293 of file dplay.c.

2299{
2300 LPDPSESSIONDESC2 lpSessionDesc;
2301
2302 FIXME( ": not checking for conditions\n" );
2303
2304 /* Not sure if this should be pruning but it's convenient */
2305 NS_PruneSessionCache( lpNSInfo );
2306
2307 NS_ResetSessionEnumeration( lpNSInfo );
2308
2309 /* Enumerate all sessions */
2310 /* FIXME: Need to indicate ANSI */
2311 while( (lpSessionDesc = NS_WalkSessions( lpNSInfo ) ) != NULL )
2312 {
2313 TRACE( "EnumSessionsCallback2 invoked\n" );
2314 if( !lpEnumSessionsCallback2( lpSessionDesc, &dwTimeout, 0, lpContext ) )
2315 {
2316 return;
2317 }
2318 }
2319
2320 /* Invoke one last time to indicate that there is no more to come */
2321 lpEnumSessionsCallback2( NULL, &dwTimeout, DPESC_TIMEDOUT, lpContext );
#define DPESC_TIMEDOUT
Definition: dplay.h:420
LPDPSESSIONDESC2 NS_WalkSessions(LPVOID lpNSInfo)
Definition: name_server.c:294
void NS_ResetSessionEnumeration(LPVOID lpNSInfo)
Definition: name_server.c:289
void NS_PruneSessionCache(LPVOID lpNSInfo)
Definition: name_server.c:319

Referenced by IDirectPlay4Impl_EnumSessions().

◆ DP_KillEnumSessionThread()

static void DP_KillEnumSessionThread ( IDirectPlayImpl This)
static

Definition at line 2371 of file dplay.c.

2373{
2374 /* Does a thread exist? If so we were doing an async enum session */
2375 if( This->dp2->hEnumSessionThread != INVALID_HANDLE_VALUE )
2376 {
2377 TRACE( "Killing EnumSession thread %p\n",
2378 This->dp2->hEnumSessionThread );
2379
2380 /* Request that the thread kill itself nicely */
2381 SetEvent( This->dp2->hKillEnumSessionThreadEvent );
2382 CloseHandle( This->dp2->hKillEnumSessionThreadEvent );
2383
2384 /* We no longer need to know about the thread */
2385 CloseHandle( This->dp2->hEnumSessionThread );
2386
2387 This->dp2->hEnumSessionThread = INVALID_HANDLE_VALUE;
2388 }
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733

Referenced by DP_SecureOpen(), and IDirectPlay4Impl_EnumSessions().

◆ DP_LoadSP()

static HMODULE DP_LoadSP ( LPCGUID  lpcGuid,
LPSPINITDATA  lpSpData,
LPBOOL  lpbIsDpSp 
)
static

Definition at line 4614 of file dplay.c.

4616{
4617 UINT i;
4618 LPCSTR spSubKey = "SOFTWARE\\Microsoft\\DirectPlay\\Service Providers";
4619 LPCSTR lpSubKey = "SOFTWARE\\Microsoft\\DirectPlay\\Lobby Providers";
4620 LPCSTR guidDataSubKey = "Guid";
4621 LPCSTR majVerDataSubKey = "dwReserved1";
4622 LPCSTR minVerDataSubKey = "dwReserved2";
4623 LPCSTR pathSubKey = "Path";
4624
4625 TRACE( " request to load %s\n", debugstr_guid( lpcGuid ) );
4626
4627 /* FIXME: Cloned code with a quick hack. */
4628 for( i=0; i<2; i++ )
4629 {
4630 HKEY hkResult;
4631 LPCSTR searchSubKey;
4632 char subKeyName[51];
4633 DWORD dwIndex, sizeOfSubKeyName=50;
4635
4636 (i == 0) ? (searchSubKey = spSubKey ) : (searchSubKey = lpSubKey );
4637 *lpbIsDpSp = (i == 0);
4638
4639
4640 /* Need to loop over the service providers in the registry */
4641 if( RegOpenKeyExA( HKEY_LOCAL_MACHINE, searchSubKey,
4642 0, KEY_READ, &hkResult ) != ERROR_SUCCESS )
4643 {
4644 /* Hmmm. Does this mean that there are no service providers? */
4645 ERR(": no service providers?\n");
4646 return 0;
4647 }
4648
4649 /* Traverse all the service providers we have available */
4650 for( dwIndex=0;
4651 RegEnumKeyExA( hkResult, dwIndex, subKeyName, &sizeOfSubKeyName,
4653 ++dwIndex, sizeOfSubKeyName=51 )
4654 {
4655
4656 HKEY hkServiceProvider;
4657 GUID serviceProviderGUID;
4658 DWORD returnType, sizeOfReturnBuffer = 255;
4659 char returnBuffer[256];
4660 WCHAR buff[51];
4661 DWORD dwTemp, len;
4662
4663 TRACE(" this time through: %s\n", subKeyName );
4664
4665 /* Get a handle for this particular service provider */
4666 if( RegOpenKeyExA( hkResult, subKeyName, 0, KEY_READ,
4667 &hkServiceProvider ) != ERROR_SUCCESS )
4668 {
4669 ERR(": what the heck is going on?\n" );
4670 continue;
4671 }
4672
4673 if( RegQueryValueExA( hkServiceProvider, guidDataSubKey,
4674 NULL, &returnType, (LPBYTE)returnBuffer,
4675 &sizeOfReturnBuffer ) != ERROR_SUCCESS )
4676 {
4677 ERR(": missing GUID registry data members\n" );
4678 continue;
4679 }
4680
4681 /* FIXME: Check return types to ensure we're interpreting data right */
4682 MultiByteToWideChar( CP_ACP, 0, returnBuffer, -1, buff, ARRAY_SIZE( buff ));
4683 CLSIDFromString( buff, &serviceProviderGUID );
4684 /* FIXME: Have I got a memory leak on the serviceProviderGUID? */
4685
4686 /* Determine if this is the Service Provider that the user asked for */
4687 if( !IsEqualGUID( &serviceProviderGUID, lpcGuid ) )
4688 {
4689 continue;
4690 }
4691
4692 if( i == 0 ) /* DP SP */
4693 {
4694 len = MultiByteToWideChar( CP_ACP, 0, subKeyName, -1, NULL, 0 );
4695 lpSpData->lpszName = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) );
4696 MultiByteToWideChar( CP_ACP, 0, subKeyName, -1, lpSpData->lpszName, len );
4697 }
4698
4699 sizeOfReturnBuffer = 255;
4700
4701 /* Get dwReserved1 */
4702 if( RegQueryValueExA( hkServiceProvider, majVerDataSubKey,
4703 NULL, &returnType, (LPBYTE)returnBuffer,
4704 &sizeOfReturnBuffer ) != ERROR_SUCCESS )
4705 {
4706 ERR(": missing dwReserved1 registry data members\n") ;
4707 continue;
4708 }
4709
4710 if( i == 0 )
4711 memcpy( &lpSpData->dwReserved1, returnBuffer, sizeof(lpSpData->dwReserved1) );
4712
4713 sizeOfReturnBuffer = 255;
4714
4715 /* Get dwReserved2 */
4716 if( RegQueryValueExA( hkServiceProvider, minVerDataSubKey,
4717 NULL, &returnType, (LPBYTE)returnBuffer,
4718 &sizeOfReturnBuffer ) != ERROR_SUCCESS )
4719 {
4720 ERR(": missing dwReserved1 registry data members\n") ;
4721 continue;
4722 }
4723
4724 if( i == 0 )
4725 memcpy( &lpSpData->dwReserved2, returnBuffer, sizeof(lpSpData->dwReserved2) );
4726
4727 sizeOfReturnBuffer = 255;
4728
4729 /* Get the path for this service provider */
4730 if( ( dwTemp = RegQueryValueExA( hkServiceProvider, pathSubKey,
4731 NULL, NULL, (LPBYTE)returnBuffer,
4732 &sizeOfReturnBuffer ) ) != ERROR_SUCCESS )
4733 {
4734 ERR(": missing PATH registry data members: 0x%08x\n", dwTemp );
4735 continue;
4736 }
4737
4738 TRACE( "Loading %s\n", returnBuffer );
4739 return LoadLibraryA( returnBuffer );
4740 }
4741 }
4742
4743 return 0;
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3298
LONG WINAPI RegEnumKeyExA(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2419
#define CP_ACP
Definition: compat.h:109
#define MultiByteToWideChar
Definition: compat.h:110
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
static unsigned char buff[32768]
Definition: fatten.c:17
GLenum GLsizei len
Definition: glext.h:6722
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int UINT
Definition: ndis.h:50
DWORD dwReserved2
Definition: dplaysp.h:359
LPWSTR lpszName
Definition: dplaysp.h:356
DWORD dwReserved1
Definition: dplaysp.h:358
const char * LPCSTR
Definition: xmlstorage.h:183

Referenced by IDirectPlay4Impl_InitializeConnection().

◆ DP_NextObjectId()

static DPID DP_NextObjectId ( void  )
inlinestatic

Definition at line 263 of file dplay.c.

265{
#define InterlockedIncrement
Definition: armddk.h:53
static LONG kludgePlayerGroupId
Definition: dplay.c:87
DWORD DPID
Definition: dplay.h:158

Referenced by DP_GetRemoteNextObjectId(), DP_HandleMessage(), DP_IF_CreateGroup(), and DP_IF_CreatePlayer().

◆ DP_SecureOpen()

static HRESULT DP_SecureOpen ( IDirectPlayImpl This,
const DPSESSIONDESC2 lpsd,
DWORD  dwFlags,
const DPSECURITYDESC lpSecurity,
const DPCREDENTIALS lpCredentials,
BOOL  bAnsi 
)
static

Definition at line 3205 of file dplay.c.

3208{
3209 HRESULT hr = DP_OK;
3210
3211 FIXME( "(%p)->(%p,0x%08x,%p,%p): partial stub\n",
3212 This, lpsd, dwFlags, lpSecurity, lpCredentials );
3213
3214 if( This->dp2->connectionInitialized == NO_PROVIDER )
3215 {
3216 return DPERR_UNINITIALIZED;
3217 }
3218
3219 if( lpsd->dwSize != sizeof(DPSESSIONDESC2) )
3220 {
3221 TRACE( ": rejecting invalid dpsd size (%d).\n", lpsd->dwSize );
3222 return DPERR_INVALIDPARAMS;
3223 }
3224
3225 if( This->dp2->bConnectionOpen )
3226 {
3227 TRACE( ": rejecting already open connection.\n" );
3229 }
3230
3231 /* If we're enumerating, kill the thread */
3233
3234 if( dwFlags & DPOPEN_CREATE )
3235 {
3236 /* Rightoo - this computer is the host and the local computer needs to be
3237 the name server so that others can join this session */
3238 NS_SetLocalComputerAsNameServer( lpsd, This->dp2->lpNameServerData );
3239
3240 This->dp2->bHostInterface = TRUE;
3241
3242 hr = DP_SetSessionDesc( This, lpsd, 0, TRUE, bAnsi );
3243 if( FAILED( hr ) )
3244 {
3245 ERR( "Unable to set session desc: %s\n", DPLAYX_HresultToString( hr ) );
3246 return hr;
3247 }
3248 }
3249
3250 /* Invoke the conditional callback for the service provider */
3251 if( This->dp2->spData.lpCB->Open )
3252 {
3254
3255 FIXME( "Not all data fields are correct. Need new parameter\n" );
3256
3257 data.bCreate = (dwFlags & DPOPEN_CREATE ) != 0;
3258 data.lpSPMessageHeader = (dwFlags & DPOPEN_CREATE ) ? NULL
3259 : NS_GetNSAddr( This->dp2->lpNameServerData );
3260 data.lpISP = This->dp2->spData.lpISP;
3261 data.bReturnStatus = (dwFlags & DPOPEN_RETURNSTATUS) != 0;
3262 data.dwOpenFlags = dwFlags;
3263 data.dwSessionFlags = This->dp2->lpSessionDesc->dwFlags;
3264
3265 hr = (*This->dp2->spData.lpCB->Open)(&data);
3266 if( FAILED( hr ) )
3267 {
3268 ERR( "Unable to open session: %s\n", DPLAYX_HresultToString( hr ) );
3269 return hr;
3270 }
3271 }
3272
3273 {
3274 /* Create the system group of which everything is a part of */
3275 DPID systemGroup = DPID_SYSTEM_GROUP;
3276
3277 hr = DP_IF_CreateGroup( This, NULL, &systemGroup, NULL,
3278 NULL, 0, 0, TRUE );
3279
3280 }
3281
3282 if( dwFlags & DPOPEN_JOIN )
3283 {
3284 DPID dpidServerId = DPID_UNKNOWN;
3285
3286 /* Create the server player for this interface. This way we can receive
3287 * messages for this session.
3288 */
3289 /* FIXME: I suppose that we should be setting an event for a receive
3290 * type of thing. That way the messaging thread could know to wake
3291 * up. DPlay would then trigger the hEvent for the player the
3292 * message is directed to.
3293 */
3294 hr = DP_IF_CreatePlayer( This, NULL, &dpidServerId, NULL, 0, NULL,
3295 0,
3297
3298 }
3299 else if( dwFlags & DPOPEN_CREATE )
3300 {
3301 DPID dpidNameServerId = DPID_NAME_SERVER;
3302
3303 hr = DP_IF_CreatePlayer( This, NULL, &dpidNameServerId, NULL, 0, NULL,
3304 0, DPPLAYER_SERVERPLAYER, bAnsi );
3305 }
3306
3307 if( FAILED(hr) )
3308 {
3309 ERR( "Couldn't create name server/system player: %s\n",
3311 }
3312
3313 return hr;
static HRESULT DP_IF_CreateGroup(IDirectPlayImpl *This, void *lpMsgHdr, DPID *lpidGroup, DPNAME *lpGroupName, void *lpData, DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi)
Definition: dplay.c:1083
static void DP_KillEnumSessionThread(IDirectPlayImpl *This)
Definition: dplay.c:2371
static HRESULT DP_IF_CreatePlayer(IDirectPlayImpl *This, void *lpMsgHdr, DPID *lpidPlayer, DPNAME *lpPlayerName, HANDLE hEvent, void *lpData, DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi)
Definition: dplay.c:1497
static HRESULT DP_SetSessionDesc(IDirectPlayImpl *This, const DPSESSIONDESC2 *lpSessDesc, DWORD dwFlags, BOOL bInitial, BOOL bAnsi)
Definition: dplay.c:3765
#define DPOPEN_CREATE
Definition: dplay.h:264
#define DPOPEN_RETURNSTATUS
Definition: dplay.h:265
#define DPERR_ALREADYINITIALIZED
Definition: dplay.h:89
#define DPOPEN_JOIN
Definition: dplay.h:263
#define DPPLAYER_LOCAL
Definition: dplay.h:1007
void NS_SetLocalComputerAsNameServer(LPCDPSESSIONDESC2 lpsd, LPVOID lpNSInfo)
Definition: name_server.c:74
LPVOID NS_GetNSAddr(LPVOID lpNSInfo)
Definition: name_server.c:151
DWORD dwSize
Definition: dplay.h:232

Referenced by IDirectPlay4AImpl_SecureOpen(), and IDirectPlay4Impl_SecureOpen().

◆ DP_SetGroupData()

static void DP_SetGroupData ( lpGroupData  lpGData,
DWORD  dwFlags,
LPVOID  lpData,
DWORD  dwDataSize 
)
static

Definition at line 1256 of file dplay.c.

1259{
1260 /* Clear out the data with this player */
1261 if( dwFlags & DPSET_LOCAL )
1262 {
1263 if ( lpGData->dwLocalDataSize != 0 )
1264 {
1265 HeapFree( GetProcessHeap(), 0, lpGData->lpLocalData );
1266 lpGData->lpLocalData = NULL;
1267 lpGData->dwLocalDataSize = 0;
1268 }
1269 }
1270 else
1271 {
1272 if( lpGData->dwRemoteDataSize != 0 )
1273 {
1274 HeapFree( GetProcessHeap(), 0, lpGData->lpRemoteData );
1275 lpGData->lpRemoteData = NULL;
1276 lpGData->dwRemoteDataSize = 0;
1277 }
1278 }
1279
1280 /* Reallocate for new data */
1281 if( lpData != NULL )
1282 {
1283 if( dwFlags & DPSET_LOCAL )
1284 {
1285 lpGData->lpLocalData = lpData;
1286 lpGData->dwLocalDataSize = dwDataSize;
1287 }
1288 else
1289 {
1290 lpGData->lpRemoteData = HeapAlloc( GetProcessHeap(), 0, dwDataSize );
1291 CopyMemory( lpGData->lpRemoteData, lpData, dwDataSize );
1292 lpGData->dwRemoteDataSize = dwDataSize;
1293 }
1294 }
1295
#define DPSET_LOCAL
Definition: dplay.h:1057
DWORD dwLocalDataSize
Definition: dplay_global.h:110
DWORD dwRemoteDataSize
Definition: dplay_global.h:114
LPVOID lpRemoteData
Definition: dplay_global.h:113
LPVOID lpLocalData
Definition: dplay_global.h:109

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

◆ DP_SetPlayerData()

static void DP_SetPlayerData ( lpPlayerData  lpPData,
DWORD  dwFlags,
LPVOID  lpData,
DWORD  dwDataSize 
)
static

Definition at line 1454 of file dplay.c.

1457{
1458 /* Clear out the data with this player */
1459 if( dwFlags & DPSET_LOCAL )
1460 {
1461 if ( lpPData->dwLocalDataSize != 0 )
1462 {
1463 HeapFree( GetProcessHeap(), 0, lpPData->lpLocalData );
1464 lpPData->lpLocalData = NULL;
1465 lpPData->dwLocalDataSize = 0;
1466 }
1467 }
1468 else
1469 {
1470 if( lpPData->dwRemoteDataSize != 0 )
1471 {
1472 HeapFree( GetProcessHeap(), 0, lpPData->lpRemoteData );
1473 lpPData->lpRemoteData = NULL;
1474 lpPData->dwRemoteDataSize = 0;
1475 }
1476 }
1477
1478 /* Reallocate for new data */
1479 if( lpData != NULL )
1480 {
1481
1482 if( dwFlags & DPSET_LOCAL )
1483 {
1484 lpPData->lpLocalData = lpData;
1485 lpPData->dwLocalDataSize = dwDataSize;
1486 }
1487 else
1488 {
1489 lpPData->lpRemoteData = HeapAlloc( GetProcessHeap(), 0, dwDataSize );
1490 CopyMemory( lpPData->lpRemoteData, lpData, dwDataSize );
1491 lpPData->dwRemoteDataSize = dwDataSize;
1492 }
1493 }
1494
DWORD dwLocalDataSize
Definition: dplay_global.h:70
LPVOID lpRemoteData
Definition: dplay_global.h:73
LPVOID lpLocalData
Definition: dplay_global.h:69
DWORD dwRemoteDataSize
Definition: dplay_global.h:74

Referenced by DP_IF_CreatePlayer(), and IDirectPlay4Impl_SetPlayerData().

◆ DP_SetSessionDesc()

static HRESULT DP_SetSessionDesc ( IDirectPlayImpl This,
const DPSESSIONDESC2 lpSessDesc,
DWORD  dwFlags,
BOOL  bInitial,
BOOL  bAnsi 
)
static

Definition at line 3765 of file dplay.c.

3768{
3769 DWORD dwRequiredSize;
3770 LPDPSESSIONDESC2 lpTempSessDesc;
3771
3772 TRACE( "(%p)->(%p,0x%08x,%u,%u)\n",
3773 This, lpSessDesc, dwFlags, bInitial, bAnsi );
3774
3775 if( This->dp2->connectionInitialized == NO_PROVIDER )
3776 {
3777 return DPERR_UNINITIALIZED;
3778 }
3779
3780 if( dwFlags )
3781 {
3782 return DPERR_INVALIDPARAMS;
3783 }
3784
3785 /* Only the host is allowed to update the session desc */
3786 if( !This->dp2->bHostInterface )
3787 {
3788 return DPERR_ACCESSDENIED;
3789 }
3790
3791 /* FIXME: Copy into This->dp2->lpSessionDesc */
3792 dwRequiredSize = DP_CalcSessionDescSize( lpSessDesc, bAnsi );
3793 lpTempSessDesc = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, dwRequiredSize );
3794
3795 if( lpTempSessDesc == NULL )
3796 {
3797 return DPERR_OUTOFMEMORY;
3798 }
3799
3800 /* Free the old */
3801 HeapFree( GetProcessHeap(), 0, This->dp2->lpSessionDesc );
3802
3803 This->dp2->lpSessionDesc = lpTempSessDesc;
3804 /* Set the new */
3805 DP_CopySessionDesc( This->dp2->lpSessionDesc, lpSessDesc, bAnsi );
3806 if( bInitial )
3807 {
3808 /*Initializing session GUID*/
3809 CoCreateGuid( &(This->dp2->lpSessionDesc->guidInstance) );
3810 }
3811 /* If this is an external invocation of the interface, we should be
3812 * letting everyone know that things have changed. Otherwise this is
3813 * just an initialization and it doesn't need to be propagated.
3814 */
3815 if( !bInitial )
3816 {
3817 FIXME( "Need to send a DPMSG_SETSESSIONDESC msg to everyone\n" );
3818 }
3819
3820 return DP_OK;
HRESULT WINAPI CoCreateGuid(GUID *pguid)
Definition: compobj.c:2206
#define DPERR_ACCESSDENIED
Definition: dplay.h:90
#define DPERR_OUTOFMEMORY
Definition: dplay.h:109

Referenced by DP_SecureOpen(), IDirectPlay4AImpl_SetSessionDesc(), and IDirectPlay4Impl_SetSessionDesc().

◆ DP_SetSPPlayerData()

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

Definition at line 5731 of file dplay.c.

5733{
5734 lpPlayerList lpPlayer = DP_FindPlayer( lpDP, idPlayer );
5735
5736 if( lpPlayer == NULL )
5737 {
5738 return DPERR_INVALIDPLAYER;
5739 }
5740
5741 lpPlayer->lpPData->lpSPPlayerData = lpData;
5742
5743 return DP_OK;

Referenced by IDirectPlaySPImpl_SetSPPlayerData().

◆ DP_SP_SendEx()

static HRESULT DP_SP_SendEx ( IDirectPlayImpl This,
DWORD  dwFlags,
void lpData,
DWORD  dwDataSize,
DWORD  dwPriority,
DWORD  dwTimeout,
void lpContext,
DWORD lpdwMsgID 
)
static

Definition at line 5259 of file dplay.c.

5262{
5263 LPDPMSG lpMElem;
5264
5265 FIXME( ": stub\n" );
5266
5267 /* FIXME: This queuing should only be for async messages */
5268
5269 lpMElem = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpMElem ) );
5270 lpMElem->msg = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, dwDataSize );
5271
5272 CopyMemory( lpMElem->msg, lpData, dwDataSize );
5273
5274 /* FIXME: Need to queue based on priority */
5275 DPQ_INSERT( This->dp2->sendMsgs, lpMElem, msgs );
5276
5277 return DP_OK;

Referenced by IDirectPlay4Impl_SendEx().

◆ DPL_CreateCompoundAddress()

HRESULT DPL_CreateCompoundAddress ( LPCDPCOMPOUNDADDRESSELEMENT  lpElements,
DWORD  dwElementCount,
LPVOID  lpAddress,
LPDWORD  lpdwAddressSize,
BOOL  bAnsiInterface 
)

Definition at line 1659 of file dplobby.c.

1665{
1666 DWORD dwSizeRequired = 0;
1667 DWORD dwElements;
1668 LPCDPCOMPOUNDADDRESSELEMENT lpOrigElements = lpElements;
1669
1670 TRACE("(%p,0x%08x,%p,%p)\n", lpElements, dwElementCount, lpAddress, lpdwAddressSize );
1671
1672 /* Parameter check */
1673 if( ( lpElements == NULL ) ||
1674 ( dwElementCount == 0 ) /* FIXME: Not sure if this is a failure case */
1675 )
1676 {
1677 return DPERR_INVALIDPARAMS;
1678 }
1679
1680 /* Add the total size chunk */
1681 dwSizeRequired += sizeof( DPADDRESS ) + sizeof( DWORD );
1682
1683 /* Calculate the size of the buffer required */
1684 for ( dwElements = dwElementCount; dwElements > 0; --dwElements, ++lpElements )
1685 {
1686 if ( ( IsEqualGUID( &lpElements->guidDataType, &DPAID_ServiceProvider ) ) ||
1687 ( IsEqualGUID( &lpElements->guidDataType, &DPAID_LobbyProvider ) )
1688 )
1689 {
1690 dwSizeRequired += sizeof( DPADDRESS ) + sizeof( GUID );
1691 }
1692 else if ( ( IsEqualGUID( &lpElements->guidDataType, &DPAID_Phone ) ) ||
1693 ( IsEqualGUID( &lpElements->guidDataType, &DPAID_Modem ) ) ||
1694 ( IsEqualGUID( &lpElements->guidDataType, &DPAID_INet ) )
1695 )
1696 {
1697 if( !bAnsiInterface )
1698 {
1699 ERR( "Ansi GUIDs used for unicode interface\n" );
1700 return DPERR_INVALIDFLAGS;
1701 }
1702
1703 dwSizeRequired += sizeof( DPADDRESS ) + lpElements->dwDataSize;
1704 }
1705 else if ( ( IsEqualGUID( &lpElements->guidDataType, &DPAID_PhoneW ) ) ||
1706 ( IsEqualGUID( &lpElements->guidDataType, &DPAID_ModemW ) ) ||
1707 ( IsEqualGUID( &lpElements->guidDataType, &DPAID_INetW ) )
1708 )
1709 {
1710 if( bAnsiInterface )
1711 {
1712 ERR( "Unicode GUIDs used for ansi interface\n" );
1713 return DPERR_INVALIDFLAGS;
1714 }
1715
1716 FIXME( "Right size for unicode interface?\n" );
1717 dwSizeRequired += sizeof( DPADDRESS ) + lpElements->dwDataSize * sizeof( WCHAR );
1718 }
1719 else if ( IsEqualGUID( &lpElements->guidDataType, &DPAID_INetPort ) )
1720 {
1721 dwSizeRequired += sizeof( DPADDRESS ) + sizeof( WORD );
1722 }
1723 else if ( IsEqualGUID( &lpElements->guidDataType, &DPAID_ComPort ) )
1724 {
1725 FIXME( "Right size for unicode interface?\n" );
1726 dwSizeRequired += sizeof( DPADDRESS ) + sizeof( DPCOMPORTADDRESS ); /* FIXME: Right size? */
1727 }
1728 else
1729 {
1730 WARN( "Skipping Unknown GUID %s\n", debugstr_guid(&lpElements->guidDataType) );
1731 }
1732 }
1733
1734 /* The user wants to know how big a buffer to allocate for us */
1735 if( ( lpAddress == NULL ) ||
1736 ( *lpdwAddressSize < dwSizeRequired )
1737 )
1738 {
1739 *lpdwAddressSize = dwSizeRequired;
1740 return DPERR_BUFFERTOOSMALL;
1741 }
1742
1743 /* Add the total size chunk */
1744 {
1745 LPDPADDRESS lpdpAddress = lpAddress;
1746
1747 lpdpAddress->guidDataType = DPAID_TotalSize;
1748 lpdpAddress->dwDataSize = sizeof( DWORD );
1749 lpAddress = (char *) lpAddress + sizeof( DPADDRESS );
1750
1751 *(LPDWORD)lpAddress = dwSizeRequired;
1752 lpAddress = (char *) lpAddress + sizeof( DWORD );
1753 }
1754
1755 /* Calculate the size of the buffer required */
1756 for( dwElements = dwElementCount, lpElements = lpOrigElements;
1757 dwElements > 0;
1758 --dwElements, ++lpElements )
1759 {
1760 if ( ( IsEqualGUID( &lpElements->guidDataType, &DPAID_ServiceProvider ) ) ||
1761 ( IsEqualGUID( &lpElements->guidDataType, &DPAID_LobbyProvider ) )
1762 )
1763 {
1764 LPDPADDRESS lpdpAddress = lpAddress;
1765
1766 lpdpAddress->guidDataType = lpElements->guidDataType;
1767 lpdpAddress->dwDataSize = sizeof( GUID );
1768 lpAddress = (char *) lpAddress + sizeof( DPADDRESS );
1769
1770 CopyMemory( lpAddress, lpElements->lpData, sizeof( GUID ) );
1771 lpAddress = (char *) lpAddress + sizeof( GUID );
1772 }
1773 else if ( ( IsEqualGUID( &lpElements->guidDataType, &DPAID_Phone ) ) ||
1774 ( IsEqualGUID( &lpElements->guidDataType, &DPAID_Modem ) ) ||
1775 ( IsEqualGUID( &lpElements->guidDataType, &DPAID_INet ) )
1776 )
1777 {
1778 LPDPADDRESS lpdpAddress = lpAddress;
1779
1780 lpdpAddress->guidDataType = lpElements->guidDataType;
1781 lpdpAddress->dwDataSize = lpElements->dwDataSize;
1782 lpAddress = (char *) lpAddress + sizeof( DPADDRESS );
1783
1784 lstrcpynA( lpAddress, lpElements->lpData, lpElements->dwDataSize );
1785 lpAddress = (char *) lpAddress + lpElements->dwDataSize;
1786 }
1787 else if ( ( <