Commit 4f52e322 authored by Biswapriyo Nath's avatar Biswapriyo Nath Committed by Alexandre Julliard

include: Add some function declarations in propvarutil.h.

parent e33bdb87
...@@ -74,6 +74,7 @@ HRESULT WINAPI PropVariantToGUID(const PROPVARIANT *ppropvar, GUID *guid); ...@@ -74,6 +74,7 @@ HRESULT WINAPI PropVariantToGUID(const PROPVARIANT *ppropvar, GUID *guid);
HRESULT WINAPI VariantToGUID(const VARIANT *pvar, GUID *guid); HRESULT WINAPI VariantToGUID(const VARIANT *pvar, GUID *guid);
INT WINAPI PropVariantCompareEx(REFPROPVARIANT propvar1, REFPROPVARIANT propvar2, INT WINAPI PropVariantCompareEx(REFPROPVARIANT propvar1, REFPROPVARIANT propvar2,
PROPVAR_COMPARE_UNIT uint, PROPVAR_COMPARE_FLAGS flags); PROPVAR_COMPARE_UNIT uint, PROPVAR_COMPARE_FLAGS flags);
HRESULT WINAPI InitPropVariantFromFileTime(const FILETIME *pftIn, PROPVARIANT *ppropvar);
HRESULT WINAPI PropVariantToDouble(REFPROPVARIANT propvarIn, double *ret); HRESULT WINAPI PropVariantToDouble(REFPROPVARIANT propvarIn, double *ret);
HRESULT WINAPI PropVariantToInt16(REFPROPVARIANT propvarIn, SHORT *ret); HRESULT WINAPI PropVariantToInt16(REFPROPVARIANT propvarIn, SHORT *ret);
...@@ -92,8 +93,17 @@ HRESULT WINAPI PropVariantToStringAlloc(REFPROPVARIANT propvarIn, WCHAR **ret); ...@@ -92,8 +93,17 @@ HRESULT WINAPI PropVariantToStringAlloc(REFPROPVARIANT propvarIn, WCHAR **ret);
#ifdef __cplusplus #ifdef __cplusplus
HRESULT InitPropVariantFromBoolean(BOOL fVal, PROPVARIANT *ppropvar); HRESULT InitPropVariantFromBoolean(BOOL fVal, PROPVARIANT *ppropvar);
HRESULT InitPropVariantFromString(PCWSTR psz, PROPVARIANT *ppropvar); HRESULT InitPropVariantFromInt16(SHORT nVal, PROPVARIANT *ppropvar);
HRESULT InitPropVariantFromUInt16(USHORT uiVal, PROPVARIANT *ppropvar);
HRESULT InitPropVariantFromInt32(LONG lVal, PROPVARIANT *ppropvar);
HRESULT InitPropVariantFromUInt32(ULONG ulVal, PROPVARIANT *ppropvar);
HRESULT InitPropVariantFromInt64(LONGLONG llVal, PROPVARIANT *ppropvar); HRESULT InitPropVariantFromInt64(LONGLONG llVal, PROPVARIANT *ppropvar);
HRESULT InitPropVariantFromUInt64(ULONGLONG ullVal, PROPVARIANT *ppropvar);
HRESULT InitPropVariantFromDouble(DOUBLE dblVal, PROPVARIANT *ppropvar);
HRESULT InitPropVariantFromString(PCWSTR psz, PROPVARIANT *ppropvar);
HRESULT InitPropVariantFromGUIDAsBuffer(REFGUID guid, PROPVARIANT *ppropvar);
BOOL IsPropVariantVector(REFPROPVARIANT propvar);
BOOL IsPropVariantString(REFPROPVARIANT propvar);
#ifndef NO_PROPVAR_INLINES #ifndef NO_PROPVAR_INLINES
...@@ -104,6 +114,55 @@ inline HRESULT InitPropVariantFromBoolean(BOOL fVal, PROPVARIANT *ppropvar) ...@@ -104,6 +114,55 @@ inline HRESULT InitPropVariantFromBoolean(BOOL fVal, PROPVARIANT *ppropvar)
return S_OK; return S_OK;
} }
inline HRESULT InitPropVariantFromInt16(SHORT nVal, PROPVARIANT *ppropvar)
{
ppropvar->vt = VT_I2;
ppropvar->iVal = nVal;
return S_OK;
}
inline HRESULT InitPropVariantFromUInt16(USHORT uiVal, PROPVARIANT *ppropvar)
{
ppropvar->vt = VT_UI2;
ppropvar->uiVal = uiVal;
return S_OK;
}
inline HRESULT InitPropVariantFromInt32(LONG lVal, PROPVARIANT *ppropvar)
{
ppropvar->vt = VT_I4;
ppropvar->lVal = lVal;
return S_OK;
}
inline HRESULT InitPropVariantFromUInt32(ULONG ulVal, PROPVARIANT *ppropvar)
{
ppropvar->vt = VT_UI4;
ppropvar->ulVal = ulVal;
return S_OK;
}
inline HRESULT InitPropVariantFromInt64(LONGLONG llVal, PROPVARIANT *ppropvar)
{
ppropvar->vt = VT_I8;
ppropvar->hVal.QuadPart = llVal;
return S_OK;
}
inline HRESULT InitPropVariantFromUInt64(ULONGLONG ullVal, PROPVARIANT *ppropvar)
{
ppropvar->vt = VT_UI8;
ppropvar->uhVal.QuadPart = ullVal;
return S_OK;
}
inline HRESULT InitPropVariantFromDouble(DOUBLE dblVal, PROPVARIANT *ppropvar)
{
ppropvar->vt = VT_R8;
ppropvar->dblVal = dblVal;
return S_OK;
}
inline HRESULT InitPropVariantFromString(PCWSTR psz, PROPVARIANT *ppropvar) inline HRESULT InitPropVariantFromString(PCWSTR psz, PROPVARIANT *ppropvar)
{ {
HRESULT hres; HRESULT hres;
...@@ -117,11 +176,19 @@ inline HRESULT InitPropVariantFromString(PCWSTR psz, PROPVARIANT *ppropvar) ...@@ -117,11 +176,19 @@ inline HRESULT InitPropVariantFromString(PCWSTR psz, PROPVARIANT *ppropvar)
return hres; return hres;
} }
inline HRESULT InitPropVariantFromInt64(LONGLONG llVal, PROPVARIANT *ppropvar) inline HRESULT InitPropVariantFromGUIDAsBuffer(REFGUID guid, PROPVARIANT *ppropvar)
{ {
ppropvar->vt = VT_I8; return InitPropVariantFromBuffer(guid, sizeof(GUID), ppropvar);
ppropvar->hVal.QuadPart = llVal; }
return S_OK;
inline BOOL IsPropVariantVector(REFPROPVARIANT propvar)
{
return (propvar.vt & (VT_ARRAY | VT_VECTOR));
}
inline BOOL IsPropVariantString(REFPROPVARIANT propvar)
{
return (PropVariantToStringWithDefault(propvar, NULL) != NULL);
} }
#endif /* NO_PROPVAR_INLINES */ #endif /* NO_PROPVAR_INLINES */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment