char oldRegFile[_MAX_LENGTH] = {'\0'};   if ( m_reg != nsnull ) {   #ifdef XP_PC  nsSpecialSystemDirectory systemDir(nsSpecialSystemDirectory::Win_WindowsDirectory);   PL_strcpy(oldRegFile, systemDir.GetNativePathCString()); PL_strcat(oldRegFile, oldWinReg); #endif   #ifdef XP_MAC nsSpecialSystemDirectory *regLocation = NULL;   regLocation = new nsSpecialSystemDirectory(nsSpecialSystemDirectory::Mac_SystemDirectory);   *regLocation += "Preferences"; *regLocation += oldMacReg;     nsNSPRPath regNSPRPath(*regLocation); PL_strcpy(oldRegFile, (const char *) regNSPRPath); #endif rv = m_reg->Open(oldRegFile);   if (NS_SUCCEEDED(rv)) {  nsIEnumerator *enumKeys;  if (NS_SUCCEEDED(rv)) {  rv = m_reg->EnumerateSubtrees(nsIRegistry::Users, &enumKeys );  if (NS_SUCCEEDED(rv)) {  rv = enumKeys->First();   while( NS_SUCCEEDED( rv ) && !enumKeys->IsDone() ) { nsISupports *base; rv = enumKeys->CurrentItem( &base );  if (NS_SUCCEEDED(rv)) {  nsIRegistryNode *node; nsIID nodeIID = NS_IREGISTRYNODE_IID; rv = base->QueryInterface( nodeIID, (void**)&node );   if (NS_SUCCEEDED(rv)) {  char *profile = nsnull; rv = node->GetName( &profile );  #if defined(DEBUG_profile) printf("oldProflie = %s\n", profile); #endif  nsIRegistry::Key key;  rv = m_reg->GetSubtree(nsIRegistry::Users, profile, &key);  if (NS_SUCCEEDED(rv)) { PL_strcpy(gOldProfiles[g_numOldProfiles], nsUnescape(profile)); }  char *profLoc = nsnull;  rv = m_reg->GetString( key, "ProfileLocation", &profLoc);  #if defined(DEBUG_profile) printf("oldProflie Location = %s\n", profLoc); #endif  if (NS_SUCCEEDED(rv)) { PL_strcpy(gOldProfLocations[g_numOldProfiles], profLoc); g_numOldProfiles++; }  PR_FREEIF(profile); PR_FREEIF(profLoc); } } rv = enumKeys->Next(); } NS_RELEASE(enumKeys); } } m_reg->Close();  if (g_numOldProfiles > 0) { UpdateMozProfileRegistry(); } } }  #endif
NS_IMETHODIMP nsProfile::MigrateProfileInfo(){    nsresult rv = NS_OK;#ifndef XP_BEOS    nsCOMPtr<nsIFile> oldRegFile;    rv = GetOldRegLocation(getter_AddRefs(oldRegFile));    if (NS_SUCCEEDED(rv)) {    rv = gProfileDataAccess->Get4xProfileInfo(oldRegFile, PR_FALSE);    gProfileDataAccess->mProfileDataChanged = PR_TRUE;    gProfileDataAccess->UpdateRegistry(nsnull);    }#endif	return rv;}