VirtualBox

Changeset 21608 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Jul 15, 2009 1:53:00 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
50127
Message:

IPRT: Use FindFirstFile to get file attributes on Windows host, fixes sharing violation error.

File:
1 edited

Legend:

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

    r15813 r21608  
    211211     * Query file info.
    212212     */
    213     WIN32_FILE_ATTRIBUTE_DATA Data;
    214213#ifndef RT_DONT_CONVERT_FILENAMES
    215214    PRTUTF16 pwszPath;
     
    217216    if (RT_FAILURE(rc))
    218217        return rc;
    219     if (!GetFileAttributesExW(pwszPath, GetFileExInfoStandard, &Data))
     218    WIN32_FIND_DATAW Data;
     219    HANDLE hDir = FindFirstFileW(pwszPath, &Data);
     220    if (hDir == INVALID_HANDLE_VALUE)
    220221    {
    221222        rc = RTErrConvertFromWin32(GetLastError());
     
    223224        return rc;
    224225    }
     226    FindClose(hDir);
    225227    RTUtf16Free(pwszPath);
    226228#else
    227     if (!GetFileAttributesExA(pszPath, GetFileExInfoStandard, &Data))
     229    WIN32_FIND_DATAA Data;
     230    HANDLE hDir = FindFirstFileA(pszPath, &Data);
     231    if (hDir == INVALID_HANDLE_VALUE)
    228232        return RTErrConvertFromWin32(GetLastError());
     233    FindClose(hDir);
    229234#endif
    230235
Note: See TracChangeset for help on using the changeset viewer.

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