return NS_OK;
rv = m_reg->GetSubtree(nsIRegistry::Common, "Profiles", &key);  if (NS_SUCCEEDED(rv)) { nsIRegistry::Key newKey;   rv = m_reg->GetSubtree(key, profileName, &newKey); } else { #if defined(DEBUG_profile) printf("Registry : Couldn't get Profiles subtree.\n"); #endif } m_reg->Close(); } else { #if defined(DEBUG_profile) printf("Couldn't open registry.\n"); #endif } } else { #if defined(DEBUG_profile) printf("Registry Object is NULL.\n"); #endif  return NS_ERROR_FAILURE; }  return rv;
NS_IMETHODIMP nsProfile::ProfileExists(const char *profileName, PRBool *exists){	nsresult rv = NS_OK;    rv = OpenRegistry();    if (NS_FAILED(rv)) return rv;        nsRegistryKey key;        rv = m_reg->GetSubtree(nsIRegistry::Common, REGISTRY_PROFILE_SUBTREE_STRING, &key);    if (NS_FAILED(rv)) return rv;        nsRegistryKey newKey;                // Get handle to <profileName> passed    rv = m_reg->GetSubtree(key, profileName, &newKey);    if (NS_FAILED(rv)) {        *exists = PR_FALSE;    }    else {        *exists = PR_TRUE;    }	return NS_OK;}