Author: akhaldi
Date: Sun Apr 20 00:08:13 2014
New Revision: 62828
URL:
http://svn.reactos.org/svn/reactos?rev=62828&view=rev
Log:
[DPLAYX]
* Sync with Wine 1.7.17.
CORE-8080
Modified:
trunk/reactos/dll/directx/wine/dplayx/dplay.c
trunk/reactos/dll/directx/wine/dplayx/dplay_global.h
trunk/reactos/dll/directx/wine/dplayx/dplaysp.c
trunk/reactos/dll/directx/wine/dplayx/dplayx.idl
trunk/reactos/dll/directx/wine/dplayx/dplayx_global.c
trunk/reactos/dll/directx/wine/dplayx/lobbysp.c
trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/directx/wine/dplayx/dplay.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dplayx/dp…
==============================================================================
--- trunk/reactos/dll/directx/wine/dplayx/dplay.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/dplayx/dplay.c [iso-8859-1] Sun Apr 20 00:08:13 2014
@@ -149,9 +149,7 @@
This->dp2->spData.lpCB->dwVersion = DPSP_MAJORVERSION;
/* This is the pointer to the service provider */
- if( FAILED( DPSP_CreateInterface( &IID_IDirectPlaySP,
- (LPVOID*)&This->dp2->spData.lpISP, This )
)
- )
+ if ( FAILED( dplaysp_create( &IID_IDirectPlaySP,
(void**)&This->dp2->spData.lpISP, This ) ) )
{
/* FIXME: Memory leak */
return FALSE;
@@ -163,8 +161,7 @@
sizeof( *This->dp2->dplspData.lpCB ) );
This->dp2->dplspData.lpCB->dwSize = sizeof( *This->dp2->dplspData.lpCB
);
- if( FAILED( DPLSP_CreateInterface( &IID_IDPLobbySP,
- (LPVOID*)&This->dp2->dplspData.lpISP, This
) )
+ if( FAILED( dplobbysp_create( &IID_IDPLobbySP,
(void**)&This->dp2->dplspData.lpISP, This ) )
)
{
/* FIXME: Memory leak */
@@ -303,28 +300,17 @@
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%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 */
-#endif
break;
case DPMSGCMD_FORWARDADDPLAYERNACK:
@@ -1650,7 +1636,7 @@
}
#if 1
- if( This->dp2->bHostInterface == FALSE )
+ if( !This->dp2->bHostInterface )
{
/* Let the name server know about the creation of this player */
/* FIXME: Is this only to be done for the creation of a server player or
@@ -4624,7 +4610,7 @@
FILETIME filetime;
(i == 0) ? (searchSubKey = spSubKey ) : (searchSubKey = lpSubKey );
- *lpbIsDpSp = (i == 0) ? TRUE : FALSE;
+ *lpbIsDpSp = (i == 0);
/* Need to loop over the service providers in the registry */
Modified: trunk/reactos/dll/directx/wine/dplayx/dplay_global.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dplayx/dp…
==============================================================================
--- trunk/reactos/dll/directx/wine/dplayx/dplay_global.h [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/dplayx/dplay_global.h [iso-8859-1] Sun Apr 20 00:08:13
2014
@@ -200,7 +200,7 @@
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;
+extern HRESULT dplaysp_create( REFIID riid, void **ppv, IDirectPlayImpl *dp )
DECLSPEC_HIDDEN;
+extern HRESULT dplobbysp_create( REFIID riid, void **ppv, IDirectPlayImpl *dp )
DECLSPEC_HIDDEN;
#endif /* __WINE_DPLAY_GLOBAL_INCLUDED */
Modified: trunk/reactos/dll/directx/wine/dplayx/dplaysp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dplayx/dp…
==============================================================================
--- trunk/reactos/dll/directx/wine/dplayx/dplaysp.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/dplayx/dplaysp.c [iso-8859-1] Sun Apr 20 00:08:13 2014
@@ -22,46 +22,16 @@
/* FIXME: Need to add interface locking inside procedures */
-/* Prototypes */
-static BOOL DPSP_CreateIUnknown( LPVOID lpSP );
-static BOOL DPSP_DestroyIUnknown( LPVOID lpSP );
-static BOOL DPSP_CreateDirectPlaySP( void *lpSP, IDirectPlayImpl *dp );
-static BOOL DPSP_DestroyDirectPlaySP( LPVOID lpSP );
-
-/* Predefine the interface */
-typedef struct IDirectPlaySPImpl IDirectPlaySPImpl;
-
-typedef struct tagDirectPlaySPIUnknownData
-{
- LONG ulObjRef;
- CRITICAL_SECTION DPSP_lock;
-} DirectPlaySPIUnknownData;
-
-typedef struct tagDirectPlaySPData
-{
- LPVOID lpSpRemoteData;
- DWORD dwSpRemoteDataSize; /* Size of data pointed to by lpSpRemoteData */
-
- LPVOID lpSpLocalData;
- DWORD dwSpLocalDataSize; /* Size of data pointed to by lpSpLocalData */
-
+typedef struct IDirectPlaySPImpl
+{
+ IDirectPlaySP IDirectPlaySP_iface;
+ LONG ref;
+ void *remote_data;
+ DWORD remote_data_size;
+ void *local_data;
+ DWORD local_data_size;
IDirectPlayImpl *dplay; /* FIXME: This should perhaps be iface not impl */
-
-} DirectPlaySPData;
-
-#define DPSP_IMPL_FIELDS \
- LONG ulInterfaceRef; \
- DirectPlaySPIUnknownData* unk; \
- DirectPlaySPData* sp;
-
-struct IDirectPlaySPImpl
-{
- const IDirectPlaySPVtbl *lpVtbl;
- DPSP_IMPL_FIELDS
-};
-
-/* Forward declaration of virtual tables */
-static const IDirectPlaySPVtbl directPlaySPVT;
+} IDirectPlaySPImpl;
/* This structure is passed to the DP object for safe keeping */
typedef struct tagDP_SPPLAYERDATA
@@ -73,202 +43,60 @@
DWORD dwPlayerRemoteDataSize;
} DP_SPPLAYERDATA, *LPDP_SPPLAYERDATA;
-/* Create the SP interface */
-HRESULT DPSP_CreateInterface( REFIID riid, void **ppvObj, IDirectPlayImpl *dp )
-{
- TRACE( " for %s\n", debugstr_guid( riid ) );
-
- *ppvObj = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
- sizeof( IDirectPlaySPImpl ) );
-
- if( *ppvObj == NULL )
- {
- return DPERR_OUTOFMEMORY;
- }
-
- if( IsEqualGUID( &IID_IDirectPlaySP, riid ) )
- {
- IDirectPlaySPImpl *This = *ppvObj;
- This->lpVtbl = &directPlaySPVT;
- }
- else
- {
- /* Unsupported interface */
- HeapFree( GetProcessHeap(), 0, *ppvObj );
- *ppvObj = NULL;
-
- return E_NOINTERFACE;
- }
-
- /* Initialize it */
- if( DPSP_CreateIUnknown( *ppvObj ) &&
- DPSP_CreateDirectPlaySP( *ppvObj, dp )
- )
- {
- IDirectPlaySP_AddRef( (LPDIRECTPLAYSP)*ppvObj );
+
+static inline IDirectPlaySPImpl *impl_from_IDirectPlaySP( IDirectPlaySP *iface )
+{
+ return CONTAINING_RECORD( iface, IDirectPlaySPImpl, IDirectPlaySP_iface );
+}
+
+static HRESULT WINAPI IDirectPlaySPImpl_QueryInterface( IDirectPlaySP *iface, REFIID
riid,
+ void **ppv )
+{
+ TRACE("(%p)->(%s,%p)\n", iface, debugstr_guid( riid ), ppv );
+
+ if ( IsEqualGUID( &IID_IUnknown, riid ) || IsEqualGUID( &IID_IDirectPlaySP,
riid ) )
+ {
+ *ppv = iface;
+ IDirectPlaySP_AddRef( iface );
return S_OK;
}
- /* Initialize failed, destroy it */
- DPSP_DestroyDirectPlaySP( *ppvObj );
- DPSP_DestroyIUnknown( *ppvObj );
-
- HeapFree( GetProcessHeap(), 0, *ppvObj );
- *ppvObj = NULL;
-
- return DPERR_NOMEMORY;
-}
-
-static BOOL DPSP_CreateIUnknown( LPVOID lpSP )
-{
- IDirectPlaySPImpl *This = lpSP;
-
- This->unk = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->unk) )
);
-
- if ( This->unk == NULL )
- {
- return FALSE;
- }
-
- 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 = lpSP;
-
- This->unk->DPSP_lock.DebugInfo->Spare[0] = 0;
- DeleteCriticalSection( &This->unk->DPSP_lock );
- HeapFree( GetProcessHeap(), 0, This->unk );
-
- return TRUE;
-}
-
-
-static BOOL DPSP_CreateDirectPlaySP( void *lpSP, IDirectPlayImpl *dp )
-{
- IDirectPlaySPImpl *This = lpSP;
-
- This->sp = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->sp) )
);
-
- if ( This->sp == NULL )
- {
- return FALSE;
- }
-
- This->sp->dplay = dp;
-
- return TRUE;
-}
-
-static BOOL DPSP_DestroyDirectPlaySP( LPVOID lpSP )
-{
- IDirectPlaySPImpl *This = lpSP;
-
- HeapFree( GetProcessHeap(), 0, This->sp->lpSpRemoteData );
- HeapFree( GetProcessHeap(), 0, This->sp->lpSpLocalData );
-
- /* FIXME: Need to delete player queue */
-
- HeapFree( GetProcessHeap(), 0, This->sp );
- return TRUE;
-}
-
-/* Interface implementation */
-
-static HRESULT WINAPI DPSP_QueryInterface
-( LPDIRECTPLAYSP iface,
- REFIID riid,
- LPVOID* ppvObj )
-{
- IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
- TRACE("(%p)->(%s,%p)\n", This, debugstr_guid( riid ), ppvObj );
-
- *ppvObj = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
- sizeof( *This ) );
-
- if( *ppvObj == NULL )
- {
- return DPERR_OUTOFMEMORY;
- }
-
- CopyMemory( *ppvObj, This, sizeof( *This ) );
- (*(IDirectPlaySPImpl**)ppvObj)->ulInterfaceRef = 0;
-
- if( IsEqualGUID( &IID_IDirectPlaySP, riid ) )
- {
- IDirectPlaySPImpl *This = *ppvObj;
- This->lpVtbl = &directPlaySPVT;
- }
- else
- {
- /* Unsupported interface */
- HeapFree( GetProcessHeap(), 0, *ppvObj );
- *ppvObj = NULL;
-
- return E_NOINTERFACE;
- }
-
- IDirectPlaySP_AddRef( (LPDIRECTPLAYSP)*ppvObj );
-
- return S_OK;
-}
-
-static ULONG WINAPI DPSP_AddRef
-( LPDIRECTPLAYSP iface )
-{
- ULONG ulInterfaceRefCount, ulObjRefCount;
- IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
-
- ulObjRefCount = InterlockedIncrement( &This->unk->ulObjRef );
- ulInterfaceRefCount = InterlockedIncrement( &This->ulInterfaceRef );
-
- TRACE( "ref count incremented to %u:%u for %p\n",
- ulInterfaceRefCount, ulObjRefCount, This );
-
- return ulObjRefCount;
-}
-
-static ULONG WINAPI DPSP_Release
-( LPDIRECTPLAYSP iface )
-{
- ULONG ulInterfaceRefCount, ulObjRefCount;
- IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
-
- ulObjRefCount = InterlockedDecrement( &This->unk->ulObjRef );
- ulInterfaceRefCount = InterlockedDecrement( &This->ulInterfaceRef );
-
- TRACE( "ref count decremented to %u:%u for %p\n",
- ulInterfaceRefCount, ulObjRefCount, This );
-
- /* Deallocate if this is the last reference to the object */
- if( ulObjRefCount == 0 )
- {
- DPSP_DestroyDirectPlaySP( This );
- DPSP_DestroyIUnknown( This );
- }
-
- if( ulInterfaceRefCount == 0 )
- {
+ FIXME( "Unsupported interface %s\n", debugstr_guid( riid ) );
+ *ppv = NULL;
+ return E_NOINTERFACE;
+}
+
+static ULONG WINAPI IDirectPlaySPImpl_AddRef( IDirectPlaySP *iface )
+{
+ IDirectPlaySPImpl *This = impl_from_IDirectPlaySP( iface );
+ ULONG ref = InterlockedIncrement( &This->ref );
+
+ TRACE( "(%p) ref=%d\n", This, ref );
+
+ return ref;
+}
+
+static ULONG WINAPI IDirectPlaySPImpl_Release( IDirectPlaySP *iface )
+{
+ IDirectPlaySPImpl *This = impl_from_IDirectPlaySP( iface );
+ ULONG ref = InterlockedDecrement( &This->ref );
+
+ TRACE( "(%p) ref=%d\n", This, ref );
+
+ if( !ref )
+ {
+ HeapFree( GetProcessHeap(), 0, This->remote_data );
+ HeapFree( GetProcessHeap(), 0, This->local_data );
HeapFree( GetProcessHeap(), 0, This );
}
- return ulInterfaceRefCount;
-}
-
-static HRESULT WINAPI IDirectPlaySPImpl_AddMRUEntry
-( LPDIRECTPLAYSP iface,
- LPCWSTR lpSection,
- LPCWSTR lpKey,
- LPCVOID lpData,
- DWORD dwDataSize,
- DWORD dwMaxEntries
-)
-{
- IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
+ return ref;
+}
+
+static HRESULT WINAPI IDirectPlaySPImpl_AddMRUEntry( IDirectPlaySP *iface, LPCWSTR
lpSection,
+ LPCWSTR lpKey, const void *lpData, DWORD dwDataSize, DWORD dwMaxEntries )
+{
+ IDirectPlaySPImpl *This = impl_from_IDirectPlaySP( iface );
/* Should be able to call the comctl32 undocumented MRU routines.
I suspect that the interface works appropriately */
@@ -278,17 +106,11 @@
return DP_OK;
}
-static HRESULT WINAPI IDirectPlaySPImpl_CreateAddress
-( LPDIRECTPLAYSP iface,
- REFGUID guidSP,
- REFGUID guidDataType,
- LPCVOID lpData,
- DWORD dwDataSize,
- LPVOID lpAddress,
- LPDWORD lpdwAddressSize
-)
-{
- IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
+static HRESULT WINAPI IDirectPlaySPImpl_CreateAddress( IDirectPlaySP *iface, REFGUID
guidSP,
+ REFGUID guidDataType, const void *lpData, DWORD dwDataSize, void *lpAddress,
+ DWORD *lpdwAddressSize )
+{
+ IDirectPlaySPImpl *This = impl_from_IDirectPlaySP( iface );
FIXME( "(%p)->(%s,%s,%p,0x%08x,%p,%p): stub\n",
This, debugstr_guid(guidSP), debugstr_guid(guidDataType),
@@ -297,15 +119,11 @@
return DP_OK;
}
-static HRESULT WINAPI IDirectPlaySPImpl_EnumAddress
-( LPDIRECTPLAYSP iface,
- LPDPENUMADDRESSCALLBACK lpEnumAddressCallback,
- LPCVOID lpAddress,
- DWORD dwAddressSize,
- LPVOID lpContext
-)
-{
- IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
+static HRESULT WINAPI IDirectPlaySPImpl_EnumAddress( IDirectPlaySP *iface,
+ LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, const void *lpAddress, DWORD
dwAddressSize,
+ void *lpContext )
+{
+ IDirectPlaySPImpl *This = impl_from_IDirectPlaySP( iface );
TRACE( "(%p)->(%p,%p,0x%08x,%p)\n",
This, lpEnumAddressCallback, lpAddress, dwAddressSize, lpContext );
@@ -315,31 +133,23 @@
return DP_OK;
}
-static HRESULT WINAPI IDirectPlaySPImpl_EnumMRUEntries
-( LPDIRECTPLAYSP iface,
- LPCWSTR lpSection,
- LPCWSTR lpKey,
- LPENUMMRUCALLBACK lpEnumMRUCallback,
- LPVOID lpContext
-)
-{
- IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
+static HRESULT WINAPI IDirectPlaySPImpl_EnumMRUEntries( IDirectPlaySP *iface, LPCWSTR
lpSection,
+ LPCWSTR lpKey, LPENUMMRUCALLBACK lpEnumMRUCallback, void *lpContext )
+{
+ IDirectPlaySPImpl *This = impl_from_IDirectPlaySP( iface );
/* Should be able to call the comctl32 undocumented MRU routines.
I suspect that the interface works appropriately */
- FIXME( "(%p)->(%p,%p,%p,%p,): stub\n",
+ FIXME( "(%p)->(%p,%p,%p,%p): stub\n",
This, lpSection, lpKey, lpEnumMRUCallback, lpContext );
return DP_OK;
}
-static HRESULT WINAPI IDirectPlaySPImpl_GetPlayerFlags
-( LPDIRECTPLAYSP iface,
- DPID idPlayer,
- LPDWORD lpdwPlayerFlags
-)
-{
- IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
+static HRESULT WINAPI IDirectPlaySPImpl_GetPlayerFlags( IDirectPlaySP *iface, DPID
idPlayer,
+ DWORD *lpdwPlayerFlags )
+{
+ IDirectPlaySPImpl *This = impl_from_IDirectPlaySP( iface );
FIXME( "(%p)->(0x%08x,%p): stub\n",
This, idPlayer, lpdwPlayerFlags );
@@ -347,22 +157,17 @@
return DP_OK;
}
-static HRESULT WINAPI IDirectPlaySPImpl_GetSPPlayerData
-( LPDIRECTPLAYSP iface,
- DPID idPlayer,
- LPVOID* lplpData,
- LPDWORD lpdwDataSize,
- DWORD dwFlags
-)
-{
+static HRESULT WINAPI IDirectPlaySPImpl_GetSPPlayerData( IDirectPlaySP *iface, DPID
idPlayer,
+ void **lplpData, DWORD *lpdwDataSize, DWORD dwFlags )
+{
+ IDirectPlaySPImpl *This = impl_from_IDirectPlaySP( iface );
HRESULT hr;
LPDP_SPPLAYERDATA lpPlayerData;
- IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
TRACE( "(%p)->(0x%08x,%p,%p,0x%08x)\n",
This, idPlayer, lplpData, lpdwDataSize, dwFlags );
- hr = DP_GetSPPlayerData( This->sp->dplay, idPlayer, (LPVOID*)&lpPlayerData
);
+ hr = DP_GetSPPlayerData( This->dplay, idPlayer, (void**)&lpPlayerData );
if( FAILED(hr) )
{
@@ -390,21 +195,16 @@
return hr;
}
-static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage
-( LPDIRECTPLAYSP iface,
- LPVOID lpMessageBody,
- DWORD dwMessageBodySize,
- LPVOID lpMessageHeader
-)
-{
+static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage( IDirectPlaySP *iface, void
*lpMessageBody,
+ DWORD dwMessageBodySize, void *lpMessageHeader )
+{
+ IDirectPlaySPImpl *This = impl_from_IDirectPlaySP( iface );
LPDPMSG_SENDENVELOPE lpMsg = lpMessageBody;
HRESULT hr = DPERR_GENERIC;
WORD wCommandId;
WORD wVersion;
DPSP_REPLYDATA data;
- IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
-
FIXME( "(%p)->(%p,0x%08x,%p): mostly stub\n",
This, lpMessageBody, dwMessageBodySize, lpMessageHeader );
@@ -434,9 +234,8 @@
data.dwMessageSize = 0;
/* Pass this message to the dplay interface to handle */
- hr = DP_HandleMessage( This->sp->dplay, lpMessageBody, dwMessageBodySize,
- lpMessageHeader, wCommandId, wVersion,
- &data.lpMessage, &data.dwMessageSize );
+ hr = DP_HandleMessage( This->dplay, lpMessageBody, dwMessageBodySize,
lpMessageHeader,
+ wCommandId, wVersion, &data.lpMessage,
&data.dwMessageSize );
if( FAILED(hr) )
{
@@ -450,7 +249,7 @@
data.idNameServer = 0;
data.lpISP = iface;
- hr = (This->sp->dplay->dp2->spData.lpCB->Reply)( &data );
+ hr = This->dplay->dp2->spData.lpCB->Reply( &data );
if( FAILED(hr) )
{
@@ -704,25 +503,17 @@
#endif
}
-static HRESULT WINAPI IDirectPlaySPImpl_SetSPPlayerData
-( LPDIRECTPLAYSP iface,
- DPID idPlayer,
- LPVOID lpData,
- DWORD dwDataSize,
- DWORD dwFlags
-)
-{
+static HRESULT WINAPI IDirectPlaySPImpl_SetSPPlayerData( IDirectPlaySP *iface, DPID
idPlayer,
+ void *lpData, DWORD dwDataSize, DWORD dwFlags )
+{
+ IDirectPlaySPImpl *This = impl_from_IDirectPlaySP( iface );
HRESULT hr;
LPDP_SPPLAYERDATA lpPlayerEntry;
LPVOID lpPlayerData;
- IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
-
-/* TRACE( "Called on process 0x%08lx\n", GetCurrentProcessId() ); */
- TRACE( "(%p)->(0x%08x,%p,0x%08x,0x%08x)\n",
- This, idPlayer, lpData, dwDataSize, dwFlags );
-
- hr = DP_GetSPPlayerData( This->sp->dplay, idPlayer, (LPVOID*)&lpPlayerEntry
);
+ TRACE( "(%p)->(0x%08x,%p,0x%08x,0x%08x)\n", This, idPlayer, lpData,
dwDataSize, dwFlags );
+
+ hr = DP_GetSPPlayerData( This->dplay, idPlayer, (void**)&lpPlayerEntry );
if( FAILED(hr) )
{
/* Player must not exist */
@@ -743,20 +534,16 @@
lpPlayerEntry->dwPlayerRemoteDataSize = dwDataSize;
}
- hr = DP_SetSPPlayerData( This->sp->dplay, idPlayer, lpPlayerEntry );
+ hr = DP_SetSPPlayerData( This->dplay, idPlayer, lpPlayerEntry );
return hr;
}
-static HRESULT WINAPI IDirectPlaySPImpl_CreateCompoundAddress
-( LPDIRECTPLAYSP iface,
- LPCDPCOMPOUNDADDRESSELEMENT lpElements,
- DWORD dwElementCount,
- LPVOID lpAddress,
- LPDWORD lpdwAddressSize
-)
-{
- IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
+static HRESULT WINAPI IDirectPlaySPImpl_CreateCompoundAddress( IDirectPlaySP *iface,
+ const DPCOMPOUNDADDRESSELEMENT *lpElements, DWORD dwElementCount, void
*lpAddress,
+ DWORD *lpdwAddressSize )
+{
+ IDirectPlaySPImpl *This = impl_from_IDirectPlaySP( iface );
FIXME( "(%p)->(%p,0x%08x,%p,%p): stub\n",
This, lpElements, dwElementCount, lpAddress, lpdwAddressSize );
@@ -764,19 +551,13 @@
return DP_OK;
}
-static HRESULT WINAPI IDirectPlaySPImpl_GetSPData
-( LPDIRECTPLAYSP iface,
- LPVOID* lplpData,
- LPDWORD lpdwDataSize,
- DWORD dwFlags
-)
-{
+static HRESULT WINAPI IDirectPlaySPImpl_GetSPData( IDirectPlaySP *iface, void
**lplpData,
+ DWORD *lpdwDataSize, DWORD dwFlags )
+{
+ IDirectPlaySPImpl *This = impl_from_IDirectPlaySP( iface );
HRESULT hr = DP_OK;
- IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
-
-/* TRACE( "Called on process 0x%08lx\n", GetCurrentProcessId() ); */
- TRACE( "(%p)->(%p,%p,0x%08x)\n",
- This, lplpData, lpdwDataSize, dwFlags );
+
+ TRACE( "(%p)->(%p,%p,0x%08x)\n", This, lplpData, lpdwDataSize, dwFlags );
#if 0
/* This is what the documentation says... */
@@ -800,42 +581,31 @@
/* Yes, we're supposed to return a pointer to the memory we have stored! */
if( dwFlags == DPSET_REMOTE )
{
- *lpdwDataSize = This->sp->dwSpRemoteDataSize;
- *lplpData = This->sp->lpSpRemoteData;
-
- if( This->sp->lpSpRemoteData == NULL )
- {
+ *lpdwDataSize = This->remote_data_size;
+ *lplpData = This->remote_data;
+
+ if( !This->remote_data )
hr = DPERR_GENERIC;
- }
}
else if( dwFlags == DPSET_LOCAL )
{
- *lpdwDataSize = This->sp->dwSpLocalDataSize;
- *lplpData = This->sp->lpSpLocalData;
-
- if( This->sp->lpSpLocalData == NULL )
- {
+ *lpdwDataSize = This->local_data_size;
+ *lplpData = This->local_data;
+
+ if( !This->local_data )
hr = DPERR_GENERIC;
- }
}
return hr;
}
-static HRESULT WINAPI IDirectPlaySPImpl_SetSPData
-( LPDIRECTPLAYSP iface,
- LPVOID lpData,
- DWORD dwDataSize,
- DWORD dwFlags
-)
-{
+static HRESULT WINAPI IDirectPlaySPImpl_SetSPData( IDirectPlaySP *iface, void *lpData,
+ DWORD dwDataSize, DWORD dwFlags )
+{
+ IDirectPlaySPImpl *This = impl_from_IDirectPlaySP( iface );
LPVOID lpSpData;
- IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
-
-/* TRACE( "Called on process 0x%08lx\n", GetCurrentProcessId() ); */
- TRACE( "(%p)->(%p,0x%08x,0x%08x)\n",
- This, lpData, dwDataSize, dwFlags );
+ TRACE( "(%p)->(%p,0x%08x,0x%08x)\n", This, lpData, dwDataSize, dwFlags );
#if 0
/* This is what the documentation says... */
@@ -860,27 +630,24 @@
/* If we have data already allocated, free it and replace it */
if( dwFlags == DPSET_REMOTE )
{
- HeapFree( GetProcessHeap(), 0, This->sp->lpSpRemoteData );
- This->sp->dwSpRemoteDataSize = dwDataSize;
- This->sp->lpSpRemoteData = lpSpData;
+ HeapFree( GetProcessHeap(), 0, This->remote_data );
+ This->remote_data_size = dwDataSize;
+ This->remote_data = lpSpData;
}
else if ( dwFlags == DPSET_LOCAL )
{
- HeapFree( GetProcessHeap(), 0, This->sp->lpSpLocalData );
- This->sp->lpSpLocalData = lpSpData;
- This->sp->dwSpLocalDataSize = dwDataSize;
+ HeapFree( GetProcessHeap(), 0, This->local_data );
+ This->local_data = lpSpData;
+ This->local_data_size = dwDataSize;
}
return DP_OK;
}
-static VOID WINAPI IDirectPlaySPImpl_SendComplete
-( LPDIRECTPLAYSP iface,
- LPVOID unknownA,
- DWORD unknownB
-)
-{
- IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface;
+static void WINAPI IDirectPlaySPImpl_SendComplete( IDirectPlaySP *iface, void *unknownA,
+ DWORD unknownB )
+{
+ IDirectPlaySPImpl *This = impl_from_IDirectPlaySP( iface );
FIXME( "(%p)->(%p,0x%08x): stub\n",
This, unknownA, unknownB );
@@ -888,11 +655,9 @@
static const IDirectPlaySPVtbl directPlaySPVT =
{
-
- DPSP_QueryInterface,
- DPSP_AddRef,
- DPSP_Release,
-
+ IDirectPlaySPImpl_QueryInterface,
+ IDirectPlaySPImpl_AddRef,
+ IDirectPlaySPImpl_Release,
IDirectPlaySPImpl_AddMRUEntry,
IDirectPlaySPImpl_CreateAddress,
IDirectPlaySPImpl_EnumAddress,
@@ -907,6 +672,27 @@
IDirectPlaySPImpl_SendComplete
};
+HRESULT dplaysp_create( REFIID riid, void **ppv, IDirectPlayImpl *dp )
+{
+ IDirectPlaySPImpl *obj;
+ HRESULT hr;
+
+ TRACE( "(%s, %p)\n", debugstr_guid( riid ), ppv );
+
+ *ppv = NULL;
+ obj = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *obj ) );
+ if ( !obj )
+ return DPERR_OUTOFMEMORY;
+
+ obj->IDirectPlaySP_iface.lpVtbl = &directPlaySPVT;
+ obj->ref = 1;
+ obj->dplay = dp;
+
+ hr = IDirectPlaySP_QueryInterface( &obj->IDirectPlaySP_iface, riid, ppv );
+ IDirectPlaySP_Release( &obj->IDirectPlaySP_iface );
+
+ return hr;
+}
/* DP external interfaces to call into DPSP interface */
Modified: trunk/reactos/dll/directx/wine/dplayx/dplayx.idl
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dplayx/dp…
==============================================================================
--- trunk/reactos/dll/directx/wine/dplayx/dplayx.idl [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/dplayx/dplayx.idl [iso-8859-1] Sun Apr 20 00:08:13
2014
@@ -18,6 +18,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#pragma makedep register
+
[
helpstring("DirectPlay Object"),
threading(both),
Modified: trunk/reactos/dll/directx/wine/dplayx/dplayx_global.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dplayx/dp…
==============================================================================
--- trunk/reactos/dll/directx/wine/dplayx/dplayx_global.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/dplayx/dplayx_global.c [iso-8859-1] Sun Apr 20 00:08:13
2014
@@ -66,9 +66,10 @@
typedef struct
{
- DWORD used;
- DWORD data[dwBlockSize-sizeof(DWORD)];
+ BOOL used;
+ BYTE data[dwBlockSize - sizeof(BOOL)];
} DPLAYX_MEM_SLICE;
+C_ASSERT(sizeof(DPLAYX_MEM_SLICE) == dwBlockSize);
static DPLAYX_MEM_SLICE* lpMemArea;
@@ -83,10 +84,10 @@
return;
}
- lpAddrStart = (char*)addr - sizeof(DWORD); /* Find block header */
+ lpAddrStart = CONTAINING_RECORD(addr, DPLAYX_MEM_SLICE, data); /* Find block header */
dwBlockUsed = ((BYTE*)lpAddrStart - (BYTE*)lpMemArea)/dwBlockSize;
- lpMemArea[ dwBlockUsed ].used = 0;
+ lpMemArea[ dwBlockUsed ].used = FALSE;
}
static LPVOID DPLAYX_PrivHeapAlloc( DWORD flags, DWORD size )
@@ -94,20 +95,20 @@
LPVOID lpvArea = NULL;
UINT uBlockUsed;
- if( size > (dwBlockSize - sizeof(DWORD)) )
+ if( size > (dwBlockSize - sizeof(BOOL)) )
{
FIXME( "Size exceeded. Request of 0x%08x\n", size );
- size = dwBlockSize - sizeof(DWORD);
+ size = dwBlockSize - sizeof(BOOL);
}
/* Find blank area */
uBlockUsed = 0;
- while( ( lpMemArea[ uBlockUsed ].used != 0 ) && ( uBlockUsed <= dwMaxBlock )
) { uBlockUsed++; }
+ while( lpMemArea[ uBlockUsed ].used && uBlockUsed <= dwMaxBlock ) {
uBlockUsed++; }
if( uBlockUsed <= dwMaxBlock )
{
/* Set the area used */
- lpMemArea[ uBlockUsed ].used = 1;
+ lpMemArea[ uBlockUsed ].used = TRUE;
lpvArea = lpMemArea[ uBlockUsed ].data;
}
else
@@ -1183,7 +1184,7 @@
/* For errors not in the list, return HRESULT as a string
This part is not thread safe */
WARN( "Unknown error 0x%08x\n", hr );
- wsprintfA( szTempStr, "0x%08lx", hr );
+ wsprintfA( szTempStr, "0x%08x", hr );
return szTempStr;
}
}
Modified: trunk/reactos/dll/directx/wine/dplayx/lobbysp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dplayx/lo…
==============================================================================
--- trunk/reactos/dll/directx/wine/dplayx/lobbysp.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/dplayx/lobbysp.c [iso-8859-1] Sun Apr 20 00:08:13 2014
@@ -20,395 +20,180 @@
#include "dplayx_global.h"
-/* Prototypes */
-static BOOL DPLSP_CreateIUnknown( LPVOID lpSP );
-static BOOL DPLSP_DestroyIUnknown( LPVOID lpSP );
-static BOOL DPLSP_CreateDPLobbySP( void *lpSP, IDirectPlayImpl *dp );
-static BOOL DPLSP_DestroyDPLobbySP( LPVOID lpSP );
-
-
-/* Predefine the interface */
-typedef struct IDPLobbySPImpl IDPLobbySPImpl;
-
-typedef struct tagDPLobbySPIUnknownData
-{
- LONG ulObjRef;
- CRITICAL_SECTION DPLSP_lock;
-} DPLobbySPIUnknownData;
-
-typedef struct tagDPLobbySPData
-{
+
+typedef struct IDPLobbySPImpl
+{
+ IDPLobbySP IDPLobbySP_iface;
+ LONG ref;
IDirectPlayImpl *dplay;
-} DPLobbySPData;
-
-#define DPLSP_IMPL_FIELDS \
- LONG ulInterfaceRef; \
- DPLobbySPIUnknownData* unk; \
- DPLobbySPData* sp;
-
-struct IDPLobbySPImpl
-{
- const IDPLobbySPVtbl *lpVtbl;
- DPLSP_IMPL_FIELDS
-};
-
-/* Forward declaration of virtual tables */
-static const IDPLobbySPVtbl dpLobbySPVT;
-
-HRESULT DPLSP_CreateInterface( REFIID riid, void **ppvObj, IDirectPlayImpl *dp )
-{
- TRACE( " for %s\n", debugstr_guid( riid ) );
-
- *ppvObj = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
- sizeof( IDPLobbySPImpl ) );
-
- if( *ppvObj == NULL )
+} IDPLobbySPImpl;
+
+static inline IDPLobbySPImpl *impl_from_IDPLobbySP(IDPLobbySP *iface)
+{
+ return CONTAINING_RECORD(iface, IDPLobbySPImpl, IDPLobbySP_iface);
+}
+
+static HRESULT WINAPI IDPLobbySPImpl_QueryInterface( IDPLobbySP *iface, REFIID riid,
+ void **ppv )
+{
+ TRACE("(%p)->(%s,%p)\n", iface, debugstr_guid( riid ), ppv );
+
+ if ( IsEqualGUID( &IID_IUnknown, riid ) || IsEqualGUID( &IID_IDPLobbySP, riid )
)
{
- return DPERR_OUTOFMEMORY;
- }
-
- if( IsEqualGUID( &IID_IDPLobbySP, riid ) )
- {
- IDPLobbySPImpl *This = *ppvObj;
- This->lpVtbl = &dpLobbySPVT;
- }
- else
- {
- /* Unsupported interface */
- HeapFree( GetProcessHeap(), 0, *ppvObj );
- *ppvObj = NULL;
-
- return E_NOINTERFACE;
- }
-
- /* Initialize it */
- if( DPLSP_CreateIUnknown( *ppvObj ) &&
- DPLSP_CreateDPLobbySP( *ppvObj, dp )
- )
- {
- IDPLobbySP_AddRef( (LPDPLOBBYSP)*ppvObj );
+ *ppv = iface;
+ IDPLobbySP_AddRef(iface);
return S_OK;
}
- /* Initialize failed, destroy it */
- DPLSP_DestroyDPLobbySP( *ppvObj );
- DPLSP_DestroyIUnknown( *ppvObj );
-
- HeapFree( GetProcessHeap(), 0, *ppvObj );
- *ppvObj = NULL;
-
- return DPERR_NOMEMORY;
-}
-
-static BOOL DPLSP_CreateIUnknown( LPVOID lpSP )
-{
- IDPLobbySPImpl *This = lpSP;
-
- This->unk = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->unk) )
);
-
- if ( This->unk == NULL )
- {
- return FALSE;
- }
-
- 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 = lpSP;
-
- This->unk->DPLSP_lock.DebugInfo->Spare[0] = 0;
- DeleteCriticalSection( &This->unk->DPLSP_lock );
- HeapFree( GetProcessHeap(), 0, This->unk );
-
- return TRUE;
-}
-
-static BOOL DPLSP_CreateDPLobbySP( void *lpSP, IDirectPlayImpl *dp )
-{
- IDPLobbySPImpl *This = lpSP;
-
- This->sp = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->sp) )
);
-
- if ( This->sp == NULL )
- {
- return FALSE;
- }
-
- This->sp->dplay = dp;
-
- return TRUE;
-}
-
-static BOOL DPLSP_DestroyDPLobbySP( LPVOID lpSP )
-{
- IDPLobbySPImpl *This = lpSP;
-
- HeapFree( GetProcessHeap(), 0, This->sp );
-
- return TRUE;
-}
-
-static
-HRESULT WINAPI DPLSP_QueryInterface
-( LPDPLOBBYSP iface,
- REFIID riid,
- LPVOID* ppvObj
-)
-{
- IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface;
- TRACE("(%p)->(%s,%p)\n", This, debugstr_guid( riid ), ppvObj );
-
- *ppvObj = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
- sizeof( *This ) );
-
- if( *ppvObj == NULL )
- {
- return DPERR_OUTOFMEMORY;
- }
-
- CopyMemory( *ppvObj, This, sizeof( *This ) );
- (*(IDPLobbySPImpl**)ppvObj)->ulInterfaceRef = 0;
-
- if( IsEqualGUID( &IID_IDPLobbySP, riid ) )
- {
- IDPLobbySPImpl *This = *ppvObj;
- This->lpVtbl = &dpLobbySPVT;
- }
- else
- {
- /* Unsupported interface */
- HeapFree( GetProcessHeap(), 0, *ppvObj );
- *ppvObj = NULL;
-
- return E_NOINTERFACE;
- }
-
- IDPLobbySP_AddRef( (LPDPLOBBYSP)*ppvObj );
-
- return S_OK;
-}
-
-static
-ULONG WINAPI DPLSP_AddRef
-( LPDPLOBBYSP iface )
-{
- ULONG ulInterfaceRefCount, ulObjRefCount;
- IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface;
-
- ulObjRefCount = InterlockedIncrement( &This->unk->ulObjRef );
- ulInterfaceRefCount = InterlockedIncrement( &This->ulInterfaceRef );
-
- TRACE( "ref count incremented to %u:%u for %p\n",
- ulInterfaceRefCount, ulObjRefCount, This );
-
- return ulObjRefCount;
-}
-
-static
-ULONG WINAPI DPLSP_Release
-( LPDPLOBBYSP iface )
-{
- ULONG ulInterfaceRefCount, ulObjRefCount;
- IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface;
-
- ulObjRefCount = InterlockedDecrement( &This->unk->ulObjRef );
- ulInterfaceRefCount = InterlockedDecrement( &This->ulInterfaceRef );
-
- TRACE( "ref count decremented to %u:%u for %p\n",
- ulInterfaceRefCount, ulObjRefCount, This );
-
- /* Deallocate if this is the last reference to the object */
- if( ulObjRefCount == 0 )
- {
- DPLSP_DestroyDPLobbySP( This );
- DPLSP_DestroyIUnknown( This );
- }
-
- if( ulInterfaceRefCount == 0 )
- {
+ FIXME("Unsupported interface %s\n", debugstr_guid(riid));
+ *ppv = NULL;
+ return E_NOINTERFACE;
+}
+
+static ULONG WINAPI IDPLobbySPImpl_AddRef( IDPLobbySP *iface )
+{
+ IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
+ ULONG ref = InterlockedIncrement( &This->ref );
+
+ TRACE( "(%p) ref=%d\n", This, ref );
+
+ return ref;
+}
+
+static ULONG WINAPI IDPLobbySPImpl_Release( IDPLobbySP *iface )
+{
+ IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
+ ULONG ref = InterlockedDecrement( &This->ref );
+
+ TRACE( "(%p) ref=%d\n", This, ref );
+
+ if( !ref )
HeapFree( GetProcessHeap(), 0, This );
- }
-
- return ulInterfaceRefCount;
-}
-
-static
-HRESULT WINAPI IDPLobbySPImpl_AddGroupToGroup
-( LPDPLOBBYSP iface,
- LPSPDATA_ADDREMOTEGROUPTOGROUP argtg
-)
-{
- IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface;
+
+ return ref;
+}
+
+static HRESULT WINAPI IDPLobbySPImpl_AddGroupToGroup( IDPLobbySP *iface,
+ SPDATA_ADDREMOTEGROUPTOGROUP *argtg )
+{
+ IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
FIXME( "(%p)->(%p):stub\n", This, argtg );
return DP_OK;
}
-static
-HRESULT WINAPI IDPLobbySPImpl_AddPlayerToGroup
-( LPDPLOBBYSP iface,
- LPSPDATA_ADDREMOTEPLAYERTOGROUP arptg
-)
-{
- IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface;
+static HRESULT WINAPI IDPLobbySPImpl_AddPlayerToGroup( IDPLobbySP *iface,
+ SPDATA_ADDREMOTEPLAYERTOGROUP *arptg )
+{
+ IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
FIXME( "(%p)->(%p):stub\n", This, arptg );
return DP_OK;
}
-static
-HRESULT WINAPI IDPLobbySPImpl_CreateGroup
-( LPDPLOBBYSP iface,
- LPSPDATA_CREATEREMOTEGROUP crg
-)
-{
- IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface;
+static HRESULT WINAPI IDPLobbySPImpl_CreateGroup( IDPLobbySP *iface,
+ SPDATA_CREATEREMOTEGROUP *crg )
+{
+ IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
FIXME( "(%p)->(%p):stub\n", This, crg );
return DP_OK;
}
-static
-HRESULT WINAPI IDPLobbySPImpl_CreateGroupInGroup
-( LPDPLOBBYSP iface,
- LPSPDATA_CREATEREMOTEGROUPINGROUP crgig
-)
-{
- IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface;
+static HRESULT WINAPI IDPLobbySPImpl_CreateGroupInGroup( IDPLobbySP *iface,
+ SPDATA_CREATEREMOTEGROUPINGROUP *crgig )
+{
+ IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
FIXME( "(%p)->(%p):stub\n", This, crgig );
return DP_OK;
}
-static
-HRESULT WINAPI IDPLobbySPImpl_DeleteGroupFromGroup
-( LPDPLOBBYSP iface,
- LPSPDATA_DELETEREMOTEGROUPFROMGROUP drgfg
-)
-{
- IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface;
+static HRESULT WINAPI IDPLobbySPImpl_DeleteGroupFromGroup( IDPLobbySP *iface,
+ SPDATA_DELETEREMOTEGROUPFROMGROUP *drgfg )
+{
+ IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
FIXME( "(%p)->(%p):stub\n", This, drgfg );
return DP_OK;
}
-static
-HRESULT WINAPI IDPLobbySPImpl_DeletePlayerFromGroup
-( LPDPLOBBYSP iface,
- LPSPDATA_DELETEREMOTEPLAYERFROMGROUP drpfg
-)
-{
- IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface;
+static HRESULT WINAPI IDPLobbySPImpl_DeletePlayerFromGroup( IDPLobbySP *iface,
+ SPDATA_DELETEREMOTEPLAYERFROMGROUP *drpfg )
+{
+ IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
FIXME( "(%p)->(%p):stub\n", This, drpfg );
return DP_OK;
}
-static
-HRESULT WINAPI IDPLobbySPImpl_DestroyGroup
-( LPDPLOBBYSP iface,
- LPSPDATA_DESTROYREMOTEGROUP drg
-)
-{
- IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface;
+static HRESULT WINAPI IDPLobbySPImpl_DestroyGroup( IDPLobbySP *iface,
+ SPDATA_DESTROYREMOTEGROUP *drg )
+{
+ IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
FIXME( "(%p)->(%p):stub\n", This, drg );
return DP_OK;
}
-static
-HRESULT WINAPI IDPLobbySPImpl_EnumSessionsResponse
-( LPDPLOBBYSP iface,
- LPSPDATA_ENUMSESSIONSRESPONSE er
-)
-{
- IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface;
+static HRESULT WINAPI IDPLobbySPImpl_EnumSessionsResponse( IDPLobbySP *iface,
+ SPDATA_ENUMSESSIONSRESPONSE *er )
+{
+ IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
FIXME( "(%p)->(%p):stub\n", This, er );
return DP_OK;
}
-static
-HRESULT WINAPI IDPLobbySPImpl_GetSPDataPointer
-( LPDPLOBBYSP iface,
- LPVOID* lplpData
-)
-{
- IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface;
+static HRESULT WINAPI IDPLobbySPImpl_GetSPDataPointer( IDPLobbySP *iface, LPVOID*
lplpData )
+{
+ IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
FIXME( "(%p)->(%p):stub\n", This, lplpData );
return DP_OK;
}
-static
-HRESULT WINAPI IDPLobbySPImpl_HandleMessage
-( LPDPLOBBYSP iface,
- LPSPDATA_HANDLEMESSAGE hm
-)
-{
- IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface;
+static HRESULT WINAPI IDPLobbySPImpl_HandleMessage( IDPLobbySP *iface,
SPDATA_HANDLEMESSAGE *hm )
+{
+ IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
FIXME( "(%p)->(%p):stub\n", This, hm );
return DP_OK;
}
-static
-HRESULT WINAPI IDPLobbySPImpl_SendChatMessage
-( LPDPLOBBYSP iface,
- LPSPDATA_CHATMESSAGE cm
-)
-{
- IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface;
+static HRESULT WINAPI IDPLobbySPImpl_SendChatMessage( IDPLobbySP *iface,
+ SPDATA_CHATMESSAGE *cm )
+{
+ IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
FIXME( "(%p)->(%p):stub\n", This, cm );
return DP_OK;
}
-static
-HRESULT WINAPI IDPLobbySPImpl_SetGroupName
-( LPDPLOBBYSP iface,
- LPSPDATA_SETREMOTEGROUPNAME srgn
-)
-{
- IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface;
+static HRESULT WINAPI IDPLobbySPImpl_SetGroupName( IDPLobbySP *iface,
+ SPDATA_SETREMOTEGROUPNAME *srgn )
+{
+ IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
FIXME( "(%p)->(%p):stub\n", This, srgn );
return DP_OK;
}
-static
-HRESULT WINAPI IDPLobbySPImpl_SetPlayerName
-( LPDPLOBBYSP iface,
- LPSPDATA_SETREMOTEPLAYERNAME srpn
-)
-{
- IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface;
+static HRESULT WINAPI IDPLobbySPImpl_SetPlayerName( IDPLobbySP *iface,
+ SPDATA_SETREMOTEPLAYERNAME *srpn )
+{
+ IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
FIXME( "(%p)->(%p):stub\n", This, srpn );
return DP_OK;
}
-static
-HRESULT WINAPI IDPLobbySPImpl_SetSessionDesc
-( LPDPLOBBYSP iface,
- LPSPDATA_SETSESSIONDESC ssd
-)
-{
- IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface;
+static HRESULT WINAPI IDPLobbySPImpl_SetSessionDesc( IDPLobbySP *iface,
+ SPDATA_SETSESSIONDESC *ssd )
+{
+ IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
FIXME( "(%p)->(%p):stub\n", This, ssd );
return DP_OK;
}
-static
-HRESULT WINAPI IDPLobbySPImpl_SetSPDataPointer
-( LPDPLOBBYSP iface,
- LPVOID lpData
-)
-{
- IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface;
+static HRESULT WINAPI IDPLobbySPImpl_SetSPDataPointer( IDPLobbySP *iface, void *lpData )
+{
+ IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
FIXME( "(%p)->(%p):stub\n", This, lpData );
return DP_OK;
}
-static
-HRESULT WINAPI IDPLobbySPImpl_StartSession
-( LPDPLOBBYSP iface,
- LPSPDATA_STARTSESSIONCOMMAND ssc
-)
-{
- IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface;
+static HRESULT WINAPI IDPLobbySPImpl_StartSession( IDPLobbySP *iface,
+ SPDATA_STARTSESSIONCOMMAND *ssc )
+{
+ IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
FIXME( "(%p)->(%p):stub\n", This, ssc );
return DP_OK;
}
@@ -416,11 +201,9 @@
static const IDPLobbySPVtbl dpLobbySPVT =
{
-
- DPLSP_QueryInterface,
- DPLSP_AddRef,
- DPLSP_Release,
-
+ IDPLobbySPImpl_QueryInterface,
+ IDPLobbySPImpl_AddRef,
+ IDPLobbySPImpl_Release,
IDPLobbySPImpl_AddGroupToGroup,
IDPLobbySPImpl_AddPlayerToGroup,
IDPLobbySPImpl_CreateGroup,
@@ -437,5 +220,26 @@
IDPLobbySPImpl_SetSessionDesc,
IDPLobbySPImpl_SetSPDataPointer,
IDPLobbySPImpl_StartSession
-
};
+
+HRESULT dplobbysp_create( REFIID riid, void **ppv, IDirectPlayImpl *dp )
+{
+ IDPLobbySPImpl *obj;
+ HRESULT hr;
+
+ TRACE( "(%s, %p)\n", debugstr_guid( riid ), ppv );
+
+ *ppv = NULL;
+ obj = HeapAlloc( GetProcessHeap(), 0, sizeof( *obj ) );
+ if ( !obj )
+ return DPERR_OUTOFMEMORY;
+
+ obj->IDPLobbySP_iface.lpVtbl = &dpLobbySPVT;
+ obj->ref = 1;
+ obj->dplay = dp;
+
+ hr = IDPLobbySP_QueryInterface( &obj->IDPLobbySP_iface, riid, ppv );
+ IDPLobbySP_Release( &obj->IDPLobbySP_iface );
+
+ return hr;
+}
Modified: trunk/reactos/media/doc/README.WINE
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sun Apr 20 00:08:13 2014
@@ -39,7 +39,7 @@
reactos/dll/directx/wine/dinput8 # Synced to Wine-1.7.17
reactos/dll/directx/wine/dmusic # Synced to Wine-1.7.17
reactos/dll/directx/wine/dplay # Synced to Wine-1.7.1
-reactos/dll/directx/wine/dplayx # Synced to Wine-1.7.1
+reactos/dll/directx/wine/dplayx # Synced to Wine-1.7.17
reactos/dll/directx/wine/dsound # Synced to Wine-1.5.26
reactos/dll/directx/wine/dxdiagn # Synced to Wine-1.7.1
reactos/dll/directx/wine/dxgi # Synced to Wine-1.7.17