26#define NONAMELESSUNION
51 if (!ppropvarDest->u.pszVal)
54 sprintf( ppropvarDest->u.pszVal,
"%04d/%02d/%02d:%02d:%02d:%02d.%03d",
62 FIXME(
"Unhandled target type: %d\n",
vt);
101 *
res = pv->u.hVal.QuadPart;
105 *
res = pv->u.uhVal.QuadPart;
115 if (pv->u.pszVal ==
end)
117 src_signed = *
res < 0;
125 if (pv->u.pwszVal ==
end)
127 src_signed = *
res < 0;
137 FIXME(
"unhandled vt %d\n", pv->vt);
141 if (*
res < 0 && src_signed != dest_signed)
167 TRACE(
"(%p, %p)\n", propvarIn,
ret);
248 static const WCHAR trueW[] = {
't',
'r',
'u',
'e',0};
249 static const WCHAR falseW[] = {
'f',
'a',
'l',
's',
'e',0};
250 static const WCHAR true2W[] = {
'#',
'T',
'R',
'U',
'E',
'#',0};
251 static const WCHAR false2W[] = {
'#',
'F',
'A',
'L',
'S',
'E',
'#',0};
259 switch (propvarIn->vt)
262 *
ret = propvarIn->u.boolVal == VARIANT_TRUE;
267 if (!propvarIn->u.pwszVal)
284 if (!propvarIn->u.pszVal)
287 if (!
lstrcmpiA(propvarIn->u.pszVal,
"true") || !
lstrcmpA(propvarIn->u.pszVal,
"#TRUE#"))
293 if (!
lstrcmpiA(propvarIn->u.pszVal,
"false") || !
lstrcmpA(propvarIn->u.pszVal,
"#FALSE#"))
312 switch(propvarIn->vt)
315 if(
cb > propvarIn->u.caub.cElems)
320 FIXME(
"Unsupported type: VT_ARRAY|VT_UI1\n");
324 WARN(
"Unexpected type: %x\n", propvarIn->vt);
361 TRACE(
"%p,%p semi-stub\n", propvarIn,
ret);
363 switch(propvarIn->vt)
372 if(propvarIn->u.pszVal)
387 if (propvarIn->u.pwszVal)
397 FIXME(
"Unsupported conversion (%d)\n", propvarIn->vt);
409 static const WCHAR str_empty[] = {0};
412 if (propvarIn->u.bstrVal ==
NULL)
415 return propvarIn->u.bstrVal;
418 if (propvarIn->vt ==
VT_LPWSTR && propvarIn->u.pwszVal !=
NULL)
419 return propvarIn->u.pwszVal;
451 ppropvarDest->vt =
VT_I1;
452 ppropvarDest->u.cVal = (
char)
res;
464 ppropvarDest->vt =
VT_UI1;
476 ppropvarDest->vt =
VT_I2;
477 ppropvarDest->u.iVal =
res;
487 ppropvarDest->vt =
VT_UI2;
488 ppropvarDest->u.uiVal =
res;
498 ppropvarDest->vt =
VT_I4;
499 ppropvarDest->u.lVal =
res;
509 ppropvarDest->vt =
VT_UI4;
510 ppropvarDest->u.ulVal =
res;
520 ppropvarDest->vt =
VT_I8;
521 ppropvarDest->u.hVal.QuadPart =
res;
531 ppropvarDest->vt =
VT_UI8;
532 ppropvarDest->u.uhVal.QuadPart =
res;
545 ppropvarDest->u.pwszVal =
res;
565 ppropvarDest->u.pszVal =
res;
576 FIXME(
"Unhandled dest type: %d\n",
vt);
583 static const WCHAR format[] = {
'{',
'%',
'0',
'8',
'X',
'-',
'%',
'0',
'4',
'X',
'-',
'%',
'0',
'4',
'X',
584 '-',
'%',
'0',
'2',
'X',
'%',
'0',
'2',
'X',
'-',
'%',
'0',
'2',
'X',
'%',
'0',
'2',
'X',
'%',
'0',
'2',
'X',
585 '%',
'0',
'2',
'X',
'%',
'0',
'2',
'X',
'%',
'0',
'2',
'X',
'}',0};
601 if(!ppropvar->u.pwszVal)
613 FIXME(
"guid == NULL\n");
628 TRACE(
"(%p %u %p)\n", pv,
cb, ppropvar);
631 if(!ppropvar->u.caub.pElems)
635 ppropvar->u.caub.cElems =
cb;
636 memcpy(ppropvar->u.caub.pElems, pv,
cb);
645 if(!ppropvar->u.puuid)
649 memcpy(ppropvar->u.puuid,
clsid,
sizeof(*ppropvar->u.puuid));
659 TRACE(
"(%p %u %p)\n", pv,
cb, pvar);
688 if(
hex[0]>=
'0' &&
hex[0]<=
'9')
690 else if(
hex[0]>=
'a' &&
hex[0]<=
'f')
692 else if(
hex[0]>=
'A' &&
hex[0]<=
'F')
698 if(
hex[1]>=
'0' &&
hex[1]<=
'9')
700 else if(
hex[1]>=
'a' &&
hex[1]<=
'f')
701 return ret +
hex[1]-
'a'+10;
702 else if(
hex[1]>=
'A' &&
hex[1]<=
'F')
703 return ret +
hex[1]-
'A'+10;
715 if(
len!=38 ||
str[0]!=
'{' ||
str[9]!=
'-' ||
str[14]!=
'-'
716 ||
str[19]!=
'-' ||
str[24]!=
'-' ||
str[37]!=
'}') {
722 for(
i=0;
i<4 &&
val!=-1;
i++) {
728 for(
i=0;
i<2 &&
val!=-1;
i++) {
734 for(
i=0;
i<2 &&
val!=-1;
i++) {
740 for(
i=0;
i<8 &&
val!=-1;
i++) {
760 switch(ppropvar->vt) {
766 memcpy(
guid, ppropvar->u.puuid,
sizeof(*ppropvar->u.puuid));
770 FIXME(
"unsupported vt: %d\n", ppropvar->vt);
788 FIXME(
"unsupported vt: %d\n",
V_VT(pvar));
800 for (
i=0;
i<propvar->u.parray->cDims;
i++)
802 if (propvar->u.parray->rgsabound[
i].cElements != 0)
805 return i == propvar->u.parray->cDims;
808 return !propvar->u.puuid;
817 const PROPVARIANT *propvar2_converted;
818 PROPVARIANT propvar2_static;
834 if (propvar1->vt != propvar2->vt)
841 propvar2_converted = &propvar2_static;
844 propvar2_converted = propvar2;
846#define CMP_NUM_VALUE(var) do { \
847 if (propvar1->u.var > propvar2_converted->u.var) \
849 else if (propvar1->u.var < propvar2_converted->u.var) \
855 switch (propvar1->vt)
891 res =
lstrcmpiW(propvar1->u.bstrVal, propvar2_converted->u.bstrVal);
893 res =
lstrcmpW(propvar1->u.bstrVal, propvar2_converted->u.bstrVal);
898 res =
lstrcmpiA(propvar1->u.pszVal, propvar2_converted->u.pszVal);
900 res =
lstrcmpA(propvar1->u.pszVal, propvar2_converted->u.pszVal);
903 res =
memcmp(propvar1->u.puuid, propvar2->u.puuid,
sizeof(*propvar1->u.puuid));
907 FIXME(
"vartype %#x not handled\n", propvar1->vt);
912 if (propvar2_converted == &propvar2_static)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define WideCharToMultiByte
#define MultiByteToWideChar
BOOL WINAPI FileTimeToSystemTime(IN CONST FILETIME *lpFileTime, OUT LPSYSTEMTIME lpSystemTime)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
static REFPROPVARIANT propvarSrc
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
HRESULT WINAPI PropVariantClear(PROPVARIANT *pvar)
HRESULT WINAPI PropVariantCopy(PROPVARIANT *pvarDest, const PROPVARIANT *pvarSrc)
HRESULT WINAPI SafeArrayAccessData(SAFEARRAY *psa, void **ppvData)
HRESULT WINAPI SafeArrayUnaccessData(SAFEARRAY *psa)
SAFEARRAY *WINAPI SafeArrayCreateVector(VARTYPE vt, LONG lLbound, ULONG cElements)
HRESULT WINAPI SafeArrayDestroy(SAFEARRAY *psa)
HRESULT WINAPI PropVariantToInt32(REFPROPVARIANT propvarIn, LONG *ret)
HRESULT WINAPI InitVariantFromGUIDAsString(REFGUID guid, VARIANT *pvar)
PCWSTR WINAPI PropVariantToStringWithDefault(REFPROPVARIANT propvarIn, LPCWSTR pszDefault)
static HRESULT PROPVAR_ConvertFILETIME(const FILETIME *ft, PROPVARIANT *ppropvarDest, VARTYPE vt)
INT WINAPI PropVariantCompareEx(REFPROPVARIANT propvar1, REFPROPVARIANT propvar2, PROPVAR_COMPARE_UNIT unit, PROPVAR_COMPARE_FLAGS flags)
HRESULT WINAPI VariantToGUID(const VARIANT *pvar, GUID *guid)
HRESULT WINAPI PropVariantToBuffer(REFPROPVARIANT propvarIn, void *ret, UINT cb)
HRESULT WINAPI PropVariantToUInt16(REFPROPVARIANT propvarIn, USHORT *ret)
static HRESULT PROPVAR_WCHARToGUID(const WCHAR *str, int len, GUID *guid)
#define CMP_NUM_VALUE(var)
static BOOL isemptyornull(const PROPVARIANT *propvar)
HRESULT WINAPI InitPropVariantFromCLSID(REFCLSID clsid, PROPVARIANT *ppropvar)
HRESULT WINAPI PropVariantToStringAlloc(REFPROPVARIANT propvarIn, WCHAR **ret)
HRESULT WINAPI PropVariantChangeType(PROPVARIANT *ppropvarDest, REFPROPVARIANT propvarSrc, PROPVAR_CHANGE_FLAGS flags, VARTYPE vt)
static void PROPVAR_GUIDToWSTR(REFGUID guid, WCHAR *str)
HRESULT WINAPI InitPropVariantFromBuffer(const VOID *pv, UINT cb, PROPVARIANT *ppropvar)
static HRESULT PROPVAR_ConvertNumber(REFPROPVARIANT pv, int dest_bits, BOOL dest_signed, LONGLONG *res)
HRESULT WINAPI PropVariantToBoolean(REFPROPVARIANT propvarIn, BOOL *ret)
HRESULT WINAPI PropVariantToInt64(REFPROPVARIANT propvarIn, LONGLONG *ret)
static DWORD PROPVAR_HexToNum(const WCHAR *hex)
HRESULT WINAPI PropVariantToDouble(REFPROPVARIANT propvarIn, double *ret)
HRESULT WINAPI PropVariantToString(REFPROPVARIANT propvarIn, PWSTR ret, UINT cch)
HRESULT WINAPI PropVariantToUInt64(REFPROPVARIANT propvarIn, ULONGLONG *ret)
HRESULT WINAPI PropVariantToUInt32(REFPROPVARIANT propvarIn, ULONG *ret)
HRESULT WINAPI PropVariantToGUID(const PROPVARIANT *ppropvar, GUID *guid)
HRESULT WINAPI PropVariantToInt16(REFPROPVARIANT propvarIn, SHORT *ret)
HRESULT WINAPI InitVariantFromBuffer(const VOID *pv, UINT cb, VARIANT *pvar)
HRESULT WINAPI InitPropVariantFromGUIDAsString(REFGUID guid, PROPVARIANT *ppropvar)
static const WCHAR stringW[]
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
VOID WINAPI CoTaskMemFree(LPVOID ptr)
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
static const WCHAR falseW[]
static const WCHAR trueW[]
#define memcpy(s1, s2, n)
#define sprintf(buf, format,...)
static DWORD DWORD void LPSTR DWORD cch
static HMODULE MODULEINFO DWORD cb
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
UINT WINAPI SysStringLen(BSTR str)
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
png_const_structrp png_const_inforp int * unit
static IPropertySystem propsys
@ PVCF_TREATEMPTYASGREATERTHAN
int PROPVAR_COMPARE_FLAGS
#define STRSAFE_E_INSUFFICIENT_BUFFER
__int64 _strtoi64(const char *nptr, char **endptr, int base)
#define HRESULT_FROM_WIN32(x)
#define ERROR_ARITHMETIC_OVERFLOW
#define DISP_E_TYPEMISMATCH