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

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

    dwError = VmAfdGetPNIDA(
                    pContext->pszServerName,
                    &pContext->pszPNID);
    BAIL_ON_VMAFD_ERROR(dwError);

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

cleanup:

    return dwError;

error:

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

    dwError = VmAfdGetPNIDA(ServerName.c_str(), &pszPNID);
    BAIL_ON_ERROR(dwError);

    result.assign(pszPNID);

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