Exemplo n.º 1
0
static
DWORD
VmAfdCliGetSiteName(
    PVM_AFD_CLI_CONTEXT pContext
    )
{
    DWORD dwError = 0;

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

    dwError = VmAfdGetSiteNameA(
                    pContext->pszServerName,
                    &pContext->pszSiteName);
    BAIL_ON_VMAFD_ERROR(dwError);

    printf("%s\n", pContext->pszSiteName);

cleanup:

    return dwError;

error:

    goto cleanup;
}
Exemplo n.º 2
0
std::string client::GetSiteName()
{
    PSTR pszSiteName = NULL;
    DWORD dwError = 0;
    std::string result;

    dwError = VmAfdGetSiteNameA(
                  ServerName.c_str(),
                  &pszSiteName);

    BAIL_ON_ERROR(dwError);

    result.assign(pszSiteName);

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