* Sync with Wine 1.5.26.
svn path=/trunk/; revision=58736
-
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
spec2def(dplay.dll dplay.spec)
${CMAKE_CURRENT_BINARY_DIR}/dplay.def)
set_module_type(dplay win32dll UNICODE)
-
-target_link_libraries(dplay
- uuid
- wine)
-
-add_importlibs(dplay
- msvcrt
- user32
- advapi32
- ole32
- winmm
- dinput
- dplayx
- kernel32
- ntdll)
-
+add_importlibs(dplay dplayx msvcrt kernel32 ntdll)
add_dependencies(dplay psdk)
-
add_cd_file(TARGET dplay DESTINATION reactos/system32 FOR all)
-
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#define WINE_OLESELFREGISTER
#define WINE_FILEDESCRIPTION_STR "Wine DirectPlay"
#define WINE_FILENAME_STR "dplay.dll"
#define WINE_FILEVERSION 5,3,0,900
#define WINE_FILEVERSION_STR "5.3.0.900"
#define WINE_PRODUCTVERSION 5,3,0,900
#define WINE_PRODUCTVERSION_STR "5.3"
+#define WINE_EXTRAVALUES VALUE "OLESelfRegister",""
-#include "wine/wine_common_ver.rc"
+#include <wine/wine_common_ver.rc>
+add_definitions(
+ -DCOM_NO_WINDOWS_H
+ -D__WINESRC__)
+
+include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
+
spec2def(dplayx.dll dplayx.spec ADD_IMPORTLIB)
list(APPEND SOURCE
dplobby.c
lobbysp.c
name_server.c
- regsvr.c
- version.rc
${CMAKE_CURRENT_BINARY_DIR}/dplayx.def)
-include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
-
-add_library(dplayx SHARED ${SOURCE})
+add_library(dplayx SHARED ${SOURCE} version.rc)
set_module_type(dplayx win32dll)
-target_link_libraries(dplayx wine uuid dxguid)
-
-add_importlibs(dplayx
- advapi32
- ole32
- user32
- winmm
- msvcrt
- kernel32
- ntdll)
-
+target_link_libraries(dplayx dxguid uuid wine)
+add_importlibs(dplayx winmm ole32 user32 advapi32 msvcrt kernel32 ntdll)
add_cd_file(TARGET dplayx DESTINATION reactos/system32 FOR all)
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
//#include <stdarg.h>
//#include "objbase.h"
//#include "winerror.h"
#include <wine/debug.h>
+//#include "dplay.h"
+//#include "dplobby.h"
+//#include "initguid.h"
#include "dpinit.h"
WINE_DEFAULT_DEBUG_CHANNEL(dplay);
typedef struct
{
/* IUnknown fields */
- const IClassFactoryVtbl *lpVtbl;
- LONG ref;
+ IClassFactory IClassFactory_iface;
+ LONG ref;
} IClassFactoryImpl;
+static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface)
+{
+ return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface);
+}
+
static HRESULT WINAPI
DP_and_DPL_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
- IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
+ IClassFactoryImpl *This = impl_from_IClassFactory(iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
static ULONG WINAPI
DP_and_DPL_AddRef(LPCLASSFACTORY iface) {
- IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
+ IClassFactoryImpl *This = impl_from_IClassFactory(iface);
return InterlockedIncrement(&This->ref);
}
static ULONG WINAPI DP_and_DPL_Release(LPCLASSFACTORY iface) {
- IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
+ IClassFactoryImpl *This = impl_from_IClassFactory(iface);
/* static class (reference starts @ 1), won't ever be freed */
return InterlockedDecrement(&This->ref);
}
static HRESULT WINAPI DP_and_DPL_CreateInstance(
LPCLASSFACTORY iface,LPUNKNOWN pOuter,REFIID riid,LPVOID *ppobj
) {
- IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
+ IClassFactoryImpl *This = impl_from_IClassFactory(iface);
TRACE("(%p)->(%p,%s,%p)\n",This,pOuter,debugstr_guid(riid),ppobj);
}
static HRESULT WINAPI DP_and_DPL_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
- IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
+ IClassFactoryImpl *This = impl_from_IClassFactory(iface);
FIXME("(%p)->(%d),stub!\n",This,dolock);
return S_OK;
}
DP_and_DPL_LockServer
};
-static IClassFactoryImpl DP_and_DPL_CF = {&DP_and_DPL_Vtbl, 1 };
+static IClassFactoryImpl DP_and_DPL_CF = {{&DP_and_DPL_Vtbl}, 1 };
/*******************************************************************************
*/
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{
- TRACE("(%p,%p,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
+ TRACE("(%s,%s,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
if ( IsEqualCLSID( riid, &IID_IClassFactory ) )
{
- *ppv = (LPVOID)&DP_and_DPL_CF;
+ *ppv = &DP_and_DPL_CF;
IClassFactory_AddRef( (IClassFactory*)*ppv );
return S_OK;
}
- ERR("(%p,%p,%p): no interface found.\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
+ ERR("(%s,%s,%p): no interface found.\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
return CLASS_E_CLASSNOTAVAILABLE;
}
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WINE_DPINIT_H
//#include "wtypes.h"
#include "dplay_global.h"
-extern HRESULT DP_CreateInterface( REFIID riid, LPVOID* ppvObj );
-extern HRESULT DPL_CreateInterface( REFIID riid, LPVOID* ppvObj );
+extern HRESULT DP_CreateInterface( REFIID riid, LPVOID* ppvObj ) DECLSPEC_HIDDEN;
+extern HRESULT DPL_CreateInterface( REFIID riid, LPVOID* ppvObj ) DECLSPEC_HIDDEN;
extern HRESULT DPSP_CreateInterface( REFIID riid, LPVOID* ppvObj,
- IDirectPlay2Impl* dp );
+ IDirectPlay2Impl* dp ) DECLSPEC_HIDDEN;
extern HRESULT DPLSP_CreateInterface( REFIID riid, LPVOID* ppvObj,
- IDirectPlay2Impl* dp );
+ IDirectPlay2Impl* dp ) DECLSPEC_HIDDEN;
#endif
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <config.h>
static lpPlayerData DP_CreatePlayer( IDirectPlay2Impl* iface, LPDPID lpid,
LPDPNAME lpName, DWORD dwFlags,
HANDLE hEvent, BOOL bAnsi );
-static BOOL DP_CopyDPNAMEStruct( LPDPNAME lpDst, LPDPNAME lpSrc, BOOL bAnsi );
+static BOOL DP_CopyDPNAMEStruct( LPDPNAME lpDst, const DPNAME *lpSrc, BOOL bAnsi );
static void DP_SetPlayerData( lpPlayerData lpPData, DWORD dwFlags,
LPVOID lpData, DWORD dwDataSize );
-static lpGroupData DP_CreateGroup( IDirectPlay2AImpl* iface, LPDPID lpid,
- LPDPNAME lpName, DWORD dwFlags,
+static lpGroupData DP_CreateGroup( IDirectPlay2AImpl* iface, const DPID *lpid,
+ const DPNAME *lpName, DWORD dwFlags,
DPID idParent, BOOL bAnsi );
static void DP_SetGroupData( lpGroupData lpGData, DWORD dwFlags,
LPVOID lpData, DWORD dwDataSize );
static const IDirectPlay4Vtbl directPlay4WVT;
/* Helper methods for player/group interfaces */
-static HRESULT WINAPI DP_IF_DeletePlayerFromGroup
+static HRESULT DP_IF_DeletePlayerFromGroup
( IDirectPlay2Impl* This, LPVOID lpMsgHdr, DPID idGroup,
DPID idPlayer, BOOL bAnsi );
-static HRESULT WINAPI DP_IF_CreatePlayer
+static HRESULT DP_IF_CreatePlayer
( IDirectPlay2Impl* This, LPVOID lpMsgHdr, LPDPID lpidPlayer,
LPDPNAME lpPlayerName, HANDLE hEvent, LPVOID lpData,
DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi );
-static HRESULT WINAPI DP_IF_DestroyGroup
+static HRESULT DP_IF_DestroyGroup
( IDirectPlay2Impl* This, LPVOID lpMsgHdr, DPID idGroup, BOOL bAnsi );
-static HRESULT WINAPI DP_IF_DestroyPlayer
+static HRESULT DP_IF_DestroyPlayer
( IDirectPlay2Impl* This, LPVOID lpMsgHdr, DPID idPlayer, BOOL bAnsi );
-static HRESULT WINAPI DP_IF_EnumGroupPlayers
+static HRESULT DP_IF_EnumGroupPlayers
( IDirectPlay2Impl* This, DPID idGroup, LPGUID lpguidInstance,
LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2,
LPVOID lpContext, DWORD dwFlags, BOOL bAnsi );
-static HRESULT WINAPI DP_IF_EnumGroups
+static HRESULT DP_IF_EnumGroups
( IDirectPlay2Impl* This, LPGUID lpguidInstance,
LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2,
LPVOID lpContext, DWORD dwFlags, BOOL bAnsi );
-static HRESULT WINAPI DP_IF_EnumPlayers
+static HRESULT DP_IF_EnumPlayers
( IDirectPlay2Impl* This, LPGUID lpguidInstance,
LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2,
LPVOID lpContext, DWORD dwFlags, BOOL bAnsi );
-static HRESULT WINAPI DP_IF_GetGroupData
+static HRESULT DP_IF_GetGroupData
( IDirectPlay2Impl* This, DPID idGroup, LPVOID lpData,
LPDWORD lpdwDataSize, DWORD dwFlags, BOOL bAnsi );
-static HRESULT WINAPI DP_IF_GetGroupName
+static HRESULT DP_IF_GetGroupName
( IDirectPlay2Impl* This, DPID idGroup, LPVOID lpData,
LPDWORD lpdwDataSize, BOOL bAnsi );
-static HRESULT WINAPI DP_IF_GetPlayerData
+static HRESULT DP_IF_GetPlayerData
( IDirectPlay2Impl* This, DPID idPlayer, LPVOID lpData,
LPDWORD lpdwDataSize, DWORD dwFlags, BOOL bAnsi );
-static HRESULT WINAPI DP_IF_GetPlayerName
+static HRESULT DP_IF_GetPlayerName
( IDirectPlay2Impl* This, DPID idPlayer, LPVOID lpData,
LPDWORD lpdwDataSize, BOOL bAnsi );
-static HRESULT WINAPI DP_IF_SetGroupName
+static HRESULT DP_IF_SetGroupName
( IDirectPlay2Impl* This, DPID idGroup, LPDPNAME lpGroupName,
DWORD dwFlags, BOOL bAnsi );
-static HRESULT WINAPI DP_IF_SetPlayerData
+static HRESULT DP_IF_SetPlayerData
( IDirectPlay2Impl* This, DPID idPlayer, LPVOID lpData,
DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi );
-static HRESULT WINAPI DP_IF_SetPlayerName
+static HRESULT DP_IF_SetPlayerName
( IDirectPlay2Impl* This, DPID idPlayer, LPDPNAME lpPlayerName,
DWORD dwFlags, BOOL bAnsi );
-static HRESULT WINAPI DP_IF_AddGroupToGroup
+static HRESULT DP_IF_AddGroupToGroup
( IDirectPlay3Impl* This, DPID idParentGroup, DPID idGroup );
-static HRESULT WINAPI DP_IF_CreateGroup
+static HRESULT DP_IF_CreateGroup
( IDirectPlay2AImpl* This, LPVOID lpMsgHdr, LPDPID lpidGroup,
LPDPNAME lpGroupName, LPVOID lpData, DWORD dwDataSize,
DWORD dwFlags, BOOL bAnsi );
-static HRESULT WINAPI DP_IF_CreateGroupInGroup
+static HRESULT DP_IF_CreateGroupInGroup
( IDirectPlay3Impl* This, LPVOID lpMsgHdr, DPID idParentGroup,
LPDPID lpidGroup, LPDPNAME lpGroupName, LPVOID lpData,
DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi );
-static HRESULT WINAPI DP_IF_AddPlayerToGroup
+static HRESULT DP_IF_AddPlayerToGroup
( IDirectPlay2Impl* This, LPVOID lpMsgHdr, DPID idGroup,
DPID idPlayer, BOOL bAnsi );
-static HRESULT WINAPI DP_IF_DeleteGroupFromGroup
+static HRESULT DP_IF_DeleteGroupFromGroup
( IDirectPlay3Impl* This, DPID idParentGroup, DPID idGroup );
-static HRESULT WINAPI DP_SetSessionDesc
+static HRESULT DP_SetSessionDesc
( IDirectPlay2Impl* This, LPCDPSESSIONDESC2 lpSessDesc,
DWORD dwFlags, BOOL bInitial, BOOL bAnsi );
-static HRESULT WINAPI DP_SecureOpen
+static HRESULT DP_SecureOpen
( IDirectPlay2Impl* This, LPCDPSESSIONDESC2 lpsd, DWORD dwFlags,
LPCDPSECURITYDESC lpSecurity, LPCDPCREDENTIALS lpCredentials,
BOOL bAnsi );
-static HRESULT WINAPI DP_SendEx
+static HRESULT DP_SendEx
( IDirectPlay2Impl* This, DPID idFrom, DPID idTo, DWORD dwFlags,
LPVOID lpData, DWORD dwDataSize, DWORD dwPriority, DWORD dwTimeout,
LPVOID lpContext, LPDWORD lpdwMsgID, BOOL bAnsi );
-static HRESULT WINAPI DP_IF_Receive
+static HRESULT DP_IF_Receive
( IDirectPlay2Impl* This, LPDPID lpidFrom, LPDPID lpidTo,
DWORD dwFlags, LPVOID lpData, LPDWORD lpdwDataSize, BOOL bAnsi );
-static HRESULT WINAPI DP_IF_GetMessageQueue
+static HRESULT DP_IF_GetMessageQueue
( IDirectPlay4Impl* This, DPID idFrom, DPID idTo, DWORD dwFlags,
LPDWORD lpdwNumMsgs, LPDWORD lpdwNumBytes, BOOL bAnsi );
-static HRESULT WINAPI DP_SP_SendEx
+static HRESULT DP_SP_SendEx
( IDirectPlay2Impl* This, DWORD dwFlags,
LPVOID lpData, DWORD dwDataSize, DWORD dwPriority, DWORD dwTimeout,
LPVOID lpContext, LPDWORD lpdwMsgID );
-static HRESULT WINAPI DP_IF_SetGroupData
+static HRESULT DP_IF_SetGroupData
( IDirectPlay2Impl* This, DPID idGroup, LPVOID lpData,
DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi );
-static HRESULT WINAPI DP_IF_GetPlayerCaps
+static HRESULT DP_IF_GetPlayerCaps
( IDirectPlay2Impl* This, DPID idPlayer, LPDPCAPS lpDPCaps,
DWORD dwFlags );
-static HRESULT WINAPI DP_IF_Close( IDirectPlay2Impl* This, BOOL bAnsi );
-static HRESULT WINAPI DP_IF_CancelMessage
+static HRESULT DP_IF_Close( IDirectPlay2Impl* This, BOOL bAnsi );
+static HRESULT DP_IF_CancelMessage
( IDirectPlay4Impl* This, DWORD dwMsgID, DWORD dwFlags,
DWORD dwMinPriority, DWORD dwMaxPriority, BOOL bAnsi );
-static HRESULT WINAPI DP_IF_EnumGroupsInGroup
+static HRESULT DP_IF_EnumGroupsInGroup
( IDirectPlay3AImpl* This, DPID idGroup, LPGUID lpguidInstance,
LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2,
LPVOID lpContext, DWORD dwFlags, BOOL bAnsi );
-static HRESULT WINAPI DP_IF_GetGroupParent
+static HRESULT DP_IF_GetGroupParent
( IDirectPlay3AImpl* This, DPID idGroup, LPDPID lpidGroup,
BOOL bAnsi );
-static HRESULT WINAPI DP_IF_GetCaps
+static HRESULT DP_IF_GetCaps
( IDirectPlay2Impl* This, LPDPCAPS lpDPCaps, DWORD dwFlags );
-static HRESULT WINAPI DP_IF_EnumSessions
+static HRESULT DP_IF_EnumSessions
( IDirectPlay2Impl* This, LPDPSESSIONDESC2 lpsd, DWORD dwTimeout,
LPDPENUMSESSIONSCALLBACK2 lpEnumSessionsCallback2,
LPVOID lpContext, DWORD dwFlags, BOOL bAnsi );
-static HRESULT WINAPI DP_IF_InitializeConnection
+static HRESULT DP_IF_InitializeConnection
( IDirectPlay3Impl* This, LPVOID lpConnection, DWORD dwFlags, BOOL bAnsi );
static BOOL CALLBACK cbDPCreateEnumConnections( LPCGUID lpguidSP,
LPVOID lpConnection, DWORD dwConnectionSize, LPCDPNAME lpName,
DWORD dwFlags, LPVOID lpContext );
-static BOOL WINAPI DP_BuildSPCompoundAddr( LPGUID lpcSpGuid, LPVOID* lplpAddrBuf,
- LPDWORD lpdwBufSize );
+static BOOL DP_BuildSPCompoundAddr( LPGUID lpcSpGuid, LPVOID* lplpAddrBuf,
+ LPDWORD lpdwBufSize );
static inline DPID DP_NextObjectId(void);
static DPID DP_GetRemoteNextObjectId(void);
-
+static DWORD DP_CalcSessionDescSize( LPCDPSESSIONDESC2 lpSessDesc, BOOL bAnsi );
static void DP_CopySessionDesc( LPDPSESSIONDESC2 destSessionDesc,
LPCDPSESSIONDESC2 srcSessDesc, BOOL bAnsi );
static BOOL DP_CreateIUnknown( LPVOID lpDP )
{
- IDirectPlay2AImpl *This = (IDirectPlay2AImpl *)lpDP;
+ IDirectPlay2AImpl *This = lpDP;
This->unk = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->unk) ) );
if ( This->unk == NULL )
}
InitializeCriticalSection( &This->unk->DP_lock );
+ This->unk->DP_lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": IDirectPlay2AImpl*->DirectPlayIUnknownData*->DP_lock");
return TRUE;
}
static BOOL DP_DestroyIUnknown( LPVOID lpDP )
{
- IDirectPlay2AImpl *This = (IDirectPlay2AImpl *)lpDP;
+ IDirectPlay2AImpl *This = lpDP;
+ This->unk->DP_lock.DebugInfo->Spare[0] = 0;
DeleteCriticalSection( &This->unk->DP_lock );
HeapFree( GetProcessHeap(), 0, This->unk );
static BOOL DP_CreateDirectPlay2( LPVOID lpDP )
{
- IDirectPlay2AImpl *This = (IDirectPlay2AImpl *)lpDP;
+ IDirectPlay2AImpl *This = lpDP;
This->dp2 = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->dp2) ) );
if ( This->dp2 == NULL )
This->dp2->bConnectionOpen = FALSE;
This->dp2->hEnumSessionThread = INVALID_HANDLE_VALUE;
+ This->dp2->dwEnumSessionLock = 0;
This->dp2->bHostInterface = FALSE;
DPQ_INIT(This->dp2->receiveMsgs);
DPQ_INIT(This->dp2->sendMsgs);
- DPQ_INIT(This->dp2->replysExpected);
+ DPQ_INIT(This->dp2->repliesExpected);
if( !NS_InitializeSessionCache( &This->dp2->lpNameServerData ) )
{
HeapFree( GetProcessHeap(), 0, elem );
}
-/* Function to delete the list of groups with this interface. Needs to
- * delete the group and player lists associated with this group as well
- * as the group data associated with this group. It should not delete
- * player data as that is shared with the top player list and will be
- * deleted with that.
- */
-DPQ_DECL_DELETECB( cbDeleteGroupsElem, lpGroupList );
-DPQ_DECL_DELETECB( cbDeleteGroupsElem, lpGroupList )
-{
- DPQ_DELETEQ( elem->lpGData->groups, groups,
- lpGroupList, cbDeleteElemFromHeap );
- DPQ_DELETEQ( elem->lpGData->players, players,
- lpPlayerList, cbDeleteElemFromHeap );
- HeapFree( GetProcessHeap(), 0, elem->lpGData );
- HeapFree( GetProcessHeap(), 0, elem );
-}
-
-/* Function to delete the list of players with this interface. Needs to
- * delete the player data for all players as well.
- */
-DPQ_DECL_DELETECB( cbDeletePlayerElem, lpPlayerList );
-DPQ_DECL_DELETECB( cbDeletePlayerElem, lpPlayerList )
-{
- HeapFree( GetProcessHeap(), 0, elem->lpPData );
- HeapFree( GetProcessHeap(), 0, elem );
-}
-
static BOOL DP_DestroyDirectPlay2( LPVOID lpDP )
{
- IDirectPlay2AImpl *This = (IDirectPlay2AImpl *)lpDP;
+ IDirectPlay2AImpl *This = lpDP;
if( This->dp2->hEnumSessionThread != INVALID_HANDLE_VALUE )
{
FreeLibrary( This->dp2->hDPLobbyProvider );
}
-#if 0
- DPQ_DELETEQ( This->dp2->players, players, lpPlayerList, cbDeletePlayerElem );
- DPQ_DELETEQ( This->dp2->groups, groups, lpGroupList, cbDeleteGroupsElem );
-#endif
-
/* FIXME: Need to delete receive and send msgs queue contents */
NS_DeleteSessionCache( This->dp2->lpNameServerData );
static BOOL DP_CreateDirectPlay3( LPVOID lpDP )
{
- IDirectPlay3AImpl *This = (IDirectPlay3AImpl *)lpDP;
+ IDirectPlay3AImpl *This = lpDP;
This->dp3 = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->dp3) ) );
if ( This->dp3 == NULL )
static BOOL DP_DestroyDirectPlay3( LPVOID lpDP )
{
- IDirectPlay3AImpl *This = (IDirectPlay3AImpl *)lpDP;
+ IDirectPlay3AImpl *This = lpDP;
/* Delete the contents */
HeapFree( GetProcessHeap(), 0, This->dp3 );
static BOOL DP_CreateDirectPlay4( LPVOID lpDP )
{
- IDirectPlay4AImpl *This = (IDirectPlay4AImpl *)lpDP;
+ IDirectPlay4AImpl *This = lpDP;
This->dp4 = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->dp4) ) );
if ( This->dp4 == NULL )
static BOOL DP_DestroyDirectPlay4( LPVOID lpDP )
{
- IDirectPlay3AImpl *This = (IDirectPlay3AImpl *)lpDP;
+ IDirectPlay3AImpl *This = lpDP;
/* Delete the contents */
HeapFree( GetProcessHeap(), 0, This->dp4 );
/* Create a new interface */
-extern
HRESULT DP_CreateInterface
( REFIID riid, LPVOID* ppvObj )
{
if( IsEqualGUID( &IID_IDirectPlay2, riid ) )
{
- IDirectPlay2Impl *This = (IDirectPlay2Impl *)*ppvObj;
+ IDirectPlay2Impl *This = *ppvObj;
This->lpVtbl = &directPlay2WVT;
}
else if( IsEqualGUID( &IID_IDirectPlay2A, riid ) )
{
- IDirectPlay2AImpl *This = (IDirectPlay2AImpl *)*ppvObj;
+ IDirectPlay2AImpl *This = *ppvObj;
This->lpVtbl = &directPlay2AVT;
}
else if( IsEqualGUID( &IID_IDirectPlay3, riid ) )
{
- IDirectPlay3Impl *This = (IDirectPlay3Impl *)*ppvObj;
+ IDirectPlay3Impl *This = *ppvObj;
This->lpVtbl = &directPlay3WVT;
}
else if( IsEqualGUID( &IID_IDirectPlay3A, riid ) )
{
- IDirectPlay3AImpl *This = (IDirectPlay3AImpl *)*ppvObj;
+ IDirectPlay3AImpl *This = *ppvObj;
This->lpVtbl = &directPlay3AVT;
}
else if( IsEqualGUID( &IID_IDirectPlay4, riid ) )
{
- IDirectPlay4Impl *This = (IDirectPlay4Impl *)*ppvObj;
+ IDirectPlay4Impl *This = *ppvObj;
This->lpVtbl = &directPlay4WVT;
}
else if( IsEqualGUID( &IID_IDirectPlay4A, riid ) )
{
- IDirectPlay4AImpl *This = (IDirectPlay4AImpl *)*ppvObj;
+ IDirectPlay4AImpl *This = *ppvObj;
This->lpVtbl = &directPlay4AVT;
}
else
if( IsEqualGUID( &IID_IDirectPlay2, riid ) )
{
- IDirectPlay2Impl *This = (IDirectPlay2Impl *)*ppvObj;
+ IDirectPlay2Impl *This = *ppvObj;
This->lpVtbl = &directPlay2WVT;
}
else if( IsEqualGUID( &IID_IDirectPlay2A, riid ) )
{
- IDirectPlay2AImpl *This = (IDirectPlay2AImpl *)*ppvObj;
+ IDirectPlay2AImpl *This = *ppvObj;
This->lpVtbl = &directPlay2AVT;
}
else if( IsEqualGUID( &IID_IDirectPlay3, riid ) )
{
- IDirectPlay3Impl *This = (IDirectPlay3Impl *)*ppvObj;
+ IDirectPlay3Impl *This = *ppvObj;
This->lpVtbl = &directPlay3WVT;
}
else if( IsEqualGUID( &IID_IDirectPlay3A, riid ) )
{
- IDirectPlay3AImpl *This = (IDirectPlay3AImpl *)*ppvObj;
+ IDirectPlay3AImpl *This = *ppvObj;
This->lpVtbl = &directPlay3AVT;
}
else if( IsEqualGUID( &IID_IDirectPlay4, riid ) )
{
- IDirectPlay4Impl *This = (IDirectPlay4Impl *)*ppvObj;
+ IDirectPlay4Impl *This = *ppvObj;
This->lpVtbl = &directPlay4WVT;
}
else if( IsEqualGUID( &IID_IDirectPlay4A, riid ) )
{
- IDirectPlay4AImpl *This = (IDirectPlay4AImpl *)*ppvObj;
+ IDirectPlay4AImpl *This = *ppvObj;
This->lpVtbl = &directPlay4AVT;
}
else
ulObjRefCount = InterlockedIncrement( &This->unk->ulObjRef );
ulInterfaceRefCount = InterlockedIncrement( &This->ulInterfaceRef );
- TRACE( "ref count incremented to %lu:%lu for %p\n",
+ TRACE( "ref count incremented to %u:%u for %p\n",
ulInterfaceRefCount, ulObjRefCount, This );
return ulObjRefCount;
ulObjRefCount = InterlockedDecrement( &This->unk->ulObjRef );
ulInterfaceRefCount = InterlockedDecrement( &This->ulInterfaceRef );
- TRACE( "ref count decremented to %lu:%lu for %p\n",
+ TRACE( "ref count decremented to %u:%u for %p\n",
ulInterfaceRefCount, ulObjRefCount, This );
/* Deallocate if this is the last reference to the object */
WORD wCommandId, WORD wVersion,
LPVOID* lplpReply, LPDWORD lpdwMsgSize )
{
- TRACE( "(%p)->(%p,0x%08lx,%p,%u,%u)\n",
+ TRACE( "(%p)->(%p,0x%08x,%p,%u,%u)\n",
This, lpcMessageBody, dwMessageBodySize, lpcMessageHeader, wCommandId,
wVersion );
{
/* Name server needs to handle this request */
case DPMSGCMD_ENUMSESSIONSREQUEST:
- {
/* Reply expected */
NS_ReplyToEnumSessionsRequest( lpcMessageBody, lplpReply, lpdwMsgSize, This );
-
break;
- }
/* Name server needs to handle this request */
case DPMSGCMD_ENUMSESSIONSREPLY:
- {
/* No reply expected */
NS_AddRemoteComputerAsNameServer( lpcMessageHeader,
This->dp2->spData.dwSPHeaderSize,
- (LPDPMSG_ENUMSESSIONSREPLY)lpcMessageBody,
+ lpcMessageBody,
This->dp2->lpNameServerData );
break;
- }
case DPMSGCMD_REQUESTNEWPLAYERID:
{
- LPCDPMSG_REQUESTNEWPLAYERID lpcMsg =
- (LPCDPMSG_REQUESTNEWPLAYERID)lpcMessageBody;
+ LPCDPMSG_REQUESTNEWPLAYERID lpcMsg = lpcMessageBody;
LPDPMSG_NEWPLAYERIDREPLY lpReply;
*lplpReply = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, *lpdwMsgSize );
- FIXME( "Ignoring dwFlags 0x%08lx in request msg\n",
+ FIXME( "Ignoring dwFlags 0x%08x in request msg\n",
lpcMsg->dwFlags );
/* Setup the reply */
lpReply->dpidNewPlayerId = DP_NextObjectId();
- TRACE( "Allocating new playerid 0x%08lx from remote request\n",
+ TRACE( "Allocating new playerid 0x%08x from remote request\n",
lpReply->dpidNewPlayerId );
-
break;
}
case DPMSGCMD_GETNAMETABLEREPLY:
case DPMSGCMD_NEWPLAYERIDREPLY:
- {
-
#if 0
if( wCommandId == DPMSGCMD_NEWPLAYERIDREPLY )
DebugBreak();
#endif
DP_MSG_ReplyReceived( This, wCommandId, lpcMessageBody, dwMessageBodySize );
-
break;
- }
#if 1
case DPMSGCMD_JUSTENVELOPE:
- {
- TRACE( "GOT THE SELF MESSAGE: %p -> 0x%08lx\n", lpcMessageHeader, ((LPDWORD)lpcMessageHeader)[1] );
+ TRACE( "GOT THE SELF MESSAGE: %p -> 0x%08x\n", lpcMessageHeader, ((const DWORD *)lpcMessageHeader)[1] );
NS_SetLocalAddr( This->dp2->lpNameServerData, lpcMessageHeader, 20 );
DP_MSG_ReplyReceived( This, wCommandId, lpcMessageBody, dwMessageBodySize );
- }
#endif
case DPMSGCMD_FORWARDADDPLAYER:
- {
#if 0
DebugBreak();
#endif
#if 1
- TRACE( "Sending message to self to get my addr\n" );
- DP_MSG_ToSelf( This, 1 ); /* This is a hack right now */
+ TRACE( "Sending message to self to get my addr\n" );
+ DP_MSG_ToSelf( This, 1 ); /* This is a hack right now */
#endif
break;
- }
case DPMSGCMD_FORWARDADDPLAYERNACK:
- {
DP_MSG_ErrorReceived( This, wCommandId, lpcMessageBody, dwMessageBodySize );
break;
- }
default:
- {
FIXME( "Unknown wCommandId %u. Ignoring message\n", wCommandId );
DebugBreak();
break;
- }
}
/* FIXME: There is code in dplaysp.c to handle dplay commands. Move to here. */
}
-static HRESULT WINAPI DP_IF_AddPlayerToGroup
+static HRESULT DP_IF_AddPlayerToGroup
( IDirectPlay2Impl* This, LPVOID lpMsgHdr, DPID idGroup,
DPID idPlayer, BOOL bAnsi )
{
lpPlayerList lpPList;
lpPlayerList lpNewPList;
- TRACE( "(%p)->(%p,0x%08lx,0x%08lx,%u)\n",
+ TRACE( "(%p)->(%p,0x%08x,0x%08x,%u)\n",
This, lpMsgHdr, idGroup, idPlayer, bAnsi );
+ if( This->dp2->connectionInitialized == NO_PROVIDER )
+ {
+ return DPERR_UNINITIALIZED;
+ }
+
/* Find the group */
if( ( lpGData = DP_FindAnyGroup( This, idGroup ) ) == NULL )
{
return DP_IF_AddPlayerToGroup( This, NULL, idGroup, idPlayer, FALSE );
}
-static HRESULT WINAPI DP_IF_Close( IDirectPlay2Impl* This, BOOL bAnsi )
+static HRESULT DP_IF_Close( IDirectPlay2Impl* This, BOOL bAnsi )
{
HRESULT hr = DP_OK;
}
static
-lpGroupData DP_CreateGroup( IDirectPlay2AImpl* This, LPDPID lpid,
- LPDPNAME lpName, DWORD dwFlags,
+lpGroupData DP_CreateGroup( IDirectPlay2AImpl* This, const DPID *lpid,
+ const DPNAME *lpName, DWORD dwFlags,
DPID idParent, BOOL bAnsi )
{
lpGroupData lpGData;
/* FIXME: Should we validate the dwFlags? */
lpGData->dwFlags = dwFlags;
- TRACE( "Created group id 0x%08lx\n", *lpid );
+ TRACE( "Created group id 0x%08x\n", *lpid );
return lpGData;
}
{
lpGroupList lpGList;
- TRACE( "(%p)->(0x%08lx)\n", This, dpid );
+ TRACE( "(%p)->(0x%08x)\n", This, dpid );
DPQ_REMOVE_ENTRY( This->dp2->lpSysGroup->groups, groups, lpGData->dpid, ==, dpid, lpGList );
if( lpGList == NULL )
{
- ERR( "DPID 0x%08lx not found\n", dpid );
+ ERR( "DPID 0x%08x not found\n", dpid );
return;
}
{
lpGroupList lpGroups;
- TRACE( "(%p)->(0x%08lx)\n", This, dpid );
+ TRACE( "(%p)->(0x%08x)\n", This, dpid );
if( dpid == DPID_SYSTEM_GROUP )
{
return lpGroups->lpGData;
}
-static HRESULT WINAPI DP_IF_CreateGroup
+static HRESULT DP_IF_CreateGroup
( IDirectPlay2AImpl* This, LPVOID lpMsgHdr, LPDPID lpidGroup,
LPDPNAME lpGroupName, LPVOID lpData, DWORD dwDataSize,
DWORD dwFlags, BOOL bAnsi )
{
lpGroupData lpGData;
- TRACE( "(%p)->(%p,%p,%p,%p,0x%08lx,0x%08lx,%u)\n",
+ TRACE( "(%p)->(%p,%p,%p,%p,0x%08x,0x%08x,%u)\n",
This, lpMsgHdr, lpidGroup, lpGroupName, lpData, dwDataSize,
dwFlags, bAnsi );
+ if( This->dp2->connectionInitialized == NO_PROVIDER )
+ {
+ return DPERR_UNINITIALIZED;
+ }
+
/* If the name is not specified, we must provide one */
if( DPID_UNKNOWN == *lpidGroup )
{
/* Reallocate for new data */
if( lpData != NULL )
{
- LPVOID lpNewData = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
- sizeof( dwDataSize ) );
- CopyMemory( lpNewData, lpData, dwDataSize );
-
if( dwFlags & DPSET_LOCAL )
{
lpGData->lpLocalData = lpData;
}
else
{
- lpGData->lpRemoteData = lpNewData;
+ lpGData->lpRemoteData = HeapAlloc( GetProcessHeap(), 0, dwDataSize );
+ CopyMemory( lpGData->lpRemoteData, lpData, dwDataSize );
lpGData->dwRemoteDataSize = dwDataSize;
}
}
/* Initialize the SP data section */
lpPData->lpSPPlayerData = DPSP_CreateSPPlayerData();
- TRACE( "Created player id 0x%08lx\n", *lpid );
+ TRACE( "Created player id 0x%08x\n", *lpid );
+
+ if( ~dwFlags & DPLAYI_PLAYER_SYSPLAYER )
+ This->dp2->lpSessionDesc->dwCurrentPlayers++;
return lpPData;
}
static void
DP_DeleteDPNameStruct( LPDPNAME lpDPName )
{
- HeapFree( GetProcessHeap(), HEAP_ZERO_MEMORY, lpDPName->lpszShortNameA );
- HeapFree( GetProcessHeap(), HEAP_ZERO_MEMORY, lpDPName->lpszLongNameA );
+ HeapFree( GetProcessHeap(), HEAP_ZERO_MEMORY, lpDPName->u1.lpszShortNameA );
+ HeapFree( GetProcessHeap(), HEAP_ZERO_MEMORY, lpDPName->u2.lpszLongNameA );
}
/* This method assumes that all links to it are already deleted */
{
lpPlayerList lpPList;
- TRACE( "(%p)->(0x%08lx)\n", This, dpid );
+ TRACE( "(%p)->(0x%08x)\n", This, dpid );
DPQ_REMOVE_ENTRY( This->dp2->lpSysGroup->players, players, lpPData->dpid, ==, dpid, lpPList );
if( lpPList == NULL )
{
- ERR( "DPID 0x%08lx not found\n", dpid );
+ ERR( "DPID 0x%08x not found\n", dpid );
return;
}
{
lpPlayerList lpPlayers;
- TRACE( "(%p)->(0x%08lx)\n", This, dpid );
+ TRACE( "(%p)->(0x%08x)\n", This, dpid );
+
+ if(This->dp2->lpSysGroup == NULL)
+ return NULL;
DPQ_FIND_ENTRY( This->dp2->lpSysGroup->players, players, lpPData->dpid, ==, dpid, lpPlayers );
}
/* Basic area for Dst must already be allocated */
-static BOOL DP_CopyDPNAMEStruct( LPDPNAME lpDst, LPDPNAME lpSrc, BOOL bAnsi )
+static BOOL DP_CopyDPNAMEStruct( LPDPNAME lpDst, const DPNAME *lpSrc, BOOL bAnsi )
{
if( lpSrc == NULL )
{
}
/* Delete any existing pointers */
- HeapFree( GetProcessHeap(), 0, lpDst->lpszShortNameA );
- HeapFree( GetProcessHeap(), 0, lpDst->lpszLongNameA );
+ HeapFree( GetProcessHeap(), 0, lpDst->u1.lpszShortNameA );
+ HeapFree( GetProcessHeap(), 0, lpDst->u2.lpszLongNameA );
/* Copy as required */
CopyMemory( lpDst, lpSrc, lpSrc->dwSize );
if( bAnsi )
{
- if( lpSrc->lpszShortNameA )
+ if( lpSrc->u1.lpszShortNameA )
{
- lpDst->lpszShortNameA = HeapAlloc( GetProcessHeap(), 0,
- strlen(lpSrc->lpszShortNameA)+1 );
- strcpy( lpDst->lpszShortNameA, lpSrc->lpszShortNameA );
+ lpDst->u1.lpszShortNameA = HeapAlloc( GetProcessHeap(), 0,
+ strlen(lpSrc->u1.lpszShortNameA)+1 );
+ strcpy( lpDst->u1.lpszShortNameA, lpSrc->u1.lpszShortNameA );
}
- if( lpSrc->lpszLongNameA )
+ if( lpSrc->u2.lpszLongNameA )
{
- lpDst->lpszLongNameA = HeapAlloc( GetProcessHeap(), 0,
- strlen(lpSrc->lpszLongNameA)+1 );
- strcpy( lpDst->lpszLongNameA, lpSrc->lpszLongNameA );
+ lpDst->u2.lpszLongNameA = HeapAlloc( GetProcessHeap(), 0,
+ strlen(lpSrc->u2.lpszLongNameA)+1 );
+ strcpy( lpDst->u2.lpszLongNameA, lpSrc->u2.lpszLongNameA );
}
}
else
{
- if( lpSrc->lpszShortNameA )
+ if( lpSrc->u1.lpszShortNameA )
{
- lpDst->lpszShortName = HeapAlloc( GetProcessHeap(), 0,
- (strlenW(lpSrc->lpszShortName)+1)*sizeof(WCHAR) );
- strcpyW( lpDst->lpszShortName, lpSrc->lpszShortName );
+ lpDst->u1.lpszShortName = HeapAlloc( GetProcessHeap(), 0,
+ (strlenW(lpSrc->u1.lpszShortName)+1)*sizeof(WCHAR) );
+ strcpyW( lpDst->u1.lpszShortName, lpSrc->u1.lpszShortName );
}
- if( lpSrc->lpszLongNameA )
+ if( lpSrc->u2.lpszLongNameA )
{
- lpDst->lpszLongName = HeapAlloc( GetProcessHeap(), 0,
- (strlenW(lpSrc->lpszLongName)+1)*sizeof(WCHAR) );
- strcpyW( lpDst->lpszLongName, lpSrc->lpszLongName );
+ lpDst->u2.lpszLongName = HeapAlloc( GetProcessHeap(), 0,
+ (strlenW(lpSrc->u2.lpszLongName)+1)*sizeof(WCHAR) );
+ strcpyW( lpDst->u2.lpszLongName, lpSrc->u2.lpszLongName );
}
}
/* Reallocate for new data */
if( lpData != NULL )
{
- LPVOID lpNewData = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
- sizeof( dwDataSize ) );
- CopyMemory( lpNewData, lpData, dwDataSize );
if( dwFlags & DPSET_LOCAL )
{
}
else
{
- lpPData->lpRemoteData = lpNewData;
+ lpPData->lpRemoteData = HeapAlloc( GetProcessHeap(), 0, dwDataSize );
+ CopyMemory( lpPData->lpRemoteData, lpData, dwDataSize );
lpPData->dwRemoteDataSize = dwDataSize;
}
}
}
-static HRESULT WINAPI DP_IF_CreatePlayer
+static HRESULT DP_IF_CreatePlayer
( IDirectPlay2Impl* This,
LPVOID lpMsgHdr, /* NULL for local creation, non NULL for remote creation */
LPDPID lpidPlayer,
lpPlayerList lpPList;
DWORD dwCreateFlags = 0;
- TRACE( "(%p)->(%p,%p,%p,%p,0x%08lx,0x%08lx,%u)\n",
+ TRACE( "(%p)->(%p,%p,%p,%p,0x%08x,0x%08x,%u)\n",
This, lpidPlayer, lpPlayerName, hEvent, lpData,
dwDataSize, dwFlags, bAnsi );
+ if( This->dp2->connectionInitialized == NO_PROVIDER )
+ {
+ return DPERR_UNINITIALIZED;
+ }
if( dwFlags == 0 )
{
)
{
/* Assume non fatal failure */
- ERR( "unknown dwFlags = 0x%08lx\n", dwFlags );
+ ERR( "unknown dwFlags = 0x%08x\n", dwFlags );
}
/* If the name is not specified, we must provide one */
*/
}
- /* FIXME: Should we be storing these dwFlags or the creation ones? */
- lpPData = DP_CreatePlayer( This, lpidPlayer, lpPlayerName, dwFlags,
+ /* We pass creation flags, so we can distinguish sysplayers and not count them in the current
+ player total */
+ lpPData = DP_CreatePlayer( This, lpidPlayer, lpPlayerName, dwCreateFlags,
hEvent, bAnsi );
if( lpPData == NULL )
data.lpSPMessageHeader = lpMsgHdr;
data.lpISP = This->dp2->spData.lpISP;
- TRACE( "Calling SP CreatePlayer 0x%08lx: dwFlags: 0x%08lx lpMsgHdr: %p\n",
+ TRACE( "Calling SP CreatePlayer 0x%08x: dwFlags: 0x%08x lpMsgHdr: %p\n",
*lpidPlayer, data.dwFlags, data.lpSPMessageHeader );
hr = (*This->dp2->spData.lpCB->CreatePlayer)( &data );
{
IDirectPlay2Impl *This = (IDirectPlay2Impl *)iface;
+ if( lpidPlayer == NULL )
+ {
+ return DPERR_INVALIDPARAMS;
+ }
+
if( dwFlags & DPPLAYER_SERVERPLAYER )
{
*lpidPlayer = DPID_SERVERPLAYER;
{
IDirectPlay2Impl *This = (IDirectPlay2Impl *)iface;
+ if( lpidPlayer == NULL )
+ {
+ return DPERR_INVALIDPARAMS;
+ }
+
if( dwFlags & DPPLAYER_SERVERPLAYER )
{
*lpidPlayer = DPID_SERVERPLAYER;
return DP_NextObjectId();
}
-static HRESULT WINAPI DP_IF_DeletePlayerFromGroup
+static HRESULT DP_IF_DeletePlayerFromGroup
( IDirectPlay2Impl* This, LPVOID lpMsgHdr, DPID idGroup,
DPID idPlayer, BOOL bAnsi )
{
lpGroupData lpGData;
lpPlayerList lpPList;
- TRACE( "(%p)->(%p,0x%08lx,0x%08lx,%u)\n",
+ TRACE( "(%p)->(%p,0x%08x,0x%08x,%u)\n",
This, lpMsgHdr, idGroup, idPlayer, bAnsi );
/* Find the group */
{
lpDPRGOPContext lpCtxt = (lpDPRGOPContext)lpContext;
- TRACE( "Removing element:0x%08lx (type:0x%08lx) from element:0x%08lx\n",
+ TRACE( "Removing element:0x%08x (type:0x%08x) from element:0x%08x\n",
dpId, dwPlayerType, lpCtxt->idGroup );
if( dwPlayerType == DPPLAYERTYPE_GROUP )
)
)
{
- ERR( "Unable to delete group 0x%08lx from group 0x%08lx\n",
+ ERR( "Unable to delete group 0x%08x from group 0x%08x\n",
dpId, lpCtxt->idGroup );
}
}
)
)
{
- ERR( "Unable to delete player 0x%08lx from grp 0x%08lx\n",
+ ERR( "Unable to delete player 0x%08x from grp 0x%08x\n",
dpId, lpCtxt->idGroup );
}
}
return TRUE; /* Continue enumeration */
}
-static HRESULT WINAPI DP_IF_DestroyGroup
+static HRESULT DP_IF_DestroyGroup
( IDirectPlay2Impl* This, LPVOID lpMsgHdr, DPID idGroup, BOOL bAnsi )
{
lpGroupData lpGData;
DPRGOPContext context;
- FIXME( "(%p)->(%p,0x%08lx,%u): semi stub\n",
+ FIXME( "(%p)->(%p,0x%08x,%u): semi stub\n",
This, lpMsgHdr, idGroup, bAnsi );
/* Find the group */
/* Remove all players that this group has */
DP_IF_EnumGroupPlayers( This, idGroup, NULL,
- cbRemoveGroupOrPlayer, (LPVOID)&context, 0, bAnsi );
+ cbRemoveGroupOrPlayer, &context, 0, bAnsi );
/* Remove all links to groups that this group has since this is dp3 */
DP_IF_EnumGroupsInGroup( (IDirectPlay3Impl*)This, idGroup, NULL,
BOOL bAnsi;
} DPFAGContext, *lpDPFAGContext;
-static HRESULT WINAPI DP_IF_DestroyPlayer
+static HRESULT DP_IF_DestroyPlayer
( IDirectPlay2Impl* This, LPVOID lpMsgHdr, DPID idPlayer, BOOL bAnsi )
{
DPFAGContext cbContext;
- FIXME( "(%p)->(%p,0x%08lx,%u): semi stub\n",
+ FIXME( "(%p)->(%p,0x%08x,%u): semi stub\n",
This, lpMsgHdr, idPlayer, bAnsi );
if( This->dp2->connectionInitialized == NO_PROVIDER )
/* Find each group and call DeletePlayerFromGroup if the player is a
member of the group */
DP_IF_EnumGroups( This, NULL, cbDeletePlayerFromAllGroups,
- (LPVOID)&cbContext, DPENUMGROUPS_ALL, bAnsi );
+ &cbContext, DPENUMGROUPS_ALL, bAnsi );
/* Now delete player and player list from the sys group */
DP_DeletePlayer( This, idPlayer );
DP_IF_EnumGroupsInGroup( (IDirectPlay3Impl*)lpCtxt->This,
dpId, NULL,
cbDeletePlayerFromAllGroups,
- (LPVOID)lpContext, DPENUMGROUPS_ALL,
+ lpContext, DPENUMGROUPS_ALL,
lpCtxt->bAnsi );
}
else
{
- ERR( "Group callback has dwPlayerType = 0x%08lx\n", dwPlayerType );
+ ERR( "Group callback has dwPlayerType = 0x%08x\n", dwPlayerType );
}
return TRUE;
return DP_IF_DestroyPlayer( This, NULL, idPlayer, FALSE );
}
-static HRESULT WINAPI DP_IF_EnumGroupPlayers
+static HRESULT DP_IF_EnumGroupPlayers
( IDirectPlay2Impl* This, DPID idGroup, LPGUID lpguidInstance,
LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2,
LPVOID lpContext, DWORD dwFlags, BOOL bAnsi )
lpGroupData lpGData;
lpPlayerList lpPList;
- FIXME("(%p)->(0x%08lx,%p,%p,%p,0x%08lx,%u): semi stub\n",
+ FIXME("(%p)->(0x%08x,%p,%p,%p,0x%08x,%u): semi stub\n",
This, idGroup, lpguidInstance, lpEnumPlayersCallback2,
lpContext, dwFlags, bAnsi );
for( ;; )
{
/* We do not enum the name server or app server as they are of no
- * concequence to the end user.
+ * consequence to the end user.
*/
if( ( lpPList->lpPData->dpid != DPID_NAME_SERVER ) &&
( lpPList->lpPData->dpid != DPID_SERVERPLAYER )
}
/* NOTE: This only enumerates top level groups (created with CreateGroup) */
-static HRESULT WINAPI DP_IF_EnumGroups
+static HRESULT DP_IF_EnumGroups
( IDirectPlay2Impl* This, LPGUID lpguidInstance,
LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2,
LPVOID lpContext, DWORD dwFlags, BOOL bAnsi )
lpContext, dwFlags, FALSE );
}
-static HRESULT WINAPI DP_IF_EnumPlayers
+static HRESULT DP_IF_EnumPlayers
( IDirectPlay2Impl* This, LPGUID lpguidInstance,
LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2,
LPVOID lpContext, DWORD dwFlags, BOOL bAnsi )
static DWORD CALLBACK DP_EnumSessionsSendAsyncRequestThread( LPVOID lpContext )
{
- EnumSessionAsyncCallbackData* data = (EnumSessionAsyncCallbackData*)lpContext;
+ EnumSessionAsyncCallbackData* data = lpContext;
HANDLE hSuicideRequest = data->hSuicideRequest;
DWORD dwTimeout = data->dwTimeout;
- TRACE( "Thread started with timeout = 0x%08lx\n", dwTimeout );
+ TRACE( "Thread started with timeout = 0x%08x\n", dwTimeout );
for( ;; )
{
}
}
-static HRESULT WINAPI DP_IF_EnumSessions
+static HRESULT DP_IF_EnumSessions
( IDirectPlay2Impl* This, LPDPSESSIONDESC2 lpsd, DWORD dwTimeout,
LPDPENUMSESSIONSCALLBACK2 lpEnumSessionsCallback2,
LPVOID lpContext, DWORD dwFlags, BOOL bAnsi )
{
HRESULT hr = DP_OK;
- TRACE( "(%p)->(%p,0x%08lx,%p,%p,0x%08lx,%u)\n",
+ TRACE( "(%p)->(%p,0x%08x,%p,%p,0x%08x,%u)\n",
This, lpsd, dwTimeout, lpEnumSessionsCallback2, lpContext, dwFlags,
bAnsi );
+ if( This->dp2->connectionInitialized == NO_PROVIDER )
+ {
+ return DPERR_UNINITIALIZED;
+ }
/* Can't enumerate if the interface is already open */
if( This->dp2->bConnectionOpen )
return hr;
}
- /* FIXME: Interface locking sucks in this method */
if( ( dwFlags & DPENUMSESSIONS_ASYNC ) )
{
/* Enumerate everything presently in the local session cache */
This->dp2->lpNameServerData, dwTimeout,
lpContext );
+ if( This->dp2->dwEnumSessionLock != 0 )
+ return DPERR_CONNECTING;
/* See if we've already created a thread to service this interface */
if( This->dp2->hEnumSessionThread == INVALID_HANDLE_VALUE )
{
DWORD dwThreadId;
+ This->dp2->dwEnumSessionLock++;
/* Send the first enum request inline since the user may cancel a dialog
* if one is presented. Also, may also have a connecting return code.
hr = NS_SendSessionRequestBroadcast( &lpsd->guidApplication,
dwFlags, &This->dp2->spData );
- if( !FAILED(hr) )
+ if( SUCCEEDED(hr) )
{
EnumSessionAsyncCallbackData* lpData
= HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpData ) );
/* FIXME: need to kill the thread on object deletion */
lpData->lpSpData = &This->dp2->spData;
- CopyMemory( &lpData->requestGuid, &lpsd->guidApplication, sizeof(GUID) );
+ lpData->requestGuid = lpsd->guidApplication;
lpData->dwEnumSessionFlags = dwFlags;
lpData->dwTimeout = dwTimeout;
0,
&dwThreadId );
}
+ This->dp2->dwEnumSessionLock--;
}
}
else
lpContext, dwFlags, FALSE );
}
-static HRESULT WINAPI DP_IF_GetPlayerCaps
+static HRESULT DP_IF_GetPlayerCaps
( IDirectPlay2Impl* This, DPID idPlayer, LPDPCAPS lpDPCaps,
DWORD dwFlags )
{
DPSP_GETCAPSDATA data;
- TRACE("(%p)->(0x%08lx,%p,0x%08lx)\n", This, idPlayer, lpDPCaps, dwFlags);
+ TRACE("(%p)->(0x%08x,%p,0x%08x)\n", This, idPlayer, lpDPCaps, dwFlags);
+
+ if ( This->dp2->connectionInitialized == NO_PROVIDER )
+ {
+ return DPERR_UNINITIALIZED;
+ }
/* Query the service provider */
data.idPlayer = idPlayer;
return (*This->dp2->spData.lpCB->GetCaps)( &data );
}
-static HRESULT WINAPI DP_IF_GetCaps
+static HRESULT DP_IF_GetCaps
( IDirectPlay2Impl* This, LPDPCAPS lpDPCaps, DWORD dwFlags )
{
return DP_IF_GetPlayerCaps( This, DPID_ALLPLAYERS, lpDPCaps, dwFlags );
return DP_IF_GetCaps( This, lpDPCaps, dwFlags );
}
-static HRESULT WINAPI DP_IF_GetGroupData
+static HRESULT DP_IF_GetGroupData
( IDirectPlay2Impl* This, DPID idGroup, LPVOID lpData,
LPDWORD lpdwDataSize, DWORD dwFlags, BOOL bAnsi )
{
DWORD dwRequiredBufferSize;
LPVOID lpCopyDataFrom;
- TRACE( "(%p)->(0x%08lx,%p,%p,0x%08lx,%u)\n",
+ TRACE( "(%p)->(0x%08x,%p,%p,0x%08x,%u)\n",
This, idGroup, lpData, lpdwDataSize, dwFlags, bAnsi );
if( ( lpGData = DP_FindAnyGroup( This, idGroup ) ) == NULL )
dwFlags, FALSE );
}
-static HRESULT WINAPI DP_IF_GetGroupName
+static HRESULT DP_IF_GetGroupName
( IDirectPlay2Impl* This, DPID idGroup, LPVOID lpData,
LPDWORD lpdwDataSize, BOOL bAnsi )
{
lpGroupData lpGData;
- LPDPNAME lpName = (LPDPNAME)lpData;
+ LPDPNAME lpName = lpData;
DWORD dwRequiredDataSize;
- FIXME("(%p)->(0x%08lx,%p,%p,%u) ANSI ignored\n",
+ FIXME("(%p)->(0x%08x,%p,%p,%u) ANSI ignored\n",
This, idGroup, lpData, lpdwDataSize, bAnsi );
if( ( lpGData = DP_FindAnyGroup( This, idGroup ) ) == NULL )
dwRequiredDataSize = lpGData->name.dwSize;
- if( lpGData->name.lpszShortNameA )
+ if( lpGData->name.u1.lpszShortNameA )
{
- dwRequiredDataSize += strlen( lpGData->name.lpszShortNameA ) + 1;
+ dwRequiredDataSize += strlen( lpGData->name.u1.lpszShortNameA ) + 1;
}
- if( lpGData->name.lpszLongNameA )
+ if( lpGData->name.u2.lpszLongNameA )
{
- dwRequiredDataSize += strlen( lpGData->name.lpszLongNameA ) + 1;
+ dwRequiredDataSize += strlen( lpGData->name.u2.lpszLongNameA ) + 1;
}
if( ( lpData == NULL ) ||
/* Copy the structure */
CopyMemory( lpName, &lpGData->name, lpGData->name.dwSize );
- if( lpGData->name.lpszShortNameA )
+ if( lpGData->name.u1.lpszShortNameA )
{
strcpy( ((char*)lpName)+lpGData->name.dwSize,
- lpGData->name.lpszShortNameA );
+ lpGData->name.u1.lpszShortNameA );
}
else
{
- lpName->lpszShortNameA = NULL;
+ lpName->u1.lpszShortNameA = NULL;
}
- if( lpGData->name.lpszShortNameA )
+ if( lpGData->name.u1.lpszShortNameA )
{
strcpy( ((char*)lpName)+lpGData->name.dwSize,
- lpGData->name.lpszLongNameA );
+ lpGData->name.u2.lpszLongNameA );
}
else
{
- lpName->lpszLongNameA = NULL;
+ lpName->u2.lpszLongNameA = NULL;
}
return DP_OK;
return DP_IF_GetGroupName( This, idGroup, lpData, lpdwDataSize, FALSE );
}
-static HRESULT WINAPI DP_IF_GetMessageCount
+static HRESULT DP_IF_GetMessageCount
( IDirectPlay2Impl* This, DPID idPlayer,
LPDWORD lpdwCount, BOOL bAnsi )
{
- FIXME("(%p)->(0x%08lx,%p,%u): stub\n", This, idPlayer, lpdwCount, bAnsi );
+ FIXME("(%p)->(0x%08x,%p,%u): stub\n", This, idPlayer, lpdwCount, bAnsi );
return DP_IF_GetMessageQueue( (IDirectPlay4Impl*)This, 0, idPlayer,
DPMESSAGEQUEUE_RECEIVE, lpdwCount, NULL,
bAnsi );
( LPDIRECTPLAY2A iface, DPID idPlayer, LPVOID lpData, LPDWORD lpdwDataSize )
{
IDirectPlay2Impl *This = (IDirectPlay2Impl *)iface;
- FIXME("(%p)->(0x%08lx,%p,%p): stub\n", This, idPlayer, lpData, lpdwDataSize );
+ FIXME("(%p)->(0x%08x,%p,%p): stub\n", This, idPlayer, lpData, lpdwDataSize );
return DP_OK;
}
( LPDIRECTPLAY2 iface, DPID idPlayer, LPVOID lpData, LPDWORD lpdwDataSize )
{
IDirectPlay2Impl *This = (IDirectPlay2Impl *)iface;
- FIXME("(%p)->(0x%08lx,%p,%p): stub\n", This, idPlayer, lpData, lpdwDataSize );
+ FIXME("(%p)->(0x%08x,%p,%p): stub\n", This, idPlayer, lpData, lpdwDataSize );
return DP_OK;
}
return DP_IF_GetPlayerCaps( This, idPlayer, lpPlayerCaps, dwFlags );
}
-static HRESULT WINAPI DP_IF_GetPlayerData
+static HRESULT DP_IF_GetPlayerData
( IDirectPlay2Impl* This, DPID idPlayer, LPVOID lpData,
LPDWORD lpdwDataSize, DWORD dwFlags, BOOL bAnsi )
{
DWORD dwRequiredBufferSize;
LPVOID lpCopyDataFrom;
- TRACE( "(%p)->(0x%08lx,%p,%p,0x%08lx,%u)\n",
+ TRACE( "(%p)->(0x%08x,%p,%p,0x%08x,%u)\n",
This, idPlayer, lpData, lpdwDataSize, dwFlags, bAnsi );
if( This->dp2->connectionInitialized == NO_PROVIDER )
dwFlags, FALSE );
}
-static HRESULT WINAPI DP_IF_GetPlayerName
+static HRESULT DP_IF_GetPlayerName
( IDirectPlay2Impl* This, DPID idPlayer, LPVOID lpData,
LPDWORD lpdwDataSize, BOOL bAnsi )
{
lpPlayerList lpPList;
- LPDPNAME lpName = (LPDPNAME)lpData;
+ LPDPNAME lpName = lpData;
DWORD dwRequiredDataSize;
- FIXME( "(%p)->(0x%08lx,%p,%p,%u): ANSI\n",
+ FIXME( "(%p)->(0x%08x,%p,%p,%u): ANSI\n",
This, idPlayer, lpData, lpdwDataSize, bAnsi );
+ if( This->dp2->connectionInitialized == NO_PROVIDER )
+ {
+ return DPERR_UNINITIALIZED;
+ }
+
if( ( lpPList = DP_FindPlayer( This, idPlayer ) ) == NULL )
{
return DPERR_INVALIDPLAYER;
dwRequiredDataSize = lpPList->lpPData->name.dwSize;
- if( lpPList->lpPData->name.lpszShortNameA )
+ if( lpPList->lpPData->name.u1.lpszShortNameA )
{
- dwRequiredDataSize += strlen( lpPList->lpPData->name.lpszShortNameA ) + 1;
+ dwRequiredDataSize += strlen( lpPList->lpPData->name.u1.lpszShortNameA ) + 1;
}
- if( lpPList->lpPData->name.lpszLongNameA )
+ if( lpPList->lpPData->name.u2.lpszLongNameA )
{
- dwRequiredDataSize += strlen( lpPList->lpPData->name.lpszLongNameA ) + 1;
+ dwRequiredDataSize += strlen( lpPList->lpPData->name.u2.lpszLongNameA ) + 1;
}
if( ( lpData == NULL ) ||
/* Copy the structure */
CopyMemory( lpName, &lpPList->lpPData->name, lpPList->lpPData->name.dwSize );
- if( lpPList->lpPData->name.lpszShortNameA )
+ if( lpPList->lpPData->name.u1.lpszShortNameA )
{
strcpy( ((char*)lpName)+lpPList->lpPData->name.dwSize,
- lpPList->lpPData->name.lpszShortNameA );
+ lpPList->lpPData->name.u1.lpszShortNameA );
}
else
{
- lpName->lpszShortNameA = NULL;
+ lpName->u1.lpszShortNameA = NULL;
}
- if( lpPList->lpPData->name.lpszShortNameA )
+ if( lpPList->lpPData->name.u1.lpszShortNameA )
{
strcpy( ((char*)lpName)+lpPList->lpPData->name.dwSize,
- lpPList->lpPData->name.lpszLongNameA );
+ lpPList->lpPData->name.u2.lpszLongNameA );
}
else
{
- lpName->lpszLongNameA = NULL;
+ lpName->u2.lpszLongNameA = NULL;
}
return DP_OK;
return DP_IF_GetPlayerName( This, idPlayer, lpData, lpdwDataSize, FALSE );
}
-static HRESULT WINAPI DP_GetSessionDesc
+static HRESULT DP_GetSessionDesc
( IDirectPlay2Impl* This, LPVOID lpData, LPDWORD lpdwDataSize,
BOOL bAnsi )
{
}
-static HRESULT WINAPI DP_SecureOpen
+static HRESULT DP_SecureOpen
( IDirectPlay2Impl* This, LPCDPSESSIONDESC2 lpsd, DWORD dwFlags,
LPCDPSECURITYDESC lpSecurity, LPCDPCREDENTIALS lpCredentials,
BOOL bAnsi )
{
HRESULT hr = DP_OK;
- FIXME( "(%p)->(%p,0x%08lx,%p,%p): partial stub\n",
+ FIXME( "(%p)->(%p,0x%08x,%p,%p): partial stub\n",
This, lpsd, dwFlags, lpSecurity, lpCredentials );
+ if( This->dp2->connectionInitialized == NO_PROVIDER )
+ {
+ return DPERR_UNINITIALIZED;
+ }
+
+ if( lpsd->dwSize != sizeof(DPSESSIONDESC2) )
+ {
+ TRACE( ": rejecting invalid dpsd size (%d).\n", lpsd->dwSize );
+ return DPERR_INVALIDPARAMS;
+ }
+
if( This->dp2->bConnectionOpen )
{
TRACE( ": rejecting already open connection.\n" );
FIXME( "Not all data fields are correct. Need new parameter\n" );
- data.bCreate = (dwFlags & DPOPEN_CREATE ) ? TRUE : FALSE;
+ data.bCreate = (dwFlags & DPOPEN_CREATE ) != 0;
data.lpSPMessageHeader = (dwFlags & DPOPEN_CREATE ) ? NULL
: NS_GetNSAddr( This->dp2->lpNameServerData );
data.lpISP = This->dp2->spData.lpISP;
- data.bReturnStatus = (dwFlags & DPOPEN_RETURNSTATUS) ? TRUE : FALSE;
+ data.bReturnStatus = (dwFlags & DPOPEN_RETURNSTATUS) != 0;
data.dwOpenFlags = dwFlags;
data.dwSessionFlags = This->dp2->lpSessionDesc->dwFlags;
( LPDIRECTPLAY2A iface, LPDPSESSIONDESC2 lpsd, DWORD dwFlags )
{
IDirectPlay2Impl *This = (IDirectPlay2Impl *)iface;
- TRACE("(%p)->(%p,0x%08lx)\n", This, lpsd, dwFlags );
+ TRACE("(%p)->(%p,0x%08x)\n", This, lpsd, dwFlags );
return DP_SecureOpen( This, lpsd, dwFlags, NULL, NULL, TRUE );
}
( LPDIRECTPLAY2 iface, LPDPSESSIONDESC2 lpsd, DWORD dwFlags )
{
IDirectPlay2Impl *This = (IDirectPlay2Impl *)iface;
- TRACE("(%p)->(%p,0x%08lx)\n", This, lpsd, dwFlags );
+ TRACE("(%p)->(%p,0x%08x)\n", This, lpsd, dwFlags );
return DP_SecureOpen( This, lpsd, dwFlags, NULL, NULL, FALSE );
}
-static HRESULT WINAPI DP_IF_Receive
+static HRESULT DP_IF_Receive
( IDirectPlay2Impl* This, LPDPID lpidFrom, LPDPID lpidTo,
DWORD dwFlags, LPVOID lpData, LPDWORD lpdwDataSize, BOOL bAnsi )
{
LPDPMSG lpMsg = NULL;
- FIXME( "(%p)->(%p,%p,0x%08lx,%p,%p,%u): stub\n",
+ FIXME( "(%p)->(%p,%p,0x%08x,%p,%p,%u): stub\n",
This, lpidFrom, lpidTo, dwFlags, lpData, lpdwDataSize, bAnsi );
if( This->dp2->connectionInitialized == NO_PROVIDER )
( dwFlags & DPRECEIVE_FROMPLAYER )
)
{
- FIXME( "Find matching message 0x%08lx\n", dwFlags );
+ FIXME( "Find matching message 0x%08x\n", dwFlags );
}
else
{
- ERR( "Hmmm..dwFlags 0x%08lx\n", dwFlags );
+ ERR( "Hmmm..dwFlags 0x%08x\n", dwFlags );
}
if( lpMsg == NULL )
}
/* Copy into the provided buffer */
- CopyMemory( lpData, lpMsg->msg, *lpdwDataSize );
+ if (lpData) CopyMemory( lpData, lpMsg->msg, *lpdwDataSize );
return DP_OK;
}
0, 0, NULL, NULL, FALSE );
}
-static HRESULT WINAPI DP_IF_SetGroupData
+static HRESULT DP_IF_SetGroupData
( IDirectPlay2Impl* This, DPID idGroup, LPVOID lpData,
DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi )
{
lpGroupData lpGData;
- TRACE( "(%p)->(0x%08lx,%p,0x%08lx,0x%08lx,%u)\n",
+ TRACE( "(%p)->(0x%08x,%p,0x%08x,0x%08x,%u)\n",
This, idGroup, lpData, dwDataSize, dwFlags, bAnsi );
/* Parameter check */
return DP_IF_SetGroupData( This, idGroup, lpData, dwDataSize, dwFlags, FALSE );
}
-static HRESULT WINAPI DP_IF_SetGroupName
+static HRESULT DP_IF_SetGroupName
( IDirectPlay2Impl* This, DPID idGroup, LPDPNAME lpGroupName,
DWORD dwFlags, BOOL bAnsi )
{
lpGroupData lpGData;
- TRACE( "(%p)->(0x%08lx,%p,0x%08lx,%u)\n", This, idGroup,
+ TRACE( "(%p)->(0x%08x,%p,0x%08x,%u)\n", This, idGroup,
lpGroupName, dwFlags, bAnsi );
if( ( lpGData = DP_FindAnyGroup( This, idGroup ) ) == NULL )
return DP_IF_SetGroupName( This, idGroup, lpGroupName, dwFlags, FALSE );
}
-static HRESULT WINAPI DP_IF_SetPlayerData
+static HRESULT DP_IF_SetPlayerData
( IDirectPlay2Impl* This, DPID idPlayer, LPVOID lpData,
DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi )
{
lpPlayerList lpPList;
- TRACE( "(%p)->(0x%08lx,%p,0x%08lx,0x%08lx,%u)\n",
+ TRACE( "(%p)->(0x%08x,%p,0x%08x,0x%08x,%u)\n",
This, idPlayer, lpData, dwDataSize, dwFlags, bAnsi );
+ if( This->dp2->connectionInitialized == NO_PROVIDER )
+ {
+ return DPERR_UNINITIALIZED;
+ }
+
/* Parameter check */
if( ( lpData == NULL ) &&
( dwDataSize != 0 )
dwFlags, FALSE );
}
-static HRESULT WINAPI DP_IF_SetPlayerName
+static HRESULT DP_IF_SetPlayerName
( IDirectPlay2Impl* This, DPID idPlayer, LPDPNAME lpPlayerName,
DWORD dwFlags, BOOL bAnsi )
{
lpPlayerList lpPList;
- TRACE( "(%p)->(0x%08lx,%p,0x%08lx,%u)\n",
+ TRACE( "(%p)->(0x%08x,%p,0x%08x,%u)\n",
This, idPlayer, lpPlayerName, dwFlags, bAnsi );
+ if( This->dp2->connectionInitialized == NO_PROVIDER )
+ {
+ return DPERR_UNINITIALIZED;
+ }
+
if( ( lpPList = DP_FindPlayer( This, idPlayer ) ) == NULL )
{
return DPERR_INVALIDGROUP;
return DP_IF_SetPlayerName( This, idPlayer, lpPlayerName, dwFlags, FALSE );
}
-static HRESULT WINAPI DP_SetSessionDesc
+static HRESULT DP_SetSessionDesc
( IDirectPlay2Impl* This, LPCDPSESSIONDESC2 lpSessDesc,
DWORD dwFlags, BOOL bInitial, BOOL bAnsi )
{
DWORD dwRequiredSize;
LPDPSESSIONDESC2 lpTempSessDesc;
- TRACE( "(%p)->(%p,0x%08lx,%u,%u)\n",
+ TRACE( "(%p)->(%p,0x%08x,%u,%u)\n",
This, lpSessDesc, dwFlags, bInitial, bAnsi );
if( This->dp2->connectionInitialized == NO_PROVIDER )
HeapFree( GetProcessHeap(), 0, This->dp2->lpSessionDesc );
This->dp2->lpSessionDesc = lpTempSessDesc;
-
/* Set the new */
DP_CopySessionDesc( This->dp2->lpSessionDesc, lpSessDesc, bAnsi );
-
+ if( bInitial )
+ {
+ /*Initializing session GUID*/
+ CoCreateGuid( &(This->dp2->lpSessionDesc->guidInstance) );
+ }
/* If this is an external invocation of the interface, we should be
* letting everyone know that things have changed. Otherwise this is
* just an initialization and it doesn't need to be propagated.
}
/* FIXME: See about merging some of this stuff with dplayx_global.c stuff */
-DWORD DP_CalcSessionDescSize( LPCDPSESSIONDESC2 lpSessDesc, BOOL bAnsi )
+static DWORD DP_CalcSessionDescSize( LPCDPSESSIONDESC2 lpSessDesc, BOOL bAnsi )
{
DWORD dwSize = 0;
if( bAnsi )
{
- if( lpSessDesc->lpszSessionNameA )
+ if( lpSessDesc->u1.lpszSessionNameA )
{
- dwSize += lstrlenA( lpSessDesc->lpszSessionNameA ) + 1;
+ dwSize += lstrlenA( lpSessDesc->u1.lpszSessionNameA ) + 1;
}
- if( lpSessDesc->lpszPasswordA )
+ if( lpSessDesc->u2.lpszPasswordA )
{
- dwSize += lstrlenA( lpSessDesc->lpszPasswordA ) + 1;
+ dwSize += lstrlenA( lpSessDesc->u2.lpszPasswordA ) + 1;
}
}
else /* UNICODE */
{
- if( lpSessDesc->lpszSessionName )
+ if( lpSessDesc->u1.lpszSessionName )
{
dwSize += sizeof( WCHAR ) *
- ( lstrlenW( lpSessDesc->lpszSessionName ) + 1 );
+ ( lstrlenW( lpSessDesc->u1.lpszSessionName ) + 1 );
}
- if( lpSessDesc->lpszPassword )
+ if( lpSessDesc->u2.lpszPassword )
{
dwSize += sizeof( WCHAR ) *
- ( lstrlenW( lpSessDesc->lpszPassword ) + 1 );
+ ( lstrlenW( lpSessDesc->u2.lpszPassword ) + 1 );
}
}
return dwSize;
}
-/* Assumes that contugous buffers are already allocated. */
+/* Assumes that contiguous buffers are already allocated. */
static void DP_CopySessionDesc( LPDPSESSIONDESC2 lpSessionDest,
LPCDPSESSIONDESC2 lpSessionSrc, BOOL bAnsi )
{
if( bAnsi )
{
- if( lpSessionSrc->lpszSessionNameA )
+ if( lpSessionSrc->u1.lpszSessionNameA )
{
lstrcpyA( (LPSTR)lpStartOfFreeSpace,
- lpSessionDest->lpszSessionNameA );
- lpSessionDest->lpszSessionNameA = (LPSTR)lpStartOfFreeSpace;
+ lpSessionDest->u1.lpszSessionNameA );
+ lpSessionDest->u1.lpszSessionNameA = (LPSTR)lpStartOfFreeSpace;
lpStartOfFreeSpace +=
- lstrlenA( (LPSTR)lpSessionDest->lpszSessionNameA ) + 1;
+ lstrlenA( lpSessionDest->u1.lpszSessionNameA ) + 1;
}
- if( lpSessionSrc->lpszPasswordA )
+ if( lpSessionSrc->u2.lpszPasswordA )
{
lstrcpyA( (LPSTR)lpStartOfFreeSpace,
- lpSessionDest->lpszPasswordA );
- lpSessionDest->lpszPasswordA = (LPSTR)lpStartOfFreeSpace;
- lpStartOfFreeSpace +=
- lstrlenA( (LPSTR)lpSessionDest->lpszPasswordA ) + 1;
+ lpSessionDest->u2.lpszPasswordA );
+ lpSessionDest->u2.lpszPasswordA = (LPSTR)lpStartOfFreeSpace;
}
}
else /* UNICODE */
{
- if( lpSessionSrc->lpszSessionName )
+ if( lpSessionSrc->u1.lpszSessionName )
{
lstrcpyW( (LPWSTR)lpStartOfFreeSpace,
- lpSessionDest->lpszSessionName );
- lpSessionDest->lpszSessionName = (LPWSTR)lpStartOfFreeSpace;
+ lpSessionDest->u1.lpszSessionName );
+ lpSessionDest->u1.lpszSessionName = (LPWSTR)lpStartOfFreeSpace;
lpStartOfFreeSpace += sizeof(WCHAR) *
- ( lstrlenW( (LPWSTR)lpSessionDest->lpszSessionName ) + 1 );
+ ( lstrlenW( lpSessionDest->u1.lpszSessionName ) + 1 );
}
- if( lpSessionSrc->lpszPassword )
+ if( lpSessionSrc->u2.lpszPassword )
{
lstrcpyW( (LPWSTR)lpStartOfFreeSpace,
- lpSessionDest->lpszPassword );
- lpSessionDest->lpszPassword = (LPWSTR)lpStartOfFreeSpace;
- lpStartOfFreeSpace += sizeof(WCHAR) *
- ( lstrlenW( (LPWSTR)lpSessionDest->lpszPassword ) + 1 );
+ lpSessionDest->u2.lpszPassword );
+ lpSessionDest->u2.lpszPassword = (LPWSTR)lpStartOfFreeSpace;
}
}
}
-static HRESULT WINAPI DP_IF_AddGroupToGroup
+static HRESULT DP_IF_AddGroupToGroup
( IDirectPlay3Impl* This, DPID idParentGroup, DPID idGroup )
{
- lpGroupData lpGParentData;
lpGroupData lpGData;
lpGroupList lpNewGList;
- TRACE( "(%p)->(0x%08lx,0x%08lx)\n", This, idParentGroup, idGroup );
+ TRACE( "(%p)->(0x%08x,0x%08x)\n", This, idParentGroup, idGroup );
- if( ( lpGParentData = DP_FindAnyGroup( (IDirectPlay2AImpl*)This, idParentGroup ) ) == NULL )
+ if( This->dp2->connectionInitialized == NO_PROVIDER )
+ {
+ return DPERR_UNINITIALIZED;
+ }
+
+ if( DP_FindAnyGroup( (IDirectPlay2AImpl*)This, idParentGroup ) == NULL )
{
return DPERR_INVALIDGROUP;
}
return DP_IF_AddGroupToGroup( This, idParentGroup, idGroup );
}
-static HRESULT WINAPI DP_IF_CreateGroupInGroup
+static HRESULT DP_IF_CreateGroupInGroup
( IDirectPlay3Impl* This, LPVOID lpMsgHdr, DPID idParentGroup,
LPDPID lpidGroup, LPDPNAME lpGroupName, LPVOID lpData,
DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi )
lpGroupList lpGList;
lpGroupData lpGData;
- TRACE( "(%p)->(0x%08lx,%p,%p,%p,0x%08lx,0x%08lx,%u)\n",
+ TRACE( "(%p)->(0x%08x,%p,%p,%p,0x%08x,0x%08x,%u)\n",
This, idParentGroup, lpidGroup, lpGroupName, lpData,
dwDataSize, dwFlags, bAnsi );
+ if( This->dp2->connectionInitialized == NO_PROVIDER )
+ {
+ return DPERR_UNINITIALIZED;
+ }
+
/* Verify that the specified parent is valid */
if( ( lpGParentData = DP_FindAnyGroup( (IDirectPlay2AImpl*)This,
idParentGroup ) ) == NULL
dwFlags, FALSE );
}
-static HRESULT WINAPI DP_IF_DeleteGroupFromGroup
+static HRESULT DP_IF_DeleteGroupFromGroup
( IDirectPlay3Impl* This, DPID idParentGroup, DPID idGroup )
{
lpGroupList lpGList;
lpGroupData lpGParentData;
- TRACE("(%p)->(0x%08lx,0x%08lx)\n", This, idParentGroup, idGroup );
+ TRACE("(%p)->(0x%08x,0x%08x)\n", This, idParentGroup, idGroup );
/* Is the parent group valid? */
if( ( lpGParentData = DP_FindAnyGroup( (IDirectPlay2AImpl*)This, idParentGroup ) ) == NULL )
return DP_IF_DeleteGroupFromGroup( This, idParentGroup, idGroup );
}
-static
-BOOL WINAPI DP_BuildSPCompoundAddr( LPGUID lpcSpGuid, LPVOID* lplpAddrBuf,
+static BOOL DP_BuildSPCompoundAddr( LPGUID lpcSpGuid, LPVOID* lplpAddrBuf,
LPDWORD lpdwBufSize )
{
DPCOMPOUNDADDRESSELEMENT dpCompoundAddress;
HRESULT hr;
dpCompoundAddress.dwDataSize = sizeof( GUID );
- memcpy( &dpCompoundAddress.guidDataType, &DPAID_ServiceProvider,
- sizeof( GUID ) ) ;
+ dpCompoundAddress.guidDataType = DPAID_ServiceProvider;
dpCompoundAddress.lpData = lpcSpGuid;
*lplpAddrBuf = NULL;
( LPDIRECTPLAY3A iface, LPCGUID lpguidApplication, LPDPENUMCONNECTIONSCALLBACK lpEnumCallback, LPVOID lpContext, DWORD dwFlags )
{
IDirectPlay3Impl *This = (IDirectPlay3Impl *)iface;
- TRACE("(%p)->(%p,%p,%p,0x%08lx)\n", This, lpguidApplication, lpEnumCallback, lpContext, dwFlags );
+ TRACE("(%p)->(%p,%p,%p,0x%08x)\n", This, lpguidApplication, lpEnumCallback, lpContext, dwFlags );
/* A default dwFlags (0) is backwards compatible -- DPCONNECTION_DIRECTPLAY */
if( dwFlags == 0 )
return DPERR_INVALIDFLAGS;
}
- if( !lpEnumCallback || !*lpEnumCallback )
+ if( !lpEnumCallback )
{
return DPERR_INVALIDPARAMS;
}
&sizeOfReturnBuffer ) != ERROR_SUCCESS )
{
ERR(": missing GUID registry data members\n" );
+ RegCloseKey(hkServiceProvider);
continue;
}
+ RegCloseKey(hkServiceProvider);
/* FIXME: Check return types to ensure we're interpreting data right */
MultiByteToWideChar( CP_ACP, 0, returnBuffer, -1, buff, sizeof(buff)/sizeof(WCHAR) );
/* Fill in the DPNAME struct for the service provider */
dpName.dwSize = sizeof( dpName );
dpName.dwFlags = 0;
- dpName.lpszShortNameA = subKeyName;
- dpName.lpszLongNameA = NULL;
+ dpName.u1.lpszShortNameA = subKeyName;
+ dpName.u2.lpszLongNameA = NULL;
/* Create the compound address for the service provider.
* NOTE: This is a gruesome architectural scar right now. DP
/* The enumeration will return FALSE if we are not to continue */
if( !lpEnumCallback( &serviceProviderGUID, lpAddressBuffer, dwAddressBufferSize,
- &dpName, DPCONNECTION_DIRECTPLAY, lpContext ) )
+ &dpName, dwFlags, lpContext ) )
{
return DP_OK;
}
&sizeOfReturnBuffer ) != ERROR_SUCCESS )
{
ERR(": missing GUID registry data members\n" );
+ RegCloseKey(hkServiceProvider);
continue;
}
+ RegCloseKey(hkServiceProvider);
/* FIXME: Check return types to ensure we're interpreting data right */
MultiByteToWideChar( CP_ACP, 0, returnBuffer, -1, buff, sizeof(buff)/sizeof(WCHAR) );
/* Fill in the DPNAME struct for the service provider */
dpName.dwSize = sizeof( dpName );
dpName.dwFlags = 0;
- dpName.lpszShortNameA = subKeyName;
- dpName.lpszLongNameA = NULL;
+ dpName.u1.lpszShortNameA = subKeyName;
+ dpName.u2.lpszLongNameA = NULL;
/* Create the compound address for the service provider.
NOTE: This is a gruesome architectural scar right now. DP uses DPL and DPL uses DP
&dwAddressBufferSize, TRUE ) ) != DP_OK )
{
ERR( "can't create address: %s\n", DPLAYX_HresultToString( hr ) );
+ HeapFree( GetProcessHeap(), 0, lpAddressBuffer );
return hr;
}
/* The enumeration will return FALSE if we are not to continue */
if( !lpEnumCallback( &serviceProviderGUID, lpAddressBuffer, dwAddressBufferSize,
- &dpName, DPCONNECTION_DIRECTPLAYLOBBY, lpContext ) )
+ &dpName, dwFlags, lpContext ) )
{
+ HeapFree( GetProcessHeap(), 0, lpAddressBuffer );
return DP_OK;
}
+ HeapFree( GetProcessHeap(), 0, lpAddressBuffer );
}
}
( LPDIRECTPLAY3 iface, LPCGUID lpguidApplication, LPDPENUMCONNECTIONSCALLBACK lpEnumCallback, LPVOID lpContext, DWORD dwFlags )
{
IDirectPlay3Impl *This = (IDirectPlay3Impl *)iface;
- FIXME("(%p)->(%p,%p,%p,0x%08lx): stub\n", This, lpguidApplication, lpEnumCallback, lpContext, dwFlags );
+ FIXME("(%p)->(%p,%p,%p,0x%08x): stub\n", This, lpguidApplication, lpEnumCallback, lpContext, dwFlags );
return DP_OK;
}
-static HRESULT WINAPI DP_IF_EnumGroupsInGroup
+static HRESULT DP_IF_EnumGroupsInGroup
( IDirectPlay3AImpl* This, DPID idGroup, LPGUID lpguidInstance,
LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2,
LPVOID lpContext, DWORD dwFlags, BOOL bAnsi )
lpGroupList lpGList;
lpGroupData lpGData;
- FIXME( "(%p)->(0x%08lx,%p,%p,%p,0x%08lx,%u): semi stub\n",
+ FIXME( "(%p)->(0x%08x,%p,%p,%p,0x%08x,%u): semi stub\n",
This, idGroup, lpguidInstance, lpEnumPlayersCallback2,
lpContext, dwFlags, bAnsi );
+ if( This->dp2->connectionInitialized == NO_PROVIDER )
+ {
+ return DPERR_UNINITIALIZED;
+ }
+
if( ( lpGData = DP_FindAnyGroup( (IDirectPlay2AImpl*)This, idGroup ) ) == NULL )
{
return DPERR_INVALIDGROUP;
( LPDIRECTPLAY3A iface, DWORD dwFlags, DPID idGroup, LPVOID lpData, LPDWORD lpdwDataSize )
{
IDirectPlay3Impl *This = (IDirectPlay3Impl *)iface;
- FIXME("(%p)->(0x%08lx,0x%08lx,%p,%p): stub\n", This, dwFlags, idGroup, lpData, lpdwDataSize );
+ FIXME("(%p)->(0x%08x,0x%08x,%p,%p): stub\n", This, dwFlags, idGroup, lpData, lpdwDataSize );
return DP_OK;
}
( LPDIRECTPLAY3 iface, DWORD dwFlags, DPID idGroup, LPVOID lpData, LPDWORD lpdwDataSize )
{
IDirectPlay3Impl *This = (IDirectPlay3Impl *)iface;
- FIXME("(%p)->(0x%08lx,0x%08lx,%p,%p): stub\n", This, dwFlags, idGroup, lpData, lpdwDataSize );
+ FIXME("(%p)->(0x%08x,0x%08x,%p,%p): stub\n", This, dwFlags, idGroup, lpData, lpdwDataSize );
return DP_OK;
}
( IsEqualGUID( guidDataType, &DPAID_LobbyProvider ) )
)
{
- TRACE( "Found SP/LP (%s) %s (data size = 0x%08lx)\n",
+ TRACE( "Found SP/LP (%s) %s (data size = 0x%08x)\n",
debugstr_guid( guidDataType ), debugstr_guid( lpData ), dwDataSize );
if( dwDataSize != sizeof( GUID ) )
{
- ERR( "Invalid sp/lp guid size 0x%08lx\n", dwDataSize );
+ ERR( "Invalid sp/lp guid size 0x%08x\n", dwDataSize );
}
memcpy( lpContext, lpData, dwDataSize );
NULL, NULL, (LPBYTE)returnBuffer,
&sizeOfReturnBuffer ) ) != ERROR_SUCCESS )
{
- ERR(": missing PATH registry data members: 0x%08lx\n", dwTemp );
+ ERR(": missing PATH registry data members: 0x%08x\n", dwTemp );
continue;
}
return hr;
}
-static HRESULT WINAPI DP_IF_InitializeConnection
+static HRESULT DP_IF_InitializeConnection
( IDirectPlay3Impl* This, LPVOID lpConnection, DWORD dwFlags, BOOL bAnsi )
{
HMODULE hServiceProvider;
const DWORD dwAddrSize = 80; /* FIXME: Need to calculate it correctly */
BOOL bIsDpSp; /* TRUE if Direct Play SP, FALSE if Direct Play Lobby SP */
- TRACE("(%p)->(%p,0x%08lx,%u)\n", This, lpConnection, dwFlags, bAnsi );
+ TRACE("(%p)->(%p,0x%08x,%u)\n", This, lpConnection, dwFlags, bAnsi );
+
+ if ( lpConnection == NULL )
+ {
+ return DPERR_INVALIDPARAMS;
+ }
if( dwFlags != 0 )
{
return DPERR_INVALIDFLAGS;
}
+ if( This->dp2->connectionInitialized != NO_PROVIDER )
+ {
+ return DPERR_ALREADYINITIALIZED;
+ }
+
/* Find out what the requested SP is and how large this buffer is */
hr = DPL_EnumAddress( DP_GetSpLpGuidFromCompoundAddress, lpConnection,
dwAddrSize, &guidSP );
if( hServiceProvider == 0 )
{
- ERR( "Unable to load service provider\n" );
+ ERR( "Unable to load service provider %s\n", debugstr_guid(&guidSP) );
return DPERR_UNAVAILABLE;
}
( LPDIRECTPLAY3A iface, DPID idFrom, DPID idTo, DWORD dwFlags, LPDPCHAT lpChatMessage )
{
IDirectPlay3Impl *This = (IDirectPlay3Impl *)iface;
- FIXME("(%p)->(0x%08lx,0x%08lx,0x%08lx,%p): stub\n", This, idFrom, idTo, dwFlags, lpChatMessage );
+ FIXME("(%p)->(0x%08x,0x%08x,0x%08x,%p): stub\n", This, idFrom, idTo, dwFlags, lpChatMessage );
return DP_OK;
}
( LPDIRECTPLAY3 iface, DPID idFrom, DPID idTo, DWORD dwFlags, LPDPCHAT lpChatMessage )
{
IDirectPlay3Impl *This = (IDirectPlay3Impl *)iface;
- FIXME("(%p)->(0x%08lx,0x%08lx,0x%08lx,%p): stub\n", This, idFrom, idTo, dwFlags, lpChatMessage );
+ FIXME("(%p)->(0x%08x,0x%08x,0x%08x,%p): stub\n", This, idFrom, idTo, dwFlags, lpChatMessage );
return DP_OK;
}
( LPDIRECTPLAY3A iface, DWORD dwFlags, DPID idGroup, LPDPLCONNECTION lpConnection )
{
IDirectPlay3Impl *This = (IDirectPlay3Impl *)iface;
- FIXME("(%p)->(0x%08lx,0x%08lx,%p): stub\n", This, dwFlags, idGroup, lpConnection );
+ FIXME("(%p)->(0x%08x,0x%08x,%p): stub\n", This, dwFlags, idGroup, lpConnection );
return DP_OK;
}
( LPDIRECTPLAY3 iface, DWORD dwFlags, DPID idGroup, LPDPLCONNECTION lpConnection )
{
IDirectPlay3Impl *This = (IDirectPlay3Impl *)iface;
- FIXME("(%p)->(0x%08lx,0x%08lx,%p): stub\n", This, dwFlags, idGroup, lpConnection );
+ FIXME("(%p)->(0x%08x,0x%08x,%p): stub\n", This, dwFlags, idGroup, lpConnection );
return DP_OK;
}
( LPDIRECTPLAY3A iface, DWORD dwFlags, DPID idGroup )
{
IDirectPlay3Impl *This = (IDirectPlay3Impl *)iface;
- FIXME("(%p)->(0x%08lx,0x%08lx): stub\n", This, dwFlags, idGroup );
+ FIXME("(%p)->(0x%08x,0x%08x): stub\n", This, dwFlags, idGroup );
return DP_OK;
}
( LPDIRECTPLAY3 iface, DWORD dwFlags, DPID idGroup )
{
IDirectPlay3Impl *This = (IDirectPlay3Impl *)iface;
- FIXME("(%p)->(0x%08lx,0x%08lx): stub\n", This, dwFlags, idGroup );
+ FIXME("(%p)->(0x%08x,0x%08x): stub\n", This, dwFlags, idGroup );
return DP_OK;
}
( LPDIRECTPLAY3A iface, DPID idGroup, LPDWORD lpdwFlags )
{
IDirectPlay3Impl *This = (IDirectPlay3Impl *)iface;
- FIXME("(%p)->(0x%08lx,%p): stub\n", This, idGroup, lpdwFlags );
+ FIXME("(%p)->(0x%08x,%p): stub\n", This, idGroup, lpdwFlags );
return DP_OK;
}
( LPDIRECTPLAY3 iface, DPID idGroup, LPDWORD lpdwFlags )
{
IDirectPlay3Impl *This = (IDirectPlay3Impl *)iface;
- FIXME("(%p)->(0x%08lx,%p): stub\n", This, idGroup, lpdwFlags );
+ FIXME("(%p)->(0x%08x,%p): stub\n", This, idGroup, lpdwFlags );
return DP_OK;
}
-static HRESULT WINAPI DP_IF_GetGroupParent
+static HRESULT DP_IF_GetGroupParent
( IDirectPlay3AImpl* This, DPID idGroup, LPDPID lpidGroup,
BOOL bAnsi )
{
lpGroupData lpGData;
- TRACE("(%p)->(0x%08lx,%p,%u)\n", This, idGroup, lpidGroup, bAnsi );
+ TRACE("(%p)->(0x%08x,%p,%u)\n", This, idGroup, lpidGroup, bAnsi );
if( ( lpGData = DP_FindAnyGroup( (IDirectPlay2AImpl*)This, idGroup ) ) == NULL )
{
( LPDIRECTPLAY3A iface, DPID idPlayer, DWORD dwFlags, LPVOID lpData, LPDWORD lpdwDataSize )
{
IDirectPlay3Impl *This = (IDirectPlay3Impl *)iface;
- FIXME("(%p)->(0x%08lx,0x%08lx,%p,%p): stub\n", This, idPlayer, dwFlags, lpData, lpdwDataSize );
+ FIXME("(%p)->(0x%08x,0x%08x,%p,%p): stub\n", This, idPlayer, dwFlags, lpData, lpdwDataSize );
return DP_OK;
}
( LPDIRECTPLAY3 iface, DPID idPlayer, DWORD dwFlags, LPVOID lpData, LPDWORD lpdwDataSize )
{
IDirectPlay3Impl *This = (IDirectPlay3Impl *)iface;
- FIXME("(%p)->(0x%08lx,0x%08lx,%p,%p): stub\n", This, idPlayer, dwFlags, lpData, lpdwDataSize );
+ FIXME("(%p)->(0x%08x,0x%08x,%p,%p): stub\n", This, idPlayer, dwFlags, lpData, lpdwDataSize );
return DP_OK;
}
( LPDIRECTPLAY3A iface, DPID idPlayer, LPDWORD lpdwFlags )
{
IDirectPlay3Impl *This = (IDirectPlay3Impl *)iface;
- FIXME("(%p)->(0x%08lx,%p): stub\n", This, idPlayer, lpdwFlags );
+ FIXME("(%p)->(0x%08x,%p): stub\n", This, idPlayer, lpdwFlags );
return DP_OK;
}
( LPDIRECTPLAY3 iface, DPID idPlayer, LPDWORD lpdwFlags )
{
IDirectPlay3Impl *This = (IDirectPlay3Impl *)iface;
- FIXME("(%p)->(0x%08lx,%p): stub\n", This, idPlayer, lpdwFlags );
+ FIXME("(%p)->(0x%08x,%p): stub\n", This, idPlayer, lpdwFlags );
return DP_OK;
}
( LPDIRECTPLAY4A iface, DPID idGroup, LPDPID lpidGroupOwner )
{
IDirectPlay4Impl *This = (IDirectPlay4Impl *)iface;
- FIXME("(%p)->(0x%08lx,%p): stub\n", This, idGroup, lpidGroupOwner );
+ FIXME("(%p)->(0x%08x,%p): stub\n", This, idGroup, lpidGroupOwner );
return DP_OK;
}
( LPDIRECTPLAY4 iface, DPID idGroup, LPDPID lpidGroupOwner )
{
IDirectPlay4Impl *This = (IDirectPlay4Impl *)iface;
- FIXME("(%p)->(0x%08lx,%p): stub\n", This, idGroup, lpidGroupOwner );
+ FIXME("(%p)->(0x%08x,%p): stub\n", This, idGroup, lpidGroupOwner );
return DP_OK;
}
( LPDIRECTPLAY4A iface, DPID idGroup , DPID idGroupOwner )
{
IDirectPlay4Impl *This = (IDirectPlay4Impl *)iface;
- FIXME("(%p)->(0x%08lx,0x%08lx): stub\n", This, idGroup, idGroupOwner );
+ FIXME("(%p)->(0x%08x,0x%08x): stub\n", This, idGroup, idGroupOwner );
return DP_OK;
}
( LPDIRECTPLAY4 iface, DPID idGroup , DPID idGroupOwner )
{
IDirectPlay4Impl *This = (IDirectPlay4Impl *)iface;
- FIXME("(%p)->(0x%08lx,0x%08lx): stub\n", This, idGroup, idGroupOwner );
+ FIXME("(%p)->(0x%08x,0x%08x): stub\n", This, idGroup, idGroupOwner );
return DP_OK;
}
-static HRESULT WINAPI DP_SendEx
+static HRESULT DP_SendEx
( IDirectPlay2Impl* This, DPID idFrom, DPID idTo, DWORD dwFlags,
LPVOID lpData, DWORD dwDataSize, DWORD dwPriority, DWORD dwTimeout,
LPVOID lpContext, LPDWORD lpdwMsgID, BOOL bAnsi )
{
- lpPlayerList lpPList;
- lpGroupData lpGData;
BOOL bValidDestination = FALSE;
- FIXME( "(%p)->(0x%08lx,0x%08lx,0x%08lx,%p,0x%08lx,0x%08lx,0x%08lx,%p,%p,%u)"
+ FIXME( "(%p)->(0x%08x,0x%08x,0x%08x,%p,0x%08x,0x%08x,0x%08x,%p,%p,%u)"
": stub\n",
This, idFrom, idTo, dwFlags, lpData, dwDataSize, dwPriority,
dwTimeout, lpContext, lpdwMsgID, bAnsi );
+ if( This->dp2->connectionInitialized == NO_PROVIDER )
+ {
+ return DPERR_UNINITIALIZED;
+ }
+
/* FIXME: Add parameter checking */
- /* FIXME: First call to this needs to aquire a message id which will be
+ /* FIXME: First call to this needs to acquire a message id which will be
* used for multiple sends
*/
*/
if( idFrom != DPID_UNKNOWN )
{
- if( ( lpPList = DP_FindPlayer( This, idFrom ) ) == NULL )
+ if( DP_FindPlayer( This, idFrom ) == NULL )
{
- WARN( "INFO: Invalid from player 0x%08lx\n", idFrom );
+ WARN( "INFO: Invalid from player 0x%08x\n", idFrom );
return DPERR_INVALIDPLAYER;
}
}
( DP_FindPlayer( This, idTo ) != NULL )
)
{
- bValidDestination = TRUE;
-
/* Have the service provider send this message */
/* FIXME: Could optimize for local interface sends */
return DP_SP_SendEx( This, dwFlags, lpData, dwDataSize, dwPriority,
}
if( ( !bValidDestination ) &&
- ( ( lpGData = DP_FindAnyGroup( This, idTo ) ) != NULL )
+ ( DP_FindAnyGroup( This, idTo ) != NULL )
)
{
bValidDestination = TRUE;
dwPriority, dwTimeout, lpContext, lpdwMsgID, FALSE );
}
-static HRESULT WINAPI DP_SP_SendEx
+static HRESULT DP_SP_SendEx
( IDirectPlay2Impl* This, DWORD dwFlags,
LPVOID lpData, DWORD dwDataSize, DWORD dwPriority, DWORD dwTimeout,
LPVOID lpContext, LPDWORD lpdwMsgID )
return DP_OK;
}
-static HRESULT WINAPI DP_IF_GetMessageQueue
+static HRESULT DP_IF_GetMessageQueue
( IDirectPlay4Impl* This, DPID idFrom, DPID idTo, DWORD dwFlags,
LPDWORD lpdwNumMsgs, LPDWORD lpdwNumBytes, BOOL bAnsi )
{
HRESULT hr = DP_OK;
- FIXME( "(%p)->(0x%08lx,0x%08lx,0x%08lx,%p,%p,%u): semi stub\n",
+ FIXME( "(%p)->(0x%08x,0x%08x,0x%08x,%p,%p,%u): semi stub\n",
This, idFrom, idTo, dwFlags, lpdwNumMsgs, lpdwNumBytes, bAnsi );
/* FIXME: Do we need to do idFrom and idTo sanity checking here? */
lpdwNumBytes, FALSE );
}
-static HRESULT WINAPI DP_IF_CancelMessage
+static HRESULT DP_IF_CancelMessage
( IDirectPlay4Impl* This, DWORD dwMsgID, DWORD dwFlags,
DWORD dwMinPriority, DWORD dwMaxPriority, BOOL bAnsi )
{
HRESULT hr = DP_OK;
- FIXME( "(%p)->(0x%08lx,0x%08lx,%u): semi stub\n",
+ FIXME( "(%p)->(0x%08x,0x%08x,%u): semi stub\n",
This, dwMsgID, dwFlags, bAnsi );
if( This->dp2->spData.lpCB->Cancel )
};
#undef XCAST
-extern
HRESULT DP_GetSPPlayerData( IDirectPlay2Impl* lpDP,
DPID idPlayer,
LPVOID* lplpData )
return DP_OK;
}
-extern
HRESULT DP_SetSPPlayerData( IDirectPlay2Impl* lpDP,
DPID idPlayer,
LPVOID lpData )
'S', 'e', 'r', 'v', 'i', 'c', 'e', ' ', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 's', 0 };
static const WCHAR guidKey[] = { 'G', 'u', 'i', 'd', 0 };
static const WCHAR descW[] = { 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'i', 'o', 'n', 'W', 0 };
-
+
DWORD dwIndex;
FILETIME filetime;
DWORD max_sizeOfDescriptionA = 0;
WCHAR *descriptionW = NULL;
DWORD max_sizeOfDescriptionW = 0;
-
+
if (!lpEnumCallbackA && !lpEnumCallbackW)
{
return DPERR_INVALIDPARAMS;
}
-
+
/* Need to loop over the service providers in the registry */
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, searchSubKey,
0, KEY_READ, &hkResult) != ERROR_SUCCESS)
ERR(": no service provider key in the registry - check your Wine installation !!!\n");
return DPERR_GENERIC;
}
-
+
/* Traverse all the service providers we have available */
dwIndex = 0;
while (1)
WCHAR guidKeyContent[(2 * 16) + 1 + 6 /* This corresponds to '{....-..-..-..-......}' */ ];
DWORD sizeOfGuidKeyContent = sizeof(guidKeyContent);
LONG ret_value;
-
+
ret_value = RegEnumKeyExW(hkResult, dwIndex, subKeyName, &sizeOfSubKeyName,
NULL, NULL, NULL, &filetime);
if (ret_value == ERROR_NO_MORE_ITEMS)
return DPERR_EXCEPTION;
}
TRACE(" this time through sub-key %s.\n", debugstr_w(subKeyName));
-
+
/* Open the key for this service provider */
if (RegOpenKeyExW(hkResult, subKeyName, 0, KEY_READ, &hkServiceProvider) != ERROR_SUCCESS)
{
ERR(": could not open registry key for service provider %s.\n", debugstr_w(subKeyName));
continue;
}
-
+
/* Get the GUID from the registry */
if (RegQueryValueExW(hkServiceProvider, guidKey,
NULL, NULL, (LPBYTE) guidKeyContent, &sizeOfGuidKeyContent) != ERROR_SUCCESS)
continue;
}
CLSIDFromString(guidKeyContent, &serviceProviderGUID );
-
+
/* The enumeration will return FALSE if we are not to continue.
*
* Note: on my windows box, major / minor version is 6 / 0 for all service providers
- * and have no relations to any of the two dwReserved1 and dwReserved2 keys.
+ * and have no relation to any of the two dwReserved1 and dwReserved2 keys.
* I think that it simply means that they are in-line with DirectX 6.0
*/
if (lpEnumCallbackA)
{
DWORD sizeOfDescription = 0;
-
- /* Note that this the the A case of this function, so use the A variant to get the description string */
+
+ /* Note that this is the A case of this function, so use the A variant to get the description string */
if (RegQueryValueExA(hkServiceProvider, "DescriptionA",
NULL, NULL, NULL, &sizeOfDescription) != ERROR_SUCCESS)
{
{
HeapFree(GetProcessHeap(), 0, descriptionA);
max_sizeOfDescriptionA = sizeOfDescription;
- descriptionA = HeapAlloc(GetProcessHeap(), 0, max_sizeOfDescriptionA);
}
descriptionA = HeapAlloc(GetProcessHeap(), 0, sizeOfDescription);
RegQueryValueExA(hkServiceProvider, "DescriptionA",
NULL, NULL, (LPBYTE) descriptionA, &sizeOfDescription);
-
+
if (!lpEnumCallbackA(&serviceProviderGUID, descriptionA, 6, 0, lpContext))
goto end;
}
else
{
DWORD sizeOfDescription = 0;
-
+
if (RegQueryValueExW(hkServiceProvider, descW,
NULL, NULL, NULL, &sizeOfDescription) != ERROR_SUCCESS)
{
{
HeapFree(GetProcessHeap(), 0, descriptionW);
max_sizeOfDescriptionW = sizeOfDescription;
- descriptionW = HeapAlloc(GetProcessHeap(), 0, max_sizeOfDescriptionW);
}
descriptionW = HeapAlloc(GetProcessHeap(), 0, sizeOfDescription);
RegQueryValueExW(hkServiceProvider, descW,
if (!lpEnumCallbackW(&serviceProviderGUID, descriptionW, 6, 0, lpContext))
goto end;
}
-
+
dwIndex++;
}
end:
HeapFree(GetProcessHeap(), 0, descriptionA);
HeapFree(GetProcessHeap(), 0, descriptionW);
-
+
return DP_OK;
}
HRESULT WINAPI DirectPlayEnumerateA(LPDPENUMDPCALLBACKA lpEnumCallback, LPVOID lpContext )
{
TRACE("(%p,%p)\n", lpEnumCallback, lpContext);
-
+
return DirectPlayEnumerateAW(lpEnumCallback, NULL, lpContext);
}
HRESULT WINAPI DirectPlayEnumerateW(LPDPENUMDPCALLBACKW lpEnumCallback, LPVOID lpContext )
{
TRACE("(%p,%p)\n", lpEnumCallback, lpContext);
-
+
return DirectPlayEnumerateAW(NULL, lpEnumCallback, lpContext);
}
*
*/
HRESULT WINAPI DirectPlayCreate
-( LPGUID lpGUID, LPDIRECTPLAY2 *lplpDP, IUnknown *pUnk)
+( LPGUID lpGUID, LPDIRECTPLAY *lplpDP, IUnknown *pUnk )
{
HRESULT hr;
LPDIRECTPLAY3A lpDP3A;
return CLASS_E_NOAGGREGATION;
}
+ if( (lplpDP == NULL) || (lpGUID == NULL) )
+ {
+ return DPERR_INVALIDPARAMS;
+ }
+
+
/* Create an IDirectPlay object. We don't support that so we'll cheat and
give them an IDirectPlay2A object and hope that doesn't cause problems */
if( DP_CreateInterface( &IID_IDirectPlay2A, (LPVOID*)lplpDP ) != DP_OK )
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WINE_DPLAY_GLOBAL_INCLUDED
#define __WINE_DPLAY_GLOBAL_INCLUDED
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+
//#include <stdarg.h>
//#include "windef.h"
extern HRESULT DPL_EnumAddress( LPDPENUMADDRESSCALLBACK lpEnumAddressCallback,
LPCVOID lpAddress, DWORD dwAddressSize,
- LPVOID lpContext );
-
-extern DWORD DP_CalcSessionDescSize( LPCDPSESSIONDESC2 lpSessDesc, BOOL bAnsi );
+ LPVOID lpContext ) DECLSPEC_HIDDEN;
/*****************************************************************************
* Predeclare the interface implementation structures
typedef struct tagDP_MSG_REPLY_STRUCT_LIST
{
- DPQ_ENTRY(tagDP_MSG_REPLY_STRUCT_LIST) replysExpected;
+ DPQ_ENTRY(tagDP_MSG_REPLY_STRUCT_LIST) repliesExpected;
DP_MSG_REPLY_STRUCT replyExpected;
} DP_MSG_REPLY_STRUCT_LIST, *LPDP_MSG_REPLY_STRUCT_LIST;
/* For async EnumSessions requests */
HANDLE hEnumSessionThread;
HANDLE hKillEnumSessionThreadEvent;
+ DWORD dwEnumSessionLock;
LPVOID lpNameServerData; /* DPlay interface doesn't know contents */
enum SPSTATE connectionInitialized;
/* Expected messages queue */
- DPQ_HEAD( tagDP_MSG_REPLY_STRUCT_LIST ) replysExpected;
+ DPQ_HEAD( tagDP_MSG_REPLY_STRUCT_LIST ) repliesExpected;
} DirectPlay2Data;
typedef struct tagDirectPlay3Data
HRESULT DP_HandleMessage( IDirectPlay2Impl* This, LPCVOID lpMessageBody,
DWORD dwMessageBodySize, LPCVOID lpMessageHeader,
WORD wCommandId, WORD wVersion,
- LPVOID* lplpReply, LPDWORD lpdwMsgSize );
+ LPVOID* lplpReply, LPDWORD lpdwMsgSize ) DECLSPEC_HIDDEN;
/* DP SP external interfaces into DirectPlay */
-extern HRESULT DP_GetSPPlayerData( IDirectPlay2Impl* lpDP, DPID idPlayer, LPVOID* lplpData );
-extern HRESULT DP_SetSPPlayerData( IDirectPlay2Impl* lpDP, DPID idPlayer, LPVOID lpData );
+extern HRESULT DP_GetSPPlayerData( IDirectPlay2Impl* lpDP, DPID idPlayer, LPVOID* lplpData ) DECLSPEC_HIDDEN;
+extern HRESULT DP_SetSPPlayerData( IDirectPlay2Impl* lpDP, DPID idPlayer, LPVOID lpData ) DECLSPEC_HIDDEN;
/* DP external interfaces to call into DPSP interface */
-extern LPVOID DPSP_CreateSPPlayerData(void);
+extern LPVOID DPSP_CreateSPPlayerData(void) DECLSPEC_HIDDEN;
#endif /* __WINE_DPLAY_GLOBAL_INCLUDED */
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
//#include <string.h>
} DP_SPPLAYERDATA, *LPDP_SPPLAYERDATA;
/* Create the SP interface */
-extern
HRESULT DPSP_CreateInterface( REFIID riid, LPVOID* ppvObj, IDirectPlay2Impl* dp )
{
TRACE( " for %s\n", debugstr_guid( riid ) );
if( IsEqualGUID( &IID_IDirectPlaySP, riid ) )
{
- IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)*ppvObj;
+ IDirectPlaySPImpl *This = *ppvObj;
This->lpVtbl = &directPlaySPVT;
}
else
static BOOL DPSP_CreateIUnknown( LPVOID lpSP )
{
- IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)lpSP;
+ IDirectPlaySPImpl *This = lpSP;
This->unk = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->unk) ) );
}
InitializeCriticalSection( &This->unk->DPSP_lock );
+ This->unk->DPSP_lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": IDirectPlaySPImpl*->DirectPlaySPIUnknownData*->DPSP_lock");
return TRUE;
}
static BOOL DPSP_DestroyIUnknown( LPVOID lpSP )
{
- IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)lpSP;
+ IDirectPlaySPImpl *This = lpSP;
+ This->unk->DPSP_lock.DebugInfo->Spare[0] = 0;
DeleteCriticalSection( &This->unk->DPSP_lock );
HeapFree( GetProcessHeap(), 0, This->unk );
static BOOL DPSP_CreateDirectPlaySP( LPVOID lpSP, IDirectPlay2Impl* dp )
{
- IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)lpSP;
+ IDirectPlaySPImpl *This = lpSP;
This->sp = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->sp) ) );
static BOOL DPSP_DestroyDirectPlaySP( LPVOID lpSP )
{
- IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)lpSP;
+ IDirectPlaySPImpl *This = lpSP;
/* Normally we should be keeping a reference, but since only the dplay
* interface that created us can destroy us, we do not keep a reference
if( IsEqualGUID( &IID_IDirectPlaySP, riid ) )
{
- IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)*ppvObj;
+ IDirectPlaySPImpl *This = *ppvObj;
This->lpVtbl = &directPlaySPVT;
}
else
ulObjRefCount = InterlockedIncrement( &This->unk->ulObjRef );
ulInterfaceRefCount = InterlockedIncrement( &This->ulInterfaceRef );
- TRACE( "ref count incremented to %lu:%lu for %p\n",
+ TRACE( "ref count incremented to %u:%u for %p\n",
ulInterfaceRefCount, ulObjRefCount, This );
return ulObjRefCount;
ulObjRefCount = InterlockedDecrement( &This->unk->ulObjRef );
ulInterfaceRefCount = InterlockedDecrement( &This->ulInterfaceRef );
- TRACE( "ref count decremented to %lu:%lu for %p\n",
+ TRACE( "ref count decremented to %u:%u for %p\n",
ulInterfaceRefCount, ulObjRefCount, This );
/* Deallocate if this is the last reference to the object */
/* Should be able to call the comctl32 undocumented MRU routines.
I suspect that the interface works appropriately */
- FIXME( "(%p)->(%p,%p%p,0x%08lx,0x%08lx): stub\n",
+ FIXME( "(%p)->(%p,%p%p,0x%08x,0x%08x): stub\n",
This, lpSection, lpKey, lpData, dwDataSize, dwMaxEntries );
return DP_OK;
{
IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
- FIXME( "(%p)->(%s,%s,%p,0x%08lx,%p,%p): stub\n",
+ FIXME( "(%p)->(%s,%s,%p,0x%08x,%p,%p): stub\n",
This, debugstr_guid(guidSP), debugstr_guid(guidDataType),
lpData, dwDataSize, lpAddress, lpdwAddressSize );
{
IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
- TRACE( "(%p)->(%p,%p,0x%08lx,%p)\n",
+ TRACE( "(%p)->(%p,%p,0x%08x,%p)\n",
This, lpEnumAddressCallback, lpAddress, dwAddressSize, lpContext );
DPL_EnumAddress( lpEnumAddressCallback, lpAddress, dwAddressSize, lpContext );
{
IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
- FIXME( "(%p)->(0x%08lx,%p): stub\n",
+ FIXME( "(%p)->(0x%08x,%p): stub\n",
This, idPlayer, lpdwPlayerFlags );
return DP_OK;
LPDP_SPPLAYERDATA lpPlayerData;
IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
- TRACE( "(%p)->(0x%08lx,%p,%p,0x%08lx)\n",
+ TRACE( "(%p)->(0x%08x,%p,%p,0x%08x)\n",
This, idPlayer, lplpData, lpdwDataSize, dwFlags );
hr = DP_GetSPPlayerData( This->sp->dplay, idPlayer, (LPVOID*)&lpPlayerData );
LPVOID lpMessageHeader
)
{
- LPDPMSG_SENDENVELOPE lpMsg = (LPDPMSG_SENDENVELOPE)lpMessageBody;
+ LPDPMSG_SENDENVELOPE lpMsg = lpMessageBody;
HRESULT hr = DPERR_GENERIC;
WORD wCommandId;
WORD wVersion;
IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
- FIXME( "(%p)->(%p,0x%08lx,%p): mostly stub\n",
+ FIXME( "(%p)->(%p,0x%08x,%p): mostly stub\n",
This, lpMessageBody, dwMessageBodySize, lpMessageHeader );
wCommandId = lpMsg->wCommandId;
wVersion = lpMsg->wVersion;
- TRACE( "Incoming message has envelope of 0x%08lx, %u, %u\n",
+ TRACE( "Incoming message has envelope of 0x%08x, %u, %u\n",
lpMsg->dwMagic, wCommandId, wVersion );
if( lpMsg->dwMagic != DPMSGMAGIC_DPLAYMSG )
{
- ERR( "Unknown magic 0x%08lx!\n", lpMsg->dwMagic );
+ ERR( "Unknown magic 0x%08x!\n", lpMsg->dwMagic );
return DPERR_GENERIC;
}
#if 0
{
- const LPDWORD lpcHeader = (LPDWORD)lpMessageHeader;
+ const LPDWORD lpcHeader = lpMessageHeader;
TRACE( "lpMessageHeader = [0x%08lx] [0x%08lx] [0x%08lx] [0x%08lx] [0x%08lx]\n",
lpcHeader[0], lpcHeader[1], lpcHeader[2], lpcHeader[3], lpcHeader[4] );
#if 0
HRESULT hr = DP_OK;
HANDLE hReceiveEvent = 0;
- /* FIXME: Aquire some sort of interface lock */
+ /* FIXME: Acquire some sort of interface lock */
/* FIXME: Need some sort of context for this callback. Need to determine
* how this is actually done with the SP
*/
{
case DPSYS_CREATEPLAYERORGROUP:
{
- LPDPMSG_CREATEPLAYERORGROUP msg = (LPDPMSG_CREATEPLAYERORGROUP)lpMsg;
+ LPDPMSG_CREATEPLAYERORGROUP msg = lpMsg;
if( msg->dwPlayerType == DPPLAYERTYPE_PLAYER )
{
case DPSYS_DESTROYPLAYERORGROUP:
{
- LPDPMSG_DESTROYPLAYERORGROUP msg = (LPDPMSG_DESTROYPLAYERORGROUP)lpMsg;
+ LPDPMSG_DESTROYPLAYERORGROUP msg = lpMsg;
if( msg->dwPlayerType == DPPLAYERTYPE_PLAYER )
{
case DPSYS_ADDPLAYERTOGROUP:
{
- LPDPMSG_ADDPLAYERTOGROUP msg = (LPDPMSG_ADDPLAYERTOGROUP)lpMsg;
+ LPDPMSG_ADDPLAYERTOGROUP msg = lpMsg;
hr = DP_IF_AddPlayerToGroup( This, msg->dpIdGroup, msg->dpIdPlayer, ... );
break;
case DPSYS_DELETEPLAYERFROMGROUP:
{
- LPDPMSG_DELETEPLAYERFROMGROUP msg = (LPDPMSG_DELETEPLAYERFROMGROUP)lpMsg;
+ LPDPMSG_DELETEPLAYERFROMGROUP msg = lpMsg;
hr = DP_IF_DeletePlayerFromGroup( This, msg->dpIdGroup, msg->dpIdPlayer,
... );
case DPSYS_SESSIONLOST:
{
- LPDPMSG_SESSIONLOST msg = (LPDPMSG_SESSIONLOST)lpMsg;
+ LPDPMSG_SESSIONLOST msg = lpMsg;
FIXME( "DPSYS_SESSIONLOST not handled\n" );
case DPSYS_HOST:
{
- LPDPMSG_HOST msg = (LPDPMSG_HOST)lpMsg;
+ LPDPMSG_HOST msg = lpMsg;
FIXME( "DPSYS_HOST not handled\n" );
case DPSYS_SETPLAYERORGROUPDATA:
{
- LPDPMSG_SETPLAYERORGROUPDATA msg = (LPDPMSG_SETPLAYERORGROUPDATA)lpMsg;
+ LPDPMSG_SETPLAYERORGROUPDATA msg = lpMsg;
if( msg->dwPlayerType == DPPLAYERTYPE_PLAYER )
{
case DPSYS_SETPLAYERORGROUPNAME:
{
- LPDPMSG_SETPLAYERORGROUPNAME msg = (LPDPMSG_SETPLAYERORGROUPNAME)lpMsg;
+ LPDPMSG_SETPLAYERORGROUPNAME msg = lpMsg;
if( msg->dwPlayerType == DPPLAYERTYPE_PLAYER )
{
case DPSYS_SETSESSIONDESC;
{
- LPDPMSG_SETSESSIONDESC msg = (LPDPMSG_SETSESSIONDESC)lpMsg;
+ LPDPMSG_SETSESSIONDESC msg = lpMsg;
hr = DP_IF_SetSessionDesc( This, &msg->dpDesc );
case DPSYS_ADDGROUPTOGROUP:
{
- LPDPMSG_ADDGROUPTOGROUP msg = (LPDPMSG_ADDGROUPTOGROUP)lpMsg;
+ LPDPMSG_ADDGROUPTOGROUP msg = lpMsg;
hr = DP_IF_AddGroupToGroup( This, msg->dpIdParentGroup, msg->dpIdGroup,
... );
case DPSYS_DELETEGROUPFROMGROUP:
{
- LPDPMSG_DELETEGROUPFROMGROUP msg = (LPDPMSG_DELETEGROUPFROMGROUP)lpMsg;
+ LPDPMSG_DELETEGROUPFROMGROUP msg = lpMsg;
hr = DP_IF_DeleteGroupFromGroup( This, msg->dpIdParentGroup,
msg->dpIdGroup, ... );
case DPSYS_SECUREMESSAGE:
{
- LPDPMSG_SECUREMESSAGE msg = (LPDPMSG_SECUREMESSAGE)lpMsg;
+ LPDPMSG_SECUREMESSAGE msg = lpMsg;
FIXME( "DPSYS_SECUREMESSAGE not implemented\n" );
case DPSYS_STARTSESSION:
{
- LPDPMSG_STARTSESSION msg = (LPDPMSG_STARTSESSION)lpMsg;
+ LPDPMSG_STARTSESSION msg = lpMsg;
FIXME( "DPSYS_STARTSESSION not implemented\n" );
case DPSYS_CHAT:
{
- LPDPMSG_CHAT msg = (LPDPMSG_CHAT)lpMsg;
+ LPDPMSG_CHAT msg = lpMsg;
FIXME( "DPSYS_CHAT not implemeneted\n" );
case DPSYS_SETGROUPOWNER:
{
- LPDPMSG_SETGROUPOWNER msg = (LPDPMSG_SETGROUPOWNER)lpMsg;
+ LPDPMSG_SETGROUPOWNER msg = lpMsg;
FIXME( "DPSYS_SETGROUPOWNER not implemented\n" );
case DPSYS_SENDCOMPLETE:
{
- LPDPMSG_SENDCOMPLETE msg = (LPDPMSG_SENDCOMPLETE)lpMsg;
+ LPDPMSG_SENDCOMPLETE msg = lpMsg;
FIXME( "DPSYS_SENDCOMPLETE not implemented\n" );
IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
/* TRACE( "Called on process 0x%08lx\n", GetCurrentProcessId() ); */
- TRACE( "(%p)->(0x%08lx,%p,0x%08lx,0x%08lx)\n",
+ TRACE( "(%p)->(0x%08x,%p,0x%08x,0x%08x)\n",
This, idPlayer, lpData, dwDataSize, dwFlags );
hr = DP_GetSPPlayerData( This->sp->dplay, idPlayer, (LPVOID*)&lpPlayerEntry );
{
IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
- FIXME( "(%p)->(%p,0x%08lx,%p,%p): stub\n",
+ FIXME( "(%p)->(%p,0x%08x,%p,%p): stub\n",
This, lpElements, dwElementCount, lpAddress, lpdwAddressSize );
return DP_OK;
IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
/* TRACE( "Called on process 0x%08lx\n", GetCurrentProcessId() ); */
- TRACE( "(%p)->(%p,%p,0x%08lx)\n",
+ TRACE( "(%p)->(%p,%p,0x%08x)\n",
This, lplpData, lpdwDataSize, dwFlags );
#if 0
*/
if( dwFlags != DPSET_REMOTE )
{
- TRACE( "Undocumented dwFlags 0x%08lx used\n", dwFlags );
+ TRACE( "Undocumented dwFlags 0x%08x used\n", dwFlags );
}
#endif
IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
/* TRACE( "Called on process 0x%08lx\n", GetCurrentProcessId() ); */
- TRACE( "(%p)->(%p,0x%08lx,0x%08lx)\n",
+ TRACE( "(%p)->(%p,0x%08x,0x%08x)\n",
This, lpData, dwDataSize, dwFlags );
#if 0
*/
if( dwFlags != DPSET_REMOTE )
{
- TRACE( "Undocumented dwFlags 0x%08lx used\n", dwFlags );
+ TRACE( "Undocumented dwFlags 0x%08x used\n", dwFlags );
}
#endif
{
IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
- FIXME( "(%p)->(%p,0x%08lx): stub\n",
+ FIXME( "(%p)->(%p,0x%08x): stub\n",
This, unknownA, unknownB );
}
/* DP external interfaces to call into DPSP interface */
/* Allocate the structure */
-extern LPVOID DPSP_CreateSPPlayerData(void)
+LPVOID DPSP_CreateSPPlayerData(void)
{
TRACE( "Creating SPPlayer data struct\n" );
return HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
--- /dev/null
+/*
+ * COM Classes for dplayx
+ *
+ * Copyright 2010 Alexandre Julliard
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+[
+ helpstring("DirectPlay Object"),
+ threading(both),
+ uuid(d1eb6d20-8923-11d0-9d97-00a0c90a43cb)
+]
+coclass DirectPlay { interface IDirectPlay; }
+
+[
+ helpstring("DirectPlayLobby Object"),
+ threading(both),
+ uuid(2fe8f810-b2a5-11d0-a787-0000f803abfc)
+]
+coclass DirectPlayLobby { interface IDirectPlayLobby; }
--- /dev/null
+HKCR
+{
+ NoRemove Interface
+ {
+ }
+ NoRemove CLSID
+ {
+ '{D1EB6D20-8923-11D0-9D97-00A0C90A43CB}' = s 'DirectPlay Object'
+ {
+ InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' }
+ }
+ '{2FE8F810-B2A5-11D0-A787-0000F803ABFC}' = s 'DirectPlayLobby Object'
+ {
+ InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' }
+ }
+ }
+}
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
*
- * NOTES:
+ * NOTES:
* o Implementation of all things which are associated with dplay on
- * the computer - ie shared resources and such. Methods in this
- * compilation unit should not call anything out side this unit
- * excepting base windows services and an interface to start the
+ * the computer - i.e. shared resources and such. Methods in this
+ * compilation unit should not call anything outside of this unit
+ * except base windows services and an interface to start the
* messaging thread.
* o Methods that begin with DPLAYX_ are used for dealing with
* dplayx.dll data which is accessible from all processes.
/* FIXME: Need to do all that fun other dll referencing type of stuff */
/* Static data for all processes */
-static LPCSTR lpszDplayxSemaName = "WINE_DPLAYX_SM";
+static const char lpszDplayxSemaName[] = "WINE_DPLAYX_SM";
static HANDLE hDplayxSema;
-static LPCSTR lpszDplayxFileMapping = "WINE_DPLAYX_FM";
+static const char lpszDplayxFileMapping[] = "WINE_DPLAYX_FM";
static HANDLE hDplayxSharedMem;
static LPVOID lpSharedStaticData = NULL;
-#define DPLAYX_AquireSemaphore() TRACE( "Waiting for DPLAYX semaphore\n" ); \
+#define DPLAYX_AcquireSemaphore() TRACE( "Waiting for DPLAYX semaphore\n" ); \
WaitForSingleObject( hDplayxSema, INFINITE );\
TRACE( "Through wait\n" )
static DPLAYX_MEM_SLICE* lpMemArea;
-void DPLAYX_PrivHeapFree( LPVOID addr );
-void DPLAYX_PrivHeapFree( LPVOID addr )
+static void DPLAYX_PrivHeapFree( LPVOID addr )
{
LPVOID lpAddrStart;
DWORD dwBlockUsed;
lpMemArea[ dwBlockUsed ].used = 0;
}
-/* FIXME: This should be static, but is being used for a hack right now */
-LPVOID DPLAYX_PrivHeapAlloc( DWORD flags, DWORD size );
-LPVOID DPLAYX_PrivHeapAlloc( DWORD flags, DWORD size )
+static LPVOID DPLAYX_PrivHeapAlloc( DWORD flags, DWORD size )
{
LPVOID lpvArea = NULL;
UINT uBlockUsed;
if( size > (dwBlockSize - sizeof(DWORD)) )
{
- FIXME( "Size exceeded. Request of 0x%08lx\n", size );
+ FIXME( "Size exceeded. Request of 0x%08x\n", size );
size = dwBlockSize - sizeof(DWORD);
}
{
/* Set the area used */
lpMemArea[ uBlockUsed ].used = 1;
- lpvArea = &(lpMemArea[ uBlockUsed ].data);
+ lpvArea = lpMemArea[ uBlockUsed ].data;
}
else
{
return lpvArea;
}
-LPSTR DPLAYX_strdupA( DWORD flags, LPCSTR str );
-LPSTR DPLAYX_strdupA( DWORD flags, LPCSTR str )
-{
- LPSTR p = DPLAYX_PrivHeapAlloc( flags, strlen(str) + 1 );
- if(p) {
- strcpy( p, str );
- }
- return p;
-}
-
-LPWSTR DPLAYX_strdupW( DWORD flags, LPCWSTR str );
-LPWSTR DPLAYX_strdupW( DWORD flags, LPCWSTR str )
-{
- INT len = strlenW(str) + 1;
- LPWSTR p = DPLAYX_PrivHeapAlloc( flags, len * sizeof(WCHAR) );
- if(p) {
- strcpyW( p, str );
- }
- return p;
-}
-
enum { numSupportedLobbies = 32, numSupportedSessions = 32 };
typedef struct tagDPLAYX_LOBBYDATA
static DPSESSIONDESC2* sessionData = NULL;
/* static DPSESSIONDESC2* sessionData[ numSupportedSessions ]; */
-/* Function prototypes */
-DWORD DPLAYX_SizeOfLobbyDataA( LPDPLCONNECTION lpDplData );
-DWORD DPLAYX_SizeOfLobbyDataW( LPDPLCONNECTION lpDplData );
-void DPLAYX_CopyConnStructA( LPDPLCONNECTION dest, LPDPLCONNECTION src );
-void DPLAYX_CopyConnStructW( LPDPLCONNECTION dest, LPDPLCONNECTION src );
-BOOL DPLAYX_IsAppIdLobbied( DWORD dwAppId, LPDPLAYX_LOBBYDATA* dplData );
-void DPLAYX_InitializeLobbyDataEntry( LPDPLAYX_LOBBYDATA lpData );
-BOOL DPLAYX_CopyIntoSessionDesc2A( LPDPSESSIONDESC2 lpSessionDest,
- LPCDPSESSIONDESC2 lpSessionSrc );
+static void DPLAYX_InitializeLobbyDataEntry( LPDPLAYX_LOBBYDATA lpData )
+{
+ ZeroMemory( lpData, sizeof( *lpData ) );
+}
+
+/* NOTE: This must be called with the semaphore acquired.
+ * TRUE/FALSE with a pointer to it's data returned. Pointer data is
+ * is only valid if TRUE is returned.
+ */
+static BOOL DPLAYX_IsAppIdLobbied( DWORD dwAppID, LPDPLAYX_LOBBYDATA* lplpDplData )
+{
+ UINT i;
+
+ *lplpDplData = NULL;
+
+ if( dwAppID == 0 )
+ {
+ dwAppID = GetCurrentProcessId();
+ TRACE( "Translated dwAppID == 0 into 0x%08x\n", dwAppID );
+ }
+
+ for( i=0; i < numSupportedLobbies; i++ )
+ {
+ if( lobbyData[ i ].dwAppID == dwAppID )
+ {
+ /* This process is lobbied */
+ TRACE( "Found 0x%08x @ %u\n", dwAppID, i );
+ *lplpDplData = &lobbyData[ i ];
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+/* Reserve a spot for the new application. TRUE means success and FALSE failure. */
+BOOL DPLAYX_CreateLobbyApplication( DWORD dwAppID )
+{
+ UINT i;
+
+ /* 0 is the marker for unused application data slots */
+ if( dwAppID == 0 )
+ {
+ return FALSE;
+ }
+
+ DPLAYX_AcquireSemaphore();
+
+ /* Find an empty space in the list and insert the data */
+ for( i=0; i < numSupportedLobbies; i++ )
+ {
+ if( lobbyData[ i ].dwAppID == 0 )
+ {
+ /* This process is now lobbied */
+ TRACE( "Setting lobbyData[%u] for (0x%08x,0x%08x)\n",
+ i, dwAppID, GetCurrentProcessId() );
+
+ lobbyData[ i ].dwAppID = dwAppID;
+ lobbyData[ i ].dwAppLaunchedFromID = GetCurrentProcessId();
+
+ /* FIXME: Where is the best place for this? In interface or here? */
+ lobbyData[ i ].hInformOnAppStart = 0;
+ lobbyData[ i ].hInformOnAppDeath = 0;
+ lobbyData[ i ].hInformOnSettingRead = 0;
+
+ DPLAYX_ReleaseSemaphore();
+ return TRUE;
+ }
+ }
+
+ ERR( "No empty lobbies\n" );
+
+ DPLAYX_ReleaseSemaphore();
+ return FALSE;
+}
+
+BOOL DPLAYX_SetLobbyHandles( DWORD dwAppID,
+ HANDLE hStart, HANDLE hDeath, HANDLE hConnRead )
+{
+ LPDPLAYX_LOBBYDATA lpLData;
+
+ /* Need to explicitly give lobby application. Can't set for yourself */
+ if( dwAppID == 0 )
+ {
+ return FALSE;
+ }
+
+ DPLAYX_AcquireSemaphore();
+
+ if( !DPLAYX_IsAppIdLobbied( dwAppID, &lpLData ) )
+ {
+ DPLAYX_ReleaseSemaphore();
+ return FALSE;
+ }
+
+ lpLData->hInformOnAppStart = hStart;
+ lpLData->hInformOnAppDeath = hDeath;
+ lpLData->hInformOnSettingRead = hConnRead;
+
+ DPLAYX_ReleaseSemaphore();
+
+ return TRUE;
+}
+
+static BOOL DPLAYX_GetThisLobbyHandles( LPHANDLE lphStart,
+ LPHANDLE lphDeath,
+ LPHANDLE lphConnRead,
+ BOOL bClearSetHandles )
+{
+ LPDPLAYX_LOBBYDATA lpLData;
+
+ DPLAYX_AcquireSemaphore();
+
+ if( !DPLAYX_IsAppIdLobbied( 0, &lpLData ) )
+ {
+ DPLAYX_ReleaseSemaphore();
+ return FALSE;
+ }
+
+ if( lphStart != NULL )
+ {
+ if( lpLData->hInformOnAppStart == 0 )
+ {
+ DPLAYX_ReleaseSemaphore();
+ return FALSE;
+ }
+
+ *lphStart = lpLData->hInformOnAppStart;
+
+ if( bClearSetHandles )
+ {
+ CloseHandle( lpLData->hInformOnAppStart );
+ lpLData->hInformOnAppStart = 0;
+ }
+ }
+
+ if( lphDeath != NULL )
+ {
+ if( lpLData->hInformOnAppDeath == 0 )
+ {
+ DPLAYX_ReleaseSemaphore();
+ return FALSE;
+ }
+
+ *lphDeath = lpLData->hInformOnAppDeath;
+
+ if( bClearSetHandles )
+ {
+ CloseHandle( lpLData->hInformOnAppDeath );
+ lpLData->hInformOnAppDeath = 0;
+ }
+ }
+
+ if( lphConnRead != NULL )
+ {
+ if( lpLData->hInformOnSettingRead == 0 )
+ {
+ DPLAYX_ReleaseSemaphore();
+ return FALSE;
+ }
+
+ *lphConnRead = lpLData->hInformOnSettingRead;
+
+ if( bClearSetHandles )
+ {
+ CloseHandle( lpLData->hInformOnSettingRead );
+ lpLData->hInformOnSettingRead = 0;
+ }
+ }
+
+ DPLAYX_ReleaseSemaphore();
+ return TRUE;
+}
/***************************************************************************
* Called to initialize the global data. This will only be used on the
s_attrib.lpSecurityDescriptor = NULL;
s_attrib.nLength = sizeof(s_attrib);
- hDplayxSema = CreateSemaphoreA( &s_attrib, 1, 1, lpszDplayxSemaName );
+ hDplayxSema = CreateSemaphoreA( &s_attrib, 0, 1, lpszDplayxSemaName );
/* First instance creates the semaphore. Others just use it */
if( GetLastError() == ERROR_SUCCESS )
else if ( GetLastError() == ERROR_ALREADY_EXISTS )
{
TRACE( "Found semaphore handle %p\n", hDplayxSema );
+ DPLAYX_AcquireSemaphore();
}
else
{
- ERR( ": semaphore error %ld\n", GetLastError() );
+ ERR( ": semaphore error %d\n", GetLastError() );
return FALSE;
}
SetLastError( ERROR_SUCCESS );
- DPLAYX_AquireSemaphore();
-
hDplayxSharedMem = CreateFileMappingA( INVALID_HANDLE_VALUE,
&s_attrib,
PAGE_READWRITE | SEC_COMMIT,
}
else
{
- ERR( ": unable to create shared memory (%ld)\n", GetLastError() );
+ ERR( ": unable to create shared memory (%d)\n", GetLastError() );
+ DPLAYX_ReleaseSemaphore();
return FALSE;
}
if( lpSharedStaticData == NULL )
{
- ERR( ": unable to map static data into process memory space (%ld)\n",
+ ERR( ": unable to map static data into process memory space (%d)\n",
GetLastError() );
+ DPLAYX_ReleaseSemaphore();
return FALSE;
}
else
else
{
/* Presently the shared data structures use pointers. If the
- * files are no mapped into the same area, the pointers will no
+ * files are not mapped into the same area, the pointers will no
* longer make any sense :(
* FIXME: In the future make the shared data structures have some
* sort of fixup to make them independent between data spaces.
lpMemArea = (LPVOID)((BYTE*)lpSharedStaticData + dwStaticSharedSize);
/* FIXME: Crude hack */
- lobbyData = (DPLAYX_LOBBYDATA*)lpSharedStaticData;
+ lobbyData = lpSharedStaticData;
sessionData = (DPSESSIONDESC2*)((BYTE*)lpSharedStaticData + (dwStaticSharedSize/2));
/* Initialize shared data segments. */
sessionData[i].dwSize = 0;
}
- /* Zero out the dynmaic area */
+ /* Zero out the dynamic area */
ZeroMemory( lpMemArea, dwDynamicSharedSize );
/* Just for fun sync the whole data area */
}
-void DPLAYX_InitializeLobbyDataEntry( LPDPLAYX_LOBBYDATA lpData )
+/* Assumption: Enough contiguous space was allocated at dest */
+static void DPLAYX_CopyConnStructA( LPDPLCONNECTION dest, const DPLCONNECTION *src )
{
- ZeroMemory( lpData, sizeof( *lpData ) );
-}
+ BYTE* lpStartOfFreeSpace;
-/* NOTE: This must be called with the semaphore aquired.
- * TRUE/FALSE with a pointer to it's data returned. Pointer data is
- * is only valid if TRUE is returned.
- */
-BOOL DPLAYX_IsAppIdLobbied( DWORD dwAppID, LPDPLAYX_LOBBYDATA* lplpDplData )
-{
- UINT i;
+ *dest = *src;
- *lplpDplData = NULL;
+ lpStartOfFreeSpace = ((BYTE*)dest) + sizeof( DPLCONNECTION );
- if( dwAppID == 0 )
+ /* Copy the LPDPSESSIONDESC2 structure if it exists */
+ if( src->lpSessionDesc )
{
- dwAppID = GetCurrentProcessId();
- TRACE( "Translated dwAppID == 0 into 0x%08lx\n", dwAppID );
+ dest->lpSessionDesc = (LPDPSESSIONDESC2)lpStartOfFreeSpace;
+ lpStartOfFreeSpace += sizeof( DPSESSIONDESC2 );
+ *dest->lpSessionDesc = *src->lpSessionDesc;
+
+ /* Session names may or may not exist */
+ if( src->lpSessionDesc->u1.lpszSessionNameA )
+ {
+ strcpy( (LPSTR)lpStartOfFreeSpace, src->lpSessionDesc->u1.lpszSessionNameA );
+ dest->lpSessionDesc->u1.lpszSessionNameA = (LPSTR)lpStartOfFreeSpace;
+ lpStartOfFreeSpace +=
+ strlen( dest->lpSessionDesc->u1.lpszSessionNameA ) + 1;
+ }
+
+ if( src->lpSessionDesc->u2.lpszPasswordA )
+ {
+ strcpy( (LPSTR)lpStartOfFreeSpace, src->lpSessionDesc->u2.lpszPasswordA );
+ dest->lpSessionDesc->u2.lpszPasswordA = (LPSTR)lpStartOfFreeSpace;
+ lpStartOfFreeSpace +=
+ strlen( dest->lpSessionDesc->u2.lpszPasswordA ) + 1;
+ }
}
- for( i=0; i < numSupportedLobbies; i++ )
+ /* DPNAME structure is optional */
+ if( src->lpPlayerName )
{
- if( lobbyData[ i ].dwAppID == dwAppID )
+ dest->lpPlayerName = (LPDPNAME)lpStartOfFreeSpace;
+ lpStartOfFreeSpace += sizeof( DPNAME );
+ *dest->lpPlayerName = *src->lpPlayerName;
+
+ if( src->lpPlayerName->u1.lpszShortNameA )
{
- /* This process is lobbied */
- TRACE( "Found 0x%08lx @ %u\n", dwAppID, i );
- *lplpDplData = &lobbyData[ i ];
- return TRUE;
+ strcpy( (LPSTR)lpStartOfFreeSpace, src->lpPlayerName->u1.lpszShortNameA );
+ dest->lpPlayerName->u1.lpszShortNameA = (LPSTR)lpStartOfFreeSpace;
+ lpStartOfFreeSpace +=
+ strlen( dest->lpPlayerName->u1.lpszShortNameA ) + 1;
+ }
+
+ if( src->lpPlayerName->u2.lpszLongNameA )
+ {
+ strcpy( (LPSTR)lpStartOfFreeSpace, src->lpPlayerName->u2.lpszLongNameA );
+ dest->lpPlayerName->u2.lpszLongNameA = (LPSTR)lpStartOfFreeSpace;
+ lpStartOfFreeSpace +=
+ strlen( (LPSTR)dest->lpPlayerName->u2.lpszLongName ) + 1 ;
}
+
}
- return FALSE;
+ /* Copy address if it exists */
+ if( src->lpAddress )
+ {
+ dest->lpAddress = lpStartOfFreeSpace;
+ CopyMemory( lpStartOfFreeSpace, src->lpAddress, src->dwAddressSize );
+ /* No need to advance lpStartOfFreeSpace as there is no more "dynamic" data */
+ }
}
-/* Reserve a spot for the new appliction. TRUE means success and FALSE failure. */
-BOOL DPLAYX_CreateLobbyApplication( DWORD dwAppID )
+/* Assumption: Enough contiguous space was allocated at dest */
+static void DPLAYX_CopyConnStructW( LPDPLCONNECTION dest, const DPLCONNECTION *src )
{
- UINT i;
+ BYTE* lpStartOfFreeSpace;
- /* 0 is the marker for unused application data slots */
- if( dwAppID == 0 )
- {
- return FALSE;
- }
+ *dest = *src;
- DPLAYX_AquireSemaphore();
+ lpStartOfFreeSpace = ( (BYTE*)dest) + sizeof( DPLCONNECTION );
- /* Find an empty space in the list and insert the data */
- for( i=0; i < numSupportedLobbies; i++ )
+ /* Copy the LPDPSESSIONDESC2 structure if it exists */
+ if( src->lpSessionDesc )
{
- if( lobbyData[ i ].dwAppID == 0 )
- {
- /* This process is now lobbied */
- TRACE( "Setting lobbyData[%u] for (0x%08lx,0x%08lx)\n",
- i, dwAppID, GetCurrentProcessId() );
-
- lobbyData[ i ].dwAppID = dwAppID;
- lobbyData[ i ].dwAppLaunchedFromID = GetCurrentProcessId();
+ dest->lpSessionDesc = (LPDPSESSIONDESC2)lpStartOfFreeSpace;
+ lpStartOfFreeSpace += sizeof( DPSESSIONDESC2 );
+ *dest->lpSessionDesc = *src->lpSessionDesc;
- /* FIXME: Where is the best place for this? In interface or here? */
- lobbyData[ i ].hInformOnAppStart = 0;
- lobbyData[ i ].hInformOnAppDeath = 0;
- lobbyData[ i ].hInformOnSettingRead = 0;
+ /* Session names may or may not exist */
+ if( src->lpSessionDesc->u1.lpszSessionName )
+ {
+ strcpyW( (LPWSTR)lpStartOfFreeSpace, src->lpSessionDesc->u1.lpszSessionName );
+ dest->lpSessionDesc->u1.lpszSessionName = (LPWSTR)lpStartOfFreeSpace;
+ lpStartOfFreeSpace += sizeof(WCHAR) *
+ ( strlenW( dest->lpSessionDesc->u1.lpszSessionName ) + 1 );
+ }
- DPLAYX_ReleaseSemaphore();
- return TRUE;
+ if( src->lpSessionDesc->u2.lpszPassword )
+ {
+ strcpyW( (LPWSTR)lpStartOfFreeSpace, src->lpSessionDesc->u2.lpszPassword );
+ dest->lpSessionDesc->u2.lpszPassword = (LPWSTR)lpStartOfFreeSpace;
+ lpStartOfFreeSpace += sizeof(WCHAR) *
+ ( strlenW( dest->lpSessionDesc->u2.lpszPassword ) + 1 );
}
}
- ERR( "No empty lobbies\n" );
-
- DPLAYX_ReleaseSemaphore();
- return FALSE;
-}
-
-/* I'm not sure when I'm going to need this, but here it is */
-BOOL DPLAYX_DestroyLobbyApplication( DWORD dwAppID )
-{
- UINT i;
-
- DPLAYX_AquireSemaphore();
-
- /* Find an empty space in the list and insert the data */
- for( i=0; i < numSupportedLobbies; i++ )
+ /* DPNAME structure is optional */
+ if( src->lpPlayerName )
{
- if( lobbyData[ i ].dwAppID == dwAppID )
+ dest->lpPlayerName = (LPDPNAME)lpStartOfFreeSpace;
+ lpStartOfFreeSpace += sizeof( DPNAME );
+ *dest->lpPlayerName = *src->lpPlayerName;
+
+ if( src->lpPlayerName->u1.lpszShortName )
{
- /* FIXME: Should free up anything unused. Tisk tisk :0 */
- /* Mark this entry unused */
- TRACE( "Marking lobbyData[%u] unused\n", i );
- DPLAYX_InitializeLobbyDataEntry( &lobbyData[ i ] );
+ strcpyW( (LPWSTR)lpStartOfFreeSpace, src->lpPlayerName->u1.lpszShortName );
+ dest->lpPlayerName->u1.lpszShortName = (LPWSTR)lpStartOfFreeSpace;
+ lpStartOfFreeSpace += sizeof(WCHAR) *
+ ( strlenW( dest->lpPlayerName->u1.lpszShortName ) + 1 );
+ }
- DPLAYX_ReleaseSemaphore();
- return TRUE;
+ if( src->lpPlayerName->u2.lpszLongName )
+ {
+ strcpyW( (LPWSTR)lpStartOfFreeSpace, src->lpPlayerName->u2.lpszLongName );
+ dest->lpPlayerName->u2.lpszLongName = (LPWSTR)lpStartOfFreeSpace;
+ lpStartOfFreeSpace += sizeof(WCHAR) *
+ ( strlenW( dest->lpPlayerName->u2.lpszLongName ) + 1 );
}
+
+ }
+
+ /* Copy address if it exists */
+ if( src->lpAddress )
+ {
+ dest->lpAddress = lpStartOfFreeSpace;
+ CopyMemory( lpStartOfFreeSpace, src->lpAddress, src->dwAddressSize );
+ /* No need to advance lpStartOfFreeSpace as there is no more "dynamic" data */
}
- DPLAYX_ReleaseSemaphore();
- ERR( "Unable to find global entry for application\n" );
- return FALSE;
}
-BOOL DPLAYX_SetLobbyHandles( DWORD dwAppID,
- HANDLE hStart, HANDLE hDeath, HANDLE hConnRead )
+static DWORD DPLAYX_SizeOfLobbyDataA( const DPLCONNECTION *lpConn )
{
- LPDPLAYX_LOBBYDATA lpLData;
+ DWORD dwTotalSize = sizeof( DPLCONNECTION );
- /* Need to explictly give lobby application. Can't set for yourself */
- if( dwAppID == 0 )
+ /* Just a safety check */
+ if( lpConn == NULL )
{
- return FALSE;
+ ERR( "lpConn is NULL\n" );
+ return 0;
}
- DPLAYX_AquireSemaphore();
-
- if( !DPLAYX_IsAppIdLobbied( dwAppID, &lpLData ) )
+ if( lpConn->lpSessionDesc != NULL )
{
- DPLAYX_ReleaseSemaphore();
- return FALSE;
+ dwTotalSize += sizeof( DPSESSIONDESC2 );
+
+ if( lpConn->lpSessionDesc->u1.lpszSessionNameA )
+ {
+ dwTotalSize += strlen( lpConn->lpSessionDesc->u1.lpszSessionNameA ) + 1;
+ }
+
+ if( lpConn->lpSessionDesc->u2.lpszPasswordA )
+ {
+ dwTotalSize += strlen( lpConn->lpSessionDesc->u2.lpszPasswordA ) + 1;
+ }
}
- lpLData->hInformOnAppStart = hStart;
- lpLData->hInformOnAppDeath = hDeath;
- lpLData->hInformOnSettingRead = hConnRead;
+ if( lpConn->lpPlayerName != NULL )
+ {
+ dwTotalSize += sizeof( DPNAME );
- DPLAYX_ReleaseSemaphore();
+ if( lpConn->lpPlayerName->u1.lpszShortNameA )
+ {
+ dwTotalSize += strlen( lpConn->lpPlayerName->u1.lpszShortNameA ) + 1;
+ }
- return TRUE;
+ if( lpConn->lpPlayerName->u2.lpszLongNameA )
+ {
+ dwTotalSize += strlen( lpConn->lpPlayerName->u2.lpszLongNameA ) + 1;
+ }
+
+ }
+
+ dwTotalSize += lpConn->dwAddressSize;
+
+ return dwTotalSize;
}
-BOOL DPLAYX_GetThisLobbyHandles( LPHANDLE lphStart,
- LPHANDLE lphDeath,
- LPHANDLE lphConnRead,
- BOOL bClearSetHandles )
+static DWORD DPLAYX_SizeOfLobbyDataW( const DPLCONNECTION *lpConn )
{
- LPDPLAYX_LOBBYDATA lpLData;
-
- DPLAYX_AquireSemaphore();
+ DWORD dwTotalSize = sizeof( DPLCONNECTION );
- if( !DPLAYX_IsAppIdLobbied( 0, &lpLData ) )
+ /* Just a safety check */
+ if( lpConn == NULL )
{
- DPLAYX_ReleaseSemaphore();
- return FALSE;
+ ERR( "lpConn is NULL\n" );
+ return 0;
}
- if( lphStart != NULL )
+ if( lpConn->lpSessionDesc != NULL )
{
- if( lpLData->hInformOnAppStart == 0 )
+ dwTotalSize += sizeof( DPSESSIONDESC2 );
+
+ if( lpConn->lpSessionDesc->u1.lpszSessionName )
{
- DPLAYX_ReleaseSemaphore();
- return FALSE;
+ dwTotalSize += sizeof( WCHAR ) *
+ ( strlenW( lpConn->lpSessionDesc->u1.lpszSessionName ) + 1 );
}
- *lphStart = lpLData->hInformOnAppStart;
-
- if( bClearSetHandles )
+ if( lpConn->lpSessionDesc->u2.lpszPassword )
{
- CloseHandle( lpLData->hInformOnAppStart );
- lpLData->hInformOnAppStart = 0;
+ dwTotalSize += sizeof( WCHAR ) *
+ ( strlenW( lpConn->lpSessionDesc->u2.lpszPassword ) + 1 );
}
}
- if( lphDeath != NULL )
+ if( lpConn->lpPlayerName != NULL )
{
- if( lpLData->hInformOnAppDeath == 0 )
- {
- DPLAYX_ReleaseSemaphore();
- return FALSE;
- }
-
- *lphDeath = lpLData->hInformOnAppDeath;
+ dwTotalSize += sizeof( DPNAME );
- if( bClearSetHandles )
+ if( lpConn->lpPlayerName->u1.lpszShortName )
{
- CloseHandle( lpLData->hInformOnAppDeath );
- lpLData->hInformOnAppDeath = 0;
+ dwTotalSize += sizeof( WCHAR ) *
+ ( strlenW( lpConn->lpPlayerName->u1.lpszShortName ) + 1 );
}
- }
- if( lphConnRead != NULL )
- {
- if( lpLData->hInformOnSettingRead == 0 )
+ if( lpConn->lpPlayerName->u2.lpszLongName )
{
- DPLAYX_ReleaseSemaphore();
- return FALSE;
+ dwTotalSize += sizeof( WCHAR ) *
+ ( strlenW( lpConn->lpPlayerName->u2.lpszLongName ) + 1 );
}
- *lphConnRead = lpLData->hInformOnSettingRead;
-
- if( bClearSetHandles )
- {
- CloseHandle( lpLData->hInformOnSettingRead );
- lpLData->hInformOnSettingRead = 0;
- }
}
- DPLAYX_ReleaseSemaphore();
+ dwTotalSize += lpConn->dwAddressSize;
- return TRUE;
+ return dwTotalSize;
}
-
HRESULT DPLAYX_GetConnectionSettingsA
( DWORD dwAppID,
LPVOID lpData,
DWORD dwRequiredDataSize = 0;
HANDLE hInformOnSettingRead;
- DPLAYX_AquireSemaphore();
+ DPLAYX_AcquireSemaphore();
if ( ! DPLAYX_IsAppIdLobbied( dwAppID, &lpDplData ) )
{
DPLAYX_ReleaseSemaphore();
- TRACE( "Application 0x%08lx is not lobbied\n", dwAppID );
+ TRACE( "Application 0x%08x is not lobbied\n", dwAppID );
return DPERR_NOTLOBBIED;
}
return DPERR_BUFFERTOOSMALL;
}
- DPLAYX_CopyConnStructA( (LPDPLCONNECTION)lpData, lpDplData->lpConn );
+ DPLAYX_CopyConnStructA( lpData, lpDplData->lpConn );
DPLAYX_ReleaseSemaphore();
return DP_OK;
}
-/* Assumption: Enough contiguous space was allocated at dest */
-void DPLAYX_CopyConnStructA( LPDPLCONNECTION dest, LPDPLCONNECTION src )
-{
- BYTE* lpStartOfFreeSpace;
-
- CopyMemory( dest, src, sizeof( DPLCONNECTION ) );
-
- lpStartOfFreeSpace = ((BYTE*)dest) + sizeof( DPLCONNECTION );
-
- /* Copy the LPDPSESSIONDESC2 structure if it exists */
- if( src->lpSessionDesc )
- {
- dest->lpSessionDesc = (LPDPSESSIONDESC2)lpStartOfFreeSpace;
- lpStartOfFreeSpace += sizeof( DPSESSIONDESC2 );
- CopyMemory( dest->lpSessionDesc, src->lpSessionDesc, sizeof( DPSESSIONDESC2 ) );
-
- /* Session names may or may not exist */
- if( src->lpSessionDesc->lpszSessionNameA )
- {
- strcpy( (LPSTR)lpStartOfFreeSpace, src->lpSessionDesc->lpszSessionNameA );
- dest->lpSessionDesc->lpszSessionNameA = (LPSTR)lpStartOfFreeSpace;
- lpStartOfFreeSpace +=
- strlen( (LPSTR)dest->lpSessionDesc->lpszSessionNameA ) + 1;
- }
-
- if( src->lpSessionDesc->lpszPasswordA )
- {
- strcpy( (LPSTR)lpStartOfFreeSpace, src->lpSessionDesc->lpszPasswordA );
- dest->lpSessionDesc->lpszPasswordA = (LPSTR)lpStartOfFreeSpace;
- lpStartOfFreeSpace +=
- strlen( (LPSTR)dest->lpSessionDesc->lpszPasswordA ) + 1;
- }
- }
-
- /* DPNAME structure is optional */
- if( src->lpPlayerName )
- {
- dest->lpPlayerName = (LPDPNAME)lpStartOfFreeSpace;
- lpStartOfFreeSpace += sizeof( DPNAME );
- CopyMemory( dest->lpPlayerName, src->lpPlayerName, sizeof( DPNAME ) );
-
- if( src->lpPlayerName->lpszShortNameA )
- {
- strcpy( (LPSTR)lpStartOfFreeSpace, src->lpPlayerName->lpszShortNameA );
- dest->lpPlayerName->lpszShortNameA = (LPSTR)lpStartOfFreeSpace;
- lpStartOfFreeSpace +=
- strlen( (LPSTR)dest->lpPlayerName->lpszShortNameA ) + 1;
- }
-
- if( src->lpPlayerName->lpszLongNameA )
- {
- strcpy( (LPSTR)lpStartOfFreeSpace, src->lpPlayerName->lpszLongNameA );
- dest->lpPlayerName->lpszLongNameA = (LPSTR)lpStartOfFreeSpace;
- lpStartOfFreeSpace +=
- strlen( (LPSTR)dest->lpPlayerName->lpszLongName ) + 1 ;
- }
-
- }
-
- /* Copy address if it exists */
- if( src->lpAddress )
- {
- dest->lpAddress = (LPVOID)lpStartOfFreeSpace;
- CopyMemory( lpStartOfFreeSpace, src->lpAddress, src->dwAddressSize );
- /* No need to advance lpStartOfFreeSpace as there is no more "dynamic" data */
- }
-}
-
HRESULT DPLAYX_GetConnectionSettingsW
( DWORD dwAppID,
LPVOID lpData,
DWORD dwRequiredDataSize = 0;
HANDLE hInformOnSettingRead;
- DPLAYX_AquireSemaphore();
+ DPLAYX_AcquireSemaphore();
if ( ! DPLAYX_IsAppIdLobbied( dwAppID, &lpDplData ) )
{
return DPERR_BUFFERTOOSMALL;
}
- DPLAYX_CopyConnStructW( (LPDPLCONNECTION)lpData, lpDplData->lpConn );
+ DPLAYX_CopyConnStructW( lpData, lpDplData->lpConn );
DPLAYX_ReleaseSemaphore();
return DP_OK;
}
-/* Assumption: Enough contiguous space was allocated at dest */
-void DPLAYX_CopyConnStructW( LPDPLCONNECTION dest, LPDPLCONNECTION src )
-{
- BYTE* lpStartOfFreeSpace;
-
- CopyMemory( dest, src, sizeof( DPLCONNECTION ) );
-
- lpStartOfFreeSpace = ( (BYTE*)dest) + sizeof( DPLCONNECTION );
-
- /* Copy the LPDPSESSIONDESC2 structure if it exists */
- if( src->lpSessionDesc )
- {
- dest->lpSessionDesc = (LPDPSESSIONDESC2)lpStartOfFreeSpace;
- lpStartOfFreeSpace += sizeof( DPSESSIONDESC2 );
- CopyMemory( dest->lpSessionDesc, src->lpSessionDesc, sizeof( DPSESSIONDESC2 ) );
-
- /* Session names may or may not exist */
- if( src->lpSessionDesc->lpszSessionName )
- {
- strcpyW( (LPWSTR)lpStartOfFreeSpace, dest->lpSessionDesc->lpszSessionName );
- src->lpSessionDesc->lpszSessionName = (LPWSTR)lpStartOfFreeSpace;
- lpStartOfFreeSpace += sizeof(WCHAR) *
- ( strlenW( (LPWSTR)dest->lpSessionDesc->lpszSessionName ) + 1 );
- }
-
- if( src->lpSessionDesc->lpszPassword )
- {
- strcpyW( (LPWSTR)lpStartOfFreeSpace, src->lpSessionDesc->lpszPassword );
- dest->lpSessionDesc->lpszPassword = (LPWSTR)lpStartOfFreeSpace;
- lpStartOfFreeSpace += sizeof(WCHAR) *
- ( strlenW( (LPWSTR)dest->lpSessionDesc->lpszPassword ) + 1 );
- }
- }
-
- /* DPNAME structure is optional */
- if( src->lpPlayerName )
- {
- dest->lpPlayerName = (LPDPNAME)lpStartOfFreeSpace;
- lpStartOfFreeSpace += sizeof( DPNAME );
- CopyMemory( dest->lpPlayerName, src->lpPlayerName, sizeof( DPNAME ) );
-
- if( src->lpPlayerName->lpszShortName )
- {
- strcpyW( (LPWSTR)lpStartOfFreeSpace, src->lpPlayerName->lpszShortName );
- dest->lpPlayerName->lpszShortName = (LPWSTR)lpStartOfFreeSpace;
- lpStartOfFreeSpace += sizeof(WCHAR) *
- ( strlenW( (LPWSTR)dest->lpPlayerName->lpszShortName ) + 1 );
- }
-
- if( src->lpPlayerName->lpszLongName )
- {
- strcpyW( (LPWSTR)lpStartOfFreeSpace, src->lpPlayerName->lpszLongName );
- dest->lpPlayerName->lpszLongName = (LPWSTR)lpStartOfFreeSpace;
- lpStartOfFreeSpace += sizeof(WCHAR) *
- ( strlenW( (LPWSTR)dest->lpPlayerName->lpszLongName ) + 1 );
- }
-
- }
-
- /* Copy address if it exists */
- if( src->lpAddress )
- {
- dest->lpAddress = (LPVOID)lpStartOfFreeSpace;
- CopyMemory( lpStartOfFreeSpace, src->lpAddress, src->dwAddressSize );
- /* No need to advance lpStartOfFreeSpace as there is no more "dynamic" data */
- }
-
-}
-
-/* Store the structure into the shared data structre. Ensure that allocs for
+/* Store the structure into the shared data structure. Ensure that allocs for
* variable length strings come from the shared data structure.
- * FIXME: We need to free information as well
+ * FIXME: We need to free information as well.
*/
HRESULT DPLAYX_SetConnectionSettingsA
( DWORD dwFlags,
DWORD dwAppID,
- LPDPLCONNECTION lpConn )
+ const DPLCONNECTION *lpConn )
{
LPDPLAYX_LOBBYDATA lpDplData;
/* Store information */
if( lpConn->dwSize != sizeof(DPLCONNECTION) )
{
- ERR(": old/new DPLCONNECTION type? Size=%08lx vs. expected=%ul bytes\n",
- lpConn->dwSize, sizeof( DPLCONNECTION ) );
+ ERR(": old/new DPLCONNECTION type? Size=%08x\n", lpConn->dwSize );
return DPERR_INVALIDPARAMS;
}
- DPLAYX_AquireSemaphore();
+ DPLAYX_AcquireSemaphore();
if ( ! DPLAYX_IsAppIdLobbied( dwAppID, &lpDplData ) )
{
{
DPLAYX_ReleaseSemaphore();
- ERR("DPSESSIONDESC passed in? Size=%lu vs. expected=%u bytes\n",
- lpConn->lpSessionDesc->dwSize, sizeof( DPSESSIONDESC2 ) );
+ ERR("DPSESSIONDESC passed in? Size=%u\n",
+ lpConn->lpSessionDesc?lpConn->lpSessionDesc->dwSize:0 );
return DPERR_INVALIDPARAMS;
}
return DP_OK;
}
-/* Store the structure into the shared data structre. Ensure that allocs for
+/* Store the structure into the shared data structure. Ensure that allocs for
* variable length strings come from the shared data structure.
* FIXME: We need to free information as well
*/
HRESULT DPLAYX_SetConnectionSettingsW
( DWORD dwFlags,
DWORD dwAppID,
- LPDPLCONNECTION lpConn )
+ const DPLCONNECTION *lpConn )
{
LPDPLAYX_LOBBYDATA lpDplData;
/* Store information */
if( lpConn->dwSize != sizeof(DPLCONNECTION) )
{
- ERR(": old/new DPLCONNECTION type? Size=%lu vs. expected=%u bytes\n",
- lpConn->dwSize, sizeof( DPLCONNECTION ) );
+ ERR(": old/new DPLCONNECTION type? Size=%u\n", lpConn->dwSize );
return DPERR_INVALIDPARAMS;
}
- DPLAYX_AquireSemaphore();
+ DPLAYX_AcquireSemaphore();
if ( ! DPLAYX_IsAppIdLobbied( dwAppID, &lpDplData ) )
{
return DP_OK;
}
-DWORD DPLAYX_SizeOfLobbyDataA( LPDPLCONNECTION lpConn )
-{
- DWORD dwTotalSize = sizeof( DPLCONNECTION );
-
- /* Just a safety check */
- if( lpConn == NULL )
- {
- ERR( "lpConn is NULL\n" );
- return 0;
- }
-
- if( lpConn->lpSessionDesc != NULL )
- {
- dwTotalSize += sizeof( DPSESSIONDESC2 );
-
- if( lpConn->lpSessionDesc->lpszSessionNameA )
- {
- dwTotalSize += strlen( lpConn->lpSessionDesc->lpszSessionNameA ) + 1;
- }
-
- if( lpConn->lpSessionDesc->lpszPasswordA )
- {
- dwTotalSize += strlen( lpConn->lpSessionDesc->lpszPasswordA ) + 1;
- }
- }
-
- if( lpConn->lpPlayerName != NULL )
- {
- dwTotalSize += sizeof( DPNAME );
-
- if( lpConn->lpPlayerName->lpszShortNameA )
- {
- dwTotalSize += strlen( lpConn->lpPlayerName->lpszShortNameA ) + 1;
- }
-
- if( lpConn->lpPlayerName->lpszLongNameA )
- {
- dwTotalSize += strlen( lpConn->lpPlayerName->lpszLongNameA ) + 1;
- }
-
- }
-
- dwTotalSize += lpConn->dwAddressSize;
-
- return dwTotalSize;
-}
-
-DWORD DPLAYX_SizeOfLobbyDataW( LPDPLCONNECTION lpConn )
-{
- DWORD dwTotalSize = sizeof( DPLCONNECTION );
-
- /* Just a safety check */
- if( lpConn == NULL )
- {
- ERR( "lpConn is NULL\n" );
- return 0;
- }
-
- if( lpConn->lpSessionDesc != NULL )
- {
- dwTotalSize += sizeof( DPSESSIONDESC2 );
-
- if( lpConn->lpSessionDesc->lpszSessionName )
- {
- dwTotalSize += sizeof( WCHAR ) *
- ( strlenW( lpConn->lpSessionDesc->lpszSessionName ) + 1 );
- }
-
- if( lpConn->lpSessionDesc->lpszPassword )
- {
- dwTotalSize += sizeof( WCHAR ) *
- ( strlenW( lpConn->lpSessionDesc->lpszPassword ) + 1 );
- }
- }
-
- if( lpConn->lpPlayerName != NULL )
- {
- dwTotalSize += sizeof( DPNAME );
-
- if( lpConn->lpPlayerName->lpszShortName )
- {
- dwTotalSize += sizeof( WCHAR ) *
- ( strlenW( lpConn->lpPlayerName->lpszShortName ) + 1 );
- }
-
- if( lpConn->lpPlayerName->lpszLongName )
- {
- dwTotalSize += sizeof( WCHAR ) *
- ( strlenW( lpConn->lpPlayerName->lpszLongName ) + 1 );
- }
-
- }
-
- dwTotalSize += lpConn->dwAddressSize;
-
- return dwTotalSize;
-}
-
-
-
-static LPDPSESSIONDESC2 DPLAYX_CopyAndAllocateSessionDesc2A( LPCDPSESSIONDESC2 lpSessionSrc )
-{
- LPDPSESSIONDESC2 lpSessionDest =
- HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpSessionSrc ) );
- DPLAYX_CopyIntoSessionDesc2A( lpSessionDest, lpSessionSrc );
-
- return lpSessionDest;
-}
-
-/* Copy an ANSI session desc structure to the given buffer */
-BOOL DPLAYX_CopyIntoSessionDesc2A( LPDPSESSIONDESC2 lpSessionDest,
- LPCDPSESSIONDESC2 lpSessionSrc )
-{
- CopyMemory( lpSessionDest, lpSessionSrc, sizeof( *lpSessionSrc ) );
-
- if( lpSessionSrc->lpszSessionNameA )
- {
- if ((lpSessionDest->lpszSessionNameA = HeapAlloc( GetProcessHeap(), 0,
- strlen(lpSessionSrc->lpszSessionNameA)+1 )))
- strcpy( lpSessionDest->lpszSessionNameA, lpSessionSrc->lpszSessionNameA );
- }
- if( lpSessionSrc->lpszPasswordA )
- {
- if ((lpSessionDest->lpszPasswordA = HeapAlloc( GetProcessHeap(), 0,
- strlen(lpSessionSrc->lpszPasswordA)+1 )))
- strcpy( lpSessionDest->lpszPasswordA, lpSessionSrc->lpszPasswordA );
- }
-
- return TRUE;
-}
-
-/* Start the index at 0. index will be updated to equal that which should
- be passed back into this function for the next element */
-LPDPSESSIONDESC2 DPLAYX_CopyAndAllocateLocalSession( UINT* index )
-{
- for( ; (*index) < numSupportedSessions; (*index)++ )
- {
- if( sessionData[(*index)].dwSize != 0 )
- {
- return DPLAYX_CopyAndAllocateSessionDesc2A( &sessionData[(*index)++] );
- }
- }
-
- /* No more sessions */
- return NULL;
-}
-
-/* Start the index at 0. index will be updated to equal that which should
- be passed back into this function for the next element */
-BOOL DPLAYX_CopyLocalSession( UINT* index, LPDPSESSIONDESC2 lpsd )
-{
- for( ; (*index) < numSupportedSessions; (*index)++ )
- {
- if( sessionData[(*index)].dwSize != 0 )
- {
- return DPLAYX_CopyIntoSessionDesc2A( lpsd, &sessionData[(*index)++] );
- }
- }
-
- /* No more sessions */
- return FALSE;
-}
-
-void DPLAYX_SetLocalSession( LPCDPSESSIONDESC2 lpsd )
-{
- UINT i;
-
- /* FIXME: Is this an error if it exists already? */
-
- /* Crude/wrong implementation for now. Just always add to first empty spot */
- for( i=0; i < numSupportedSessions; i++ )
- {
- /* Is this one empty? */
- if( sessionData[i].dwSize == 0 )
- {
- DPLAYX_CopyIntoSessionDesc2A( &sessionData[i], lpsd );
- break;
- }
- }
-
-}
-
BOOL DPLAYX_WaitForConnectionSettings( BOOL bWait )
{
LPDPLAYX_LOBBYDATA lpLobbyData;
- DPLAYX_AquireSemaphore();
+ DPLAYX_AcquireSemaphore();
if( !DPLAYX_IsAppIdLobbied( 0, &lpLobbyData ) )
{
UINT i;
BOOL bFound = FALSE;
- DPLAYX_AquireSemaphore();
+ DPLAYX_AcquireSemaphore();
for( i=0; i < numSupportedLobbies; i++ )
{
{
LPDPLAYX_LOBBYDATA lpLobbyData;
- DPLAYX_AquireSemaphore();
+ DPLAYX_AcquireSemaphore();
if( !DPLAYX_IsAppIdLobbied( dwAppId, &lpLobbyData ) )
{
default:
/* For errors not in the list, return HRESULT as a string
This part is not thread safe */
- WARN( "Unknown error 0x%08lx\n", hr );
+ WARN( "Unknown error 0x%08x\n", hr );
wsprintfA( szTempStr, "0x%08lx", hr );
return szTempStr;
}
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WINE_DPLAYX_GLOBAL
#define WIN32_NO_STATUS
#define _INC_WINDOWS
-#define COM_NO_WINDOWS_H
#include <stdarg.h>
//#include "winuser.h"
#include <dplay.h>
-BOOL DPLAYX_ConstructData(void);
-BOOL DPLAYX_DestructData(void);
+BOOL DPLAYX_ConstructData(void) DECLSPEC_HIDDEN;
+BOOL DPLAYX_DestructData(void) DECLSPEC_HIDDEN;
HRESULT DPLAYX_GetConnectionSettingsA ( DWORD dwAppID,
LPVOID lpData,
- LPDWORD lpdwDataSize );
+ LPDWORD lpdwDataSize ) DECLSPEC_HIDDEN;
HRESULT DPLAYX_GetConnectionSettingsW ( DWORD dwAppID,
LPVOID lpData,
- LPDWORD lpdwDataSize );
+ LPDWORD lpdwDataSize ) DECLSPEC_HIDDEN;
HRESULT DPLAYX_SetConnectionSettingsA ( DWORD dwFlags,
DWORD dwAppID,
- LPDPLCONNECTION lpConn );
+ const DPLCONNECTION *lpConn ) DECLSPEC_HIDDEN;
HRESULT DPLAYX_SetConnectionSettingsW ( DWORD dwFlags,
DWORD dwAppID,
- LPDPLCONNECTION lpConn );
+ const DPLCONNECTION *lpConn ) DECLSPEC_HIDDEN;
-BOOL DPLAYX_CreateLobbyApplication( DWORD dwAppID );
-BOOL DPLAYX_DestroyLobbyApplication( DWORD dwAppID );
+BOOL DPLAYX_CreateLobbyApplication( DWORD dwAppID ) DECLSPEC_HIDDEN;
-BOOL DPLAYX_WaitForConnectionSettings( BOOL bWait );
-BOOL DPLAYX_AnyLobbiesWaitingForConnSettings(void);
+BOOL DPLAYX_WaitForConnectionSettings( BOOL bWait ) DECLSPEC_HIDDEN;
+BOOL DPLAYX_AnyLobbiesWaitingForConnSettings(void) DECLSPEC_HIDDEN;
BOOL DPLAYX_SetLobbyHandles( DWORD dwAppID,
- HANDLE hStart, HANDLE hDeath, HANDLE hConnRead );
-BOOL DPLAYX_GetThisLobbyHandles( LPHANDLE lphStart,
- LPHANDLE lphDeath,
- LPHANDLE lphConnRead, BOOL bClearSetHandles );
+ HANDLE hStart, HANDLE hDeath, HANDLE hConnRead ) DECLSPEC_HIDDEN;
-LPDPSESSIONDESC2 DPLAYX_CopyAndAllocateLocalSession( UINT* index );
-BOOL DPLAYX_CopyLocalSession( UINT* index, LPDPSESSIONDESC2 lpsd );
-void DPLAYX_SetLocalSession( LPCDPSESSIONDESC2 lpsd );
-
-BOOL DPLAYX_SetLobbyMsgThreadId( DWORD dwAppId, DWORD dwThreadId );
-
-/* FIXME: This should not be here */
-LPVOID DPLAYX_PrivHeapAlloc( DWORD flags, DWORD size );
-void DPLAYX_PrivHeapFree( LPVOID addr );
-
-LPSTR DPLAYX_strdupA( DWORD flags, LPCSTR str );
-LPWSTR DPLAYX_strdupW( DWORD flags, LPCWSTR str );
-/* FIXME: End shared data alloc which should be local */
+BOOL DPLAYX_SetLobbyMsgThreadId( DWORD dwAppId, DWORD dwThreadId ) DECLSPEC_HIDDEN;
/* Convert a DP or DPL HRESULT code into a string for human consumption */
-LPCSTR DPLAYX_HresultToString( HRESULT hr );
+LPCSTR DPLAYX_HresultToString( HRESULT hr ) DECLSPEC_HIDDEN;
#endif /* __WINE_DPLAYX_GLOBAL */
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* NOTES
* o DPMSGCMD_ENUMSESSIONSREPLY & DPMSGCMD_ENUMSESSIONSREQUEST
* Have most fields understood, but not all. Everything seems to work.
* o DPMSGCMD_REQUESTNEWPLAYERID & DPMSGCMD_NEWPLAYERIDREPLY
- * Barely work. This needs to be completed for sessions to start.
+ * Barely works. This needs to be completed for sessions to start.
* o A small issue will be the fact that DirectX 6.1(ie. DirectPlay4)
- * introduces a layer of functionality inside the DP objects which
+ * introduces a layer of functionality inside the DP objects which
* provide guaranteed protocol delivery. This is even if the native
* protocol, IPX or modem for instance, doesn't guarantee it. I'm going
- * to leave this kind of implementation to as close to the end as
- * possible. However, I will implement an abstraction layer, where
- * possible, for this functionality. It will do nothing to start, but
- * will require only the implementation of the guaranteness to give
+ * to leave this kind of implementation to as close to the end as
+ * possible. However, I will implement an abstraction layer, where
+ * possible, for this functionality. It will do nothing to start, but
+ * will require only the implementation of the guarantee to give
* final implementation.
*
* TODO:
* - Change RegEnumKeyEx enumeration pattern to allow error handling and to
* share registry implementation (or at least simplify).
* - Add in appropriate RegCloseKey calls for all the opening we're doing...
- * - Fix all the buffer sizes for registry calls. They're off by one -
+ * - Fix all the buffer sizes for registry calls. They're off by one -
* but in a safe direction.
* - Fix race condition on interface destruction
* - Handles need to be correctly reference counted
- * - Check if we need to deallocate any list objects when destroying
+ * - Check if we need to deallocate any list objects when destroying
* a dplay interface
- * - RunApplication process spawning needs to have correct syncronization.
+ * - RunApplication process spawning needs to have correct synchronization.
* - Need to get inter lobby messages working.
- * - Decypher dplay messages between applications and implement...
+ * - Decipher dplay messages between applications and implement...
* - Need to implement lobby session spawning.
* - Improve footprint and realtime blocking by setting up a separate data share
* between lobby application and client since there can be multiple apps per
* client. Also get rid of offset dependency by making data offset independent
* somehow.
*/
-//#include <stdarg.h>
+
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+
+#include <stdarg.h>
//#include "winerror.h"
-//#include "windef.h"
-//#include "winbase.h"
+#include <windef.h>
+#include <winbase.h>
+#include <objbase.h>
+#include <rpcproxy.h>
#include <wine/debug.h>
#include "dplayx_global.h"
WINE_DEFAULT_DEBUG_CHANNEL(dplay);
+static HINSTANCE instance;
+
/* This is a globally exported variable at ordinal 6 of DPLAYX.DLL */
DWORD gdwDPlaySPRefCount = 0; /* FIXME: Should it be initialized here? */
BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved )
{
- TRACE( "(%p,%ld,%p)\n", hinstDLL, fdwReason, lpvReserved );
+ TRACE( "(%p,%d,%p)\n", hinstDLL, fdwReason, lpvReserved );
switch ( fdwReason )
{
case DLL_PROCESS_ATTACH:
+ instance = hinstDLL;
DisableThreadLibraryCalls(hinstDLL);
/* First instance perform construction of global processor data */
return DPLAYX_ConstructData();
HRESULT hr = ( gdwDPlaySPRefCount > 0 ) ? S_FALSE : S_OK;
/* FIXME: Should I be putting a check in for class factory objects
- * as well
+ * as well?
*/
- TRACE( ": returning 0x%08lx\n", hr );
+ TRACE( ": returning 0x%08x\n", hr );
return hr;
}
+
+/***********************************************************************
+ * DllRegisterServer (DPLAYX.@)
+ */
+HRESULT WINAPI DllRegisterServer(void)
+{
+ return __wine_register_resources( instance );
+}
+
+/***********************************************************************
+ * DllUnregisterServer (DPLAYX.@)
+ */
+HRESULT WINAPI DllUnregisterServer(void)
+{
+ return __wine_unregister_resources( instance );
+}
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* NOTES
* o Messaging interface required for both DirectPlay and DirectPlayLobby.
static DWORD CALLBACK DPL_MSG_ThreadMain( LPVOID lpContext )
{
- LPMSGTHREADINFO lpThreadInfo = (LPMSGTHREADINFO)lpContext;
+ LPMSGTHREADINFO lpThreadInfo = lpContext;
DWORD dwWaitResult;
TRACE( "Msg thread created. Waiting on app startup\n" );
dwWaitResult = WaitForSingleObject( lpThreadInfo->hStart, 10000 /* 10 sec */ );
if( dwWaitResult == WAIT_TIMEOUT )
{
- FIXME( "Should signal app/wait creation failure (0x%08lx)\n", dwWaitResult );
+ FIXME( "Should signal app/wait creation failure (0x%08x)\n", dwWaitResult );
goto end_of_thread;
}
dwWaitResult = WaitForSingleObject( lpThreadInfo->hSettingRead, INFINITE );
if( dwWaitResult == WAIT_TIMEOUT )
{
- ERR( "App Read connection setting timeout fail (0x%08lx)\n", dwWaitResult );
+ ERR( "App Read connection setting timeout fail (0x%08x)\n", dwWaitResult );
}
/* Close this handle as it's not needed anymore */
CloseHandle( lpThreadInfo->hSettingRead );
lpThreadInfo->hSettingRead = 0;
- TRACE( "App created && intialized starting main message reception loop\n" );
+ TRACE( "App created && initialized starting main message reception loop\n" );
for ( ;; )
{
return 0;
}
-/* DP messageing stuff */
+/* DP messaging stuff */
static HANDLE DP_MSG_BuildAndLinkReplyStruct( IDirectPlay2Impl* This,
LPDP_MSG_REPLY_STRUCT_LIST lpReplyStructList,
WORD wReplyCommandId );
/* Insert into the message queue while locked */
EnterCriticalSection( &This->unk->DP_lock );
- DPQ_INSERT( This->dp2->replysExpected, lpReplyStructList, replysExpected );
+ DPQ_INSERT( This->dp2->repliesExpected, lpReplyStructList, repliesExpected );
LeaveCriticalSection( &This->unk->DP_lock );
return lpReplyStructList->replyExpected.hReceipt;
data.bSystemMessage = TRUE; /* Allow reply to be sent */
data.lpISP = This->dp2->spData.lpISP;
- TRACE( "Asking for player id w/ dwFlags 0x%08lx\n",
+ TRACE( "Asking for player id w/ dwFlags 0x%08x\n",
lpMsgBody->dwFlags );
DP_MSG_ExpectReply( This, &data, DPMSG_DEFAULT_WAIT_TIME, DPMSGCMD_NEWPLAYERIDREPLY,
}
/* Need to examine the data and extract the new player id */
- if( !FAILED(hr) )
+ if( SUCCEEDED(hr) )
{
LPCDPMSG_NEWPLAYERIDREPLY lpcReply;
- lpcReply = (LPCDPMSG_NEWPLAYERIDREPLY)lpMsg;
+ lpcReply = lpMsg;
*lpdpidAllocatedId = lpcReply->dpidNewPlayerId;
- TRACE( "Received reply for id = 0x%08lx\n", lpcReply->dpidNewPlayerId );
+ TRACE( "Received reply for id = 0x%08x\n", lpcReply->dpidNewPlayerId );
/* FIXME: I think that the rest of the message has something to do
* with remote data for the player that perhaps I need to setup.
* However, with the information that is passed, all that it could
- * be used for is a standardized intialization value, which I'm
+ * be used for is a standardized initialization value, which I'm
* guessing we can do without. Unless the message content is the same
* for several different messages?
*/
DWORD dwDataSize;
/* SP Player remote data needs to be propagated at some point - is this the point? */
- IDirectPlaySP_GetSPPlayerData( This->dp2->spData.lpISP, 0, (LPVOID*)&lpPData, &dwDataSize, DPSET_REMOTE );
+ IDirectPlaySP_GetSPPlayerData( This->dp2->spData.lpISP, 0, &lpPData, &dwDataSize, DPSET_REMOTE );
ERR( "Player Data size is 0x%08lx\n"
"[%02x%02x %02x%02x %02x%02x %02x%02x %02x%02x %02x%02x %02x%02x %02x%02x]\n"
lpMsgBody->unknown4[3] = NS_GetNsMagic( This->dp2->lpNameServerData ) -
0x02000000;
- TRACE( "Setting first magic to 0x%08lx\n", lpMsgBody->unknown4[3] );
+ TRACE( "Setting first magic to 0x%08x\n", lpMsgBody->unknown4[3] );
lpMsgBody->unknown4[4] = 0x0;
lpMsgBody->unknown4[5] = 0x0;
lpMsgBody->unknown4[6] = 0x0;
-#if 0
- lpMsgBody->unknown4[7] = NS_GetOtherMagic( This->dp2->lpNameServerData )
-#else
lpMsgBody->unknown4[7] = NS_GetNsMagic( This->dp2->lpNameServerData );
-#endif
- TRACE( "Setting second magic to 0x%08lx\n", lpMsgBody->unknown4[7] );
+ TRACE( "Setting second magic to 0x%08x\n", lpMsgBody->unknown4[7] );
lpMsgBody->unknown4[8] = 0x0;
lpMsgBody->unknown4[9] = 0x0;
data.bSystemMessage = TRUE; /* Allow reply to be sent */
data.lpISP = This->dp2->spData.lpISP;
- TRACE( "Sending forward player request with 0x%08lx\n", dpidServer );
+ TRACE( "Sending forward player request with 0x%08x\n", dpidServer );
lpMsg = DP_MSG_ExpectReply( This, &data,
DPMSG_WAIT_60_SECS,
hMsgReceipt = DP_MSG_BuildAndLinkReplyStruct( This, &replyStructList,
wReplyCommandId );
- TRACE( "Sending msg and expecting cmd %u in reply within %lu ticks\n",
+ TRACE( "Sending msg and expecting cmd %u in reply within %u ticks\n",
wReplyCommandId, dwWaitTime );
hr = (*This->dp2->spData.lpCB->Send)( lpData );
dwWaitReturn = WaitForSingleObject( hMsgReceipt, dwWaitTime );
if( dwWaitReturn != WAIT_OBJECT_0 )
{
- ERR( "Wait failed 0x%08lx\n", dwWaitReturn );
+ ERR( "Wait failed 0x%08x\n", dwWaitReturn );
return NULL;
}
* avoid problems.
*/
EnterCriticalSection( &This->unk->DP_lock );
- DPQ_REMOVE_ENTRY( This->dp2->replysExpected, replysExpected, replyExpected.wExpectedReply,\
+ DPQ_REMOVE_ENTRY( This->dp2->repliesExpected, repliesExpected, replyExpected.wExpectedReply,
==, wCommandId, lpReplyList );
LeaveCriticalSection( &This->unk->DP_lock );
{
LPCDPMSG_FORWARDADDPLAYERNACK lpcErrorMsg;
- lpcErrorMsg = (LPCDPMSG_FORWARDADDPLAYERNACK)lpMsgBody;
+ lpcErrorMsg = lpMsgBody;
ERR( "Received error message %u. Error is %s\n",
wCommandId, DPLAYX_HresultToString( lpcErrorMsg->errorCode) );
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WINE_DPLAYX_MESSAGES__
#include "dplay_global.h"
DWORD CreateLobbyMessageReceptionThread( HANDLE hNotifyEvent, HANDLE hStart,
- HANDLE hDeath, HANDLE hConnRead );
+ HANDLE hDeath, HANDLE hConnRead ) DECLSPEC_HIDDEN;
HRESULT DP_MSG_SendRequestPlayerId( IDirectPlay2AImpl* This, DWORD dwFlags,
- LPDPID lpdipidAllocatedId );
-HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlay2AImpl* This, DPID dpidServer );
+ LPDPID lpdipidAllocatedId ) DECLSPEC_HIDDEN;
+HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlay2AImpl* This, DPID dpidServer ) DECLSPEC_HIDDEN;
void DP_MSG_ReplyReceived( IDirectPlay2AImpl* This, WORD wCommandId,
- LPCVOID lpMsgBody, DWORD dwMsgBodySize );
+ LPCVOID lpMsgBody, DWORD dwMsgBodySize ) DECLSPEC_HIDDEN;
void DP_MSG_ErrorReceived( IDirectPlay2AImpl* This, WORD wCommandId,
- LPCVOID lpMsgBody, DWORD dwMsgBodySize );
-void DP_MSG_ToSelf( IDirectPlay2AImpl* This, DPID dpidSelf );
+ LPCVOID lpMsgBody, DWORD dwMsgBodySize ) DECLSPEC_HIDDEN;
+void DP_MSG_ToSelf( IDirectPlay2AImpl* This, DPID dpidSelf ) DECLSPEC_HIDDEN;
/* Timings -> 1000 ticks/sec */
#define DPMSG_WAIT_5_SECS 5000
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* NOTES
* o Linked list implementation for dplay/dplobby. Based off of the BSD
* elm - how to find the next element
* field - to be concatenated to rc to compare with fieldToCompare
* fieldToCompare - The value that we're comparing against
- * compare_cb - Callback to invoke to determine if comparision should continue.
+ * compare_cb - Callback to invoke to determine if comparison should continue.
* Callback must be defined with DPQ_DECL_COMPARECB.
* rc - Variable to put the return code. Same type as (head).lpQHFirst
*/
* elm - how to find the next element
* field - to be concatenated to rc to compare with fieldToCompare
* fieldToCompare - The value that we're comparing against
- * compare_cb - Callback to invoke to determine if comparision should continue.
+ * compare_cb - Callback to invoke to determine if comparison should continue.
* Callback must be defined with DPQ_DECL_COMPARECB.
* rc - Variable to put the return code. Same type as (head).lpQHFirst
*/
#define DPQ_DECL_DELETECB( name, type ) void name( type elem )
/* Prototype of a method which just performs a HeapFree on the elem */
-DPQ_DECL_DELETECB( cbDeleteElemFromHeap, LPVOID );
+DPQ_DECL_DELETECB( cbDeleteElemFromHeap, LPVOID ) DECLSPEC_HIDDEN;
#endif /* __WINE_DPLAYX_QUEUE_H */
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
//#include <string.h>
/* Forward declarations for this module helper methods */
HRESULT DPL_CreateCompoundAddress ( LPCDPCOMPOUNDADDRESSELEMENT lpElements, DWORD dwElementCount,
- LPVOID lpAddress, LPDWORD lpdwAddressSize, BOOL bAnsiInterface );
+ LPVOID lpAddress, LPDWORD lpdwAddressSize, BOOL bAnsiInterface )DECLSPEC_HIDDEN;
-HRESULT DPL_CreateAddress( REFGUID guidSP, REFGUID guidDataType, LPCVOID lpData, DWORD dwDataSize,
+static HRESULT DPL_CreateAddress( REFGUID guidSP, REFGUID guidDataType, LPCVOID lpData, DWORD dwDataSize,
LPVOID lpAddress, LPDWORD lpdwAddressSize, BOOL bAnsiInterface );
extern HRESULT DPL_EnumAddress( LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, LPCVOID lpAddress,
DWORD dwAddressSize, LPVOID lpContext );
-static HRESULT WINAPI DPL_ConnectEx( IDirectPlayLobbyAImpl* This,
- DWORD dwFlags, REFIID riid,
- LPVOID* lplpDP, IUnknown* pUnk );
+static HRESULT DPL_ConnectEx( IDirectPlayLobbyAImpl* This,
+ DWORD dwFlags, REFIID riid,
+ LPVOID* lplpDP, IUnknown* pUnk );
-BOOL DPL_CreateAndSetLobbyHandles( DWORD dwDestProcessId, HANDLE hDestProcess,
+static BOOL DPL_CreateAndSetLobbyHandles( DWORD dwDestProcessId, HANDLE hDestProcess,
LPHANDLE lphStart, LPHANDLE lphDeath,
LPHANDLE lphRead );
static BOOL DPL_CreateIUnknown( LPVOID lpDPL )
{
- IDirectPlayLobbyAImpl *This = (IDirectPlayLobbyAImpl *)lpDPL;
+ IDirectPlayLobbyAImpl *This = lpDPL;
This->unk = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->unk) ) );
if ( This->unk == NULL )
}
InitializeCriticalSection( &This->unk->DPL_lock );
+ This->unk->DPL_lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": IDirectPlayLobbyAImpl*->DirectPlayLobbyIUnknownData*->DPL_lock");
return TRUE;
}
static BOOL DPL_DestroyIUnknown( LPVOID lpDPL )
{
- IDirectPlayLobbyAImpl *This = (IDirectPlayLobbyAImpl *)lpDPL;
+ IDirectPlayLobbyAImpl *This = lpDPL;
+ This->unk->DPL_lock.DebugInfo->Spare[0] = 0;
DeleteCriticalSection( &This->unk->DPL_lock );
HeapFree( GetProcessHeap(), 0, This->unk );
static BOOL DPL_CreateLobby1( LPVOID lpDPL )
{
- IDirectPlayLobbyAImpl *This = (IDirectPlayLobbyAImpl *)lpDPL;
+ IDirectPlayLobbyAImpl *This = lpDPL;
This->dpl = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->dpl) ) );
if ( This->dpl == NULL )
static BOOL DPL_DestroyLobby1( LPVOID lpDPL )
{
- IDirectPlayLobbyAImpl *This = (IDirectPlayLobbyAImpl *)lpDPL;
+ IDirectPlayLobbyAImpl *This = lpDPL;
if( This->dpl->dwMsgThread )
{
static BOOL DPL_CreateLobby2( LPVOID lpDPL )
{
- IDirectPlayLobby2AImpl *This = (IDirectPlayLobby2AImpl *)lpDPL;
+ IDirectPlayLobby2AImpl *This = lpDPL;
This->dpl2 = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->dpl2) ) );
if ( This->dpl2 == NULL )
static BOOL DPL_DestroyLobby2( LPVOID lpDPL )
{
- IDirectPlayLobby2AImpl *This = (IDirectPlayLobby2AImpl *)lpDPL;
+ IDirectPlayLobby2AImpl *This = lpDPL;
HeapFree( GetProcessHeap(), 0, This->dpl2 );
static BOOL DPL_CreateLobby3( LPVOID lpDPL )
{
- IDirectPlayLobby3AImpl *This = (IDirectPlayLobby3AImpl *)lpDPL;
+ IDirectPlayLobby3AImpl *This = lpDPL;
This->dpl3 = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->dpl3) ) );
if ( This->dpl3 == NULL )
static BOOL DPL_DestroyLobby3( LPVOID lpDPL )
{
- IDirectPlayLobby3AImpl *This = (IDirectPlayLobby3AImpl *)lpDPL;
+ IDirectPlayLobby3AImpl *This = lpDPL;
HeapFree( GetProcessHeap(), 0, This->dpl3 );
* successfully for a third interface, a query for the first interface
* through the pointer for the third interface must succeed.
*/
-extern
HRESULT DPL_CreateInterface
( REFIID riid, LPVOID* ppvObj )
{
if( IsEqualGUID( &IID_IDirectPlayLobby, riid ) )
{
- IDirectPlayLobbyWImpl *This = (IDirectPlayLobbyWImpl *)*ppvObj;
+ IDirectPlayLobbyWImpl *This = *ppvObj;
This->lpVtbl = &directPlayLobbyWVT;
}
else if( IsEqualGUID( &IID_IDirectPlayLobbyA, riid ) )
{
- IDirectPlayLobbyAImpl *This = (IDirectPlayLobbyAImpl *)*ppvObj;
+ IDirectPlayLobbyAImpl *This = *ppvObj;
This->lpVtbl = &directPlayLobbyAVT;
}
else if( IsEqualGUID( &IID_IDirectPlayLobby2, riid ) )
{
- IDirectPlayLobby2WImpl *This = (IDirectPlayLobby2WImpl *)*ppvObj;
+ IDirectPlayLobby2WImpl *This = *ppvObj;
This->lpVtbl = &directPlayLobby2WVT;
}
else if( IsEqualGUID( &IID_IDirectPlayLobby2A, riid ) )
{
- IDirectPlayLobby2AImpl *This = (IDirectPlayLobby2AImpl *)*ppvObj;
+ IDirectPlayLobby2AImpl *This = *ppvObj;
This->lpVtbl = &directPlayLobby2AVT;
}
else if( IsEqualGUID( &IID_IDirectPlayLobby3, riid ) )
{
- IDirectPlayLobby3WImpl *This = (IDirectPlayLobby3WImpl *)*ppvObj;
+ IDirectPlayLobby3WImpl *This = *ppvObj;
This->lpVtbl = &directPlayLobby3WVT;
}
else if( IsEqualGUID( &IID_IDirectPlayLobby3A, riid ) )
{
- IDirectPlayLobby3AImpl *This = (IDirectPlayLobby3AImpl *)*ppvObj;
+ IDirectPlayLobby3AImpl *This = *ppvObj;
This->lpVtbl = &directPlayLobby3AVT;
}
else
if( IsEqualGUID( &IID_IDirectPlayLobby, riid ) )
{
- IDirectPlayLobbyWImpl *This = (IDirectPlayLobbyWImpl *)*ppvObj;
+ IDirectPlayLobbyWImpl *This = *ppvObj;
This->lpVtbl = &directPlayLobbyWVT;
}
else if( IsEqualGUID( &IID_IDirectPlayLobbyA, riid ) )
{
- IDirectPlayLobbyAImpl *This = (IDirectPlayLobbyAImpl *)*ppvObj;
+ IDirectPlayLobbyAImpl *This = *ppvObj;
This->lpVtbl = &directPlayLobbyAVT;
}
else if( IsEqualGUID( &IID_IDirectPlayLobby2, riid ) )
{
- IDirectPlayLobby2WImpl *This = (IDirectPlayLobby2WImpl *)*ppvObj;
+ IDirectPlayLobby2WImpl *This = *ppvObj;
This->lpVtbl = &directPlayLobby2WVT;
}
else if( IsEqualGUID( &IID_IDirectPlayLobby2A, riid ) )
{
- IDirectPlayLobby2AImpl *This = (IDirectPlayLobby2AImpl *)*ppvObj;
+ IDirectPlayLobby2AImpl *This = *ppvObj;
This->lpVtbl = &directPlayLobby2AVT;
}
else if( IsEqualGUID( &IID_IDirectPlayLobby3, riid ) )
{
- IDirectPlayLobby3WImpl *This = (IDirectPlayLobby3WImpl *)*ppvObj;
+ IDirectPlayLobby3WImpl *This = *ppvObj;
This->lpVtbl = &directPlayLobby3WVT;
}
else if( IsEqualGUID( &IID_IDirectPlayLobby3A, riid ) )
{
- IDirectPlayLobby3AImpl *This = (IDirectPlayLobby3AImpl *)*ppvObj;
+ IDirectPlayLobby3AImpl *This = *ppvObj;
This->lpVtbl = &directPlayLobby3AVT;
}
else
ulObjRefCount = InterlockedIncrement( &This->unk->ulObjRef );
ulInterfaceRefCount = InterlockedIncrement( &This->ulInterfaceRef );
- TRACE( "ref count incremented to %lu:%lu for %p\n",
+ TRACE( "ref count incremented to %u:%u for %p\n",
ulInterfaceRefCount, ulObjRefCount, This );
return ulObjRefCount;
ulObjRefCount = InterlockedDecrement( &This->unk->ulObjRef );
ulInterfaceRefCount = InterlockedDecrement( &This->ulInterfaceRef );
- TRACE( "ref count decremented to %lu:%lu for %p\n",
+ TRACE( "ref count decremented to %u:%u for %p\n",
ulInterfaceRefCount, ulObjRefCount, This );
/* Deallocate if this is the last reference to the object */
* Returns an IDirectPlay interface.
*
*/
-static HRESULT WINAPI DPL_ConnectEx
+static HRESULT DPL_ConnectEx
( IDirectPlayLobbyAImpl* This,
DWORD dwFlags,
REFIID riid,
DWORD dwConnSize = 0;
LPDPLCONNECTION lpConn;
- FIXME("(%p)->(0x%08lx,%p,%p): semi stub\n", This, dwFlags, lplpDP, pUnk );
+ FIXME("(%p)->(0x%08x,%p,%p): semi stub\n", This, dwFlags, lplpDP, pUnk );
if( pUnk )
{
lpAddress, lpdwAddressSize, FALSE );
}
-HRESULT DPL_CreateAddress(
+static HRESULT DPL_CreateAddress(
REFGUID guidSP,
REFGUID guidDataType,
LPCVOID lpData,
const DWORD dwNumAddElements = 2; /* Service Provide & address data type */
DPCOMPOUNDADDRESSELEMENT addressElements[ 2 /* dwNumAddElements */ ];
- TRACE( "(%p)->(%p,%p,0x%08lx,%p,%p,%d)\n", guidSP, guidDataType, lpData, dwDataSize,
+ TRACE( "(%p)->(%p,%p,0x%08x,%p,%p,%d)\n", guidSP, guidDataType, lpData, dwDataSize,
lpAddress, lpdwAddressSize, bAnsiInterface );
addressElements[ 0 ].guidDataType = DPAID_ServiceProvider;
{
IDirectPlayLobbyAImpl *This = (IDirectPlayLobbyAImpl *)iface;
- TRACE("(%p)->(%p,%p,0x%08lx,%p)\n", This, lpEnumAddressCallback, lpAddress,
+ TRACE("(%p)->(%p,%p,0x%08x,%p)\n", This, lpEnumAddressCallback, lpAddress,
dwAddressSize, lpContext );
return DPL_EnumAddress( lpEnumAddressCallback, lpAddress, dwAddressSize, lpContext );
{
IDirectPlayLobbyWImpl *This = (IDirectPlayLobbyWImpl *)iface;
- TRACE("(%p)->(%p,%p,0x%08lx,%p)\n", This, lpEnumAddressCallback, lpAddress,
+ TRACE("(%p)->(%p,%p,0x%08x,%p)\n", This, lpEnumAddressCallback, lpAddress,
dwAddressSize, lpContext );
return DPL_EnumAddress( lpEnumAddressCallback, lpAddress, dwAddressSize, lpContext );
}
-extern HRESULT DPL_EnumAddress( LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, LPCVOID lpAddress,
- DWORD dwAddressSize, LPVOID lpContext )
+HRESULT DPL_EnumAddress( LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, LPCVOID lpAddress,
+ DWORD dwAddressSize, LPVOID lpContext )
{
DWORD dwTotalSizeEnumerated = 0;
while ( dwTotalSizeEnumerated < dwAddressSize )
{
- const DPADDRESS* lpElements = (const DPADDRESS*)lpAddress;
+ const DPADDRESS* lpElements = lpAddress;
DWORD dwSizeThisEnumeration;
/* Invoke the enum method. If false is returned, stop enumeration */
if ( !lpEnumAddressCallback( &lpElements->guidDataType,
lpElements->dwDataSize,
- (BYTE*)lpElements + sizeof( DPADDRESS ),
+ (const BYTE *)lpElements + sizeof( DPADDRESS ),
lpContext ) )
{
break;
char subKeyName[51];
FILETIME filetime;
- TRACE(" (%p)->(%p,%p,%p,0x%08lx)\n", This, lpEnumAddressTypeCallback, guidSP, lpContext, dwFlags );
+ TRACE(" (%p)->(%p,%p,%p,0x%08x)\n", This, lpEnumAddressTypeCallback, guidSP, lpContext, dwFlags );
if( dwFlags != 0 )
{
return DPERR_INVALIDPARAMS;
}
- if( !lpEnumAddressTypeCallback || !*lpEnumAddressTypeCallback )
+ if( !lpEnumAddressTypeCallback )
{
return DPERR_INVALIDPARAMS;
}
{
IDirectPlayLobbyWImpl *This = (IDirectPlayLobbyWImpl *)iface;
- FIXME("(%p)->(%p,%p,0x%08lx):stub\n", This, lpEnumLocalAppCallback, lpContext, dwFlags );
+ FIXME("(%p)->(%p,%p,0x%08x):stub\n", This, lpEnumLocalAppCallback, lpContext, dwFlags );
return DPERR_OUTOFMEMORY;
}
char subKeyName[51];
FILETIME filetime;
- TRACE("(%p)->(%p,%p,0x%08lx)\n", This, lpEnumLocalAppCallback, lpContext, dwFlags );
+ TRACE("(%p)->(%p,%p,0x%08x)\n", This, lpEnumLocalAppCallback, lpContext, dwFlags );
if( dwFlags != 0 )
{
return DPERR_INVALIDPARAMS;
}
- if( !lpEnumLocalAppCallback || !*lpEnumLocalAppCallback )
+ if( !lpEnumLocalAppCallback )
{
return DPERR_INVALIDPARAMS;
}
IDirectPlayLobbyAImpl *This = (IDirectPlayLobbyAImpl *)iface;
HRESULT hr;
- TRACE("(%p)->(0x%08lx,%p,%p)\n", This, dwAppID, lpData, lpdwDataSize );
+ TRACE("(%p)->(0x%08x,%p,%p)\n", This, dwAppID, lpData, lpdwDataSize );
EnterCriticalSection( &This->unk->DPL_lock );
IDirectPlayLobbyWImpl *This = (IDirectPlayLobbyWImpl *)iface;
HRESULT hr;
- TRACE("(%p)->(0x%08lx,%p,%p)\n", This, dwAppID, lpData, lpdwDataSize );
+ TRACE("(%p)->(0x%08x,%p,%p)\n", This, dwAppID, lpData, lpdwDataSize );
EnterCriticalSection( &This->unk->DPL_lock );
LPDWORD lpdwDataSize )
{
IDirectPlayLobbyAImpl *This = (IDirectPlayLobbyAImpl *)iface;
- FIXME(":stub %p %08lx %08lx %p %p %p\n", This, dwFlags, dwAppID, lpdwMessageFlags, lpData,
+ FIXME(":stub %p %08x %08x %p %p %p\n", This, dwFlags, dwAppID, lpdwMessageFlags, lpData,
lpdwDataSize );
return DPERR_OUTOFMEMORY;
}
LPDWORD lpdwDataSize )
{
IDirectPlayLobbyWImpl *This = (IDirectPlayLobbyWImpl *)iface;
- FIXME(":stub %p %08lx %08lx %p %p %p\n", This, dwFlags, dwAppID, lpdwMessageFlags, lpData,
+ FIXME(":stub %p %08x %08x %p %p %p\n", This, dwFlags, dwAppID, lpdwMessageFlags, lpData,
lpdwDataSize );
return DPERR_OUTOFMEMORY;
}
return TRUE; /* Keep enumerating, haven't found the application yet */
}
-BOOL DPL_CreateAndSetLobbyHandles( DWORD dwDestProcessId, HANDLE hDestProcess,
+static BOOL DPL_CreateAndSetLobbyHandles( DWORD dwDestProcessId, HANDLE hDestProcess,
LPHANDLE lphStart, LPHANDLE lphDeath,
LPHANDLE lphRead )
{
DWORD dwSuspendCount;
HANDLE hStart, hDeath, hSettingRead;
- TRACE( "(%p)->(0x%08lx,%p,%p,%p)\n",
+ TRACE( "(%p)->(0x%08x,%p,%p,%p)\n",
This, dwFlags, lpdwAppID, lpConn, hReceiveEvent );
if( dwFlags != 0 )
/* Our callback function will fill up the enumData structure with all the information
required to start a new process */
IDirectPlayLobby_EnumLocalApplications( iface, RunApplicationA_EnumLocalApplications,
- (LPVOID)(&enumData), 0 );
+ (&enumData), 0 );
/* First the application name */
strcpy( temp, enumData.lpszPath );
/* Reserve this global application id! */
if( !DPLAYX_CreateLobbyApplication( newProcessInfo.dwProcessId ) )
{
- ERR( "Unable to create global application data for 0x%08lx\n",
+ ERR( "Unable to create global application data for 0x%08x\n",
newProcessInfo.dwProcessId );
}
/* Unsuspend the process - should return the prev suspension count */
if( ( dwSuspendCount = ResumeThread( newProcessInfo.hThread ) ) != 1 )
{
- ERR( "ResumeThread failed with 0x%08lx\n", dwSuspendCount );
+ ERR( "ResumeThread failed with 0x%08x\n", dwSuspendCount );
}
return DP_OK;
HANDLE hReceiveEvent )
{
IDirectPlayLobbyWImpl *This = (IDirectPlayLobbyWImpl *)iface;
- FIXME( "(%p)->(0x%08lx,%p,%p,%p):stub\n", This, dwFlags, lpdwAppID, lpConn, (void *)hReceiveEvent );
+ FIXME( "(%p)->(0x%08x,%p,%p,%p):stub\n", This, dwFlags, lpdwAppID, lpConn, hReceiveEvent );
return DPERR_OUTOFMEMORY;
}
IDirectPlayLobbyWImpl *This = (IDirectPlayLobbyWImpl *)iface;
HRESULT hr;
- TRACE("(%p)->(0x%08lx,0x%08lx,%p)\n", This, dwFlags, dwAppID, lpConn );
+ TRACE("(%p)->(0x%08x,0x%08x,%p)\n", This, dwFlags, dwAppID, lpConn );
EnterCriticalSection( &This->unk->DPL_lock );
hr = DPLAYX_SetConnectionSettingsW( dwFlags, dwAppID, lpConn );
- /* FIXME: Don't think that this is supposed to fail, but the docuementation
+ /* FIXME: Don't think that this is supposed to fail, but the documentation
is somewhat sketchy. I'll try creating a lobby application
for this... */
if( hr == DPERR_NOTLOBBIED )
IDirectPlayLobbyAImpl *This = (IDirectPlayLobbyAImpl *)iface;
HRESULT hr;
- TRACE("(%p)->(0x%08lx,0x%08lx,%p)\n", This, dwFlags, dwAppID, lpConn );
+ TRACE("(%p)->(0x%08x,0x%08x,%p)\n", This, dwFlags, dwAppID, lpConn );
EnterCriticalSection( &This->unk->DPL_lock );
hr = DPLAYX_SetConnectionSettingsA( dwFlags, dwAppID, lpConn );
- /* FIXME: Don't think that this is supposed to fail, but the docuementation
+ /* FIXME: Don't think that this is supposed to fail, but the documentation
is somewhat sketchy. I'll try creating a lobby application
for this... */
if( hr == DPERR_NOTLOBBIED )
DWORD dwElements;
LPCDPCOMPOUNDADDRESSELEMENT lpOrigElements = lpElements;
- TRACE("(%p,0x%08lx,%p,%p)\n", lpElements, dwElementCount, lpAddress, lpdwAddressSize );
+ TRACE("(%p,0x%08x,%p,%p)\n", lpElements, dwElementCount, lpAddress, lpdwAddressSize );
/* Parameter check */
if( ( lpElements == NULL ) ||
/* Add the total size chunk */
{
- LPDPADDRESS lpdpAddress = (LPDPADDRESS)lpAddress;
+ LPDPADDRESS lpdpAddress = lpAddress;
- CopyMemory( &lpdpAddress->guidDataType, &DPAID_TotalSize, sizeof( GUID ) );
+ lpdpAddress->guidDataType = DPAID_TotalSize;
lpdpAddress->dwDataSize = sizeof( DWORD );
lpAddress = (char *) lpAddress + sizeof( DPADDRESS );
( IsEqualGUID( &lpElements->guidDataType, &DPAID_LobbyProvider ) )
)
{
- LPDPADDRESS lpdpAddress = (LPDPADDRESS)lpAddress;
+ LPDPADDRESS lpdpAddress = lpAddress;
- CopyMemory( &lpdpAddress->guidDataType, &lpElements->guidDataType,
- sizeof( GUID ) );
+ lpdpAddress->guidDataType = lpElements->guidDataType;
lpdpAddress->dwDataSize = sizeof( GUID );
lpAddress = (char *) lpAddress + sizeof( DPADDRESS );
( IsEqualGUID( &lpElements->guidDataType, &DPAID_INet ) )
)
{
- LPDPADDRESS lpdpAddress = (LPDPADDRESS)lpAddress;
+ LPDPADDRESS lpdpAddress = lpAddress;
- CopyMemory( &lpdpAddress->guidDataType, &lpElements->guidDataType,
- sizeof( GUID ) );
+ lpdpAddress->guidDataType = lpElements->guidDataType;
lpdpAddress->dwDataSize = lpElements->dwDataSize;
lpAddress = (char *) lpAddress + sizeof( DPADDRESS );
- lstrcpynA( (LPSTR)lpAddress,
- (LPCSTR)lpElements->lpData,
- lpElements->dwDataSize );
+ lstrcpynA( lpAddress, lpElements->lpData, lpElements->dwDataSize );
lpAddress = (char *) lpAddress + lpElements->dwDataSize;
}
else if ( ( IsEqualGUID( &lpElements->guidDataType, &DPAID_PhoneW ) ) ||
( IsEqualGUID( &lpElements->guidDataType, &DPAID_INetW ) )
)
{
- LPDPADDRESS lpdpAddress = (LPDPADDRESS)lpAddress;
+ LPDPADDRESS lpdpAddress = lpAddress;
- CopyMemory( &lpdpAddress->guidDataType, &lpElements->guidDataType,
- sizeof( GUID ) );
+ lpdpAddress->guidDataType = lpElements->guidDataType;
lpdpAddress->dwDataSize = lpElements->dwDataSize;
lpAddress = (char *) lpAddress + sizeof( DPADDRESS );
- lstrcpynW( (LPWSTR)lpAddress,
- (LPCWSTR)lpElements->lpData,
- lpElements->dwDataSize );
+ lstrcpynW( lpAddress, lpElements->lpData, lpElements->dwDataSize );
lpAddress = (char *) lpAddress + lpElements->dwDataSize * sizeof( WCHAR );
}
else if ( IsEqualGUID( &lpElements->guidDataType, &DPAID_INetPort ) )
{
- LPDPADDRESS lpdpAddress = (LPDPADDRESS)lpAddress;
+ LPDPADDRESS lpdpAddress = lpAddress;
- CopyMemory( &lpdpAddress->guidDataType, &lpElements->guidDataType,
- sizeof( GUID ) );
+ lpdpAddress->guidDataType = lpElements->guidDataType;
lpdpAddress->dwDataSize = lpElements->dwDataSize;
lpAddress = (char *) lpAddress + sizeof( DPADDRESS );
}
else if ( IsEqualGUID( &lpElements->guidDataType, &DPAID_ComPort ) )
{
- LPDPADDRESS lpdpAddress = (LPDPADDRESS)lpAddress;
+ LPDPADDRESS lpdpAddress = lpAddress;
- CopyMemory( &lpdpAddress->guidDataType, &lpElements->guidDataType,
- sizeof( GUID ) );
+ lpdpAddress->guidDataType = lpElements->guidDataType;
lpdpAddress->dwDataSize = lpElements->dwDataSize;
lpAddress = (char *) lpAddress + sizeof( DPADDRESS );
( LPDIRECTPLAYLOBBY3 iface, DWORD dwFlags )
{
HRESULT hr = DP_OK;
- BOOL bStartWait = (dwFlags & DPLWAIT_CANCEL) ? FALSE : TRUE;
+ BOOL bStartWait = !(dwFlags & DPLWAIT_CANCEL);
- TRACE( "(%p)->(0x%08lx)\n", iface, dwFlags );
+ TRACE( "(%p)->(0x%08x)\n", iface, dwFlags );
if( DPLAYX_WaitForConnectionSettings( bStartWait ) )
{
( LPDIRECTPLAYLOBBY3A iface, DWORD dwFlags )
{
HRESULT hr = DP_OK;
- BOOL bStartWait = (dwFlags & DPLWAIT_CANCEL) ? FALSE : TRUE;
+ BOOL bStartWait = !(dwFlags & DPLWAIT_CANCEL);
- TRACE( "(%p)->(0x%08lx)\n", iface, dwFlags );
+ TRACE( "(%p)->(0x%08x)\n", iface, dwFlags );
if( DPLAYX_WaitForConnectionSettings( bStartWait ) )
{
/* Note: Hack so we can reuse the old functions without compiler warnings */
#if !defined(__STRICT_ANSI__) && defined(__GNUC__)
-# define XCAST(fun) (typeof(directPlayLobby2AVT.fun))
+# define XCAST(fun) (typeof(directPlayLobby2WVT.fun))
#else
# define XCAST(fun) (void*)
#endif
LPVOID lpData,
DWORD dwDataSize )
{
- TRACE("lpGUIDDSP=%p lplpDPL=%p lpUnk=%p lpData=%p dwDataSize=%08lx\n",
+ TRACE("lpGUIDDSP=%p lplpDPL=%p lpUnk=%p lpData=%p dwDataSize=%08x\n",
lpGUIDDSP,lplpDPL,lpUnk,lpData,dwDataSize);
/* Parameter Check: lpGUIDSP, lpUnk & lpData must be NULL. dwDataSize must
LPVOID lpData,
DWORD dwDataSize )
{
- TRACE("lpGUIDDSP=%p lplpDPL=%p lpUnk=%p lpData=%p dwDataSize=%08lx\n",
+ TRACE("lpGUIDDSP=%p lplpDPL=%p lpUnk=%p lpData=%p dwDataSize=%08x\n",
lpGUIDDSP,lplpDPL,lpUnk,lpData,dwDataSize);
/* Parameter Check: lpGUIDSP, lpUnk & lpData must be NULL. dwDataSize must
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
//#include "winerror.h"
if( IsEqualGUID( &IID_IDPLobbySP, riid ) )
{
- IDPLobbySPImpl *This = (IDPLobbySPImpl *)*ppvObj;
+ IDPLobbySPImpl *This = *ppvObj;
This->lpVtbl = &dpLobbySPVT;
}
else
static BOOL DPLSP_CreateIUnknown( LPVOID lpSP )
{
- IDPLobbySPImpl *This = (IDPLobbySPImpl *)lpSP;
+ IDPLobbySPImpl *This = lpSP;
This->unk = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->unk) ) );
}
InitializeCriticalSection( &This->unk->DPLSP_lock );
+ This->unk->DPLSP_lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": IDPLobbySPImpl*->DPLobbySPIUnknownData*->DPLSP_lock");
return TRUE;
}
static BOOL DPLSP_DestroyIUnknown( LPVOID lpSP )
{
- IDPLobbySPImpl *This = (IDPLobbySPImpl *)lpSP;
+ IDPLobbySPImpl *This = lpSP;
+ This->unk->DPLSP_lock.DebugInfo->Spare[0] = 0;
DeleteCriticalSection( &This->unk->DPLSP_lock );
HeapFree( GetProcessHeap(), 0, This->unk );
static BOOL DPLSP_CreateDPLobbySP( LPVOID lpSP, IDirectPlay2Impl* dp )
{
- IDPLobbySPImpl *This = (IDPLobbySPImpl *)lpSP;
+ IDPLobbySPImpl *This = lpSP;
This->sp = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->sp) ) );
static BOOL DPLSP_DestroyDPLobbySP( LPVOID lpSP )
{
- IDPLobbySPImpl *This = (IDPLobbySPImpl *)lpSP;
+ IDPLobbySPImpl *This = lpSP;
HeapFree( GetProcessHeap(), 0, This->sp );
if( IsEqualGUID( &IID_IDPLobbySP, riid ) )
{
- IDPLobbySPImpl *This = (IDPLobbySPImpl *)*ppvObj;
+ IDPLobbySPImpl *This = *ppvObj;
This->lpVtbl = &dpLobbySPVT;
}
else
ulObjRefCount = InterlockedIncrement( &This->unk->ulObjRef );
ulInterfaceRefCount = InterlockedIncrement( &This->ulInterfaceRef );
- TRACE( "ref count incremented to %lu:%lu for %p\n",
+ TRACE( "ref count incremented to %u:%u for %p\n",
ulInterfaceRefCount, ulObjRefCount, This );
return ulObjRefCount;
ulObjRefCount = InterlockedDecrement( &This->unk->ulObjRef );
ulInterfaceRefCount = InterlockedDecrement( &This->ulInterfaceRef );
- TRACE( "ref count decremented to %lu:%lu for %p\n",
+ TRACE( "ref count decremented to %u:%u for %p\n",
ulInterfaceRefCount, ulObjRefCount, This );
/* Deallocate if this is the last reference to the object */
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WINE_LOBBY_SP_H
LPDPNAME lpName;
} SPDATA_ADDREMOTEPLAYERTOGROUP, *LPSPDATA_ADDREMOTEPLAYERTOGROUP;
-typedef struct SPDATA_BUILDPARENTALHEIRARCHY
+typedef struct SPDATA_BUILDPARENTALHIERARCHY
{
DWORD dwSize;
LPDPLOBBYSP lpISP;
DWORD dwGroupID;
DWORD dwMessage;
DWORD dwParentID;
-} SPDATA_BUILDPARENTALHEIRARCHY, *LPSPDATA_BUILDPARENTALHEIRARCHY;
+} SPDATA_BUILDPARENTALHIERARCHY, *LPSPDATA_BUILDPARENTALHIERARCHY;
typedef struct SPDATA_CLOSE
{
/* Prototypes for callbacks returned by DPLSPInit */
typedef HRESULT (WINAPI *LPSP_ADDGROUPTOGROUP)(LPSPDATA_ADDGROUPTOGROUP);
typedef HRESULT (WINAPI *LPSP_ADDPLAYERTOGROUP)(LPSPDATA_ADDPLAYERTOGROUP);
-typedef HRESULT (WINAPI *LPSP_BUILDPARENTALHEIRARCHY)(LPSPDATA_BUILDPARENTALHEIRARCHY);
+typedef HRESULT (WINAPI *LPSP_BUILDPARENTALHIERARCHY)(LPSPDATA_BUILDPARENTALHIERARCHY);
typedef HRESULT (WINAPI *LPSP_CLOSE)(LPSPDATA_CLOSE);
typedef HRESULT (WINAPI *LPSP_CREATEGROUP)(LPSPDATA_CREATEGROUP);
typedef HRESULT (WINAPI *LPSP_CREATEGROUPINGROUP)(LPSPDATA_CREATEGROUPINGROUP);
DWORD dwFlags;
LPSP_ADDGROUPTOGROUP AddGroupToGroup;
LPSP_ADDPLAYERTOGROUP AddPlayerToGroup;
- LPSP_BUILDPARENTALHEIRARCHY BuildParentalHeirarchy;
+ LPSP_BUILDPARENTALHIERARCHY BuildParentalHierarchy;
LPSP_CLOSE Close;
LPSP_CREATEGROUP CreateGroup;
LPSP_CREATEGROUPINGROUP CreateGroupInGroup;
} SPDATA_INIT, *LPSPDATA_INIT;
typedef HRESULT (WINAPI *LPSP_INIT)(LPSPDATA_INIT);
-HRESULT WINAPI DPLSPInit(LPSPDATA_INIT);
+HRESULT WINAPI DPLSPInit(LPSPDATA_INIT) DECLSPEC_HIDDEN;
/* Define the COM interface */
#define INTERFACE IDPLobbySP
/* This variable is exported from the DLL at ordinal 6 to be accessed by the
* SP directly. This is the same variable that the DP SP will use.
*/
-extern DWORD gdwDPlaySPRefCount;
+extern DWORD gdwDPlaySPRefCount DECLSPEC_HIDDEN;
#endif
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/* NOTE: Methods with the NS_ prefix are name server methods */
typedef struct NSCache NSCache, *lpNSCache;
/* Function prototypes */
-DPQ_DECL_DELETECB( cbDeleteNSNodeFromHeap, lpNSCacheData );
+static DPQ_DECL_DELETECB( cbDeleteNSNodeFromHeap, lpNSCacheData );
/* Name Server functions
* ---------------------
*/
void NS_SetLocalComputerAsNameServer( LPCDPSESSIONDESC2 lpsd, LPVOID lpNSInfo )
{
-#if 0
- /* FIXME: Remove this method? */
- DPLAYX_SetLocalSession( lpsd );
-#endif
lpNSCache lpCache = (lpNSCache)lpNSInfo;
lpCache->bNsIsLocal = TRUE;
}
-void NS_SetRemoteComputerAsNameServer( LPCDPSESSIONDESC2 lpsd, LPVOID lpNSInfo )
-{
- lpNSCache lpCache = (lpNSCache)lpNSInfo;
-
- lpCache->bNsIsLocal = FALSE;
-}
-
static DPQ_DECL_COMPARECB( cbUglyPig, GUID )
{
return IsEqualGUID( elem1, elem2 );
}
/* Store the given NS remote address for future reference */
-/* FIXME: LPDPMSG_ENUMSESSIONSREPLY should be const */
-void NS_AddRemoteComputerAsNameServer( LPCVOID lpcNSAddrHdr,
- DWORD dwHdrSize,
- LPDPMSG_ENUMSESSIONSREPLY lpMsg,
- LPVOID lpNSInfo )
+void NS_AddRemoteComputerAsNameServer( LPCVOID lpcNSAddrHdr,
+ DWORD dwHdrSize,
+ LPCDPMSG_ENUMSESSIONSREPLY lpcMsg,
+ LPVOID lpNSInfo )
{
DWORD len;
lpNSCache lpCache = (lpNSCache)lpNSInfo;
lpNSCacheData lpCacheNode;
- TRACE( "%p, %p, %p\n", lpcNSAddrHdr, lpMsg, lpNSInfo );
+ TRACE( "%p, %p, %p\n", lpcNSAddrHdr, lpcMsg, lpNSInfo );
/* See if we can find this session. If we can, remove it as it's a dup */
DPQ_REMOVE_ENTRY_CB( lpCache->first, next, data->guidInstance, cbUglyPig,
- lpMsg->sd.guidInstance, lpCacheNode );
+ lpcMsg->sd.guidInstance, lpCacheNode );
if( lpCacheNode != NULL )
{
if( lpCacheNode->data == NULL )
{
ERR( "no memory for SESSIONDESC2\n" );
+ HeapFree( GetProcessHeap(), 0, lpCacheNode );
return;
}
- CopyMemory( lpCacheNode->data, &lpMsg->sd, sizeof( *lpCacheNode->data ) );
- len = WideCharToMultiByte( CP_ACP, 0, (LPWSTR)(lpMsg+1), -1, NULL, 0, NULL, NULL );
- if ((lpCacheNode->data->lpszSessionNameA = HeapAlloc( GetProcessHeap(), 0, len )))
+ *lpCacheNode->data = lpcMsg->sd;
+ len = WideCharToMultiByte( CP_ACP, 0, (LPCWSTR)(lpcMsg+1), -1, NULL, 0, NULL, NULL );
+ if ((lpCacheNode->data->u1.lpszSessionNameA = HeapAlloc( GetProcessHeap(), 0, len )))
{
- WideCharToMultiByte( CP_ACP, 0, (LPWSTR)(lpMsg+1), -1,
- lpCacheNode->data->lpszSessionNameA, len, NULL, NULL );
+ WideCharToMultiByte( CP_ACP, 0, (LPCWSTR)(lpcMsg+1), -1,
+ lpCacheNode->data->u1.lpszSessionNameA, len, NULL, NULL );
}
lpCacheNode->dwTime = timeGetTime();
/* Ok. Cheat and don't search for the correct stuff just take the first.
* FIXME: In the future how are we to know what is _THE_ enum we used?
* This is going to have to go into dplay somehow. Perhaps it
- * comes back with app server id for the join command! Oh...that
+ * comes back with app server id for the join command! Oh... that
* must be it. That would make this method obsolete once that's
* in place.
*/
/* Get the magic number associated with the Name Server */
DWORD NS_GetNsMagic( LPVOID lpNSInfo )
{
- LPDWORD lpHdrInfo = (LPDWORD)NS_GetNSAddr( lpNSInfo );
+ LPDWORD lpHdrInfo = NS_GetNSAddr( lpNSInfo );
return lpHdrInfo[1];
}
-/* Get the magic number associated with the non NS end */
-DWORD NS_GetOtherMagic( LPVOID lpNSInfo )
-{
- lpNSCache lpCache = (lpNSCache)lpNSInfo;
-
- return ((LPDWORD)lpCache->lpLocalAddrHdr)[1];
-}
-
void NS_SetLocalAddr( LPVOID lpNSInfo, LPCVOID lpHdr, DWORD dwHdrSize )
{
lpNSCache lpCache = (lpNSCache)lpNSInfo;
*/
HRESULT NS_SendSessionRequestBroadcast( LPCGUID lpcGuid,
DWORD dwFlags,
- LPSPINITDATA lpSpData )
+ const SPINITDATA *lpSpData )
{
DPSP_ENUMSESSIONSDATA data;
data.lpMessage = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
data.dwMessageSize );
data.lpISP = lpSpData->lpISP;
- data.bReturnStatus = (dwFlags & DPENUMSESSIONS_RETURNSTATUS) ? TRUE : FALSE;
+ data.bReturnStatus = (dwFlags & DPENUMSESSIONS_RETURNSTATUS) != 0;
lpMsg = (LPDPMSG_ENUMSESSIONSREQUEST)(((BYTE*)data.lpMessage)+lpSpData->dwSPHeaderSize);
lpMsg->dwPasswordSize = 0; /* FIXME: If enumerating passwords..? */
lpMsg->dwFlags = dwFlags;
- CopyMemory( &lpMsg->guidApplication, lpcGuid, sizeof( *lpcGuid ) );
+ lpMsg->guidApplication = *lpcGuid;
return (lpSpData->lpCB->EnumSessions)( &data );
}
/* Delete a name server node which has been allocated on the heap */
-DPQ_DECL_DELETECB( cbDeleteNSNodeFromHeap, lpNSCacheData )
+static DPQ_DECL_DELETECB( cbDeleteNSNodeFromHeap, lpNSCacheData )
{
/* NOTE: This proc doesn't deal with the walking pointer */
DWORD dwVariableSize;
DWORD dwVariableLen;
/* LPCDPMSG_ENUMSESSIONSREQUEST msg = (LPDPMSG_ENUMSESSIONSREQUEST)lpcMsg; */
- BOOL bAnsi = TRUE; /* FIXME: This needs to be in the DPLAY interface */
-
- FIXME( ": few fixed + need to check request for response\n" );
- if (bAnsi)
- {
- dwVariableLen = MultiByteToWideChar( CP_ACP, 0,
- lpDP->dp2->lpSessionDesc->lpszSessionNameA,
- -1, NULL, 0 );
- }
- else
- {
- dwVariableLen = strlenW( lpDP->dp2->lpSessionDesc->lpszSessionName ) + 1;
- }
+ /* FIXME: Should handle ANSI or WIDECHAR input. Currently just ANSI input */
+ FIXME( ": few fixed + need to check request for response, might need UNICODE input ability.\n" );
+ dwVariableLen = MultiByteToWideChar( CP_ACP, 0,
+ lpDP->dp2->lpSessionDesc->u1.lpszSessionNameA,
+ -1, NULL, 0 );
dwVariableSize = dwVariableLen * sizeof( WCHAR );
*lpdwReplySize = lpDP->dp2->spData.dwSPHeaderSize +
rmsg->envelope.wVersion = DPMSGVER_DP6;
CopyMemory( &rmsg->sd, lpDP->dp2->lpSessionDesc,
- sizeof( lpDP->dp2->lpSessionDesc->dwSize ) );
+ lpDP->dp2->lpSessionDesc->dwSize );
rmsg->dwUnknown = 0x0000005c;
- if( bAnsi )
- {
- MultiByteToWideChar( CP_ACP, 0, lpDP->dp2->lpSessionDesc->lpszSessionNameA, -1,
- (LPWSTR)(rmsg+1), dwVariableLen );
- }
- else
- {
- strcpyW( (LPWSTR)(rmsg+1), lpDP->dp2->lpSessionDesc->lpszSessionName );
- }
+ MultiByteToWideChar( CP_ACP, 0, lpDP->dp2->lpSessionDesc->u1.lpszSessionNameA, -1,
+ (LPWSTR)(rmsg+1), dwVariableLen );
}
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WINE_DPLAYX_NAMESERVER
#include "dplayx_messages.h"
//#include "dplay_global.h"
-void NS_SetLocalComputerAsNameServer( LPCDPSESSIONDESC2 lpsd, LPVOID lpNSInfo );
-void NS_SetRemoteComputerAsNameServer( LPCDPSESSIONDESC2 lpsd, LPVOID lpNSInfo );
+void NS_SetLocalComputerAsNameServer( LPCDPSESSIONDESC2 lpsd, LPVOID lpNSInfo ) DECLSPEC_HIDDEN;
void NS_AddRemoteComputerAsNameServer( LPCVOID lpNSAddrHdr,
DWORD dwHdrSize,
- LPDPMSG_ENUMSESSIONSREPLY lpMsg,
- LPVOID lpNSInfo );
-LPVOID NS_GetNSAddr( LPVOID lpNSInfo );
-DWORD NS_GetNsMagic( LPVOID lpNSInfo );
-DWORD NS_GetOtherMagic( LPVOID lpNSInfo );
-void NS_SetLocalAddr( LPVOID lpNSInfo, LPCVOID lpHdr, DWORD dwHdrSize );
+ LPCDPMSG_ENUMSESSIONSREPLY lpcMsg,
+ LPVOID lpNSInfo ) DECLSPEC_HIDDEN;
+LPVOID NS_GetNSAddr( LPVOID lpNSInfo ) DECLSPEC_HIDDEN;
+DWORD NS_GetNsMagic( LPVOID lpNSInfo ) DECLSPEC_HIDDEN;
+void NS_SetLocalAddr( LPVOID lpNSInfo, LPCVOID lpHdr, DWORD dwHdrSize ) DECLSPEC_HIDDEN;
void NS_ReplyToEnumSessionsRequest( LPCVOID lpcMsg,
LPVOID* lplpReplyData,
LPDWORD lpdwReplySize,
- IDirectPlay2Impl* lpDP );
+ IDirectPlay2Impl* lpDP ) DECLSPEC_HIDDEN;
HRESULT NS_SendSessionRequestBroadcast( LPCGUID lpcGuid,
DWORD dwFlags,
- LPSPINITDATA lpSpData );
+ const SPINITDATA *lpSpData ) DECLSPEC_HIDDEN;
-BOOL NS_InitializeSessionCache( LPVOID* lplpNSInfo );
-void NS_DeleteSessionCache( LPVOID lpNSInfo );
-void NS_InvalidateSessionCache( LPVOID lpNSInfo );
+BOOL NS_InitializeSessionCache( LPVOID* lplpNSInfo ) DECLSPEC_HIDDEN;
+void NS_DeleteSessionCache( LPVOID lpNSInfo ) DECLSPEC_HIDDEN;
+void NS_InvalidateSessionCache( LPVOID lpNSInfo ) DECLSPEC_HIDDEN;
-void NS_ResetSessionEnumeration( LPVOID lpNSInfo );
-LPDPSESSIONDESC2 NS_WalkSessions( LPVOID lpNSInfo );
-void NS_PruneSessionCache( LPVOID lpNSInfo );
+void NS_ResetSessionEnumeration( LPVOID lpNSInfo ) DECLSPEC_HIDDEN;
+LPDPSESSIONDESC2 NS_WalkSessions( LPVOID lpNSInfo ) DECLSPEC_HIDDEN;
+void NS_PruneSessionCache( LPVOID lpNSInfo ) DECLSPEC_HIDDEN;
#endif /* __WINE_DPLAYX_NAMESERVER */
+++ /dev/null
-/*
- * self-registerable dll functions for dplayx.dll
- *
- * Copyright (C) 2003 John K. Hohm
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#define WIN32_NO_STATUS
-#define _INC_WINDOWS
-#define COM_NO_WINDOWS_H
-
-#include <stdarg.h>
-//#include <string.h>
-
-#include <windef.h>
-#include <winbase.h>
-//#include "winuser.h"
-#include <winreg.h>
-//#include "winerror.h"
-
-//#include "dplay.h"
-#include <dplobby.h>
-
-#include <wine/debug.h>
-
-WINE_DEFAULT_DEBUG_CHANNEL(dplayx);
-
-/*
- * Near the bottom of this file are the exported DllRegisterServer and
- * DllUnregisterServer, which make all this worthwhile.
- */
-
-/***********************************************************************
- * interface for self-registering
- */
-struct regsvr_interface
-{
- IID const *iid; /* NULL for end of list */
- LPCSTR name; /* can be NULL to omit */
- IID const *base_iid; /* can be NULL to omit */
- int num_methods; /* can be <0 to omit */
- CLSID const *ps_clsid; /* can be NULL to omit */
- CLSID const *ps_clsid32; /* can be NULL to omit */
-};
-
-static HRESULT register_interfaces(struct regsvr_interface const *list);
-static HRESULT unregister_interfaces(struct regsvr_interface const *list);
-
-struct regsvr_coclass
-{
- CLSID const *clsid; /* NULL for end of list */
- LPCSTR name; /* can be NULL to omit */
- LPCSTR ips; /* can be NULL to omit */
- LPCSTR ips32; /* can be NULL to omit */
- LPCSTR ips32_tmodel; /* can be NULL to omit */
- LPCSTR progid; /* can be NULL to omit */
- LPCSTR viprogid; /* can be NULL to omit */
- LPCSTR progid_extra; /* can be NULL to omit */
-};
-
-static HRESULT register_coclasses(struct regsvr_coclass const *list);
-static HRESULT unregister_coclasses(struct regsvr_coclass const *list);
-
-/***********************************************************************
- * static string constants
- */
-static WCHAR const interface_keyname[10] = {
- 'I', 'n', 't', 'e', 'r', 'f', 'a', 'c', 'e', 0 };
-static WCHAR const base_ifa_keyname[14] = {
- 'B', 'a', 's', 'e', 'I', 'n', 't', 'e', 'r', 'f', 'a', 'c',
- 'e', 0 };
-static WCHAR const num_methods_keyname[11] = {
- 'N', 'u', 'm', 'M', 'e', 't', 'h', 'o', 'd', 's', 0 };
-static WCHAR const ps_clsid_keyname[15] = {
- 'P', 'r', 'o', 'x', 'y', 'S', 't', 'u', 'b', 'C', 'l', 's',
- 'i', 'd', 0 };
-static WCHAR const ps_clsid32_keyname[17] = {
- 'P', 'r', 'o', 'x', 'y', 'S', 't', 'u', 'b', 'C', 'l', 's',
- 'i', 'd', '3', '2', 0 };
-static WCHAR const clsid_keyname[6] = {
- 'C', 'L', 'S', 'I', 'D', 0 };
-static WCHAR const curver_keyname[7] = {
- 'C', 'u', 'r', 'V', 'e', 'r', 0 };
-static WCHAR const ips_keyname[13] = {
- 'I', 'n', 'P', 'r', 'o', 'c', 'S', 'e', 'r', 'v', 'e', 'r',
- 0 };
-static WCHAR const ips32_keyname[15] = {
- 'I', 'n', 'P', 'r', 'o', 'c', 'S', 'e', 'r', 'v', 'e', 'r',
- '3', '2', 0 };
-static WCHAR const progid_keyname[7] = {
- 'P', 'r', 'o', 'g', 'I', 'D', 0 };
-static WCHAR const viprogid_keyname[25] = {
- 'V', 'e', 'r', 's', 'i', 'o', 'n', 'I', 'n', 'd', 'e', 'p',
- 'e', 'n', 'd', 'e', 'n', 't', 'P', 'r', 'o', 'g', 'I', 'D',
- 0 };
-static char const tmodel_valuename[] = "ThreadingModel";
-
-/***********************************************************************
- * static helper functions
- */
-static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid);
-static LONG register_key_defvalueW(HKEY base, WCHAR const *name,
- WCHAR const *value);
-static LONG register_key_defvalueA(HKEY base, WCHAR const *name,
- char const *value);
-static LONG register_progid(WCHAR const *clsid,
- char const *progid, char const *curver_progid,
- char const *name, char const *extra);
-static LONG recursive_delete_key(HKEY key);
-static LONG recursive_delete_keyA(HKEY base, char const *name);
-static LONG recursive_delete_keyW(HKEY base, WCHAR const *name);
-
-/***********************************************************************
- * register_interfaces
- */
-static HRESULT register_interfaces(struct regsvr_interface const *list)
-{
- LONG res = ERROR_SUCCESS;
- HKEY interface_key;
-
- res = RegCreateKeyExW(HKEY_CLASSES_ROOT, interface_keyname, 0, NULL, 0,
- KEY_READ | KEY_WRITE, NULL, &interface_key, NULL);
- if (res != ERROR_SUCCESS) goto error_return;
-
- for (; res == ERROR_SUCCESS && list->iid; ++list) {
- WCHAR buf[39];
- HKEY iid_key;
-
- StringFromGUID2(list->iid, buf, 39);
- res = RegCreateKeyExW(interface_key, buf, 0, NULL, 0,
- KEY_READ | KEY_WRITE, NULL, &iid_key, NULL);
- if (res != ERROR_SUCCESS) goto error_close_interface_key;
-
- if (list->name) {
- res = RegSetValueExA(iid_key, NULL, 0, REG_SZ,
- (CONST BYTE*)(list->name),
- strlen(list->name) + 1);
- if (res != ERROR_SUCCESS) goto error_close_iid_key;
- }
-
- if (list->base_iid) {
- register_key_guid(iid_key, base_ifa_keyname, list->base_iid);
- if (res != ERROR_SUCCESS) goto error_close_iid_key;
- }
-
- if (0 <= list->num_methods) {
- static WCHAR const fmt[3] = { '%', 'd', 0 };
- HKEY key;
-
- res = RegCreateKeyExW(iid_key, num_methods_keyname, 0, NULL, 0,
- KEY_READ | KEY_WRITE, NULL, &key, NULL);
- if (res != ERROR_SUCCESS) goto error_close_iid_key;
-
- wsprintfW(buf, fmt, list->num_methods);
- res = RegSetValueExW(key, NULL, 0, REG_SZ,
- (CONST BYTE*)buf,
- (lstrlenW(buf) + 1) * sizeof(WCHAR));
- RegCloseKey(key);
-
- if (res != ERROR_SUCCESS) goto error_close_iid_key;
- }
-
- if (list->ps_clsid) {
- register_key_guid(iid_key, ps_clsid_keyname, list->ps_clsid);
- if (res != ERROR_SUCCESS) goto error_close_iid_key;
- }
-
- if (list->ps_clsid32) {
- register_key_guid(iid_key, ps_clsid32_keyname, list->ps_clsid32);
- if (res != ERROR_SUCCESS) goto error_close_iid_key;
- }
-
- error_close_iid_key:
- RegCloseKey(iid_key);
- }
-
-error_close_interface_key:
- RegCloseKey(interface_key);
-error_return:
- return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
-}
-
-/***********************************************************************
- * unregister_interfaces
- */
-static HRESULT unregister_interfaces(struct regsvr_interface const *list)
-{
- LONG res = ERROR_SUCCESS;
- HKEY interface_key;
-
- res = RegOpenKeyExW(HKEY_CLASSES_ROOT, interface_keyname, 0,
- KEY_READ | KEY_WRITE, &interface_key);
- if (res == ERROR_FILE_NOT_FOUND) return S_OK;
- if (res != ERROR_SUCCESS) goto error_return;
-
- for (; res == ERROR_SUCCESS && list->iid; ++list) {
- WCHAR buf[39];
-
- StringFromGUID2(list->iid, buf, 39);
- res = recursive_delete_keyW(interface_key, buf);
- }
-
- RegCloseKey(interface_key);
-error_return:
- return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
-}
-
-/***********************************************************************
- * register_coclasses
- */
-static HRESULT register_coclasses(struct regsvr_coclass const *list)
-{
- LONG res = ERROR_SUCCESS;
- HKEY coclass_key;
-
- res = RegCreateKeyExW(HKEY_CLASSES_ROOT, clsid_keyname, 0, NULL, 0,
- KEY_READ | KEY_WRITE, NULL, &coclass_key, NULL);
- if (res != ERROR_SUCCESS) goto error_return;
-
- for (; res == ERROR_SUCCESS && list->clsid; ++list) {
- WCHAR buf[39];
- HKEY clsid_key;
-
- StringFromGUID2(list->clsid, buf, 39);
- res = RegCreateKeyExW(coclass_key, buf, 0, NULL, 0,
- KEY_READ | KEY_WRITE, NULL, &clsid_key, NULL);
- if (res != ERROR_SUCCESS) goto error_close_coclass_key;
-
- if (list->name) {
- res = RegSetValueExA(clsid_key, NULL, 0, REG_SZ,
- (CONST BYTE*)(list->name),
- strlen(list->name) + 1);
- if (res != ERROR_SUCCESS) goto error_close_clsid_key;
- }
-
- if (list->ips) {
- res = register_key_defvalueA(clsid_key, ips_keyname, list->ips);
- if (res != ERROR_SUCCESS) goto error_close_clsid_key;
- }
-
- if (list->ips32) {
- HKEY ips32_key;
-
- res = RegCreateKeyExW(clsid_key, ips32_keyname, 0, NULL, 0,
- KEY_READ | KEY_WRITE, NULL,
- &ips32_key, NULL);
- if (res != ERROR_SUCCESS) goto error_close_clsid_key;
-
- res = RegSetValueExA(ips32_key, NULL, 0, REG_SZ,
- (CONST BYTE*)list->ips32,
- lstrlenA(list->ips32) + 1);
- if (res == ERROR_SUCCESS && list->ips32_tmodel)
- res = RegSetValueExA(ips32_key, tmodel_valuename, 0, REG_SZ,
- (CONST BYTE*)list->ips32_tmodel,
- strlen(list->ips32_tmodel) + 1);
- RegCloseKey(ips32_key);
- if (res != ERROR_SUCCESS) goto error_close_clsid_key;
- }
-
- if (list->progid) {
- res = register_key_defvalueA(clsid_key, progid_keyname,
- list->progid);
- if (res != ERROR_SUCCESS) goto error_close_clsid_key;
-
- res = register_progid(buf, list->progid, NULL,
- list->name, list->progid_extra);
- if (res != ERROR_SUCCESS) goto error_close_clsid_key;
- }
-
- if (list->viprogid) {
- res = register_key_defvalueA(clsid_key, viprogid_keyname,
- list->viprogid);
- if (res != ERROR_SUCCESS) goto error_close_clsid_key;
-
- res = register_progid(buf, list->viprogid, list->progid,
- list->name, list->progid_extra);
- if (res != ERROR_SUCCESS) goto error_close_clsid_key;
- }
-
- error_close_clsid_key:
- RegCloseKey(clsid_key);
- }
-
-error_close_coclass_key:
- RegCloseKey(coclass_key);
-error_return:
- return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
-}
-
-/***********************************************************************
- * unregister_coclasses
- */
-static HRESULT unregister_coclasses(struct regsvr_coclass const *list)
-{
- LONG res = ERROR_SUCCESS;
- HKEY coclass_key;
-
- res = RegOpenKeyExW(HKEY_CLASSES_ROOT, clsid_keyname, 0,
- KEY_READ | KEY_WRITE, &coclass_key);
- if (res == ERROR_FILE_NOT_FOUND) return S_OK;
- if (res != ERROR_SUCCESS) goto error_return;
-
- for (; res == ERROR_SUCCESS && list->clsid; ++list) {
- WCHAR buf[39];
-
- StringFromGUID2(list->clsid, buf, 39);
- res = recursive_delete_keyW(coclass_key, buf);
- if (res != ERROR_SUCCESS) goto error_close_coclass_key;
-
- if (list->progid) {
- res = recursive_delete_keyA(HKEY_CLASSES_ROOT, list->progid);
- if (res != ERROR_SUCCESS) goto error_close_coclass_key;
- }
-
- if (list->viprogid) {
- res = recursive_delete_keyA(HKEY_CLASSES_ROOT, list->viprogid);
- if (res != ERROR_SUCCESS) goto error_close_coclass_key;
- }
- }
-
-error_close_coclass_key:
- RegCloseKey(coclass_key);
-error_return:
- return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
-}
-
-/***********************************************************************
- * regsvr_key_guid
- */
-static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid)
-{
- WCHAR buf[39];
-
- StringFromGUID2(guid, buf, 39);
- return register_key_defvalueW(base, name, buf);
-}
-
-/***********************************************************************
- * regsvr_key_defvalueW
- */
-static LONG register_key_defvalueW(
- HKEY base,
- WCHAR const *name,
- WCHAR const *value)
-{
- LONG res;
- HKEY key;
-
- res = RegCreateKeyExW(base, name, 0, NULL, 0,
- KEY_READ | KEY_WRITE, NULL, &key, NULL);
- if (res != ERROR_SUCCESS) return res;
- res = RegSetValueExW(key, NULL, 0, REG_SZ, (CONST BYTE*)value,
- (lstrlenW(value) + 1) * sizeof(WCHAR));
- RegCloseKey(key);
- return res;
-}
-
-/***********************************************************************
- * regsvr_key_defvalueA
- */
-static LONG register_key_defvalueA(
- HKEY base,
- WCHAR const *name,
- char const *value)
-{
- LONG res;
- HKEY key;
-
- res = RegCreateKeyExW(base, name, 0, NULL, 0,
- KEY_READ | KEY_WRITE, NULL, &key, NULL);
- if (res != ERROR_SUCCESS) return res;
- res = RegSetValueExA(key, NULL, 0, REG_SZ, (CONST BYTE*)value,
- lstrlenA(value) + 1);
- RegCloseKey(key);
- return res;
-}
-
-/***********************************************************************
- * regsvr_progid
- */
-static LONG register_progid(
- WCHAR const *clsid,
- char const *progid,
- char const *curver_progid,
- char const *name,
- char const *extra)
-{
- LONG res;
- HKEY progid_key;
-
- res = RegCreateKeyExA(HKEY_CLASSES_ROOT, progid, 0,
- NULL, 0, KEY_READ | KEY_WRITE, NULL,
- &progid_key, NULL);
- if (res != ERROR_SUCCESS) return res;
-
- if (name) {
- res = RegSetValueExA(progid_key, NULL, 0, REG_SZ,
- (CONST BYTE*)name, strlen(name) + 1);
- if (res != ERROR_SUCCESS) goto error_close_progid_key;
- }
-
- if (clsid) {
- res = register_key_defvalueW(progid_key, clsid_keyname, clsid);
- if (res != ERROR_SUCCESS) goto error_close_progid_key;
- }
-
- if (curver_progid) {
- res = register_key_defvalueA(progid_key, curver_keyname,
- curver_progid);
- if (res != ERROR_SUCCESS) goto error_close_progid_key;
- }
-
- if (extra) {
- HKEY extra_key;
-
- res = RegCreateKeyExA(progid_key, extra, 0,
- NULL, 0, KEY_READ | KEY_WRITE, NULL,
- &extra_key, NULL);
- if (res == ERROR_SUCCESS)
- RegCloseKey(extra_key);
- }
-
-error_close_progid_key:
- RegCloseKey(progid_key);
- return res;
-}
-
-/***********************************************************************
- * recursive_delete_key
- */
-static LONG recursive_delete_key(HKEY key)
-{
- LONG res;
- WCHAR subkey_name[MAX_PATH];
- DWORD cName;
- HKEY subkey;
-
- for (;;) {
- cName = sizeof(subkey_name) / sizeof(WCHAR);
- res = RegEnumKeyExW(key, 0, subkey_name, &cName,
- NULL, NULL, NULL, NULL);
- if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA) {
- res = ERROR_SUCCESS; /* presumably we're done enumerating */
- break;
- }
- res = RegOpenKeyExW(key, subkey_name, 0,
- KEY_READ | KEY_WRITE, &subkey);
- if (res == ERROR_FILE_NOT_FOUND) continue;
- if (res != ERROR_SUCCESS) break;
-
- res = recursive_delete_key(subkey);
- RegCloseKey(subkey);
- if (res != ERROR_SUCCESS) break;
- }
-
- if (res == ERROR_SUCCESS) res = RegDeleteKeyW(key, 0);
- return res;
-}
-
-/***********************************************************************
- * recursive_delete_keyA
- */
-static LONG recursive_delete_keyA(HKEY base, char const *name)
-{
- LONG res;
- HKEY key;
-
- res = RegOpenKeyExA(base, name, 0, KEY_READ | KEY_WRITE, &key);
- if (res == ERROR_FILE_NOT_FOUND) return ERROR_SUCCESS;
- if (res != ERROR_SUCCESS) return res;
- res = recursive_delete_key(key);
- RegCloseKey(key);
- return res;
-}
-
-/***********************************************************************
- * recursive_delete_keyW
- */
-static LONG recursive_delete_keyW(HKEY base, WCHAR const *name)
-{
- LONG res;
- HKEY key;
-
- res = RegOpenKeyExW(base, name, 0, KEY_READ | KEY_WRITE, &key);
- if (res == ERROR_FILE_NOT_FOUND) return ERROR_SUCCESS;
- if (res != ERROR_SUCCESS) return res;
- res = recursive_delete_key(key);
- RegCloseKey(key);
- return res;
-}
-
-/***********************************************************************
- * coclass list
- */
-static struct regsvr_coclass const coclass_list[] = {
- { &CLSID_DirectPlay,
- "DirectPlay Object",
- NULL,
- "dplayx.dll",
- "Both"
- },
- { &CLSID_DirectPlayLobby,
- "DirectPlayLobby Object",
- NULL,
- "dplayx.dll",
- "Both"
- },
- { NULL } /* list terminator */
-};
-
-/***********************************************************************
- * interface list
- */
-
-static struct regsvr_interface const interface_list[] = {
- { NULL } /* list terminator */
-};
-
-/***********************************************************************
- * DllRegisterServer (DPLAYX.@)
- */
-HRESULT WINAPI DllRegisterServer(void)
-{
- HRESULT hr;
-
- TRACE("\n");
-
- hr = register_coclasses(coclass_list);
- if (SUCCEEDED(hr))
- hr = register_interfaces(interface_list);
- return hr;
-}
-
-/***********************************************************************
- * DllUnregisterServer (DPLAYX.@)
- */
-HRESULT WINAPI DllUnregisterServer(void)
-{
- HRESULT hr;
-
- TRACE("\n");
-
- hr = unregister_coclasses(coclass_list);
- if (SUCCEEDED(hr))
- hr = unregister_interfaces(interface_list);
- return hr;
-}
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#define WINE_OLESELFREGISTER
+1 WINE_REGISTRY dplayx.rgs
+
#define WINE_FILEDESCRIPTION_STR "Wine DirectPlay"
#define WINE_FILENAME_STR "dplayx.dll"
-#define WINE_FILEVERSION 5,3,0,900
-#define WINE_FILEVERSION_STR "5.3.0.900"
-#define WINE_PRODUCTVERSION 5,3,0,900
-#define WINE_PRODUCTVERSION_STR "5.3"
+#define WINE_FILEVERSION 5,3,1,904
+#define WINE_FILEVERSION_STR "5.3.1.904"
+#define WINE_PRODUCTVERSION 5,3,1,904
+#define WINE_PRODUCTVERSION_STR "5.3.1.904"
+#define WINE_EXTRAVALUES VALUE "OLESelfRegister",""
-#include "wine/wine_common_ver.rc"
+#include <wine/wine_common_ver.rc>
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WINE_DPLAY_H
{
LPWSTR lpszShortName;
LPSTR lpszShortNameA;
- };
+ } DUMMYUNIONNAME1;
union /*playerLongName */ /* Player's formal/real name */
{
LPWSTR lpszLongName;
LPSTR lpszLongNameA;
- };
+ } DUMMYUNIONNAME2;
} DPNAME, *LPDPNAME;
-
-
#define DPLONGNAMELEN 52
#define DPSHORTNAMELEN 20
#define DPSESSIONNAMELEN 32
{
LPWSTR lpszSessionName;
LPSTR lpszSessionNameA;
- };
+ } DUMMYUNIONNAME1;
union /* Optional password */
{
LPWSTR lpszPassword;
LPSTR lpszPasswordA;
- };
+ } DUMMYUNIONNAME2;
DWORD dwReserved1;
DWORD dwReserved2;
DWORD dwUser3;
DWORD dwUser4;
} DPSESSIONDESC2, *LPDPSESSIONDESC2;
-
-
typedef const DPSESSIONDESC2* LPCDPSESSIONDESC2;
#define DPOPEN_JOIN 0x00000001
#define DPSESSION_PASSWORDREQUIRED 0x00000400
#define DPSESSION_MULTICASTSERVER 0x00000800
#define DPSESSION_CLIENTSERVER 0x00001000
+#define DPSESSION_DIRECTPLAYPROTOCOL 0x00002000
+#define DPSESSION_NOPRESERVEORDER 0x00004000
+#define DPSESSION_OPTIMIZELATENCY 0x00008000
typedef struct tagDPLCONNECTION
{
extern HRESULT WINAPI DirectPlayEnumerateA( LPDPENUMDPCALLBACKA, LPVOID );
extern HRESULT WINAPI DirectPlayEnumerateW( LPDPENUMDPCALLBACKW, LPVOID );
-extern HRESULT WINAPI DirectPlayCreate( LPGUID lpGUID, LPDIRECTPLAY2 *lplpDP, IUnknown *pUnk);
+extern HRESULT WINAPI DirectPlayCreate( LPGUID lpGUID, LPDIRECTPLAY *lplpDP, IUnknown *pUnk );
typedef BOOL (CALLBACK *LPDPENUMPLAYERSCALLBACK)(
DPID dpId,
/* DirectPlay::Connect */
#define DPCONNECT_RETURNSTATUS (DPENUMSESSIONS_RETURNSTATUS)
+/* DirectPlay::GetCaps and DirectPlay::GetPlayerCaps */
+#define DPCAPS_ISHOST 0x00000002
+#define DPCAPS_GROUPOPTIMIZED 0x00000008
+#define DPCAPS_KEEPALIVEOPTIMIZED 0x00000010
+#define DPCAPS_GUARANTEEDOPTIMIZED 0x00000020
+#define DPCAPS_GUARANTEEDSUPPORTED 0x00000040
+#define DPCAPS_SIGNINGSUPPORTED 0x00000080
+#define DPCAPS_ENCRYPTIONSUPPORTED 0x00000100
+#define DPPLAYERCAPS_LOCAL 0x00000800
+#define DPCAPS_ASYNCCANCELSUPPORTED 0x00001000
+#define DPCAPS_ASYNCCANCELALLSUPPORTED 0x00002000
+#define DPCAPS_SENDTIMEOUTSUPPORTED 0x00004000
+#define DPCAPS_SENDPRIORITYSUPPORTED 0x00008000
+#define DPCAPS_ASYNCSUPPORTED 0x00010000
/** DirectPlay system messages **/
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WINE_DIRECT_PLAY_SP_H
#define __WINE_DIRECT_PLAY_SP_H
-#define WIN32_NO_STATUS
-#define _INC_WINDOWS
-#define COM_NO_WINDOWS_H
+#include <stdarg.h>
-//#include <stdarg.h>
-
-//#include "windef.h"
-#include <winbase.h>
-//#include "winuser.h"
-//#include "dplay.h"
-#include <dplobby.h>
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "dplay.h"
+#include "dplobby.h"
/* GUID for IDirectPlaySP {0C9F6360-CC61-11cf-ACEC-00AA006886E3} */
DEFINE_GUID(IID_IDirectPlaySP, 0xc9f6360, 0xcc61, 0x11cf, 0xac, 0xec, 0x0, 0xaa, 0x0, 0x68, 0x86, 0xe3);
reactos/dll/directx/dinput # Synced to Wine-20090208
reactos/dll/directx/dinput8 # Synced to Wine-20090208
reactos/dll/directx/dmusic # Synced to Wine-1_1_23
-reactos/dll/directx/dplay # Synced to Wine-0_9_5
-reactos/dll/directx/dplayx # Synced to Wine-0_9_5
+reactos/dll/directx/dplay # Synced to Wine-1.5.26
+reactos/dll/directx/dplayx # Synced to Wine-1.5.26
reactos/dll/directx/dxdiagn # Synced to Wine-0_9_5
reactos/dll/directx/msdmo # Autosync
reactos/dll/directx/qedit # Autosync