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

Michael Karcher wine at mkarcher.dialup.fu-berlin.de
Thu Aug 21 16:35:10 CDT 2008


Am Donnerstag, den 21.08.2008, 13:26 -0500 schrieb James Hawkins:
> 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"

No, sorry. This is not a C language issue, like Louis Lenders flamed
you, but a Win32 API issue. Still he is right in this case, because
lstrcpyn is *not* like strncpy. lstrcpyn does, according to MSDN,
perfectly the right thing here. There is even an example on the MSDN
page, stating that
  lstrcpyn(dest,"abcdefghi",4)
puts "abc" into dest.

Regards,
  Michael Karcher




More information about the wine-devel mailing list