diff options
Diffstat (limited to '')
-rw-r--r-- | file_io/win32/dir.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 8c8b745..e4e3f7c 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -128,6 +128,8 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, if (thedir->dirhand == INVALID_HANDLE_VALUE) { apr_status_t rv; + FINDEX_INFO_LEVELS info_level; + if ((rv = utf8_to_unicode_path(wdirname, sizeof(wdirname) / sizeof(apr_wchar_t), thedir->dirname))) { @@ -136,7 +138,19 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, eos = wcschr(wdirname, '\0'); eos[0] = '*'; eos[1] = '\0'; - thedir->dirhand = FindFirstFileW(wdirname, thedir->w.entry); + + /* Do not request short file names on Windows 7 and later. */ + if (apr_os_level >= APR_WIN_7) { + info_level = FindExInfoBasic; + } + else { + info_level = FindExInfoStandard; + } + + thedir->dirhand = FindFirstFileExW(wdirname, info_level, + thedir->w.entry, + FindExSearchNameMatch, NULL, + 0); eos[0] = '\0'; if (thedir->dirhand == INVALID_HANDLE_VALUE) { return apr_get_os_error(); |