kIStringBundleServiceIID, (nsISupports **)&sbServ);
NS_GET_IID(nsIStringBundleService), (nsISupports **)&sbServ);
nsExtensibleStringBundle::nsExtensibleStringBundle(const char * aRegistryKey,                                                   nsILocale * aLocale,                                                   nsresult * aResult){  NS_INIT_REFCNT();  nsresult res = NS_OK;  nsIEnumerator * components = NULL;  nsIRegistry * registry = NULL;  nsRegistryKey uconvKey, key;  nsIStringBundleService * sbServ = NULL;  // get the Bundle Service  res = nsServiceManager::GetService(kStringBundleServiceCID,       kIStringBundleServiceIID, (nsISupports **)&sbServ);  if (NS_FAILED(res)) goto done;  // get the registry  res = nsServiceManager::GetService(NS_REGISTRY_PROGID,     nsIRegistry::GetIID(), (nsISupports**)&registry);  if (NS_FAILED(res)) goto done;  // get subtree  res = registry->GetSubtree(nsIRegistry::Common,      aRegistryKey, &uconvKey);  if (NS_FAILED(res)) goto done;  // enumerate subtrees  res = registry->EnumerateSubtrees(uconvKey, &components);  if (NS_FAILED(res)) goto done;  res = components->First();  if (NS_FAILED(res)) goto done;  // create the bundles array  res = NS_NewISupportsArray(&mBundle);  if (NS_FAILED(res)) goto done;  while (NS_OK != components->IsDone()) {    nsISupports * base = NULL;    nsIRegistryNode * node = NULL;    char * name = NULL;    nsIStringBundle * bundle = NULL;    res = components->CurrentItem(&base);    if (NS_FAILED(res)) goto done1;    res = base->QueryInterface(kRegistryNodeIID, (void**)&node);    if (NS_FAILED(res)) goto done1;    res = node->GetKey(&key);    if (NS_FAILED(res)) goto done1;    res = registry->GetString(key, "name", &name);    if (NS_FAILED(res)) goto done1;    res = sbServ->CreateBundle(name, aLocale, &bundle);    if (NS_FAILED(res)) goto done1;    res = mBundle->AppendElement(bundle);    if (NS_FAILED(res)) goto done1;    // printf("Name = %s\n", name);done1:    NS_IF_RELEASE(base);    NS_IF_RELEASE(node);    NS_IF_RELEASE(bundle);    if (name != NULL) nsCRT::free(name);    res = components->Next();    if (NS_FAILED(res)) break; // this is NOT supposed to fail!  }  // finish and clean updone:  if (registry != NULL) {    nsServiceManager::ReleaseService(NS_REGISTRY_PROGID, registry);  }  if (sbServ != NULL) nsServiceManager::ReleaseService(      kStringBundleServiceCID, sbServ);  NS_IF_RELEASE(components);}