コード例 #1
0
ファイル: wchar.c プロジェクト: ArildF/masters
__cdecl
PAL_wcscat(
        wchar_16 *strDestination, 
        const wchar_16 *strSource)
{
    wchar_16 *ret;
    ENTRY("wcscat (strDestination=%p (%S), strSource=%p (%S))\n", 
          strDestination?strDestination:W16_NULLSTRING, 
          strDestination?strDestination:W16_NULLSTRING, strSource?strSource:W16_NULLSTRING, strSource?strSource:W16_NULLSTRING);

    ret = PAL_wcsncat( strDestination, strSource, PAL_wcslen( strSource ) );
    
    LOGEXIT("wcscat returnng wchar_t %p (%S)\n", ret, ret);
    return ret;
}
コード例 #2
0
ファイル: fmtmessage.cpp プロジェクト: Dykam/coreclr
/*++
Function :

    FMTMSG_FormatMessageInit
    
    Loads the dynamic library, resolves symbols.
    
    Loads the satellite file into memory.
--*/
static HSATELLITE FMTMSG_FormatMessageInit( void )
{
    static const WCHAR ROTORPALSATFILE[] = {
        'p','a','l','.','s','a','t','e','l','l','i','t','e', '\0'
    };
    
    WCHAR SatPathAndFile[ MAX_PATH ];

    HSATELLITE hSatellite;

    LPVOID lpLibRotorPalRt;

    TRACE( "Initilizing the dynamic library and the satellite files.\n" );

    lpLibRotorPalRt = s_lpLibRotorPalRt;

    if ( !lpLibRotorPalRt )
    {
        lpLibRotorPalRt = FMTMSG_LoadLibrary( );
        if ( !lpLibRotorPalRt )
        {
            ERROR( "Unable to load the shared library. Reason %s.\n", dlerror() );
            goto error;
        }
    }

    /* Get the symbols. */
    LoadSatelliteResource = reinterpret_cast<FnLoadSatelliteResource>(
        dlsym( lpLibRotorPalRt, "PAL_LoadSatelliteResourceW" ));
    FreeSatelliteResource = reinterpret_cast<FnFreeSatelliteResource>(
        dlsym( lpLibRotorPalRt, "PAL_FreeSatelliteResource" ));
    LoadSatelliteStringW = reinterpret_cast<FnLoadSatelliteStringW>(
        dlsym( lpLibRotorPalRt, "PAL_LoadSatelliteStringW" ));

    if ( !LoadSatelliteResource || !FreeSatelliteResource || 
            !LoadSatelliteStringW )
    {
        ERROR( "Unable to load the shared library symbols. "
                "Reason %s.\n", dlerror() );
        goto error;
    }

    /* Load the satellite file. */
    if ( !PAL_GetPALDirectoryW( SatPathAndFile, MAX_PATH ) )
    {
        ERROR( "Unable to retrieve the path.\n" );
        goto error;
    }
   
    PAL_wcsncat( SatPathAndFile, ROTORPALSATFILE, MAX_PATH );
    hSatellite = ((*LoadSatelliteResource)( SatPathAndFile ));

    if ( !hSatellite )
    {
        ERROR( "Unable to load the satellite file\n" );
        goto error;
    }

    if ( InterlockedCompareExchangePointer(&s_hSatellite, hSatellite, NULL) != NULL )
    {
        /* somebody beat us to it */
        (*FreeSatelliteResource)(hSatellite);
    }

error:
    return s_hSatellite;
}