Fix Size Return From InternetGetCookieW

Robert Shearman rob at codeweavers.com
Sat Jul 17 11:09:45 CDT 2004


Hi,

lpdwSize stores "the size of the buffer necessary to copy all the cookie 
data, expressed as a byte count". Therefore, we need to multiple "cnt" 
by sizeof(WCHAR) before returning. This patch changes the function to do 
this.

Rob

Changelog:
Fix Size Return From InternetGetCookieW

-------------- next part --------------
Index: wine/dlls/wininet/cookie.c
===================================================================
RCS file: /home/wine/wine/dlls/wininet/cookie.c,v
retrieving revision 1.7
diff -u -r1.7 cookie.c
--- wine/dlls/wininet/cookie.c	19 Apr 2004 20:12:14 -0000	1.7
+++ wine/dlls/wininet/cookie.c	13 Jul 2004 16:23:10 -0000
@@ -390,7 +390,7 @@
     if (lpCookieData == NULL)
     {
 	cnt += 1; /* NULL */
-	*lpdwSize = cnt;
+	*lpdwSize = cnt*sizeof(WCHAR);
 	TRACE("returning\n");
 	return TRUE;
     }
@@ -398,7 +398,7 @@
     if (!domain_count)
         return FALSE;
 
-    *lpdwSize = cnt + 1;
+    *lpdwSize = (cnt + 1)*sizeof(WCHAR);
 
     TRACE("Returning %i (from %i domains): %s\n", cnt, domain_count,
            debugstr_w(lpCookieData));
 


More information about the wine-patches mailing list