wininet: Fix URLCache_LocalFileNameToPathA to return a full path, rather than just the container path.

Robert Shearman rob at
Wed Mar 12 10:36:00 CDT 2008

This was caused by path_len including the nul-terminator and so the rest 
of the string was being added after the nul-terminator, which is 
incorrect. This is fixed by making path_len not include the nul-terminator.

Also fix a few other issues with the function, like not passing a 
correct length into the second call to WideCharToMultiByte, nRequired 
being calculated incorrectly and the string not always being nul-terminated.

Add a test for this function by testing the lpszLocalFileName field 
obtained from RetrieveUrlCacheEntryFileA.
  dlls/wininet/tests/urlcache.c |    1 +
  dlls/wininet/urlcache.c       |    8 ++++----
  2 files changed, 5 insertions(+), 4 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ee1321c624ccc97df9e2e3b5cfec76238fe6d937.diff
Type: text/x-patch
Size: 1966 bytes
Desc: not available
Url : 

More information about the wine-patches mailing list