rv = OpenRegistry(); if (NS_FAILED(rv)) return rv;
if (m_reg != nsnull) {  rv = m_reg->OpenDefault();
NS_IMETHODIMP nsProfile::IsPregCookieSet(char **pregSet){	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_SUCCEEDED(rv))        {            rv = m_reg->GetString(key, REGISTRY_HAVE_PREG_INFO_STRING, pregSet);        }    else        {#if defined(DEBUG_profile)            printf("Registry : Couldn't get Profiles subtree.\n");#endif        }	return rv;}