Reviewing, and writing tests. Thanks for your analysis!

On Wed, Jan 5, 2022 at 11:45 AM <i...@apache.org> wrote:
>
> Author: ivan
> Date: Wed Jan  5 17:45:33 2022
> New Revision: 1896724
>
> URL: http://svn.apache.org/viewvc?rev=1896724&view=rev
> Log:
> Win32: Minor optimization of apr_stat() and apr_file_info_get().
>
> * file_io/win32/filestat.c
>   (reparse_point_is_link, apr_stat): Use FindFirstFileExW(FindExInfoBasic)
>    instead of FindFirstFileW().
>
> Modified:
>     apr/apr/trunk/file_io/win32/filestat.c
>
> Modified: apr/apr/trunk/file_io/win32/filestat.c
> URL: 
> http://svn.apache.org/viewvc/apr/apr/trunk/file_io/win32/filestat.c?rev=1896724&r1=1896723&r2=1896724&view=diff
> ==============================================================================
> --- apr/apr/trunk/file_io/win32/filestat.c (original)
> +++ apr/apr/trunk/file_io/win32/filestat.c Wed Jan  5 17:45:33 2022
> @@ -240,7 +240,8 @@ static int reparse_point_is_link(WIN32_F
>              return 0;
>          }
>
> -        hFind = FindFirstFileW(wfname, &fd);
> +        hFind = FindFirstFileExW(wfname, FindExInfoBasic, &fd, 
> FindExSearchNameMatch,
> +                                 NULL, 0);
>          if (hFind == INVALID_HANDLE_VALUE) {
>              return 0;
>          }
> @@ -653,7 +654,8 @@ APR_DECLARE(apr_status_t) apr_stat(apr_f
>          if ((rv = test_safe_name(fname)) != APR_SUCCESS) {
>              return rv;
>          }
> -        hFind = FindFirstFileW(wfname, &FileInfo.w);
> +        hFind = FindFirstFileExW(wfname, FindExInfoBasic, &FileInfo.w,
> +                                 FindExSearchNameMatch, NULL, 0);
>          if (hFind == INVALID_HANDLE_VALUE)
>              return apr_get_os_error();
>          FindClose(hFind);
>
>

Reply via email to