static nsresult OpenAddressBook(const char * dbUri, nsIAddrDatabase** aDatabase, nsIAbDirectory** aDirectory)
static nsresult OpenAddressBook(const char * dbUri, nsIAddrDatabase** aDatabase)
static nsresult OpenAddressBook(const char * dbUri, nsIAddrDatabase** aDatabase, nsIAbDirectory** aDirectory){  if (!aDatabase || !aDirectory)    return NS_ERROR_NULL_POINTER;  nsresult rv;  nsCOMPtr<nsIAddressBook> addresBook (do_GetService(NS_ADDRESSBOOK_CONTRACTID));   if (addresBook)    rv = addresBook->GetAbDatabaseFromURI(dbUri, aDatabase);  nsCOMPtr<nsIRDFService> rdfService (do_GetService("@mozilla.org/rdf/rdf-service;1", &rv));  if (NS_FAILED(rv))     return rv;  nsCOMPtr <nsIRDFResource> resource;  rv = rdfService->GetResource(dbUri, getter_AddRefs(resource));  if (NS_FAILED(rv))     return rv;  // query interface   rv = resource->QueryInterface(nsIAbDirectory::GetIID(), (void **)aDirectory);  return rv;}