*_retval = enumerator; NS_ADDREF(*_retval);
rv = NS_NewArrayEnumerator(_retval, nodes); if (NS_FAILED(rv)) return rv;
nsMsgAccountManagerDataSource::GetTargets(nsIRDFResource *source,                                   nsIRDFResource *property,                                   PRBool aTruthValue,                                   nsISimpleEnumerator **_retval){  nsresult rv = NS_RDF_NO_VALUE;  // create array and enumerator  // even if we're not handling this we need to return something empty?  nsCOMPtr<nsISupportsArray> nodes;  rv = NS_NewISupportsArray(getter_AddRefs(nodes));  if (NS_FAILED(rv)) return rv;    nsISimpleEnumerator* enumerator =    new nsArrayEnumerator(nodes);  if (!enumerator) return NS_ERROR_OUT_OF_MEMORY;  *_retval = enumerator;  NS_ADDREF(*_retval);  // if the property is "account" or "child" then return the  // list of accounts  // if the property is "server" return a union of all servers  // in the account (mainly for the folder pane)#ifdef DEBUG_amds  nsXPIDLCString source_value;  rv = source->GetValue(getter_Copies(source_value));  nsXPIDLCString property_arc;  rv = property->GetValue(getter_Copies(property_arc));  if (NS_FAILED(rv)) return rv;    printf("GetTargets(%s with arc %s...)\n",         (const char*)source_value,         (const char*)property_arc);#endif    if (source == kNC_AccountRoot) {    if (property == kNC_Child ||        property == kNC_Settings) {            nsCOMPtr<nsISupportsArray> servers;      rv = mAccountManager->GetAllServers(getter_AddRefs(servers));            // fill up the nodes array with the RDF Resources for the servers      serverCreationParams params = { nodes, getRDFService() };      servers->EnumerateForwards(createServerResources, (void*)&params);#ifdef DEBUG_amds      printf("GetTargets(): added the servers on %s\n",             (const char*)property_arc);#endif    }#ifdef DEBUG_amds    else {      printf("unknown arc %s on msgaccounts:/\n", (const char*)property_arc);    }#endif      } else {    /* if this is a server, then support the settings */    nsCOMPtr<nsIMsgFolder> folder = do_QueryInterface(source, &rv);    if (NS_SUCCEEDED(rv)) {      // all the Settings - main, server, copies, advanced, etc      if (property == kNC_Settings) {                nsIRDFResource* res;        rv = getRDFService()->GetResource(NC_RDF_PAGETITLE_SERVER, &res);        if (NS_SUCCEEDED(rv)) nodes->AppendElement(res);        rv = getRDFService()->GetResource(NC_RDF_PAGETITLE_COPIES, &res);        if (NS_SUCCEEDED(rv)) nodes->AppendElement(res);                PRUint32 nodecount;        nodes->Count(&nodecount);#ifdef DEBUG_amds        printf("GetTargets(): Added %d settings resources on %s\n",               nodecount, (const char*)property_arc);#endif      }    }    #ifdef DEBUG_amds    else {      printf("GetTargets(): Unknown source %s\n", (const char*)source_value);    }#endif  }    return NS_OK;}