USER32: win16 applications should not see long filenames returned from dialog control (try 2)

Dmitry Timoshkov dmitry at codeweavers.com
Mon Nov 5 05:27:31 CST 2007


"Alex Villacís Lasso" <a_villacis at palosanto.com> wrote:

>  BOOL16 WINAPI DlgDirSelectEx16( HWND16 hwnd, LPSTR str, INT16 len, INT16 id )
>  {
> -    return DlgDirSelectExA( WIN_Handle32(hwnd), str, len, id );
> +    BOOL16 ret = DlgDirSelectExA( WIN_Handle32(hwnd), str, len, id );
> +    GetShortPathNameA(str, str, len);
> +    return ret;
>  }

>  BOOL16 WINAPI DlgDirSelectComboBoxEx16( HWND16 hwnd, LPSTR str, INT16 len,
>                                          INT16 id )
>  {
> -    return DlgDirSelectComboBoxExA( WIN_Handle32(hwnd), str, len, id );
> +    BOOL16 ret = DlgDirSelectComboBoxExA( WIN_Handle32(hwnd), str, len, id );
> +    GetShortPathNameA(str, str, len);
> +    return ret;
>  }

You are passing garbage to GetShortPathNameA in the case of failure.

-- 
Dmitry. 




More information about the wine-devel mailing list