Changeset 5311 for trunk/src/DPlayX/dplayx_global.cpp
- Timestamp:
- Mar 14, 2001, 12:13:28 AM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/DPlayX/dplayx_global.cpp
r4446 r5311 1 // $Id: dplayx_global.cpp,v 1. 3 2000-10-06 19:49:05hugh Exp $1 // $Id: dplayx_global.cpp,v 1.4 2001-03-13 23:13:27 hugh Exp $ 2 2 /* dplayx.dll global data implementation. 3 3 * … … 659 659 660 660 /* Session names may or may not exist */ 661 if( src->lpSessionDesc-> sess.lpszSessionNameA )662 { 663 strcpy( (LPSTR)lpStartOfFreeSpace, src->lpSessionDesc-> sess.lpszSessionNameA );664 dest->lpSessionDesc-> sess.lpszSessionNameA = (LPSTR)lpStartOfFreeSpace;661 if( src->lpSessionDesc->u1.lpszSessionNameA ) 662 { 663 strcpy( (LPSTR)lpStartOfFreeSpace, src->lpSessionDesc->u1.lpszSessionNameA ); 664 dest->lpSessionDesc->u1.lpszSessionNameA = (LPSTR)lpStartOfFreeSpace; 665 665 lpStartOfFreeSpace += 666 strlen( (LPSTR)dest->lpSessionDesc-> sess.lpszSessionNameA ) + 1;667 } 668 669 if( src->lpSessionDesc-> pass.lpszPasswordA )670 { 671 strcpy( (LPSTR)lpStartOfFreeSpace, src->lpSessionDesc-> pass.lpszPasswordA );672 dest->lpSessionDesc-> pass.lpszPasswordA = (LPSTR)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; 673 673 lpStartOfFreeSpace += 674 strlen( (LPSTR)dest->lpSessionDesc-> pass.lpszPasswordA ) + 1;674 strlen( (LPSTR)dest->lpSessionDesc->u2.lpszPasswordA ) + 1; 675 675 } 676 676 } … … 683 683 CopyMemory( dest->lpPlayerName, src->lpPlayerName, sizeof( DPNAME ) ); 684 684 685 if( src->lpPlayerName-> psn.lpszShortNameA )686 { 687 strcpy( (LPSTR)lpStartOfFreeSpace, src->lpPlayerName-> psn.lpszShortNameA );688 dest->lpPlayerName-> psn.lpszShortNameA = (LPSTR)lpStartOfFreeSpace;685 if( src->lpPlayerName->u1.lpszShortNameA ) 686 { 687 strcpy( (LPSTR)lpStartOfFreeSpace, src->lpPlayerName->u1.lpszShortNameA ); 688 dest->lpPlayerName->u1.lpszShortNameA = (LPSTR)lpStartOfFreeSpace; 689 689 lpStartOfFreeSpace += 690 strlen( (LPSTR)dest->lpPlayerName-> psn.lpszShortNameA ) + 1;691 } 692 693 if( src->lpPlayerName-> pln.lpszLongNameA )694 { 695 strcpy( (LPSTR)lpStartOfFreeSpace, src->lpPlayerName-> pln.lpszLongNameA );696 dest->lpPlayerName-> pln.lpszLongNameA = (LPSTR)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; 697 697 lpStartOfFreeSpace += 698 strlen( (LPSTR)dest->lpPlayerName-> pln.lpszLongName ) + 1 ;698 strlen( (LPSTR)dest->lpPlayerName->u2.lpszLongName ) + 1 ; 699 699 } 700 700 … … 781 781 782 782 /* Session names may or may not exist */ 783 if( src->lpSessionDesc-> sess.lpszSessionName )784 { 785 strcpyW( (LPWSTR)lpStartOfFreeSpace, dest->lpSessionDesc-> sess.lpszSessionName );786 src->lpSessionDesc-> sess.lpszSessionName = (LPWSTR)lpStartOfFreeSpace;783 if( src->lpSessionDesc->u1.lpszSessionName ) 784 { 785 strcpyW( (LPWSTR)lpStartOfFreeSpace, dest->lpSessionDesc->u1.lpszSessionName ); 786 src->lpSessionDesc->u1.lpszSessionName = (LPWSTR)lpStartOfFreeSpace; 787 787 lpStartOfFreeSpace += sizeof(WCHAR) * 788 ( strlenW( (LPWSTR)dest->lpSessionDesc-> sess.lpszSessionName ) + 1 );789 } 790 791 if( src->lpSessionDesc-> pass.lpszPassword )792 { 793 strcpyW( (LPWSTR)lpStartOfFreeSpace, src->lpSessionDesc-> pass.lpszPassword );794 dest->lpSessionDesc-> pass.lpszPassword = (LPWSTR)lpStartOfFreeSpace;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; 795 795 lpStartOfFreeSpace += sizeof(WCHAR) * 796 ( strlenW( (LPWSTR)dest->lpSessionDesc-> pass.lpszPassword ) + 1 );796 ( strlenW( (LPWSTR)dest->lpSessionDesc->u2.lpszPassword ) + 1 ); 797 797 } 798 798 } … … 805 805 CopyMemory( dest->lpPlayerName, src->lpPlayerName, sizeof( DPNAME ) ); 806 806 807 if( src->lpPlayerName-> psn.lpszShortName )808 { 809 strcpyW( (LPWSTR)lpStartOfFreeSpace, src->lpPlayerName-> psn.lpszShortName );810 dest->lpPlayerName-> psn.lpszShortName = (LPWSTR)lpStartOfFreeSpace;807 if( src->lpPlayerName->u1.lpszShortName ) 808 { 809 strcpyW( (LPWSTR)lpStartOfFreeSpace, src->lpPlayerName->u1.lpszShortName ); 810 dest->lpPlayerName->u1.lpszShortName = (LPWSTR)lpStartOfFreeSpace; 811 811 lpStartOfFreeSpace += sizeof(WCHAR) * 812 ( strlenW( (LPWSTR)dest->lpPlayerName-> psn.lpszShortName ) + 1 );813 } 814 815 if( src->lpPlayerName-> pln.lpszLongName )816 { 817 strcpyW( (LPWSTR)lpStartOfFreeSpace, src->lpPlayerName-> pln.lpszLongName );818 dest->lpPlayerName-> pln.lpszLongName = (LPWSTR)lpStartOfFreeSpace;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; 819 819 lpStartOfFreeSpace += sizeof(WCHAR) * 820 ( strlenW( (LPWSTR)dest->lpPlayerName-> pln.lpszLongName ) + 1 );820 ( strlenW( (LPWSTR)dest->lpPlayerName->u2.lpszLongName ) + 1 ); 821 821 } 822 822 … … 964 964 dwTotalSize += sizeof( DPSESSIONDESC2 ); 965 965 966 if( lpConn->lpSessionDesc-> sess.lpszSessionNameA )967 { 968 dwTotalSize += strlen( lpConn->lpSessionDesc-> sess.lpszSessionNameA ) + 1;969 } 970 971 if( lpConn->lpSessionDesc-> pass.lpszPasswordA )972 { 973 dwTotalSize += strlen( lpConn->lpSessionDesc-> pass.lpszPasswordA ) + 1;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; 974 974 } 975 975 } … … 979 979 dwTotalSize += sizeof( DPNAME ); 980 980 981 if( lpConn->lpPlayerName-> psn.lpszShortNameA )982 { 983 dwTotalSize += strlen( lpConn->lpPlayerName-> psn.lpszShortNameA ) + 1;984 } 985 986 if( lpConn->lpPlayerName-> pln.lpszLongNameA )987 { 988 dwTotalSize += strlen( lpConn->lpPlayerName-> pln.lpszLongNameA ) + 1;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; 989 989 } 990 990 … … 1011 1011 dwTotalSize += sizeof( DPSESSIONDESC2 ); 1012 1012 1013 if( lpConn->lpSessionDesc-> sess.lpszSessionName )1013 if( lpConn->lpSessionDesc->u1.lpszSessionName ) 1014 1014 { 1015 1015 dwTotalSize += sizeof( WCHAR ) * 1016 ( strlenW( lpConn->lpSessionDesc-> sess.lpszSessionName ) + 1 );1017 } 1018 1019 if( lpConn->lpSessionDesc-> pass.lpszPassword )1016 ( strlenW( lpConn->lpSessionDesc->u1.lpszSessionName ) + 1 ); 1017 } 1018 1019 if( lpConn->lpSessionDesc->u2.lpszPassword ) 1020 1020 { 1021 1021 dwTotalSize += sizeof( WCHAR ) * 1022 ( strlenW( lpConn->lpSessionDesc-> pass.lpszPassword ) + 1 );1022 ( strlenW( lpConn->lpSessionDesc->u2.lpszPassword ) + 1 ); 1023 1023 } 1024 1024 } … … 1028 1028 dwTotalSize += sizeof( DPNAME ); 1029 1029 1030 if( lpConn->lpPlayerName-> psn.lpszShortName )1030 if( lpConn->lpPlayerName->u1.lpszShortName ) 1031 1031 { 1032 1032 dwTotalSize += sizeof( WCHAR ) * 1033 ( strlenW( lpConn->lpPlayerName-> psn.lpszShortName ) + 1 );1034 } 1035 1036 if( lpConn->lpPlayerName-> pln.lpszLongName )1033 ( strlenW( lpConn->lpPlayerName->u1.lpszShortName ) + 1 ); 1034 } 1035 1036 if( lpConn->lpPlayerName->u2.lpszLongName ) 1037 1037 { 1038 1038 dwTotalSize += sizeof( WCHAR ) * 1039 ( strlenW( lpConn->lpPlayerName-> pln.lpszLongName ) + 1 );1039 ( strlenW( lpConn->lpPlayerName->u2.lpszLongName ) + 1 ); 1040 1040 } 1041 1041 … … 1065 1065 CopyMemory( lpSessionDest, lpSessionSrc, sizeof( *lpSessionSrc ) ); 1066 1066 1067 if( lpSessionSrc-> sess.lpszSessionNameA )1068 { 1069 lpSessionDest->sess.lpszSessionNameA =1070 HEAP_strdupA( GetProcessHeap(),1071 HEAP_ZERO_MEMORY, lpSessionSrc->sess.lpszSessionNameA );1072 } 1073 if( lpSessionSrc-> pass.lpszPasswordA )1074 { 1075 lpSessionDest->pass.lpszPasswordA =1076 HEAP_strdupA( GetProcessHeap(),1077 HEAP_ZERO_MEMORY, lpSessionSrc->pass.lpszPasswordA );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 ); 1078 1078 } 1079 1079
Note:
See TracChangeset
for help on using the changeset viewer.