Ignore:
Timestamp:
Mar 14, 2001, 12:13:28 AM (24 years ago)
Author:
hugh
Message:

Synced with WINE

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:05 hugh Exp $
     1// $Id: dplobby.cpp,v 1.4 2001-03-13 23:13:27 hugh Exp $
    22/* Direct Play Lobby 2 & 3 Implementation
    33 *
     
    1616#include "winnt.h"
    1717#include "winreg.h"
     18#include "winnls.h"
    1819#include "heap.h"
    1920#include "heapstring.h"
     
    2627#include "dplayx_queue.h"
    2728
    28 DEFAULT_DEBUG_CHANNEL(dplay)
     29DEFAULT_DEBUG_CHANNEL(dplay);
    2930
    3031#undef  debugstr_guid
     
    363364
    364365  CopyMemory( *ppvObj, iface, sizeof( IDirectPlayLobbyWImpl )  );
    365   (*(IDirectPlayLobbyWImpl**)ppvObj)->ulInterfaceRef = 0;
     366  (*(IDirectPlayLobbyAImpl**)ppvObj)->ulInterfaceRef = 0;
    366367
    367368  if( IsEqualGUID( &IID_IDirectPlayLobby, riid ) )
     
    767768      char     atSubKey[51];
    768769      char     returnBuffer[51];
    769       LPWSTR   lpWGUIDString;
     770      WCHAR    buff[51];
    770771      DWORD    dwAtIndex;
    771772      LPSTR    atKey = "Address Types";
     
    793794
    794795      /* 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 );
    798798      /* FIXME: Have I got a memory leak on the serviceProviderGUID? */
    799799
     
    821821
    822822        /* 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 );
    826825        /* FIXME: Have I got a memory leak on the serviceProviderGUID? */
    827826
     
    918917    DWORD      returnTypeGUID, sizeOfReturnBuffer = 50;
    919918    char       returnBuffer[51];
    920     LPWSTR     lpWGUIDString;
     919    WCHAR      buff[51];
    921920    DPLAPPINFO dplAppInfo;
    922921
     
    940939
    941940    /* 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 );
    945943    /* FIXME: Have I got a memory leak on the serviceProviderGUID? */
    946944
    947945    dplAppInfo.dwSize               = sizeof( dplAppInfo );
    948946    dplAppInfo.guidApplication      = serviceProviderGUID;
    949     dplAppInfo.appName.lpszAppNameA = subKeyName;
     947    dplAppInfo.u.lpszAppNameA = subKeyName;
    950948
    951949    EnterCriticalSection( &This->unk->DPL_lock );
     
    10961094    else
    10971095    {
    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 );
    10991098    }
    11001099
     
    11091108    else
    11101109    {
    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 );
    11121112    }
    11131113
     
    11221122    else
    11231123    {
    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 );
    11251126    }
    11261127
     
    11351136    else
    11361137    {
    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 );
    11381140    }
    11391141
     
    11491151{
    11501152  /* These are the handles for the created process */
    1151   HANDLE hAppStart, hAppDeath, hAppRead, hTemp;;
     1153  HANDLE hAppStart, hAppDeath, hAppRead, hTemp;
    11521154  SECURITY_ATTRIBUTES s_attrib;
    11531155
     
    12451247  HeapFree( GetProcessHeap(), 0, enumData.lpszPath );
    12461248  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 );
    12481250
    12491251  /* Now the command line */
     
    12511253  strcat( temp, enumData.lpszCommandLine );
    12521254  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 );
    12541257
    12551258  ZeroMemory( &startupInfo, sizeof( startupInfo ) );
Note: See TracChangeset for help on using the changeset viewer.