wininet: Do not omit mandatory argument to WriteFile.

This commit is contained in:
Thomas Faber 2014-07-12 10:30:29 +02:00 committed by Alexandre Julliard
parent 4707b4483b
commit 9609df86e3
1 changed files with 8 additions and 7 deletions

View File

@ -416,6 +416,7 @@ static BOOL save_persistent_cookie(cookie_container_t *container)
BOOL do_save = FALSE; BOOL do_save = FALSE;
char buf[64], *dyn_buf; char buf[64], *dyn_buf;
FILETIME time; FILETIME time;
DWORD bytes_written;
if (!create_cookie_url(container->domain->domain, container->path, cookie_url, sizeof(cookie_url)/sizeof(cookie_url[0]))) if (!create_cookie_url(container->domain->domain, container->path, cookie_url, sizeof(cookie_url)/sizeof(cookie_url[0])))
return FALSE; return FALSE;
@ -454,31 +455,31 @@ static BOOL save_persistent_cookie(cookie_container_t *container)
continue; continue;
dyn_buf = heap_strdupWtoA(cookie_container->name); dyn_buf = heap_strdupWtoA(cookie_container->name);
if(!dyn_buf || !WriteFile(cookie_handle, dyn_buf, strlen(dyn_buf), NULL, NULL)) { if(!dyn_buf || !WriteFile(cookie_handle, dyn_buf, strlen(dyn_buf), &bytes_written, NULL)) {
heap_free(dyn_buf); heap_free(dyn_buf);
do_save = FALSE; do_save = FALSE;
break; break;
} }
heap_free(dyn_buf); heap_free(dyn_buf);
if(!WriteFile(cookie_handle, "\n", 1, NULL, NULL)) { if(!WriteFile(cookie_handle, "\n", 1, &bytes_written, NULL)) {
do_save = FALSE; do_save = FALSE;
break; break;
} }
dyn_buf = heap_strdupWtoA(cookie_container->data); dyn_buf = heap_strdupWtoA(cookie_container->data);
if(!dyn_buf || !WriteFile(cookie_handle, dyn_buf, strlen(dyn_buf), NULL, NULL)) { if(!dyn_buf || !WriteFile(cookie_handle, dyn_buf, strlen(dyn_buf), &bytes_written, NULL)) {
heap_free(dyn_buf); heap_free(dyn_buf);
do_save = FALSE; do_save = FALSE;
break; break;
} }
heap_free(dyn_buf); heap_free(dyn_buf);
if(!WriteFile(cookie_handle, "\n", 1, NULL, NULL)) { if(!WriteFile(cookie_handle, "\n", 1, &bytes_written, NULL)) {
do_save = FALSE; do_save = FALSE;
break; break;
} }
dyn_buf = heap_strdupWtoA(container->domain->domain); dyn_buf = heap_strdupWtoA(container->domain->domain);
if(!dyn_buf || !WriteFile(cookie_handle, dyn_buf, strlen(dyn_buf), NULL, NULL)) { if(!dyn_buf || !WriteFile(cookie_handle, dyn_buf, strlen(dyn_buf), &bytes_written, NULL)) {
heap_free(dyn_buf); heap_free(dyn_buf);
do_save = FALSE; do_save = FALSE;
break; break;
@ -486,7 +487,7 @@ static BOOL save_persistent_cookie(cookie_container_t *container)
heap_free(dyn_buf); heap_free(dyn_buf);
dyn_buf = heap_strdupWtoA(container->path); dyn_buf = heap_strdupWtoA(container->path);
if(!dyn_buf || !WriteFile(cookie_handle, dyn_buf, strlen(dyn_buf), NULL, NULL)) { if(!dyn_buf || !WriteFile(cookie_handle, dyn_buf, strlen(dyn_buf), &bytes_written, NULL)) {
heap_free(dyn_buf); heap_free(dyn_buf);
do_save = FALSE; do_save = FALSE;
break; break;
@ -496,7 +497,7 @@ static BOOL save_persistent_cookie(cookie_container_t *container)
sprintf(buf, "\n%u\n%u\n%u\n%u\n%u\n*\n", cookie_container->flags, sprintf(buf, "\n%u\n%u\n%u\n%u\n%u\n*\n", cookie_container->flags,
cookie_container->expiry.dwLowDateTime, cookie_container->expiry.dwHighDateTime, cookie_container->expiry.dwLowDateTime, cookie_container->expiry.dwHighDateTime,
cookie_container->create.dwLowDateTime, cookie_container->create.dwHighDateTime); cookie_container->create.dwLowDateTime, cookie_container->create.dwHighDateTime);
if(!WriteFile(cookie_handle, buf, strlen(buf), NULL, NULL)) { if(!WriteFile(cookie_handle, buf, strlen(buf), &bytes_written, NULL)) {
do_save = FALSE; do_save = FALSE;
break; break;
} }