Ignore:
Timestamp:
Apr 16, 2001, 7:25:26 PM (24 years ago)
Author:
sandervl
Message:

compile fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/DPlayX/dplayx_global.cpp

    r5311 r5526  
    1 // $Id: dplayx_global.cpp,v 1.4 2001-03-13 23:13:27 hugh Exp $
     1// $Id: dplayx_global.cpp,v 1.5 2001-04-16 17:25:21 sandervl Exp $
    22/* dplayx.dll global data implementation.
    33 *
     
    659659
    660660    /* Session names may or may not exist */
    661     if( src->lpSessionDesc->u1.lpszSessionNameA )
    662     {
    663       strcpy( (LPSTR)lpStartOfFreeSpace, src->lpSessionDesc->u1.lpszSessionNameA );
    664       dest->lpSessionDesc->u1.lpszSessionNameA = (LPSTR)lpStartOfFreeSpace;
     661    if( src->lpSessionDesc->lpszSessionNameA )
     662    {
     663      strcpy( (LPSTR)lpStartOfFreeSpace, src->lpSessionDesc->lpszSessionNameA );
     664      dest->lpSessionDesc->lpszSessionNameA = (LPSTR)lpStartOfFreeSpace;
    665665      lpStartOfFreeSpace +=
    666         strlen( (LPSTR)dest->lpSessionDesc->u1.lpszSessionNameA ) + 1;
    667     }
    668 
    669     if( src->lpSessionDesc->u2.lpszPasswordA )
    670     {
    671       strcpy( (LPSTR)lpStartOfFreeSpace, src->lpSessionDesc->u2.lpszPasswordA );
    672       dest->lpSessionDesc->u2.lpszPasswordA = (LPSTR)lpStartOfFreeSpace;
     666        strlen( (LPSTR)dest->lpSessionDesc->lpszSessionNameA ) + 1;
     667    }
     668
     669    if( src->lpSessionDesc->lpszPasswordA )
     670    {
     671      strcpy( (LPSTR)lpStartOfFreeSpace, src->lpSessionDesc->lpszPasswordA );
     672      dest->lpSessionDesc->lpszPasswordA = (LPSTR)lpStartOfFreeSpace;
    673673      lpStartOfFreeSpace +=
    674         strlen( (LPSTR)dest->lpSessionDesc->u2.lpszPasswordA ) + 1;
     674        strlen( (LPSTR)dest->lpSessionDesc->lpszPasswordA ) + 1;
    675675    }
    676676  }
     
    683683    CopyMemory( dest->lpPlayerName, src->lpPlayerName, sizeof( DPNAME ) );
    684684
    685     if( src->lpPlayerName->u1.lpszShortNameA )
    686     {
    687       strcpy( (LPSTR)lpStartOfFreeSpace, src->lpPlayerName->u1.lpszShortNameA );
    688       dest->lpPlayerName->u1.lpszShortNameA = (LPSTR)lpStartOfFreeSpace;
     685    if( src->lpPlayerName->lpszShortNameA )
     686    {
     687      strcpy( (LPSTR)lpStartOfFreeSpace, src->lpPlayerName->lpszShortNameA );
     688      dest->lpPlayerName->lpszShortNameA = (LPSTR)lpStartOfFreeSpace;
    689689      lpStartOfFreeSpace +=
    690         strlen( (LPSTR)dest->lpPlayerName->u1.lpszShortNameA ) + 1;
    691     }
    692 
    693     if( src->lpPlayerName->u2.lpszLongNameA )
    694     {
    695       strcpy( (LPSTR)lpStartOfFreeSpace, src->lpPlayerName->u2.lpszLongNameA );
    696       dest->lpPlayerName->u2.lpszLongNameA = (LPSTR)lpStartOfFreeSpace;
     690        strlen( (LPSTR)dest->lpPlayerName->lpszShortNameA ) + 1;
     691    }
     692
     693    if( src->lpPlayerName->lpszLongNameA )
     694    {
     695      strcpy( (LPSTR)lpStartOfFreeSpace, src->lpPlayerName->lpszLongNameA );
     696      dest->lpPlayerName->lpszLongNameA = (LPSTR)lpStartOfFreeSpace;
    697697      lpStartOfFreeSpace +=
    698         strlen( (LPSTR)dest->lpPlayerName->u2.lpszLongName ) + 1 ;
     698        strlen( (LPSTR)dest->lpPlayerName->lpszLongName ) + 1 ;
    699699    }
    700700
     
    781781
    782782    /* Session names may or may not exist */
    783     if( src->lpSessionDesc->u1.lpszSessionName )
    784     {
    785       strcpyW( (LPWSTR)lpStartOfFreeSpace, dest->lpSessionDesc->u1.lpszSessionName );
    786       src->lpSessionDesc->u1.lpszSessionName = (LPWSTR)lpStartOfFreeSpace;
     783    if( src->lpSessionDesc->lpszSessionName )
     784    {
     785      strcpyW( (LPWSTR)lpStartOfFreeSpace, dest->lpSessionDesc->lpszSessionName );
     786      src->lpSessionDesc->lpszSessionName = (LPWSTR)lpStartOfFreeSpace;
    787787      lpStartOfFreeSpace +=  sizeof(WCHAR) *
    788         ( strlenW( (LPWSTR)dest->lpSessionDesc->u1.lpszSessionName ) + 1 );
    789     }
    790 
    791     if( src->lpSessionDesc->u2.lpszPassword )
    792     {
    793       strcpyW( (LPWSTR)lpStartOfFreeSpace, src->lpSessionDesc->u2.lpszPassword );
    794       dest->lpSessionDesc->u2.lpszPassword = (LPWSTR)lpStartOfFreeSpace;
     788        ( strlenW( (LPWSTR)dest->lpSessionDesc->lpszSessionName ) + 1 );
     789    }
     790
     791    if( src->lpSessionDesc->lpszPassword )
     792    {
     793      strcpyW( (LPWSTR)lpStartOfFreeSpace, src->lpSessionDesc->lpszPassword );
     794      dest->lpSessionDesc->lpszPassword = (LPWSTR)lpStartOfFreeSpace;
    795795      lpStartOfFreeSpace +=  sizeof(WCHAR) *
    796         ( strlenW( (LPWSTR)dest->lpSessionDesc->u2.lpszPassword ) + 1 );
     796        ( strlenW( (LPWSTR)dest->lpSessionDesc->lpszPassword ) + 1 );
    797797    }
    798798  }
     
    805805    CopyMemory( dest->lpPlayerName, src->lpPlayerName, sizeof( DPNAME ) );
    806806
    807     if( src->lpPlayerName->u1.lpszShortName )
    808     {
    809       strcpyW( (LPWSTR)lpStartOfFreeSpace, src->lpPlayerName->u1.lpszShortName );
    810       dest->lpPlayerName->u1.lpszShortName = (LPWSTR)lpStartOfFreeSpace;
     807    if( src->lpPlayerName->lpszShortName )
     808    {
     809      strcpyW( (LPWSTR)lpStartOfFreeSpace, src->lpPlayerName->lpszShortName );
     810      dest->lpPlayerName->lpszShortName = (LPWSTR)lpStartOfFreeSpace;
    811811      lpStartOfFreeSpace +=  sizeof(WCHAR) *
    812         ( strlenW( (LPWSTR)dest->lpPlayerName->u1.lpszShortName ) + 1 );
    813     }
    814 
    815     if( src->lpPlayerName->u2.lpszLongName )
    816     {
    817       strcpyW( (LPWSTR)lpStartOfFreeSpace, src->lpPlayerName->u2.lpszLongName );
    818       dest->lpPlayerName->u2.lpszLongName = (LPWSTR)lpStartOfFreeSpace;
     812        ( strlenW( (LPWSTR)dest->lpPlayerName->lpszShortName ) + 1 );
     813    }
     814
     815    if( src->lpPlayerName->lpszLongName )
     816    {
     817      strcpyW( (LPWSTR)lpStartOfFreeSpace, src->lpPlayerName->lpszLongName );
     818      dest->lpPlayerName->lpszLongName = (LPWSTR)lpStartOfFreeSpace;
    819819      lpStartOfFreeSpace +=  sizeof(WCHAR) *
    820         ( strlenW( (LPWSTR)dest->lpPlayerName->u2.lpszLongName ) + 1 );
     820        ( strlenW( (LPWSTR)dest->lpPlayerName->lpszLongName ) + 1 );
    821821    }
    822822
     
    964964    dwTotalSize += sizeof( DPSESSIONDESC2 );
    965965
    966     if( lpConn->lpSessionDesc->u1.lpszSessionNameA )
    967     {
    968       dwTotalSize += strlen( lpConn->lpSessionDesc->u1.lpszSessionNameA ) + 1;
    969     }
    970 
    971     if( lpConn->lpSessionDesc->u2.lpszPasswordA )
    972     {
    973       dwTotalSize += strlen( lpConn->lpSessionDesc->u2.lpszPasswordA ) + 1;
     966    if( lpConn->lpSessionDesc->lpszSessionNameA )
     967    {
     968      dwTotalSize += strlen( lpConn->lpSessionDesc->lpszSessionNameA ) + 1;
     969    }
     970
     971    if( lpConn->lpSessionDesc->lpszPasswordA )
     972    {
     973      dwTotalSize += strlen( lpConn->lpSessionDesc->lpszPasswordA ) + 1;
    974974    }
    975975  }
     
    979979    dwTotalSize += sizeof( DPNAME );
    980980
    981     if( lpConn->lpPlayerName->u1.lpszShortNameA )
    982     {
    983       dwTotalSize += strlen( lpConn->lpPlayerName->u1.lpszShortNameA ) + 1;
    984     }
    985 
    986     if( lpConn->lpPlayerName->u2.lpszLongNameA )
    987     {
    988       dwTotalSize += strlen( lpConn->lpPlayerName->u2.lpszLongNameA ) + 1;
     981    if( lpConn->lpPlayerName->lpszShortNameA )
     982    {
     983      dwTotalSize += strlen( lpConn->lpPlayerName->lpszShortNameA ) + 1;
     984    }
     985
     986    if( lpConn->lpPlayerName->lpszLongNameA )
     987    {
     988      dwTotalSize += strlen( lpConn->lpPlayerName->lpszLongNameA ) + 1;
    989989    }
    990990
     
    10111011    dwTotalSize += sizeof( DPSESSIONDESC2 );
    10121012
    1013     if( lpConn->lpSessionDesc->u1.lpszSessionName )
     1013    if( lpConn->lpSessionDesc->lpszSessionName )
    10141014    {
    10151015      dwTotalSize += sizeof( WCHAR ) *
    1016         ( strlenW( lpConn->lpSessionDesc->u1.lpszSessionName ) + 1 );
    1017     }
    1018 
    1019     if( lpConn->lpSessionDesc->u2.lpszPassword )
     1016        ( strlenW( lpConn->lpSessionDesc->lpszSessionName ) + 1 );
     1017    }
     1018
     1019    if( lpConn->lpSessionDesc->lpszPassword )
    10201020    {
    10211021      dwTotalSize += sizeof( WCHAR ) *
    1022         ( strlenW( lpConn->lpSessionDesc->u2.lpszPassword ) + 1 );
     1022        ( strlenW( lpConn->lpSessionDesc->lpszPassword ) + 1 );
    10231023    }
    10241024  }
     
    10281028    dwTotalSize += sizeof( DPNAME );
    10291029
    1030     if( lpConn->lpPlayerName->u1.lpszShortName )
     1030    if( lpConn->lpPlayerName->lpszShortName )
    10311031    {
    10321032      dwTotalSize += sizeof( WCHAR ) *
    1033         ( strlenW( lpConn->lpPlayerName->u1.lpszShortName ) + 1 );
    1034     }
    1035 
    1036     if( lpConn->lpPlayerName->u2.lpszLongName )
     1033        ( strlenW( lpConn->lpPlayerName->lpszShortName ) + 1 );
     1034    }
     1035
     1036    if( lpConn->lpPlayerName->lpszLongName )
    10371037    {
    10381038      dwTotalSize += sizeof( WCHAR ) *
    1039         ( strlenW( lpConn->lpPlayerName->u2.lpszLongName ) + 1 );
     1039        ( strlenW( lpConn->lpPlayerName->lpszLongName ) + 1 );
    10401040    }
    10411041
     
    10651065  CopyMemory( lpSessionDest, lpSessionSrc, sizeof( *lpSessionSrc ) );
    10661066
    1067   if( lpSessionSrc->u1.lpszSessionNameA )
    1068   {
    1069       if ((lpSessionDest->u1.lpszSessionNameA = (LPSTR)HeapAlloc( GetProcessHeap(), 0,
    1070                                                              strlen(lpSessionSrc->u1.lpszSessionNameA)+1 )))
    1071           strcpy( lpSessionDest->u1.lpszSessionNameA, lpSessionSrc->u1.lpszSessionNameA );
    1072   }
    1073   if( lpSessionSrc->u2.lpszPasswordA )
    1074   {
    1075       if ((lpSessionDest->u2.lpszPasswordA = (LPSTR)HeapAlloc( GetProcessHeap(), 0,
    1076                                                           strlen(lpSessionSrc->u2.lpszPasswordA)+1 )))
    1077           strcpy( lpSessionDest->u2.lpszPasswordA, lpSessionSrc->u2.lpszPasswordA );
     1067  if( lpSessionSrc->lpszSessionNameA )
     1068  {
     1069      if ((lpSessionDest->lpszSessionNameA = (LPSTR)HeapAlloc( GetProcessHeap(), 0,
     1070                                                             strlen(lpSessionSrc->lpszSessionNameA)+1 )))
     1071          strcpy( lpSessionDest->lpszSessionNameA, lpSessionSrc->lpszSessionNameA );
     1072  }
     1073  if( lpSessionSrc->lpszPasswordA )
     1074  {
     1075      if ((lpSessionDest->lpszPasswordA = (LPSTR)HeapAlloc( GetProcessHeap(), 0,
     1076                                                          strlen(lpSessionSrc->lpszPasswordA)+1 )))
     1077          strcpy( lpSessionDest->lpszPasswordA, lpSessionSrc->lpszPasswordA );
    10781078  }
    10791079
Note: See TracChangeset for help on using the changeset viewer.