dlls/kernel32/path.c: Fix return values for UNC pathnames in GetLongPathNameW

Alexandre Hardy alexandre.hardy at gmail.com
Tue Dec 1 01:44:38 CST 2009


The MSDN:
   http://msdn.microsoft.com/en-us/library/aa364980(VS.85).aspx
states that GetLongPathNameW returns the length of the string
required to hold the pathname if the buffer is too small to hold
the path. In the case where the buffer is too small, the filename
should not be stored in the buffer.

This ensures that the buffer is not written to (for UNC pathnames)
if the buffer is not large enought to store the path.

Two patches are included with this e-mail:
   1) 0001-unc_get_long_name.patch
       This patch fixes handling of UNC pathnames where
       the provided destination string is too short.
   2) 0002-UNC-GetLongPathNameW-test.patch
       This patch adds a test to check whether
       UNC paths with a 0 destination length is
       handled correctly.

No attempt has been made to determine correct
long UNC pathnames, the only issue addressed
by these patches is the behaviour of GetLongPathNameW
when a UNC pathname is presented.

Kind regards
Alexandre

--
--------------------------------------------------
Alexandre Hardy
http://www.ahardy.za.net



-- 
--------------------------------------------------
Alexandre Hardy
http://www.ahardy.za.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-unc_get_long_name.patch
Type: text/x-patch
Size: 1110 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20091201/6f5f7b35/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-UNC-GetLongPathNameW-test.patch
Type: text/x-patch
Size: 1181 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20091201/6f5f7b35/attachment-0001.bin>


More information about the wine-patches mailing list