From d56994dbfa2287f2c8d551e5b15c9e9d6c26d64b Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Tue, 16 May 2017 00:22:58 +0200 Subject: [PATCH] Added patches with multiple improvements for propsys functions. --- patches/patchinstall.sh | 26 ++++++ ...ort-for-VT_I1-and-VT_UI1-to-PropVari.patch | 49 +++++++++++ ...ort-for-VT_LPWSTR-and-VT_BSTR-to-Pro.patch | 44 ++++++++++ ...ort-for-VT_BSTR-to-PropVariantChange.patch | 26 ++++++ ...FILETIME-handling-by-PropVariantChan.patch | 67 +++++++++++++++ ...ort-for-VT_LPSTR-to-PropVariantChang.patch | 48 +++++++++++ ...ort-for-VT_LPSTR-and-VT_LPWSTR-to-Pr.patch | 86 +++++++++++++++++++ 7 files changed, 346 insertions(+) create mode 100644 patches/propsys-Improvements/0001-propsys-Add-support-for-VT_I1-and-VT_UI1-to-PropVari.patch create mode 100644 patches/propsys-Improvements/0002-propsys-Add-support-for-VT_LPWSTR-and-VT_BSTR-to-Pro.patch create mode 100644 patches/propsys-Improvements/0003-propsys-Add-support-for-VT_BSTR-to-PropVariantChange.patch create mode 100644 patches/propsys-Improvements/0004-propsys-Make-VT_FILETIME-handling-by-PropVariantChan.patch create mode 100644 patches/propsys-Improvements/0005-propsys-Add-support-for-VT_LPSTR-to-PropVariantChang.patch create mode 100644 patches/propsys-Improvements/0006-propsys-Add-support-for-VT_LPSTR-and-VT_LPWSTR-to-Pr.patch diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 4467a012..6490a7a4 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -299,6 +299,7 @@ patch_enable_all () enable_oleaut32_x86_64_Marshaller="$1" enable_opengl32_Revert_Disable_Ext="$1" enable_opengl32_glDebugMessageCallback="$1" + enable_propsys_Improvements="$1" enable_quartz_MediaSeeking_Positions="$1" enable_quartz_Silence_FIXMEs="$1" enable_riched20_Class_Tests="$1" @@ -1130,6 +1131,9 @@ patch_enable () opengl32-glDebugMessageCallback) enable_opengl32_glDebugMessageCallback="$2" ;; + propsys-Improvements) + enable_propsys_Improvements="$2" + ;; quartz-MediaSeeking_Positions) enable_quartz_MediaSeeking_Positions="$2" ;; @@ -6606,6 +6610,28 @@ if test "$enable_opengl32_glDebugMessageCallback" -eq 1; then ) >> "$patchlist" fi +# Patchset propsys-Improvements +# | +# | Modified files: +# | * dlls/propsys/propvar.c, dlls/propsys/tests/propsys.c +# | +if test "$enable_propsys_Improvements" -eq 1; then + patch_apply propsys-Improvements/0001-propsys-Add-support-for-VT_I1-and-VT_UI1-to-PropVari.patch + patch_apply propsys-Improvements/0002-propsys-Add-support-for-VT_LPWSTR-and-VT_BSTR-to-Pro.patch + patch_apply propsys-Improvements/0003-propsys-Add-support-for-VT_BSTR-to-PropVariantChange.patch + patch_apply propsys-Improvements/0004-propsys-Make-VT_FILETIME-handling-by-PropVariantChan.patch + patch_apply propsys-Improvements/0005-propsys-Add-support-for-VT_LPSTR-to-PropVariantChang.patch + patch_apply propsys-Improvements/0006-propsys-Add-support-for-VT_LPSTR-and-VT_LPWSTR-to-Pr.patch + ( + printf '%s\n' '+ { "Dmitry Timoshkov", "propsys: Add support for VT_I1 and VT_UI1 to PropVariantChangeType.", 1 },'; + printf '%s\n' '+ { "Dmitry Timoshkov", "propsys: Add support for VT_LPWSTR and VT_BSTR to PropVariantToStringAlloc.", 1 },'; + printf '%s\n' '+ { "Dmitry Timoshkov", "propsys: Add support for VT_BSTR to PropVariantChangeType.", 1 },'; + printf '%s\n' '+ { "Dmitry Timoshkov", "propsys: Make VT_FILETIME handling by PropVariantChangeType more implicit.", 1 },'; + printf '%s\n' '+ { "Dmitry Timoshkov", "propsys: Add support for VT_LPSTR to PropVariantChangeType.", 2 },'; + printf '%s\n' '+ { "Dmitry Timoshkov", "propsys: Add support for VT_LPSTR and VT_LPWSTR to PropVariantCompareEx.", 2 },'; + ) >> "$patchlist" +fi + # Patchset quartz-MediaSeeking_Positions # | # | Modified files: diff --git a/patches/propsys-Improvements/0001-propsys-Add-support-for-VT_I1-and-VT_UI1-to-PropVari.patch b/patches/propsys-Improvements/0001-propsys-Add-support-for-VT_I1-and-VT_UI1-to-PropVari.patch new file mode 100644 index 00000000..5dd81369 --- /dev/null +++ b/patches/propsys-Improvements/0001-propsys-Add-support-for-VT_I1-and-VT_UI1-to-PropVari.patch @@ -0,0 +1,49 @@ +From ad76cf41e0a79a75c0acb3a8aae6caa6dab9549c Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Fri, 31 Mar 2017 13:39:41 +0800 +Subject: propsys: Add support for VT_I1 and VT_UI1 to PropVariantChangeType. + +--- + dlls/propsys/propvar.c | 26 ++++++++++++++++++++++++++ + 1 file changed, 26 insertions(+) + +diff --git a/dlls/propsys/propvar.c b/dlls/propsys/propvar.c +index 3fee67ad276..007fd94b840 100644 +--- a/dlls/propsys/propvar.c ++++ b/dlls/propsys/propvar.c +@@ -264,6 +264,32 @@ HRESULT WINAPI PropVariantChangeType(PROPVARIANT *ppropvarDest, REFPROPVARIANT p + + switch (vt) + { ++ case VT_I1: ++ { ++ LONGLONG res; ++ ++ hr = PROPVAR_ConvertNumber(propvarSrc, 8, TRUE, &res); ++ if (SUCCEEDED(hr)) ++ { ++ ppropvarDest->vt = VT_I1; ++ ppropvarDest->u.cVal = (char)res; ++ } ++ return hr; ++ } ++ ++ case VT_UI1: ++ { ++ LONGLONG res; ++ ++ hr = PROPVAR_ConvertNumber(propvarSrc, 8, FALSE, &res); ++ if (SUCCEEDED(hr)) ++ { ++ ppropvarDest->vt = VT_UI1; ++ ppropvarDest->u.bVal = (UCHAR)res; ++ } ++ return hr; ++ } ++ + case VT_I2: + { + SHORT res; +-- +2.12.2 + diff --git a/patches/propsys-Improvements/0002-propsys-Add-support-for-VT_LPWSTR-and-VT_BSTR-to-Pro.patch b/patches/propsys-Improvements/0002-propsys-Add-support-for-VT_LPWSTR-and-VT_BSTR-to-Pro.patch new file mode 100644 index 00000000..d9443507 --- /dev/null +++ b/patches/propsys-Improvements/0002-propsys-Add-support-for-VT_LPWSTR-and-VT_BSTR-to-Pro.patch @@ -0,0 +1,44 @@ +From 08d1f368bb9d12d89f334a7fd34f06895b217087 Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Fri, 31 Mar 2017 13:43:52 +0800 +Subject: propsys: Add support for VT_LPWSTR and VT_BSTR to + PropVariantToStringAlloc. + +--- + dlls/propsys/propvar.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/dlls/propsys/propvar.c b/dlls/propsys/propvar.c +index 007fd94b840..a359bc724fc 100644 +--- a/dlls/propsys/propvar.c ++++ b/dlls/propsys/propvar.c +@@ -224,6 +224,7 @@ HRESULT WINAPI PropVariantToStringAlloc(REFPROPVARIANT propvarIn, WCHAR **ret) + res = CoTaskMemAlloc(1*sizeof(WCHAR)); + res[0] = '\0'; + break; ++ + case VT_LPSTR: + if(propvarIn->u.pszVal) + { +@@ -237,6 +238,18 @@ HRESULT WINAPI PropVariantToStringAlloc(REFPROPVARIANT propvarIn, WCHAR **ret) + MultiByteToWideChar(CP_ACP, 0, propvarIn->u.pszVal, -1, res, len); + } + break; ++ ++ case VT_LPWSTR: ++ case VT_BSTR: ++ if (propvarIn->u.pwszVal) ++ { ++ DWORD size = (strlenW(propvarIn->u.pwszVal) + 1) * sizeof(WCHAR); ++ res = CoTaskMemAlloc(size); ++ if(!res) return E_OUTOFMEMORY; ++ memcpy(res, propvarIn->u.pwszVal, size); ++ } ++ break; ++ + default: + FIXME("Unsupported conversion (%d)\n", propvarIn->vt); + hr = E_FAIL; +-- +2.12.2 + diff --git a/patches/propsys-Improvements/0003-propsys-Add-support-for-VT_BSTR-to-PropVariantChange.patch b/patches/propsys-Improvements/0003-propsys-Add-support-for-VT_BSTR-to-PropVariantChange.patch new file mode 100644 index 00000000..2644d3fb --- /dev/null +++ b/patches/propsys-Improvements/0003-propsys-Add-support-for-VT_BSTR-to-PropVariantChange.patch @@ -0,0 +1,26 @@ +From a862cb25cefe885d4de212c21fc8a62dc8b8c682 Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Fri, 31 Mar 2017 13:45:23 +0800 +Subject: propsys: Add support for VT_BSTR to PropVariantChangeType. + +--- + dlls/propsys/propvar.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/dlls/propsys/propvar.c b/dlls/propsys/propvar.c +index a359bc724fc..92399f56576 100644 +--- a/dlls/propsys/propvar.c ++++ b/dlls/propsys/propvar.c +@@ -369,7 +369,9 @@ HRESULT WINAPI PropVariantChangeType(PROPVARIANT *ppropvarDest, REFPROPVARIANT p + } + return hr; + } ++ + case VT_LPWSTR: ++ case VT_BSTR: + { + WCHAR *res; + hr = PropVariantToStringAlloc(propvarSrc, &res); +-- +2.12.2 + diff --git a/patches/propsys-Improvements/0004-propsys-Make-VT_FILETIME-handling-by-PropVariantChan.patch b/patches/propsys-Improvements/0004-propsys-Make-VT_FILETIME-handling-by-PropVariantChan.patch new file mode 100644 index 00000000..4a242485 --- /dev/null +++ b/patches/propsys-Improvements/0004-propsys-Make-VT_FILETIME-handling-by-PropVariantChan.patch @@ -0,0 +1,67 @@ +From 96f68fa277d1f8aed675d962f8cfa898b06805d7 Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Sun, 7 May 2017 17:19:33 +0800 +Subject: propsys: Make VT_FILETIME handling by PropVariantChangeType more + implicit. + +--- + dlls/propsys/propvar.c | 22 +++++++++------------- + 1 file changed, 9 insertions(+), 13 deletions(-) + +diff --git a/dlls/propsys/propvar.c b/dlls/propsys/propvar.c +index 92399f56576..725428ebad2 100644 +--- a/dlls/propsys/propvar.c ++++ b/dlls/propsys/propvar.c +@@ -36,12 +36,11 @@ + + WINE_DEFAULT_DEBUG_CHANNEL(propsys); + +-static HRESULT PROPVAR_ConvertFILETIME(PROPVARIANT *ppropvarDest, +- REFPROPVARIANT propvarSrc, VARTYPE vt) ++static HRESULT PROPVAR_ConvertFILETIME(const FILETIME *ft, PROPVARIANT *ppropvarDest, VARTYPE vt) + { + SYSTEMTIME time; + +- FileTimeToSystemTime(&propvarSrc->u.filetime, &time); ++ FileTimeToSystemTime(ft, &time); + + switch (vt) + { +@@ -272,9 +271,12 @@ HRESULT WINAPI PropVariantChangeType(PROPVARIANT *ppropvarDest, REFPROPVARIANT p + FIXME("(%p, %p, %d, %d, %d): semi-stub!\n", ppropvarDest, propvarSrc, + propvarSrc->vt, flags, vt); + +- if(vt == propvarSrc->vt) ++ if (vt == propvarSrc->vt) + return PropVariantCopy(ppropvarDest, propvarSrc); + ++ if (propvarSrc->vt == VT_FILETIME) ++ return PROPVAR_ConvertFILETIME(&propvarSrc->u.filetime, ppropvarDest, vt); ++ + switch (vt) + { + case VT_I1: +@@ -382,17 +384,11 @@ HRESULT WINAPI PropVariantChangeType(PROPVARIANT *ppropvarDest, REFPROPVARIANT p + } + return hr; + } +- } + +- switch (propvarSrc->vt) +- { +- case VT_FILETIME: +- return PROPVAR_ConvertFILETIME(ppropvarDest, propvarSrc, vt); +- default: +- FIXME("Unhandled source type: %d\n", propvarSrc->vt); ++ default: ++ FIXME("Unhandled dest type: %d\n", vt); ++ return E_FAIL; + } +- +- return E_FAIL; + } + + static void PROPVAR_GUIDToWSTR(REFGUID guid, WCHAR *str) +-- +2.12.2 + diff --git a/patches/propsys-Improvements/0005-propsys-Add-support-for-VT_LPSTR-to-PropVariantChang.patch b/patches/propsys-Improvements/0005-propsys-Add-support-for-VT_LPSTR-to-PropVariantChang.patch new file mode 100644 index 00000000..e3fb2d0e --- /dev/null +++ b/patches/propsys-Improvements/0005-propsys-Add-support-for-VT_LPSTR-to-PropVariantChang.patch @@ -0,0 +1,48 @@ +From e84408e24968a947de9fcfde7605e5f200d24a01 Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Sun, 7 May 2017 17:25:53 +0800 +Subject: propsys: Add support for VT_LPSTR to PropVariantChangeType. (v2) + +--- + dlls/propsys/propvar.c | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +diff --git a/dlls/propsys/propvar.c b/dlls/propsys/propvar.c +index 725428ebad2..8233d2f362f 100644 +--- a/dlls/propsys/propvar.c ++++ b/dlls/propsys/propvar.c +@@ -385,6 +385,31 @@ HRESULT WINAPI PropVariantChangeType(PROPVARIANT *ppropvarDest, REFPROPVARIANT p + return hr; + } + ++ case VT_LPSTR: ++ { ++ WCHAR *resW; ++ hr = PropVariantToStringAlloc(propvarSrc, &resW); ++ if (SUCCEEDED(hr)) ++ { ++ char *res; ++ DWORD len; ++ ++ len = WideCharToMultiByte(CP_ACP, 0, resW, -1, NULL, 0, NULL, NULL); ++ res = CoTaskMemAlloc(len); ++ if (res) ++ { ++ WideCharToMultiByte(CP_ACP, 0, resW, -1, res, len, NULL, NULL); ++ ppropvarDest->vt = VT_LPSTR; ++ ppropvarDest->u.pszVal = res; ++ } ++ else ++ hr = E_OUTOFMEMORY; ++ ++ CoTaskMemFree(resW); ++ } ++ return hr; ++ } ++ + default: + FIXME("Unhandled dest type: %d\n", vt); + return E_FAIL; +-- +2.12.2 + diff --git a/patches/propsys-Improvements/0006-propsys-Add-support-for-VT_LPSTR-and-VT_LPWSTR-to-Pr.patch b/patches/propsys-Improvements/0006-propsys-Add-support-for-VT_LPSTR-and-VT_LPWSTR-to-Pr.patch new file mode 100644 index 00000000..78aac6d5 --- /dev/null +++ b/patches/propsys-Improvements/0006-propsys-Add-support-for-VT_LPSTR-and-VT_LPWSTR-to-Pr.patch @@ -0,0 +1,86 @@ +From 1908c1582fcd927a08c0aa7b0a6c1e11c614942f Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Fri, 31 Mar 2017 13:53:14 +0800 +Subject: propsys: Add support for VT_LPSTR and VT_LPWSTR to + PropVariantCompareEx. (v2) + +--- + dlls/propsys/propvar.c | 28 ++++++++++++++++++++++++++-- + dlls/propsys/tests/propsys.c | 4 ++-- + 2 files changed, 28 insertions(+), 4 deletions(-) + +diff --git a/dlls/propsys/propvar.c b/dlls/propsys/propvar.c +index 8233d2f362f..0c366d5a053 100644 +--- a/dlls/propsys/propvar.c ++++ b/dlls/propsys/propvar.c +@@ -18,8 +18,12 @@ + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + ++#include "config.h" ++#include "wine/port.h" ++ + #include + #include ++#include + + #define NONAMELESSUNION + +@@ -112,6 +116,15 @@ static HRESULT PROPVAR_ConvertNumber(REFPROPVARIANT pv, int dest_bits, + src_signed = FALSE; + *res = 0; + break; ++ case VT_LPSTR: ++ *res = strtoll(pv->u.pszVal, NULL, 0); ++ src_signed = *res < 0; ++ break; ++ case VT_LPWSTR: ++ case VT_BSTR: ++ *res = strtolW(pv->u.pwszVal, NULL, 0); ++ src_signed = *res < 0; ++ break; + default: + FIXME("unhandled vt %d\n", pv->vt); + return E_NOTIMPL; +@@ -698,8 +711,19 @@ INT WINAPI PropVariantCompareEx(REFPROPVARIANT propvar1, REFPROPVARIANT propvar2 + CMP_INT_VALUE(uhVal.QuadPart); + break; + case VT_BSTR: +- /* FIXME: Use string flags. */ +- res = lstrcmpW(propvar1->u.bstrVal, propvar2->u.bstrVal); ++ case VT_LPWSTR: ++ /* FIXME: Use other string flags. */ ++ if (flags & (PVCF_USESTRCMPI | PVCF_USESTRCMPIC)) ++ res = lstrcmpiW(propvar1->u.bstrVal, propvar2_converted->u.bstrVal); ++ else ++ res = lstrcmpW(propvar1->u.bstrVal, propvar2_converted->u.bstrVal); ++ break; ++ case VT_LPSTR: ++ /* FIXME: Use other string flags. */ ++ if (flags & (PVCF_USESTRCMPI | PVCF_USESTRCMPIC)) ++ res = lstrcmpiA(propvar1->u.pszVal, propvar2_converted->u.pszVal); ++ else ++ res = lstrcmpA(propvar1->u.pszVal, propvar2_converted->u.pszVal); + break; + default: + FIXME("vartype %d not handled\n", propvar1->vt); +diff --git a/dlls/propsys/tests/propsys.c b/dlls/propsys/tests/propsys.c +index 71b6a93df17..54b45ace9bd 100644 +--- a/dlls/propsys/tests/propsys.c ++++ b/dlls/propsys/tests/propsys.c +@@ -735,10 +735,10 @@ static void test_PropVariantCompare(void) + ok(res == 0, "res=%i\n", res); + + res = PropVariantCompareEx(&i2_2, &str_2, 0, 0); +- todo_wine ok(res == 0, "res=%i\n", res); ++ ok(res == 0, "res=%i\n", res); + + res = PropVariantCompareEx(&i2_2, &str_02, 0, 0); +- todo_wine ok(res == 0, "res=%i\n", res); ++ ok(res == 0, "res=%i\n", res); + + res = PropVariantCompareEx(&str_2, &i2_2, 0, 0); + todo_wine ok(res == 0, "res=%i\n", res); +-- +2.12.2 +