From 4c113948282ab385b9dac562a853a4f9c3066f78 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Mon, 26 Oct 2015 17:47:03 +0100 Subject: [PATCH] Rebase against 12111d8c3b897df92fabc1c1a81567477952e9b1. --- ...mbase-Add-TRACEs-to-string-functions.patch | 145 ------------------ ...mbase-Implement-WindowsConcatString.patch} | 12 +- ...-check-for-NULL-pointer-in-WindowsCr.patch | 49 ------ ...s-Add-tests-for-WindowsConcatString.patch} | 12 +- ...t-WindowsSubstringWithSpecifiedLengt.patch | 71 --------- ...d-tests-for-WindowsSubstringWithSpec.patch | 106 ------------- patches/patchinstall.sh | 14 +- 7 files changed, 15 insertions(+), 394 deletions(-) delete mode 100644 patches/combase-Strings/0001-combase-Add-TRACEs-to-string-functions.patch rename patches/combase-Strings/{0005-combase-Implement-WindowsConcatString.patch => 0001-combase-Implement-WindowsConcatString.patch} (91%) delete mode 100644 patches/combase-Strings/0002-combase-Simplify-check-for-NULL-pointer-in-WindowsCr.patch rename patches/combase-Strings/{0006-combase-tests-Add-tests-for-WindowsConcatString.patch => 0002-combase-tests-Add-tests-for-WindowsConcatString.patch} (93%) delete mode 100644 patches/combase-Strings/0003-combase-Implement-WindowsSubstringWithSpecifiedLengt.patch delete mode 100644 patches/combase-Strings/0004-combase-tests-Add-tests-for-WindowsSubstringWithSpec.patch diff --git a/patches/combase-Strings/0001-combase-Add-TRACEs-to-string-functions.patch b/patches/combase-Strings/0001-combase-Add-TRACEs-to-string-functions.patch deleted file mode 100644 index a3cc9489..00000000 --- a/patches/combase-Strings/0001-combase-Add-TRACEs-to-string-functions.patch +++ /dev/null @@ -1,145 +0,0 @@ -From 7544953e42915dccf4d3bc495d62503f2953cf9b Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sat, 24 Oct 2015 17:51:13 +0200 -Subject: combase: Add TRACEs to string functions. - ---- - dlls/combase/string.c | 37 +++++++++++++++++++++++++++++++++++++ - 1 file changed, 37 insertions(+) - -diff --git a/dlls/combase/string.c b/dlls/combase/string.c -index 33e5100..766e765 100644 ---- a/dlls/combase/string.c -+++ b/dlls/combase/string.c -@@ -21,7 +21,9 @@ - #include "windows.h" - #include "winerror.h" - #include "hstring.h" -+#include "wine/debug.h" - -+WINE_DEFAULT_DEBUG_CHANNEL(winstring); - - struct hstring_private - { -@@ -72,6 +74,9 @@ HRESULT WINAPI WindowsCreateString(LPCWSTR ptr, UINT32 len, - HSTRING *out) - { - struct hstring_private *priv; -+ -+ TRACE("(%p, %u, %p)\n", ptr, len, out); -+ - if (out == NULL) - return E_INVALIDARG; - if (ptr == NULL && len > 0) -@@ -95,6 +100,9 @@ HRESULT WINAPI WindowsCreateStringReference(LPCWSTR ptr, UINT32 len, - HSTRING_HEADER *header, HSTRING *out) - { - struct hstring_private *priv = impl_from_HSTRING_HEADER(header); -+ -+ TRACE("(%p, %u, %p, %p)\n", ptr, len, header, out); -+ - if (out == NULL || header == NULL) - return E_INVALIDARG; - if (ptr == NULL && len > 0) -@@ -119,6 +127,9 @@ HRESULT WINAPI WindowsCreateStringReference(LPCWSTR ptr, UINT32 len, - HRESULT WINAPI WindowsDeleteString(HSTRING str) - { - struct hstring_private *priv = impl_from_HSTRING(str); -+ -+ TRACE("(%p)\n", str); -+ - if (str == NULL) - return S_OK; - if (priv->reference) -@@ -134,6 +145,9 @@ HRESULT WINAPI WindowsDeleteString(HSTRING str) - HRESULT WINAPI WindowsDuplicateString(HSTRING str, HSTRING *out) - { - struct hstring_private *priv = impl_from_HSTRING(str); -+ -+ TRACE("(%p, %p)\n", str, out); -+ - if (out == NULL) - return E_INVALIDARG; - if (str == NULL) -@@ -156,6 +170,9 @@ HRESULT WINAPI WindowsPreallocateStringBuffer(UINT32 len, WCHAR **outptr, - { - struct hstring_private *priv; - HSTRING str; -+ -+ TRACE("(%u, %p, %p)\n", len, outptr, out); -+ - if (outptr == NULL || out == NULL) - return E_POINTER; - if (len == 0) -@@ -178,6 +195,8 @@ HRESULT WINAPI WindowsPreallocateStringBuffer(UINT32 len, WCHAR **outptr, - */ - HRESULT WINAPI WindowsDeleteStringBuffer(HSTRING_BUFFER buf) - { -+ TRACE("(%p)\n", buf); -+ - return WindowsDeleteString((HSTRING)buf); - } - -@@ -187,6 +206,9 @@ HRESULT WINAPI WindowsDeleteStringBuffer(HSTRING_BUFFER buf) - HRESULT WINAPI WindowsPromoteStringBuffer(HSTRING_BUFFER buf, HSTRING *out) - { - struct hstring_private *priv = impl_from_HSTRING_BUFFER(buf); -+ -+ TRACE("(%p, %p)\n", buf, out); -+ - if (out == NULL) - return E_POINTER; - if (buf == NULL) -@@ -206,6 +228,9 @@ HRESULT WINAPI WindowsPromoteStringBuffer(HSTRING_BUFFER buf, HSTRING *out) - UINT32 WINAPI WindowsGetStringLen(HSTRING str) - { - struct hstring_private *priv = impl_from_HSTRING(str); -+ -+ TRACE("(%p)\n", str); -+ - if (str == NULL) - return 0; - return priv->length; -@@ -217,6 +242,9 @@ UINT32 WINAPI WindowsGetStringLen(HSTRING str) - LPCWSTR WINAPI WindowsGetStringRawBuffer(HSTRING str, UINT32 *len) - { - struct hstring_private *priv = impl_from_HSTRING(str); -+ -+ TRACE("(%p, %p)\n", str, len); -+ - if (str == NULL) - { - if (len) -@@ -235,6 +263,9 @@ HRESULT WINAPI WindowsStringHasEmbeddedNull(HSTRING str, BOOL *out) - { - UINT32 i; - struct hstring_private *priv = impl_from_HSTRING(str); -+ -+ TRACE("(%p, %p)\n", str, out); -+ - if (out == NULL) - return E_INVALIDARG; - if (str == NULL) -@@ -261,6 +292,9 @@ HRESULT WINAPI WindowsSubstring(HSTRING str, UINT32 start, HSTRING *out) - { - struct hstring_private *priv = impl_from_HSTRING(str); - UINT32 len = WindowsGetStringLen(str); -+ -+ TRACE("(%p, %u, %p)\n", str, start, out); -+ - if (out == NULL) - return E_INVALIDARG; - if (start > len) -@@ -279,6 +313,9 @@ HRESULT WINAPI WindowsSubstring(HSTRING str, UINT32 start, HSTRING *out) - BOOL WINAPI WindowsIsStringEmpty(HSTRING str) - { - struct hstring_private *priv = impl_from_HSTRING(str); -+ -+ TRACE("(%p)\n", str); -+ - if (str == NULL) - return TRUE; - return priv->length == 0; --- -2.6.1 - diff --git a/patches/combase-Strings/0005-combase-Implement-WindowsConcatString.patch b/patches/combase-Strings/0001-combase-Implement-WindowsConcatString.patch similarity index 91% rename from patches/combase-Strings/0005-combase-Implement-WindowsConcatString.patch rename to patches/combase-Strings/0001-combase-Implement-WindowsConcatString.patch index b1ea31f5..b7d863ce 100644 --- a/patches/combase-Strings/0005-combase-Implement-WindowsConcatString.patch +++ b/patches/combase-Strings/0001-combase-Implement-WindowsConcatString.patch @@ -1,4 +1,4 @@ -From 5f3fb549f2442ee29ab6268a15a933a4363a467e Mon Sep 17 00:00:00 2001 +From 0e973b890161d9b50dac9784b33c9a8580223fd4 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sat, 24 Oct 2015 22:30:21 +0200 Subject: combase: Implement WindowsConcatString. @@ -10,7 +10,7 @@ Subject: combase: Implement WindowsConcatString. 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/dlls/api-ms-win-core-winrt-string-l1-1-0/api-ms-win-core-winrt-string-l1-1-0.spec b/dlls/api-ms-win-core-winrt-string-l1-1-0/api-ms-win-core-winrt-string-l1-1-0.spec -index cb354f9..efe50d8 100644 +index dc67deb..fa048d8 100644 --- a/dlls/api-ms-win-core-winrt-string-l1-1-0/api-ms-win-core-winrt-string-l1-1-0.spec +++ b/dlls/api-ms-win-core-winrt-string-l1-1-0/api-ms-win-core-winrt-string-l1-1-0.spec @@ -7,7 +7,7 @@ @@ -19,11 +19,11 @@ index cb354f9..efe50d8 100644 @ stub WindowsCompareStringOrdinal -@ stub WindowsConcatString +@ stdcall WindowsConcatString(ptr ptr ptr) combase.WindowsConcatString - @ stdcall WindowsCreateString(ptr long ptr) combase.WindowsCreateString + @ stdcall WindowsCreateString(wstr long ptr) combase.WindowsCreateString @ stdcall WindowsCreateStringReference(wstr long ptr ptr) combase.WindowsCreateStringReference @ stdcall WindowsDeleteString(ptr) combase.WindowsDeleteString diff --git a/dlls/combase/combase.spec b/dlls/combase/combase.spec -index 3b3fd9c..efb5b07 100644 +index fcd5947..6a76b2d 100644 --- a/dlls/combase/combase.spec +++ b/dlls/combase/combase.spec @@ -288,7 +288,7 @@ @@ -32,11 +32,11 @@ index 3b3fd9c..efb5b07 100644 @ stub WindowsCompareStringOrdinal -@ stub WindowsConcatString +@ stdcall WindowsConcatString(ptr ptr ptr) - @ stdcall WindowsCreateString(ptr long ptr) + @ stdcall WindowsCreateString(wstr long ptr) @ stdcall WindowsCreateStringReference(wstr long ptr ptr) @ stdcall WindowsDeleteString(ptr) diff --git a/dlls/combase/string.c b/dlls/combase/string.c -index 92666b4..6f9ec07 100644 +index 49d7695..d84f940 100644 --- a/dlls/combase/string.c +++ b/dlls/combase/string.c @@ -330,6 +330,35 @@ HRESULT WINAPI WindowsSubstringWithSpecifiedLength(HSTRING str, UINT32 start, UI diff --git a/patches/combase-Strings/0002-combase-Simplify-check-for-NULL-pointer-in-WindowsCr.patch b/patches/combase-Strings/0002-combase-Simplify-check-for-NULL-pointer-in-WindowsCr.patch deleted file mode 100644 index 79c74ef2..00000000 --- a/patches/combase-Strings/0002-combase-Simplify-check-for-NULL-pointer-in-WindowsCr.patch +++ /dev/null @@ -1,49 +0,0 @@ -From fe236be1d5f8285d4438afde1bd5b7b7d502341d Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sat, 24 Oct 2015 22:52:44 +0200 -Subject: combase: Simplify check for NULL pointer in - WindowsCreateString[Reference]. - ---- - dlls/combase/string.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/dlls/combase/string.c b/dlls/combase/string.c -index 766e765..4344d36 100644 ---- a/dlls/combase/string.c -+++ b/dlls/combase/string.c -@@ -79,13 +79,13 @@ HRESULT WINAPI WindowsCreateString(LPCWSTR ptr, UINT32 len, - - if (out == NULL) - return E_INVALIDARG; -- if (ptr == NULL && len > 0) -- return E_POINTER; - if (len == 0) - { - *out = NULL; - return S_OK; - } -+ if (ptr == NULL) -+ return E_POINTER; - if (!alloc_string(len, out)) - return E_OUTOFMEMORY; - priv = impl_from_HSTRING(*out); -@@ -105,13 +105,13 @@ HRESULT WINAPI WindowsCreateStringReference(LPCWSTR ptr, UINT32 len, - - if (out == NULL || header == NULL) - return E_INVALIDARG; -- if (ptr == NULL && len > 0) -- return E_POINTER; - if (len == 0) - { - *out = NULL; - return S_OK; - } -+ if (ptr == NULL) -+ return E_POINTER; - if (ptr[len] != '\0') - return E_INVALIDARG; - priv->buffer = (LPWSTR)ptr; --- -2.6.1 - diff --git a/patches/combase-Strings/0006-combase-tests-Add-tests-for-WindowsConcatString.patch b/patches/combase-Strings/0002-combase-tests-Add-tests-for-WindowsConcatString.patch similarity index 93% rename from patches/combase-Strings/0006-combase-tests-Add-tests-for-WindowsConcatString.patch rename to patches/combase-Strings/0002-combase-tests-Add-tests-for-WindowsConcatString.patch index 6765207f..8d590474 100644 --- a/patches/combase-Strings/0006-combase-tests-Add-tests-for-WindowsConcatString.patch +++ b/patches/combase-Strings/0002-combase-tests-Add-tests-for-WindowsConcatString.patch @@ -1,4 +1,4 @@ -From 3d933fb3c0278d2f3b90ca6929ddf7454710ca16 Mon Sep 17 00:00:00 2001 +From 1f8fc65e3edcc8265b20faeffc18123b7b6f4fb5 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sat, 24 Oct 2015 22:35:06 +0200 Subject: combase/tests: Add tests for WindowsConcatString. @@ -8,7 +8,7 @@ Subject: combase/tests: Add tests for WindowsConcatString. 1 file changed, 60 insertions(+) diff --git a/dlls/combase/tests/string.c b/dlls/combase/tests/string.c -index dd35fa8..d39edbe 100644 +index 5a59b50..43ce2d0 100644 --- a/dlls/combase/tests/string.c +++ b/dlls/combase/tests/string.c @@ -27,6 +27,7 @@ @@ -19,7 +19,7 @@ index dd35fa8..d39edbe 100644 static HRESULT (WINAPI *pWindowsCreateString)(LPCWSTR, UINT32, HSTRING *); static HRESULT (WINAPI *pWindowsCreateStringReference)(LPCWSTR, UINT32, HSTRING_HEADER *, HSTRING *); static HRESULT (WINAPI *pWindowsDeleteString)(HSTRING); -@@ -52,6 +53,7 @@ static BOOL init_functions(void) +@@ -51,6 +52,7 @@ static BOOL init_functions(void) win_skip("Failed to load combase.dll, skipping tests\n"); return FALSE; } @@ -27,7 +27,7 @@ index dd35fa8..d39edbe 100644 SET(WindowsCreateString); SET(WindowsCreateStringReference); SET(WindowsDeleteString); -@@ -96,6 +98,8 @@ static void _check_string(int line, HSTRING str, LPCWSTR content, UINT32 length, +@@ -94,6 +96,8 @@ static void _check_string(int line, HSTRING str, LPCWSTR content, UINT32 length, } static const WCHAR input_string[] = { 'a', 'b', 'c', 'd', 'e', 'f', '\0', '\0' }; @@ -36,7 +36,7 @@ index dd35fa8..d39edbe 100644 static const WCHAR input_empty_string[] = { '\0' }; static const WCHAR input_embed_null[] = { 'a', '\0', 'c', '\0', 'e', 'f', '\0' }; static const WCHAR output_substring[] = { 'c', 'd', 'e', 'f', '\0' }; -@@ -321,6 +325,61 @@ static void test_substring(void) +@@ -319,6 +323,61 @@ static void test_substring(void) ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n"); } @@ -98,7 +98,7 @@ index dd35fa8..d39edbe 100644 START_TEST(string) { if (!init_functions()) -@@ -330,4 +389,5 @@ START_TEST(string) +@@ -328,4 +387,5 @@ START_TEST(string) test_access(); test_string_buffer(); test_substring(); diff --git a/patches/combase-Strings/0003-combase-Implement-WindowsSubstringWithSpecifiedLengt.patch b/patches/combase-Strings/0003-combase-Implement-WindowsSubstringWithSpecifiedLengt.patch deleted file mode 100644 index fc00dff1..00000000 --- a/patches/combase-Strings/0003-combase-Implement-WindowsSubstringWithSpecifiedLengt.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 8a60c9da79b9b03c8fa9e2b971b0f3e3c074014a Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sat, 24 Oct 2015 17:54:52 +0200 -Subject: combase: Implement WindowsSubstringWithSpecifiedLength. - ---- - .../api-ms-win-core-winrt-string-l1-1-0.spec | 2 +- - dlls/combase/combase.spec | 2 +- - dlls/combase/string.c | 22 ++++++++++++++++++++++ - 3 files changed, 24 insertions(+), 2 deletions(-) - -diff --git a/dlls/api-ms-win-core-winrt-string-l1-1-0/api-ms-win-core-winrt-string-l1-1-0.spec b/dlls/api-ms-win-core-winrt-string-l1-1-0/api-ms-win-core-winrt-string-l1-1-0.spec -index 825980d..cb354f9 100644 ---- a/dlls/api-ms-win-core-winrt-string-l1-1-0/api-ms-win-core-winrt-string-l1-1-0.spec -+++ b/dlls/api-ms-win-core-winrt-string-l1-1-0/api-ms-win-core-winrt-string-l1-1-0.spec -@@ -22,6 +22,6 @@ - @ stub WindowsReplaceString - @ stdcall WindowsStringHasEmbeddedNull(ptr ptr) combase.WindowsStringHasEmbeddedNull - @ stdcall WindowsSubstring(ptr long ptr) combase.WindowsSubstring --@ stub WindowsSubstringWithSpecifiedLength -+@ stdcall WindowsSubstringWithSpecifiedLength(ptr long long ptr) combase.WindowsSubstringWithSpecifiedLength - @ stub WindowsTrimStringEnd - @ stub WindowsTrimStringStart -diff --git a/dlls/combase/combase.spec b/dlls/combase/combase.spec -index bf8607a..3b3fd9c 100644 ---- a/dlls/combase/combase.spec -+++ b/dlls/combase/combase.spec -@@ -303,6 +303,6 @@ - @ stub WindowsReplaceString - @ stdcall WindowsStringHasEmbeddedNull(ptr ptr) - @ stdcall WindowsSubstring(ptr long ptr) --@ stub WindowsSubstringWithSpecifiedLength -+@ stdcall WindowsSubstringWithSpecifiedLength(ptr long long ptr) - @ stub WindowsTrimStringEnd - @ stub WindowsTrimStringStart -diff --git a/dlls/combase/string.c b/dlls/combase/string.c -index 4344d36..92666b4 100644 ---- a/dlls/combase/string.c -+++ b/dlls/combase/string.c -@@ -308,6 +308,28 @@ HRESULT WINAPI WindowsSubstring(HSTRING str, UINT32 start, HSTRING *out) - } - - /*********************************************************************** -+ * WindowsSubstringWithSpecifiedLength (combase.@) -+ */ -+HRESULT WINAPI WindowsSubstringWithSpecifiedLength(HSTRING str, UINT32 start, UINT32 len, HSTRING *out) -+{ -+ struct hstring_private *priv = impl_from_HSTRING(str); -+ -+ TRACE("(%p, %u, %u, %p)\n", str, start, len, out); -+ -+ if (out == NULL) -+ return E_INVALIDARG; -+ if (start + len < start || -+ start + len > WindowsGetStringLen(str)) -+ return E_BOUNDS; -+ if (len == 0) -+ { -+ *out = NULL; -+ return S_OK; -+ } -+ return WindowsCreateString(&priv->buffer[start], len, out); -+} -+ -+/*********************************************************************** - * WindowsIsStringEmpty (combase.@) - */ - BOOL WINAPI WindowsIsStringEmpty(HSTRING str) --- -2.6.1 - diff --git a/patches/combase-Strings/0004-combase-tests-Add-tests-for-WindowsSubstringWithSpec.patch b/patches/combase-Strings/0004-combase-tests-Add-tests-for-WindowsSubstringWithSpec.patch deleted file mode 100644 index 08f9cffd..00000000 --- a/patches/combase-Strings/0004-combase-tests-Add-tests-for-WindowsSubstringWithSpec.patch +++ /dev/null @@ -1,106 +0,0 @@ -From 1612ae8d8b8112d7e4e6b9c6a51d1aaf3f1093ec Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sat, 24 Oct 2015 17:58:09 +0200 -Subject: combase/tests: Add tests for WindowsSubstringWithSpecifiedLength. - ---- - dlls/combase/tests/string.c | 30 ++++++++++++++++++++++++++++-- - 1 file changed, 28 insertions(+), 2 deletions(-) - -diff --git a/dlls/combase/tests/string.c b/dlls/combase/tests/string.c -index a6b02c6..dd35fa8 100644 ---- a/dlls/combase/tests/string.c -+++ b/dlls/combase/tests/string.c -@@ -39,6 +39,8 @@ static HRESULT (WINAPI *pWindowsPreallocateStringBuffer)(UINT32, WCHAR **, HSTRI - static HRESULT (WINAPI *pWindowsPromoteStringBuffer)(HSTRING_BUFFER, HSTRING *); - static HRESULT (WINAPI *pWindowsStringHasEmbeddedNull)(HSTRING, BOOL *); - static HRESULT (WINAPI *pWindowsSubstring)(HSTRING, UINT32, HSTRING *); -+static HRESULT (WINAPI *pWindowsSubstringWithSpecifiedLength)(HSTRING, UINT32, UINT32, HSTRING *); -+ - - #define SET(x) p##x = (void*)GetProcAddress(hmod, #x) - -@@ -62,6 +64,8 @@ static BOOL init_functions(void) - SET(WindowsPromoteStringBuffer); - SET(WindowsStringHasEmbeddedNull); - SET(WindowsSubstring); -+ SET(WindowsSubstringWithSpecifiedLength); -+ - return TRUE; - } - -@@ -249,6 +253,9 @@ static void test_substring(void) - ok(pWindowsSubstring(str, 2, &substr) == S_OK, "Failed to create substring\n"); - check_string(substr, output_substring, 4, FALSE); - ok(pWindowsDeleteString(substr) == S_OK, "Failed to delete string\n"); -+ ok(pWindowsSubstringWithSpecifiedLength(str, 2, 3, &substr) == S_OK, "Failed to create substring\n"); -+ check_string(substr, output_substring, 3, FALSE); -+ ok(pWindowsDeleteString(substr) == S_OK, "Failed to delete string\n"); - ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n"); - - /* Test duplication of string using substring */ -@@ -257,6 +264,10 @@ static void test_substring(void) - ok(str != substr, "Duplicated string didn't create new string\n"); - check_string(substr, input_string, 6, FALSE); - ok(pWindowsDeleteString(substr) == S_OK, "Failed to delete string\n"); -+ ok(pWindowsSubstringWithSpecifiedLength(str, 0, 6, &substr) == S_OK, "Failed to create substring\n"); -+ ok(str != substr, "Duplicated string didn't create new string\n"); -+ check_string(substr, input_string, 6, FALSE); -+ ok(pWindowsDeleteString(substr) == S_OK, "Failed to delete string\n"); - ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n"); - - /* Test substring of string reference */ -@@ -264,6 +275,9 @@ static void test_substring(void) - ok(pWindowsSubstring(str, 2, &substr) == S_OK, "Failed to create substring of string ref\n"); - check_string(substr, output_substring, 4, FALSE); - ok(pWindowsDeleteString(substr) == S_OK, "Failed to delete string\n"); -+ ok(pWindowsSubstringWithSpecifiedLength(str, 2, 3, &substr) == S_OK, "Failed to create substring of string ref\n"); -+ check_string(substr, output_substring, 3, FALSE); -+ ok(pWindowsDeleteString(substr) == S_OK, "Failed to delete string\n"); - ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string ref\n"); - - /* Test duplication of string reference using substring */ -@@ -272,26 +286,38 @@ static void test_substring(void) - ok(str != substr, "Duplicated string ref didn't create new string\n"); - check_string(substr, input_string, 6, FALSE); - ok(pWindowsDeleteString(substr) == S_OK, "Failed to delete string\n"); -- ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n"); -+ ok(pWindowsSubstringWithSpecifiedLength(str, 0, 6, &substr) == S_OK, "Failed to create substring of string ref\n"); -+ ok(str != substr, "Duplicated string didn't create new string\n"); -+ check_string(substr, input_string, 6, FALSE); -+ ok(pWindowsDeleteString(substr) == S_OK, "Failed to delete string\n"); -+ ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string ref\n"); - - /* Test get substring of empty string */ - ok(pWindowsSubstring(NULL, 0, &substr) == S_OK, "Failed to duplicate NULL string\n"); - ok(substr == NULL, "Substring created new string\n"); -+ ok(pWindowsSubstringWithSpecifiedLength(NULL, 0, 0, &substr) == S_OK, "Failed to duplicate NULL string\n"); -+ ok(substr == NULL, "Substring created new string\n"); - - /* Test get empty substring of string */ - ok(pWindowsCreateString(input_string, 6, &str) == S_OK, "Failed to create string\n"); - ok(pWindowsSubstring(str, 6, &substr) == S_OK, "Failed to create substring\n"); - ok(substr == NULL, "Substring created new string\n"); -+ ok(pWindowsSubstringWithSpecifiedLength(str, 6, 0, &substr) == S_OK, "Failed to create substring\n"); -+ ok(substr == NULL, "Substring created new string\n"); - ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n"); - -- /* Test handling of using too high start index */ -+ /* Test handling of using too high start index or length */ - ok(pWindowsCreateString(input_string, 6, &str) == S_OK, "Failed to create string\n"); - ok(pWindowsSubstring(str, 7, &substr) == E_BOUNDS, "Incorrect error handling\n"); -+ ok(pWindowsSubstringWithSpecifiedLength(str, 7, 0, &substr) == E_BOUNDS, "Incorrect error handling\n"); -+ ok(pWindowsSubstringWithSpecifiedLength(str, 6, 1, &substr) == E_BOUNDS, "Incorrect error handling\n"); -+ ok(pWindowsSubstringWithSpecifiedLength(str, 7, 0xffffffff, &substr) == E_BOUNDS, "Incorrect error handling\n"); - ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n"); - - /* Test handling of a NULL string */ - ok(pWindowsCreateString(input_string, 6, &str) == S_OK, "Failed to create string\n"); - ok(pWindowsSubstring(str, 7, NULL) == E_INVALIDARG, "Incorrect error handling\n"); -+ ok(pWindowsSubstringWithSpecifiedLength(str, 7, 0, NULL) == E_INVALIDARG, "Incorrect error handling\n"); - ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n"); - } - --- -2.6.1 - diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 66274773..42e01ebe 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -52,7 +52,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "f8d78b0d927c1cae4c5075c64d980c306fb3ed87" + echo "12111d8c3b897df92fabc1c1a81567477952e9b1" } # Show version information @@ -2333,17 +2333,9 @@ fi # | dlls/combase/string.c, dlls/combase/tests/string.c # | if test "$enable_combase_Strings" -eq 1; then - patch_apply combase-Strings/0001-combase-Add-TRACEs-to-string-functions.patch - patch_apply combase-Strings/0002-combase-Simplify-check-for-NULL-pointer-in-WindowsCr.patch - patch_apply combase-Strings/0003-combase-Implement-WindowsSubstringWithSpecifiedLengt.patch - patch_apply combase-Strings/0004-combase-tests-Add-tests-for-WindowsSubstringWithSpec.patch - patch_apply combase-Strings/0005-combase-Implement-WindowsConcatString.patch - patch_apply combase-Strings/0006-combase-tests-Add-tests-for-WindowsConcatString.patch + patch_apply combase-Strings/0001-combase-Implement-WindowsConcatString.patch + patch_apply combase-Strings/0002-combase-tests-Add-tests-for-WindowsConcatString.patch ( - echo '+ { "Sebastian Lackner", "combase: Add TRACEs to string functions.", 1 },'; - echo '+ { "Sebastian Lackner", "combase: Simplify check for NULL pointer in WindowsCreateString[Reference].", 1 },'; - echo '+ { "Sebastian Lackner", "combase: Implement WindowsSubstringWithSpecifiedLength.", 1 },'; - echo '+ { "Sebastian Lackner", "combase/tests: Add tests for WindowsSubstringWithSpecifiedLength.", 1 },'; echo '+ { "Sebastian Lackner", "combase: Implement WindowsConcatString.", 1 },'; echo '+ { "Sebastian Lackner", "combase/tests: Add tests for WindowsConcatString.", 1 },'; ) >> "$patchlist"