22#define NONAMELESSUNION
23#define NONAMELESSSTRUCT
38#define CY_MULTIPLIER 10000
39#define CY_MULTIPLIER_F 10000.0
40#define CY_HALF (CY_MULTIPLIER/2)
41#define CY_HALF_F (CY_MULTIPLIER_F/2.0)
70 FIXME(
"VT_ type %d unhandled, please report!\n",
vt);
77#define VARIANT_DutchRound(typ, value, res) do { \
78 double whole = value < 0 ? ceil(value) : floor(value); \
79 double fract = value - whole; \
80 if (fract > 0.5) res = (typ)whole + (typ)1; \
81 else if (fract == 0.5) { typ is_odd = (typ)whole & 1; res = whole + is_odd; } \
82 else if (fract >= 0.0) res = (typ)whole; \
83 else if (fract == -0.5) { typ is_odd = (typ)whole & 1; res = whole - is_odd; } \
84 else if (fract > -0.5) res = (typ)whole; \
85 else res = (typ)whole - (typ)1; \
118 static DISPPARAMS emptyParams = {
NULL,
NULL, 0, 0 };
146#define RETTYP static inline HRESULT
150#define SIMPLE(dest, src, func) RETTYP _##func(src in, dest* out) { \
151 *out = in; return S_OK; }
154#define NEGTST(dest, src, func) RETTYP _##func(src in, dest* out) { \
155 if (in < 0) return DISP_E_OVERFLOW; *out = in; return S_OK; }
158#define POSTST(dest, src, func, tst) RETTYP _##func(src in, dest* out) { \
159 if (in > (dest)tst) return DISP_E_OVERFLOW; *out = in; return S_OK; }
162#define BOTHTST(dest, src, func, lo, hi) RETTYP _##func(src in, dest* out) { \
163 if (in < (dest)lo || in > hi) return DISP_E_OVERFLOW; *out = in; return S_OK; }
284 return _VarI1FromUI1(bIn, pcOut);
303 return _VarI1FromI2(sIn, pcOut);
322 return _VarI1FromI4(iIn, pcOut);
363 if (dblIn < I1_MIN - 0.5 || dblIn >=
I1_MAX + 0.5)
407 return _VarI1FromI4(
i, pcOut);
467 return _VarI1FromBool(boolIn, pcOut);
486 return _VarI1FromUI2(usIn, pcOut);
506 return _VarI1FromUI4(ulIn, pcOut);
531 hRet = _VarI1FromI8(i64, pcOut);
551 return _VarI1FromI8(llIn, pcOut);
570 return _VarI1FromUI8(ullIn, pcOut);
592 return _VarUI1FromI2(sIn, pbOut);
611 return _VarUI1FromI4(iIn, pbOut);
653 if (dblIn < -0.5 || dblIn >=
UI1_MAX + 0.5)
681 return _VarUI1FromUI4(
i, pbOut);
760 return _VarUI1FromBool(boolIn, pbOut);
779 return _VarUI1FromI1(cIn, pbOut);
798 return _VarUI1FromUI2(usIn, pbOut);
817 return _VarUI1FromUI4(ulIn, pbOut);
842 hRet = _VarUI1FromI8(i64, pbOut);
862 return _VarUI1FromI8(llIn, pbOut);
881 return _VarUI1FromUI8(ullIn, pbOut);
902 return _VarI2FromUI1(bIn, psOut);
920 return _VarI2FromI4(iIn, psOut);
959 if (dblIn < I2_MIN - 0.5 || dblIn >=
I2_MAX + 0.5)
983 return _VarI2FromI4(
i, psOut);
1061 return _VarI2FromBool(boolIn, psOut);
1078 return _VarI2FromI1(cIn, psOut);
1096 return _VarI2FromUI2(usIn, psOut);
1114 return _VarI2FromUI4(ulIn, psOut);
1139 hRet = _VarI2FromI8(i64, psOut);
1158 return _VarI2FromI8(llIn, psOut);
1176 return _VarI2FromUI8(ullIn, psOut);
1196 return _VarUI2FromUI1(bIn, pusOut);
1214 return _VarUI2FromI2(sIn, pusOut);
1232 return _VarUI2FromI4(iIn, pusOut);
1271 if (dblIn < -0.5 || dblIn >=
UI2_MAX + 0.5)
1316 return _VarUI2FromUI4(
i, pusOut);
1375 return _VarUI2FromBool(boolIn, pusOut);
1393 return _VarUI2FromI1(cIn, pusOut);
1411 return _VarUI2FromUI4(ulIn, pusOut);
1436 hRet = _VarUI2FromI8(i64, pusOut);
1455 return _VarUI2FromI8(llIn, pusOut);
1473 return _VarUI2FromUI8(ullIn, pusOut);
1493 return _VarI4FromUI1(bIn, piOut);
1512 return _VarI4FromI2(sIn, piOut);
1551 if (dblIn < I4_MIN - 0.5 || dblIn >=
I4_MAX + 0.5)
1651 return _VarI4FromBool(boolIn, piOut);
1668 return _VarI4FromI1(cIn, piOut);
1685 return _VarI4FromUI2(usIn, piOut);
1703 return _VarI4FromUI4(ulIn, piOut);
1728 hRet = _VarI4FromI8(i64, piOut);
1747 return _VarI4FromI8(llIn, piOut);
1765 return _VarI4FromUI8(ullIn, piOut);
1785 return _VarUI4FromUI1(bIn, pulOut);
1803 return _VarUI4FromI2(sIn, pulOut);
1821 return _VarUI4FromI4(iIn, pulOut);
1860 if (dblIn < -0.5 || dblIn >=
UI4_MAX + 0.5)
1960 return _VarUI4FromBool(boolIn, pulOut);
1978 return _VarUI4FromI1(cIn, pulOut);
1995 return _VarUI4FromUI2(usIn, pulOut);
2020 hRet = _VarUI4FromI8(i64, pulOut);
2039 return _VarUI4FromI8(llIn, pulOut);
2057 return _VarUI4FromUI8(ullIn, pulOut);
2077 return _VarI8FromUI1(bIn, pi64Out);
2095 return _VarI8FromI2(sIn, pi64Out);
2150 if ( dblIn < -4611686018427387904.0 || dblIn >= 4611686018427387904.0)
2284 return _VarI8FromI1(cIn, pi64Out);
2301 return _VarI8FromUI2(usIn, pi64Out);
2318 return _VarI8FromUI4(ulIn, pi64Out);
2340 if (
DEC_SIGN(pdecIn) & ~DECIMAL_NEG)
2380 return _VarI8FromUI8(ullIn, pi64Out);
2401 return _VarUI8FromI8(llIn, pui64Out);
2418 return _VarUI8FromUI1(bIn, pui64Out);
2435 return _VarUI8FromI2(sIn, pui64Out);
2475 if (dblIn < -0.5 || dblIn > 1.844674407370955e19)
2613 return _VarUI8FromI1(cIn, pui64Out);
2630 return _VarUI8FromUI2(usIn, pui64Out);
2647 return _VarUI8FromUI4(ulIn, pui64Out);
2675 if (
DEC_SIGN(pdecIn) & ~DECIMAL_NEG)
2683 WARN(
"Sign would be ignored under Win32!\n");
2720 return _VarR4FromUI1(bIn, pFltOut);
2737 return _VarR4FromI2(sIn, pFltOut);
2754 return _VarR4FromI4(lIn, pFltOut);
2772 double d = dblIn < 0.0 ? -dblIn : dblIn;
2890 return _VarR4FromI1(cIn, pFltOut);
2910 return _VarR4FromUI2(usIn, pFltOut);
2930 return _VarR4FromUI4(ulIn, pFltOut);
2964 highPart *= 4294967296.0F;
2965 highPart *= 4294967296.0F;
2988 return _VarR4FromI8(llIn, pFltOut);
3005 return _VarR4FromUI8(ullIn, pFltOut);
3023 if (fltLeft < dblRight)
3025 else if (fltLeft > dblRight)
3047 return _VarR8FromUI1(bIn, pDblOut);
3064 return _VarR8FromI2(sIn, pDblOut);
3081 return _VarR8FromI4(lIn, pDblOut);
3098 return _VarR8FromR4(fltIn, pDblOut);
3132 return _VarR8FromDate(dateIn, pDblOut);
3211 return _VarR8FromI1(cIn, pDblOut);
3231 return _VarR8FromUI2(usIn, pDblOut);
3251 return _VarR8FromUI4(ulIn, pDblOut);
3270 double divisor = 1.0, highPart;
3284 highPart *= 4294967296.0F;
3285 highPart *= 4294967296.0F;
3308 return _VarR8FromI8(llIn, pDblOut);
3325 return _VarR8FromUI8(ullIn, pDblOut);
3343 *pDblOut =
pow(dblLeft, dblPow);
3370 double scale, whole, fract;
3378 whole = dblIn < 0 ?
ceil(dblIn) :
floor(dblIn);
3379 fract = dblIn - whole;
3382 dblIn = whole + 1.0;
3383 else if (fract == 0.5)
3384 dblIn = whole +
fmod(whole, 2.0);
3385 else if (fract >= 0.0)
3387 else if (fract == -0.5)
3388 dblIn = whole -
fmod(whole, 2.0);
3389 else if (fract > -0.5)
3392 dblIn = whole - 1.0;
3394 *pDblOut = dblIn /
scale;
3505#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
3509 static const unsigned short r8_fpcontrol = 0x137f;
3511 unsigned short old_fpcontrol, result_fpstatus;
3514 __asm__ __volatile__(
"fnclex" );
3515 __asm__ __volatile__(
"fstcw %0" :
"=m" (old_fpcontrol) : );
3516 __asm__ __volatile__(
"fldcw %0" : :
"m" (r8_fpcontrol) );
3518 __asm__ __volatile__(
"fldl %0" : :
"m" (dblIn) );
3519 __asm__ __volatile__(
"fmull %0" : :
"m" (r8_multiplier) );
3520 __asm__ __volatile__(
"fistpll %0" : :
"m" (*pCyOut) );
3522 __asm__ __volatile__(
"fstsw %0" :
"=m" (result_fpstatus) : );
3523 __asm__ __volatile__(
"fnclex" );
3524 __asm__ __volatile__(
"fldcw %0" : :
"m" (old_fpcontrol) );
3526 if (result_fpstatus & 0x9)
3530 if (dblIn < -922337203685477.5807 || dblIn >= 922337203685477.5807)
3878 if (cyIn.s.
Hi == (
int)0x80000000 && !cyIn.s.
Lo)
3953 if (cyIn.s.
Hi == (
int)0x80000000 && !cyIn.s.
Lo)
4024 else if (
result.int64 > 0)
4244 if (cyIn.s.
Hi & 0x80000000)
4403 if (pLi->
u.HighPart & 0x80000000)
4448 if (
DEC_SIGN(*ppDecLeft) & ~DECIMAL_NEG ||
DEC_SIGN(*ppDecRight) & ~DECIMAL_NEG)
4458 if (scaleAmount > 0)
4460 decTemp = *(*ppDecRight);
4461 *ppDecRight = &pDecOut[0];
4465 decTemp = *(*ppDecLeft);
4466 *ppDecLeft = &pDecOut[0];
4473 decTemp = pDecOut[0];
4479 DEC_SCALE(&pDecOut[0]) += (scaleAmount > 0) ? scaleAmount : (-scaleAmount);
4484 pDecOut[0] = decTemp;
4485 if (scaleAmount > 0)
4489 *ppDecLeft = &pDecOut[1];
4493 DEC_SCALE(&pDecOut[0]) += (-scaleAmount) -
i;
4495 *ppDecRight = &pDecOut[1];
4510 remainder = (digit > 0xFFFFFFFF) ? 1 : 0;
4511 di.
bitsnum[
i] = digit & 0xFFFFFFFF;
4525 *pulHigh = ul64.
u.HighPart;
4526 return ul64.
u.LowPart;
4536 if (ulLeft < ulRight)
4547 ul64.
u.HighPart = -ul64.
u.HighPart ;
4549 *pulHigh = ul64.
u.HighPart;
4550 return ul64.
u.LowPart;
4559 *pulHigh = ul64.
u.HighPart;
4560 return ul64.
u.LowPart;
4607 goto VarDecAdd_AsPositive;
4617VarDecAdd_AsNegative:
4624VarDecAdd_AsInvertedNegative:
4638 goto VarDecAdd_AsInvertedNegative;
4640 goto VarDecAdd_AsNegative;
4645VarDecAdd_AsPositive:
4708 for (
i =
n - 1;
i >= 0 && !
p[
i];
i--);
4709 for (;
i >= 0;
i--) {
4722 for (;
n > 0;
n--)
if (*
p++ != 0)
return FALSE;
4735 signed int mulstart;
4738 result->sign = (
a->sign ^
b->sign) ? 1 : 0;
4743 result->scale =
a->scale +
b->scale;
4744 memset(running, 0,
sizeof(running));
4747 for (mulstart =
ARRAY_SIZE(
a->bitsnum) - 1; mulstart >= 0 && !
a->bitsnum[mulstart]; mulstart--);
4757 for (iA = 0; iA <= mulstart; iA++) {
4761 for (iOverflowMul = 0, iB = 0; iB <
ARRAY_SIZE(
b->bitsnum); iB++) {
4765 iRV =
VARIANT_Mul(
b->bitsnum[iB],
a->bitsnum[iA], &iOverflowMul);
4781 while (
result->scale > 0) {
4782 memcpy(quotient, running,
sizeof(quotient));
4785 memcpy(running, quotient,
sizeof(quotient));
4806 remainder = (digit > 0xFFFFFFFF) ? 1 : 0;
4807 running[
i] = digit & 0xFFFFFFFF;
4838 else overflow =
TRUE;
4846 }
else overflow =
TRUE;
4850 memcpy(quotient,
a->bitsnum,
sizeof(
a->bitsnum));
4872 if (i <= a->
scale) {
4873 unsigned int numzeroes =
a->scale + 1 -
i;
4874 if (
i + 1 + numzeroes >=
n) {
4879 while (numzeroes > 0) {
4880 s[--numzeroes] =
'0';
4887 unsigned int periodpos =
i -
a->scale;
4891 memmove(
s + periodpos + 1,
s + periodpos, (
i + 1 - periodpos) *
sizeof(
WCHAR));
4892 s[periodpos] =
'.';
i++;
4895 while (
s[
i - 1] ==
'0')
s[--
i] =
'\0';
4896 if (
s[
i - 1] ==
'.')
s[--
i] =
'\0';
4935 unsigned char carry = 0;
4941 for (
i = 0;
i < np;
i++) {
4945 v[
i] =
sum & 0xffffffff;
4948 for (;
i < nv && carry;
i++) {
4951 v[
i] =
sum & 0xffffffff;
4976 DWORD * negdivisor = tempsub +
n;
4979 for (
i = 0;
i <
n;
i++) negdivisor[
i] = (
i < dn) ?
~divisor[
i] : 0xFFFFFFFF;
4987 for (
i <<= 5;
i < (
n << 5);
i++) {
4995 if ((tempsub[
n - 1] & 0x80000000) == 0) {
5008 for (iOverflowMul = 0,
i = 0;
i <
n;
i++)
5010 return (
unsigned char)iOverflowMul;
5019 DWORD *
a,
int * ascale,
unsigned int an,
5020 DWORD *
b,
int * bscale,
unsigned int bn)
5033 unsigned int tn = an + 1;
5036 if (bn + 1 > tn) tn = bn + 1;
5037 if (*ascale != *bscale) {
5040 DWORD * digitchosen;
5041 unsigned int nchosen;
5045 if (*ascale < *bscale) {
5046 targetscale = *ascale;
5047 scalechosen = bscale;
5051 targetscale = *bscale;
5052 scalechosen = ascale;
5060 while (*scalechosen > targetscale) {
5069 if (*ascale != *bscale) {
5070 DWORD * digitchosen;
5071 unsigned int nchosen;
5076 if (*ascale > *bscale) {
5077 targetscale = *ascale;
5078 scalechosen = bscale;
5082 targetscale = *bscale;
5083 scalechosen = ascale;
5093 while (*scalechosen < targetscale &&
t[nchosen] == 0) {
5095 if (
t[nchosen] == 0) {
5103 if (*ascale != *bscale) {
5106 DWORD * digitchosen;
5107 unsigned int nchosen;
5111 if (*ascale < *bscale) {
5112 targetscale = *ascale;
5113 scalechosen = bscale;
5117 targetscale = *bscale;
5118 scalechosen = ascale;
5126 while (*scalechosen > targetscale) {
5143 while (!underflow) {
5183 int quotientscale, remainderscale, tempquotientscale;
5184 DWORD remainderplusquotient[8];
5187 quotientscale = remainderscale = (
int)dividend->
scale - (
int)
divisor->scale;
5188 tempquotientscale = quotientscale;
5207 memset(remainderplusquotient, 0,
sizeof(remainderplusquotient));
5213 if (round_remainder) {
5214 if(remainderplusquotient[4] >= 5){
5219 remainder = (digit > 0xFFFFFFFF) ? 1 : 0;
5220 quotient->
bitsnum[
i] = digit & 0xFFFFFFFF;
5223 memset(remainderplusquotient, 0,
sizeof(remainderplusquotient));
5226 memcpy(remainderplusquotient, remainderplusquotient + 4, 4 *
sizeof(
DWORD));
5228 tempquotientscale = ++remainderscale;
5235 while (r_overflow ==
S_OK && quotientscale < 0) {
5236 memset(remainderplusquotient, 0,
sizeof(remainderplusquotient));
5245 if (r_overflow ==
S_OK) {
5246 if (quotientscale <= 255) quotient->
scale = quotientscale;
5263 int exponent5, exponent10;
5269 exponent5 = -exponent2;
5270 exponent10 = exponent2;
5273 while (exponent5 > 0) {
5280 if ((
val->bitsnum[0] & 1) == 0) {
5283 exponent10++; exponent5--;
5286 bPrevCarryBit =
val->bitsnum[2] & 1;
5287 val->bitsnum[2] >>= 1;
5288 bCurrCarryBit =
val->bitsnum[1] & 1;
5289 val->bitsnum[1] = (
val->bitsnum[1] >> 1) | (bPrevCarryBit ? 0x80000000 : 0);
5290 val->bitsnum[0] = (
val->bitsnum[0] >> 1) | (bCurrCarryBit ? 0x80000000 : 0);
5294 DWORD temp_bitsnum[3];
5311 bPrevCarryBit =
val->bitsnum[2] & 1;
5312 val->bitsnum[2] >>= 1;
5313 bCurrCarryBit =
val->bitsnum[1] & 1;
5314 val->bitsnum[1] = (
val->bitsnum[1] >> 1) | (bPrevCarryBit ? 0x80000000 : 0);
5315 val->bitsnum[0] = (
val->bitsnum[0] >> 1) | (bCurrCarryBit ? 0x80000000 : 0);
5321 while (exponent5 < 0) {
5325 if ((
val->bitsnum[2] & 0x80000000) == 0) {
5327 exponent10--; exponent5++;
5342 while (
hres ==
S_OK && exponent10 > 0) {
5362 }
else if (rem10 >= 5) {
5371 while (exponent10 < 0 && (
val->bitsnum[2] != 0 || (
val->bitsnum[1] & 0xFFE00000) != 0)) {
5382 while (exponent10 < 0 && (
val->bitsnum[2] != 0 ||
val->bitsnum[1] != 0 ||
5383 (
val->bitsnum[2] == 0 &&
val->bitsnum[1] == 0 && (
val->bitsnum[0] & 0xFF000000) != 0))) {
5395 while (exponent10 < 0) {
5396 DWORD temp_bitsnum[3];
5415 unsigned int m : 23;
5432 if (
fx.i.m == 0 &&
fx.i.exp_bias == 0) {
5435 }
else if (
fx.i.m == 0 &&
fx.i.exp_bias == 0xFF) {
5438 }
else if (
fx.i.exp_bias == 0xFF) {
5445 exponent2 =
fx.i.exp_bias - 127;
5449 dest->bitsnum[0] =
fx.i.m;
5450 dest->bitsnum[0] &= 0x007FFFFF;
5451 if (
fx.i.exp_bias == 0) {
5456 dest->bitsnum[0] |= 0x00800000;
5492 if (
fx.i.m_lo == 0 &&
fx.i.m_hi == 0 &&
fx.i.exp_bias == 0) {
5495 }
else if (
fx.i.m_lo == 0 &&
fx.i.m_hi == 0 &&
fx.i.exp_bias == 0x7FF) {
5498 }
else if (
fx.i.exp_bias == 0x7FF) {
5505 exponent2 =
fx.i.exp_bias - 1023;
5509 dest->bitsnum[0] =
fx.i.m_lo;
5510 dest->bitsnum[1] =
fx.i.m_hi;
5511 dest->bitsnum[1] &= 0x000FFFFF;
5512 if (
fx.i.exp_bias == 0) {
5517 dest->bitsnum[1] |= 0x00100000;
5541 if (divresult !=
S_OK)
5558 WARN(
"result scale is %u, scaling (with loss of significant digits)...\n",
5568 WARN(
"result underflowed, setting to 0\n");
5569 di_result.
scale = 0;
5577 remainder = (digit > 0xFFFFFFFF) ? 1 : 0;
5578 di_result.
bitsnum[
i] = digit & 0xFFFFFFFF;
5603 if (!pDecLeft || !pDecRight || !pDecOut)
return E_INVALIDARG;
5644 WARN(
"result scale is %u, scaling (with loss of significant digits)...\n",
5654 WARN(
"result underflowed, setting to 0\n");
5655 di_result.
scale = 0;
5683 return VarDecAdd(pDecLeft, &decRight, pDecOut);
5727 if (
DEC_SIGN(pDecIn) & ~DECIMAL_NEG)
5767 if (
DEC_SIGN(pDecIn) & ~DECIMAL_NEG)
5775 LONGLONG rounded = dbl >= 0.0 ? dbl + 0.5 : dbl - 0.5;
5834 memset(&tmp, 0,
sizeof(tmp));
5871 if (!pDecLeft || !pDecRight)
5874 if ((!(
DEC_SIGN(pDecLeft) & DECIMAL_NEG)) && (
DEC_SIGN(pDecRight) & DECIMAL_NEG) &&
5877 else if ((
DEC_SIGN(pDecLeft) & DECIMAL_NEG) && (!(
DEC_SIGN(pDecRight) & DECIMAL_NEG)) &&
5942 *pBoolOut = bIn ? VARIANT_TRUE : VARIANT_FALSE;
5960 *pBoolOut = sIn ? VARIANT_TRUE : VARIANT_FALSE;
5978 *pBoolOut = lIn ? VARIANT_TRUE : VARIANT_FALSE;
5996 *pBoolOut = fltIn ? VARIANT_TRUE : VARIANT_FALSE;
6014 *pBoolOut = dblIn ? VARIANT_TRUE : VARIANT_FALSE;
6032 *pBoolOut = dateIn ? VARIANT_TRUE : VARIANT_FALSE;
6050 *pBoolOut = cyIn.
int64 ? VARIANT_TRUE : VARIANT_FALSE;
6076 for (
i = 0;
i < (dwId & 0x0f);
i++)
p += *
p + 1;
6117 static const WCHAR szFalse[] = {
'#',
'F',
'A',
'L',
'S',
'E',
'#',
'\0' };
6118 static const WCHAR szTrue[] = {
'#',
'T',
'R',
'U',
'E',
'#',
'\0' };
6123 if (!strIn || !pBoolOut)
6150VarBoolFromStr_CheckLocalised:
6156 *pBoolOut = VARIANT_TRUE;
6162 *pBoolOut = VARIANT_FALSE;
6171 goto VarBoolFromStr_CheckLocalised;
6175 if (!
wcscmp(strIn, szFalse))
6176 *pBoolOut = VARIANT_FALSE;
6177 else if (!
wcscmp(strIn, szTrue))
6178 *pBoolOut = VARIANT_TRUE;
6185 if (
SUCCEEDED(hRes)) *pBoolOut =
d ? VARIANT_TRUE : VARIANT_FALSE;
6225 *pBoolOut = cIn ? VARIANT_TRUE : VARIANT_FALSE;
6243 *pBoolOut = usIn ? VARIANT_TRUE : VARIANT_FALSE;
6261 *pBoolOut = ulIn ? VARIANT_TRUE : VARIANT_FALSE;
6284 *pBoolOut = VARIANT_TRUE;
6286 *pBoolOut = VARIANT_FALSE;
6304 *pBoolOut = llIn ? VARIANT_TRUE : VARIANT_FALSE;
6322 *pBoolOut = ullIn ? VARIANT_TRUE : VARIANT_FALSE;
6334 WCHAR ulNextDigit = ulVal % 10;
6336 *szOut-- =
'0' + ulNextDigit;
6337 ulVal = (ulVal - ulNextDigit) / 10;
6347 WCHAR szConverted[256];
6355 szConverted[0] =
'\0';
6358 szOut = szConverted;
6460 WCHAR lpDecimalSep[16];
6471 if (lpDecimalSep[0] ==
'.' && lpDecimalSep[1] ==
'\0')
6497 WARN(
"GetNumberFormatW() failed, returning raw number string instead\n");
6526 static const WCHAR szAccept[] = {
'0',
'.',
'\0'};
6620 if (cyIn.s.
Hi & 0x80000000UL) {
6625 decVal.
bitsnum[0] = ~decVal.bitsnum[0];
6626 decVal.
bitsnum[1] = ~decVal.bitsnum[1];
6652 if(min_len >= date_len)
6655 for(
len=0, tmp=o; tmp; tmp/=10)
len++;
6660 for(tmp=min_len-
len; tmp>0; tmp--)
6662 for(tmp=
len; tmp>0; tmp--, o/=10)
6663 date[tmp-1] =
'0' + o%10;
6664 return min_len>
len ? min_len :
len;
6671 static const LCTYPE dayname[] = {
6675 static const LCTYPE sdayname[] = {
6680 static const LCTYPE monthname[] = {
6685 static const LCTYPE smonthname[] = {
6696 while(*
fmt && date_len) {
6734 FIXME(
"Should be using GetCalendarInfo(CAL_SERASTRING), defaulting to 'AD'\n");
6784 TRACE(
"(%g,0x%08x,0x%08x,%p)\n", dateIn, lcid,
dwFlags, pbstrOut);
6794 FIXME(
"VAR_CALENDAR_HIJRI/VAR_CALENDAR_GREGORIAN not handled\n");
6800 double whole = dateIn < 0 ?
ceil(dateIn) :
floor(dateIn);
6801 double partial = dateIn - whole;
6805 else if (partial > -1
e-12 && partial < 1
e-12)
6858 TRACE(
"%d,0x%08x,0x%08x,%p\n", boolIn, lcid,
dwFlags, pbstrOut);
6884 if (boolIn == VARIANT_FALSE)
6887VarBstrFromBool_GetLocalised:
6897 goto VarBstrFromBool_GetLocalised;
6901 WARN(
"Failed to load bool text!\n");
7109 unsigned int lenLeft, lenRight;
7126 (*pbstrOut)[0] =
'\0';
7129 memcpy(*pbstrOut, pbstrLeft, lenLeft);
7132 memcpy((
CHAR*)*pbstrOut + lenLeft, pbstrRight, lenRight);
7163 TRACE(
"%s,%s,%d,%08x\n",
7167 if (!pbstrLeft || !*pbstrLeft)
7169 if (pbstrRight && *pbstrRight)
7172 else if (!pbstrRight || !*pbstrRight)
7179 ret =
memcmp(pbstrLeft, pbstrRight,
min(lenLeft, lenRight));
7184 if (lenLeft < lenRight)
7186 if (lenLeft > lenRight)
7195 if (lenLeft == 0 || lenRight == 0)
7197 if (lenLeft == 0 && lenRight == 0)
return VARCMP_EQ;
7295 *pdateOut = (
DATE)dblIn;
7355#define DP_TIMESEP 0x01
7356#define DP_DATESEP 0x02
7357#define DP_MONTH 0x04
7369#define TIMEFLAG(i) ((dp.dwFlags[i] & DP_TIMESEP) << i)
7371#define IsLeapYear(y) (((y % 4) == 0) && (((y % 100) != 0) || ((y % 400) == 0)))
7376 static const BYTE days[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
7387#define ORDER_MDY 0x01
7388#define ORDER_YMD 0x02
7389#define ORDER_YDM 0x04
7390#define ORDER_DMY 0x08
7391#define ORDER_MYD 0x10
7397 DWORD dwAllOrders, dwTry, dwCount = 0,
v1,
v2,
v3;
7404 goto VARIANT_MakeDate_OK;
7445VARIANT_MakeDate_Start:
7446 TRACE(
"dwAllOrders is 0x%08x\n", dwAllOrders);
7457 case 0: dwTry = dwAllOrders &
ORDER_MDY;
break;
7458 case 1: dwTry = dwAllOrders &
ORDER_DMY;
break;
7459 default: dwTry = dwAllOrders &
ORDER_YMD;
break;
7462 else if (dwCount == 1)
7475 dwTry = dwAllOrders;
7478 TRACE(
"Attempt %d, dwTry is 0x%08x\n", dwCount, dwTry);
7484#define DATE_SWAP(x,y) do { dwTemp = x; x = y; y = dwTemp; } while (0)
7491 goto VARIANT_MakeDate_OK;
7493 dwAllOrders &= ~ORDER_MDY;
7500 goto VARIANT_MakeDate_OK;
7502 dwAllOrders &= ~ORDER_YMD;
7510 goto VARIANT_MakeDate_OK;
7512 dwAllOrders &= ~ORDER_YDM;
7517 goto VARIANT_MakeDate_OK;
7518 dwAllOrders &= ~ORDER_DMY;
7527 goto VARIANT_MakeDate_OK;
7529 dwAllOrders &= ~ORDER_MYD;
7540 goto VARIANT_MakeDate_Start;
7597 static const USHORT ParseDateTokens[] =
7616 static const BYTE ParseDateMonths[] =
7618 1,2,3,4,5,6,7,8,9,10,11,12,13,
7619 1,2,3,4,5,6,7,8,9,10,11,12,13
7624 DWORD dwDateSeps = 0, iDate = 0;
7638 memset(&dp, 0,
sizeof(dp));
7642 TRACE(
"iDate is %d\n", iDate);
7680 if (dwLen && !
_wcsnicmp(strIn, tokens[
i], dwLen))
7693 else if (
i > 39 &&
i < 42)
7703 strIn += (dwLen - 1);
7711 if ((*strIn ==
'a' || *strIn ==
'A' || *strIn ==
'p' || *strIn ==
'P') &&
7715 if (*strIn ==
'a' || *strIn ==
'A')
7735 else if (*strIn ==
':' || *strIn ==
'.')
7740 if (tokens[42][0] == *strIn)
7751 else if (*strIn ==
'-' || *strIn ==
'/')
7754 if (dwDateSeps > 2 || !dp.
dwCount || !strIn[1])
7759 else if (*strIn ==
',' ||
iswspace(*strIn))
7761 if (*strIn ==
',' && !strIn[1])
8026 *pdateOut = (
DATE)llIn;
8046 *pdateOut = (
DATE)ullIn;
_STLP_VENDOR_CSTD::ldiv_t div(long __x, long __y)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static const WCHAR empty[]
static DOUBLE day(DOUBLE time)
VOID WINAPI GetSystemTime(OUT LPSYSTEMTIME lpSystemTime)
LPVOID WINAPI LockResource(HGLOBAL handle)
HRSRC WINAPI FindResourceExW(HMODULE hModule, LPCWSTR type, LPCWSTR name, WORD lang)
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
INT WINAPI CompareStringW(LCID lcid, DWORD flags, LPCWSTR str1, INT len1, LPCWSTR str2, INT len2)
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
LCID WINAPI ConvertDefaultLocale(LCID lcid)
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
HRESULT WINAPI VarUI1FromI4(LONG iIn, BYTE *pbOut)
HRESULT WINAPI VarUI8FromUI2(USHORT usIn, ULONG64 *pui64Out)
HRESULT WINAPI VarI4FromUI8(ULONG64 ullIn, LONG *piOut)
HRESULT WINAPI VarBstrFromUI1(BYTE bIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut)
HRESULT WINAPI VarUI2FromCy(CY cyIn, USHORT *pusOut)
HRESULT WINAPI VarCyMul(CY cyLeft, CY cyRight, CY *pCyOut)
HRESULT WINAPI VarUI8FromCy(CY cyIn, ULONG64 *pui64Out)
static BOOL VARIANT_IsValidMonthDay(DWORD day, DWORD month, DWORD year)
static BOOL VARIANT_int_iszero(const DWORD *p, unsigned int n)
HRESULT WINAPI VarCyFromR8(double dblIn, CY *pCyOut)
HRESULT WINAPI VarCyInt(CY cyIn, CY *pCyOut)
HRESULT WINAPI VarI2FromUI1(BYTE bIn, SHORT *psOut)
HRESULT WINAPI VarR4FromI1(signed char cIn, float *pFltOut)
HRESULT WINAPI VarCyMulI4(CY cyLeft, LONG lRight, CY *pCyOut)
HRESULT WINAPI VarUI4FromI4(LONG iIn, ULONG *pulOut)
HRESULT WINAPI VarCyFromDec(DECIMAL *pdecIn, CY *pCyOut)
HRESULT WINAPI VarBstrFromBool(VARIANT_BOOL boolIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut)
HRESULT WINAPI VarCyFromUI1(BYTE bIn, CY *pCyOut)
HRESULT WINAPI VarI2FromStr(OLECHAR *strIn, LCID lcid, ULONG dwFlags, SHORT *psOut)
HRESULT WINAPI VarI1FromDec(DECIMAL *pdecIn, signed char *pcOut)
HRESULT WINAPI VarR4FromUI8(ULONG64 ullIn, float *pFltOut)
HMODULE hProxyDll DECLSPEC_HIDDEN
HRESULT WINAPI VarI2FromBool(VARIANT_BOOL boolIn, SHORT *psOut)
static HRESULT VARIANT_NumberFromBstr(OLECHAR *pStrIn, LCID lcid, ULONG ulFlags, void *pOut, VARTYPE vt)
HRESULT WINAPI VarDecCmp(const DECIMAL *pDecLeft, const DECIMAL *pDecRight)
HRESULT WINAPI VarUI2FromDisp(IDispatch *pdispIn, LCID lcid, USHORT *pusOut)
HRESULT WINAPI VarBoolFromUI1(BYTE bIn, VARIANT_BOOL *pBoolOut)
HRESULT WINAPI VarUI1FromUI4(ULONG ulIn, BYTE *pbOut)
HRESULT WINAPI VarCyFromStr(OLECHAR *strIn, LCID lcid, ULONG dwFlags, CY *pCyOut)
HRESULT WINAPI VarI1FromR8(double dblIn, signed char *pcOut)
HRESULT WINAPI VarI1FromR4(FLOAT fltIn, signed char *pcOut)
HRESULT WINAPI VarUI4FromDisp(IDispatch *pdispIn, LCID lcid, ULONG *pulOut)
HRESULT WINAPI VarCyFromUI2(USHORT usIn, CY *pCyOut)
HRESULT WINAPI VarI1FromDisp(IDispatch *pdispIn, LCID lcid, signed char *pcOut)
HRESULT WINAPI VarDecFromCy(CY cyIn, DECIMAL *pDecOut)
HRESULT WINAPI VarR8FromI2(SHORT sIn, double *pDblOut)
HRESULT WINAPI VarUI4FromUI2(USHORT usIn, ULONG *pulOut)
HRESULT WINAPI VarI1FromUI2(USHORT usIn, signed char *pcOut)
HRESULT WINAPI VarCyFix(CY cyIn, CY *pCyOut)
HRESULT WINAPI VarR8FromCy(CY cyIn, double *pDblOut)
HRESULT WINAPI VarI1FromUI4(ULONG ulIn, signed char *pcOut)
HRESULT WINAPI VarBstrFromR8(double dblIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut)
HRESULT WINAPI VarUI4FromI1(signed char cIn, ULONG *pulOut)
HRESULT WINAPI VarI2FromUI8(ULONG64 ullIn, SHORT *psOut)
HRESULT WINAPI VarR4CmpR8(float fltLeft, double dblRight)
HRESULT WINAPI VarI8FromUI1(BYTE bIn, LONG64 *pi64Out)
HRESULT WINAPI VarDecCmpR8(const DECIMAL *pDecLeft, double dblRight)
HRESULT WINAPI VarDecAdd(const DECIMAL *pDecLeft, const DECIMAL *pDecRight, DECIMAL *pDecOut)
HRESULT WINAPI VarBoolFromDec(DECIMAL *pDecIn, VARIANT_BOOL *pBoolOut)
HRESULT WINAPI VarBstrFromI2(short sIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut)
HRESULT WINAPI VarCyAbs(CY cyIn, CY *pCyOut)
static ULONG VARIANT_Mul(ULONG ulLeft, ULONG ulRight, ULONG *pulHigh)
HRESULT WINAPI VarI4FromBool(VARIANT_BOOL boolIn, LONG *piOut)
static int output_int_len(int o, int min_len, WCHAR *date, int date_len)
HRESULT WINAPI VarUI8FromUI4(ULONG ulIn, ULONG64 *pui64Out)
HRESULT WINAPI VarI8FromDisp(IDispatch *pdispIn, LCID lcid, LONG64 *pi64Out)
#define BOTHTST(dest, src, func, lo, hi)
static int VARIANT_DI_mul(const VARIANT_DI *a, const VARIANT_DI *b, VARIANT_DI *result)
HRESULT WINAPI VarUI1FromR8(double dblIn, BYTE *pbOut)
HRESULT WINAPI VarI1FromI2(SHORT sIn, signed char *pcOut)
HRESULT WINAPI VarDateFromDisp(IDispatch *pdispIn, LCID lcid, DATE *pdateOut)
HRESULT WINAPI VarBstrFromI4(LONG lIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut)
HRESULT WINAPI VarUI2FromDec(DECIMAL *pdecIn, USHORT *pusOut)
HRESULT WINAPI VarDecFromI2(SHORT sIn, DECIMAL *pDecOut)
HRESULT WINAPI VarI8FromStr(OLECHAR *strIn, LCID lcid, ULONG dwFlags, LONG64 *pi64Out)
HRESULT WINAPI VarI8FromR8(double dblIn, LONG64 *pi64Out)
HRESULT WINAPI VarR8FromI8(LONG64 llIn, double *pDblOut)
HRESULT WINAPI VarDecRound(const DECIMAL *pDecIn, int cDecimals, DECIMAL *pDecOut)
static HRESULT VARIANT_DI_div(const VARIANT_DI *dividend, const VARIANT_DI *divisor, VARIANT_DI *quotient, BOOL round_remainder)
static void VARIANT_DIFromDec(const DECIMAL *from, VARIANT_DI *to)
HRESULT WINAPI VarR4FromDisp(IDispatch *pdispIn, LCID lcid, float *pFltOut)
HRESULT WINAPI VarDateFromI1(signed char cIn, DATE *pdateOut)
HRESULT WINAPI VarUI2FromI1(signed char cIn, USHORT *pusOut)
#define NEGTST(dest, src, func)
HRESULT WINAPI VarDecFromUI1(BYTE bIn, DECIMAL *pDecOut)
HRESULT WINAPI VarUI2FromI4(LONG iIn, USHORT *pusOut)
HRESULT WINAPI VarUI1FromR4(FLOAT fltIn, BYTE *pbOut)
HRESULT WINAPI VarI1FromUI1(BYTE bIn, signed char *pcOut)
HRESULT WINAPI VarDecFromR8(double dblIn, DECIMAL *pDecOut)
HRESULT WINAPI VarI8FromUI8(ULONG64 ullIn, LONG64 *pi64Out)
HRESULT WINAPI VarI4FromI2(SHORT sIn, LONG *piOut)
HRESULT WINAPI VarDateFromUI8(ULONG64 ullIn, DATE *pdateOut)
HRESULT WINAPI VarDateFromR4(FLOAT fltIn, DATE *pdateOut)
HRESULT WINAPI VarBoolFromI8(LONG64 llIn, VARIANT_BOOL *pBoolOut)
HRESULT WINAPI VarCyMulI8(CY cyLeft, LONG64 llRight, CY *pCyOut)
static HRESULT VARIANT_do_division(const DECIMAL *pDecLeft, const DECIMAL *pDecRight, DECIMAL *pDecOut, BOOL round)
HRESULT WINAPI VarI1FromI4(LONG iIn, signed char *pcOut)
static ULONG VARIANT_Add(ULONG ulLeft, ULONG ulRight, ULONG *pulHigh)
HRESULT WINAPI VarI4FromUI2(USHORT usIn, LONG *piOut)
HRESULT WINAPI VarI8FromDate(DATE dateIn, LONG64 *pi64Out)
HRESULT WINAPI VarI4FromDate(DATE dateIn, LONG *piOut)
HRESULT WINAPI VarDecFix(const DECIMAL *pDecIn, DECIMAL *pDecOut)
HRESULT WINAPI VarI8FromCy(CY cyIn, LONG64 *pi64Out)
static WCHAR * VARIANT_WriteNumber(ULONG64 ulVal, WCHAR *szOut)
static const WCHAR szFloatFormatW[]
static HRESULT VARIANT_MakeDate(DATEPARSE *dp, DWORD iDate, DWORD offset, SYSTEMTIME *st)
static BSTR VARIANT_BstrReplaceDecimal(const WCHAR *buff, LCID lcid, ULONG dwFlags)
HRESULT WINAPI VarBoolFromStr(OLECHAR *strIn, LCID lcid, ULONG dwFlags, VARIANT_BOOL *pBoolOut)
HRESULT WINAPI VarBstrFromCy(CY cyIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut)
HRESULT WINAPI VarUI8FromBool(VARIANT_BOOL boolIn, ULONG64 *pui64Out)
HRESULT WINAPI VarI8FromI2(SHORT sIn, LONG64 *pi64Out)
HRESULT WINAPI VarR8FromUI2(USHORT usIn, double *pDblOut)
HRESULT WINAPI VarUI8FromR4(FLOAT fltIn, ULONG64 *pui64Out)
HRESULT WINAPI VarUI1FromCy(CY cyIn, BYTE *pbOut)
HRESULT WINAPI VarBoolFromI2(SHORT sIn, VARIANT_BOOL *pBoolOut)
HRESULT WINAPI VarDateFromUI1(BYTE bIn, DATE *pdateOut)
HRESULT WINAPI VarR8FromDate(DATE dateIn, double *pDblOut)
HRESULT WINAPI VarDecFromDisp(IDispatch *pdispIn, LCID lcid, DECIMAL *pDecOut)
HRESULT WINAPI VarR4FromUI4(ULONG ulIn, float *pFltOut)
HRESULT WINAPI VarCyFromBool(VARIANT_BOOL boolIn, CY *pCyOut)
HRESULT WINAPI VarI4FromDisp(IDispatch *pdispIn, LCID lcid, LONG *piOut)
HRESULT WINAPI VarI2FromI1(signed char cIn, SHORT *psOut)
HRESULT WINAPI VarCyRound(CY cyIn, int cDecimals, CY *pCyOut)
HRESULT WINAPI VarUI1FromDec(DECIMAL *pdecIn, BYTE *pbOut)
HRESULT WINAPI VarCyFromDate(DATE dateIn, CY *pCyOut)
HRESULT WINAPI VarI4FromR8(double dblIn, LONG *piOut)
HRESULT WINAPI VarI8FromR4(FLOAT fltIn, LONG64 *pi64Out)
HRESULT WINAPI VarBoolFromI4(LONG lIn, VARIANT_BOOL *pBoolOut)
HRESULT WINAPI VarR4FromUI1(BYTE bIn, float *pFltOut)
HRESULT WINAPI VarDateFromDec(DECIMAL *pdecIn, DATE *pdateOut)
HRESULT WINAPI VarI4FromI1(signed char cIn, LONG *piOut)
HRESULT WINAPI VarBoolFromCy(CY cyIn, VARIANT_BOOL *pBoolOut)
static unsigned char VARIANT_int_add(DWORD *v, unsigned int nv, const DWORD *p, unsigned int np)
static int VARIANT_DecCmp(const DECIMAL *pDecLeft, const DECIMAL *pDecRight)
static void VARIANT_DI_clear(VARIANT_DI *i)
HRESULT WINAPI VarI2FromDate(DATE dateIn, SHORT *psOut)
HRESULT WINAPI VarUI1FromUI8(ULONG64 ullIn, BYTE *pbOut)
HRESULT WINAPI VarDecFromR4(FLOAT fltIn, DECIMAL *pDecOut)
HRESULT WINAPI VarUI4FromR8(double dblIn, ULONG *pulOut)
HRESULT WINAPI VarBstrFromDate(DATE dateIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut)
HRESULT WINAPI VarI2FromI8(LONG64 llIn, SHORT *psOut)
HRESULT WINAPI VarBoolFromR4(FLOAT fltIn, VARIANT_BOOL *pBoolOut)
HRESULT WINAPI VarDecSub(const DECIMAL *pDecLeft, const DECIMAL *pDecRight, DECIMAL *pDecOut)
HRESULT WINAPI VarR8FromUI8(ULONG64 ullIn, double *pDblOut)
HRESULT WINAPI VarUI4FromI2(SHORT sIn, ULONG *pulOut)
HRESULT WINAPI VarI2FromUI2(USHORT usIn, SHORT *psOut)
HRESULT WINAPI VarR4FromCy(CY cyIn, float *pFltOut)
HRESULT WINAPI VarUI2FromI8(LONG64 llIn, USHORT *pusOut)
#define VARIANT_DutchRound(typ, value, res)
HRESULT WINAPI VarR4FromDec(DECIMAL *pDecIn, float *pFltOut)
static HRESULT VARIANT_BstrFromReal(DOUBLE dblIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut, LPCWSTR lpszFormat)
HRESULT WINAPI VarUI1FromI2(SHORT sIn, BYTE *pbOut)
static HRESULT VARIANT_DI_normalize(VARIANT_DI *val, int exponent2, BOOL isDouble)
HRESULT WINAPI VarUI4FromDec(DECIMAL *pdecIn, ULONG *pulOut)
HRESULT WINAPI VarCyCmpR8(CY cyLeft, double dblRight)
HRESULT WINAPI VarUI2FromStr(OLECHAR *strIn, LCID lcid, ULONG dwFlags, USHORT *pusOut)
HRESULT WINAPI VarI4FromI8(LONG64 llIn, LONG *piOut)
HRESULT WINAPI VarUI8FromR8(double dblIn, ULONG64 *pui64Out)
HRESULT WINAPI VarUI8FromDate(DATE dateIn, ULONG64 *pui64Out)
HRESULT WINAPI VarI8FromI1(signed char cIn, LONG64 *pi64Out)
#define POSTST(dest, src, func, tst)
HRESULT WINAPI VarDecNeg(const DECIMAL *pDecIn, DECIMAL *pDecOut)
HRESULT WINAPI VarR4FromI2(SHORT sIn, float *pFltOut)
HRESULT WINAPI VarI1FromUI8(ULONG64 ullIn, signed char *pcOut)
static HRESULT VARIANT_DI_FromR4(float source, VARIANT_DI *dest)
HRESULT WINAPI VarR8Round(double dblIn, int nDig, double *pDblOut)
HRESULT WINAPI VarBstrCmp(BSTR pbstrLeft, BSTR pbstrRight, LCID lcid, DWORD dwFlags)
HRESULT WINAPI VarUI4FromStr(OLECHAR *strIn, LCID lcid, ULONG dwFlags, ULONG *pulOut)
static HRESULT VARIANT_FromDisp(IDispatch *pdispIn, LCID lcid, void *pOut, VARTYPE vt, DWORD dwFlags)
HRESULT WINAPI VarUI8FromDisp(IDispatch *pdispIn, LCID lcid, ULONG64 *pui64Out)
HRESULT WINAPI VarUI4FromI8(LONG64 llIn, ULONG *pulOut)
HRESULT WINAPI VarR8FromUI4(ULONG ulIn, double *pDblOut)
static HRESULT VARIANT_DI_FromR8(double source, VARIANT_DI *dest)
HRESULT WINAPI VarUI2FromDate(DATE dateIn, USHORT *pusOut)
HRESULT WINAPI VarDecFromUI8(ULONG64 ullIn, DECIMAL *pDecOut)
HRESULT WINAPI VarI2FromDisp(IDispatch *pdispIn, LCID lcid, SHORT *psOut)
HRESULT WINAPI VarDateFromCy(CY cyIn, DATE *pdateOut)
HRESULT WINAPI VarUI2FromUI1(BYTE bIn, USHORT *pusOut)
HRESULT WINAPI VarBoolFromDate(DATE dateIn, VARIANT_BOOL *pBoolOut)
HRESULT WINAPI VarI8FromDec(DECIMAL *pdecIn, LONG64 *pi64Out)
HRESULT WINAPI VarDateFromUI4(ULONG ulIn, DATE *pdateOut)
HRESULT WINAPI VarR8FromI4(LONG lIn, double *pDblOut)
HRESULT WINAPI VarDecFromUI2(USHORT usIn, DECIMAL *pDecOut)
HRESULT WINAPI VarCyFromI8(LONG64 llIn, CY *pCyOut)
HRESULT WINAPI VarUI8FromStr(OLECHAR *strIn, LCID lcid, ULONG dwFlags, ULONG64 *pui64Out)
HRESULT WINAPI VarDateFromBool(VARIANT_BOOL boolIn, DATE *pdateOut)
HRESULT WINAPI VarI2FromR8(double dblIn, SHORT *psOut)
HRESULT WINAPI VarDecFromBool(VARIANT_BOOL bIn, DECIMAL *pDecOut)
HRESULT WINAPI VarCyCmp(CY cyLeft, CY cyRight)
HRESULT WINAPI VarI1FromBool(VARIANT_BOOL boolIn, signed char *pcOut)
HRESULT WINAPI VarR4FromUI2(USHORT usIn, float *pFltOut)
HRESULT WINAPI VarUI4FromUI8(ULONG64 ullIn, ULONG *pulOut)
HRESULT WINAPI VarBstrFromI8(LONG64 llIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut)
HRESULT WINAPI VarDecAbs(const DECIMAL *pDecIn, DECIMAL *pDecOut)
struct tagDATEPARSE DATEPARSE
static ULONG VARIANT_Sub(ULONG ulLeft, ULONG ulRight, ULONG *pulHigh)
HRESULT WINAPI VarUI2FromBool(VARIANT_BOOL boolIn, USHORT *pusOut)
HRESULT WINAPI VarUI1FromUI2(USHORT usIn, BYTE *pbOut)
HRESULT WINAPI VarUI1FromStr(OLECHAR *strIn, LCID lcid, ULONG dwFlags, BYTE *pbOut)
static BSTR VARIANT_MakeBstr(LCID lcid, DWORD dwFlags, WCHAR *szOut)
RETTYP _VarR8FromCy(CY i, double *o)
HRESULT WINAPI VarDecFromUI4(ULONG ulIn, DECIMAL *pDecOut)
HRESULT WINAPI VarUI1FromI8(LONG64 llIn, BYTE *pbOut)
HRESULT WINAPI VarI2FromR4(FLOAT fltIn, SHORT *psOut)
HRESULT WINAPI VarDecFromI4(LONG lIn, DECIMAL *pDecOut)
HRESULT WINAPI VarBstrFromUI8(ULONG64 ullIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut)
HRESULT WINAPI VarBstrFromDec(DECIMAL *pDecIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut)
HRESULT WINAPI VarI4FromCy(CY cyIn, LONG *piOut)
HRESULT WINAPI VarBoolFromUI8(ULONG64 ullIn, VARIANT_BOOL *pBoolOut)
HRESULT WINAPI VarUI4FromR4(FLOAT fltIn, ULONG *pulOut)
HRESULT WINAPI VarUI8FromI8(LONG64 llIn, ULONG64 *pui64Out)
HRESULT WINAPI VarR8FromDisp(IDispatch *pdispIn, LCID lcid, double *pDblOut)
static void VARIANT_int_div(DWORD *p, unsigned int n, const DWORD *divisor, unsigned int dn)
HRESULT WINAPI VarUI2FromUI4(ULONG ulIn, USHORT *pusOut)
HRESULT WINAPI VarUI1FromDisp(IDispatch *pdispIn, LCID lcid, BYTE *pbOut)
HRESULT WINAPI VarUI8FromDec(DECIMAL *pdecIn, ULONG64 *pui64Out)
HRESULT WINAPI VarUI1FromBool(VARIANT_BOOL boolIn, BYTE *pbOut)
HRESULT WINAPI VarBoolFromDisp(IDispatch *pdispIn, LCID lcid, VARIANT_BOOL *pBoolOut)
static void VARIANT_CopyData(const VARIANT *srcVar, VARTYPE vt, void *pOut)
HRESULT WINAPI VarDecInt(const DECIMAL *pDecIn, DECIMAL *pDecOut)
HRESULT WINAPI VarCyFromR4(FLOAT fltIn, CY *pCyOut)
HRESULT WINAPI VarR4FromDate(DATE dateIn, float *pFltOut)
HRESULT WINAPI VarI4FromUI1(BYTE bIn, LONG *piOut)
HRESULT WINAPI VarCyNeg(CY cyIn, CY *pCyOut)
HRESULT WINAPI VarR4FromI4(LONG lIn, float *pFltOut)
HRESULT WINAPI VarCyFromI4(LONG lIn, CY *pCyOut)
HRESULT WINAPI VarBoolFromUI2(USHORT usIn, VARIANT_BOOL *pBoolOut)
static const WCHAR szDoubleFormatW[]
HRESULT WINAPI VarUI2FromUI8(ULONG64 ullIn, USHORT *pusOut)
static unsigned char VARIANT_int_divbychar(DWORD *p, unsigned int n, unsigned char divisor)
HRESULT WINAPI VarCySub(CY cyLeft, CY cyRight, CY *pCyOut)
HRESULT WINAPI VarCyFromDisp(IDispatch *pdispIn, LCID lcid, CY *pCyOut)
HRESULT WINAPI VarI2FromUI4(ULONG ulIn, SHORT *psOut)
HRESULT WINAPI VarUI4FromBool(VARIANT_BOOL boolIn, ULONG *pulOut)
HRESULT WINAPI VarDecMul(const DECIMAL *pDecLeft, const DECIMAL *pDecRight, DECIMAL *pDecOut)
static HRESULT VARIANT_DecScale(const DECIMAL **ppDecLeft, const DECIMAL **ppDecRight, DECIMAL pDecOut[2])
HRESULT WINAPI VarDecFromStr(OLECHAR *strIn, LCID lcid, ULONG dwFlags, DECIMAL *pDecOut)
HRESULT WINAPI VarCyFromUI8(ULONG64 ullIn, CY *pCyOut)
HRESULT WINAPI VarI8FromUI4(ULONG ulIn, LONG64 *pi64Out)
HRESULT WINAPI VarUI4FromCy(CY cyIn, ULONG *pulOut)
static const int CY_Divisors[5]
HRESULT WINAPI VarUI8FromUI1(BYTE bIn, ULONG64 *pui64Out)
HRESULT WINAPI VarR8FromI1(signed char cIn, double *pDblOut)
HRESULT WINAPI VarR4FromBool(VARIANT_BOOL boolIn, float *pFltOut)
HRESULT WINAPI VarR8FromDec(const DECIMAL *pDecIn, double *pDblOut)
HRESULT WINAPI VarUI8FromI2(SHORT sIn, ULONG64 *pui64Out)
HRESULT WINAPI VarBstrFromR4(FLOAT fltIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut)
HRESULT WINAPI VarUI1FromI1(signed char cIn, BYTE *pbOut)
HRESULT WINAPI VarBoolFromR8(double dblIn, VARIANT_BOOL *pBoolOut)
HRESULT WINAPI VarI4FromDec(DECIMAL *pdecIn, LONG *piOut)
HRESULT WINAPI VarUI1FromDate(DATE dateIn, BYTE *pbOut)
HRESULT WINAPI VarBoolFromUI4(ULONG ulIn, VARIANT_BOOL *pBoolOut)
HRESULT WINAPI VarR8FromUI1(BYTE bIn, double *pDblOut)
HRESULT WINAPI VarDecFromDate(DATE dateIn, DECIMAL *pDecOut)
HRESULT WINAPI VarBstrFromDisp(IDispatch *pdispIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut)
HRESULT WINAPI VarDecDiv(const DECIMAL *pDecLeft, const DECIMAL *pDecRight, DECIMAL *pDecOut)
struct DECIMAL_internal VARIANT_DI
HRESULT WINAPI VarR4FromI8(LONG64 llIn, float *pFltOut)
HRESULT WINAPI VarR8FromBool(VARIANT_BOOL boolIn, double *pDblOut)
HRESULT WINAPI VarI1FromI8(LONG64 llIn, signed char *pcOut)
HRESULT WINAPI VarCyFromUI4(ULONG ulIn, CY *pCyOut)
HRESULT WINAPI VarDateFromUI2(USHORT uiIn, DATE *pdateOut)
HRESULT WINAPI VarDateFromR8(double dblIn, DATE *pdateOut)
HRESULT WINAPI VarR8FromStr(OLECHAR *strIn, LCID lcid, ULONG dwFlags, double *pDblOut)
HRESULT WINAPI VarUI2FromI2(SHORT sIn, USHORT *pusOut)
static BOOL VARIANT_DI_tostringW(const VARIANT_DI *a, WCHAR *s, unsigned int n)
HRESULT WINAPI VarI1FromDate(DATE dateIn, signed char *pcOut)
HRESULT WINAPI VarI1FromStr(OLECHAR *strIn, LCID lcid, ULONG dwFlags, signed char *pcOut)
HRESULT WINAPI VarDateFromI2(short sIn, DATE *pdateOut)
HRESULT WINAPI VarI2FromCy(CY cyIn, SHORT *psOut)
HRESULT WINAPI VarI1FromCy(CY cyIn, signed char *pcOut)
static void VARIANT_int_shiftleft(DWORD *p, unsigned int n, unsigned int shift)
HRESULT WINAPI VarUI4FromDate(DATE dateIn, ULONG *pulOut)
HRESULT WINAPI VarDateFromI4(LONG lIn, DATE *pdateOut)
HRESULT WINAPI VarUI4FromUI1(BYTE bIn, ULONG *pulOut)
HRESULT WINAPI VarBstrFromUI2(USHORT usIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut)
HRESULT WINAPI VarI8FromBool(VARIANT_BOOL boolIn, LONG64 *pi64Out)
HRESULT WINAPI VarBstrCat(BSTR pbstrLeft, BSTR pbstrRight, BSTR *pbstrOut)
HRESULT WINAPI VarDecFromI1(signed char cIn, DECIMAL *pDecOut)
HRESULT WINAPI VarI8FromUI2(USHORT usIn, LONG64 *pi64Out)
HRESULT WINAPI VarDateFromI8(LONG64 llIn, DATE *pdateOut)
HRESULT WINAPI VarUI2FromR4(FLOAT fltIn, USHORT *pusOut)
HRESULT WINAPI VarUI2FromR8(double dblIn, USHORT *pusOut)
#define SIMPLE(dest, src, func)
HRESULT WINAPI VarI4FromStr(OLECHAR *strIn, LCID lcid, ULONG dwFlags, LONG *piOut)
HRESULT WINAPI VarR8Pow(double dblLeft, double dblPow, double *pDblOut)
HRESULT WINAPI VarI2FromI4(LONG iIn, SHORT *psOut)
HRESULT WINAPI VarBoolFromI1(signed char cIn, VARIANT_BOOL *pBoolOut)
HRESULT WINAPI VarI4FromUI4(ULONG ulIn, LONG *piOut)
HRESULT WINAPI VarUI8FromI1(signed char cIn, ULONG64 *pui64Out)
HRESULT WINAPI VarBstrFromUI4(ULONG ulIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut)
HRESULT WINAPI VarR4FromR8(double dblIn, float *pFltOut)
HRESULT WINAPI VarCyFromI2(SHORT sIn, CY *pCyOut)
HRESULT WINAPI VarDecFromI8(LONG64 llIn, DECIMAL *pDecOut)
BOOL get_date_format(LCID lcid, DWORD flags, const SYSTEMTIME *st, const WCHAR *fmt, WCHAR *date, int date_len)
static BOOL VARIANT_GetLocalisedText(LANGID langId, DWORD dwId, WCHAR *lpszDest)
static unsigned char VARIANT_int_mulbychar(DWORD *p, unsigned int n, unsigned char m)
HRESULT WINAPI VarR8FromR4(FLOAT fltIn, double *pDblOut)
HRESULT WINAPI VarR4FromStr(OLECHAR *strIn, LCID lcid, ULONG dwFlags, float *pFltOut)
static HRESULT VARIANT_BstrFromUInt(ULONG64 ulVal, LCID lcid, DWORD dwFlags, BSTR *pbstrOut)
HRESULT WINAPI VarDateFromStr(OLECHAR *strIn, LCID lcid, ULONG dwFlags, DATE *pdateOut)
static int VARIANT_int_addlossy(DWORD *a, int *ascale, unsigned int an, DWORD *b, int *bscale, unsigned int bn)
HRESULT WINAPI VarCyAdd(CY cyLeft, CY cyRight, CY *pCyOut)
HRESULT WINAPI VarCyFromI1(signed char cIn, CY *pCyOut)
static void VARIANT_DecFromDI(const VARIANT_DI *from, DECIMAL *to)
HRESULT WINAPI VarI4FromR4(FLOAT fltIn, LONG *piOut)
HRESULT WINAPI VarI2FromDec(DECIMAL *pdecIn, SHORT *psOut)
HRESULT WINAPI VarBstrFromI1(signed char cIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
static const WCHAR month[12][4]
static unsigned char buff[32768]
double pow(double x, double y)
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLuint GLuint GLsizei count
GLdouble GLdouble GLdouble r
GLenum GLenum GLenum GLenum GLenum scale
GLboolean GLboolean GLboolean b
GLfloat GLfloat GLfloat GLfloat v3
GLboolean GLboolean GLboolean GLboolean a
GLfloat GLfloat GLfloat v2
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
_Check_return_ double __cdecl fmod(_In_ double x, _In_ double y)
_Check_return_ _CRTIMP double __cdecl floor(_In_ double x)
_Check_return_ _CRTIMP double __cdecl ceil(_In_ double x)
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
double __cdecl remainder(double, double)
#define memcpy(s1, s2, n)
#define memmove(s1, s2, n)
struct task_struct * current
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
#define cmp(status, error)
struct _ULARGE_INTEGER * PULARGE_INTEGER
#define MAKELCID(lgid, srtid)
_In_ DWORD _In_ DWORD dwOffset
UINT WINAPI SysStringByteLen(BSTR str)
BSTR WINAPI SysAllocString(LPCOLESTR str)
UINT WINAPI SysStringLen(BSTR str)
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
BSTR WINAPI DECLSPEC_HOTPATCH SysAllocStringByteLen(LPCSTR str, UINT len)
#define VAR_CALENDAR_GREGORIAN
#define VAR_CALENDAR_THAI
#define VAR_DATEVALUEONLY
#define VAR_CALENDAR_HIJRI
#define DISPATCH_PROPERTYGET
#define VAR_TIMEVALUEONLY
__asm__(".p2align 4, 0x90\n" ".seh_proc __seh2_global_filter_func\n" "__seh2_global_filter_func:\n" "\tsub %rbp, %rax\n" "\tpush %rbp\n" "\t.seh_pushreg %rbp\n" "\tsub $32, %rsp\n" "\t.seh_stackalloc 32\n" "\t.seh_endprologue\n" "\tsub %rax, %rdx\n" "\tmov %rdx, %rbp\n" "\tjmp *%r8\n" "__seh2_global_filter_func_exit:\n" "\t.p2align 4\n" "\tadd $32, %rsp\n" "\tpop %rbp\n" "\tret\n" "\t.seh_endproc")
static int sum(int x_, int y_)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_Check_return_ _CRTIMP size_t __cdecl wcsspn(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_Control)
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
#define LANGIDFROMLCID(l)
struct _ULARGE_INTEGER::@4136 u
INT WINAPI VariantTimeToSystemTime(double dateIn, LPSYSTEMTIME lpSt)
HRESULT WINAPI VariantChangeTypeEx(VARIANTARG *pvargDest, VARIANTARG *pvargSrc, LCID lcid, USHORT wFlags, VARTYPE vt)
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
HRESULT WINAPI VarParseNumFromStr(OLECHAR *lpszStr, LCID lcid, ULONG dwFlags, NUMPARSE *pNumprs, BYTE *rgbDig)
HRESULT WINAPI VarNumFromParseNum(NUMPARSE *pNumprs, BYTE *rgbDig, ULONG dwVtBits, VARIANT *pVarDst)
void WINAPI VariantInit(VARIANTARG *pVarg)
INT WINAPI SystemTimeToVariantTime(LPSYSTEMTIME lpSt, double *pDateOut)
#define SIGNSCALE(sign, scale)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
_In_ ULONG _In_ ULONG rgb
#define DISP_E_BADVARTYPE
#define DISP_E_TYPEMISMATCH
#define LOCALE_SABBREVMONTHNAME10
#define LOCALE_SMONTHNAME12
#define LOCALE_SMONTHNAME5
#define LOCALE_SABBREVMONTHNAME9
#define LOCALE_SABBREVMONTHNAME11
#define LOCALE_SABBREVDAYNAME5
#define LOCALE_SABBREVDAYNAME2
#define LOCALE_SABBREVMONTHNAME2
#define LOCALE_SMONTHNAME13
#define LOCALE_SMONTHNAME3
#define LOCALE_SMONTHNAME11
#define LOCALE_SMONTHNAME8
#define LOCALE_SMONTHNAME4
#define LOCALE_SABBREVMONTHNAME13
#define LOCALE_SMONTHNAME7
#define LOCALE_SSHORTDATE
#define LOCALE_SABBREVMONTHNAME4
#define LOCALE_SABBREVDAYNAME4
#define LOCALE_SMONTHNAME1
#define LOCALE_SABBREVMONTHNAME3
#define LOCALE_SABBREVMONTHNAME1
#define LOCALE_NOUSEROVERRIDE
#define LOCALE_SABBREVDAYNAME6
#define LOCALE_SMONTHNAME2
#define LOCALE_SABBREVDAYNAME1
#define LOCALE_SABBREVMONTHNAME6
#define LOCALE_SMONTHNAME6
#define LOCALE_SABBREVDAYNAME3
#define LOCALE_SABBREVMONTHNAME5
#define LOCALE_SABBREVMONTHNAME7
#define LOCALE_SABBREVMONTHNAME8
#define LOCALE_SMONTHNAME10
#define LOCALE_SMONTHNAME9
#define LOCALE_SABBREVMONTHNAME12
#define LOCALE_SABBREVDAYNAME7
#define MAKEINTRESOURCEW(i)