Piotr Caban : wininet: Added more fields to cookie structure.

Alexandre Julliard julliard at winehq.org
Mon Oct 1 13:35:07 CDT 2012


Module: wine
Branch: master
Commit: ee47def0adf81da86c8a6ff9ced626124cca0fd2
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ee47def0adf81da86c8a6ff9ced626124cca0fd2

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Mon Oct  1 14:20:35 2012 +0200

wininet: Added more fields to cookie structure.

---

 dlls/wininet/cookie.c |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/dlls/wininet/cookie.c b/dlls/wininet/cookie.c
index 8552548..6f21628 100644
--- a/dlls/wininet/cookie.c
+++ b/dlls/wininet/cookie.c
@@ -65,7 +65,9 @@ struct _cookie
 
     LPWSTR lpCookieName;
     LPWSTR lpCookieData;
+    DWORD flags;
     FILETIME expiry;
+    FILETIME create;
 };
 
 struct _cookie_domain
@@ -90,14 +92,25 @@ static void COOKIE_deleteDomain(cookie_domain *deadDomain);
 static cookie *COOKIE_addCookie(cookie_domain *domain, LPCWSTR name, LPCWSTR data, FILETIME expiry)
 {
     cookie *newCookie = heap_alloc(sizeof(cookie));
+    if (!newCookie)
+        return NULL;
 
-    list_init(&newCookie->entry);
-    newCookie->lpCookieName = NULL;
-    newCookie->lpCookieData = NULL;
-    newCookie->expiry = expiry;
     newCookie->lpCookieName = heap_strdupW(name);
     newCookie->lpCookieData = heap_strdupW(data);
 
+    if (!newCookie->lpCookieName || !newCookie->lpCookieData)
+    {
+        heap_free(newCookie->lpCookieName);
+        heap_free(newCookie->lpCookieData);
+        heap_free(newCookie);
+
+        return NULL;
+    }
+
+    newCookie->flags = 0; /* TODO */
+    newCookie->expiry = expiry;
+    GetSystemTimeAsFileTime(&newCookie->create);
+
     TRACE("added cookie %p (data is %s)\n", newCookie, debugstr_w(data) );
 
     list_add_tail(&domain->cookie_list, &newCookie->entry);




More information about the wine-cvs mailing list