Changeset 4446 for trunk/src/DPlayX/dplay.cpp
- Timestamp:
- Oct 6, 2000, 9:49:06 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/DPlayX/dplay.cpp
r4317 r4446 1 // $Id: dplay.cpp,v 1. 2 2000-09-24 22:47:36hugh Exp $1 // $Id: dplay.cpp,v 1.3 2000-10-06 19:49:03 hugh Exp $ 2 2 /* Direct Play 2,3,4 Implementation 3 3 * … … 32 32 DEFAULT_DEBUG_CHANNEL(dplay) 33 33 34 #undef debugstr_guid 34 35 #define debugstr_guid(a) a 35 36 … … 274 275 This->dp2->spData.dwSPVersion = DPSP_MAJORVERSION; 275 276 276 This->dp2->spData.lpCB = (LPDPSP_SPCALLBACKS)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, 277 sizeof( *This->dp2->spData.lpCB ) ); 277 This->dp2->spData.lpCB = (DPSP_SPCALLBACKS*)HeapAlloc( GetProcessHeap(), 278 HEAP_ZERO_MEMORY, 279 sizeof( *This->dp2->spData.lpCB ) ); 278 280 This->dp2->spData.lpCB->dwSize = sizeof( *This->dp2->spData.lpCB ); 279 281 This->dp2->spData.lpCB->dwVersion = DPSP_MAJORVERSION; … … 634 636 wVersion ); 635 637 638 DebugBreak(); 639 636 640 switch( wCommandId ) 637 641 { … … 650 654 *lpdwMsgSize ); 651 655 652 FIXME( "Ignoring dwFlags in msg\n" ); 656 FIXME( "Ignoring dwFlags in request msg\n" ); 657 658 #if 0 659 /* This is just a test. See how large the SPData is and send it */ 660 { 661 LPVOID lpData; 662 DWORD dwDataSize; 663 HRESULT hr; 664 665 hr = IDirectPlaySP_GetSPData( This->dp2->spData.lpISP, &lpData, 666 &dwDataSize, DPSET_REMOTE ); 667 668 if( FAILED(hr) ) 669 { 670 ERR( "Unable to get remote SPData %s\n", DPLAYX_HresultToString(hr) ); 671 } 672 673 } 674 #endif 653 675 654 676 /* Setup the reply */ … … 660 682 lpReply->envelope.wVersion = DPMSGVER_DP6; 661 683 662 #if 0663 /* FIXME: Need to know the proper contents of the message! */664 684 lpReply->dpidNewPlayerId = DP_NextObjectId(); 665 #endif 685 686 TRACE( "Allocating new playerid 0x%08lx from remote request\n", 687 lpReply->dpidNewPlayerId ); 666 688 667 689 break; … … 670 692 case DPMSGCMD_NEWPLAYERIDREPLY: 671 693 { 672 673 DebugBreak();674 694 675 695 if( This->dp2->hMsgReceipt ) … … 684 704 else 685 705 { 686 ERR( "No receipt event set \n" );706 ERR( "No receipt event set - only expecting in reply mode\n" ); 687 707 } 688 708 … … 1316 1336 BOOL bAnsi ) 1317 1337 { 1338 HANDLE hr = DP_OK; 1318 1339 lpPlayerData lpPData; 1319 1340 lpPlayerList lpPList; … … 1353 1374 else 1354 1375 { 1355 HRESULThr = DP_MSG_SendRequestPlayerId( This, dwFlags, lpidPlayer );1376 hr = DP_MSG_SendRequestPlayerId( This, dwFlags, lpidPlayer ); 1356 1377 1357 1378 if( FAILED(hr) ) … … 1421 1442 data.lpISP = This->dp2->spData.lpISP; 1422 1443 1423 (*This->dp2->spData.lpCB->CreatePlayer)( &data ); 1444 hr = (*This->dp2->spData.lpCB->CreatePlayer)( &data ); 1445 } 1446 1447 if( FAILED(hr) ) 1448 { 1449 ERR( "Failed to create player with sp: %s\n", DPLAYX_HresultToString(hr) ); 1450 return hr; 1451 } 1452 1453 /* Now let the SP know that this player is a member of the system group */ 1454 if( This->dp2->spData.lpCB->AddPlayerToGroup ) 1455 { 1456 DPSP_ADDPLAYERTOGROUPDATA data; 1457 1458 data.idPlayer = *lpidPlayer; 1459 data.idGroup = DPID_SYSTEM_GROUP; 1460 data.lpISP = This->dp2->spData.lpISP; 1461 1462 TRACE( "Calling SP AddPlayerToGroup (sys group)\n" ); 1463 1464 hr = (*This->dp2->spData.lpCB->AddPlayerToGroup)( &data ); 1465 } 1466 1467 if( FAILED(hr) ) 1468 { 1469 ERR( "Failed to add player to sys groupwith sp: %s\n", 1470 DPLAYX_HresultToString(hr) ); 1471 return hr; 1424 1472 } 1425 1473 … … 1447 1495 /* FIXME: Should size include data w/ message or just message "header" */ 1448 1496 /* FIXME: Check return code */ 1449 DP_SendEx( This, DPID_SERVERPLAYER, DPID_ALLPLAYERS, 0, &msg, sizeof( msg ),1450 0, 0, NULL, NULL, bAnsi );1451 } 1452 1453 return DP_OK;1497 hr = DP_SendEx( This, DPID_SERVERPLAYER, DPID_ALLPLAYERS, 0, &msg, 1498 sizeof( msg ), 0, 0, NULL, NULL, bAnsi ); 1499 } 1500 1501 return hr; 1454 1502 } 1455 1503 … … 1947 1995 1948 1996 FIXME( ": not checking for conditions\n" ); 1997 1998 /* Not sure if this should be pruning but it's convenient */ 1999 NS_PruneSessionCache( lpNSInfo ); 1949 2000 1950 2001 NS_ResetSessionEnumeration( lpNSInfo ); … … 2675 2726 if( dwFlags & DPOPEN_JOIN ) 2676 2727 { 2677 DPID dpidServerId = DPID_ SERVERPLAYER;2728 DPID dpidServerId = DPID_UNKNOWN; 2678 2729 2679 2730 /* Create the server player for this interface. This way we can receive … … 2697 2748 } 2698 2749 2750 if( FAILED(hr) ) 2751 { 2752 ERR( "Couldn't create name server/system player: %s\n", 2753 DPLAYX_HresultToString(hr) ); 2754 } 2755 2699 2756 return hr; 2700 2757 } … … 3406 3463 } 3407 3464 3408 if( (LPVOID)lpEnumCallback==NULL || *(int*)lpEnumCallback==NULL)3465 if( lpEnumCallback==NULL || *(DWORD*)lpEnumCallback==0 ) 3409 3466 { 3410 3467 return DPERR_INVALIDPARAMS; … … 3460 3517 } 3461 3518 3462 if( RegQueryValueExA( hkServiceProvider, guidDataSubKey,3519 if( RegQueryValueExA( hkServiceProvider, (LPSTR)guidDataSubKey, 3463 3520 NULL, &returnTypeGUID, (LPBYTE)returnBuffer, 3464 3521 &sizeOfReturnBuffer ) != ERROR_SUCCESS ) … … 3469 3526 3470 3527 /* FIXME: Check return types to ensure we're interpreting data right */ 3471 lpWGUIDString = HEAP_strdupAtoW( GetProcessHeap(), 0, (LPCSTR)returnBuffer );3528 lpWGUIDString = HEAP_strdupAtoW( GetProcessHeap(), 0, returnBuffer ); 3472 3529 CLSIDFromString( (LPCOLESTR)lpWGUIDString, &serviceProviderGUID ); 3473 3530 HeapFree( GetProcessHeap(), 0, lpWGUIDString ); … … 3566 3623 } 3567 3624 3568 if( RegQueryValueExA( hkServiceProvider, guidDataSubKey,3625 if( RegQueryValueExA( hkServiceProvider, (LPSTR)guidDataSubKey, 3569 3626 NULL, &returnTypeGUID, (LPBYTE)returnBuffer, 3570 3627 &sizeOfReturnBuffer ) != ERROR_SUCCESS ) … … 3910 3967 * The rest will be done in DP_LoadSP 3911 3968 */ 3912 This->dp2->spData.lpAddress = ( LPDPADDRESS)lpConnection;3969 This->dp2->spData.lpAddress = (DPADDRESS*)lpConnection; 3913 3970 This->dp2->spData.dwAddressSize = dwAddrSize; 3914 3971 This->dp2->spData.lpGuid = &guidSP;
Note:
See TracChangeset
for help on using the changeset viewer.