Ignore:
Timestamp:
Oct 6, 2000, 9:49:06 PM (25 years ago)
Author:
hugh
Message:

Updated to latest WINE

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:36 hugh Exp $
     1// $Id: dplay.cpp,v 1.3 2000-10-06 19:49:03 hugh Exp $
    22/* Direct Play 2,3,4 Implementation
    33 *
     
    3232DEFAULT_DEBUG_CHANNEL(dplay)
    3333
     34#undef debugstr_guid
    3435#define debugstr_guid(a) a
    3536
     
    274275  This->dp2->spData.dwSPVersion = DPSP_MAJORVERSION;
    275276
    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 ) );
    278280  This->dp2->spData.lpCB->dwSize = sizeof( *This->dp2->spData.lpCB );
    279281  This->dp2->spData.lpCB->dwVersion = DPSP_MAJORVERSION;
     
    634636         wVersion );
    635637
     638  DebugBreak();
     639
    636640  switch( wCommandId )
    637641  {
     
    650654                                                        *lpdwMsgSize );
    651655
    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
    653675
    654676      /* Setup the reply */
     
    660682      lpReply->envelope.wVersion   = DPMSGVER_DP6;
    661683
    662 #if 0
    663       /* FIXME: Need to know the proper contents of the message! */
    664684      lpReply->dpidNewPlayerId = DP_NextObjectId();
    665 #endif
     685
     686      TRACE( "Allocating new playerid 0x%08lx from remote request\n",
     687             lpReply->dpidNewPlayerId );
    666688
    667689      break;
     
    670692    case DPMSGCMD_NEWPLAYERIDREPLY:
    671693    {
    672 
    673       DebugBreak();
    674694
    675695      if( This->dp2->hMsgReceipt )
     
    684704      else
    685705      {
    686         ERR( "No receipt event set\n" );
     706        ERR( "No receipt event set - only expecting in reply mode\n" );
    687707      }
    688708
     
    13161336  BOOL bAnsi )
    13171337{
     1338  HANDLE hr = DP_OK;
    13181339  lpPlayerData lpPData;
    13191340  lpPlayerList lpPList;
     
    13531374    else
    13541375    {
    1355       HRESULT hr = DP_MSG_SendRequestPlayerId( This, dwFlags, lpidPlayer );
     1376      hr = DP_MSG_SendRequestPlayerId( This, dwFlags, lpidPlayer );
    13561377
    13571378      if( FAILED(hr) )
     
    14211442    data.lpISP             = This->dp2->spData.lpISP;
    14221443
    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;
    14241472  }
    14251473
     
    14471495    /* FIXME: Should size include data w/ message or just message "header" */
    14481496    /* 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;
    14541502}
    14551503
     
    19471995
    19481996  FIXME( ": not checking for conditions\n" );
     1997
     1998  /* Not sure if this should be pruning but it's convenient */
     1999  NS_PruneSessionCache( lpNSInfo );
    19492000
    19502001  NS_ResetSessionEnumeration( lpNSInfo );
     
    26752726  if( dwFlags & DPOPEN_JOIN )
    26762727  {
    2677     DPID dpidServerId = DPID_SERVERPLAYER;
     2728    DPID dpidServerId = DPID_UNKNOWN;
    26782729
    26792730    /* Create the server player for this interface. This way we can receive
     
    26972748  }
    26982749
     2750  if( FAILED(hr) )
     2751  {
     2752    ERR( "Couldn't create name server/system player: %s\n",
     2753         DPLAYX_HresultToString(hr) );
     2754  }
     2755
    26992756  return hr;
    27002757}
     
    34063463  }
    34073464
    3408   if( (LPVOID)lpEnumCallback==NULL || *(int*)lpEnumCallback==NULL )
     3465  if( lpEnumCallback==NULL || *(DWORD*)lpEnumCallback==0 )
    34093466  {
    34103467     return DPERR_INVALIDPARAMS;
     
    34603517      }
    34613518
    3462       if( RegQueryValueExA( hkServiceProvider, guidDataSubKey,
     3519      if( RegQueryValueExA( hkServiceProvider, (LPSTR)guidDataSubKey,
    34633520                            NULL, &returnTypeGUID, (LPBYTE)returnBuffer,
    34643521                            &sizeOfReturnBuffer ) != ERROR_SUCCESS )
     
    34693526
    34703527      /* 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 );
    34723529      CLSIDFromString( (LPCOLESTR)lpWGUIDString, &serviceProviderGUID );
    34733530      HeapFree( GetProcessHeap(), 0, lpWGUIDString );
     
    35663623      }
    35673624
    3568       if( RegQueryValueExA( hkServiceProvider, guidDataSubKey,
     3625      if( RegQueryValueExA( hkServiceProvider, (LPSTR)guidDataSubKey,
    35693626                            NULL, &returnTypeGUID, (LPBYTE)returnBuffer,
    35703627                            &sizeOfReturnBuffer ) != ERROR_SUCCESS )
     
    39103967   * The rest will be done in DP_LoadSP
    39113968   */
    3912   This->dp2->spData.lpAddress = (LPDPADDRESS)lpConnection;
     3969  This->dp2->spData.lpAddress = (DPADDRESS*)lpConnection;
    39133970  This->dp2->spData.dwAddressSize = dwAddrSize;
    39143971  This->dp2->spData.lpGuid = &guidSP;
Note: See TracChangeset for help on using the changeset viewer.