[PROPSYS] Sync with Wine Staging 1.9.16. CORE-11866

svn path=/trunk/; revision=72302
This commit is contained in:
Amine Khaldi 2016-08-18 10:35:19 +00:00
parent c5ba8fbb12
commit df418ff838
3 changed files with 53 additions and 2 deletions

View file

@ -135,7 +135,7 @@
@ stub PropVariantToInt64WithDefault
@ stub PropVariantToStrRet
@ stub PropVariantToString
@ stub PropVariantToStringAlloc
@ stdcall PropVariantToStringAlloc(ptr ptr)
@ stub PropVariantToStringVector
@ stub PropVariantToStringVectorAlloc
@ stub PropVariantToStringWithDefault

View file

@ -198,6 +198,43 @@ HRESULT WINAPI PropVariantToUInt64(REFPROPVARIANT propvarIn, ULONGLONG *ret)
return hr;
}
HRESULT WINAPI PropVariantToStringAlloc(REFPROPVARIANT propvarIn, WCHAR **ret)
{
WCHAR *res = NULL;
HRESULT hr = S_OK;
TRACE("%p,%p semi-stub\n", propvarIn, ret);
switch(propvarIn->vt)
{
case VT_NULL:
res = CoTaskMemAlloc(1*sizeof(WCHAR));
res[0] = '\0';
break;
case VT_LPSTR:
if(propvarIn->u.pszVal)
{
DWORD len;
len = MultiByteToWideChar(CP_ACP, 0, propvarIn->u.pszVal, -1, NULL, 0);
res = CoTaskMemAlloc(len*sizeof(WCHAR));
if(!res)
return E_OUTOFMEMORY;
MultiByteToWideChar(CP_ACP, 0, propvarIn->u.pszVal, -1, res, len);
}
break;
default:
FIXME("Unsupported conversion (%d)\n", propvarIn->vt);
hr = E_FAIL;
break;
}
*ret = res;
return hr;
}
/******************************************************************
* PropVariantChangeType (PROPSYS.@)
*/
@ -209,6 +246,9 @@ 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)
return PropVariantCopy(ppropvarDest, propvarSrc);
switch (vt)
{
case VT_I2:
@ -277,6 +317,17 @@ HRESULT WINAPI PropVariantChangeType(PROPVARIANT *ppropvarDest, REFPROPVARIANT p
}
return hr;
}
case VT_LPWSTR:
{
WCHAR *res;
hr = PropVariantToStringAlloc(propvarSrc, &res);
if (SUCCEEDED(hr))
{
ppropvarDest->vt = VT_LPWSTR;
ppropvarDest->u.pwszVal = res;
}
return hr;
}
}
switch (propvarSrc->vt)

View file

@ -154,7 +154,7 @@ reactos/dll/win32/pdh # Synced to WineStaging-1.9.11
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.11
reactos/dll/win32/propsys # Synced to WineStaging-1.9.16
reactos/dll/win32/pstorec # Synced to WineStaging-1.9.11
reactos/dll/win32/qmgr # Synced to WineStaging-1.9.11
reactos/dll/win32/qmgrprxy # Synced to WineStaging-1.9.11