From: Anton Baskanov baskanov@gmail.com
--- dlls/dplayx/dplay.c | 12 ++---------- dlls/dplayx/tests/dplayx.c | 4 ++-- 2 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/dlls/dplayx/dplay.c b/dlls/dplayx/dplay.c index e6dccc2097c..cc7972a7516 100644 --- a/dlls/dplayx/dplay.c +++ b/dlls/dplayx/dplay.c @@ -3811,14 +3811,6 @@ static HRESULT DP_IF_Receive( IDirectPlayImpl *This, DPID *lpidFrom, DPID *lpidT dwFlags = DPRECEIVE_ALL; }
- /* If the lpData is NULL, we must be peeking the message */ - if( ( lpData == NULL ) && - !( dwFlags & DPRECEIVE_PEEK ) - ) - { - return DPERR_INVALIDPARAMS; - } - if( dwFlags & DPRECEIVE_ALL ) { lpMsg = This->dp2->receiveMsgs.lpQHFirst; @@ -3841,7 +3833,7 @@ static HRESULT DP_IF_Receive( IDirectPlayImpl *This, DPID *lpidFrom, DPID *lpidT
msgSize = lpMsg->copyMessage( NULL, lpMsg->msg, lpMsg->genericSize, bAnsi );
- if( *lpdwDataSize < msgSize ) + if( *lpdwDataSize < msgSize || !lpData ) { *lpdwDataSize = msgSize; return DPERR_BUFFERTOOSMALL; @@ -3852,7 +3844,7 @@ static HRESULT DP_IF_Receive( IDirectPlayImpl *This, DPID *lpidFrom, DPID *lpidT *lpdwDataSize = msgSize;
/* Copy into the provided buffer */ - if (lpData) lpMsg->copyMessage( lpData, lpMsg->msg, lpMsg->genericSize, bAnsi ); + lpMsg->copyMessage( lpData, lpMsg->msg, lpMsg->genericSize, bAnsi );
if( !( dwFlags & DPRECEIVE_PEEK ) ) { diff --git a/dlls/dplayx/tests/dplayx.c b/dlls/dplayx/tests/dplayx.c index 0ae709a89a1..d921966abe6 100644 --- a/dlls/dplayx/tests/dplayx.c +++ b/dlls/dplayx/tests/dplayx.c @@ -8161,10 +8161,10 @@ static void test_Receive(void) toId = 0xdeadbeef; msgDataSize = sizeof( msgData ); hr = IDirectPlayX_Receive( dp, &fromId, &toId, 0, NULL, &msgDataSize ); - todo_wine ok( hr == DPERR_BUFFERTOOSMALL, "got hr %#lx.\n", hr ); + ok( hr == DPERR_BUFFERTOOSMALL, "got hr %#lx.\n", hr ); ok( fromId == 0xdeadbeef, "got source id %#lx.\n", fromId ); ok( toId == 0xdeadbeef, "got destination id %#lx.\n", toId ); - todo_wine ok( msgDataSize == sizeof( data0 ), "got message size %lu.\n", msgDataSize ); + ok( msgDataSize == sizeof( data0 ), "got message size %lu.\n", msgDataSize );
fromId = 0xdeadbeef; toId = 0xdeadbeef;