mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-09-13 09:17:20 -07:00
Rebase against 1098a673e61908bacf9459ea6a1ef062f9332d6b.
[combase-WindowsString] Removed patches to implement various additional combase string functions (accepted upstream). [kernel32-InterlockedPushListSList] Removed patches to forward InterlockedPushListSList to ntdll (improved patch accepted upstream). [ntdll-Unused_Import_Descr] Removed patch to ignore import descriptors with empty thunk list (accepted upstream). [server-Win8_Pseudo_Handles] Removed patch to implement support for Win8+ process/thread token pseudo handles (accepted upstream).
This commit is contained in:
parent
11f91d29fc
commit
b52385ec2a
@ -30,6 +30,5 @@ Fixes: Add shcore dll
|
||||
Depends: ole32-CoGetApartmentType
|
||||
Depends: kernel32-GetFinalPathNameByHandle
|
||||
Depends: kernel32-FreeUserPhysicalPages
|
||||
Depends: kernel32-InterlockedPushListSList
|
||||
Depends: kernel32-GetCurrentPackageFamilyName
|
||||
Depends: combase-RoApi
|
||||
|
@ -1,94 +0,0 @@
|
||||
From 70e8a8c08aa3ef0ac48d267d5917f998f4f09b16 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. (v2)
|
||||
|
||||
---
|
||||
.../api-ms-win-core-winrt-string-l1-1-0.spec | 2 +-
|
||||
dlls/combase/combase.spec | 2 +-
|
||||
dlls/combase/string.c | 33 ++++++++++++++++++++++
|
||||
include/winnls.h | 1 +
|
||||
4 files changed, 36 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..bd18a73 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 = CompareStringOrdinal(buf1, len1, buf2, len2, FALSE) - CSTR_EQUAL;
|
||||
+ return S_OK;
|
||||
+}
|
||||
diff --git a/include/winnls.h b/include/winnls.h
|
||||
index 4b4eb77..0370572 100644
|
||||
--- a/include/winnls.h
|
||||
+++ b/include/winnls.h
|
||||
@@ -831,6 +831,7 @@ WINBASEAPI INT WINAPI CompareStringA(LCID,DWORD,LPCSTR,INT,LPCSTR,INT);
|
||||
WINBASEAPI INT WINAPI CompareStringW(LCID,DWORD,LPCWSTR,INT,LPCWSTR,INT);
|
||||
#define CompareString WINELIB_NAME_AW(CompareString)
|
||||
WINBASEAPI INT WINAPI CompareStringEx(LPCWSTR,DWORD,LPCWSTR,INT,LPCWSTR,INT,LPNLSVERSIONINFO,LPVOID,LPARAM);
|
||||
+WINBASEAPI INT WINAPI CompareStringOrdinal(const WCHAR *,INT,const WCHAR *,INT,BOOL);
|
||||
WINBASEAPI LCID WINAPI ConvertDefaultLocale(LCID);
|
||||
WINBASEAPI BOOL WINAPI EnumCalendarInfoA(CALINFO_ENUMPROCA,LCID,CALID,CALTYPE);
|
||||
WINBASEAPI BOOL WINAPI EnumCalendarInfoW(CALINFO_ENUMPROCW,LCID,CALID,CALTYPE);
|
||||
--
|
||||
2.6.4
|
||||
|
@ -1,105 +0,0 @@
|
||||
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,77 +0,0 @@
|
||||
From 6b4166e822951ced51c2ac5637f37427a3a640a5 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sun, 17 Jan 2016 05:55:43 +0100
|
||||
Subject: combase: Implement WindowsTrimStringStart.
|
||||
|
||||
---
|
||||
.../api-ms-win-core-winrt-string-l1-1-0.spec | 2 +-
|
||||
dlls/combase/combase.spec | 2 +-
|
||||
dlls/combase/string.c | 28 ++++++++++++++++++++++
|
||||
3 files changed, 30 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 1b661aa..fe63810 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
|
||||
@@ -24,4 +24,4 @@
|
||||
@ stdcall WindowsSubstring(ptr long ptr) combase.WindowsSubstring
|
||||
@ stdcall WindowsSubstringWithSpecifiedLength(ptr long long ptr) combase.WindowsSubstringWithSpecifiedLength
|
||||
@ stub WindowsTrimStringEnd
|
||||
-@ stub WindowsTrimStringStart
|
||||
+@ stdcall WindowsTrimStringStart(ptr ptr ptr) combase.WindowsTrimStringStart
|
||||
diff --git a/dlls/combase/combase.spec b/dlls/combase/combase.spec
|
||||
index 430ca95..69f47d0 100644
|
||||
--- a/dlls/combase/combase.spec
|
||||
+++ b/dlls/combase/combase.spec
|
||||
@@ -305,4 +305,4 @@
|
||||
@ stdcall WindowsSubstring(ptr long ptr)
|
||||
@ stdcall WindowsSubstringWithSpecifiedLength(ptr long long ptr)
|
||||
@ stub WindowsTrimStringEnd
|
||||
-@ stub WindowsTrimStringStart
|
||||
+@ stdcall WindowsTrimStringStart(ptr ptr ptr)
|
||||
diff --git a/dlls/combase/string.c b/dlls/combase/string.c
|
||||
index bd18a73..868411c 100644
|
||||
--- a/dlls/combase/string.c
|
||||
+++ b/dlls/combase/string.c
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "windows.h"
|
||||
#include "winerror.h"
|
||||
#include "hstring.h"
|
||||
+#include "wine/unicode.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(winstring);
|
||||
@@ -405,3 +406,30 @@ HRESULT WINAPI WindowsCompareStringOrdinal(HSTRING str1, HSTRING str2, INT32 *re
|
||||
*res = CompareStringOrdinal(buf1, len1, buf2, len2, FALSE) - CSTR_EQUAL;
|
||||
return S_OK;
|
||||
}
|
||||
+
|
||||
+/***********************************************************************
|
||||
+ * WindowsTrimStringStart (combase.@)
|
||||
+ */
|
||||
+HRESULT WINAPI WindowsTrimStringStart(HSTRING str1, HSTRING str2, HSTRING *out)
|
||||
+{
|
||||
+ struct hstring_private *priv1 = impl_from_HSTRING(str1);
|
||||
+ struct hstring_private *priv2 = impl_from_HSTRING(str2);
|
||||
+ UINT32 start = 0;
|
||||
+
|
||||
+ TRACE("(%p, %p, %p)\n", str1, str2, out);
|
||||
+
|
||||
+ if (!out || !str2 || !priv2->length)
|
||||
+ return E_INVALIDARG;
|
||||
+ if (!str1)
|
||||
+ {
|
||||
+ *out = NULL;
|
||||
+ return S_OK;
|
||||
+ }
|
||||
+ for (start = 0; start < priv1->length; start++)
|
||||
+ {
|
||||
+ if (!memchrW(priv2->buffer, priv1->buffer[start], priv2->length))
|
||||
+ break;
|
||||
+ }
|
||||
+ return start ? WindowsCreateString(&priv1->buffer[start], priv1->length - start, out) :
|
||||
+ WindowsDuplicateString(str1, out);
|
||||
+}
|
||||
--
|
||||
2.6.4
|
||||
|
@ -1,71 +0,0 @@
|
||||
From ea49da0c37d81de96f1789306cca9322cf93e3e5 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sun, 17 Jan 2016 05:56:50 +0100
|
||||
Subject: combase: Implement WindowsTrimStringEnd.
|
||||
|
||||
---
|
||||
.../api-ms-win-core-winrt-string-l1-1-0.spec | 2 +-
|
||||
dlls/combase/combase.spec | 2 +-
|
||||
dlls/combase/string.c | 27 ++++++++++++++++++++++
|
||||
3 files changed, 29 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 fe63810..8b60a91 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
|
||||
@@ -23,5 +23,5 @@
|
||||
@ stdcall WindowsStringHasEmbeddedNull(ptr ptr) combase.WindowsStringHasEmbeddedNull
|
||||
@ stdcall WindowsSubstring(ptr long ptr) combase.WindowsSubstring
|
||||
@ stdcall WindowsSubstringWithSpecifiedLength(ptr long long ptr) combase.WindowsSubstringWithSpecifiedLength
|
||||
-@ stub WindowsTrimStringEnd
|
||||
+@ stdcall WindowsTrimStringEnd(ptr ptr ptr) combase.WindowsTrimStringEnd
|
||||
@ stdcall WindowsTrimStringStart(ptr ptr ptr) combase.WindowsTrimStringStart
|
||||
diff --git a/dlls/combase/combase.spec b/dlls/combase/combase.spec
|
||||
index 69f47d0..4bda470 100644
|
||||
--- a/dlls/combase/combase.spec
|
||||
+++ b/dlls/combase/combase.spec
|
||||
@@ -304,5 +304,5 @@
|
||||
@ stdcall WindowsStringHasEmbeddedNull(ptr ptr)
|
||||
@ stdcall WindowsSubstring(ptr long ptr)
|
||||
@ stdcall WindowsSubstringWithSpecifiedLength(ptr long long ptr)
|
||||
-@ stub WindowsTrimStringEnd
|
||||
+@ stdcall WindowsTrimStringEnd(ptr ptr ptr)
|
||||
@ stdcall WindowsTrimStringStart(ptr ptr ptr)
|
||||
diff --git a/dlls/combase/string.c b/dlls/combase/string.c
|
||||
index 868411c..56d84ad 100644
|
||||
--- a/dlls/combase/string.c
|
||||
+++ b/dlls/combase/string.c
|
||||
@@ -433,3 +433,30 @@ HRESULT WINAPI WindowsTrimStringStart(HSTRING str1, HSTRING str2, HSTRING *out)
|
||||
return start ? WindowsCreateString(&priv1->buffer[start], priv1->length - start, out) :
|
||||
WindowsDuplicateString(str1, out);
|
||||
}
|
||||
+
|
||||
+/***********************************************************************
|
||||
+ * WindowsTrimStringEnd (combase.@)
|
||||
+ */
|
||||
+HRESULT WINAPI WindowsTrimStringEnd(HSTRING str1, HSTRING str2, HSTRING *out)
|
||||
+{
|
||||
+ struct hstring_private *priv1 = impl_from_HSTRING(str1);
|
||||
+ struct hstring_private *priv2 = impl_from_HSTRING(str2);
|
||||
+ UINT32 len;
|
||||
+
|
||||
+ TRACE("(%p, %p, %p)\n", str1, str2, out);
|
||||
+
|
||||
+ if (!out || !str2 || !priv2->length)
|
||||
+ return E_INVALIDARG;
|
||||
+ if (!str1)
|
||||
+ {
|
||||
+ *out = NULL;
|
||||
+ return S_OK;
|
||||
+ }
|
||||
+ for (len = priv1->length; len > 0; len--)
|
||||
+ {
|
||||
+ if (!memchrW(priv2->buffer, priv1->buffer[len - 1], priv2->length))
|
||||
+ break;
|
||||
+ }
|
||||
+ return (len < priv1->length) ? WindowsCreateString(priv1->buffer, len, out) :
|
||||
+ WindowsDuplicateString(str1, out);
|
||||
+}
|
||||
--
|
||||
2.6.4
|
||||
|
@ -1,119 +0,0 @@
|
||||
From 6a3505cc0e0a632cdf9fb10c0b38b8f0a435a13d Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sun, 17 Jan 2016 05:58:08 +0100
|
||||
Subject: combase/tests: Add tests for WindowsTrimString{Start,End}.
|
||||
|
||||
---
|
||||
dlls/combase/tests/string.c | 77 +++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 77 insertions(+)
|
||||
|
||||
diff --git a/dlls/combase/tests/string.c b/dlls/combase/tests/string.c
|
||||
index db6c8f5..ac6c587 100644
|
||||
--- a/dlls/combase/tests/string.c
|
||||
+++ b/dlls/combase/tests/string.c
|
||||
@@ -42,6 +42,8 @@ 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 *);
|
||||
+static HRESULT (WINAPI *pWindowsTrimStringEnd)(HSTRING, HSTRING, HSTRING *);
|
||||
+static HRESULT (WINAPI *pWindowsTrimStringStart)(HSTRING, HSTRING, HSTRING *);
|
||||
|
||||
#define SET(x) p##x = (void*)GetProcAddress(hmod, #x)
|
||||
|
||||
@@ -68,6 +70,8 @@ static BOOL init_functions(void)
|
||||
SET(WindowsStringHasEmbeddedNull);
|
||||
SET(WindowsSubstring);
|
||||
SET(WindowsSubstringWithSpecifiedLength);
|
||||
+ SET(WindowsTrimStringEnd);
|
||||
+ SET(WindowsTrimStringStart);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -456,6 +460,78 @@ static void test_compare(void)
|
||||
ok(res == 0, "Expected 0, got %d\n", res);
|
||||
}
|
||||
|
||||
+static void test_trim(void)
|
||||
+{
|
||||
+ HSTRING str1, str2, trimmed;
|
||||
+ HSTRING_HEADER header1, header2;
|
||||
+
|
||||
+ /* Test trimming of string buffers */
|
||||
+ ok(pWindowsCreateString(input_string, 6, &str1) == S_OK, "Failed to create string\n");
|
||||
+ ok(pWindowsCreateString(input_string1, 3, &str2) == S_OK, "Failed to create string\n");
|
||||
+
|
||||
+ ok(pWindowsTrimStringStart(str1, str2, &trimmed) == S_OK, "Failed to trim string\n");
|
||||
+ check_string(trimmed, input_string2, 3, FALSE);
|
||||
+ ok(pWindowsDeleteString(trimmed) == S_OK, "Failed to delete string\n");
|
||||
+ ok(pWindowsTrimStringEnd(str1, str2, &trimmed) == S_OK, "Failed to trim string\n");
|
||||
+ ok(trimmed == str1, "Trimmed string created new string\n");
|
||||
+ check_string(trimmed, input_string, 6, FALSE);
|
||||
+ ok(pWindowsDeleteString(trimmed) == S_OK, "Failed to delete string\n");
|
||||
+
|
||||
+ ok(pWindowsDeleteString(str2) == S_OK, "Failed to delete string\n");
|
||||
+ ok(pWindowsCreateString(input_string2, 3, &str2) == S_OK, "Failed to create string\n");
|
||||
+
|
||||
+ ok(pWindowsTrimStringStart(str1, str2, &trimmed) == S_OK, "Failed to trim string\n");
|
||||
+ ok(trimmed == str1, "Trimmed string created new string\n");
|
||||
+ check_string(trimmed, input_string, 6, FALSE);
|
||||
+ ok(pWindowsDeleteString(trimmed) == S_OK, "Failed to delete string\n");
|
||||
+ ok(pWindowsTrimStringEnd(str1, str2, &trimmed) == S_OK, "Failed to trim string\n");
|
||||
+ check_string(trimmed, input_string1, 3, FALSE);
|
||||
+ ok(pWindowsDeleteString(trimmed) == S_OK, "Failed to delete string\n");
|
||||
+
|
||||
+ ok(pWindowsDeleteString(str2) == S_OK, "Failed to delete string\n");
|
||||
+ ok(pWindowsDeleteString(str1) == S_OK, "Failed to delete string\n");
|
||||
+
|
||||
+ /* Test trimming of string references */
|
||||
+ ok(pWindowsCreateStringReference(input_string, 6, &header1, &str1) == S_OK, "Failed to create string ref\n");
|
||||
+ ok(pWindowsCreateStringReference(input_string1, 3, &header2, &str2) == S_OK, "Failed to create string ref\n");
|
||||
+
|
||||
+ ok(pWindowsTrimStringStart(str1, str2, &trimmed) == S_OK, "Failed to trim string\n");
|
||||
+ check_string(trimmed, input_string2, 3, FALSE);
|
||||
+ ok(pWindowsDeleteString(trimmed) == S_OK, "Failed to delete string\n");
|
||||
+ ok(pWindowsTrimStringEnd(str1, str2, &trimmed) == S_OK, "Failed to trim string\n");
|
||||
+ ok(trimmed != str1, "Trimmed string ref didn't create new string\n");
|
||||
+ check_string(trimmed, input_string, 6, FALSE);
|
||||
+ ok(pWindowsDeleteString(trimmed) == S_OK, "Failed to delete string\n");
|
||||
+
|
||||
+ ok(pWindowsDeleteString(str2) == S_OK, "Failed to delete string ref\n");
|
||||
+ ok(pWindowsCreateStringReference(input_string2, 3, &header2, &str2) == S_OK, "Failed to create string ref\n");
|
||||
+
|
||||
+ ok(pWindowsTrimStringStart(str1, str2, &trimmed) == S_OK, "Failed to trim string\n");
|
||||
+ ok(trimmed != str1, "Trimmed string ref didn't create new string\n");
|
||||
+ check_string(trimmed, input_string, 6, FALSE);
|
||||
+ ok(pWindowsDeleteString(trimmed) == S_OK, "Failed to delete string\n");
|
||||
+ ok(pWindowsTrimStringEnd(str1, str2, &trimmed) == S_OK, "Failed to trim string\n");
|
||||
+ check_string(trimmed, input_string1, 3, FALSE);
|
||||
+ ok(pWindowsDeleteString(trimmed) == S_OK, "Failed to delete string\n");
|
||||
+
|
||||
+ ok(pWindowsDeleteString(str2) == S_OK, "Failed to delete string ref\n");
|
||||
+ ok(pWindowsDeleteString(str1) == S_OK, "Failed to delete string ref\n");
|
||||
+
|
||||
+ /* Test handling of a NULL string */
|
||||
+ ok(pWindowsCreateString(input_string, 6, &str1) == S_OK, "Failed to create string\n");
|
||||
+ ok(pWindowsTrimStringStart(NULL, NULL, NULL) == E_INVALIDARG, "Incorrect error handling\n");
|
||||
+ ok(pWindowsTrimStringStart(NULL, str1, NULL) == E_INVALIDARG, "Incorrect error handling\n");
|
||||
+ ok(pWindowsTrimStringStart(NULL, NULL, &trimmed) == E_INVALIDARG, "Incorrect error handling\n");
|
||||
+ ok(pWindowsTrimStringStart(NULL, str1, &trimmed) == S_OK, "Failed to trim empty string\n");
|
||||
+ ok(trimmed == NULL, "Trimming created new string\n");
|
||||
+ ok(pWindowsTrimStringEnd(NULL, NULL, NULL) == E_INVALIDARG, "Incorrect error handling\n");
|
||||
+ ok(pWindowsTrimStringEnd(NULL, str1, NULL) == E_INVALIDARG, "Incorrect error handling\n");
|
||||
+ ok(pWindowsTrimStringEnd(NULL, NULL, &trimmed) == E_INVALIDARG, "Incorrect error handling\n");
|
||||
+ ok(pWindowsTrimStringEnd(NULL, str1, &trimmed) == S_OK, "Failed to trim empty string\n");
|
||||
+ ok(trimmed == NULL, "Trimming created new string\n");
|
||||
+ ok(pWindowsDeleteString(str1) == S_OK, "Failed to delete string\n");
|
||||
+}
|
||||
+
|
||||
START_TEST(string)
|
||||
{
|
||||
if (!init_functions())
|
||||
@@ -467,4 +543,5 @@ START_TEST(string)
|
||||
test_substring();
|
||||
test_concat();
|
||||
test_compare();
|
||||
+ test_trim();
|
||||
}
|
||||
--
|
||||
2.6.4
|
||||
|
@ -1,3 +0,0 @@
|
||||
Fixes: Implement combase.WindowsCompareStringOrdinal
|
||||
Fixes: Implement combase.WindowsTrimStringStart
|
||||
Fixes: Implement combase.WindowsTrimStringEnd
|
@ -1,37 +0,0 @@
|
||||
From 81cb0869aced99d1ff549b3f3ddc98e6ba0d1fc9 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Tue, 12 Jan 2016 05:30:09 +0100
|
||||
Subject: kernel32: Forward InterlockedPushListSList to ntdll.
|
||||
|
||||
---
|
||||
.../api-ms-win-core-interlocked-l1-1-0.spec | 2 +-
|
||||
dlls/kernel32/kernel32.spec | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/api-ms-win-core-interlocked-l1-1-0/api-ms-win-core-interlocked-l1-1-0.spec b/dlls/api-ms-win-core-interlocked-l1-1-0/api-ms-win-core-interlocked-l1-1-0.spec
|
||||
index 9c6d25c..695e308 100644
|
||||
--- a/dlls/api-ms-win-core-interlocked-l1-1-0/api-ms-win-core-interlocked-l1-1-0.spec
|
||||
+++ b/dlls/api-ms-win-core-interlocked-l1-1-0/api-ms-win-core-interlocked-l1-1-0.spec
|
||||
@@ -8,5 +8,5 @@
|
||||
@ stdcall -arch=i386 InterlockedIncrement(ptr) kernel32.InterlockedIncrement
|
||||
@ stdcall InterlockedPopEntrySList(ptr) kernel32.InterlockedPopEntrySList
|
||||
@ stdcall InterlockedPushEntrySList(ptr ptr) kernel32.InterlockedPushEntrySList
|
||||
-@ stub InterlockedPushListSList
|
||||
+@ stdcall InterlockedPushListSList(ptr ptr ptr long) kernel32.InterlockedPushListSList
|
||||
@ stdcall QueryDepthSList(ptr) kernel32.QueryDepthSList
|
||||
diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec
|
||||
index 68325ba..124bd74 100644
|
||||
--- a/dlls/kernel32/kernel32.spec
|
||||
+++ b/dlls/kernel32/kernel32.spec
|
||||
@@ -957,7 +957,7 @@
|
||||
@ stdcall -arch=i386 InterlockedIncrement(ptr)
|
||||
@ stdcall InterlockedPopEntrySList(ptr) ntdll.RtlInterlockedPopEntrySList
|
||||
@ stdcall InterlockedPushEntrySList(ptr ptr) ntdll.RtlInterlockedPushEntrySList
|
||||
-# @ stub InterlockedPushListSList
|
||||
+@ stdcall InterlockedPushListSList(ptr ptr ptr long) ntdll.RtlInterlockedPushListSList
|
||||
@ stub InvalidateConsoleDIBits
|
||||
@ stdcall InvalidateNLSCache()
|
||||
@ stdcall IsBadCodePtr(ptr)
|
||||
--
|
||||
2.6.4
|
||||
|
@ -1 +0,0 @@
|
||||
Fixes: Forward InterlockedPushListSList to ntdll
|
@ -1,4 +1,4 @@
|
||||
From a76e0d5f4e8211975ede9f1bf65522a31114112a Mon Sep 17 00:00:00 2001
|
||||
From cea071b746980986f7a1a5c502445588c95e6f37 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 13 Dec 2014 05:34:48 +0100
|
||||
Subject: ntdll: Implement loader redirection scheme.
|
||||
@ -8,10 +8,10 @@ Subject: ntdll: Implement loader redirection scheme.
|
||||
1 file changed, 44 insertions(+), 22 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
|
||||
index 0486517..7877f04 100644
|
||||
index 1e2e28e..94ca2f0 100644
|
||||
--- a/dlls/ntdll/loader.c
|
||||
+++ b/dlls/ntdll/loader.c
|
||||
@@ -85,6 +85,7 @@ struct builtin_load_info
|
||||
@@ -92,6 +92,7 @@ struct builtin_load_info
|
||||
{
|
||||
const WCHAR *load_path;
|
||||
const WCHAR *filename;
|
||||
@ -19,7 +19,7 @@ index 0486517..7877f04 100644
|
||||
NTSTATUS status;
|
||||
WINE_MODREF *wm;
|
||||
};
|
||||
@@ -110,7 +111,8 @@ static WINE_MODREF *cached_modref;
|
||||
@@ -117,7 +118,8 @@ static WINE_MODREF *cached_modref;
|
||||
static WINE_MODREF *current_modref;
|
||||
static WINE_MODREF *last_failed_modref;
|
||||
|
||||
@ -29,7 +29,7 @@ index 0486517..7877f04 100644
|
||||
static NTSTATUS process_attach( WINE_MODREF *wm, LPVOID lpReserved );
|
||||
static FARPROC find_ordinal_export( HMODULE module, const IMAGE_EXPORT_DIRECTORY *exports,
|
||||
DWORD exp_size, DWORD ordinal, LPCWSTR load_path );
|
||||
@@ -436,7 +438,7 @@ static FARPROC find_forwarded_export( HMODULE module, const char *forward, LPCWS
|
||||
@@ -443,7 +445,7 @@ static FARPROC find_forwarded_export( HMODULE module, const char *forward, LPCWS
|
||||
if (!(wm = find_basename_module( mod_name )))
|
||||
{
|
||||
TRACE( "delay loading %s for '%s'\n", debugstr_w(mod_name), forward );
|
||||
@ -38,7 +38,7 @@ index 0486517..7877f04 100644
|
||||
!(wm->ldr.Flags & LDR_DONT_RESOLVE_REFS))
|
||||
{
|
||||
if (process_attach( wm, NULL ) != STATUS_SUCCESS)
|
||||
@@ -585,7 +587,7 @@ static WINE_MODREF *import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *d
|
||||
@@ -599,7 +601,7 @@ static BOOL import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *descr, LP
|
||||
{
|
||||
ascii_to_unicode( buffer, name, len );
|
||||
buffer[len] = 0;
|
||||
@ -47,8 +47,8 @@ index 0486517..7877f04 100644
|
||||
}
|
||||
else /* need to allocate a larger buffer */
|
||||
{
|
||||
@@ -593,7 +595,7 @@ static WINE_MODREF *import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *d
|
||||
if (!ptr) return NULL;
|
||||
@@ -607,7 +609,7 @@ static BOOL import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *descr, LP
|
||||
if (!ptr) return FALSE;
|
||||
ascii_to_unicode( ptr, name, len );
|
||||
ptr[len] = 0;
|
||||
- status = load_dll( load_path, ptr, 0, &wmImp );
|
||||
@ -56,7 +56,7 @@ index 0486517..7877f04 100644
|
||||
RtlFreeHeap( GetProcessHeap(), 0, ptr );
|
||||
}
|
||||
|
||||
@@ -909,7 +911,7 @@ static NTSTATUS fixup_imports( WINE_MODREF *wm, LPCWSTR load_path )
|
||||
@@ -927,7 +929,7 @@ static NTSTATUS fixup_imports( WINE_MODREF *wm, LPCWSTR load_path )
|
||||
* Allocate a WINE_MODREF structure and add it to the process list
|
||||
* The loader_section must be locked while calling this function.
|
||||
*/
|
||||
@ -65,7 +65,7 @@ index 0486517..7877f04 100644
|
||||
{
|
||||
WINE_MODREF *wm;
|
||||
const WCHAR *p;
|
||||
@@ -932,7 +934,7 @@ static WINE_MODREF *alloc_module( HMODULE hModule, LPCWSTR filename )
|
||||
@@ -950,7 +952,7 @@ static WINE_MODREF *alloc_module( HMODULE hModule, LPCWSTR filename )
|
||||
wm->ldr.TimeDateStamp = 0;
|
||||
wm->ldr.ActivationContext = 0;
|
||||
|
||||
@ -74,7 +74,7 @@ index 0486517..7877f04 100644
|
||||
if ((p = strrchrW( wm->ldr.FullDllName.Buffer, '\\' ))) p++;
|
||||
else p = wm->ldr.FullDllName.Buffer;
|
||||
RtlInitUnicodeString( &wm->ldr.BaseDllName, p );
|
||||
@@ -1549,7 +1551,7 @@ static void load_builtin_callback( void *module, const char *filename )
|
||||
@@ -1589,7 +1591,7 @@ static void load_builtin_callback( void *module, const char *filename )
|
||||
return;
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ index 0486517..7877f04 100644
|
||||
RtlFreeHeap( GetProcessHeap(), 0, fullname );
|
||||
if (!wm)
|
||||
{
|
||||
@@ -1605,8 +1607,8 @@ static void load_builtin_callback( void *module, const char *filename )
|
||||
@@ -1771,8 +1773,8 @@ static NTSTATUS perform_relocations( void *module, SIZE_T len )
|
||||
/******************************************************************************
|
||||
* load_native_dll (internal)
|
||||
*/
|
||||
@ -94,7 +94,7 @@ index 0486517..7877f04 100644
|
||||
{
|
||||
void *module;
|
||||
HANDLE mapping;
|
||||
@@ -1630,7 +1632,7 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, LPCWSTR name, HANDLE file,
|
||||
@@ -1806,7 +1808,7 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, LPCWSTR name, HANDLE file,
|
||||
|
||||
/* create the MODREF */
|
||||
|
||||
@ -103,7 +103,7 @@ index 0486517..7877f04 100644
|
||||
{
|
||||
status = STATUS_NO_MEMORY;
|
||||
goto done;
|
||||
@@ -1692,8 +1694,8 @@ done:
|
||||
@@ -1870,8 +1872,8 @@ done:
|
||||
/***********************************************************************
|
||||
* load_builtin_dll
|
||||
*/
|
||||
@ -114,7 +114,7 @@ index 0486517..7877f04 100644
|
||||
{
|
||||
char error[256], dllname[MAX_PATH];
|
||||
const WCHAR *name, *p;
|
||||
@@ -1713,6 +1715,7 @@ static NTSTATUS load_builtin_dll( LPCWSTR load_path, LPCWSTR path, HANDLE file,
|
||||
@@ -1891,6 +1893,7 @@ static NTSTATUS load_builtin_dll( LPCWSTR load_path, LPCWSTR path, HANDLE file,
|
||||
*/
|
||||
info.load_path = load_path;
|
||||
info.filename = NULL;
|
||||
@ -122,7 +122,7 @@ index 0486517..7877f04 100644
|
||||
info.status = STATUS_SUCCESS;
|
||||
info.wm = NULL;
|
||||
|
||||
@@ -2153,14 +2156,14 @@ overflow:
|
||||
@@ -2331,14 +2334,14 @@ overflow:
|
||||
return STATUS_BUFFER_TOO_SMALL;
|
||||
}
|
||||
|
||||
@ -139,7 +139,7 @@ index 0486517..7877f04 100644
|
||||
{
|
||||
BOOL data = flags & (LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE);
|
||||
enum loadorder loadorder;
|
||||
@@ -2198,6 +2201,25 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_
|
||||
@@ -2376,6 +2379,25 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_
|
||||
}
|
||||
|
||||
main_exe = get_modref( NtCurrentTeb()->Peb->ImageBaseAddress );
|
||||
@ -165,7 +165,7 @@ index 0486517..7877f04 100644
|
||||
loadorder = get_load_order( main_exe ? main_exe->ldr.BaseDllName.Buffer : NULL, filename );
|
||||
|
||||
if (handle && is_fake_dll( handle ))
|
||||
@@ -2220,22 +2242,22 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_
|
||||
@@ -2398,22 +2420,22 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_
|
||||
if (!handle) nts = STATUS_DLL_NOT_FOUND;
|
||||
else
|
||||
{
|
||||
@ -193,7 +193,7 @@ index 0486517..7877f04 100644
|
||||
if (nts == STATUS_SUCCESS && loadorder == LO_DEFAULT &&
|
||||
(MODULE_InitDLL( *pwm, DLL_WINE_PREATTACH, NULL ) != STATUS_SUCCESS))
|
||||
{
|
||||
@@ -2245,7 +2267,7 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_
|
||||
@@ -2423,7 +2445,7 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_
|
||||
nts = STATUS_DLL_NOT_FOUND;
|
||||
}
|
||||
if (nts == STATUS_DLL_NOT_FOUND && loadorder != LO_BUILTIN)
|
||||
@ -202,7 +202,7 @@ index 0486517..7877f04 100644
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2278,7 +2300,7 @@ NTSTATUS WINAPI DECLSPEC_HOTPATCH LdrLoadDll(LPCWSTR path_name, DWORD flags,
|
||||
@@ -2456,7 +2478,7 @@ NTSTATUS WINAPI DECLSPEC_HOTPATCH LdrLoadDll(LPCWSTR path_name, DWORD flags,
|
||||
RtlEnterCriticalSection( &loader_section );
|
||||
|
||||
if (!path_name) path_name = NtCurrentTeb()->Peb->ProcessParameters->DllPath.Buffer;
|
||||
@ -211,7 +211,7 @@ index 0486517..7877f04 100644
|
||||
|
||||
if (nts == STATUS_SUCCESS && !(wm->ldr.Flags & LDR_DONT_RESOLVE_REFS))
|
||||
{
|
||||
@@ -3241,7 +3263,7 @@ void __wine_process_init(void)
|
||||
@@ -3419,7 +3441,7 @@ void __wine_process_init(void)
|
||||
/* setup the load callback and create ntdll modref */
|
||||
wine_dll_set_callback( load_builtin_callback );
|
||||
|
||||
@ -221,5 +221,5 @@ index 0486517..7877f04 100644
|
||||
MESSAGE( "wine: could not load kernel32.dll, status %x\n", status );
|
||||
exit(1);
|
||||
--
|
||||
2.4.5
|
||||
2.7.1
|
||||
|
||||
|
@ -1,36 +0,0 @@
|
||||
From 62e17ad9aac4093654a2347aca9fd62f9e0499a8 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Thu, 7 Jan 2016 04:07:25 +0100
|
||||
Subject: ntdll: Skip unused import descriptors when loading libraries.
|
||||
|
||||
---
|
||||
dlls/ntdll/loader.c | 13 ++++++++++++-
|
||||
1 file changed, 12 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
|
||||
index 74feb97..d552a32 100644
|
||||
--- a/dlls/ntdll/loader.c
|
||||
+++ b/dlls/ntdll/loader.c
|
||||
@@ -901,7 +901,18 @@ static NTSTATUS fixup_imports( WINE_MODREF *wm, LPCWSTR load_path )
|
||||
status = STATUS_SUCCESS;
|
||||
for (i = 0; i < nb_imports; i++)
|
||||
{
|
||||
- if (!(wm->deps[i] = import_dll( wm->ldr.BaseAddress, &imports[i], load_path )))
|
||||
+ const IMAGE_IMPORT_DESCRIPTOR *descr = &imports[i];
|
||||
+ const IMAGE_THUNK_DATA *import_list = get_rva( wm->ldr.BaseAddress, descr->u.OriginalFirstThunk ?
|
||||
+ (DWORD)descr->u.OriginalFirstThunk : (DWORD)descr->FirstThunk );
|
||||
+ if (!import_list->u1.Ordinal)
|
||||
+ {
|
||||
+ const char *name = get_rva( wm->ldr.BaseAddress, descr->Name );
|
||||
+ WARN( "Skipping unused import %s\n", debugstr_a(name) );
|
||||
+ wm->deps[i] = NULL;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ if (!(wm->deps[i] = import_dll( wm->ldr.BaseAddress, descr, load_path )))
|
||||
status = STATUS_DLL_NOT_FOUND;
|
||||
}
|
||||
current_modref = prev;
|
||||
--
|
||||
2.6.4
|
||||
|
@ -1 +0,0 @@
|
||||
Fixes: [39792] Ignore import descriptors with empty thunk list
|
@ -51,7 +51,7 @@ usage()
|
||||
# Get the upstream commit sha
|
||||
upstream_commit()
|
||||
{
|
||||
echo "9c98d632779862aae15e9e3a25f59065fae03386"
|
||||
echo "1098a673e61908bacf9459ea6a1ef062f9332d6b"
|
||||
}
|
||||
|
||||
# Show version information
|
||||
@ -96,7 +96,6 @@ patch_enable_all ()
|
||||
enable_avifile_dll16_AVIStreamGetFrame="$1"
|
||||
enable_browseui_Progress_Dialog="$1"
|
||||
enable_combase_RoApi="$1"
|
||||
enable_combase_WindowsString="$1"
|
||||
enable_comctl32_Button_Theming="$1"
|
||||
enable_comctl32_PROPSHEET_InsertPage="$1"
|
||||
enable_comctl32_TTM_ADDTOOLW="$1"
|
||||
@ -166,7 +165,6 @@ patch_enable_all ()
|
||||
enable_kernel32_FreeUserPhysicalPages="$1"
|
||||
enable_kernel32_GetCurrentPackageFamilyName="$1"
|
||||
enable_kernel32_GetFinalPathNameByHandle="$1"
|
||||
enable_kernel32_InterlockedPushListSList="$1"
|
||||
enable_kernel32_LocaleNameToLCID="$1"
|
||||
enable_kernel32_Named_Pipe="$1"
|
||||
enable_kernel32_NeedCurrentDirectoryForExePath="$1"
|
||||
@ -231,7 +229,6 @@ patch_enable_all ()
|
||||
enable_ntdll_SystemRoot_Symlink="$1"
|
||||
enable_ntdll_ThreadTime="$1"
|
||||
enable_ntdll_Threading="$1"
|
||||
enable_ntdll_Unused_Import_Descr="$1"
|
||||
enable_ntdll_User_Shared_Data="$1"
|
||||
enable_ntdll_WRITECOPY="$1"
|
||||
enable_ntdll_Wait_User_APC="$1"
|
||||
@ -276,7 +273,6 @@ patch_enable_all ()
|
||||
enable_server_Signal_Thread="$1"
|
||||
enable_server_Stored_ACLs="$1"
|
||||
enable_server_Timestamp_Compat="$1"
|
||||
enable_server_Win8_Pseudo_Handles="$1"
|
||||
enable_services_SERVICE_FILE_SYSTEM_DRIVER="$1"
|
||||
enable_setupapi_Display_Device="$1"
|
||||
enable_setupapi_HSPFILEQ_Check_Type="$1"
|
||||
@ -436,9 +432,6 @@ patch_enable ()
|
||||
combase-RoApi)
|
||||
enable_combase_RoApi="$2"
|
||||
;;
|
||||
combase-WindowsString)
|
||||
enable_combase_WindowsString="$2"
|
||||
;;
|
||||
comctl32-Button_Theming)
|
||||
enable_comctl32_Button_Theming="$2"
|
||||
;;
|
||||
@ -646,9 +639,6 @@ patch_enable ()
|
||||
kernel32-GetFinalPathNameByHandle)
|
||||
enable_kernel32_GetFinalPathNameByHandle="$2"
|
||||
;;
|
||||
kernel32-InterlockedPushListSList)
|
||||
enable_kernel32_InterlockedPushListSList="$2"
|
||||
;;
|
||||
kernel32-LocaleNameToLCID)
|
||||
enable_kernel32_LocaleNameToLCID="$2"
|
||||
;;
|
||||
@ -841,9 +831,6 @@ patch_enable ()
|
||||
ntdll-Threading)
|
||||
enable_ntdll_Threading="$2"
|
||||
;;
|
||||
ntdll-Unused_Import_Descr)
|
||||
enable_ntdll_Unused_Import_Descr="$2"
|
||||
;;
|
||||
ntdll-User_Shared_Data)
|
||||
enable_ntdll_User_Shared_Data="$2"
|
||||
;;
|
||||
@ -976,9 +963,6 @@ patch_enable ()
|
||||
server-Timestamp_Compat)
|
||||
enable_server_Timestamp_Compat="$2"
|
||||
;;
|
||||
server-Win8_Pseudo_Handles)
|
||||
enable_server_Win8_Pseudo_Handles="$2"
|
||||
;;
|
||||
services-SERVICE_FILE_SYSTEM_DRIVER)
|
||||
enable_services_SERVICE_FILE_SYSTEM_DRIVER="$2"
|
||||
;;
|
||||
@ -2229,9 +2213,6 @@ if test "$enable_api_ms_win_Stub_DLLs" -eq 1; then
|
||||
if test "$enable_kernel32_GetFinalPathNameByHandle" -gt 1; then
|
||||
abort "Patchset kernel32-GetFinalPathNameByHandle disabled, but api-ms-win-Stub_DLLs depends on that."
|
||||
fi
|
||||
if test "$enable_kernel32_InterlockedPushListSList" -gt 1; then
|
||||
abort "Patchset kernel32-InterlockedPushListSList disabled, but api-ms-win-Stub_DLLs depends on that."
|
||||
fi
|
||||
if test "$enable_ole32_CoGetApartmentType" -gt 1; then
|
||||
abort "Patchset ole32-CoGetApartmentType disabled, but api-ms-win-Stub_DLLs depends on that."
|
||||
fi
|
||||
@ -2239,7 +2220,6 @@ if test "$enable_api_ms_win_Stub_DLLs" -eq 1; then
|
||||
enable_kernel32_FreeUserPhysicalPages=1
|
||||
enable_kernel32_GetCurrentPackageFamilyName=1
|
||||
enable_kernel32_GetFinalPathNameByHandle=1
|
||||
enable_kernel32_InterlockedPushListSList=1
|
||||
enable_ole32_CoGetApartmentType=1
|
||||
fi
|
||||
|
||||
@ -2583,18 +2563,6 @@ if test "$enable_kernel32_GetFinalPathNameByHandle" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset kernel32-InterlockedPushListSList
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/api-ms-win-core-interlocked-l1-1-0/api-ms-win-core-interlocked-l1-1-0.spec, dlls/kernel32/kernel32.spec
|
||||
# |
|
||||
if test "$enable_kernel32_InterlockedPushListSList" -eq 1; then
|
||||
patch_apply kernel32-InterlockedPushListSList/0001-kernel32-Forward-InterlockedPushListSList-to-ntdll.patch
|
||||
(
|
||||
echo '+ { "Sebastian Lackner", "kernel32: Forward InterlockedPushListSList to ntdll.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset ole32-CoGetApartmentType
|
||||
# |
|
||||
# | Modified files:
|
||||
@ -2613,7 +2581,7 @@ fi
|
||||
# |
|
||||
# | This patchset has the following (direct or indirect) dependencies:
|
||||
# | * combase-RoApi, kernel32-FreeUserPhysicalPages, kernel32-GetCurrentPackageFamilyName, kernel32-GetFinalPathNameByHandle,
|
||||
# | kernel32-InterlockedPushListSList, ole32-CoGetApartmentType
|
||||
# | ole32-CoGetApartmentType
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * configure.ac, dlls/api-ms-win-appmodel-runtime-l1-1-1/Makefile.in, dlls/api-ms-win-appmodel-runtime-l1-1-1/api-ms-win-
|
||||
@ -2793,27 +2761,6 @@ if test "$enable_browseui_Progress_Dialog" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset combase-WindowsString
|
||||
# |
|
||||
# | 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, include/winnls.h
|
||||
# |
|
||||
if test "$enable_combase_WindowsString" -eq 1; then
|
||||
patch_apply combase-WindowsString/0001-combase-Implement-WindowsCompareStringOrdinal.patch
|
||||
patch_apply combase-WindowsString/0002-combase-tests-Add-tests-for-WindowsCompareStringOrdi.patch
|
||||
patch_apply combase-WindowsString/0003-combase-Implement-WindowsTrimStringStart.patch
|
||||
patch_apply combase-WindowsString/0004-combase-Implement-WindowsTrimStringEnd.patch
|
||||
patch_apply combase-WindowsString/0005-combase-tests-Add-tests-for-WindowsTrimString-Start-.patch
|
||||
(
|
||||
echo '+ { "Sebastian Lackner", "combase: Implement WindowsCompareStringOrdinal.", 2 },';
|
||||
echo '+ { "Sebastian Lackner", "combase/tests: Add tests for WindowsCompareStringOrdinal.", 1 },';
|
||||
echo '+ { "Sebastian Lackner", "combase: Implement WindowsTrimStringStart.", 1 },';
|
||||
echo '+ { "Sebastian Lackner", "combase: Implement WindowsTrimStringEnd.", 1 },';
|
||||
echo '+ { "Sebastian Lackner", "combase/tests: Add tests for WindowsTrimString{Start,End}.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset comctl32-Button_Theming
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
@ -5064,21 +5011,6 @@ if test "$enable_ntdll_Threading" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset ntdll-Unused_Import_Descr
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
# | * [#39792] Ignore import descriptors with empty thunk list
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/ntdll/loader.c
|
||||
# |
|
||||
if test "$enable_ntdll_Unused_Import_Descr" -eq 1; then
|
||||
patch_apply ntdll-Unused_Import_Descr/0001-ntdll-Skip-unused-import-descriptors-when-loading-li.patch
|
||||
(
|
||||
echo '+ { "Sebastian Lackner", "ntdll: Skip unused import descriptors when loading libraries.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset ntdll-User_Shared_Data
|
||||
# |
|
||||
# | Modified files:
|
||||
@ -5777,18 +5709,6 @@ if test "$enable_server_Timestamp_Compat" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset server-Win8_Pseudo_Handles
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/advapi32/tests/security.c, include/winbase.h, server/handle.c
|
||||
# |
|
||||
if test "$enable_server_Win8_Pseudo_Handles" -eq 1; then
|
||||
patch_apply server-Win8_Pseudo_Handles/0001-server-Implement-support-for-pseudo-tokens-CurrentPr.patch
|
||||
(
|
||||
echo '+ { "Michael Müller", "server: Implement support for pseudo tokens CurrentProcessToken, CurrentThreadToken, CurrentThreadEffectiveToken.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset services-SERVICE_FILE_SYSTEM_DRIVER
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
|
@ -1,126 +0,0 @@
|
||||
From e68fdb7c4406d7b01a653480e28153c0e2c87bbf Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sun, 17 Jan 2016 20:32:28 +0100
|
||||
Subject: server: Implement support for pseudo tokens CurrentProcessToken,
|
||||
CurrentThreadToken, CurrentThreadEffectiveToken.
|
||||
|
||||
---
|
||||
dlls/advapi32/tests/security.c | 52 ++++++++++++++++++++++++++++++++++++++++++
|
||||
include/winbase.h | 15 ++++++++++++
|
||||
server/handle.c | 6 +++++
|
||||
3 files changed, 73 insertions(+)
|
||||
|
||||
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
|
||||
index c71e6fe..a3d194c 100644
|
||||
--- a/dlls/advapi32/tests/security.c
|
||||
+++ b/dlls/advapi32/tests/security.c
|
||||
@@ -6070,6 +6070,57 @@ static void test_GetSidIdentifierAuthority(void)
|
||||
ok(GetLastError() == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", GetLastError());
|
||||
}
|
||||
|
||||
+static void test_pseudo_tokens(void)
|
||||
+{
|
||||
+ TOKEN_STATISTICS statistics1, statistics2;
|
||||
+ HANDLE token;
|
||||
+ DWORD retlen;
|
||||
+ BOOL ret;
|
||||
+
|
||||
+ ret = OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
|
||||
+ ok(ret, "OpenProcessToken failed with error %u\n", GetLastError());
|
||||
+ memset(&statistics1, 0x11, sizeof(statistics1));
|
||||
+ ret = GetTokenInformation(token, TokenStatistics, &statistics1, sizeof(statistics1), &retlen);
|
||||
+ ok(ret, "GetTokenInformation failed with %u\n", GetLastError());
|
||||
+ CloseHandle(token);
|
||||
+
|
||||
+ /* test GetCurrentProcessToken() */
|
||||
+ SetLastError(0xdeadbeef);
|
||||
+ memset(&statistics2, 0x22, sizeof(statistics2));
|
||||
+ ret = GetTokenInformation(GetCurrentProcessToken(), TokenStatistics,
|
||||
+ &statistics2, sizeof(statistics2), &retlen);
|
||||
+ ok(ret || broken(GetLastError() == ERROR_INVALID_HANDLE),
|
||||
+ "GetTokenInformation failed with %u\n", GetLastError());
|
||||
+ if (ret)
|
||||
+ ok(!memcmp(&statistics1, &statistics2, sizeof(statistics1)), "Token statistics are not equal\n");
|
||||
+ else
|
||||
+ win_skip("Failed to get information about pseudo process token, skipping comparison\n");
|
||||
+
|
||||
+ /* test GetCurrentThreadEffectiveToken() */
|
||||
+ SetLastError(0xdeadbeef);
|
||||
+ memset(&statistics2, 0x22, sizeof(statistics2));
|
||||
+ ret = GetTokenInformation(GetCurrentThreadEffectiveToken(), TokenStatistics,
|
||||
+ &statistics2, sizeof(statistics2), &retlen);
|
||||
+ ok(ret || broken(GetLastError() == ERROR_INVALID_HANDLE),
|
||||
+ "GetTokenInformation failed with %u\n", GetLastError());
|
||||
+ if (ret)
|
||||
+ ok(!memcmp(&statistics1, &statistics2, sizeof(statistics1)), "Token statistics are not equal\n");
|
||||
+ else
|
||||
+ win_skip("Failed to get information about pseudo effective thread token, skipping comparison\n");
|
||||
+
|
||||
+ SetLastError(0xdeadbeef);
|
||||
+ ret = OpenThreadToken(GetCurrentThread(), TOKEN_QUERY, TRUE, &token);
|
||||
+ ok(!ret, "OpenThreadToken should have failed\n");
|
||||
+ ok(GetLastError() == ERROR_NO_TOKEN, "Expected ERROR_NO_TOKEN, got %u\n", GetLastError());
|
||||
+
|
||||
+ /* test GetCurrentThreadToken() */
|
||||
+ SetLastError(0xdeadbeef);
|
||||
+ ret = GetTokenInformation(GetCurrentThreadToken(), TokenStatistics,
|
||||
+ &statistics2, sizeof(statistics2), &retlen);
|
||||
+ todo_wine ok(GetLastError() == ERROR_NO_TOKEN || broken(GetLastError() == ERROR_INVALID_HANDLE),
|
||||
+ "Expected ERROR_NO_TOKEN, got %u\n", GetLastError());
|
||||
+}
|
||||
+
|
||||
START_TEST(security)
|
||||
{
|
||||
init();
|
||||
@@ -6115,4 +6166,5 @@ START_TEST(security)
|
||||
test_AddAce();
|
||||
test_system_security_access();
|
||||
test_GetSidIdentifierAuthority();
|
||||
+ test_pseudo_tokens();
|
||||
}
|
||||
diff --git a/include/winbase.h b/include/winbase.h
|
||||
index f35391d..f5c2557 100644
|
||||
--- a/include/winbase.h
|
||||
+++ b/include/winbase.h
|
||||
@@ -2973,6 +2973,21 @@ WINBASEAPI VOID WINAPI SetLastError(DWORD);
|
||||
#define GetCurrentThread() ((HANDLE)~(ULONG_PTR)1)
|
||||
#endif
|
||||
|
||||
+static FORCEINLINE HANDLE GetCurrentProcessToken(void)
|
||||
+{
|
||||
+ return (HANDLE)~(LONG_PTR)3;
|
||||
+}
|
||||
+
|
||||
+static FORCEINLINE HANDLE GetCurrentThreadToken(void)
|
||||
+{
|
||||
+ return (HANDLE)~(LONG_PTR)4;
|
||||
+}
|
||||
+
|
||||
+static FORCEINLINE HANDLE GetCurrentThreadEffectiveToken(void)
|
||||
+{
|
||||
+ return (HANDLE)~(LONG_PTR)5;
|
||||
+}
|
||||
+
|
||||
/* WinMain(entry point) must be declared in winbase.h. */
|
||||
/* If this is not declared, we cannot compile many sources written with C++. */
|
||||
int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int);
|
||||
diff --git a/server/handle.c b/server/handle.c
|
||||
index 05d71ba..76e1cca 100644
|
||||
--- a/server/handle.c
|
||||
+++ b/server/handle.c
|
||||
@@ -402,6 +402,12 @@ static inline struct object *get_magic_handle( obj_handle_t handle )
|
||||
{
|
||||
switch(handle)
|
||||
{
|
||||
+ case 0xfffffffa: /* current thread impersonation token pseudo-handle */
|
||||
+ return (struct object *)thread_get_impersonation_token( current );
|
||||
+ case 0xfffffffb: /* current thread token pseudo-handle */
|
||||
+ return (struct object *)current->token;
|
||||
+ case 0xfffffffc: /* current process token pseudo-handle */
|
||||
+ return (struct object *)current->process->token;
|
||||
case 0xfffffffe: /* current thread pseudo-handle */
|
||||
return ¤t->obj;
|
||||
case 0x7fffffff: /* current process pseudo-handle */
|
||||
--
|
||||
2.6.4
|
||||
|
@ -1 +0,0 @@
|
||||
Fixes: Implement support for Win8+ process/thread token pseudo handles
|
Loading…
Reference in New Issue
Block a user