mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 17:05:46 +00:00
[DPLAYX]
* Sync with Wine 1.7.1. CORE-7469 svn path=/trunk/; revision=60479
This commit is contained in:
parent
7925f40b98
commit
0bfb6c5c69
13 changed files with 3987 additions and 3444 deletions
|
@ -30,20 +30,15 @@
|
||||||
//#include "dplay.h"
|
//#include "dplay.h"
|
||||||
//#include "dplobby.h"
|
//#include "dplobby.h"
|
||||||
//#include "initguid.h"
|
//#include "initguid.h"
|
||||||
#include "dpinit.h"
|
#include "dplay_global.h"
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(dplay);
|
WINE_DEFAULT_DEBUG_CHANNEL(dplay);
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* DirectPlayLobby ClassFactory
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
/* IUnknown fields */
|
|
||||||
IClassFactory IClassFactory_iface;
|
IClassFactory IClassFactory_iface;
|
||||||
LONG ref;
|
HRESULT (*createinstance)(REFIID riid, void **ppv);
|
||||||
} IClassFactoryImpl;
|
} IClassFactoryImpl;
|
||||||
|
|
||||||
static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface)
|
static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface)
|
||||||
|
@ -51,61 +46,62 @@ static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface)
|
||||||
return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface);
|
return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI
|
static HRESULT WINAPI IClassFactoryImpl_QueryInterface(IClassFactory *iface, REFIID riid,
|
||||||
DP_and_DPL_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
|
void **ppv)
|
||||||
IClassFactoryImpl *This = impl_from_IClassFactory(iface);
|
{
|
||||||
|
TRACE("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv);
|
||||||
|
|
||||||
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
|
if (IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IClassFactory, riid))
|
||||||
|
{
|
||||||
return E_NOINTERFACE;
|
*ppv = iface;
|
||||||
}
|
IClassFactory_AddRef(iface);
|
||||||
|
|
||||||
static ULONG WINAPI
|
|
||||||
DP_and_DPL_AddRef(LPCLASSFACTORY iface) {
|
|
||||||
IClassFactoryImpl *This = impl_from_IClassFactory(iface);
|
|
||||||
return InterlockedIncrement(&This->ref);
|
|
||||||
}
|
|
||||||
|
|
||||||
static ULONG WINAPI DP_and_DPL_Release(LPCLASSFACTORY 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 = impl_from_IClassFactory(iface);
|
|
||||||
|
|
||||||
TRACE("(%p)->(%p,%s,%p)\n",This,pOuter,debugstr_guid(riid),ppobj);
|
|
||||||
|
|
||||||
if ( DPL_CreateInterface( riid, ppobj ) == S_OK )
|
|
||||||
{
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
else if ( DP_CreateInterface( riid, ppobj ) == S_OK )
|
|
||||||
{
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
return E_NOINTERFACE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI DP_and_DPL_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
|
|
||||||
IClassFactoryImpl *This = impl_from_IClassFactory(iface);
|
|
||||||
FIXME("(%p)->(%d),stub!\n",This,dolock);
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
*ppv = NULL;
|
||||||
|
WARN("no interface for %s\n", debugstr_guid(riid));
|
||||||
|
return E_NOINTERFACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const IClassFactoryVtbl DP_and_DPL_Vtbl = {
|
static ULONG WINAPI IClassFactoryImpl_AddRef(IClassFactory *iface)
|
||||||
DP_and_DPL_QueryInterface,
|
{
|
||||||
DP_and_DPL_AddRef,
|
return 2; /* non-heap based object */
|
||||||
DP_and_DPL_Release,
|
}
|
||||||
DP_and_DPL_CreateInstance,
|
|
||||||
DP_and_DPL_LockServer
|
static ULONG WINAPI IClassFactoryImpl_Release(IClassFactory *iface)
|
||||||
|
{
|
||||||
|
return 1; /* non-heap based object */
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI IClassFactoryImpl_CreateInstance(IClassFactory *iface, IUnknown *pOuter,
|
||||||
|
REFIID riid, void **ppv)
|
||||||
|
{
|
||||||
|
IClassFactoryImpl *This = impl_from_IClassFactory(iface);
|
||||||
|
|
||||||
|
TRACE("(%p)->(%p,%s,%p)\n", iface, pOuter, debugstr_guid(riid), ppv);
|
||||||
|
|
||||||
|
if (pOuter)
|
||||||
|
return CLASS_E_NOAGGREGATION;
|
||||||
|
|
||||||
|
return This->createinstance(riid, ppv);
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI IClassFactoryImpl_LockServer(IClassFactory *iface, BOOL dolock)
|
||||||
|
{
|
||||||
|
FIXME("(%p)->(%d),stub!\n", iface, dolock);
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const IClassFactoryVtbl cf_vt = {
|
||||||
|
IClassFactoryImpl_QueryInterface,
|
||||||
|
IClassFactoryImpl_AddRef,
|
||||||
|
IClassFactoryImpl_Release,
|
||||||
|
IClassFactoryImpl_CreateInstance,
|
||||||
|
IClassFactoryImpl_LockServer
|
||||||
};
|
};
|
||||||
|
|
||||||
static IClassFactoryImpl DP_and_DPL_CF = {{&DP_and_DPL_Vtbl}, 1 };
|
static IClassFactoryImpl dplay_cf = {{&cf_vt}, dplay_create};
|
||||||
|
static IClassFactoryImpl dplaylobby_cf = {{&cf_vt}, dplobby_create};
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
|
@ -129,14 +125,12 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
|
||||||
{
|
{
|
||||||
TRACE("(%s,%s,%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 ) )
|
if (IsEqualCLSID(&CLSID_DirectPlay, rclsid))
|
||||||
{
|
return IClassFactory_QueryInterface(&dplay_cf.IClassFactory_iface, riid, ppv);
|
||||||
*ppv = &DP_and_DPL_CF;
|
|
||||||
IClassFactory_AddRef( (IClassFactory*)*ppv );
|
|
||||||
|
|
||||||
return S_OK;
|
if (IsEqualCLSID(&CLSID_DirectPlayLobby, rclsid))
|
||||||
}
|
return IClassFactory_QueryInterface(&dplaylobby_cf.IClassFactory_iface, riid, ppv);
|
||||||
|
|
||||||
ERR("(%s,%s,%p): no interface found.\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
|
FIXME("(%s,%s,%p): no class found.\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
|
||||||
return CLASS_E_CLASSNOTAVAILABLE;
|
return CLASS_E_CLASSNOTAVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,37 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright 1999, 2000 Peter Hunnisett
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __WINE_DPINIT_H
|
|
||||||
#define __WINE_DPINIT_H
|
|
||||||
|
|
||||||
//#include <stdarg.h>
|
|
||||||
|
|
||||||
//#include "windef.h"
|
|
||||||
//#include "winbase.h"
|
|
||||||
//#include "wtypes.h"
|
|
||||||
#include "dplay_global.h"
|
|
||||||
|
|
||||||
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 ) DECLSPEC_HIDDEN;
|
|
||||||
extern HRESULT DPLSP_CreateInterface( REFIID riid, LPVOID* ppvObj,
|
|
||||||
IDirectPlay2Impl* dp ) DECLSPEC_HIDDEN;
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
File diff suppressed because it is too large
Load diff
|
@ -34,22 +34,6 @@ extern HRESULT DPL_EnumAddress( LPDPENUMADDRESSCALLBACK lpEnumAddressCallback,
|
||||||
LPCVOID lpAddress, DWORD dwAddressSize,
|
LPCVOID lpAddress, DWORD dwAddressSize,
|
||||||
LPVOID lpContext ) DECLSPEC_HIDDEN;
|
LPVOID lpContext ) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
/*****************************************************************************
|
|
||||||
* Predeclare the interface implementation structures
|
|
||||||
*/
|
|
||||||
typedef struct IDirectPlay2Impl IDirectPlay2AImpl;
|
|
||||||
typedef struct IDirectPlay2Impl IDirectPlay2Impl;
|
|
||||||
typedef struct IDirectPlay3Impl IDirectPlay3AImpl;
|
|
||||||
typedef struct IDirectPlay3Impl IDirectPlay3Impl;
|
|
||||||
typedef struct IDirectPlay4Impl IDirectPlay4AImpl;
|
|
||||||
typedef struct IDirectPlay4Impl IDirectPlay4Impl;
|
|
||||||
|
|
||||||
typedef struct tagDirectPlayIUnknownData
|
|
||||||
{
|
|
||||||
LONG ulObjRef;
|
|
||||||
CRITICAL_SECTION DP_lock;
|
|
||||||
} DirectPlayIUnknownData;
|
|
||||||
|
|
||||||
typedef struct tagEnumSessionAsyncCallbackData
|
typedef struct tagEnumSessionAsyncCallbackData
|
||||||
{
|
{
|
||||||
LPSPINITDATA lpSpData;
|
LPSPINITDATA lpSpData;
|
||||||
|
@ -199,50 +183,35 @@ typedef struct tagDirectPlay2Data
|
||||||
DPQ_HEAD( tagDP_MSG_REPLY_STRUCT_LIST ) repliesExpected;
|
DPQ_HEAD( tagDP_MSG_REPLY_STRUCT_LIST ) repliesExpected;
|
||||||
} DirectPlay2Data;
|
} DirectPlay2Data;
|
||||||
|
|
||||||
typedef struct tagDirectPlay3Data
|
typedef struct IDirectPlayImpl
|
||||||
{
|
{
|
||||||
BOOL dummy;
|
IDirectPlay IDirectPlay_iface;
|
||||||
} DirectPlay3Data;
|
IDirectPlay2A IDirectPlay2A_iface;
|
||||||
typedef struct tagDirectPlay4Data
|
IDirectPlay2 IDirectPlay2_iface;
|
||||||
{
|
IDirectPlay3A IDirectPlay3A_iface;
|
||||||
BOOL dummy;
|
IDirectPlay3 IDirectPlay3_iface;
|
||||||
} DirectPlay4Data;
|
IDirectPlay4A IDirectPlay4A_iface;
|
||||||
|
IDirectPlay4 IDirectPlay4_iface;
|
||||||
|
LONG numIfaces; /* "in use interfaces" refcount */
|
||||||
|
LONG ref, ref2A, ref2, ref3A, ref3, ref4A, ref4;
|
||||||
|
CRITICAL_SECTION lock;
|
||||||
|
DirectPlay2Data *dp2;
|
||||||
|
} IDirectPlayImpl;
|
||||||
|
|
||||||
#define DP_IMPL_FIELDS \
|
HRESULT DP_HandleMessage( IDirectPlayImpl *This, const void *lpMessageBody,
|
||||||
LONG ulInterfaceRef; \
|
DWORD dwMessageBodySize, const void *lpMessageHeader, WORD wCommandId, WORD wVersion,
|
||||||
DirectPlayIUnknownData* unk; \
|
void **lplpReply, DWORD *lpdwMsgSize ) DECLSPEC_HIDDEN;
|
||||||
DirectPlay2Data* dp2; \
|
|
||||||
DirectPlay3Data* dp3; \
|
|
||||||
DirectPlay4Data* dp4;
|
|
||||||
|
|
||||||
struct IDirectPlay2Impl
|
|
||||||
{
|
|
||||||
const IDirectPlay2Vtbl *lpVtbl;
|
|
||||||
DP_IMPL_FIELDS
|
|
||||||
};
|
|
||||||
|
|
||||||
struct IDirectPlay3Impl
|
|
||||||
{
|
|
||||||
const IDirectPlay3Vtbl *lpVtbl;
|
|
||||||
DP_IMPL_FIELDS
|
|
||||||
};
|
|
||||||
|
|
||||||
struct IDirectPlay4Impl
|
|
||||||
{
|
|
||||||
const IDirectPlay4Vtbl *lpVtbl;
|
|
||||||
DP_IMPL_FIELDS
|
|
||||||
};
|
|
||||||
|
|
||||||
HRESULT DP_HandleMessage( IDirectPlay2Impl* This, LPCVOID lpMessageBody,
|
|
||||||
DWORD dwMessageBodySize, LPCVOID lpMessageHeader,
|
|
||||||
WORD wCommandId, WORD wVersion,
|
|
||||||
LPVOID* lplpReply, LPDWORD lpdwMsgSize ) DECLSPEC_HIDDEN;
|
|
||||||
|
|
||||||
/* DP SP external interfaces into DirectPlay */
|
/* DP SP external interfaces into DirectPlay */
|
||||||
extern HRESULT DP_GetSPPlayerData( IDirectPlay2Impl* lpDP, DPID idPlayer, LPVOID* lplpData ) DECLSPEC_HIDDEN;
|
extern HRESULT DP_GetSPPlayerData( IDirectPlayImpl *lpDP, DPID idPlayer, void **lplpData ) DECLSPEC_HIDDEN;
|
||||||
extern HRESULT DP_SetSPPlayerData( IDirectPlay2Impl* lpDP, DPID idPlayer, LPVOID lpData ) DECLSPEC_HIDDEN;
|
extern HRESULT DP_SetSPPlayerData( IDirectPlayImpl *lpDP, DPID idPlayer, void *lpData ) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
/* DP external interfaces to call into DPSP interface */
|
/* DP external interfaces to call into DPSP interface */
|
||||||
extern LPVOID DPSP_CreateSPPlayerData(void) DECLSPEC_HIDDEN;
|
extern LPVOID DPSP_CreateSPPlayerData(void) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
|
extern HRESULT dplay_create( REFIID riid, void **ppv ) DECLSPEC_HIDDEN;
|
||||||
|
extern HRESULT dplobby_create( REFIID riid, void **ppv ) DECLSPEC_HIDDEN;
|
||||||
|
extern HRESULT DPSP_CreateInterface( REFIID riid, void **ppvObj, IDirectPlayImpl *dp ) DECLSPEC_HIDDEN;
|
||||||
|
extern HRESULT DPLSP_CreateInterface( REFIID riid, void **ppvObj, IDirectPlayImpl *dp ) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
#endif /* __WINE_DPLAY_GLOBAL_INCLUDED */
|
#endif /* __WINE_DPLAY_GLOBAL_INCLUDED */
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
//#include "winerror.h"
|
//#include "winerror.h"
|
||||||
#include <wine/debug.h>
|
#include <wine/debug.h>
|
||||||
|
|
||||||
//#include "dpinit.h"
|
|
||||||
//#include "dplaysp.h"
|
//#include "dplaysp.h"
|
||||||
//#include "dplay_global.h"
|
//#include "dplay_global.h"
|
||||||
#include "name_server.h"
|
#include "name_server.h"
|
||||||
|
@ -37,7 +36,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dplay);
|
||||||
/* Prototypes */
|
/* Prototypes */
|
||||||
static BOOL DPSP_CreateIUnknown( LPVOID lpSP );
|
static BOOL DPSP_CreateIUnknown( LPVOID lpSP );
|
||||||
static BOOL DPSP_DestroyIUnknown( LPVOID lpSP );
|
static BOOL DPSP_DestroyIUnknown( LPVOID lpSP );
|
||||||
static BOOL DPSP_CreateDirectPlaySP( LPVOID lpSP, IDirectPlay2Impl* dp );
|
static BOOL DPSP_CreateDirectPlaySP( void *lpSP, IDirectPlayImpl *dp );
|
||||||
static BOOL DPSP_DestroyDirectPlaySP( LPVOID lpSP );
|
static BOOL DPSP_DestroyDirectPlaySP( LPVOID lpSP );
|
||||||
|
|
||||||
/* Predefine the interface */
|
/* Predefine the interface */
|
||||||
|
@ -57,7 +56,7 @@ typedef struct tagDirectPlaySPData
|
||||||
LPVOID lpSpLocalData;
|
LPVOID lpSpLocalData;
|
||||||
DWORD dwSpLocalDataSize; /* Size of data pointed to by lpSpLocalData */
|
DWORD dwSpLocalDataSize; /* Size of data pointed to by lpSpLocalData */
|
||||||
|
|
||||||
IDirectPlay2Impl* dplay; /* FIXME: This should perhaps be iface not impl */
|
IDirectPlayImpl *dplay; /* FIXME: This should perhaps be iface not impl */
|
||||||
|
|
||||||
} DirectPlaySPData;
|
} DirectPlaySPData;
|
||||||
|
|
||||||
|
@ -86,7 +85,7 @@ typedef struct tagDP_SPPLAYERDATA
|
||||||
} DP_SPPLAYERDATA, *LPDP_SPPLAYERDATA;
|
} DP_SPPLAYERDATA, *LPDP_SPPLAYERDATA;
|
||||||
|
|
||||||
/* Create the SP interface */
|
/* Create the SP interface */
|
||||||
HRESULT DPSP_CreateInterface( REFIID riid, LPVOID* ppvObj, IDirectPlay2Impl* dp )
|
HRESULT DPSP_CreateInterface( REFIID riid, void **ppvObj, IDirectPlayImpl *dp )
|
||||||
{
|
{
|
||||||
TRACE( " for %s\n", debugstr_guid( riid ) );
|
TRACE( " for %s\n", debugstr_guid( riid ) );
|
||||||
|
|
||||||
|
@ -160,7 +159,7 @@ static BOOL DPSP_DestroyIUnknown( LPVOID lpSP )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static BOOL DPSP_CreateDirectPlaySP( LPVOID lpSP, IDirectPlay2Impl* dp )
|
static BOOL DPSP_CreateDirectPlaySP( void *lpSP, IDirectPlayImpl *dp )
|
||||||
{
|
{
|
||||||
IDirectPlaySPImpl *This = lpSP;
|
IDirectPlaySPImpl *This = lpSP;
|
||||||
|
|
||||||
|
@ -173,21 +172,6 @@ static BOOL DPSP_CreateDirectPlaySP( LPVOID lpSP, IDirectPlay2Impl* dp )
|
||||||
|
|
||||||
This->sp->dplay = dp;
|
This->sp->dplay = dp;
|
||||||
|
|
||||||
/* 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
|
|
||||||
* to it (ie we'd be stuck with always having one reference to the dplay
|
|
||||||
* object, and hence us, around).
|
|
||||||
* NOTE: The dp object does reference count us.
|
|
||||||
*
|
|
||||||
* FIXME: This is a kludge to get around a problem where a queryinterface
|
|
||||||
* is used to get a new interface and then is closed. We will then
|
|
||||||
* reference garbage. However, with this we will never deallocate
|
|
||||||
* the interface we store. The correct fix is to require all
|
|
||||||
* DP internal interfaces to use the This->dp2 interface which
|
|
||||||
* should be changed to This->dp
|
|
||||||
*/
|
|
||||||
IDirectPlayX_AddRef( (LPDIRECTPLAY2)dp );
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,14 +179,6 @@ static BOOL DPSP_DestroyDirectPlaySP( LPVOID lpSP )
|
||||||
{
|
{
|
||||||
IDirectPlaySPImpl *This = 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
|
|
||||||
* to it (ie we'd be stuck with always having one reference to the dplay
|
|
||||||
* object, and hence us, around).
|
|
||||||
* NOTE: The dp object does reference count us.
|
|
||||||
*/
|
|
||||||
/*IDirectPlayX_Release( (LPDIRECTPLAY2)This->sp->dplay ); */
|
|
||||||
|
|
||||||
HeapFree( GetProcessHeap(), 0, This->sp->lpSpRemoteData );
|
HeapFree( GetProcessHeap(), 0, This->sp->lpSpRemoteData );
|
||||||
HeapFree( GetProcessHeap(), 0, This->sp->lpSpLocalData );
|
HeapFree( GetProcessHeap(), 0, This->sp->lpSpLocalData );
|
||||||
|
|
||||||
|
@ -408,13 +384,11 @@ static HRESULT WINAPI IDirectPlaySPImpl_GetSPPlayerData
|
||||||
/* What to do in the case where there is nothing set yet? */
|
/* What to do in the case where there is nothing set yet? */
|
||||||
if( dwFlags == DPSET_LOCAL )
|
if( dwFlags == DPSET_LOCAL )
|
||||||
{
|
{
|
||||||
HeapFree( GetProcessHeap(), 0, lpPlayerData->lpPlayerLocalData );
|
|
||||||
*lplpData = lpPlayerData->lpPlayerLocalData;
|
*lplpData = lpPlayerData->lpPlayerLocalData;
|
||||||
*lpdwDataSize = lpPlayerData->dwPlayerLocalDataSize;
|
*lpdwDataSize = lpPlayerData->dwPlayerLocalDataSize;
|
||||||
}
|
}
|
||||||
else if( dwFlags == DPSET_REMOTE )
|
else if( dwFlags == DPSET_REMOTE )
|
||||||
{
|
{
|
||||||
HeapFree( GetProcessHeap(), 0, lpPlayerData->lpPlayerRemoteData );
|
|
||||||
*lplpData = lpPlayerData->lpPlayerRemoteData;
|
*lplpData = lpPlayerData->lpPlayerRemoteData;
|
||||||
*lpdwDataSize = lpPlayerData->dwPlayerRemoteDataSize;
|
*lpdwDataSize = lpPlayerData->dwPlayerRemoteDataSize;
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,9 +45,8 @@ typedef struct tagMSGTHREADINFO
|
||||||
} MSGTHREADINFO, *LPMSGTHREADINFO;
|
} MSGTHREADINFO, *LPMSGTHREADINFO;
|
||||||
|
|
||||||
static DWORD CALLBACK DPL_MSG_ThreadMain( LPVOID lpContext );
|
static DWORD CALLBACK DPL_MSG_ThreadMain( LPVOID lpContext );
|
||||||
static LPVOID DP_MSG_ExpectReply( IDirectPlay2AImpl* This, LPDPSP_SENDDATA data,
|
static void *DP_MSG_ExpectReply( IDirectPlayImpl *This, DPSP_SENDDATA *data, DWORD dwWaitTime,
|
||||||
DWORD dwWaitTime, WORD wReplyCommandId,
|
WORD wReplyCommandId, void **lplpReplyMsg, DWORD *lpdwMsgBodySize );
|
||||||
LPVOID* lplpReplyMsg, LPDWORD lpdwMsgBodySize );
|
|
||||||
|
|
||||||
|
|
||||||
/* Create the message reception thread to allow the application to receive
|
/* Create the message reception thread to allow the application to receive
|
||||||
|
@ -154,16 +153,8 @@ end_of_thread:
|
||||||
}
|
}
|
||||||
|
|
||||||
/* DP messaging stuff */
|
/* DP messaging stuff */
|
||||||
static HANDLE DP_MSG_BuildAndLinkReplyStruct( IDirectPlay2Impl* This,
|
static HANDLE DP_MSG_BuildAndLinkReplyStruct( IDirectPlayImpl *This,
|
||||||
LPDP_MSG_REPLY_STRUCT_LIST lpReplyStructList,
|
DP_MSG_REPLY_STRUCT_LIST *lpReplyStructList, WORD wReplyCommandId )
|
||||||
WORD wReplyCommandId );
|
|
||||||
static LPVOID DP_MSG_CleanReplyStruct( LPDP_MSG_REPLY_STRUCT_LIST lpReplyStructList,
|
|
||||||
LPVOID* lplpReplyMsg, LPDWORD lpdwMsgBodySize );
|
|
||||||
|
|
||||||
|
|
||||||
static
|
|
||||||
HANDLE DP_MSG_BuildAndLinkReplyStruct( IDirectPlay2Impl* This,
|
|
||||||
LPDP_MSG_REPLY_STRUCT_LIST lpReplyStructList, WORD wReplyCommandId )
|
|
||||||
{
|
{
|
||||||
lpReplyStructList->replyExpected.hReceipt = CreateEventW( NULL, FALSE, FALSE, NULL );
|
lpReplyStructList->replyExpected.hReceipt = CreateEventW( NULL, FALSE, FALSE, NULL );
|
||||||
lpReplyStructList->replyExpected.wExpectedReply = wReplyCommandId;
|
lpReplyStructList->replyExpected.wExpectedReply = wReplyCommandId;
|
||||||
|
@ -171,9 +162,9 @@ HANDLE DP_MSG_BuildAndLinkReplyStruct( IDirectPlay2Impl* This,
|
||||||
lpReplyStructList->replyExpected.dwMsgBodySize = 0;
|
lpReplyStructList->replyExpected.dwMsgBodySize = 0;
|
||||||
|
|
||||||
/* Insert into the message queue while locked */
|
/* Insert into the message queue while locked */
|
||||||
EnterCriticalSection( &This->unk->DP_lock );
|
EnterCriticalSection( &This->lock );
|
||||||
DPQ_INSERT( This->dp2->repliesExpected, lpReplyStructList, repliesExpected );
|
DPQ_INSERT( This->dp2->repliesExpected, lpReplyStructList, repliesExpected );
|
||||||
LeaveCriticalSection( &This->unk->DP_lock );
|
LeaveCriticalSection( &This->lock );
|
||||||
|
|
||||||
return lpReplyStructList->replyExpected.hReceipt;
|
return lpReplyStructList->replyExpected.hReceipt;
|
||||||
}
|
}
|
||||||
|
@ -190,8 +181,7 @@ LPVOID DP_MSG_CleanReplyStruct( LPDP_MSG_REPLY_STRUCT_LIST lpReplyStructList,
|
||||||
return lpReplyStructList->replyExpected.lpReplyMsg;
|
return lpReplyStructList->replyExpected.lpReplyMsg;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT DP_MSG_SendRequestPlayerId( IDirectPlay2AImpl* This, DWORD dwFlags,
|
HRESULT DP_MSG_SendRequestPlayerId( IDirectPlayImpl *This, DWORD dwFlags, DPID *lpdpidAllocatedId )
|
||||||
LPDPID lpdpidAllocatedId )
|
|
||||||
{
|
{
|
||||||
LPVOID lpMsg;
|
LPVOID lpMsg;
|
||||||
LPDPMSG_REQUESTNEWPLAYERID lpMsgBody;
|
LPDPMSG_REQUESTNEWPLAYERID lpMsgBody;
|
||||||
|
@ -257,7 +247,7 @@ HRESULT DP_MSG_SendRequestPlayerId( IDirectPlay2AImpl* This, DWORD dwFlags,
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlay2AImpl* This, DPID dpidServer )
|
HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlayImpl *This, DPID dpidServer )
|
||||||
{
|
{
|
||||||
LPVOID lpMsg;
|
LPVOID lpMsg;
|
||||||
LPDPMSG_FORWARDADDPLAYER lpMsgBody;
|
LPDPMSG_FORWARDADDPLAYER lpMsgBody;
|
||||||
|
@ -375,10 +365,8 @@ HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlay2AImpl* This, DPID dpidServer )
|
||||||
* ordering issues on sends and receives from the opposite machine. No wonder MS is not
|
* ordering issues on sends and receives from the opposite machine. No wonder MS is not
|
||||||
* a networking company.
|
* a networking company.
|
||||||
*/
|
*/
|
||||||
static
|
static void *DP_MSG_ExpectReply( IDirectPlayImpl *This, DPSP_SENDDATA *lpData, DWORD dwWaitTime,
|
||||||
LPVOID DP_MSG_ExpectReply( IDirectPlay2AImpl* This, LPDPSP_SENDDATA lpData,
|
WORD wReplyCommandId, void **lplpReplyMsg, DWORD *lpdwMsgBodySize )
|
||||||
DWORD dwWaitTime, WORD wReplyCommandId,
|
|
||||||
LPVOID* lplpReplyMsg, LPDWORD lpdwMsgBodySize )
|
|
||||||
{
|
{
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
HANDLE hMsgReceipt;
|
HANDLE hMsgReceipt;
|
||||||
|
@ -417,8 +405,8 @@ LPVOID DP_MSG_ExpectReply( IDirectPlay2AImpl* This, LPDPSP_SENDDATA lpData,
|
||||||
* all important data. It is quite silly to have to copy the message, but the documents
|
* all important data. It is quite silly to have to copy the message, but the documents
|
||||||
* indicate that a copy is taken. Silly really.
|
* indicate that a copy is taken. Silly really.
|
||||||
*/
|
*/
|
||||||
void DP_MSG_ReplyReceived( IDirectPlay2AImpl* This, WORD wCommandId,
|
void DP_MSG_ReplyReceived( IDirectPlayImpl *This, WORD wCommandId, const void *lpcMsgBody,
|
||||||
LPCVOID lpcMsgBody, DWORD dwMsgBodySize )
|
DWORD dwMsgBodySize )
|
||||||
{
|
{
|
||||||
LPDP_MSG_REPLY_STRUCT_LIST lpReplyList;
|
LPDP_MSG_REPLY_STRUCT_LIST lpReplyList;
|
||||||
|
|
||||||
|
@ -432,10 +420,10 @@ void DP_MSG_ReplyReceived( IDirectPlay2AImpl* This, WORD wCommandId,
|
||||||
/* Find, and immediately remove (to avoid double triggering), the appropriate entry. Call locked to
|
/* Find, and immediately remove (to avoid double triggering), the appropriate entry. Call locked to
|
||||||
* avoid problems.
|
* avoid problems.
|
||||||
*/
|
*/
|
||||||
EnterCriticalSection( &This->unk->DP_lock );
|
EnterCriticalSection( &This->lock );
|
||||||
DPQ_REMOVE_ENTRY( This->dp2->repliesExpected, repliesExpected, replyExpected.wExpectedReply,
|
DPQ_REMOVE_ENTRY( This->dp2->repliesExpected, repliesExpected, replyExpected.wExpectedReply,
|
||||||
==, wCommandId, lpReplyList );
|
==, wCommandId, lpReplyList );
|
||||||
LeaveCriticalSection( &This->unk->DP_lock );
|
LeaveCriticalSection( &This->lock );
|
||||||
|
|
||||||
if( lpReplyList != NULL )
|
if( lpReplyList != NULL )
|
||||||
{
|
{
|
||||||
|
@ -456,7 +444,7 @@ void DP_MSG_ReplyReceived( IDirectPlay2AImpl* This, WORD wCommandId,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DP_MSG_ToSelf( IDirectPlay2AImpl* This, DPID dpidSelf )
|
void DP_MSG_ToSelf( IDirectPlayImpl *This, DPID dpidSelf )
|
||||||
{
|
{
|
||||||
LPVOID lpMsg;
|
LPVOID lpMsg;
|
||||||
LPDPMSG_SENDENVELOPE lpMsgBody;
|
LPDPMSG_SENDENVELOPE lpMsgBody;
|
||||||
|
@ -493,8 +481,8 @@ void DP_MSG_ToSelf( IDirectPlay2AImpl* This, DPID dpidSelf )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DP_MSG_ErrorReceived( IDirectPlay2AImpl* This, WORD wCommandId,
|
void DP_MSG_ErrorReceived( IDirectPlayImpl *This, WORD wCommandId, const void *lpMsgBody,
|
||||||
LPCVOID lpMsgBody, DWORD dwMsgBodySize )
|
DWORD dwMsgBodySize )
|
||||||
{
|
{
|
||||||
LPCDPMSG_FORWARDADDPLAYERNACK lpcErrorMsg;
|
LPCDPMSG_FORWARDADDPLAYERNACK lpcErrorMsg;
|
||||||
|
|
||||||
|
|
|
@ -31,15 +31,15 @@
|
||||||
DWORD CreateLobbyMessageReceptionThread( HANDLE hNotifyEvent, HANDLE hStart,
|
DWORD CreateLobbyMessageReceptionThread( HANDLE hNotifyEvent, HANDLE hStart,
|
||||||
HANDLE hDeath, HANDLE hConnRead ) DECLSPEC_HIDDEN;
|
HANDLE hDeath, HANDLE hConnRead ) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
HRESULT DP_MSG_SendRequestPlayerId( IDirectPlay2AImpl* This, DWORD dwFlags,
|
HRESULT DP_MSG_SendRequestPlayerId( IDirectPlayImpl *This, DWORD dwFlags,
|
||||||
LPDPID lpdipidAllocatedId ) DECLSPEC_HIDDEN;
|
LPDPID lpdipidAllocatedId ) DECLSPEC_HIDDEN;
|
||||||
HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlay2AImpl* This, DPID dpidServer ) DECLSPEC_HIDDEN;
|
HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlayImpl *This, DPID dpidServer ) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
void DP_MSG_ReplyReceived( IDirectPlay2AImpl* This, WORD wCommandId,
|
void DP_MSG_ReplyReceived( IDirectPlayImpl *This, WORD wCommandId,
|
||||||
LPCVOID lpMsgBody, DWORD dwMsgBodySize ) DECLSPEC_HIDDEN;
|
LPCVOID lpMsgBody, DWORD dwMsgBodySize ) DECLSPEC_HIDDEN;
|
||||||
void DP_MSG_ErrorReceived( IDirectPlay2AImpl* This, WORD wCommandId,
|
void DP_MSG_ErrorReceived( IDirectPlayImpl *This, WORD wCommandId,
|
||||||
LPCVOID lpMsgBody, DWORD dwMsgBodySize ) DECLSPEC_HIDDEN;
|
LPCVOID lpMsgBody, DWORD dwMsgBodySize ) DECLSPEC_HIDDEN;
|
||||||
void DP_MSG_ToSelf( IDirectPlay2AImpl* This, DPID dpidSelf ) DECLSPEC_HIDDEN;
|
void DP_MSG_ToSelf( IDirectPlayImpl *This, DPID dpidSelf ) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
/* Timings -> 1000 ticks/sec */
|
/* Timings -> 1000 ticks/sec */
|
||||||
#define DPMSG_WAIT_5_SECS 5000
|
#define DPMSG_WAIT_5_SECS 5000
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -22,15 +22,14 @@
|
||||||
#include <wine/debug.h>
|
#include <wine/debug.h>
|
||||||
|
|
||||||
//#include "lobbysp.h"
|
//#include "lobbysp.h"
|
||||||
//#include "dplay_global.h"
|
#include "dplay_global.h"
|
||||||
#include "dpinit.h"
|
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(dplay);
|
WINE_DEFAULT_DEBUG_CHANNEL(dplay);
|
||||||
|
|
||||||
/* Prototypes */
|
/* Prototypes */
|
||||||
static BOOL DPLSP_CreateIUnknown( LPVOID lpSP );
|
static BOOL DPLSP_CreateIUnknown( LPVOID lpSP );
|
||||||
static BOOL DPLSP_DestroyIUnknown( LPVOID lpSP );
|
static BOOL DPLSP_DestroyIUnknown( LPVOID lpSP );
|
||||||
static BOOL DPLSP_CreateDPLobbySP( LPVOID lpSP, IDirectPlay2Impl* dp );
|
static BOOL DPLSP_CreateDPLobbySP( void *lpSP, IDirectPlayImpl *dp );
|
||||||
static BOOL DPLSP_DestroyDPLobbySP( LPVOID lpSP );
|
static BOOL DPLSP_DestroyDPLobbySP( LPVOID lpSP );
|
||||||
|
|
||||||
|
|
||||||
|
@ -45,7 +44,7 @@ typedef struct tagDPLobbySPIUnknownData
|
||||||
|
|
||||||
typedef struct tagDPLobbySPData
|
typedef struct tagDPLobbySPData
|
||||||
{
|
{
|
||||||
IDirectPlay2Impl* dplay;
|
IDirectPlayImpl *dplay;
|
||||||
} DPLobbySPData;
|
} DPLobbySPData;
|
||||||
|
|
||||||
#define DPLSP_IMPL_FIELDS \
|
#define DPLSP_IMPL_FIELDS \
|
||||||
|
@ -62,7 +61,7 @@ struct IDPLobbySPImpl
|
||||||
/* Forward declaration of virtual tables */
|
/* Forward declaration of virtual tables */
|
||||||
static const IDPLobbySPVtbl dpLobbySPVT;
|
static const IDPLobbySPVtbl dpLobbySPVT;
|
||||||
|
|
||||||
HRESULT DPLSP_CreateInterface( REFIID riid, LPVOID* ppvObj, IDirectPlay2Impl* dp )
|
HRESULT DPLSP_CreateInterface( REFIID riid, void **ppvObj, IDirectPlayImpl *dp )
|
||||||
{
|
{
|
||||||
TRACE( " for %s\n", debugstr_guid( riid ) );
|
TRACE( " for %s\n", debugstr_guid( riid ) );
|
||||||
|
|
||||||
|
@ -135,7 +134,7 @@ static BOOL DPLSP_DestroyIUnknown( LPVOID lpSP )
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL DPLSP_CreateDPLobbySP( LPVOID lpSP, IDirectPlay2Impl* dp )
|
static BOOL DPLSP_CreateDPLobbySP( void *lpSP, IDirectPlayImpl *dp )
|
||||||
{
|
{
|
||||||
IDPLobbySPImpl *This = lpSP;
|
IDPLobbySPImpl *This = lpSP;
|
||||||
|
|
||||||
|
@ -148,22 +147,6 @@ static BOOL DPLSP_CreateDPLobbySP( LPVOID lpSP, IDirectPlay2Impl* dp )
|
||||||
|
|
||||||
This->sp->dplay = dp;
|
This->sp->dplay = dp;
|
||||||
|
|
||||||
/* 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
|
|
||||||
* to it (ie we'd be stuck with always having one reference to the dplay
|
|
||||||
* object, and hence us, around).
|
|
||||||
* NOTE: The dp object does reference count us.
|
|
||||||
*
|
|
||||||
* FIXME: This is a kludge to get around a problem where a queryinterface
|
|
||||||
* is used to get a new interface and then is closed. We will then
|
|
||||||
* reference garbage. However, with this we will never deallocate
|
|
||||||
* the interface we store. The correct fix is to require all
|
|
||||||
* DP internal interfaces to use the This->dp2 interface which
|
|
||||||
* should be changed to This->dp
|
|
||||||
*/
|
|
||||||
IDirectPlayX_AddRef( (LPDIRECTPLAY2)dp );
|
|
||||||
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -458,7 +458,6 @@ typedef struct SPDATA_INIT
|
||||||
} SPDATA_INIT, *LPSPDATA_INIT;
|
} SPDATA_INIT, *LPSPDATA_INIT;
|
||||||
|
|
||||||
typedef HRESULT (WINAPI *LPSP_INIT)(LPSPDATA_INIT);
|
typedef HRESULT (WINAPI *LPSP_INIT)(LPSPDATA_INIT);
|
||||||
HRESULT WINAPI DPLSPInit(LPSPDATA_INIT) DECLSPEC_HIDDEN;
|
|
||||||
|
|
||||||
/* Define the COM interface */
|
/* Define the COM interface */
|
||||||
#define INTERFACE IDPLobbySP
|
#define INTERFACE IDPLobbySP
|
||||||
|
|
|
@ -353,10 +353,8 @@ void NS_PruneSessionCache( LPVOID lpNSInfo )
|
||||||
}
|
}
|
||||||
|
|
||||||
/* NAME SERVER Message stuff */
|
/* NAME SERVER Message stuff */
|
||||||
void NS_ReplyToEnumSessionsRequest( LPCVOID lpcMsg,
|
void NS_ReplyToEnumSessionsRequest( const void *lpcMsg, void **lplpReplyData, DWORD *lpdwReplySize,
|
||||||
LPVOID* lplpReplyData,
|
IDirectPlayImpl *lpDP )
|
||||||
LPDWORD lpdwReplySize,
|
|
||||||
IDirectPlay2Impl* lpDP )
|
|
||||||
{
|
{
|
||||||
LPDPMSG_ENUMSESSIONSREPLY rmsg;
|
LPDPMSG_ENUMSESSIONSREPLY rmsg;
|
||||||
DWORD dwVariableSize;
|
DWORD dwVariableSize;
|
||||||
|
|
|
@ -40,7 +40,7 @@ void NS_SetLocalAddr( LPVOID lpNSInfo, LPCVOID lpHdr, DWORD dwHdrSize ) DECLSPEC
|
||||||
void NS_ReplyToEnumSessionsRequest( LPCVOID lpcMsg,
|
void NS_ReplyToEnumSessionsRequest( LPCVOID lpcMsg,
|
||||||
LPVOID* lplpReplyData,
|
LPVOID* lplpReplyData,
|
||||||
LPDWORD lpdwReplySize,
|
LPDWORD lpdwReplySize,
|
||||||
IDirectPlay2Impl* lpDP ) DECLSPEC_HIDDEN;
|
IDirectPlayImpl *lpDP ) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
HRESULT NS_SendSessionRequestBroadcast( LPCGUID lpcGuid,
|
HRESULT NS_SendSessionRequestBroadcast( LPCGUID lpcGuid,
|
||||||
DWORD dwFlags,
|
DWORD dwFlags,
|
||||||
|
|
|
@ -38,7 +38,7 @@ reactos/dll/directx/wine/dinput # Synced to Wine-1.7.1
|
||||||
reactos/dll/directx/wine/dinput8 # Synced to Wine-1.5.26
|
reactos/dll/directx/wine/dinput8 # Synced to Wine-1.5.26
|
||||||
reactos/dll/directx/wine/dmusic # Synced to Wine-1.5.26
|
reactos/dll/directx/wine/dmusic # Synced to Wine-1.5.26
|
||||||
reactos/dll/directx/wine/dplay # Synced to Wine-1.7.1
|
reactos/dll/directx/wine/dplay # Synced to Wine-1.7.1
|
||||||
reactos/dll/directx/wine/dplayx # Synced to Wine-1.5.26
|
reactos/dll/directx/wine/dplayx # Synced to Wine-1.7.1
|
||||||
reactos/dll/directx/wine/dsound # Synced to Wine-1.7.1
|
reactos/dll/directx/wine/dsound # Synced to Wine-1.7.1
|
||||||
reactos/dll/directx/wine/dxdiagn # Synced to Wine-0_9_5
|
reactos/dll/directx/wine/dxdiagn # Synced to Wine-0_9_5
|
||||||
reactos/dll/directx/wine/dxgi # Synced to Wine-1.7.1
|
reactos/dll/directx/wine/dxgi # Synced to Wine-1.7.1
|
||||||
|
|
Loading…
Reference in a new issue