Author: akhaldi
Date: Sat Jun 3 22:35:14 2017
New Revision: 74836
URL:
http://svn.reactos.org/svn/reactos?rev=74836&view=rev
Log:
[PROPSYS] Sync with Wine Staging 2.9. CORE-13362
090b4f2 propsys: Add support for VT_LPSTR and VT_LPWSTR to PropVariantCompareEx. (v2)
99758d9 propsys: Add support for VT_LPSTR to PropVariantChangeType. (v2)
43fa646 propsys: Make VT_FILETIME handling by PropVariantChangeType more implicit.
55b3752 propsys: Add support for VT_BSTR to PropVariantChangeType.
fc00aec propsys: Add support for VT_LPWSTR and VT_BSTR to PropVariantToStringAlloc.
aa841b3 propsys: Add support for VT_I1 and VT_UI1 to PropVariantChangeType.
8e273c8 propsys: Fix PSGetPropertyDescriptionListFromString spec file entry.
6df21d4 propsys: Use snprintf in PROPVAR_ConvertFILETIME.
Modified:
trunk/reactos/dll/win32/propsys/propsys.spec
trunk/reactos/dll/win32/propsys/propvar.c
trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/propsys/propsys.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/propsys/propsys.…
==============================================================================
--- trunk/reactos/dll/win32/propsys/propsys.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/propsys/propsys.spec [iso-8859-1] Sat Jun 3 22:35:14 2017
@@ -82,7 +82,7 @@
@ stub PSGetNamedPropertyFromPropertyStorage
@ stdcall PSGetPropertyDescription(ptr ptr ptr)
@ stub PSGetPropertyDescriptionByName
-@ stdcall PSGetPropertyDescriptionListFromString(ptr ptr ptr)
+@ stdcall PSGetPropertyDescriptionListFromString(wstr ptr ptr)
@ stub PSGetPropertyFromPropertyStorage
@ stub PSGetPropertyKeyFromName
@ stdcall PSGetPropertySystem(ptr ptr)
Modified: trunk/reactos/dll/win32/propsys/propvar.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/propsys/propvar.…
==============================================================================
--- trunk/reactos/dll/win32/propsys/propvar.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/propsys/propvar.c [iso-8859-1] Sat Jun 3 22:35:14 2017
@@ -25,12 +25,11 @@
#include <oleauto.h>
#include <propvarutil.h>
-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)
{
@@ -39,13 +38,15 @@
static const char format[] = "%04d/%02d/%02d:%02d:%02d:%02d.%03d";
ppropvarDest->u.pszVal = HeapAlloc(GetProcessHeap(), 0,
- lstrlenA(format) + 1);
+ sizeof(format));
if (!ppropvarDest->u.pszVal)
return E_OUTOFMEMORY;
- sprintf(ppropvarDest->u.pszVal, format, time.wYear, time.wMonth,
- time.wDay, time.wHour, time.wMinute,
- time.wSecond, time.wMilliseconds);
+ snprintf( ppropvarDest->u.pszVal, sizeof(format),
+ format,
+ time.wYear, time.wMonth, time.wDay,
+ time.wHour, time.wMinute, time.wSecond,
+ time.wMilliseconds );
return S_OK;
}
@@ -99,6 +100,15 @@
case VT_EMPTY:
src_signed = FALSE;
*res = 0;
+ break;
+ case VT_LPSTR:
+ *res = _strtoi64(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);
@@ -211,6 +221,7 @@
res = CoTaskMemAlloc(1*sizeof(WCHAR));
res[0] = '\0';
break;
+
case VT_LPSTR:
if(propvarIn->u.pszVal)
{
@@ -224,6 +235,18 @@
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;
@@ -246,11 +269,40 @@
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:
+ {
+ 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;
@@ -317,7 +369,9 @@
}
return hr;
}
+
case VT_LPWSTR:
+ case VT_BSTR:
{
WCHAR *res;
hr = PropVariantToStringAlloc(propvarSrc, &res);
@@ -328,17 +382,36 @@
}
return hr;
}
- }
-
- switch (propvarSrc->vt)
- {
- case VT_FILETIME:
- return PROPVAR_ConvertFILETIME(ppropvarDest, propvarSrc, vt);
- default:
- FIXME("Unhandled source type: %d\n", propvarSrc->vt);
- }
-
- return E_FAIL;
+
+ 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;
+ }
}
static void PROPVAR_GUIDToWSTR(REFGUID guid, WCHAR *str)
@@ -623,8 +696,19 @@
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);
Modified: trunk/reactos/media/doc/README.WINE
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sat Jun 3 22:35:14 2017
@@ -151,7 +151,7 @@
reactos/dll/win32/pidgen # Synced to WineStaging-1.9.11
reactos/dll/win32/powrprof # Forked at Wine-1.0rc5
reactos/dll/win32/printui # Synced to WineStaging-1.9.11
-reactos/dll/win32/propsys # Synced to WineStaging-1.9.16
+reactos/dll/win32/propsys # Synced to WineStaging-2.9
reactos/dll/win32/pstorec # Synced to WineStaging-2.2
reactos/dll/win32/qmgr # Synced to WineStaging-1.9.23
reactos/dll/win32/qmgrprxy # Synced to WineStaging-1.9.11