static DWORD VmAfdCliGetLDU( PVM_AFD_CLI_CONTEXT pContext ) { DWORD dwError = 0; if (!pContext) { dwError = ERROR_INVALID_PARAMETER; BAIL_ON_VMAFD_ERROR(dwError); } dwError = VmAfdGetLDUA( pContext->pszServerName, &pContext->pszLDU); BAIL_ON_VMAFD_ERROR(dwError); printf("%s\n", pContext->pszLDU); cleanup: return dwError; error: goto cleanup; }
std::string client::GetLDU() { PSTR pszDomainName = NULL; DWORD dwError = 0; std::string result; dwError = VmAfdGetLDUA(ServerName.c_str(), &pszDomainName); BAIL_ON_ERROR(dwError); result.assign(pszDomainName); error: if (pszDomainName != NULL) { VmAfdFreeString(pszDomainName); } THROW_IF_NEEDED(dwError); return result; }