From: Anton Baskanov baskanov@gmail.com
--- dlls/dplayx/dplayx_messages.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/dlls/dplayx/dplayx_messages.c b/dlls/dplayx/dplayx_messages.c index 2bd50095818..b95c368ed2b 100644 --- a/dlls/dplayx/dplayx_messages.c +++ b/dlls/dplayx/dplayx_messages.c @@ -169,6 +169,14 @@ static HANDLE DP_MSG_BuildAndLinkReplyStruct( IDirectPlayImpl *This, return lpReplyStructList->replyExpected.hReceipt; }
+static +void DP_MSG_UnlinkReplyStruct( IDirectPlayImpl *This, DP_MSG_REPLY_STRUCT_LIST *lpReplyStructList ) +{ + EnterCriticalSection( &This->lock ); + DPQ_REMOVE( This->dp2->repliesExpected, lpReplyStructList, repliesExpected ); + LeaveCriticalSection( &This->lock ); +} + static LPVOID DP_MSG_CleanReplyStruct( LPDP_MSG_REPLY_STRUCT_LIST lpReplyStructList, LPVOID* lplpReplyMsg, LPDWORD lpdwMsgBodySize ) @@ -384,6 +392,8 @@ static void *DP_MSG_ExpectReply( IDirectPlayImpl *This, DPSP_SENDDATA *lpData, D if( FAILED(hr) ) { ERR( "Send failed: %s\n", DPLAYX_HresultToString( hr ) ); + DP_MSG_UnlinkReplyStruct( This, &replyStructList ); + DP_MSG_CleanReplyStruct( &replyStructList, lplpReplyMsg, lpdwMsgBodySize ); return NULL; }
@@ -394,6 +404,8 @@ static void *DP_MSG_ExpectReply( IDirectPlayImpl *This, DPSP_SENDDATA *lpData, D if( dwWaitReturn != WAIT_OBJECT_0 ) { ERR( "Wait failed 0x%08lx\n", dwWaitReturn ); + DP_MSG_UnlinkReplyStruct( This, &replyStructList ); + DP_MSG_CleanReplyStruct( &replyStructList, lplpReplyMsg, lpdwMsgBodySize ); return NULL; }
From: Anton Baskanov baskanov@gmail.com
--- dlls/dplayx/dplayx_messages.c | 37 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 19 deletions(-)
diff --git a/dlls/dplayx/dplayx_messages.c b/dlls/dplayx/dplayx_messages.c index b95c368ed2b..6a49ffcca94 100644 --- a/dlls/dplayx/dplayx_messages.c +++ b/dlls/dplayx/dplayx_messages.c @@ -45,7 +45,7 @@ typedef struct tagMSGTHREADINFO } MSGTHREADINFO, *LPMSGTHREADINFO;
static DWORD CALLBACK DPL_MSG_ThreadMain( LPVOID lpContext ); -static void *DP_MSG_ExpectReply( IDirectPlayImpl *This, DPSP_SENDDATA *data, DWORD dwWaitTime, +static HRESULT DP_MSG_ExpectReply( IDirectPlayImpl *This, DPSP_SENDDATA *data, DWORD dwWaitTime, WORD wReplyCommandId, void **lplpReplyMsg, DWORD *lpdwMsgBodySize );
@@ -178,15 +178,13 @@ void DP_MSG_UnlinkReplyStruct( IDirectPlayImpl *This, DP_MSG_REPLY_STRUCT_LIST * }
static -LPVOID DP_MSG_CleanReplyStruct( LPDP_MSG_REPLY_STRUCT_LIST lpReplyStructList, - LPVOID* lplpReplyMsg, LPDWORD lpdwMsgBodySize ) +void DP_MSG_CleanReplyStruct( LPDP_MSG_REPLY_STRUCT_LIST lpReplyStructList, + LPVOID* lplpReplyMsg, LPDWORD lpdwMsgBodySize ) { CloseHandle( lpReplyStructList->replyExpected.hReceipt );
*lplpReplyMsg = lpReplyStructList->replyExpected.lpReplyMsg; *lpdwMsgBodySize = lpReplyStructList->replyExpected.dwMsgBodySize; - - return lpReplyStructList->replyExpected.lpReplyMsg; }
HRESULT DP_MSG_SendRequestPlayerId( IDirectPlayImpl *This, DWORD dwFlags, DPID *lpdpidAllocatedId ) @@ -226,8 +224,8 @@ HRESULT DP_MSG_SendRequestPlayerId( IDirectPlayImpl *This, DWORD dwFlags, DPID * TRACE( "Asking for player id w/ dwFlags 0x%08lx\n", lpMsgBody->dwFlags );
- DP_MSG_ExpectReply( This, &data, DPMSG_DEFAULT_WAIT_TIME, DPMSGCMD_NEWPLAYERIDREPLY, - &lpMsg, &dwMsgSize ); + hr = DP_MSG_ExpectReply( This, &data, DPMSG_DEFAULT_WAIT_TIME, DPMSGCMD_NEWPLAYERIDREPLY, + &lpMsg, &dwMsgSize ); }
/* Need to examine the data and extract the new player id */ @@ -352,10 +350,10 @@ HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlayImpl *This, DPID dpidServer )
TRACE( "Sending forward player request with 0x%08lx\n", dpidServer );
- lpMsg = DP_MSG_ExpectReply( This, &data, - DPMSG_WAIT_60_SECS, - DPMSGCMD_GETNAMETABLEREPLY, - &lpMsg, &dwMsgSize ); + hr = DP_MSG_ExpectReply( This, &data, + DPMSG_WAIT_60_SECS, + DPMSGCMD_GETNAMETABLEREPLY, + &lpMsg, &dwMsgSize ); }
/* Need to examine the data and extract the new player id */ @@ -373,7 +371,7 @@ HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlayImpl *This, DPID dpidServer ) * ordering issues on sends and receives from the opposite machine. No wonder MS is not * a networking company. */ -static void *DP_MSG_ExpectReply( IDirectPlayImpl *This, DPSP_SENDDATA *lpData, DWORD dwWaitTime, +static HRESULT DP_MSG_ExpectReply( IDirectPlayImpl *This, DPSP_SENDDATA *lpData, DWORD dwWaitTime, WORD wReplyCommandId, void **lplpReplyMsg, DWORD *lpdwMsgBodySize ) { HRESULT hr; @@ -394,7 +392,7 @@ static void *DP_MSG_ExpectReply( IDirectPlayImpl *This, DPSP_SENDDATA *lpData, D ERR( "Send failed: %s\n", DPLAYX_HresultToString( hr ) ); DP_MSG_UnlinkReplyStruct( This, &replyStructList ); DP_MSG_CleanReplyStruct( &replyStructList, lplpReplyMsg, lpdwMsgBodySize ); - return NULL; + return hr; }
/* The reply message will trigger the hMsgReceipt event effectively switching @@ -406,11 +404,12 @@ static void *DP_MSG_ExpectReply( IDirectPlayImpl *This, DPSP_SENDDATA *lpData, D ERR( "Wait failed 0x%08lx\n", dwWaitReturn ); DP_MSG_UnlinkReplyStruct( This, &replyStructList ); DP_MSG_CleanReplyStruct( &replyStructList, lplpReplyMsg, lpdwMsgBodySize ); - return NULL; + return DPERR_TIMEOUT; }
/* Clean Up */ - return DP_MSG_CleanReplyStruct( &replyStructList, lplpReplyMsg, lpdwMsgBodySize ); + DP_MSG_CleanReplyStruct( &replyStructList, lplpReplyMsg, lpdwMsgBodySize ); + return DP_OK; }
/* Determine if there is a matching request for this incoming message and then copy @@ -484,10 +483,10 @@ void DP_MSG_ToSelf( IDirectPlayImpl *This, DPID dpidSelf ) data.bSystemMessage = TRUE; /* Allow reply to be sent */ data.lpISP = This->dp2->spData.lpISP;
- lpMsg = DP_MSG_ExpectReply( This, &data, - DPMSG_WAIT_5_SECS, - DPMSGCMD_JUSTENVELOPE, - &lpMsg, &dwMsgSize ); + DP_MSG_ExpectReply( This, &data, + DPMSG_WAIT_5_SECS, + DPMSGCMD_JUSTENVELOPE, + &lpMsg, &dwMsgSize ); } }
From: Anton Baskanov baskanov@gmail.com
--- dlls/dplayx/dplay_global.h | 3 +- dlls/dplayx/dplayx_messages.c | 64 +++++++++++++++++++++++++---------- 2 files changed, 49 insertions(+), 18 deletions(-)
diff --git a/dlls/dplayx/dplay_global.h b/dlls/dplayx/dplay_global.h index e81c57a4442..097f0839d84 100644 --- a/dlls/dplayx/dplay_global.h +++ b/dlls/dplayx/dplay_global.h @@ -44,7 +44,8 @@ typedef struct tagEnumSessionAsyncCallbackData typedef struct tagDP_MSG_REPLY_STRUCT { HANDLE hReceipt; - WORD wExpectedReply; + WORD *expectedReplies; + DWORD expectedReplyCount; LPVOID lpReplyMsg; DWORD dwMsgBodySize; /* FIXME: Is the message header required as well? */ diff --git a/dlls/dplayx/dplayx_messages.c b/dlls/dplayx/dplayx_messages.c index 6a49ffcca94..1077d99796a 100644 --- a/dlls/dplayx/dplayx_messages.c +++ b/dlls/dplayx/dplayx_messages.c @@ -46,7 +46,8 @@ typedef struct tagMSGTHREADINFO
static DWORD CALLBACK DPL_MSG_ThreadMain( LPVOID lpContext ); static HRESULT DP_MSG_ExpectReply( IDirectPlayImpl *This, DPSP_SENDDATA *data, DWORD dwWaitTime, - WORD wReplyCommandId, void **lplpReplyMsg, DWORD *lpdwMsgBodySize ); + WORD *replyCommandIds, DWORD replyCommandIdCount, void **lplpReplyMsg, + DWORD *lpdwMsgBodySize );
/* Create the message reception thread to allow the application to receive @@ -154,12 +155,14 @@ end_of_thread:
/* DP messaging stuff */ static HANDLE DP_MSG_BuildAndLinkReplyStruct( IDirectPlayImpl *This, - DP_MSG_REPLY_STRUCT_LIST *lpReplyStructList, WORD wReplyCommandId ) + DP_MSG_REPLY_STRUCT_LIST *lpReplyStructList, WORD *replyCommandIds, + DWORD replyCommandIdCount ) { - lpReplyStructList->replyExpected.hReceipt = CreateEventW( NULL, FALSE, FALSE, NULL ); - lpReplyStructList->replyExpected.wExpectedReply = wReplyCommandId; - lpReplyStructList->replyExpected.lpReplyMsg = NULL; - lpReplyStructList->replyExpected.dwMsgBodySize = 0; + lpReplyStructList->replyExpected.hReceipt = CreateEventW( NULL, FALSE, FALSE, NULL ); + lpReplyStructList->replyExpected.expectedReplies = replyCommandIds; + lpReplyStructList->replyExpected.expectedReplyCount = replyCommandIdCount; + lpReplyStructList->replyExpected.lpReplyMsg = NULL; + lpReplyStructList->replyExpected.dwMsgBodySize = 0;
/* Insert into the message queue while locked */ EnterCriticalSection( &This->lock ); @@ -169,6 +172,33 @@ static HANDLE DP_MSG_BuildAndLinkReplyStruct( IDirectPlayImpl *This, return lpReplyStructList->replyExpected.hReceipt; }
+static DP_MSG_REPLY_STRUCT_LIST *DP_MSG_FindAndUnlinkReplyStruct( IDirectPlayImpl *This, + WORD commandId ) +{ + DP_MSG_REPLY_STRUCT_LIST *reply; + DWORD i; + + EnterCriticalSection( &This->lock ); + + for( reply = DPQ_FIRST( This->dp2->repliesExpected ); reply; + reply = DPQ_NEXT( reply->repliesExpected ) ) + { + for( i = 0; i < reply->replyExpected.expectedReplyCount; ++i ) + { + if( reply->replyExpected.expectedReplies[ i ] == commandId ) + { + DPQ_REMOVE( This->dp2->repliesExpected, reply, repliesExpected ); + LeaveCriticalSection( &This->lock ); + return reply; + } + } + } + + LeaveCriticalSection( &This->lock ); + + return NULL; +} + static void DP_MSG_UnlinkReplyStruct( IDirectPlayImpl *This, DP_MSG_REPLY_STRUCT_LIST *lpReplyStructList ) { @@ -211,6 +241,7 @@ HRESULT DP_MSG_SendRequestPlayerId( IDirectPlayImpl *This, DWORD dwFlags, DPID *
/* Send the message */ { + WORD replyCommand = DPMSGCMD_NEWPLAYERIDREPLY; DPSP_SENDDATA data;
data.dwFlags = DPSEND_GUARANTEED; @@ -224,7 +255,7 @@ HRESULT DP_MSG_SendRequestPlayerId( IDirectPlayImpl *This, DWORD dwFlags, DPID * TRACE( "Asking for player id w/ dwFlags 0x%08lx\n", lpMsgBody->dwFlags );
- hr = DP_MSG_ExpectReply( This, &data, DPMSG_DEFAULT_WAIT_TIME, DPMSGCMD_NEWPLAYERIDREPLY, + hr = DP_MSG_ExpectReply( This, &data, DPMSG_DEFAULT_WAIT_TIME, &replyCommand, 1, &lpMsg, &dwMsgSize ); }
@@ -338,6 +369,7 @@ HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlayImpl *This, DPID dpidServer )
/* Send the message */ { + WORD replyCommand = DPMSGCMD_GETNAMETABLEREPLY; DPSP_SENDDATA data;
data.dwFlags = DPSEND_GUARANTEED; @@ -352,7 +384,7 @@ HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlayImpl *This, DPID dpidServer )
hr = DP_MSG_ExpectReply( This, &data, DPMSG_WAIT_60_SECS, - DPMSGCMD_GETNAMETABLEREPLY, + &replyCommand, 1, &lpMsg, &dwMsgSize ); }
@@ -372,7 +404,8 @@ HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlayImpl *This, DPID dpidServer ) * a networking company. */ static HRESULT DP_MSG_ExpectReply( IDirectPlayImpl *This, DPSP_SENDDATA *lpData, DWORD dwWaitTime, - WORD wReplyCommandId, void **lplpReplyMsg, DWORD *lpdwMsgBodySize ) + WORD *replyCommandIds, DWORD replyCommandIdCount, void **lplpReplyMsg, + DWORD *lpdwMsgBodySize ) { HRESULT hr; HANDLE hMsgReceipt; @@ -381,10 +414,9 @@ static HRESULT DP_MSG_ExpectReply( IDirectPlayImpl *This, DPSP_SENDDATA *lpData,
/* Setup for receipt */ hMsgReceipt = DP_MSG_BuildAndLinkReplyStruct( This, &replyStructList, - wReplyCommandId ); + replyCommandIds, replyCommandIdCount );
- TRACE( "Sending msg and expecting cmd %u in reply within %lu ticks\n", - wReplyCommandId, dwWaitTime ); + TRACE( "Sending msg and expecting reply within %lu ticks\n", dwWaitTime ); hr = (*This->dp2->spData.lpCB->Send)( lpData );
if( FAILED(hr) ) @@ -431,10 +463,7 @@ void DP_MSG_ReplyReceived( IDirectPlayImpl *This, WORD wCommandId, const void *l /* Find, and immediately remove (to avoid double triggering), the appropriate entry. Call locked to * avoid problems. */ - EnterCriticalSection( &This->lock ); - DPQ_REMOVE_ENTRY( This->dp2->repliesExpected, repliesExpected, replyExpected.wExpectedReply, - ==, wCommandId, lpReplyList ); - LeaveCriticalSection( &This->lock ); + lpReplyList = DP_MSG_FindAndUnlinkReplyStruct( This, wCommandId );
if( lpReplyList != NULL ) { @@ -473,6 +502,7 @@ void DP_MSG_ToSelf( IDirectPlayImpl *This, DPID dpidSelf )
/* Send the message to ourselves */ { + WORD replyCommand = DPMSGCMD_JUSTENVELOPE; DPSP_SENDDATA data;
data.dwFlags = 0; @@ -485,7 +515,7 @@ void DP_MSG_ToSelf( IDirectPlayImpl *This, DPID dpidSelf )
DP_MSG_ExpectReply( This, &data, DPMSG_WAIT_5_SECS, - DPMSGCMD_JUSTENVELOPE, + &replyCommand, 1, &lpMsg, &dwMsgSize ); } }
From: Anton Baskanov baskanov@gmail.com
--- dlls/dplayx/dplay.c | 1 + dlls/dplayx/dplayx_messages.c | 4 ++-- dlls/dplayx/dplayx_messages.h | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/dplayx/dplay.c b/dlls/dplayx/dplay.c index 3ff5c0b4f16..e09a5a76a11 100644 --- a/dlls/dplayx/dplay.c +++ b/dlls/dplayx/dplay.c @@ -383,6 +383,7 @@ HRESULT DP_HandleMessage( IDirectPlayImpl *This, const void *lpcMessageBody,
case DPMSGCMD_GETNAMETABLEREPLY: case DPMSGCMD_NEWPLAYERIDREPLY: + case DPMSGCMD_SUPERENUMPLAYERSREPLY: DP_MSG_ReplyReceived( This, wCommandId, lpcMessageBody, dwMessageBodySize ); break;
diff --git a/dlls/dplayx/dplayx_messages.c b/dlls/dplayx/dplayx_messages.c index 1077d99796a..4e385d5a0ee 100644 --- a/dlls/dplayx/dplayx_messages.c +++ b/dlls/dplayx/dplayx_messages.c @@ -369,7 +369,7 @@ HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlayImpl *This, DPID dpidServer )
/* Send the message */ { - WORD replyCommand = DPMSGCMD_GETNAMETABLEREPLY; + WORD replyCommands[] = { DPMSGCMD_GETNAMETABLEREPLY, DPMSGCMD_SUPERENUMPLAYERSREPLY }; DPSP_SENDDATA data;
data.dwFlags = DPSEND_GUARANTEED; @@ -384,7 +384,7 @@ HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlayImpl *This, DPID dpidServer )
hr = DP_MSG_ExpectReply( This, &data, DPMSG_WAIT_60_SECS, - &replyCommand, 1, + replyCommands, ARRAYSIZE( replyCommands ), &lpMsg, &dwMsgSize ); }
diff --git a/dlls/dplayx/dplayx_messages.h b/dlls/dplayx/dplayx_messages.h index c8758d3ddb1..6c2a210cb1d 100644 --- a/dlls/dplayx/dplayx_messages.h +++ b/dlls/dplayx/dplayx_messages.h @@ -72,6 +72,8 @@ void DP_MSG_ToSelf( IDirectPlayImpl *This, DPID dpidSelf );
#define DPMSGCMD_FORWARDADDPLAYERNACK 36
+#define DPMSGCMD_SUPERENUMPLAYERSREPLY 41 + #define DPMSGCMD_JUSTENVELOPE 1000 #define DPMSGCMD_JUSTENVELOPEREPLY 1001
From: Anton Baskanov baskanov@gmail.com
--- dlls/dpwsockx/dpwsockx_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/dpwsockx/dpwsockx_main.c b/dlls/dpwsockx/dpwsockx_main.c index 5b6a48d083a..19a1f3d7644 100644 --- a/dlls/dpwsockx/dpwsockx_main.c +++ b/dlls/dpwsockx/dpwsockx_main.c @@ -448,7 +448,7 @@ static HRESULT WINAPI DPWSCB_CreatePlayer( LPDPSP_CREATEPLAYERDATA data ) FIXME( "(%ld,0x%08lx,%p,%p) stub\n", data->idPlayer, data->dwFlags, data->lpSPMessageHeader, data->lpISP ); - return DPERR_UNSUPPORTED; + return DP_OK; }
static HRESULT WINAPI DPWSCB_DeletePlayer( LPDPSP_DELETEPLAYERDATA data )
From: Anton Baskanov baskanov@gmail.com
--- dlls/dpwsockx/dpwsockx_dll.h | 3 ++ dlls/dpwsockx/dpwsockx_main.c | 96 ++++++++++++++++++++++++++++++++++- 2 files changed, 97 insertions(+), 2 deletions(-)
diff --git a/dlls/dpwsockx/dpwsockx_dll.h b/dlls/dpwsockx/dpwsockx_dll.h index 39680a9bead..1b80fa02004 100644 --- a/dlls/dpwsockx/dpwsockx_dll.h +++ b/dlls/dpwsockx/dpwsockx_dll.h @@ -70,6 +70,8 @@ struct tagDPWS_IN_CONNECTION typedef struct { SOCKADDR_IN addr; + + SOCKET tcpSock; } DPWS_OUT_CONNECTION;
typedef struct tagDPWS_DATA @@ -81,6 +83,7 @@ typedef struct tagDPWS_DATA WSAEVENT acceptEvent; struct list inConnections;
+ CRITICAL_SECTION sendCs; DPWS_OUT_CONNECTION nameserverConnection;
BOOL started; diff --git a/dlls/dpwsockx/dpwsockx_main.c b/dlls/dpwsockx/dpwsockx_main.c index 19a1f3d7644..7ff3484a3c2 100644 --- a/dlls/dpwsockx/dpwsockx_main.c +++ b/dlls/dpwsockx/dpwsockx_main.c @@ -328,10 +328,13 @@ static HRESULT DPWS_Start( DPWS_DATA *dpwsData ) return DPERR_UNAVAILABLE; }
+ InitializeCriticalSection( &dpwsData->sendCs ); + dpwsData->thread = CreateThread( NULL, 0, DPWS_ThreadProc, dpwsData, 0, NULL ); if ( !dpwsData->thread ) { ERR( "CreateThread() failed\n" ); + DeleteCriticalSection( &dpwsData->sendCs ); WSACloseEvent( dpwsData->stopEvent ); WSACloseEvent( dpwsData->acceptEvent ); closesocket( dpwsData->tcpSock ); @@ -357,10 +360,14 @@ static void DPWS_Stop( DPWS_DATA *dpwsData ) WaitForSingleObject( dpwsData->thread, INFINITE ); CloseHandle( dpwsData->thread );
+ if ( dpwsData->nameserverConnection.tcpSock != INVALID_SOCKET ) + closesocket( dpwsData->nameserverConnection.tcpSock ); + LIST_FOR_EACH_ENTRY_SAFE( inConnection, inConnection2, &dpwsData->inConnections, DPWS_IN_CONNECTION, entry ) DPWS_RemoveInConnection( inConnection );
+ DeleteCriticalSection( &dpwsData->sendCs ); WSACloseEvent( dpwsData->stopEvent ); WSACloseEvent( dpwsData->acceptEvent ); closesocket( dpwsData->tcpSock ); @@ -525,6 +532,8 @@ static HRESULT WINAPI DPWSCB_Open( LPDPSP_OPENDATA data ) dpwsData->nameserverConnection.addr.sin_addr = header->SockAddr.sin_addr; dpwsData->nameserverConnection.addr.sin_port = header->SockAddr.sin_port;
+ dpwsData->nameserverConnection.tcpSock = INVALID_SOCKET; + return DP_OK; }
@@ -573,12 +582,95 @@ static HRESULT WINAPI DPWSCB_GetAddressChoices( LPDPSP_GETADDRESSCHOICESDATA dat
static HRESULT WINAPI DPWSCB_SendEx( LPDPSP_SENDEXDATA data ) { - FIXME( "(%p,0x%08lx,%ld,%ld,%p,%ld,%ld,%ld,%ld,%p,%p,%u) stub\n", + DPWS_OUT_CONNECTION *connection; + DPSP_MSG_HEADER header = { 0 }; + DPWS_DATA *dpwsData; + DWORD dpwsDataSize; + DWORD transferred; + HRESULT hr; + + TRACE( "(%p,0x%08lx,%ld,%ld,%p,%ld,%ld,%ld,%ld,%p,%p,%u)\n", data->lpISP, data->dwFlags, data->idPlayerTo, data->idPlayerFrom, data->lpSendBuffers, data->cBuffers, data->dwMessageSize, data->dwPriority, data->dwTimeout, data->lpDPContext, data->lpdwSPMsgID, data->bSystemMessage ); - return DPERR_UNSUPPORTED; + + if ( data->idPlayerTo ) + { + FIXME( "only sending to nameserver is currently implemented\n" ); + return DPERR_UNSUPPORTED; + } + + if ( !( data->dwFlags & DPSEND_GUARANTEED ) ) + { + FIXME( "non-guaranteed delivery is not yet supported\n" ); + return DPERR_UNSUPPORTED; + } + + if ( data->dwFlags & DPSEND_ASYNC ) + { + FIXME("asynchronous send is not yet supported\n"); + return DPERR_UNSUPPORTED; + } + + hr = IDirectPlaySP_GetSPData( data->lpISP, (void **) &dpwsData, &dpwsDataSize, DPSET_LOCAL ); + if ( FAILED( hr ) ) + return hr; + + header.mixed = DPSP_MSG_MAKE_MIXED( data->dwMessageSize, DPSP_MSG_TOKEN_REMOTE ); + header.SockAddr.sin_family = AF_INET; + header.SockAddr.sin_port = dpwsData->tcpAddr.sin_port; + + data->lpSendBuffers[ 0 ].pData = (unsigned char *) &header; + + EnterCriticalSection( &dpwsData->sendCs ); + + connection = &dpwsData->nameserverConnection; + + if ( connection->tcpSock == INVALID_SOCKET ) + { + connection->tcpSock = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP ); + if ( connection->tcpSock == INVALID_SOCKET ) + { + ERR( "socket() failed\n" ); + LeaveCriticalSection( &dpwsData->sendCs ); + return DPERR_UNAVAILABLE; + } + + if ( SOCKET_ERROR == connect( connection->tcpSock, (SOCKADDR *) &connection->addr, + sizeof( connection->addr ) ) ) + { + ERR( "connect() failed\n" ); + closesocket( connection->tcpSock ); + connection->tcpSock = INVALID_SOCKET; + LeaveCriticalSection( &dpwsData->sendCs ); + return DPERR_UNAVAILABLE; + } + } + + if ( SOCKET_ERROR == WSASend( connection->tcpSock, (WSABUF *) data->lpSendBuffers, + data->cBuffers, &transferred, 0, NULL, NULL ) ) + { + if ( WSAGetLastError() != WSA_IO_PENDING ) + { + ERR( "WSASend() failed\n" ); + LeaveCriticalSection( &dpwsData->sendCs ); + return DPERR_UNAVAILABLE; + } + } + + if ( transferred < data->dwMessageSize ) + { + ERR( "lost connection\n" ); + closesocket( connection->tcpSock ); + connection->tcpSock = INVALID_SOCKET; + LeaveCriticalSection( &dpwsData->sendCs ); + return DPERR_CONNECTIONLOST; + } + + LeaveCriticalSection( &dpwsData->sendCs ); + + return DP_OK; }
static HRESULT WINAPI DPWSCB_SendToGroupEx( LPDPSP_SENDTOGROUPEXDATA data )
From: Anton Baskanov baskanov@gmail.com
--- dlls/dplayx/dplayx_messages.c | 180 ++++++++++++++++++---------------- dlls/dplayx/tests/dplayx.c | 59 ++++++----- 2 files changed, 121 insertions(+), 118 deletions(-)
diff --git a/dlls/dplayx/dplayx_messages.c b/dlls/dplayx/dplayx_messages.c index 4e385d5a0ee..8e4f8750283 100644 --- a/dlls/dplayx/dplayx_messages.c +++ b/dlls/dplayx/dplayx_messages.c @@ -45,7 +45,7 @@ typedef struct tagMSGTHREADINFO } MSGTHREADINFO, *LPMSGTHREADINFO;
static DWORD CALLBACK DPL_MSG_ThreadMain( LPVOID lpContext ); -static HRESULT DP_MSG_ExpectReply( IDirectPlayImpl *This, DPSP_SENDDATA *data, DWORD dwWaitTime, +static HRESULT DP_MSG_ExpectReply( IDirectPlayImpl *This, DPSP_SENDEXDATA *data, DWORD dwWaitTime, WORD *replyCommandIds, DWORD replyCommandIdCount, void **lplpReplyMsg, DWORD *lpdwMsgBodySize );
@@ -217,43 +217,51 @@ void DP_MSG_CleanReplyStruct( LPDP_MSG_REPLY_STRUCT_LIST lpReplyStructList, *lpdwMsgBodySize = lpReplyStructList->replyExpected.dwMsgBodySize; }
+DWORD DP_MSG_ComputeMessageSize( SGBUFFER *buffers, DWORD bufferCount ) +{ + DWORD size = 0; + DWORD i; + for ( i = 0; i < bufferCount; ++i ) + size += buffers[ i ].len; + return size; +} + HRESULT DP_MSG_SendRequestPlayerId( IDirectPlayImpl *This, DWORD dwFlags, DPID *lpdpidAllocatedId ) { LPVOID lpMsg; - LPDPMSG_REQUESTNEWPLAYERID lpMsgBody; + DPMSG_REQUESTNEWPLAYERID msgBody; DWORD dwMsgSize; HRESULT hr = DP_OK;
- dwMsgSize = This->dp2->spData.dwSPHeaderSize + sizeof( *lpMsgBody ); - - lpMsg = calloc( 1, dwMsgSize ); - - lpMsgBody = (LPDPMSG_REQUESTNEWPLAYERID)( (BYTE*)lpMsg + - This->dp2->spData.dwSPHeaderSize ); - /* Compose dplay message envelope */ - lpMsgBody->envelope.dwMagic = DPMSGMAGIC_DPLAYMSG; - lpMsgBody->envelope.wCommandId = DPMSGCMD_REQUESTNEWPLAYERID; - lpMsgBody->envelope.wVersion = DPMSGVER_DP6; + msgBody.envelope.dwMagic = DPMSGMAGIC_DPLAYMSG; + msgBody.envelope.wCommandId = DPMSGCMD_REQUESTNEWPLAYERID; + msgBody.envelope.wVersion = DPMSGVER_DP6;
/* Compose the body of the message */ - lpMsgBody->dwFlags = dwFlags; + msgBody.dwFlags = dwFlags;
/* Send the message */ { WORD replyCommand = DPMSGCMD_NEWPLAYERIDREPLY; - DPSP_SENDDATA data; + SGBUFFER buffers[ 2 ] = { 0 }; + DPSP_SENDEXDATA data = { 0 };
+ buffers[ 0 ].len = This->dp2->spData.dwSPHeaderSize; + buffers[ 1 ].len = sizeof( msgBody ); + buffers[ 1 ].pData = (UCHAR *) &msgBody; + + data.lpISP = This->dp2->spData.lpISP; data.dwFlags = DPSEND_GUARANTEED; data.idPlayerTo = 0; /* Name server */ data.idPlayerFrom = 0; /* Sending from DP */ - data.lpMessage = lpMsg; - data.dwMessageSize = dwMsgSize; + data.lpSendBuffers = buffers; + data.cBuffers = ARRAYSIZE( buffers ); + data.dwMessageSize = DP_MSG_ComputeMessageSize( data.lpSendBuffers, data.cBuffers ); data.bSystemMessage = TRUE; /* Allow reply to be sent */ - data.lpISP = This->dp2->spData.lpISP;
TRACE( "Asking for player id w/ dwFlags 0x%08lx\n", - lpMsgBody->dwFlags ); + msgBody.dwFlags );
hr = DP_MSG_ExpectReply( This, &data, DPMSG_DEFAULT_WAIT_TIME, &replyCommand, 1, &lpMsg, &dwMsgSize ); @@ -287,21 +295,14 @@ HRESULT DP_MSG_SendRequestPlayerId( IDirectPlayImpl *This, DWORD dwFlags, DPID * HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlayImpl *This, DPID dpidServer ) { LPVOID lpMsg; - LPDPMSG_FORWARDADDPLAYER lpMsgBody; + DPMSG_FORWARDADDPLAYER msgBody; DWORD dwMsgSize; HRESULT hr = DP_OK;
- dwMsgSize = This->dp2->spData.dwSPHeaderSize + sizeof( *lpMsgBody ); - - lpMsg = calloc( 1, dwMsgSize ); - - lpMsgBody = (LPDPMSG_FORWARDADDPLAYER)( (BYTE*)lpMsg + - This->dp2->spData.dwSPHeaderSize ); - /* Compose dplay message envelope */ - lpMsgBody->envelope.dwMagic = DPMSGMAGIC_DPLAYMSG; - lpMsgBody->envelope.wCommandId = DPMSGCMD_FORWARDADDPLAYER; - lpMsgBody->envelope.wVersion = DPMSGVER_DP6; + msgBody.envelope.dwMagic = DPMSGMAGIC_DPLAYMSG; + msgBody.envelope.wCommandId = DPMSGCMD_FORWARDADDPLAYER; + msgBody.envelope.wVersion = DPMSGVER_DP6;
#if 0 { @@ -329,56 +330,62 @@ HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlayImpl *This, DPID dpidServer ) #endif
/* Compose body of message */ - lpMsgBody->dpidAppServer = dpidServer; - lpMsgBody->unknown2[0] = 0x0; - lpMsgBody->unknown2[1] = 0x1c; - lpMsgBody->unknown2[2] = 0x6c; - lpMsgBody->unknown2[3] = 0x50; - lpMsgBody->unknown2[4] = 0x9; - - lpMsgBody->dpidAppServer2 = dpidServer; - lpMsgBody->unknown3[0] = 0x0; - lpMsgBody->unknown3[1] = 0x0; - lpMsgBody->unknown3[2] = 0x20; - lpMsgBody->unknown3[3] = 0x0; - lpMsgBody->unknown3[4] = 0x0; - - lpMsgBody->dpidAppServer3 = dpidServer; - lpMsgBody->unknown4[0] = 0x30; - lpMsgBody->unknown4[1] = 0xb; - lpMsgBody->unknown4[2] = 0x0; - - lpMsgBody->unknown4[3] = NS_GetNsMagic( This->dp2->lpNameServerData ) - - 0x02000000; - TRACE( "Setting first magic to 0x%08lx\n", lpMsgBody->unknown4[3] ); - - lpMsgBody->unknown4[4] = 0x0; - lpMsgBody->unknown4[5] = 0x0; - lpMsgBody->unknown4[6] = 0x0; - - lpMsgBody->unknown4[7] = NS_GetNsMagic( This->dp2->lpNameServerData ); - TRACE( "Setting second magic to 0x%08lx\n", lpMsgBody->unknown4[7] ); - - lpMsgBody->unknown4[8] = 0x0; - lpMsgBody->unknown4[9] = 0x0; - lpMsgBody->unknown4[10] = 0x0; - lpMsgBody->unknown4[11] = 0x0; - - lpMsgBody->unknown5[0] = 0x0; - lpMsgBody->unknown5[1] = 0x0; + msgBody.dpidAppServer = dpidServer; + msgBody.unknown2[0] = 0x0; + msgBody.unknown2[1] = 0x1c; + msgBody.unknown2[2] = 0x6c; + msgBody.unknown2[3] = 0x50; + msgBody.unknown2[4] = 0x9; + + msgBody.dpidAppServer2 = dpidServer; + msgBody.unknown3[0] = 0x0; + msgBody.unknown3[1] = 0x0; + msgBody.unknown3[2] = 0x20; + msgBody.unknown3[3] = 0x0; + msgBody.unknown3[4] = 0x0; + + msgBody.dpidAppServer3 = dpidServer; + msgBody.unknown4[0] = 0x30; + msgBody.unknown4[1] = 0xb; + msgBody.unknown4[2] = 0x0; + + msgBody.unknown4[3] = NS_GetNsMagic( This->dp2->lpNameServerData ) - + 0x02000000; + TRACE( "Setting first magic to 0x%08lx\n", msgBody.unknown4[3] ); + + msgBody.unknown4[4] = 0x0; + msgBody.unknown4[5] = 0x0; + msgBody.unknown4[6] = 0x0; + + msgBody.unknown4[7] = NS_GetNsMagic( This->dp2->lpNameServerData ); + TRACE( "Setting second magic to 0x%08lx\n", msgBody.unknown4[7] ); + + msgBody.unknown4[8] = 0x0; + msgBody.unknown4[9] = 0x0; + msgBody.unknown4[10] = 0x0; + msgBody.unknown4[11] = 0x0; + + msgBody.unknown5[0] = 0x0; + msgBody.unknown5[1] = 0x0;
/* Send the message */ { WORD replyCommands[] = { DPMSGCMD_GETNAMETABLEREPLY, DPMSGCMD_SUPERENUMPLAYERSREPLY }; - DPSP_SENDDATA data; + SGBUFFER buffers[ 2 ] = { 0 }; + DPSP_SENDEXDATA data = { 0 }; + + buffers[ 0 ].len = This->dp2->spData.dwSPHeaderSize; + buffers[ 1 ].len = sizeof( msgBody ); + buffers[ 1 ].pData = (UCHAR *) &msgBody;
+ data.lpISP = This->dp2->spData.lpISP; data.dwFlags = DPSEND_GUARANTEED; data.idPlayerTo = 0; /* Name server */ data.idPlayerFrom = dpidServer; /* Sending from session server */ - data.lpMessage = lpMsg; - data.dwMessageSize = dwMsgSize; + data.lpSendBuffers = buffers; + data.cBuffers = ARRAYSIZE( buffers ); + data.dwMessageSize = DP_MSG_ComputeMessageSize( data.lpSendBuffers, data.cBuffers ); data.bSystemMessage = TRUE; /* Allow reply to be sent */ - data.lpISP = This->dp2->spData.lpISP;
TRACE( "Sending forward player request with 0x%08lx\n", dpidServer );
@@ -403,7 +410,7 @@ HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlayImpl *This, DPID dpidServer ) * ordering issues on sends and receives from the opposite machine. No wonder MS is not * a networking company. */ -static HRESULT DP_MSG_ExpectReply( IDirectPlayImpl *This, DPSP_SENDDATA *lpData, DWORD dwWaitTime, +static HRESULT DP_MSG_ExpectReply( IDirectPlayImpl *This, DPSP_SENDEXDATA *lpData, DWORD dwWaitTime, WORD *replyCommandIds, DWORD replyCommandIdCount, void **lplpReplyMsg, DWORD *lpdwMsgBodySize ) { @@ -417,7 +424,7 @@ static HRESULT DP_MSG_ExpectReply( IDirectPlayImpl *This, DPSP_SENDDATA *lpData, replyCommandIds, replyCommandIdCount );
TRACE( "Sending msg and expecting reply within %lu ticks\n", dwWaitTime ); - hr = (*This->dp2->spData.lpCB->Send)( lpData ); + hr = (*This->dp2->spData.lpCB->SendEx)( lpData );
if( FAILED(hr) ) { @@ -485,33 +492,32 @@ void DP_MSG_ReplyReceived( IDirectPlayImpl *This, WORD wCommandId, const void *l void DP_MSG_ToSelf( IDirectPlayImpl *This, DPID dpidSelf ) { LPVOID lpMsg; - LPDPMSG_SENDENVELOPE lpMsgBody; + DPMSG_SENDENVELOPE msgBody; DWORD dwMsgSize;
- dwMsgSize = This->dp2->spData.dwSPHeaderSize + sizeof( *lpMsgBody ); - - lpMsg = calloc( 1, dwMsgSize ); - - lpMsgBody = (LPDPMSG_SENDENVELOPE)( (BYTE*)lpMsg + - This->dp2->spData.dwSPHeaderSize ); - /* Compose dplay message envelope */ - lpMsgBody->dwMagic = DPMSGMAGIC_DPLAYMSG; - lpMsgBody->wCommandId = DPMSGCMD_JUSTENVELOPE; - lpMsgBody->wVersion = DPMSGVER_DP6; + msgBody.dwMagic = DPMSGMAGIC_DPLAYMSG; + msgBody.wCommandId = DPMSGCMD_JUSTENVELOPE; + msgBody.wVersion = DPMSGVER_DP6;
/* Send the message to ourselves */ { WORD replyCommand = DPMSGCMD_JUSTENVELOPE; - DPSP_SENDDATA data; + SGBUFFER buffers[ 2 ] = { 0 }; + DPSP_SENDEXDATA data = { 0 }; + + buffers[ 0 ].len = This->dp2->spData.dwSPHeaderSize; + buffers[ 1 ].len = sizeof( msgBody ); + buffers[ 1 ].pData = (UCHAR *) &msgBody;
+ data.lpISP = This->dp2->spData.lpISP; data.dwFlags = 0; data.idPlayerTo = dpidSelf; /* Sending to session server */ data.idPlayerFrom = 0; /* Sending from session server */ - data.lpMessage = lpMsg; - data.dwMessageSize = dwMsgSize; + data.lpSendBuffers = buffers; + data.cBuffers = ARRAYSIZE( buffers ); + data.dwMessageSize = DP_MSG_ComputeMessageSize( data.lpSendBuffers, data.cBuffers ); data.bSystemMessage = TRUE; /* Allow reply to be sent */ - data.lpISP = This->dp2->spData.lpISP;
DP_MSG_ExpectReply( This, &data, DPMSG_WAIT_5_SECS, diff --git a/dlls/dplayx/tests/dplayx.c b/dlls/dplayx/tests/dplayx.c index 62a7888119e..58f6903efdd 100644 --- a/dlls/dplayx/tests/dplayx.c +++ b/dlls/dplayx/tests/dplayx.c @@ -1046,8 +1046,8 @@ static void checkSpData_( int line, SpData *spData ) ok_( __FILE__, line )( !spData->tcpAddr.sin_addr.s_addr, "got TCP address %#lx.\n", spData->tcpAddr.sin_addr.s_addr ); ok_( __FILE__, line )( spData->udpAddr.sin_family == AF_INET, "got UDP family %d.\n", spData->udpAddr.sin_family ); - ok_( __FILE__, line )( 2350 <= ntohs( spData->udpAddr.sin_port ) && ntohs( spData->udpAddr.sin_port ) < 2400, - "got UDP port %d.\n", ntohs( spData->udpAddr.sin_port ) ); + todo_wine ok_( __FILE__, line )( 2350 <= ntohs( spData->udpAddr.sin_port ) && ntohs( spData->udpAddr.sin_port ) < 2400, + "got UDP port %d.\n", ntohs( spData->udpAddr.sin_port ) ); ok_( __FILE__, line )( !spData->udpAddr.sin_addr.s_addr, "got UDP address %#lx.\n", spData->udpAddr.sin_addr.s_addr ); } @@ -1246,10 +1246,13 @@ static unsigned short receiveAddForwardRequest_( int line, SOCKET sock, DPID exp
wsResult = receiveMessage_( line, sock, &request, sizeof( request ) ); ok_( __FILE__, line )( wsResult == sizeof( request ), "recv() returned %d.\n", wsResult ); + if ( wsResult == SOCKET_ERROR ) + return 0;
- port = checkSpHeader_( line, &request.spHeader, expectedSize, FALSE ); + port = checkSpHeader_( line, &request.spHeader, expectedSize, expectedPasswordSize != 2 ); checkMessageHeader_( line, &request.request.header, 19 ); - ok_( __FILE__, line )( !request.request.toId, "got destination id %#lx.\n", request.request.toId ); + todo_wine_if( request.request.toId ) ok_( __FILE__, line )( !request.request.toId, "got destination id %#lx.\n", + request.request.toId ); ok_( __FILE__, line )( request.request.playerId == expectedPlayerId, "got player id %#lx.\n", request.request.playerId ); ok_( __FILE__, line )( !request.request.groupId, "got group id %#lx.\n", request.request.groupId ); @@ -1263,13 +1266,16 @@ static unsigned short receiveAddForwardRequest_( int line, SOCKET sock, DPID exp
wsResult = receiveMessage_( line, sock, password, expectedPasswordSize );
- ok_( __FILE__, line )( wsResult == expectedPasswordSize, "recv() returned %d.\n", wsResult ); - ok_( __FILE__, line )( !lstrcmpW( password, expectedPassword ), "got password %s.\n", wine_dbgstr_w( password ) ); + todo_wine_if( expectedPasswordSize != 2 ) ok_( __FILE__, line )( wsResult == expectedPasswordSize, + "recv() returned %d.\n", wsResult ); + todo_wine_if( expectedPasswordSize != 2 ) ok_( __FILE__, line )( !lstrcmpW( password, expectedPassword ), + "got password %s.\n", wine_dbgstr_w( password ) );
wsResult = receiveMessage_( line, sock, &tickCount, sizeof( DWORD ) );
- ok_( __FILE__, line )( wsResult == sizeof( DWORD ), "recv() returned %d.\n", wsResult ); - ok_( __FILE__, line )( tickCount == expectedTickCount, "got tick count %#lx.\n", tickCount ); + todo_wine_if( expectedPasswordSize != 2 ) ok_( __FILE__, line )( wsResult == sizeof( DWORD ), + "recv() returned %d.\n", wsResult ); + todo_wine ok_( __FILE__, line )( tickCount == expectedTickCount, "got tick count %#lx.\n", tickCount );
return port; } @@ -1944,8 +1950,8 @@ static BOOL CALLBACK EnumSessions_cb2( LPCDPSESSIONDESC2 lpThisSD, return TRUE; }
-#define check_Open( dp, dpsd, serverDpsd, requestExpected, port, expectedPassword, expectedHr, hrTodo ) check_Open_( __LINE__, dp, dpsd, serverDpsd, requestExpected, port, expectedPassword, expectedHr, hrTodo ) -static void check_Open_( int line, IDirectPlay4A *dp, DPSESSIONDESC2 *dpsd, const DPSESSIONDESC2 *serverDpsd, BOOL requestExpected, unsigned short port, const WCHAR *expectedPassword, HRESULT expectedHr, BOOL hrTodo ) +#define check_Open( dp, dpsd, serverDpsd, requestExpected, port, expectedPassword, expectedHr ) check_Open_( __LINE__, dp, dpsd, serverDpsd, requestExpected, port, expectedPassword, expectedHr ) +static void check_Open_( int line, IDirectPlay4A *dp, DPSESSIONDESC2 *dpsd, const DPSESSIONDESC2 *serverDpsd, BOOL requestExpected, unsigned short port, const WCHAR *expectedPassword, HRESULT expectedHr ) { SOCKET listenSock; OpenParam *param; @@ -1967,16 +1973,7 @@ static void check_Open_( int line, IDirectPlay4A *dp, DPSESSIONDESC2 *dpsd, cons unsigned short port;
recvSock = acceptTcp_( line, listenSock ); - todo_wine ok_( __FILE__, line )( recvSock != INVALID_SOCKET, "accept() returned %#Ix.\n", recvSock ); - if ( recvSock == INVALID_SOCKET ) - { - hr = openAsyncWait( param, 2000 ); - todo_wine_if( hrTodo ) ok_( __FILE__, line )( hr == expectedHr, "Open() returned %#lx.\n", hr ); - - closesocket( listenSock ); - WSACleanup(); - return; - } + ok_( __FILE__, line )( recvSock != INVALID_SOCKET, "accept() returned %#Ix.\n", recvSock );
port = receiveRequestPlayerId_( line, recvSock, 0x9 );
@@ -1991,7 +1988,7 @@ static void check_Open_( int line, IDirectPlay4A *dp, DPSESSIONDESC2 *dpsd, cons checkNoMoreMessages_( line, recvSock );
hr = openAsyncWait( param, 2000 ); - todo_wine_if( hrTodo ) ok_( __FILE__, line )( hr == expectedHr, "Open() returned %#lx.\n", hr ); + ok_( __FILE__, line )( hr == expectedHr, "Open() returned %#lx.\n", hr );
hr = IDirectPlayX_Close( dp ); checkHR( DP_OK, hr ); @@ -2002,7 +1999,7 @@ static void check_Open_( int line, IDirectPlay4A *dp, DPSESSIONDESC2 *dpsd, cons else { hr = openAsyncWait( param, 2000 ); - todo_wine_if( hrTodo ) ok_( __FILE__, line )( hr == expectedHr, "Open() returned %#lx.\n", hr ); + ok_( __FILE__, line )( hr == expectedHr, "Open() returned %#lx.\n", hr ); }
checkNoMoreAccepts_( line, listenSock ); @@ -2072,9 +2069,9 @@ static void test_Open(void)
dpsd = dpsdZero; dpsd.dwSize = 0; - check_Open( dp, &dpsd, NULL, FALSE, 2349, NULL, DPERR_INVALIDPARAMS, FALSE ); + check_Open( dp, &dpsd, NULL, FALSE, 2349, NULL, DPERR_INVALIDPARAMS );
- check_Open( dp, &dpsdZero, NULL, FALSE, 2349, NULL, DPERR_UNINITIALIZED, FALSE ); + check_Open( dp, &dpsdZero, NULL, FALSE, 2349, NULL, DPERR_UNINITIALIZED );
init_TCPIP_provider( dp, "127.0.0.1", 0 );
@@ -2082,19 +2079,19 @@ static void test_Open(void) /* - Checking how strict dplay is with sizes */ dpsd = dpsdZero; dpsd.dwSize = 0; - check_Open( dp, &dpsd, NULL, FALSE, 2349, NULL, DPERR_INVALIDPARAMS, FALSE ); + check_Open( dp, &dpsd, NULL, FALSE, 2349, NULL, DPERR_INVALIDPARAMS );
dpsd = dpsdZero; dpsd.dwSize = sizeof( DPSESSIONDESC2 ) - 1; - check_Open( dp, &dpsd, NULL, FALSE, 2349, NULL, DPERR_INVALIDPARAMS, FALSE ); + check_Open( dp, &dpsd, NULL, FALSE, 2349, NULL, DPERR_INVALIDPARAMS );
dpsd = dpsdZero; dpsd.dwSize = sizeof( DPSESSIONDESC2 ) + 1; - check_Open( dp, &dpsd, NULL, FALSE, 2349, NULL, DPERR_INVALIDPARAMS, FALSE ); + check_Open( dp, &dpsd, NULL, FALSE, 2349, NULL, DPERR_INVALIDPARAMS );
- check_Open( dp, &dpsdZero, NULL, FALSE, 2349, NULL, DPERR_NOSESSIONS, FALSE ); + check_Open( dp, &dpsdZero, NULL, FALSE, 2349, NULL, DPERR_NOSESSIONS );
- check_Open( dp, &dpsdAppGuid, NULL, FALSE, 2349, NULL, DPERR_NOSESSIONS, FALSE ); + check_Open( dp, &dpsdAppGuid, NULL, FALSE, 2349, NULL, DPERR_NOSESSIONS );
enumSock = bindUdp( 47624 );
@@ -2124,7 +2121,7 @@ static void test_Open(void) break; }
- check_Open( dp, &dpsdAppGuid, &normalDpsd, TRUE, 2349, L"", DP_OK, TRUE ); + check_Open( dp, &dpsdAppGuid, &normalDpsd, TRUE, 2349, L"", DP_OK );
/* Join to protected session */ for ( tryIndex = 0; ; ++tryIndex ) @@ -2155,7 +2152,7 @@ static void test_Open(void)
dpsd = dpsdAppGuid; dpsd.lpszPasswordA = (char *) "hadouken"; - check_Open( dp, &dpsd, &protectedDpsd, TRUE, 2349, L"hadouken", DP_OK, TRUE ); + check_Open( dp, &dpsd, &protectedDpsd, TRUE, 2349, L"hadouken", DP_OK );
closesocket( enumSock );
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=148638
Your paranoid android.
=== w7u_2qxl (32 bit report) ===
dplayx: dplayx.c:2134: Test failed: got flags 0.
This merge request was approved by Alistair Leslie-Hughes.