NS_ENSURE_ARG_POINTER(srcResource); NS_ENSURE_ARG_POINTER(dstResource); NS_ENSURE_ARG_POINTER(argumentArray);
if(!srcFolderElement || !dstFolderElement || !messages) return NS_ERROR_NULL_POINTER;  nsCOMPtr<nsIRDFResource> srcResource, dstResource; nsCOMPtr<nsIMsgFolder> srcFolder; nsCOMPtr<nsISupportsArray> argumentArray; nsCOMPtr<nsISupportsArray> folderArray;  rv = dstFolderElement->GetResource(getter_AddRefs(dstResource)); if(NS_FAILED(rv)) return rv;  rv = srcFolderElement->GetResource(getter_AddRefs(srcResource)); if(NS_FAILED(rv)) return rv;  srcFolder = do_QueryInterface(srcResource); if(!srcFolder) return NS_ERROR_NO_INTERFACE;  rv =ConvertDOMListToResourceArray(messages, getter_AddRefs(argumentArray)); if(NS_FAILED(rv)) return rv;  nsCOMPtr<nsISupports> srcFolderSupports(do_QueryInterface(srcFolder)); if(srcFolderSupports) argumentArray->InsertElementAt(srcFolderSupports, 0);  rv = NS_NewISupportsArray(getter_AddRefs(folderArray)); if(NS_FAILED(rv)) { return NS_ERROR_OUT_OF_MEMORY; }  folderArray->AppendElement(dstResource);
nsMessenger::CopyMessages(nsIRDFCompositeDataSource *database,                          nsIRDFResource *srcResource, // folder						              nsIRDFResource *dstResource,                          nsISupportsArray *argumentArray, // nsIMessages                          PRBool isMove){	nsresult rv;  NS_ENSURE_ARG_POINTER(srcResource);  NS_ENSURE_ARG_POINTER(dstResource);  NS_ENSURE_ARG_POINTER(argumentArray);	  nsCOMPtr<nsIMsgFolder> srcFolder;  nsCOMPtr<nsISupportsArray> folderArray;      srcFolder = do_QueryInterface(srcResource);  if(!srcFolder)    return NS_ERROR_NO_INTERFACE;    nsCOMPtr<nsISupports> srcFolderSupports(do_QueryInterface(srcFolder));  if(srcFolderSupports)    argumentArray->InsertElementAt(srcFolderSupports, 0);  rv = NS_NewISupportsArray(getter_AddRefs(folderArray));  NS_ENSURE_SUCCESS(rv, rv);    folderArray->AppendElement(dstResource);  if (isMove)    rv = DoCommand(database, NS_LITERAL_CSTRING(NC_RDF_MOVE), folderArray, argumentArray);  else    rv = DoCommand(database, NS_LITERAL_CSTRING(NC_RDF_COPY), folderArray, argumentArray);  return rv;}