mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-11-21 16:46:54 -08:00
Added patch to implement combase.WindowsCompareStringOrdinal.
This commit is contained in:
parent
2f1f80dcb3
commit
979bd36103
@ -0,0 +1,81 @@
|
||||
From 390bb740e27741df384d19e78cffa128e997d4f3 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sat, 16 Jan 2016 16:12:47 +0100
|
||||
Subject: combase: Implement WindowsCompareStringOrdinal.
|
||||
|
||||
---
|
||||
.../api-ms-win-core-winrt-string-l1-1-0.spec | 2 +-
|
||||
dlls/combase/combase.spec | 2 +-
|
||||
dlls/combase/string.c | 33 ++++++++++++++++++++++
|
||||
3 files changed, 35 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 fa048d8..1b661aa 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
|
||||
@@ -6,7 +6,7 @@
|
||||
@ stub HSTRING_UserSize64
|
||||
@ stub HSTRING_UserUnmarshal
|
||||
@ stub HSTRING_UserUnmarshal64
|
||||
-@ stub WindowsCompareStringOrdinal
|
||||
+@ stdcall WindowsCompareStringOrdinal(ptr ptr ptr) combase.WindowsCompareStringOrdinal
|
||||
@ stdcall WindowsConcatString(ptr ptr ptr) combase.WindowsConcatString
|
||||
@ stdcall WindowsCreateString(wstr long ptr) combase.WindowsCreateString
|
||||
@ stdcall WindowsCreateStringReference(wstr long ptr ptr) combase.WindowsCreateStringReference
|
||||
diff --git a/dlls/combase/combase.spec b/dlls/combase/combase.spec
|
||||
index 5082f39..430ca95 100644
|
||||
--- a/dlls/combase/combase.spec
|
||||
+++ b/dlls/combase/combase.spec
|
||||
@@ -287,7 +287,7 @@
|
||||
@ stub WdtpInterfacePointer_UserSize64
|
||||
@ stdcall WdtpInterfacePointer_UserUnmarshal(ptr ptr ptr ptr) ole32.WdtpInterfacePointer_UserUnmarshal
|
||||
@ stub WdtpInterfacePointer_UserUnmarshal64
|
||||
-@ stub WindowsCompareStringOrdinal
|
||||
+@ stdcall WindowsCompareStringOrdinal(ptr ptr ptr)
|
||||
@ stdcall WindowsConcatString(ptr ptr ptr)
|
||||
@ stdcall WindowsCreateString(wstr long ptr)
|
||||
@ stdcall WindowsCreateStringReference(wstr long ptr ptr)
|
||||
diff --git a/dlls/combase/string.c b/dlls/combase/string.c
|
||||
index dd7c8e9..1d49c4b 100644
|
||||
--- a/dlls/combase/string.c
|
||||
+++ b/dlls/combase/string.c
|
||||
@@ -372,3 +372,36 @@ BOOL WINAPI WindowsIsStringEmpty(HSTRING str)
|
||||
return TRUE;
|
||||
return priv->length == 0;
|
||||
}
|
||||
+
|
||||
+/***********************************************************************
|
||||
+ * WindowsCompareStringOrdinal (combase.@)
|
||||
+ */
|
||||
+HRESULT WINAPI WindowsCompareStringOrdinal(HSTRING str1, HSTRING str2, INT32 *res)
|
||||
+{
|
||||
+ struct hstring_private *priv1 = impl_from_HSTRING(str1);
|
||||
+ struct hstring_private *priv2 = impl_from_HSTRING(str2);
|
||||
+ const WCHAR *buf1 = empty, *buf2 = empty;
|
||||
+ UINT32 len1 = 0, len2 = 0;
|
||||
+
|
||||
+ TRACE("(%p, %p, %p)\n", str1, str2, res);
|
||||
+
|
||||
+ if (res == NULL)
|
||||
+ return E_INVALIDARG;
|
||||
+ if (str1 == str2)
|
||||
+ {
|
||||
+ *res = 0;
|
||||
+ return S_OK;
|
||||
+ }
|
||||
+ if (str1)
|
||||
+ {
|
||||
+ buf1 = priv1->buffer;
|
||||
+ len1 = priv1->length;
|
||||
+ }
|
||||
+ if (str2)
|
||||
+ {
|
||||
+ buf2 = priv2->buffer;
|
||||
+ len2 = priv2->length;
|
||||
+ }
|
||||
+ *res = CompareStringEx(NULL, 0, buf1, len1, buf2, len2, NULL, NULL, 0) - CSTR_EQUAL;
|
||||
+ return S_OK;
|
||||
+}
|
||||
--
|
||||
2.6.4
|
||||
|
@ -0,0 +1,105 @@
|
||||
From aa2897cf754969a7108c4b139f03bfb95c4a5ddb Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sat, 16 Jan 2016 16:13:45 +0100
|
||||
Subject: combase/tests: Add tests for WindowsCompareStringOrdinal.
|
||||
|
||||
---
|
||||
dlls/combase/tests/string.c | 63 +++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 63 insertions(+)
|
||||
|
||||
diff --git a/dlls/combase/tests/string.c b/dlls/combase/tests/string.c
|
||||
index 8e112c3..db6c8f5 100644
|
||||
--- a/dlls/combase/tests/string.c
|
||||
+++ b/dlls/combase/tests/string.c
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
#include "wine/test.h"
|
||||
|
||||
+static HRESULT (WINAPI *pWindowsCompareStringOrdinal)(HSTRING, HSTRING, INT32 *);
|
||||
static HRESULT (WINAPI *pWindowsConcatString)(HSTRING, HSTRING, HSTRING *);
|
||||
static HRESULT (WINAPI *pWindowsCreateString)(LPCWSTR, UINT32, HSTRING *);
|
||||
static HRESULT (WINAPI *pWindowsCreateStringReference)(LPCWSTR, UINT32, HSTRING_HEADER *, HSTRING *);
|
||||
@@ -52,6 +53,7 @@ static BOOL init_functions(void)
|
||||
win_skip("Failed to load combase.dll, skipping tests\n");
|
||||
return FALSE;
|
||||
}
|
||||
+ SET(WindowsCompareStringOrdinal);
|
||||
SET(WindowsConcatString);
|
||||
SET(WindowsCreateString);
|
||||
SET(WindowsCreateStringReference);
|
||||
@@ -394,6 +396,66 @@ static void test_concat(void)
|
||||
ok(concat == NULL, "Concatenate created new string\n");
|
||||
}
|
||||
|
||||
+static void test_compare(void)
|
||||
+{
|
||||
+ HSTRING str1, str2;
|
||||
+ HSTRING_HEADER header1, header2;
|
||||
+ INT32 res;
|
||||
+
|
||||
+ /* Test comparison of string buffers */
|
||||
+ ok(pWindowsCreateString(input_string1, 3, &str1) == S_OK, "Failed to create string\n");
|
||||
+ ok(pWindowsCreateString(input_string2, 3, &str2) == S_OK, "Failed to create string\n");
|
||||
+
|
||||
+ ok(pWindowsCompareStringOrdinal(str1, str1, &res) == S_OK, "Failed to compare string\n");
|
||||
+ ok(res == 0, "Expected 0, got %d\n", res);
|
||||
+ ok(pWindowsCompareStringOrdinal(str1, str2, &res) == S_OK, "Failed to compare string\n");
|
||||
+ ok(res == -1, "Expected -1, got %d\n", res);
|
||||
+ ok(pWindowsCompareStringOrdinal(str2, str1, &res) == S_OK, "Failed to compare string\n");
|
||||
+ ok(res == 1, "Expected 1, got %d\n", res);
|
||||
+ ok(pWindowsCompareStringOrdinal(str2, str2, &res) == S_OK, "Failed to compare string\n");
|
||||
+ ok(res == 0, "Expected 0, got %d\n", res);
|
||||
+ ok(pWindowsCompareStringOrdinal(str1, NULL, &res) == S_OK, "Failed to compare string\n");
|
||||
+ ok(res == 1, "Expected 1, got %d\n", res);
|
||||
+ ok(pWindowsCompareStringOrdinal(NULL, str1, &res) == S_OK, "Failed to compare string\n");
|
||||
+ ok(res == -1, "Expected -1, got %d\n", res);
|
||||
+ ok(pWindowsCompareStringOrdinal(str2, NULL, &res) == S_OK, "Failed to compare string\n");
|
||||
+ ok(res == 1, "Expected 1, got %d\n", res);
|
||||
+ ok(pWindowsCompareStringOrdinal(NULL, str2, &res) == S_OK, "Failed to compare string\n");
|
||||
+ ok(res == -1, "Expected -1, got %d\n", res);
|
||||
+
|
||||
+ ok(pWindowsDeleteString(str2) == S_OK, "Failed to delete string\n");
|
||||
+ ok(pWindowsDeleteString(str1) == S_OK, "Failed to delete string\n");
|
||||
+
|
||||
+ /* Test comparison of string references */
|
||||
+ ok(pWindowsCreateStringReference(input_string1, 3, &header1, &str1) == S_OK, "Failed to create string ref\n");
|
||||
+ ok(pWindowsCreateStringReference(input_string2, 3, &header2, &str2) == S_OK, "Failed to create string ref\n");
|
||||
+
|
||||
+ ok(pWindowsCompareStringOrdinal(str1, str1, &res) == S_OK, "Failed to compare string\n");
|
||||
+ ok(res == 0, "Expected 0, got %d\n", res);
|
||||
+ ok(pWindowsCompareStringOrdinal(str1, str2, &res) == S_OK, "Failed to compare string\n");
|
||||
+ ok(res == -1, "Expected -1, got %d\n", res);
|
||||
+ ok(pWindowsCompareStringOrdinal(str2, str1, &res) == S_OK, "Failed to compare string\n");
|
||||
+ ok(res == 1, "Expected 1, got %d\n", res);
|
||||
+ ok(pWindowsCompareStringOrdinal(str2, str2, &res) == S_OK, "Failed to compare string\n");
|
||||
+ ok(res == 0, "Expected 0, got %d\n", res);
|
||||
+ ok(pWindowsCompareStringOrdinal(str1, NULL, &res) == S_OK, "Failed to compare string\n");
|
||||
+ ok(res == 1, "Expected 1, got %d\n", res);
|
||||
+ ok(pWindowsCompareStringOrdinal(NULL, str1, &res) == S_OK, "Failed to compare string\n");
|
||||
+ ok(res == -1, "Expected -1, got %d\n", res);
|
||||
+ ok(pWindowsCompareStringOrdinal(str2, NULL, &res) == S_OK, "Failed to compare string\n");
|
||||
+ ok(res == 1, "Expected 1, got %d\n", res);
|
||||
+ ok(pWindowsCompareStringOrdinal(NULL, str2, &res) == S_OK, "Failed to compare string\n");
|
||||
+ ok(res == -1, "Expected -1, got %d\n", res);
|
||||
+
|
||||
+ ok(pWindowsDeleteString(str2) == S_OK, "Failed to delete string ref\n");
|
||||
+ ok(pWindowsDeleteString(str1) == S_OK, "Failed to delete string ref\n");
|
||||
+
|
||||
+ /* Test comparison of two empty strings */
|
||||
+ ok(pWindowsCompareStringOrdinal(NULL, NULL, NULL) == E_INVALIDARG, "Incorrect error handling\n");
|
||||
+ ok(pWindowsCompareStringOrdinal(NULL, NULL, &res) == S_OK, "Failed to compare NULL string\n");
|
||||
+ ok(res == 0, "Expected 0, got %d\n", res);
|
||||
+}
|
||||
+
|
||||
START_TEST(string)
|
||||
{
|
||||
if (!init_functions())
|
||||
@@ -404,4 +466,5 @@ START_TEST(string)
|
||||
test_string_buffer();
|
||||
test_substring();
|
||||
test_concat();
|
||||
+ test_compare();
|
||||
}
|
||||
--
|
||||
2.6.4
|
||||
|
1
patches/combase-WindowsCompareStringOrdinal/definition
Normal file
1
patches/combase-WindowsCompareStringOrdinal/definition
Normal file
@ -0,0 +1 @@
|
||||
Fixes: Implement combase.WindowsCompareStringOrdinal
|
@ -92,6 +92,7 @@ patch_enable_all ()
|
||||
enable_api_ms_win_crt_Stub_DLLs="$1"
|
||||
enable_authz_Stub_Functions="$1"
|
||||
enable_browseui_Progress_Dialog="$1"
|
||||
enable_combase_WindowsCompareStringOrdinal="$1"
|
||||
enable_comctl32_Button_Theming="$1"
|
||||
enable_comctl32_PROPSHEET_InsertPage="$1"
|
||||
enable_configure_Absolute_RPATH="$1"
|
||||
@ -404,6 +405,9 @@ patch_enable ()
|
||||
category-stable)
|
||||
enable_category_stable="$2"
|
||||
;;
|
||||
combase-WindowsCompareStringOrdinal)
|
||||
enable_combase_WindowsCompareStringOrdinal="$2"
|
||||
;;
|
||||
comctl32-Button_Theming)
|
||||
enable_comctl32_Button_Theming="$2"
|
||||
;;
|
||||
@ -2547,6 +2551,21 @@ if test "$enable_browseui_Progress_Dialog" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset combase-WindowsCompareStringOrdinal
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/api-ms-win-core-winrt-string-l1-1-0/api-ms-win-core-winrt-string-l1-1-0.spec, dlls/combase/combase.spec,
|
||||
# | dlls/combase/string.c, dlls/combase/tests/string.c
|
||||
# |
|
||||
if test "$enable_combase_WindowsCompareStringOrdinal" -eq 1; then
|
||||
patch_apply combase-WindowsCompareStringOrdinal/0001-combase-Implement-WindowsCompareStringOrdinal.patch
|
||||
patch_apply combase-WindowsCompareStringOrdinal/0002-combase-tests-Add-tests-for-WindowsCompareStringOrdi.patch
|
||||
(
|
||||
echo '+ { "Sebastian Lackner", "combase: Implement WindowsCompareStringOrdinal.", 1 },';
|
||||
echo '+ { "Sebastian Lackner", "combase/tests: Add tests for WindowsCompareStringOrdinal.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset comctl32-Button_Theming
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
|
Loading…
Reference in New Issue
Block a user