From: Anton Baskanov baskanov@gmail.com
--- dlls/dplayx/dplay.c | 10 ++++++++-- dlls/dplayx/tests/dplayx.c | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/dlls/dplayx/dplay.c b/dlls/dplayx/dplay.c index 2ab7e686f56..3ff5c0b4f16 100644 --- a/dlls/dplayx/dplay.c +++ b/dlls/dplayx/dplay.c @@ -3286,6 +3286,7 @@ static HRESULT WINAPI IDirectPlay4Impl_Initialize( IDirectPlay4 *iface, GUID *gu static HRESULT DP_SecureOpen( IDirectPlayImpl *This, const DPSESSIONDESC2 *lpsd, DWORD dwFlags, const DPSECURITYDESC *lpSecurity, const DPCREDENTIALS *lpCredentials, BOOL bAnsi ) { + void *spMessageHeader = NULL; HRESULT hr = DP_OK;
FIXME( "(%p)->(%p,0x%08lx,%p,%p): partial stub\n", @@ -3326,6 +3327,12 @@ static HRESULT DP_SecureOpen( IDirectPlayImpl *This, const DPSESSIONDESC2 *lpsd, return hr; } } + else + { + spMessageHeader = NS_GetNSAddr( This->dp2->lpNameServerData ); + if ( !spMessageHeader ) + return DPERR_NOSESSIONS; + }
/* Invoke the conditional callback for the service provider */ if( This->dp2->spData.lpCB->Open ) @@ -3335,8 +3342,7 @@ static HRESULT DP_SecureOpen( IDirectPlayImpl *This, const DPSESSIONDESC2 *lpsd, FIXME( "Not all data fields are correct. Need new parameter\n" );
data.bCreate = (dwFlags & DPOPEN_CREATE ) != 0; - data.lpSPMessageHeader = (dwFlags & DPOPEN_CREATE ) ? NULL - : NS_GetNSAddr( This->dp2->lpNameServerData ); + data.lpSPMessageHeader = spMessageHeader; data.lpISP = This->dp2->spData.lpISP; data.bReturnStatus = (dwFlags & DPOPEN_RETURNSTATUS) != 0; data.dwOpenFlags = dwFlags; diff --git a/dlls/dplayx/tests/dplayx.c b/dlls/dplayx/tests/dplayx.c index 545f31ac0a5..774eb76075c 100644 --- a/dlls/dplayx/tests/dplayx.c +++ b/dlls/dplayx/tests/dplayx.c @@ -2092,9 +2092,9 @@ static void test_Open(void) dpsd.dwSize = sizeof( DPSESSIONDESC2 ) + 1; check_Open( dp, &dpsd, NULL, FALSE, 2349, NULL, DPERR_INVALIDPARAMS, FALSE );
- check_Open( dp, &dpsdZero, NULL, FALSE, 2349, NULL, DPERR_NOSESSIONS, TRUE ); + check_Open( dp, &dpsdZero, NULL, FALSE, 2349, NULL, DPERR_NOSESSIONS, FALSE );
- check_Open( dp, &dpsdAppGuid, NULL, FALSE, 2349, NULL, DPERR_NOSESSIONS, TRUE ); + check_Open( dp, &dpsdAppGuid, NULL, FALSE, 2349, NULL, DPERR_NOSESSIONS, FALSE );
enumSock = bindUdp( 47624 );