propvarutil.h: Added InitPropVariantFromBoolean and InitPropVariantFromString implementations.

This commit is contained in:
Jacek Caban 2011-07-01 14:15:21 +02:00 committed by Alexandre Julliard
parent 8e5eaf7f7b
commit ad2f8bdd5c
1 changed files with 31 additions and 0 deletions

View File

@ -38,4 +38,35 @@ typedef int PROPVAR_CHANGE_FLAGS;
HRESULT WINAPI PropVariantChangeType(PROPVARIANT *ppropvarDest, REFPROPVARIANT propvarSrc,
PROPVAR_CHANGE_FLAGS flags, VARTYPE vt);
#ifdef __cplusplus
HRESULT InitPropVariantFromBoolean(BOOL fVal, PROPVARIANT *ppropvar);
HRESULT InitPropVariantFromString(PCWSTR psz, PROPVARIANT *ppropvar);
#ifndef NO_PROPVAR_INLINES
HRESULT inline InitPropVariantFromBoolean(BOOL fVal, PROPVARIANT *ppropvar)
{
ppropvar->vt = VT_BOOL;
ppropvar->boolVal = fVal ? VARIANT_TRUE : VARIANT_FALSE;
return S_OK;
}
HRESULT inline InitPropVariantFromString(PCWSTR psz, PROPVARIANT *ppropvar)
{
HRESULT hres;
hres = SHStrDupW(psz, &ppropvar->pwszVal);
if(SUCCEEDED(hres))
ppropvar->vt = VT_LPWSTR;
else
PropVariantInit(ppropvar);
return hres;
}
#endif
#endif
#endif /* __WINE_PROPVARUTIL_H */