From: Anton Baskanov baskanov@gmail.com
--- dlls/dplayx/dplay.c | 5 +---- dlls/dplayx/dplayx_messages.c | 34 +++++++++++++++++++++------------- dlls/dplayx/dplayx_messages.h | 8 ++++++-- 3 files changed, 28 insertions(+), 19 deletions(-)
diff --git a/dlls/dplayx/dplay.c b/dlls/dplayx/dplay.c index 26dfd0279a1..83970be9c41 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_FORWARDADDPLAYERNACK: case DPMSGCMD_SUPERENUMPLAYERSREPLY: DP_MSG_ReplyReceived( This, wCommandId, lpcMessageBody, dwMessageBodySize, lpcMessageHeader ); break; @@ -397,10 +398,6 @@ HRESULT DP_HandleMessage( IDirectPlayImpl *This, const void *lpcMessageBody, DP_MSG_ToSelf( This, 1 ); /* This is a hack right now */ break;
- case DPMSGCMD_FORWARDADDPLAYERNACK: - DP_MSG_ErrorReceived( This, wCommandId, lpcMessageBody, dwMessageBodySize ); - break; - default: FIXME( "Unknown wCommandId %u. Ignoring message\n", wCommandId ); DebugBreak(); diff --git a/dlls/dplayx/dplayx_messages.c b/dlls/dplayx/dplayx_messages.c index 7ca6ba5a52c..90091d0aa03 100644 --- a/dlls/dplayx/dplayx_messages.c +++ b/dlls/dplayx/dplayx_messages.c @@ -495,7 +495,8 @@ HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlayImpl *This, DPID dpidServer, WC
/* Send the message */ { - WORD replyCommands[] = { DPMSGCMD_GETNAMETABLEREPLY, DPMSGCMD_SUPERENUMPLAYERSREPLY }; + WORD replyCommands[] = { DPMSGCMD_GETNAMETABLEREPLY, DPMSGCMD_SUPERENUMPLAYERSREPLY, + DPMSGCMD_FORWARDADDPLAYERNACK }; SGBUFFER buffers[ 6 ] = { 0 }; DPSP_SENDEXDATA data = { 0 };
@@ -588,6 +589,25 @@ HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlayImpl *This, DPID dpidServer, WC { FIXME( "Name Table reply received: stub\n" ); } + else if( envelope->wCommandId == DPMSGCMD_FORWARDADDPLAYERNACK ) + { + DPSP_MSG_ADDFORWARDREPLY *addForwardReply; + + if( dwMsgSize < sizeof( DPSP_MSG_ADDFORWARDREPLY ) ) + { + free( msgHeader ); + free( lpMsg ); + return DPERR_GENERIC; + } + addForwardReply = (DPSP_MSG_ADDFORWARDREPLY *) envelope; + + hr = addForwardReply->error; + + free( msgHeader ); + free( lpMsg ); + + return hr; + } free( msgHeader ); free( lpMsg ); } @@ -720,15 +740,3 @@ void DP_MSG_ToSelf( IDirectPlayImpl *This, DPID dpidSelf ) &lpMsg, &dwMsgSize, &msgHeader ); } } - -void DP_MSG_ErrorReceived( IDirectPlayImpl *This, WORD wCommandId, const void *lpMsgBody, - DWORD dwMsgBodySize ) -{ - LPCDPMSG_FORWARDADDPLAYERNACK lpcErrorMsg; - - lpcErrorMsg = lpMsgBody; - - ERR( "Received error message %u. Error is %s\n", - wCommandId, DPLAYX_HresultToString( lpcErrorMsg->errorCode) ); - DebugBreak(); -} diff --git a/dlls/dplayx/dplayx_messages.h b/dlls/dplayx/dplayx_messages.h index f29b52b5ae1..e8453200d26 100644 --- a/dlls/dplayx/dplayx_messages.h +++ b/dlls/dplayx/dplayx_messages.h @@ -55,8 +55,6 @@ HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlayImpl *This, DPID dpidServer, WC void DP_MSG_ReplyReceived( IDirectPlayImpl *This, WORD wCommandId, LPCVOID lpMsgBody, DWORD dwMsgBodySize, const void *msgHeader ); -void DP_MSG_ErrorReceived( IDirectPlayImpl *This, WORD wCommandId, - LPCVOID lpMsgBody, DWORD dwMsgBodySize ); void DP_MSG_ToSelf( IDirectPlayImpl *This, DPID dpidSelf );
/* Timings -> 1000 ticks/sec */ @@ -255,6 +253,12 @@ typedef struct #define DPLAYI_SUPERPACKEDPLAYER_PARENT_ID_PRESENT 0x100 #define DPLAYI_SUPERPACKEDPLAYER_SHORTCUT_COUNT_SIZE( mask ) (((mask) >> 9) & 0x3)
+typedef struct +{ + DPMSG_SENDENVELOPE envelope; + HRESULT error; +} DPSP_MSG_ADDFORWARDREPLY; + typedef struct { DPMSG_SENDENVELOPE envelope;