kernel32: Tiny improvement to the GetVolumePathNameW stub (try 4)

James Hawkins truiken at gmail.com
Thu Aug 21 13:26:41 CDT 2008


On Mon, Aug 18, 2008 at 4:18 AM, Louis. Lenders
<xerox_xerox2000 at yahoo.co.uk> wrote:
> (the return TRUE statement got lost from last patch, thanks Michael for
> noticing)
>
>
> Hi,  this fixes Adobe Lightroom 2.0 start up bug, mentioned in
> http://bugs.winehq.org/show_bug.cgi?id=8224#c4
>
> as long wine doesn't handle with volume mount points, it's probably safe to
> satisfy most apps.
>
> (A simple google for
> "fixme:volume:GetVolumePathNameW"
> revealed only about 3 apps , and "fixme:volume:GetVolumePathNameA" revealed
> zero hits, so for now the use of this api seems not really wide-spread, and
> no need to touch GetVolumePathNameA i guess)
>

+    /* As long as we don't handle volumemountpoints, and filename is
something like "X:\\blabla\\bla", it's probably safe to return "X:\"
for
+      now to keep some applications happy */
+

Please get rid of this comment.

+    if(strlenW(filename)>=3 && filename[1] == ':' && filename[2] ==
'\\' && buflen >3)
+    {
+         lstrcpynW(volumepathname,filename,4);
+         return TRUE;
+    }

You've handled *a* successful case, but what about the error case?
Also, you're copying 4 bytes of filename into volumepathname.  I don't
think you understand what lstrcpyn does.  Imagine this case:

volumepathname = "aaaaaaaa"
buflen = 8
filename = "C:\\file"

After the call to lstrcpyn:

volumepathname = "C:\\faaaa"

-- 
James Hawkins



More information about the wine-devel mailing list