wine-staging/patches/combase-WindowsString/0001-combase-Implement-WindowsCompareStringOrdinal.patch

95 lines
3.9 KiB
Diff
Raw Normal View History

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