Example #1
0
static
DWORD
VmAfdCliGetLSLocation(
    PVM_AFD_CLI_CONTEXT pContext
    )
{
    DWORD dwError = 0;
    PSTR pszLSLocation = NULL;

    if (!pContext)
    {
        dwError = ERROR_INVALID_PARAMETER;
        BAIL_ON_VMAFD_ERROR(dwError);
    }

    dwError = VmAfdGetLSLocationA(
                    pContext->pszServerName,
                    &pszLSLocation);
    BAIL_ON_VMAFD_ERROR(dwError);

    printf("%s\n", pszLSLocation);

cleanup:

    VMAFD_SAFE_FREE_STRINGA(pszLSLocation);

    return dwError;

error:

    goto cleanup;
}
Example #2
0
std::string client::GetLSLocation()
{
    PSTR pszLSLocation= NULL;
    DWORD dwError = 0;
    std::string result;

    dwError = VmAfdGetLSLocationA(ServerName.c_str(), &pszLSLocation);
    BAIL_ON_ERROR(dwError);

    result.assign(pszLSLocation);

error:
    if (pszLSLocation != NULL)
    {
        VmAfdFreeString(pszLSLocation);
    }
    THROW_IF_NEEDED(dwError);
    return result;
}