Changeset 5311 for trunk/src/DPlayX/dplobby.cpp
- Timestamp:
- Mar 14, 2001, 12:13:28 AM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/DPlayX/dplobby.cpp
r4446 r5311 1 // $Id: dplobby.cpp,v 1. 3 2000-10-06 19:49:05hugh Exp $1 // $Id: dplobby.cpp,v 1.4 2001-03-13 23:13:27 hugh Exp $ 2 2 /* Direct Play Lobby 2 & 3 Implementation 3 3 * … … 16 16 #include "winnt.h" 17 17 #include "winreg.h" 18 #include "winnls.h" 18 19 #include "heap.h" 19 20 #include "heapstring.h" … … 26 27 #include "dplayx_queue.h" 27 28 28 DEFAULT_DEBUG_CHANNEL(dplay) 29 DEFAULT_DEBUG_CHANNEL(dplay); 29 30 30 31 #undef debugstr_guid … … 363 364 364 365 CopyMemory( *ppvObj, iface, sizeof( IDirectPlayLobbyWImpl ) ); 365 (*(IDirectPlayLobby WImpl**)ppvObj)->ulInterfaceRef = 0;366 (*(IDirectPlayLobbyAImpl**)ppvObj)->ulInterfaceRef = 0; 366 367 367 368 if( IsEqualGUID( &IID_IDirectPlayLobby, riid ) ) … … 767 768 char atSubKey[51]; 768 769 char returnBuffer[51]; 769 LPWSTR lpWGUIDString;770 WCHAR buff[51]; 770 771 DWORD dwAtIndex; 771 772 LPSTR atKey = "Address Types"; … … 793 794 794 795 /* FIXME: Check return types to ensure we're interpreting data right */ 795 lpWGUIDString = HEAP_strdupAtoW( GetProcessHeap(), 0, returnBuffer ); 796 CLSIDFromString( (LPCOLESTR)lpWGUIDString, &serviceProviderGUID ); 797 HeapFree( GetProcessHeap(), 0, lpWGUIDString ); 796 MultiByteToWideChar( CP_ACP, 0, returnBuffer, -1, buff, sizeof(buff)/sizeof(WCHAR) ); 797 CLSIDFromString( (LPCOLESTR)buff, &serviceProviderGUID ); 798 798 /* FIXME: Have I got a memory leak on the serviceProviderGUID? */ 799 799 … … 821 821 822 822 /* FIXME: Check return types to ensure we're interpreting data right */ 823 lpWGUIDString = HEAP_strdupAtoW( GetProcessHeap(), 0, atSubKey ); 824 CLSIDFromString( (LPCOLESTR)lpWGUIDString, &serviceProviderGUID ); 825 HeapFree( GetProcessHeap(), 0, lpWGUIDString ); 823 MultiByteToWideChar( CP_ACP, 0, atSubKey, -1, buff, sizeof(buff)/sizeof(WCHAR) ); 824 CLSIDFromString( (LPCOLESTR)buff, &serviceProviderGUID ); 826 825 /* FIXME: Have I got a memory leak on the serviceProviderGUID? */ 827 826 … … 918 917 DWORD returnTypeGUID, sizeOfReturnBuffer = 50; 919 918 char returnBuffer[51]; 920 LPWSTR lpWGUIDString;919 WCHAR buff[51]; 921 920 DPLAPPINFO dplAppInfo; 922 921 … … 940 939 941 940 /* FIXME: Check return types to ensure we're interpreting data right */ 942 lpWGUIDString = HEAP_strdupAtoW( GetProcessHeap(), 0, returnBuffer ); 943 CLSIDFromString( (LPCOLESTR)lpWGUIDString, &serviceProviderGUID ); 944 HeapFree( GetProcessHeap(), 0, lpWGUIDString ); 941 MultiByteToWideChar( CP_ACP, 0, returnBuffer, -1, buff, sizeof(buff)/sizeof(WCHAR) ); 942 CLSIDFromString( (LPCOLESTR)buff, &serviceProviderGUID ); 945 943 /* FIXME: Have I got a memory leak on the serviceProviderGUID? */ 946 944 947 945 dplAppInfo.dwSize = sizeof( dplAppInfo ); 948 946 dplAppInfo.guidApplication = serviceProviderGUID; 949 dplAppInfo. appName.lpszAppNameA = subKeyName;947 dplAppInfo.u.lpszAppNameA = subKeyName; 950 948 951 949 EnterCriticalSection( &This->unk->DPL_lock ); … … 1096 1094 else 1097 1095 { 1098 lpData->lpszCommandLine = HEAP_strdupA( GetProcessHeap(), HEAP_ZERO_MEMORY, returnBuffer ); 1096 if ((lpData->lpszCommandLine = (LPSTR)HeapAlloc( GetProcessHeap(), 0, strlen(returnBuffer)+1 ))) 1097 strcpy( lpData->lpszCommandLine, returnBuffer ); 1099 1098 } 1100 1099 … … 1109 1108 else 1110 1109 { 1111 lpData->lpszCurrentDirectory = HEAP_strdupA( GetProcessHeap(), HEAP_ZERO_MEMORY, returnBuffer ); 1110 if ((lpData->lpszCurrentDirectory = (LPSTR)HeapAlloc( GetProcessHeap(), 0, strlen(returnBuffer)+1 ))) 1111 strcpy( lpData->lpszCurrentDirectory, returnBuffer ); 1112 1112 } 1113 1113 … … 1122 1122 else 1123 1123 { 1124 lpData->lpszFileName = HEAP_strdupA( GetProcessHeap(), HEAP_ZERO_MEMORY, returnBuffer ); 1124 if ((lpData->lpszFileName = (LPSTR)HeapAlloc( GetProcessHeap(), 0, strlen(returnBuffer)+1 ))) 1125 strcpy( lpData->lpszFileName, returnBuffer ); 1125 1126 } 1126 1127 … … 1135 1136 else 1136 1137 { 1137 lpData->lpszPath = HEAP_strdupA( GetProcessHeap(), HEAP_ZERO_MEMORY, returnBuffer ); 1138 if ((lpData->lpszPath = (LPSTR)HeapAlloc( GetProcessHeap(), 0, strlen(returnBuffer)+1 ))) 1139 strcpy( lpData->lpszPath, returnBuffer ); 1138 1140 } 1139 1141 … … 1149 1151 { 1150 1152 /* These are the handles for the created process */ 1151 HANDLE hAppStart, hAppDeath, hAppRead, hTemp; ;1153 HANDLE hAppStart, hAppDeath, hAppRead, hTemp; 1152 1154 SECURITY_ATTRIBUTES s_attrib; 1153 1155 … … 1245 1247 HeapFree( GetProcessHeap(), 0, enumData.lpszPath ); 1246 1248 HeapFree( GetProcessHeap(), 0, enumData.lpszFileName ); 1247 appName = HEAP_strdupA( GetProcessHeap(), HEAP_ZERO_MEMORY, temp );1249 if ((appName = (LPSTR)HeapAlloc( GetProcessHeap(), 0, strlen(temp)+1 ))) strcpy( appName, temp ); 1248 1250 1249 1251 /* Now the command line */ … … 1251 1253 strcat( temp, enumData.lpszCommandLine ); 1252 1254 HeapFree( GetProcessHeap(), 0, enumData.lpszCommandLine ); 1253 enumData.lpszCommandLine = HEAP_strdupA( GetProcessHeap(), HEAP_ZERO_MEMORY, temp ); 1255 if ((enumData.lpszCommandLine = (LPSTR)HeapAlloc( GetProcessHeap(), 0, strlen(temp)+1 ))) 1256 strcpy( enumData.lpszCommandLine, temp ); 1254 1257 1255 1258 ZeroMemory( &startupInfo, sizeof( startupInfo ) );
Note:
See TracChangeset
for help on using the changeset viewer.