rv2 = src->GetFileSpec(&doomedSpec);
rv2 = dest->GetFileSpec(&doomedSpec);
void ReplaceScheduledFiles( HREG reg ){    RKEY    key;    /* replace files if any listed */    if (REGERR_OK == NR_RegGetKey(reg,ROOTKEY_PRIVATE,REG_REPLACE_LIST_KEY,&key))    {        char keyname[MAXREGNAMELEN];        char doomedFile[MAXREGPATHLEN];        char srcFile[MAXREGPATHLEN];        nsFileSpec              doomedSpec;        nsFileSpec              srcSpec;        nsCOMPtr<nsIFileSpec>   src;        nsCOMPtr<nsIFileSpec>   dest;        nsresult                rv1, rv2;        rv1 = NS_NewFileSpec(getter_AddRefs(src));        rv2 = NS_NewFileSpec(getter_AddRefs(dest));        if (NS_SUCCEEDED(rv1) && NS_SUCCEEDED(rv2))        {            uint32 bufsize;            REGENUM state = 0;            while (REGERR_OK == NR_RegEnumSubkeys( reg, key, &state,                                    keyname, sizeof(keyname), REGENUM_CHILDREN))            {                bufsize = sizeof(srcFile);                REGERR err1 = NR_RegGetEntry( reg, (RKEY)state,                                    REG_REPLACE_SRCFILE, srcFile, &bufsize);                bufsize = sizeof(doomedFile);                REGERR err2 = NR_RegGetEntry( reg, (RKEY)state,                                    REG_REPLACE_DESTFILE, doomedFile, &bufsize);                if ( err1 == REGERR_OK && err2 == REGERR_OK )                {                    src->SetPersistentDescriptorString(srcFile);                    rv1 = src->GetFileSpec(&srcSpec);                    dest->SetPersistentDescriptorString(doomedFile);                    rv2 = src->GetFileSpec(&doomedSpec);                    if (NS_SUCCEEDED(rv1) && NS_SUCCEEDED(rv2))                    {                        // finally now try to do the replace                        PRInt32 result = ReplaceFileNow( srcSpec, doomedSpec );                        if ( result == nsInstall::DOES_NOT_EXIST ||                             result == nsInstall::SUCCESS )                        {                            // This one is done                            NR_RegDeleteKey( reg, key, keyname );                        }                    }                }            }            /* delete list node if empty */            state = 0;            if (REGERR_NOMORE == NR_RegEnumSubkeys( reg, key, &state, keyname,                                          sizeof(keyname), REGENUM_CHILDREN ))            {                NR_RegDeleteKey(reg, ROOTKEY_PRIVATE, REG_REPLACE_LIST_KEY);            }        }    }}