Fix lossage due to pathname truncation in calls to MODULE_LoadLibraryExA

David Laight david at
Thu Sep 12 18:13:43 CDT 2002

> I was under the impression that MAX_PATH is a Windows limitation rather than 
> one of the UNIX that WINE is running on. Since Windows doesn't promise to 
> permit any more than MAX_PATH, we gain nothing by allowing for more in WINE, 
> hence the use of MAX_PATH to size the buffers.

Dunno about widnows, but posix and unix claim to have a PATH_MAX.
Unix file system code doesn't usually check (after all it would have
to know the max depth at any point - otherwise you could rename a
directory and exceed the limit way down the file tree).

It is the sort of limit that is rather painful - you either allocate
a massive (on stack) buffer most of which is never needed (and
traditiobally fail to check for overflow) or dynamically allocate a
buffer that is big enough and don't have a limit at all.


David Laight: david at

More information about the wine-devel mailing list