mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 08:55:19 +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 "dplobby.h"
|
||||
//#include "initguid.h"
|
||||
#include "dpinit.h"
|
||||
#include "dplay_global.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(dplay);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* DirectPlayLobby ClassFactory
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* IUnknown fields */
|
||||
IClassFactory IClassFactory_iface;
|
||||
LONG ref;
|
||||
HRESULT (*createinstance)(REFIID riid, void **ppv);
|
||||
} IClassFactoryImpl;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
DP_and_DPL_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
|
||||
IClassFactoryImpl *This = impl_from_IClassFactory(iface);
|
||||
static HRESULT WINAPI IClassFactoryImpl_QueryInterface(IClassFactory *iface, REFIID riid,
|
||||
void **ppv)
|
||||
{
|
||||
TRACE("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv);
|
||||
|
||||
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
|
||||
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
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);
|
||||
if (IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IClassFactory, riid))
|
||||
{
|
||||
*ppv = iface;
|
||||
IClassFactory_AddRef(iface);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
*ppv = NULL;
|
||||
WARN("no interface for %s\n", debugstr_guid(riid));
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
static const IClassFactoryVtbl DP_and_DPL_Vtbl = {
|
||||
DP_and_DPL_QueryInterface,
|
||||
DP_and_DPL_AddRef,
|
||||
DP_and_DPL_Release,
|
||||
DP_and_DPL_CreateInstance,
|
||||
DP_and_DPL_LockServer
|
||||
static ULONG WINAPI IClassFactoryImpl_AddRef(IClassFactory *iface)
|
||||
{
|
||||
return 2; /* non-heap based object */
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
if ( IsEqualCLSID( riid, &IID_IClassFactory ) )
|
||||
{
|
||||
*ppv = &DP_and_DPL_CF;
|
||||
IClassFactory_AddRef( (IClassFactory*)*ppv );
|
||||
if (IsEqualCLSID(&CLSID_DirectPlay, rclsid))
|
||||
return IClassFactory_QueryInterface(&dplay_cf.IClassFactory_iface, riid, 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;
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
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
|
||||
{
|
||||
LPSPINITDATA lpSpData;
|
||||
|
@ -199,50 +183,35 @@ typedef struct tagDirectPlay2Data
|
|||
DPQ_HEAD( tagDP_MSG_REPLY_STRUCT_LIST ) repliesExpected;
|
||||
} DirectPlay2Data;
|
||||
|
||||
typedef struct tagDirectPlay3Data
|
||||
typedef struct IDirectPlayImpl
|
||||
{
|
||||
BOOL dummy;
|
||||
} DirectPlay3Data;
|
||||
typedef struct tagDirectPlay4Data
|
||||
{
|
||||
BOOL dummy;
|
||||
} DirectPlay4Data;
|
||||
IDirectPlay IDirectPlay_iface;
|
||||
IDirectPlay2A IDirectPlay2A_iface;
|
||||
IDirectPlay2 IDirectPlay2_iface;
|
||||
IDirectPlay3A IDirectPlay3A_iface;
|
||||
IDirectPlay3 IDirectPlay3_iface;
|
||||
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 \
|
||||
LONG ulInterfaceRef; \
|
||||
DirectPlayIUnknownData* unk; \
|
||||
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;
|
||||
HRESULT DP_HandleMessage( IDirectPlayImpl *This, const void *lpMessageBody,
|
||||
DWORD dwMessageBodySize, const void *lpMessageHeader, WORD wCommandId, WORD wVersion,
|
||||
void **lplpReply, DWORD *lpdwMsgSize ) DECLSPEC_HIDDEN;
|
||||
|
||||
/* DP SP external interfaces into DirectPlay */
|
||||
extern HRESULT DP_GetSPPlayerData( IDirectPlay2Impl* lpDP, DPID idPlayer, LPVOID* lplpData ) DECLSPEC_HIDDEN;
|
||||
extern HRESULT DP_SetSPPlayerData( IDirectPlay2Impl* lpDP, DPID idPlayer, LPVOID lpData ) DECLSPEC_HIDDEN;
|
||||
extern HRESULT DP_GetSPPlayerData( IDirectPlayImpl *lpDP, DPID idPlayer, void **lplpData ) DECLSPEC_HIDDEN;
|
||||
extern HRESULT DP_SetSPPlayerData( IDirectPlayImpl *lpDP, DPID idPlayer, void *lpData ) DECLSPEC_HIDDEN;
|
||||
|
||||
/* DP external interfaces to call into DPSP interface */
|
||||
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 */
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
//#include "winerror.h"
|
||||
#include <wine/debug.h>
|
||||
|
||||
//#include "dpinit.h"
|
||||
//#include "dplaysp.h"
|
||||
//#include "dplay_global.h"
|
||||
#include "name_server.h"
|
||||
|
@ -37,7 +36,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dplay);
|
|||
/* Prototypes */
|
||||
static BOOL DPSP_CreateIUnknown( 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 );
|
||||
|
||||
/* Predefine the interface */
|
||||
|
@ -57,7 +56,7 @@ typedef struct tagDirectPlaySPData
|
|||
LPVOID 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;
|
||||
|
||||
|
@ -86,7 +85,7 @@ typedef struct tagDP_SPPLAYERDATA
|
|||
} DP_SPPLAYERDATA, *LPDP_SPPLAYERDATA;
|
||||
|
||||
/* 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 ) );
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -173,21 +172,6 @@ static BOOL DPSP_CreateDirectPlaySP( LPVOID lpSP, IDirectPlay2Impl* 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;
|
||||
}
|
||||
|
||||
|
@ -195,14 +179,6 @@ static BOOL DPSP_DestroyDirectPlaySP( LPVOID 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->lpSpLocalData );
|
||||
|
||||
|
@ -408,13 +384,11 @@ static HRESULT WINAPI IDirectPlaySPImpl_GetSPPlayerData
|
|||
/* What to do in the case where there is nothing set yet? */
|
||||
if( dwFlags == DPSET_LOCAL )
|
||||
{
|
||||
HeapFree( GetProcessHeap(), 0, lpPlayerData->lpPlayerLocalData );
|
||||
*lplpData = lpPlayerData->lpPlayerLocalData;
|
||||
*lpdwDataSize = lpPlayerData->dwPlayerLocalDataSize;
|
||||
}
|
||||
else if( dwFlags == DPSET_REMOTE )
|
||||
{
|
||||
HeapFree( GetProcessHeap(), 0, lpPlayerData->lpPlayerRemoteData );
|
||||
*lplpData = lpPlayerData->lpPlayerRemoteData;
|
||||
*lpdwDataSize = lpPlayerData->dwPlayerRemoteDataSize;
|
||||
}
|
||||
|
|
|
@ -45,9 +45,8 @@ typedef struct tagMSGTHREADINFO
|
|||
} MSGTHREADINFO, *LPMSGTHREADINFO;
|
||||
|
||||
static DWORD CALLBACK DPL_MSG_ThreadMain( LPVOID lpContext );
|
||||
static LPVOID DP_MSG_ExpectReply( IDirectPlay2AImpl* This, LPDPSP_SENDDATA data,
|
||||
DWORD dwWaitTime, WORD wReplyCommandId,
|
||||
LPVOID* lplpReplyMsg, LPDWORD lpdwMsgBodySize );
|
||||
static void *DP_MSG_ExpectReply( IDirectPlayImpl *This, DPSP_SENDDATA *data, DWORD dwWaitTime,
|
||||
WORD wReplyCommandId, void **lplpReplyMsg, DWORD *lpdwMsgBodySize );
|
||||
|
||||
|
||||
/* Create the message reception thread to allow the application to receive
|
||||
|
@ -154,16 +153,8 @@ end_of_thread:
|
|||
}
|
||||
|
||||
/* DP messaging stuff */
|
||||
static HANDLE DP_MSG_BuildAndLinkReplyStruct( IDirectPlay2Impl* This,
|
||||
LPDP_MSG_REPLY_STRUCT_LIST lpReplyStructList,
|
||||
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 )
|
||||
static HANDLE DP_MSG_BuildAndLinkReplyStruct( IDirectPlayImpl *This,
|
||||
DP_MSG_REPLY_STRUCT_LIST *lpReplyStructList, WORD wReplyCommandId )
|
||||
{
|
||||
lpReplyStructList->replyExpected.hReceipt = CreateEventW( NULL, FALSE, FALSE, NULL );
|
||||
lpReplyStructList->replyExpected.wExpectedReply = wReplyCommandId;
|
||||
|
@ -171,9 +162,9 @@ HANDLE DP_MSG_BuildAndLinkReplyStruct( IDirectPlay2Impl* This,
|
|||
lpReplyStructList->replyExpected.dwMsgBodySize = 0;
|
||||
|
||||
/* Insert into the message queue while locked */
|
||||
EnterCriticalSection( &This->unk->DP_lock );
|
||||
EnterCriticalSection( &This->lock );
|
||||
DPQ_INSERT( This->dp2->repliesExpected, lpReplyStructList, repliesExpected );
|
||||
LeaveCriticalSection( &This->unk->DP_lock );
|
||||
LeaveCriticalSection( &This->lock );
|
||||
|
||||
return lpReplyStructList->replyExpected.hReceipt;
|
||||
}
|
||||
|
@ -190,8 +181,7 @@ LPVOID DP_MSG_CleanReplyStruct( LPDP_MSG_REPLY_STRUCT_LIST lpReplyStructList,
|
|||
return lpReplyStructList->replyExpected.lpReplyMsg;
|
||||
}
|
||||
|
||||
HRESULT DP_MSG_SendRequestPlayerId( IDirectPlay2AImpl* This, DWORD dwFlags,
|
||||
LPDPID lpdpidAllocatedId )
|
||||
HRESULT DP_MSG_SendRequestPlayerId( IDirectPlayImpl *This, DWORD dwFlags, DPID *lpdpidAllocatedId )
|
||||
{
|
||||
LPVOID lpMsg;
|
||||
LPDPMSG_REQUESTNEWPLAYERID lpMsgBody;
|
||||
|
@ -257,7 +247,7 @@ HRESULT DP_MSG_SendRequestPlayerId( IDirectPlay2AImpl* This, DWORD dwFlags,
|
|||
return hr;
|
||||
}
|
||||
|
||||
HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlay2AImpl* This, DPID dpidServer )
|
||||
HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlayImpl *This, DPID dpidServer )
|
||||
{
|
||||
LPVOID lpMsg;
|
||||
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
|
||||
* a networking company.
|
||||
*/
|
||||
static
|
||||
LPVOID DP_MSG_ExpectReply( IDirectPlay2AImpl* This, LPDPSP_SENDDATA lpData,
|
||||
DWORD dwWaitTime, WORD wReplyCommandId,
|
||||
LPVOID* lplpReplyMsg, LPDWORD lpdwMsgBodySize )
|
||||
static void *DP_MSG_ExpectReply( IDirectPlayImpl *This, DPSP_SENDDATA *lpData, DWORD dwWaitTime,
|
||||
WORD wReplyCommandId, void **lplpReplyMsg, DWORD *lpdwMsgBodySize )
|
||||
{
|
||||
HRESULT hr;
|
||||
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
|
||||
* indicate that a copy is taken. Silly really.
|
||||
*/
|
||||
void DP_MSG_ReplyReceived( IDirectPlay2AImpl* This, WORD wCommandId,
|
||||
LPCVOID lpcMsgBody, DWORD dwMsgBodySize )
|
||||
void DP_MSG_ReplyReceived( IDirectPlayImpl *This, WORD wCommandId, const void *lpcMsgBody,
|
||||
DWORD dwMsgBodySize )
|
||||
{
|
||||
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
|
||||
* avoid problems.
|
||||
*/
|
||||
EnterCriticalSection( &This->unk->DP_lock );
|
||||
EnterCriticalSection( &This->lock );
|
||||
DPQ_REMOVE_ENTRY( This->dp2->repliesExpected, repliesExpected, replyExpected.wExpectedReply,
|
||||
==, wCommandId, lpReplyList );
|
||||
LeaveCriticalSection( &This->unk->DP_lock );
|
||||
LeaveCriticalSection( &This->lock );
|
||||
|
||||
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;
|
||||
LPDPMSG_SENDENVELOPE lpMsgBody;
|
||||
|
@ -493,8 +481,8 @@ void DP_MSG_ToSelf( IDirectPlay2AImpl* This, DPID dpidSelf )
|
|||
}
|
||||
}
|
||||
|
||||
void DP_MSG_ErrorReceived( IDirectPlay2AImpl* This, WORD wCommandId,
|
||||
LPCVOID lpMsgBody, DWORD dwMsgBodySize )
|
||||
void DP_MSG_ErrorReceived( IDirectPlayImpl *This, WORD wCommandId, const void *lpMsgBody,
|
||||
DWORD dwMsgBodySize )
|
||||
{
|
||||
LPCDPMSG_FORWARDADDPLAYERNACK lpcErrorMsg;
|
||||
|
||||
|
|
|
@ -31,15 +31,15 @@
|
|||
DWORD CreateLobbyMessageReceptionThread( HANDLE hNotifyEvent, HANDLE hStart,
|
||||
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;
|
||||
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;
|
||||
void DP_MSG_ErrorReceived( IDirectPlay2AImpl* This, WORD wCommandId,
|
||||
void DP_MSG_ErrorReceived( IDirectPlayImpl *This, WORD wCommandId,
|
||||
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 */
|
||||
#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 "lobbysp.h"
|
||||
//#include "dplay_global.h"
|
||||
#include "dpinit.h"
|
||||
#include "dplay_global.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(dplay);
|
||||
|
||||
/* Prototypes */
|
||||
static BOOL DPLSP_CreateIUnknown( 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 );
|
||||
|
||||
|
||||
|
@ -45,7 +44,7 @@ typedef struct tagDPLobbySPIUnknownData
|
|||
|
||||
typedef struct tagDPLobbySPData
|
||||
{
|
||||
IDirectPlay2Impl* dplay;
|
||||
IDirectPlayImpl *dplay;
|
||||
} DPLobbySPData;
|
||||
|
||||
#define DPLSP_IMPL_FIELDS \
|
||||
|
@ -62,7 +61,7 @@ struct IDPLobbySPImpl
|
|||
/* Forward declaration of virtual tables */
|
||||
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 ) );
|
||||
|
||||
|
@ -135,7 +134,7 @@ static BOOL DPLSP_DestroyIUnknown( LPVOID lpSP )
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL DPLSP_CreateDPLobbySP( LPVOID lpSP, IDirectPlay2Impl* dp )
|
||||
static BOOL DPLSP_CreateDPLobbySP( void *lpSP, IDirectPlayImpl *dp )
|
||||
{
|
||||
IDPLobbySPImpl *This = lpSP;
|
||||
|
||||
|
@ -148,22 +147,6 @@ static BOOL DPLSP_CreateDPLobbySP( LPVOID lpSP, IDirectPlay2Impl* 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;
|
||||
}
|
||||
|
||||
|
|
|
@ -458,7 +458,6 @@ typedef struct SPDATA_INIT
|
|||
} SPDATA_INIT, *LPSPDATA_INIT;
|
||||
|
||||
typedef HRESULT (WINAPI *LPSP_INIT)(LPSPDATA_INIT);
|
||||
HRESULT WINAPI DPLSPInit(LPSPDATA_INIT) DECLSPEC_HIDDEN;
|
||||
|
||||
/* Define the COM interface */
|
||||
#define INTERFACE IDPLobbySP
|
||||
|
|
|
@ -353,10 +353,8 @@ void NS_PruneSessionCache( LPVOID lpNSInfo )
|
|||
}
|
||||
|
||||
/* NAME SERVER Message stuff */
|
||||
void NS_ReplyToEnumSessionsRequest( LPCVOID lpcMsg,
|
||||
LPVOID* lplpReplyData,
|
||||
LPDWORD lpdwReplySize,
|
||||
IDirectPlay2Impl* lpDP )
|
||||
void NS_ReplyToEnumSessionsRequest( const void *lpcMsg, void **lplpReplyData, DWORD *lpdwReplySize,
|
||||
IDirectPlayImpl *lpDP )
|
||||
{
|
||||
LPDPMSG_ENUMSESSIONSREPLY rmsg;
|
||||
DWORD dwVariableSize;
|
||||
|
|
|
@ -40,7 +40,7 @@ void NS_SetLocalAddr( LPVOID lpNSInfo, LPCVOID lpHdr, DWORD dwHdrSize ) DECLSPEC
|
|||
void NS_ReplyToEnumSessionsRequest( LPCVOID lpcMsg,
|
||||
LPVOID* lplpReplyData,
|
||||
LPDWORD lpdwReplySize,
|
||||
IDirectPlay2Impl* lpDP ) DECLSPEC_HIDDEN;
|
||||
IDirectPlayImpl *lpDP ) DECLSPEC_HIDDEN;
|
||||
|
||||
HRESULT NS_SendSessionRequestBroadcast( LPCGUID lpcGuid,
|
||||
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/dmusic # Synced to Wine-1.5.26
|
||||
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/dxdiagn # Synced to Wine-0_9_5
|
||||
reactos/dll/directx/wine/dxgi # Synced to Wine-1.7.1
|
||||
|
|
Loading…
Reference in a new issue