Rebase against 18230d23c599f1f5f9dd419dccc11c49117cc3b8.

This commit is contained in:
Alistair Leslie-Hughes 2022-03-05 09:58:02 +11:00
parent 0648126dae
commit a79a08a6f7
10 changed files with 148 additions and 80 deletions

View File

@ -159,7 +159,7 @@ index 5ed116d94d9..35ae5ab854a 100644
- nt_dest.Length = dest_len;
+ if (flags == SYMLINK_FLAG_RELATIVE)
+ {
+ SIZE_T nt_path_len = PATH_MAX, unix_path_len = PATH_MAX;
+ ULONG nt_path_len = PATH_MAX, unix_path_len = PATH_MAX;
+ WCHAR *nt_path;
+
+ /* resolve the NT path of the source */

View File

@ -1,7 +1,7 @@
From 96a9115e57cee4a11675d1fff5125155b6b213fb Mon Sep 17 00:00:00 2001
From 1d139a330669c7d650a95c08872e11da8d9d28f6 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@wine-staging.com>
Date: Mon, 3 May 2021 09:28:08 -0600
Subject: ntdll: Add support for creating Unix/Linux symlinks.
Subject: [PATCH] ntdll: Add support for creating Unix/Linux symlinks.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
@ -10,7 +10,7 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
2 files changed, 65 insertions(+), 8 deletions(-)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 18887895e40..bff3b18ce83 100644
index e4eb36e31b3..6f647ddcca5 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -5390,7 +5390,9 @@ static void test_reparse_points(void)
@ -72,10 +72,10 @@ index 18887895e40..bff3b18ce83 100644
/* Cleanup */
pRtlFreeUnicodeString(&nameW);
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 752561931ab..0c2117ca801 100644
index 323bf865631..c146fc70639 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -6031,18 +6031,18 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -6024,18 +6024,18 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
{
BOOL src_allocated = FALSE, path_allocated = FALSE, dest_allocated = FALSE;
BOOL nt_dest_allocated = FALSE, tempdir_created = FALSE;
@ -97,7 +97,7 @@ index 752561931ab..0c2117ca801 100644
ULONG flags;
int i;
@@ -6060,6 +6060,12 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -6053,6 +6053,12 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
dest = &buffer->SymbolicLinkReparseBuffer.PathBuffer[offset];
flags = buffer->SymbolicLinkReparseBuffer.Flags;
break;
@ -110,7 +110,7 @@ index 752561931ab..0c2117ca801 100644
default:
FIXME("stub: FSCTL_SET_REPARSE_POINT(%x)\n", buffer->ReparseTag);
return STATUS_NOT_IMPLEMENTED;
@@ -6071,6 +6077,9 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -6064,6 +6070,9 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
if ((status = server_get_unix_name( handle, &unix_src, FALSE )))
goto cleanup;
src_allocated = TRUE;
@ -119,8 +119,8 @@ index 752561931ab..0c2117ca801 100644
+
if (flags == SYMLINK_FLAG_RELATIVE)
{
SIZE_T nt_path_len = PATH_MAX, unix_path_len = PATH_MAX;
@@ -6146,6 +6155,8 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
ULONG nt_path_len = PATH_MAX, unix_path_len = PATH_MAX;
@@ -6139,6 +6148,8 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
if (status != STATUS_SUCCESS && status != STATUS_NO_SUCH_FILE)
goto cleanup;
dest_allocated = TRUE;
@ -129,7 +129,7 @@ index 752561931ab..0c2117ca801 100644
/* check that the source and destination paths are the same up to the relative path */
if (flags == SYMLINK_FLAG_RELATIVE)
{
@@ -6161,14 +6172,17 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -6154,14 +6165,17 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
/* Encode the reparse tag into the symlink */
strcpy( magic_dest, "" );
@ -153,5 +153,5 @@ index 752561931ab..0c2117ca801 100644
/* Encode the type (file or directory) if NT symlink */
if (buffer->ReparseTag == IO_REPARSE_TAG_SYMLINK)
--
2.17.1
2.34.1

View File

@ -0,0 +1,71 @@
From 8c6455d6be0cba8dc98a95726d9d289089c2bf67 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Sat, 5 Mar 2022 11:08:23 +1100
Subject: [PATCH] Fix warnings
These need to be merged into the patches above.
---
dlls/ntdll/unix/file.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 787616aa675..ee4f31a1e38 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -6150,16 +6150,14 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
/* re-resolve the unix path for the source */
for (;;)
{
- UNICODE_STRING nt_path_tmp;
+ OBJECT_ATTRIBUTES attr;
unix_path = malloc( unix_path_len );
if (!unix_path)
{
status = STATUS_NO_MEMORY;
goto cleanup;
}
- nt_path_tmp.Buffer = nt_path;
- nt_path_tmp.Length = wcslen(nt_path) * sizeof(WCHAR);
- status = wine_nt_to_unix_file_name( &nt_path_tmp, unix_path, &unix_path_len, FALSE );
+ status = wine_nt_to_unix_file_name( &attr, unix_path, &unix_path_len, FILE_OPEN_IF );
if (status != STATUS_BUFFER_TOO_SMALL) break;
free( unix_path );
}
@@ -6182,13 +6180,15 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
/* resolve the NT path of the destination */
for (;;)
{
+ OBJECT_ATTRIBUTES attr;
+ ULONG len = unix_dest_len;
unix_dest = malloc( unix_dest_len );
if (!unix_dest)
{
status = STATUS_NO_MEMORY;
goto cleanup;
}
- status = wine_nt_to_unix_file_name( &nt_dest, unix_dest, &unix_dest_len, FILE_WINE_PATH );
+ status = wine_nt_to_unix_file_name( &attr, unix_dest, &len, FILE_WINE_PATH );
if (status != STATUS_BUFFER_TOO_SMALL) break;
free( unix_dest );
}
@@ -6447,13 +6447,15 @@ NTSTATUS get_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG *si
/* resolve the NT path */
for (;;)
{
+ ULONG len;
nt_dest = malloc( nt_dest_len * sizeof(WCHAR) );
if (!nt_dest)
{
status = STATUS_NO_MEMORY;
goto cleanup;
}
- status = wine_unix_to_nt_file_name( unix_dest, nt_dest, &nt_dest_len );
+ status = wine_unix_to_nt_file_name( unix_dest, nt_dest, &len );
+ nt_dest_len = len;
if (status != STATUS_BUFFER_TOO_SMALL) break;
free( nt_dest );
}
--
2.34.1

View File

@ -51,7 +51,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "1b9d48a7b01e2b715af46bc1f8d5fe6f1529782c"
echo "18230d23c599f1f5f9dd419dccc11c49117cc3b8"
}
# Show version information
@ -1875,6 +1875,7 @@ if test "$enable_ntdll_Junction_Points" -eq 1; then
patch_apply ntdll-Junction_Points/0037-ntdll-Strip-the-wine-prefix-from-reparse-point-paths.patch
patch_apply ntdll-Junction_Points/0038-ntdll-Add-a-marker-to-reparse-point-paths-to-indicat.patch
patch_apply ntdll-Junction_Points/0039-server-Rewrite-absolute-reparse-point-targets-if-the.patch
patch_apply ntdll-Junction_Points/0040-Fix-warnings.patch
fi
# Patchset server-Key_State

View File

@ -1,4 +1,4 @@
From d1e31dceb931ff2a40e606f7aa9acf46d79ca074 Mon Sep 17 00:00:00 2001
From 614d8a2d74f7b5e7fdd2739741dc0fc42e57eebd Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Wed, 22 Sep 2021 19:01:44 +1000
Subject: [PATCH] sapi: Implement ISpObjectToken GetId
@ -9,32 +9,32 @@ Subject: [PATCH] sapi: Implement ISpObjectToken GetId
2 files changed, 28 insertions(+), 6 deletions(-)
diff --git a/dlls/sapi/tests/token.c b/dlls/sapi/tests/token.c
index 47196d42dc7..042dfbaa84a 100644
index 9473d56b4d1..260e059127d 100644
--- a/dlls/sapi/tests/token.c
+++ b/dlls/sapi/tests/token.c
@@ -185,11 +185,11 @@ static void test_object_token(void)
ok( hr == S_OK, "got %08x\n", hr );
ok( hr == S_OK, "got %08lx\n", hr );
hr = ISpObjectToken_GetId( token, NULL );
- todo_wine ok( hr == SPERR_UNINITIALIZED, "got %08x\n", hr );
+ ok( hr == SPERR_UNINITIALIZED, "got %08x\n", hr );
- todo_wine ok( hr == SPERR_UNINITIALIZED, "got %08lx\n", hr );
+ ok( hr == SPERR_UNINITIALIZED, "got %08lx\n", hr );
tempW = (LPWSTR)0xdeadbeef;
hr = ISpObjectToken_GetId( token, &tempW );
- todo_wine ok( hr == SPERR_UNINITIALIZED, "got %08x\n", hr );
+ ok( hr == SPERR_UNINITIALIZED, "got %08x\n", hr );
- todo_wine ok( hr == SPERR_UNINITIALIZED, "got %08lx\n", hr );
+ ok( hr == SPERR_UNINITIALIZED, "got %08lx\n", hr );
ok( tempW == (LPWSTR)0xdeadbeef, "got %s\n", wine_dbgstr_w(tempW) );
hr = ISpObjectToken_GetCategory( token, NULL );
@@ -220,7 +220,7 @@ static void test_object_token(void)
ok( hr == SPERR_ALREADY_INITIALIZED, "got %08x\n", hr );
ok( hr == SPERR_ALREADY_INITIALIZED, "got %08lx\n", hr );
hr = ISpObjectToken_GetId( token, NULL );
- todo_wine ok( hr == E_POINTER, "got %08x\n", hr );
+ ok( hr == E_POINTER, "got %08x\n", hr );
- todo_wine ok( hr == E_POINTER, "got %08lx\n", hr );
+ ok( hr == E_POINTER, "got %08lx\n", hr );
hr = ISpObjectToken_GetCategory( token, NULL );
todo_wine ok( hr == E_POINTER, "got %08x\n", hr );
todo_wine ok( hr == E_POINTER, "got %08lx\n", hr );
@@ -297,6 +297,7 @@ static void test_object_token(void)
ISpObjectToken_Release( token );
}
@ -44,7 +44,7 @@ index 47196d42dc7..042dfbaa84a 100644
{
CoInitialize( NULL );
diff --git a/dlls/sapi/token.c b/dlls/sapi/token.c
index d16478d0064..93ce6549e65 100644
index a514b2995b4..e0fbf200d65 100644
--- a/dlls/sapi/token.c
+++ b/dlls/sapi/token.c
@@ -70,6 +70,7 @@ struct object_token
@ -110,5 +110,5 @@ index d16478d0064..93ce6549e65 100644
static HRESULT WINAPI token_GetCategory( ISpObjectToken *iface,
--
2.33.0
2.34.1

View File

@ -1,4 +1,4 @@
From 1f31bae540fcdd419eda6d012317f904860ec445 Mon Sep 17 00:00:00 2001
From b039e9a489b99619027dfd1a8233c08bfdb362ce Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Wed, 21 Apr 2021 21:06:55 +1000
Subject: [PATCH] secur32: Input Parameter should be NULL on first call to
@ -13,7 +13,7 @@ Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/secur32/schannel.c b/dlls/secur32/schannel.c
index 141a191c7c6..443bf8f3d6c 100644
index c7d62c47758..0ac9e522ce3 100644
--- a/dlls/secur32/schannel.c
+++ b/dlls/secur32/schannel.c
@@ -734,7 +734,7 @@ static SECURITY_STATUS SEC_ENTRY schan_InitializeSecurityContextW(
@ -26,33 +26,33 @@ index 141a191c7c6..443bf8f3d6c 100644
ULONG_PTR handle;
struct create_session_params create_params;
diff --git a/dlls/secur32/tests/schannel.c b/dlls/secur32/tests/schannel.c
index 6c15addf2fc..47f7ca0ef3a 100644
index 1cf751a3198..d0aaf2a13d5 100644
--- a/dlls/secur32/tests/schannel.c
+++ b/dlls/secur32/tests/schannel.c
@@ -1397,7 +1397,7 @@ todo_wine
@@ -1397,7 +1397,7 @@ static void test_communication(void)
status = InitializeSecurityContextA(&cred_handle, &context, (SEC_CHAR *)"localhost",
ISC_REQ_CONFIDENTIALITY|ISC_REQ_STREAM,
0, 0, NULL, 0, &context, &buffers[0], &attrs, NULL);
- todo_wine ok(status == SEC_I_CONTINUE_NEEDED, "Expected SEC_I_CONTINUE_NEEDED, got %08x\n", status);
+ ok(status == SEC_I_CONTINUE_NEEDED, "Expected SEC_I_CONTINUE_NEEDED, got %08x\n", status);
- todo_wine ok(status == SEC_I_CONTINUE_NEEDED, "Expected SEC_I_CONTINUE_NEEDED, got %08lx\n", status);
+ ok(status == SEC_I_CONTINUE_NEEDED, "Expected SEC_I_CONTINUE_NEEDED, got %08lx\n", status);
if (status != SEC_I_CONTINUE_NEEDED)
{
skip("skipping remaining renegotiate test\n");
@@ -1439,7 +1439,7 @@ todo_wine
@@ -1439,7 +1439,7 @@ static void test_communication(void)
ISC_REQ_USE_SUPPLIED_CREDS, 0, 0, &buffers[1], 0, &context2, &buffers[0], &attrs, NULL);
buffers[1].pBuffers[0].cbBuffer = buf_size;
}
- ok (status == SEC_E_OK, "got %08x\n", status);
+ todo_wine ok (status == SEC_E_OK, "got %08x\n", status);
- ok (status == SEC_E_OK, "got %08lx\n", status);
+ todo_wine ok (status == SEC_E_OK, "got %08lx\n", status);
buf = &buffers[0].pBuffers[0];
buf->cbBuffer = buf_size;
@@ -1449,7 +1449,7 @@ todo_wine
@@ -1449,7 +1449,7 @@ static void test_communication(void)
buffers[0].pBuffers[0].BufferType = SECBUFFER_DATA;
buffers[0].pBuffers[1].BufferType = SECBUFFER_EMPTY;
status = DecryptMessage(&context, &buffers[0], 0, NULL);
- ok(status == SEC_E_OK, "DecryptMessage failed: %08x\n", status);
+ todo_wine ok(status == SEC_E_OK, "DecryptMessage failed: %08x\n", status);
- ok(status == SEC_E_OK, "DecryptMessage failed: %08lx\n", status);
+ todo_wine ok(status == SEC_E_OK, "DecryptMessage failed: %08lx\n", status);
if (status == SEC_E_OK)
{
ok(buffers[0].pBuffers[0].BufferType == SECBUFFER_STREAM_HEADER, "Expected first buffer to be SECBUFFER_STREAM_HEADER\n");

View File

@ -1,4 +1,4 @@
From 21c96f8d75f9596e1cd523bae1f2f54b5d2cd445 Mon Sep 17 00:00:00 2001
From 55d0f2284439c3d5661319d10ae333c9e3ea3ad7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Thu, 3 Mar 2016 05:02:21 +0100
Subject: [PATCH] setupapi: Implement SetupAddToDiskSpaceList.
@ -9,7 +9,7 @@ Subject: [PATCH] setupapi: Implement SetupAddToDiskSpaceList.
2 files changed, 285 insertions(+), 11 deletions(-)
diff --git a/dlls/setupapi/diskspace.c b/dlls/setupapi/diskspace.c
index 4f047dd2b54..dcee29443d7 100644
index dcfa39b5a92..cc309f9393c 100644
--- a/dlls/setupapi/diskspace.c
+++ b/dlls/setupapi/diskspace.c
@@ -48,7 +48,21 @@ struct space_list
@ -174,7 +174,7 @@ index 4f047dd2b54..dcee29443d7 100644
+ return ret;
}
diff --git a/dlls/setupapi/tests/diskspace.c b/dlls/setupapi/tests/diskspace.c
index dab6705eee3..2bdf8babce0 100644
index 577b1f84a2a..e60b4b32b5e 100644
--- a/dlls/setupapi/tests/diskspace.c
+++ b/dlls/setupapi/tests/diskspace.c
@@ -19,6 +19,7 @@
@ -238,13 +238,13 @@ index dab6705eee3..2bdf8babce0 100644
ret = SetupQuerySpaceRequiredOnDriveA(handle, "", NULL, NULL, 0);
ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveA to return FALSE, got %d\n", ret);
ok(GetLastError() == ERROR_INVALID_DRIVE,
- "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
+ "Expected GetLastError() to return ERROR_INVALID_DRIVE, got %u\n",
- "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
+ "Expected GetLastError() to return ERROR_INVALID_DRIVE, got %lu\n",
GetLastError());
SetLastError(0xdeadbeef);
@@ -369,6 +400,97 @@ static void test_SetupQuerySpaceRequiredOnDriveA(void)
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
GetLastError());
+ GetWindowsDirectoryA(windir, MAX_PATH);
@ -389,5 +389,5 @@ index dab6705eee3..2bdf8babce0 100644
+ test_SetupAddToDiskSpaceListA();
}
--
2.23.0
2.34.1

View File

@ -1,4 +1,4 @@
From 79fadd8815f6438b30804d202c252920dd3f9213 Mon Sep 17 00:00:00 2001
From f7664a23897b809862a80e287122464cb31e4986 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Thu, 8 Jun 2017 23:50:03 +0200
Subject: [PATCH] programs/winedevice: Load some common drivers and fix ldr
@ -58,7 +58,7 @@ index dc4f4ad993d..4a57cf56f75 100644
+ mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks);
+
+ status = RtlUnicodeStringToAnsiString(&name_a, &mod->BaseDllName, TRUE);
+ ok(!status, "RtlUnicodeStringToAnsiString failed with %08x\n", status);
+ ok(!status, "RtlUnicodeStringToAnsiString failed with %08lx\n", status);
+ if (status) continue;
+
+ if (entry == start->Flink)

View File

@ -1,4 +1,4 @@
From 8f500bf79ec01cee5683a3614428662ac29e8e4d Mon Sep 17 00:00:00 2001
From 0703846f52cc70153aacee4ef699008da450bfe8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 16 May 2015 03:16:15 +0200
Subject: [PATCH] wininet: Replacing header fields should fail if they do not
@ -8,31 +8,27 @@ A lot of details are not properly covered by tests yet and were
marked with FIXME comments. The implementation was written in such
a way that it behaves identical to the old code in such situations.
---
dlls/wininet/http.c | 205 ++++++++++++++++++++++----------------------
1 file changed, 103 insertions(+), 102 deletions(-)
dlls/wininet/http.c | 197 ++++++++++++++++++++++----------------------
1 file changed, 99 insertions(+), 98 deletions(-)
diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
index 1cc688b6b07..1219507bd3d 100644
index 55698467cda..c618652cfaa 100644
--- a/dlls/wininet/http.c
+++ b/dlls/wininet/http.c
@@ -6117,130 +6117,131 @@ static LPWSTR * HTTP_InterpretHttpHeader(LPCWSTR buffer)
@@ -6108,130 +6108,131 @@ static LPWSTR * HTTP_InterpretHttpHeader(LPCWSTR buffer)
static DWORD HTTP_ProcessHeader(http_request_t *request, LPCWSTR field, LPCWSTR value, DWORD dwModifier)
{
- LPHTTPHEADERW lphttpHdr = NULL;
- INT index;
- BOOL request_only = !!(dwModifier & HTTP_ADDHDR_FLAG_REQ);
- DWORD res = ERROR_HTTP_INVALID_HEADER;
+ LPHTTPHEADERW lphttpHdr;
+ INT index;
+ BOOL request_only = !!(dwModifier & HTTP_ADDHDR_FLAG_REQ);
INT index;
BOOL request_only = !!(dwModifier & HTTP_ADDHDR_FLAG_REQ);
- DWORD res = ERROR_HTTP_INVALID_HEADER;
+ DWORD res = ERROR_SUCCESS;
- TRACE("--> %s: %s - 0x%08lx\n", debugstr_w(field), debugstr_w(value), dwModifier);
+ TRACE("--> %s: %s - 0x%08x\n", debugstr_w(field), debugstr_w(value), dwModifier);
TRACE("--> %s: %s - 0x%08lx\n", debugstr_w(field), debugstr_w(value), dwModifier);
- EnterCriticalSection( &request->headers_section );
+ EnterCriticalSection( &request->headers_section );
EnterCriticalSection( &request->headers_section );
- /* REPLACE wins out over ADD */
- if (dwModifier & HTTP_ADDHDR_FLAG_REPLACE)
@ -101,15 +97,15 @@ index 1cc688b6b07..1219507bd3d 100644
- HTTP_DeleteCustomHeader( request, index );
+ goto out;
+ }
- if (value && value[0])
+
+ /* do not add new header if FLAG_ADD_IF_NEW is set */
+ if (dwModifier & HTTP_ADDHDR_FLAG_ADD_IF_NEW)
+ {
+ res = ERROR_HTTP_INVALID_HEADER; /* FIXME */
+ goto out;
+ }
+
- if (value && value[0])
+ /* handle appending to existing header */
+ if (dwModifier & COALESCEFLAGS)
{
@ -125,7 +121,10 @@ index 1cc688b6b07..1219507bd3d 100644
+ lphttpHdr->wFlags |= HDR_ISREQUEST;
+ else
+ lphttpHdr->wFlags &= ~HDR_ISREQUEST;
+
- hdr.lpszField = (LPWSTR)field;
- hdr.lpszValue = (LPWSTR)value;
- hdr.wFlags = hdr.wCount = 0;
+ if (dwModifier & HTTP_ADDHDR_FLAG_COALESCE_WITH_COMMA)
+ {
+ ch = ',';
@ -137,13 +136,14 @@ index 1cc688b6b07..1219507bd3d 100644
+ lphttpHdr->wFlags |= HDR_COMMADELIMITED;
+ }
- hdr.lpszField = (LPWSTR)field;
- hdr.lpszValue = (LPWSTR)value;
- hdr.wFlags = hdr.wCount = 0;
+ len = origlen + valuelen + ((ch > 0) ? 2 : 0);
- if (dwModifier & HTTP_ADDHDR_FLAG_REQ)
- hdr.wFlags |= HDR_ISREQUEST;
+ len = origlen + valuelen + ((ch > 0) ? 2 : 0);
- res = HTTP_InsertCustomHeader(request, &hdr);
- LeaveCriticalSection( &request->headers_section );
- return res;
- }
+ lpsztmp = heap_realloc(lphttpHdr->lpszValue, (len+1)*sizeof(WCHAR));
+ if (lpsztmp)
+ {
@ -157,10 +157,10 @@ index 1cc688b6b07..1219507bd3d 100644
+ origlen++;
+ }
- res = HTTP_InsertCustomHeader(request, &hdr);
- LeaveCriticalSection( &request->headers_section );
- return res;
- }
- LeaveCriticalSection( &request->headers_section );
- return ERROR_SUCCESS;
- }
- else if (dwModifier & COALESCEFLAGS)
+ memcpy(&lphttpHdr->lpszValue[origlen], value, valuelen*sizeof(WCHAR));
+ lphttpHdr->lpszValue[len] = '\0';
+ }
@ -169,11 +169,7 @@ index 1cc688b6b07..1219507bd3d 100644
+ WARN("heap_realloc (%d bytes) failed\n",len+1);
+ res = ERROR_OUTOFMEMORY;
+ }
- LeaveCriticalSection( &request->headers_section );
- return ERROR_SUCCESS;
- }
- else if (dwModifier & COALESCEFLAGS)
+
+ goto out;
+ }
+ }

View File

@ -1 +1 @@
1b9d48a7b01e2b715af46bc1f8d5fe6f1529782c
18230d23c599f1f5f9dd419dccc11c49117cc3b8