[PATCH 2/3] winebus.sys: Make the device and instance IDs consistent.
Zebediah Figura
z.figura12 at gmail.com
Tue Jun 4 11:20:05 CDT 2019
On 6/4/19 10:56 AM, Alexandre Julliard wrote:
> Zebediah Figura <zfigura at codeweavers.com> writes:
>
>> + DWORD len;
>>
>> - if ((dst = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR))))
>> - sprintfW(dst, formatW, ext->busid, ext->vid, ext->pid);
>> + if (ext->input == (WORD)-1)
>> + {
>> + len = snprintfW(NULL, 0, formatW, ext->busid, ext->vid, ext->pid);
>
> This can't work, snprintfW returns -1 on overflow.
>
...Indeed. I'm not sure why it worked for me, then. I guess there's no
way to get the real buffer size using this approach?
I'll resend using a fixed-size buffer.
More information about the wine-devel
mailing list