if (NS_SUCCEEDED(rv)) { nsIRegistry::Key key;  rv = m_reg->GetSubtree(nsIRegistry::Common, "Profiles", &key);  if (NS_SUCCEEDED(rv)) { rv = m_reg->GetString(key, "HavePregInfo", pregSet); } else {
nsRegistryKey key;  rv = m_reg->GetSubtree(nsIRegistry::Common, REGISTRY_PROFILE_SUBTREE_STRING, &key);  if (NS_SUCCEEDED(rv)) { rv = m_reg->GetString(key, REGISTRY_HAVE_PREG_INFO_STRING, pregSet); } else {
NS_IMETHODIMP nsProfile::IsPregCookieSet(char **pregSet){	nsresult rv = NS_OK;    PRBool openalready = PR_FALSE;     	// Check result.	if (m_reg != nsnull)	{		// Open the registry.		rv = m_reg->IsOpen( &openalready );				if ( !openalready )			rv = m_reg->OpenDefault();    		if (NS_SUCCEEDED(rv))		{			nsIRegistry::Key key;			rv = m_reg->GetSubtree(nsIRegistry::Common, "Profiles", &key);			if (NS_SUCCEEDED(rv))			{				rv = m_reg->GetString(key, "HavePregInfo", pregSet);			}			else			{#if defined(DEBUG_profile)					printf("Registry : Couldn't get Profiles subtree.\n");#endif			}			if (!openalready)				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;}