示例#1
0
DWORD VmDnsRpcCopySrvRecord(
    PVMDNS_RECORD   pSrc,
    PVMDNS_RECORD   pDest
    )
{
    DWORD dwError = 0;
    PVMDNS_SRV_DATAA pData = NULL;

    pData = &pDest->Data.SRV;

    VmDnsRpcAllocateStringA(pSrc->pszName, &pDest->pszName);
    BAIL_ON_VMDNS_ERROR(dwError);

    pDest->iClass = pSrc->iClass;
    pDest->dwTtl = pSrc->dwTtl;
    pDest->dwType = pSrc->dwType;
    pData->wPort = pSrc->Data.SRV.wPort;
    pData->wPriority = pSrc->Data.SRV.wPriority;
    pData->wWeight = pSrc->Data.SRV.wWeight;

    VmDnsRpcAllocateStringA(pSrc->Data.SRV.pNameTarget, &pData->pNameTarget);
    BAIL_ON_VMDNS_ERROR(dwError);

cleanup:
    return dwError;

error:
    VmDnsClearRecord(pDest);

    goto cleanup;
}
示例#2
0
DWORD
VmDnsRpcCopyPtrRecord(
    PVMDNS_RECORD   pSrc,
    PVMDNS_RECORD   pDest
    )
{
    DWORD dwError = 0;
    PVMDNS_PTR_DATAA pData = NULL;

    pData = &pDest->Data.PTR;

    VmDnsRpcAllocateStringA(pSrc->pszName, &pDest->pszName);
    BAIL_ON_VMDNS_ERROR(dwError);

    pDest->iClass = pSrc->iClass;
    pDest->dwTtl = pSrc->dwTtl;
    pDest->dwType = pSrc->dwType;

    VmDnsRpcAllocateStringA(pSrc->Data.PTR.pNameHost, &pData->pNameHost);
    BAIL_ON_VMDNS_ERROR(dwError);

cleanup:
    return dwError;

error:
    VmDnsRpcClearPtrRecord(pDest);

    goto cleanup;
}
示例#3
0
DWORD
VmDnsRpcCopyZoneInfo(
    PVMDNS_ZONE_INFO pZoneInfoSrc,
    PVMDNS_ZONE_INFO pZoneInfoDest
    )
{
    DWORD dwError = ERROR_SUCCESS;

    BAIL_ON_VMDNS_INVALID_POINTER(pZoneInfoSrc, dwError);
    BAIL_ON_VMDNS_INVALID_POINTER(pZoneInfoDest, dwError);

    dwError = VmDnsRpcAllocateStringA(pZoneInfoSrc->pszName,
                                    &pZoneInfoDest->pszName);
    BAIL_ON_VMDNS_ERROR(dwError);

    dwError = VmDnsRpcAllocateStringA(pZoneInfoSrc->pszPrimaryDnsSrvName,
                                    &pZoneInfoDest->pszPrimaryDnsSrvName);
    BAIL_ON_VMDNS_ERROR(dwError);

    dwError = VmDnsRpcAllocateStringA(pZoneInfoSrc->pszRName,
                                    &pZoneInfoDest->pszRName);
    BAIL_ON_VMDNS_ERROR(dwError);

    pZoneInfoDest->dwFlags = pZoneInfoSrc->dwFlags;
    pZoneInfoDest->dwZoneType = pZoneInfoSrc->dwZoneType;
    pZoneInfoDest->expire = pZoneInfoSrc->expire;
    pZoneInfoDest->minimum = pZoneInfoSrc->minimum;
    pZoneInfoDest->refreshInterval = pZoneInfoSrc->refreshInterval;
    pZoneInfoDest->retryInterval = pZoneInfoSrc->retryInterval;
    pZoneInfoDest->serial = pZoneInfoSrc->serial;

cleanup:
    return dwError;
error:
    VmDnsRpcFreeMemory(pZoneInfoDest->pszName);
    VmDnsRpcFreeMemory(pZoneInfoDest->pszPrimaryDnsSrvName);
    VmDnsRpcFreeMemory(pZoneInfoDest->pszRName);
    VmDnsRpcFreeMemory(pZoneInfoDest);
    goto cleanup;
}