MAXPNAMELEN

Doug Kingston dpk at randomnotes.org
Thu Jan 28 20:02:28 CST 2021


dlls/include/mmsystem.h:#define MAXPNAMELEN      32     /* max product name
length (including NULL) */

I wanted to know what the reason was for bounding this string to only 32
bytes (actually 31 + null).  We have a situation with identical devices and
need to add some differentiating text to that string when multiple
identical devices exist so that applications can choose the correct
device.

Our device product string is "USB PnP Sound Device" (20 chars).
mmdevdrv.c:static WCHAR *construct_device_id() then prefixs with either
"In: " (4 chars) or "Out: " (5 chars) and concatenates " - USB" (6 chars).

In: USB PnP Sound Device - USB
Out: USB PnP Sound Device - USB

Total string length is 30 or 31 characters.  Any additional text added at
the end will get truncated and a prefix will cause the existing string to
be truncated.

-Doug-
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20210128/958e7bd8/attachment-0001.htm>


More information about the wine-devel mailing list