rv2 = NS_NewLocalFile((char*)doomedFile, getter_AddRefs(dest));
rv2 = NS_NewLocalFile((char*)doomedFile, PR_TRUE, getter_AddRefs(dest));
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];        nsCOMPtr<nsIFile>       doomedSpec;        nsCOMPtr<nsIFile>       srcSpec;        nsCOMPtr<nsILocalFile>       src;        nsCOMPtr<nsILocalFile>       dest;        nsresult                rv1, rv2;        memset(srcFile, 0, sizeof(srcFile));        memset(doomedFile, 0, sizeof(doomedFile));                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 )            {                rv1 = NS_NewLocalFile((char*)srcFile, getter_AddRefs(src));                rv1 = src->Clone(getter_AddRefs(srcSpec));                rv2 = NS_NewLocalFile((char*)doomedFile, getter_AddRefs(dest));                rv2 = dest->Clone(getter_AddRefs(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);        }    }}