nsresult res = NS_OK;
nsresult rv; nsCOMPtr<nsICategoryManager> catman = do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv); if (NS_FAILED(rv)) return rv;
nsresult nsCharsetConverterManager::RegisterConverterManagerData(){  nsresult res = NS_OK;  NS_WITH_SERVICE(nsIRegistry, registry, kRegistryCID, &res);  if (NS_FAILED(res)) return res;  // open registry if necessary  PRBool regOpen = PR_FALSE;  registry->IsOpen(&regOpen);  if (!regOpen) {    res = registry->OpenWellKnownRegistry(nsIRegistry::ApplicationComponentRegistry);    if (NS_FAILED(res)) return res;  }  RegisterConverterTitles(registry, NS_TITLE_BUNDLE_REGISTRY_KEY);  RegisterConverterData(registry, NS_DATA_BUNDLE_REGISTRY_KEY);  return NS_OK;}