mirror of
https://gitlab.winehq.org/wine/wine.git
synced 2024-11-21 17:09:06 -07:00
Merge branch 'dplayx_single_lobby' into 'master'
dplayx: Merge IDirectPlayLobby3A into IDirectPlayLobby3 See merge request wine/wine!6481
This commit is contained in:
commit
d4ee3e798c
1 changed files with 268 additions and 506 deletions
|
@ -38,10 +38,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(dplay);
|
|||
HRESULT DPL_CreateCompoundAddress ( LPCDPCOMPOUNDADDRESSELEMENT lpElements, DWORD dwElementCount,
|
||||
LPVOID lpAddress, LPDWORD lpdwAddressSize, BOOL bAnsiInterface );
|
||||
|
||||
static HRESULT DPL_CreateAddress( REFGUID guidSP, REFGUID guidDataType, LPCVOID lpData, DWORD dwDataSize,
|
||||
LPVOID lpAddress, LPDWORD lpdwAddressSize, BOOL bAnsiInterface );
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirectPlayLobby {1,2,3} implementation structure
|
||||
*
|
||||
|
@ -66,6 +62,7 @@ typedef struct IDirectPlayLobbyImpl
|
|||
IDirectPlayLobby3 IDirectPlayLobby3_iface;
|
||||
IDirectPlayLobby3A IDirectPlayLobby3A_iface;
|
||||
LONG ref;
|
||||
BOOL ansi_iface;
|
||||
CRITICAL_SECTION lock;
|
||||
HKEY cbkeyhack;
|
||||
DWORD msgtid;
|
||||
|
@ -93,13 +90,6 @@ static void dplobby_destroy(IDirectPlayLobbyImpl *obj)
|
|||
free( obj );
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirectPlayLobby3AImpl_QueryInterface( IDirectPlayLobby3A *iface, REFIID riid,
|
||||
void **ppv )
|
||||
{
|
||||
IDirectPlayLobbyImpl *This = impl_from_IDirectPlayLobby3A( iface );
|
||||
return IDirectPlayLobby_QueryInterface( &This->IDirectPlayLobby3_iface, riid, ppv );
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirectPlayLobby3Impl_QueryInterface( IDirectPlayLobby3 *iface, REFIID riid,
|
||||
void **ppv )
|
||||
{
|
||||
|
@ -108,17 +98,14 @@ static HRESULT WINAPI IDirectPlayLobby3Impl_QueryInterface( IDirectPlayLobby3 *i
|
|||
if ( IsEqualGUID( &IID_IUnknown, riid ) ||
|
||||
IsEqualGUID( &IID_IDirectPlayLobby, riid ) ||
|
||||
IsEqualGUID( &IID_IDirectPlayLobby2, riid ) ||
|
||||
IsEqualGUID( &IID_IDirectPlayLobby3, riid ) )
|
||||
{
|
||||
TRACE( "(%p)->(IID_IDirectPlay3 %p)\n", This, ppv );
|
||||
*ppv = &This->IDirectPlayLobby3_iface;
|
||||
}
|
||||
else if ( IsEqualGUID( &IID_IDirectPlayLobbyA, riid ) ||
|
||||
IsEqualGUID( &IID_IDirectPlayLobby3, riid ) ||
|
||||
/* Ansi interfaces */
|
||||
IsEqualGUID( &IID_IDirectPlayLobbyA, riid ) ||
|
||||
IsEqualGUID( &IID_IDirectPlayLobby2A, riid ) ||
|
||||
IsEqualGUID( &IID_IDirectPlayLobby3A, riid ))
|
||||
{
|
||||
TRACE( "(%p)->(IID_IDirectPlayLobby3A %p)\n", This, ppv );
|
||||
*ppv = &This->IDirectPlayLobby3A_iface;
|
||||
TRACE( "(%p)->(IID_IDirectPlay3 %p)\n", This, ppv );
|
||||
*ppv = &This->IDirectPlayLobby3_iface;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -131,16 +118,6 @@ static HRESULT WINAPI IDirectPlayLobby3Impl_QueryInterface( IDirectPlayLobby3 *i
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
static ULONG WINAPI IDirectPlayLobby3AImpl_AddRef(IDirectPlayLobby3A *iface)
|
||||
{
|
||||
IDirectPlayLobbyImpl *This = impl_from_IDirectPlayLobby3A( iface );
|
||||
ULONG ref = InterlockedIncrement( &This->ref );
|
||||
|
||||
TRACE( "(%p) ref3=%ld\n", This, ref );
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
static ULONG WINAPI IDirectPlayLobby3Impl_AddRef(IDirectPlayLobby3 *iface)
|
||||
{
|
||||
IDirectPlayLobbyImpl *This = impl_from_IDirectPlayLobby3( iface );
|
||||
|
@ -151,19 +128,6 @@ static ULONG WINAPI IDirectPlayLobby3Impl_AddRef(IDirectPlayLobby3 *iface)
|
|||
return ref;
|
||||
}
|
||||
|
||||
static ULONG WINAPI IDirectPlayLobby3AImpl_Release(IDirectPlayLobby3A *iface)
|
||||
{
|
||||
IDirectPlayLobbyImpl *This = impl_from_IDirectPlayLobby3A( iface );
|
||||
ULONG ref = InterlockedDecrement( &This->ref );
|
||||
|
||||
TRACE( "(%p) ref=%ld\n", This, ref );
|
||||
|
||||
if ( !ref )
|
||||
dplobby_destroy( This );
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
static ULONG WINAPI IDirectPlayLobby3Impl_Release(IDirectPlayLobby3 *iface)
|
||||
{
|
||||
IDirectPlayLobbyImpl *This = impl_from_IDirectPlayLobby3( iface );
|
||||
|
@ -264,12 +228,6 @@ static HRESULT DPL_ConnectEx( IDirectPlayLobbyImpl *This, DWORD dwFlags, REFIID
|
|||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirectPlayLobby3AImpl_Connect( IDirectPlayLobby3A *iface, DWORD flags,
|
||||
IDirectPlay2A **dp, IUnknown *unk)
|
||||
{
|
||||
return IDirectPlayLobby_ConnectEx( iface, flags, &IID_IDirectPlay2A, (void**)dp, unk );
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirectPlayLobby3Impl_Connect( IDirectPlayLobby3 *iface, DWORD flags,
|
||||
IDirectPlay2 **dp, IUnknown *unk)
|
||||
{
|
||||
|
@ -287,37 +245,17 @@ static HRESULT WINAPI IDirectPlayLobby3Impl_Connect( IDirectPlayLobby3 *iface, D
|
|||
* NOTE: It appears that this method is supposed to be really really stupid
|
||||
* with no error checking on the contents.
|
||||
*/
|
||||
|
||||
static HRESULT WINAPI IDirectPlayLobby3AImpl_CreateAddress( IDirectPlayLobby3A *iface,
|
||||
REFGUID guidSP, REFGUID guidDataType, const void *lpData, DWORD dwDataSize, void *lpAddress,
|
||||
DWORD *lpdwAddressSize )
|
||||
{
|
||||
return DPL_CreateAddress( guidSP, guidDataType, lpData, dwDataSize,
|
||||
lpAddress, lpdwAddressSize, TRUE );
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirectPlayLobby3Impl_CreateAddress( IDirectPlayLobby3 *iface, REFGUID guidSP,
|
||||
REFGUID guidDataType, const void *lpData, DWORD dwDataSize, void *lpAddress,
|
||||
DWORD *lpdwAddressSize )
|
||||
{
|
||||
return DPL_CreateAddress( guidSP, guidDataType, lpData, dwDataSize,
|
||||
lpAddress, lpdwAddressSize, FALSE );
|
||||
}
|
||||
IDirectPlayLobbyImpl *This = impl_from_IDirectPlayLobby3( iface );
|
||||
|
||||
static HRESULT DPL_CreateAddress(
|
||||
REFGUID guidSP,
|
||||
REFGUID guidDataType,
|
||||
LPCVOID lpData,
|
||||
DWORD dwDataSize,
|
||||
LPVOID lpAddress,
|
||||
LPDWORD lpdwAddressSize,
|
||||
BOOL bAnsiInterface )
|
||||
{
|
||||
const DWORD dwNumAddElements = 2; /* Service Provide & address data type */
|
||||
DPCOMPOUNDADDRESSELEMENT addressElements[ 2 /* dwNumAddElements */ ];
|
||||
|
||||
TRACE( "(%p)->(%p,%p,0x%08lx,%p,%p,%d)\n", guidSP, guidDataType, lpData, dwDataSize,
|
||||
lpAddress, lpdwAddressSize, bAnsiInterface );
|
||||
TRACE( "(%p)->(%s, %s, %p, 0x%08lx, %p, %p)\n", This, debugstr_guid(guidSP), debugstr_guid(guidDataType),
|
||||
lpData, dwDataSize, lpAddress, lpdwAddressSize);
|
||||
|
||||
addressElements[ 0 ].guidDataType = DPAID_ServiceProvider;
|
||||
addressElements[ 0 ].dwDataSize = sizeof( GUID );
|
||||
|
@ -330,29 +268,16 @@ static HRESULT DPL_CreateAddress(
|
|||
/* Call CreateCompoundAddress to cut down on code.
|
||||
NOTE: We can do this because we don't support DPL 1 interfaces! */
|
||||
return DPL_CreateCompoundAddress( addressElements, dwNumAddElements,
|
||||
lpAddress, lpdwAddressSize, bAnsiInterface );
|
||||
lpAddress, lpdwAddressSize, This->ansi_iface );
|
||||
}
|
||||
|
||||
|
||||
|
||||
/********************************************************************
|
||||
*
|
||||
* Parses out chunks from the DirectPlay Address buffer by calling the
|
||||
* given callback function, with lpContext, for each of the chunks.
|
||||
*
|
||||
*/
|
||||
static HRESULT WINAPI IDirectPlayLobby3AImpl_EnumAddress( IDirectPlayLobby3A *iface,
|
||||
LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, const void *lpAddress, DWORD dwAddressSize,
|
||||
void *lpContext )
|
||||
{
|
||||
IDirectPlayLobbyImpl *This = impl_from_IDirectPlayLobby3A( iface );
|
||||
|
||||
TRACE("(%p)->(%p,%p,0x%08lx,%p)\n", This, lpEnumAddressCallback, lpAddress,
|
||||
dwAddressSize, lpContext );
|
||||
|
||||
return DPL_EnumAddress( lpEnumAddressCallback, lpAddress, dwAddressSize, lpContext );
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirectPlayLobby3Impl_EnumAddress( IDirectPlayLobby3 *iface,
|
||||
LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, const void *lpAddress, DWORD dwAddressSize,
|
||||
void *lpContext )
|
||||
|
@ -400,35 +325,29 @@ HRESULT DPL_EnumAddress( LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, LPCVOID
|
|||
* build the DirectPlay Address.
|
||||
*
|
||||
*/
|
||||
static HRESULT WINAPI IDirectPlayLobby3AImpl_EnumAddressTypes( IDirectPlayLobby3A *iface,
|
||||
LPDPLENUMADDRESSTYPESCALLBACK lpEnumAddressTypeCallback, REFGUID guidSP, void *lpContext,
|
||||
DWORD dwFlags )
|
||||
static HRESULT WINAPI IDirectPlayLobby3Impl_EnumAddressTypes( IDirectPlayLobby3 *iface,
|
||||
LPDPLENUMADDRESSTYPESCALLBACK enumaddrtypecb, REFGUID sp, void *context, DWORD flags )
|
||||
{
|
||||
IDirectPlayLobbyImpl *This = impl_from_IDirectPlayLobby3A( iface );
|
||||
|
||||
HKEY hkResult;
|
||||
LPCSTR searchSubKey = "SOFTWARE\\Microsoft\\DirectPlay\\Service Providers";
|
||||
DWORD dwIndex, sizeOfSubKeyName=50;
|
||||
char subKeyName[51];
|
||||
FILETIME filetime;
|
||||
|
||||
TRACE(" (%p)->(%p,%p,%p,0x%08lx)\n", This, lpEnumAddressTypeCallback, guidSP, lpContext, dwFlags );
|
||||
TRACE(" (%p)->(%p,%p,%p,0x%08lx)\n", This, enumaddrtypecb, sp, context, flags );
|
||||
|
||||
if( dwFlags != 0 )
|
||||
if (!This->ansi_iface)
|
||||
{
|
||||
ERR("Returning unicode values currently isn't supported\n");
|
||||
return DPERR_INVALIDPARAMS;
|
||||
}
|
||||
|
||||
if( !lpEnumAddressTypeCallback )
|
||||
if ( flags != 0 || !enumaddrtypecb || sp == NULL )
|
||||
{
|
||||
return DPERR_INVALIDPARAMS;
|
||||
}
|
||||
|
||||
if( guidSP == NULL )
|
||||
{
|
||||
return DPERR_INVALIDOBJECT;
|
||||
}
|
||||
|
||||
/* Need to loop over the service providers in the registry */
|
||||
if ( RegOpenKeyExA( HKEY_LOCAL_MACHINE, searchSubKey,
|
||||
0, KEY_READ, &hkResult ) != ERROR_SUCCESS )
|
||||
|
@ -444,7 +363,6 @@ static HRESULT WINAPI IDirectPlayLobby3AImpl_EnumAddressTypes( IDirectPlayLobby3
|
|||
NULL, NULL, NULL, &filetime ) != ERROR_NO_MORE_ITEMS;
|
||||
++dwIndex, sizeOfSubKeyName=50 )
|
||||
{
|
||||
|
||||
HKEY hkServiceProvider, hkServiceProviderAt;
|
||||
GUID serviceProviderGUID;
|
||||
DWORD returnTypeGUID, sizeOfReturnBuffer = 50;
|
||||
|
@ -479,7 +397,7 @@ static HRESULT WINAPI IDirectPlayLobby3AImpl_EnumAddressTypes( IDirectPlayLobby3
|
|||
/* FIXME: Have I got a memory leak on the serviceProviderGUID? */
|
||||
|
||||
/* Determine if this is the Service Provider that the user asked for */
|
||||
if( !IsEqualGUID( &serviceProviderGUID, guidSP ) )
|
||||
if ( !IsEqualGUID( &serviceProviderGUID, sp ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -506,12 +424,11 @@ static HRESULT WINAPI IDirectPlayLobby3AImpl_EnumAddressTypes( IDirectPlayLobby3
|
|||
/* FIXME: Have I got a memory leak on the serviceProviderGUID? */
|
||||
|
||||
/* The enumeration will return FALSE if we are not to continue */
|
||||
if( !lpEnumAddressTypeCallback( &serviceProviderGUID, lpContext, 0 ) )
|
||||
if ( !enumaddrtypecb( &serviceProviderGUID, context, 0 ) )
|
||||
{
|
||||
WARN("lpEnumCallback returning FALSE\n" );
|
||||
break; /* FIXME: This most likely has to break from the procedure...*/
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* We only enumerate address types for 1 GUID. We've found it, so quit looking */
|
||||
|
@ -521,14 +438,6 @@ static HRESULT WINAPI IDirectPlayLobby3AImpl_EnumAddressTypes( IDirectPlayLobby3
|
|||
return DP_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirectPlayLobby3Impl_EnumAddressTypes( IDirectPlayLobby3 *iface,
|
||||
LPDPLENUMADDRESSTYPESCALLBACK enumaddrtypecb, REFGUID sp, void *context, DWORD flags )
|
||||
{
|
||||
IDirectPlayLobbyImpl *This = impl_from_IDirectPlayLobby3( iface );
|
||||
return IDirectPlayLobby_EnumAddressTypes( &This->IDirectPlayLobby3A_iface, enumaddrtypecb, sp,
|
||||
context, flags );
|
||||
}
|
||||
|
||||
/********************************************************************
|
||||
*
|
||||
* Enumerates what applications are registered with DirectPlay by
|
||||
|
@ -540,16 +449,6 @@ static HRESULT WINAPI IDirectPlayLobby3Impl_EnumLocalApplications( IDirectPlayLo
|
|||
{
|
||||
IDirectPlayLobbyImpl *This = impl_from_IDirectPlayLobby3( iface );
|
||||
|
||||
FIXME("(%p)->(%p,%p,0x%08lx):stub\n", This, lpEnumLocalAppCallback, lpContext, dwFlags );
|
||||
|
||||
return DPERR_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirectPlayLobby3AImpl_EnumLocalApplications( IDirectPlayLobby3A *iface,
|
||||
LPDPLENUMLOCALAPPLICATIONSCALLBACK lpEnumLocalAppCallback, void *lpContext, DWORD dwFlags )
|
||||
{
|
||||
IDirectPlayLobbyImpl *This = impl_from_IDirectPlayLobby3A( iface );
|
||||
|
||||
HKEY hkResult;
|
||||
LPCSTR searchSubKey = "SOFTWARE\\Microsoft\\DirectPlay\\Applications";
|
||||
LPCSTR guidDataSubKey = "Guid";
|
||||
|
@ -559,6 +458,12 @@ static HRESULT WINAPI IDirectPlayLobby3AImpl_EnumLocalApplications( IDirectPlayL
|
|||
|
||||
TRACE("(%p)->(%p,%p,0x%08lx)\n", This, lpEnumLocalAppCallback, lpContext, dwFlags );
|
||||
|
||||
if (!This->ansi_iface)
|
||||
{
|
||||
ERR("Returning unicode values currently isn't supported\n");
|
||||
return DPERR_INVALIDPARAMS;
|
||||
}
|
||||
|
||||
if ( dwFlags != 0 )
|
||||
{
|
||||
return DPERR_INVALIDPARAMS;
|
||||
|
@ -644,27 +549,6 @@ static HRESULT WINAPI IDirectPlayLobby3AImpl_EnumLocalApplications( IDirectPlayL
|
|||
* the data structure to be allocated by our caller which can then
|
||||
* call this procedure/method again with a valid data pointer.
|
||||
*/
|
||||
|
||||
static HRESULT WINAPI IDirectPlayLobby3AImpl_GetConnectionSettings( IDirectPlayLobby3A *iface,
|
||||
DWORD dwAppID, void *lpData, DWORD *lpdwDataSize )
|
||||
{
|
||||
IDirectPlayLobbyImpl *This = impl_from_IDirectPlayLobby3A( iface );
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p)->(0x%08lx,%p,%p)\n", This, dwAppID, lpData, lpdwDataSize );
|
||||
|
||||
EnterCriticalSection( &This->lock );
|
||||
|
||||
hr = DPLAYX_GetConnectionSettingsA( dwAppID,
|
||||
lpData,
|
||||
lpdwDataSize
|
||||
);
|
||||
|
||||
LeaveCriticalSection( &This->lock );
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirectPlayLobby3Impl_GetConnectionSettings( IDirectPlayLobby3 *iface,
|
||||
DWORD dwAppID, void *lpData, DWORD *lpdwDataSize )
|
||||
{
|
||||
|
@ -691,17 +575,6 @@ static HRESULT WINAPI IDirectPlayLobby3Impl_GetConnectionSettings( IDirectPlayLo
|
|||
* application. All messages are queued until received.
|
||||
*
|
||||
*/
|
||||
|
||||
static HRESULT WINAPI IDirectPlayLobby3AImpl_ReceiveLobbyMessage( IDirectPlayLobby3A *iface,
|
||||
DWORD dwFlags, DWORD dwAppID, DWORD *lpdwMessageFlags, void *lpData,
|
||||
DWORD *lpdwDataSize )
|
||||
{
|
||||
IDirectPlayLobbyImpl *This = impl_from_IDirectPlayLobby3A( iface );
|
||||
FIXME(":stub %p %08lx %08lx %p %p %p\n", This, dwFlags, dwAppID, lpdwMessageFlags, lpData,
|
||||
lpdwDataSize );
|
||||
return DPERR_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirectPlayLobby3Impl_ReceiveLobbyMessage( IDirectPlayLobby3 *iface,
|
||||
DWORD dwFlags, DWORD dwAppID, DWORD *lpdwMessageFlags, void *lpData,
|
||||
DWORD *lpdwDataSize )
|
||||
|
@ -853,10 +726,10 @@ static BOOL DPL_CreateAndSetLobbyHandles( DWORD dwDestProcessId, HANDLE hDestPro
|
|||
* connect to a session.
|
||||
*
|
||||
*/
|
||||
static HRESULT WINAPI IDirectPlayLobby3AImpl_RunApplication( IDirectPlayLobby3A *iface,
|
||||
DWORD dwFlags, DWORD *lpdwAppID, DPLCONNECTION *lpConn, HANDLE hReceiveEvent )
|
||||
static HRESULT WINAPI IDirectPlayLobby3Impl_RunApplication( IDirectPlayLobby3 *iface, DWORD dwFlags,
|
||||
DWORD *lpdwAppID, DPLCONNECTION *lpConn, HANDLE hReceiveEvent )
|
||||
{
|
||||
IDirectPlayLobbyImpl *This = impl_from_IDirectPlayLobby3A( iface );
|
||||
IDirectPlayLobbyImpl *This = impl_from_IDirectPlayLobby3( iface );
|
||||
HRESULT hr;
|
||||
RunApplicationEnumStruct enumData;
|
||||
char temp[200];
|
||||
|
@ -866,8 +739,13 @@ static HRESULT WINAPI IDirectPlayLobby3AImpl_RunApplication( IDirectPlayLobby3A
|
|||
DWORD dwSuspendCount;
|
||||
HANDLE hStart, hDeath, hSettingRead;
|
||||
|
||||
TRACE( "(%p)->(0x%08lx,%p,%p,%p)\n",
|
||||
This, dwFlags, lpdwAppID, lpConn, hReceiveEvent );
|
||||
TRACE( "(%p)->(0x%08lx,%p,%p,%p)\n", This, dwFlags, lpdwAppID, lpConn, hReceiveEvent );
|
||||
|
||||
if (!This->ansi_iface)
|
||||
{
|
||||
ERR("Returning unicode values currently isn't supported\n");
|
||||
return DPERR_INVALIDPARAMS;
|
||||
}
|
||||
|
||||
if( dwFlags != 0 )
|
||||
{
|
||||
|
@ -940,12 +818,10 @@ static HRESULT WINAPI IDirectPlayLobby3AImpl_RunApplication( IDirectPlayLobby3A
|
|||
/* Reserve this global application id! */
|
||||
if( !DPLAYX_CreateLobbyApplication( newProcessInfo.dwProcessId ) )
|
||||
{
|
||||
ERR( "Unable to create global application data for 0x%08lx\n",
|
||||
newProcessInfo.dwProcessId );
|
||||
ERR( "Unable to create global application data for 0x%08lx\n", newProcessInfo.dwProcessId );
|
||||
}
|
||||
|
||||
hr = IDirectPlayLobby_SetConnectionSettings( iface, 0, newProcessInfo.dwProcessId, lpConn );
|
||||
|
||||
if( hr != DP_OK )
|
||||
{
|
||||
ERR( "SetConnectionSettings failure %s\n", DPLAYX_HresultToString( hr ) );
|
||||
|
@ -977,28 +853,12 @@ static HRESULT WINAPI IDirectPlayLobby3AImpl_RunApplication( IDirectPlayLobby3A
|
|||
return DP_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirectPlayLobby3Impl_RunApplication( IDirectPlayLobby3 *iface, DWORD dwFlags,
|
||||
DWORD *lpdwAppID, DPLCONNECTION *lpConn, HANDLE hReceiveEvent )
|
||||
{
|
||||
IDirectPlayLobbyImpl *This = impl_from_IDirectPlayLobby3( iface );
|
||||
FIXME( "(%p)->(0x%08lx,%p,%p,%p):stub\n", This, dwFlags, lpdwAppID, lpConn, hReceiveEvent );
|
||||
return DPERR_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
/********************************************************************
|
||||
*
|
||||
* Sends a message between the application and the lobby client.
|
||||
* All messages are queued until received.
|
||||
*
|
||||
*/
|
||||
|
||||
static HRESULT WINAPI IDirectPlayLobby3AImpl_SendLobbyMessage( IDirectPlayLobby3A *iface,
|
||||
DWORD flags, DWORD appid, void *data, DWORD size )
|
||||
{
|
||||
FIXME(":stub\n");
|
||||
return DPERR_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirectPlayLobby3Impl_SendLobbyMessage( IDirectPlayLobby3 *iface,
|
||||
DWORD flags, DWORD appid, void *data, DWORD size )
|
||||
{
|
||||
|
@ -1043,47 +903,11 @@ static HRESULT WINAPI IDirectPlayLobby3Impl_SetConnectionSettings( IDirectPlayLo
|
|||
return hr;
|
||||
}
|
||||
|
||||
|
||||
static HRESULT WINAPI IDirectPlayLobby3AImpl_SetConnectionSettings( IDirectPlayLobby3A *iface,
|
||||
DWORD dwFlags, DWORD dwAppID, DPLCONNECTION *lpConn )
|
||||
{
|
||||
IDirectPlayLobbyImpl *This = impl_from_IDirectPlayLobby3A( iface );
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p)->(0x%08lx,0x%08lx,%p)\n", This, dwFlags, dwAppID, lpConn );
|
||||
|
||||
EnterCriticalSection( &This->lock );
|
||||
|
||||
hr = DPLAYX_SetConnectionSettingsA( dwFlags, dwAppID, lpConn );
|
||||
|
||||
/* FIXME: Don't think that this is supposed to fail, but the documentation
|
||||
is somewhat sketchy. I'll try creating a lobby application
|
||||
for this... */
|
||||
if( hr == DPERR_NOTLOBBIED )
|
||||
{
|
||||
FIXME( "Unlobbied app setting connections. Is this correct behavior?\n" );
|
||||
dwAppID = GetCurrentProcessId();
|
||||
DPLAYX_CreateLobbyApplication( dwAppID );
|
||||
hr = DPLAYX_SetConnectionSettingsA( dwFlags, dwAppID, lpConn );
|
||||
}
|
||||
|
||||
LeaveCriticalSection( &This->lock );
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/********************************************************************
|
||||
*
|
||||
* Registers an event that will be set when a lobby message is received.
|
||||
*
|
||||
*/
|
||||
static HRESULT WINAPI IDirectPlayLobby3AImpl_SetLobbyMessageEvent( IDirectPlayLobby3A *iface,
|
||||
DWORD flags, DWORD appid, HANDLE event )
|
||||
{
|
||||
FIXME(":stub\n");
|
||||
return DPERR_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirectPlayLobby3Impl_SetLobbyMessageEvent( IDirectPlayLobby3 *iface,
|
||||
DWORD flags, DWORD appid, HANDLE event )
|
||||
{
|
||||
|
@ -1095,14 +919,11 @@ static HRESULT WINAPI IDirectPlayLobby3Impl_CreateCompoundAddress( IDirectPlayLo
|
|||
const DPCOMPOUNDADDRESSELEMENT *lpElements, DWORD dwElementCount, void *lpAddress,
|
||||
DWORD *lpdwAddressSize )
|
||||
{
|
||||
return DPL_CreateCompoundAddress( lpElements, dwElementCount, lpAddress, lpdwAddressSize, FALSE );
|
||||
}
|
||||
IDirectPlayLobbyImpl *This = impl_from_IDirectPlayLobby3( iface );
|
||||
|
||||
static HRESULT WINAPI IDirectPlayLobby3AImpl_CreateCompoundAddress( IDirectPlayLobby3A *iface,
|
||||
const DPCOMPOUNDADDRESSELEMENT *lpElements, DWORD dwElementCount, void *lpAddress,
|
||||
DWORD *lpdwAddressSize )
|
||||
{
|
||||
return DPL_CreateCompoundAddress( lpElements, dwElementCount, lpAddress, lpdwAddressSize, TRUE );
|
||||
TRACE("(%p)->(%p, 0x%08lx, %p, %p)\n", This, lpElements, dwElementCount, lpAddress, lpdwAddressSize );
|
||||
|
||||
return DPL_CreateCompoundAddress( lpElements, dwElementCount, lpAddress, lpdwAddressSize, This->ansi_iface );
|
||||
}
|
||||
|
||||
HRESULT DPL_CreateCompoundAddress
|
||||
|
@ -1283,13 +1104,6 @@ static HRESULT WINAPI IDirectPlayLobby3Impl_ConnectEx( IDirectPlayLobby3 *iface,
|
|||
return DPL_ConnectEx( This, dwFlags, riid, lplpDP, pUnk );
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirectPlayLobby3AImpl_ConnectEx( IDirectPlayLobby3A *iface, DWORD dwFlags,
|
||||
REFIID riid, void **lplpDP, IUnknown *pUnk )
|
||||
{
|
||||
IDirectPlayLobbyImpl *This = impl_from_IDirectPlayLobby3A( iface );
|
||||
return DPL_ConnectEx( This, dwFlags, riid, lplpDP, pUnk );
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirectPlayLobby3Impl_RegisterApplication( IDirectPlayLobby3 *iface,
|
||||
DWORD flags, DPAPPLICATIONDESC *appdesc )
|
||||
{
|
||||
|
@ -1297,13 +1111,6 @@ static HRESULT WINAPI IDirectPlayLobby3Impl_RegisterApplication( IDirectPlayLobb
|
|||
return DP_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirectPlayLobby3AImpl_RegisterApplication( IDirectPlayLobby3A *iface,
|
||||
DWORD flags, DPAPPLICATIONDESC *appdesc )
|
||||
{
|
||||
FIXME(":stub\n");
|
||||
return DP_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirectPlayLobby3Impl_UnregisterApplication( IDirectPlayLobby3 *iface,
|
||||
DWORD flags, REFGUID appdesc )
|
||||
{
|
||||
|
@ -1311,13 +1118,6 @@ static HRESULT WINAPI IDirectPlayLobby3Impl_UnregisterApplication( IDirectPlayLo
|
|||
return DP_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirectPlayLobby3AImpl_UnregisterApplication( IDirectPlayLobby3A *iface,
|
||||
DWORD flags, REFGUID appdesc )
|
||||
{
|
||||
FIXME(":stub\n");
|
||||
return DP_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirectPlayLobby3Impl_WaitForConnectionSettings( IDirectPlayLobby3 *iface,
|
||||
DWORD dwFlags )
|
||||
{
|
||||
|
@ -1335,46 +1135,6 @@ static HRESULT WINAPI IDirectPlayLobby3Impl_WaitForConnectionSettings( IDirectPl
|
|||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirectPlayLobby3AImpl_WaitForConnectionSettings( IDirectPlayLobby3A *iface,
|
||||
DWORD dwFlags )
|
||||
{
|
||||
HRESULT hr = DP_OK;
|
||||
BOOL bStartWait = !(dwFlags & DPLWAIT_CANCEL);
|
||||
|
||||
TRACE( "(%p)->(0x%08lx)\n", iface, dwFlags );
|
||||
|
||||
if( DPLAYX_WaitForConnectionSettings( bStartWait ) )
|
||||
{
|
||||
/* FIXME: What is the correct error return code? */
|
||||
hr = DPERR_NOTLOBBIED;
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
static const IDirectPlayLobby3Vtbl dpl3A_vt =
|
||||
{
|
||||
IDirectPlayLobby3AImpl_QueryInterface,
|
||||
IDirectPlayLobby3AImpl_AddRef,
|
||||
IDirectPlayLobby3AImpl_Release,
|
||||
IDirectPlayLobby3AImpl_Connect,
|
||||
IDirectPlayLobby3AImpl_CreateAddress,
|
||||
IDirectPlayLobby3AImpl_EnumAddress,
|
||||
IDirectPlayLobby3AImpl_EnumAddressTypes,
|
||||
IDirectPlayLobby3AImpl_EnumLocalApplications,
|
||||
IDirectPlayLobby3AImpl_GetConnectionSettings,
|
||||
IDirectPlayLobby3AImpl_ReceiveLobbyMessage,
|
||||
IDirectPlayLobby3AImpl_RunApplication,
|
||||
IDirectPlayLobby3AImpl_SendLobbyMessage,
|
||||
IDirectPlayLobby3AImpl_SetConnectionSettings,
|
||||
IDirectPlayLobby3AImpl_SetLobbyMessageEvent,
|
||||
IDirectPlayLobby3AImpl_CreateCompoundAddress,
|
||||
IDirectPlayLobby3AImpl_ConnectEx,
|
||||
IDirectPlayLobby3AImpl_RegisterApplication,
|
||||
IDirectPlayLobby3AImpl_UnregisterApplication,
|
||||
IDirectPlayLobby3AImpl_WaitForConnectionSettings
|
||||
};
|
||||
|
||||
static const IDirectPlayLobby3Vtbl dpl3_vt =
|
||||
{
|
||||
IDirectPlayLobby3Impl_QueryInterface,
|
||||
|
@ -1411,9 +1171,11 @@ HRESULT dplobby_create( REFIID riid, void **ppv )
|
|||
return DPERR_OUTOFMEMORY;
|
||||
|
||||
obj->IDirectPlayLobby3_iface.lpVtbl = &dpl3_vt;
|
||||
obj->IDirectPlayLobby3A_iface.lpVtbl = &dpl3A_vt;
|
||||
obj->msgtid = 0;
|
||||
obj->ref = 1;
|
||||
obj->ansi_iface = IsEqualGUID( &IID_IDirectPlayLobbyA, riid ) ||
|
||||
IsEqualGUID( &IID_IDirectPlayLobby2A, riid ) ||
|
||||
IsEqualGUID( &IID_IDirectPlayLobby3A, riid );
|
||||
|
||||
InitializeCriticalSectionEx( &obj->lock, 0, RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO );
|
||||
obj->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": IDirectPlayLobbyImpl.lock");
|
||||
|
|
Loading…
Reference in a new issue