[PATCH] kernel32: Implement GetFinalPathNameByHandle

Dmitry Timoshkov dmitry at baikal.ru
Thu Mar 19 10:54:27 CDT 2015


Andrew Eikum <aeikum at codeweavers.com> wrote:

> +    info->FileName[info->FileNameLength / sizeof(WCHAR)] = 0;
> +    if (!RtlDosPathNameToNtPathName_U( info->FileName, &nt_name, NULL, NULL ))
> +    {
> +        SetLastError( ERROR_PATH_NOT_FOUND );
> +        return 0;
> +    }
> +
> +    name_wchars = nt_name.Length / sizeof(WCHAR);
> +    if (name_wchars + 1 > len)
> +    {
> +        RtlFreeUnicodeString( &nt_name );
> +        return name_wchars + 1;
> +    }
> +
> +    memcpy( outstr, nt_name.Buffer, nt_name.Length );
> +    outstr[name_wchars] = 0;

Where did you get an idea that you should return an nt path from this API?
There is no a single check in the tests for a returned file name, and this
whole thing looks over complicated.

-- 
Dmitry.



More information about the wine-devel mailing list