VirtualBox

Changeset 6971 in vbox


Ignore:
Timestamp:
Feb 15, 2008 2:18:10 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
28150
Message:

Fixed: Newly created files and directories won't be indexed automatically anymore by the Windows Indexing Service.

Location:
trunk/src/VBox/Runtime/r3/win
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/win/dir-win.cpp

    r5999 r6971  
    9999                rc = RTErrConvertFromWin32(GetLastError());
    100100
     101            /*
     102             * Turn off indexing of directory through Windows Indexing Service
     103             */
     104            if (RT_SUCCESS(rc))
     105            {
     106                if (SetFileAttributesW((LPCWSTR)pucszString, FILE_ATTRIBUTE_NOT_CONTENT_INDEXED))
     107                    rc = VINF_SUCCESS;
     108                else
     109                    rc = RTErrConvertFromWin32(GetLastError());
     110            }
     111
    101112            RTStrUcs2Free(pucszString);
    102113        }
  • trunk/src/VBox/Runtime/r3/win/fileio-win.cpp

    r6432 r6971  
    230230        return RTErrConvertFromWin32(GetLastError());
    231231
     232    /*
     233     * Turn off indexing of directory through Windows Indexing Service
     234     */
     235    if (   (dwCreationDisposition == OPEN_ALWAYS)
     236        || (dwCreationDisposition == CREATE_NEW)
     237        || (dwCreationDisposition == CREATE_ALWAYS))
     238    {
     239        if (FALSE == SetFileAttributes(pszFilename, FILE_ATTRIBUTE_NOT_CONTENT_INDEXED))
     240            return RTErrConvertFromWin32(GetLastError());
     241    }
    232242#else
     243
    233244    PRTUCS2 pwszFilename;
    234245    rc = RTStrToUtf16(pszFilename, &pwszFilename);
     
    249260        return rc;
    250261    }
     262
     263    /*
     264     * Turn off indexing of directory through Windows Indexing Service
     265     */
     266    if (   (dwCreationDisposition == OPEN_ALWAYS)
     267        || (dwCreationDisposition == CREATE_NEW)
     268        || (dwCreationDisposition == CREATE_ALWAYS))
     269    {
     270        if (FALSE == SetFileAttributesW(pwszFilename, FILE_ATTRIBUTE_NOT_CONTENT_INDEXED))
     271        {
     272            rc = RTErrConvertFromWin32(GetLastError());
     273            RTUtf16Free(pwszFilename);
     274            return rc;
     275        }
     276    }
     277
    251278    RTUtf16Free(pwszFilename);
    252279#endif
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette