Changeset 6944 for trunk/src/oleaut32/variant.c
- Timestamp:
- Oct 3, 2001, 9:22:00 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/oleaut32/variant.c
r6711 r6944 48 48 DEFAULT_DEBUG_CHANNEL(ole); 49 49 50 #define SYSDUPSTRING(str) SysAllocStringLen((str), SysStringLen(str)) 51 50 52 #ifndef FLT_MAX 51 53 # ifdef MAXFLOAT … … 90 92 * 400 then it is a leap year. 91 93 */ 92 /* According to postg eSQL date parsing functions there is94 /* According to postgreSQL date parsing functions there is 93 95 * a leap year when this expression is true. 94 96 * (((y % 4) == 0) && (((y % 100) != 0) || ((y % 400) == 0))) … … 104 106 */ 105 107 static const double DAYS_IN_ONE_YEAR = 365.2425; 108 106 109 107 110 /****************************************************************************** … … 235 238 static BOOL TmToDATE( struct tm* pTm, DATE *pDateOut ) 236 239 { 237 if( (pTm->tm_year - 1900) >= 0 ) 238 { 239 int leapYear = 0; 240 241 /* Start at 1. This is the way DATE is defined. 242 * January 1, 1900 at Midnight is 1.00. 243 * January 1, 1900 at 6AM is 1.25. 244 * and so on. 245 */ 246 *pDateOut = 1; 247 248 /* Add the number of days corresponding to 249 * tm_year. 250 */ 251 *pDateOut += (pTm->tm_year - 1900) * 365; 252 253 /* Add the leap days in the previous years between now and 1900. 254 * Note a leap year is one that is a multiple of 4 255 * but not of a 100. Except if it is a multiple of 256 * 400 then it is a leap year. 257 */ 258 *pDateOut += ( (pTm->tm_year - 1) / 4 ) - ( 1900 / 4 ); 259 *pDateOut -= ( (pTm->tm_year - 1) / 100 ) - ( 1900 / 100 ); 260 *pDateOut += ( (pTm->tm_year - 1) / 400 ) - ( 1900 / 400 ); 261 262 /* Set the leap year flag if the 263 * current year specified by tm_year is a 264 * leap year. This will be used to add a day 265 * to the day count. 266 */ 267 if( isleap( pTm->tm_year ) ) 268 leapYear = 1; 269 270 /* Add the number of days corresponding to 271 * the month. 272 */ 273 switch( pTm->tm_mon ) 274 { 275 case 2: 276 *pDateOut += 31; 277 break; 278 case 3: 279 *pDateOut += ( 59 + leapYear ); 280 break; 281 case 4: 282 *pDateOut += ( 90 + leapYear ); 283 break; 284 case 5: 285 *pDateOut += ( 120 + leapYear ); 286 break; 287 case 6: 288 *pDateOut += ( 151 + leapYear ); 289 break; 290 case 7: 291 *pDateOut += ( 181 + leapYear ); 292 break; 293 case 8: 294 *pDateOut += ( 212 + leapYear ); 295 break; 296 case 9: 297 *pDateOut += ( 243 + leapYear ); 298 break; 299 case 10: 300 *pDateOut += ( 273 + leapYear ); 301 break; 302 case 11: 303 *pDateOut += ( 304 + leapYear ); 304 break; 305 case 12: 306 *pDateOut += ( 334 + leapYear ); 307 break; 308 } 309 /* Add the number of days in this month. 310 */ 311 *pDateOut += pTm->tm_mday; 312 313 /* Add the number of seconds, minutes, and hours 314 * to the DATE. Note these are the fracionnal part 315 * of the DATE so seconds / number of seconds in a day. 316 */ 317 *pDateOut += pTm->tm_hour / 24.0; 318 *pDateOut += pTm->tm_min / 1440.0; 319 *pDateOut += pTm->tm_sec / 86400.0; 320 return TRUE; 321 } 322 return FALSE; 240 int leapYear = 0; 241 242 if( (pTm->tm_year - 1900) < 0 ) return FALSE; 243 244 /* Start at 1. This is the way DATE is defined. 245 * January 1, 1900 at Midnight is 1.00. 246 * January 1, 1900 at 6AM is 1.25. 247 * and so on. 248 */ 249 *pDateOut = 1; 250 251 /* Add the number of days corresponding to 252 * tm_year. 253 */ 254 *pDateOut += (pTm->tm_year - 1900) * 365; 255 256 /* Add the leap days in the previous years between now and 1900. 257 * Note a leap year is one that is a multiple of 4 258 * but not of a 100. Except if it is a multiple of 259 * 400 then it is a leap year. 260 */ 261 *pDateOut += ( (pTm->tm_year - 1) / 4 ) - ( 1900 / 4 ); 262 *pDateOut -= ( (pTm->tm_year - 1) / 100 ) - ( 1900 / 100 ); 263 *pDateOut += ( (pTm->tm_year - 1) / 400 ) - ( 1900 / 400 ); 264 265 /* Set the leap year flag if the 266 * current year specified by tm_year is a 267 * leap year. This will be used to add a day 268 * to the day count. 269 */ 270 if( isleap( pTm->tm_year ) ) 271 leapYear = 1; 272 273 /* Add the number of days corresponding to 274 * the month. 275 */ 276 switch( pTm->tm_mon ) 277 { 278 case 2: 279 *pDateOut += 31; 280 break; 281 case 3: 282 *pDateOut += ( 59 + leapYear ); 283 break; 284 case 4: 285 *pDateOut += ( 90 + leapYear ); 286 break; 287 case 5: 288 *pDateOut += ( 120 + leapYear ); 289 break; 290 case 6: 291 *pDateOut += ( 151 + leapYear ); 292 break; 293 case 7: 294 *pDateOut += ( 181 + leapYear ); 295 break; 296 case 8: 297 *pDateOut += ( 212 + leapYear ); 298 break; 299 case 9: 300 *pDateOut += ( 243 + leapYear ); 301 break; 302 case 10: 303 *pDateOut += ( 273 + leapYear ); 304 break; 305 case 11: 306 *pDateOut += ( 304 + leapYear ); 307 break; 308 case 12: 309 *pDateOut += ( 334 + leapYear ); 310 break; 311 } 312 /* Add the number of days in this month. 313 */ 314 *pDateOut += pTm->tm_mday; 315 316 /* Add the number of seconds, minutes, and hours 317 * to the DATE. Note these are the fracionnal part 318 * of the DATE so seconds / number of seconds in a day. 319 */ 320 *pDateOut += pTm->tm_hour / 24.0; 321 *pDateOut += pTm->tm_min / 1440.0; 322 *pDateOut += pTm->tm_sec / 86400.0; 323 return TRUE; 323 324 } 324 325 … … 339 340 static BOOL DateToTm( DATE dateIn, DWORD dwFlags, struct tm* pTm ) 340 341 { 341 /* Do not process dates smaller than January 1, 1900. 342 * Which corresponds to 2.0 in the windows DATE format. 343 */ 344 if( dateIn >= 2.0 ) 345 { 346 double decimalPart = 0.0; 347 double wholePart = 0.0; 348 349 memset(pTm,0,sizeof(*pTm)); 350 351 /* Because of the nature of DATE format which 352 * associates 2.0 to January 1, 1900. We will 353 * remove 1.0 from the whole part of the DATE 354 * so that in the following code 1.0 355 * will correspond to January 1, 1900. 356 * This simplifies the processing of the DATE value. 357 */ 358 dateIn -= 1.0; 359 360 wholePart = (double) floor( dateIn ); 361 decimalPart = fmod( dateIn, wholePart ); 362 363 if( !(dwFlags & VAR_TIMEVALUEONLY) ) 364 { 365 int nDay = 0; 366 int leapYear = 0; 367 double yearsSince1900 = 0; 368 /* Start at 1900, this is where the DATE time 0.0 starts. 369 */ 370 pTm->tm_year = 1900; 371 /* find in what year the day in the "wholePart" falls into. 372 * add the value to the year field. 373 */ 374 yearsSince1900 = floor( (wholePart / DAYS_IN_ONE_YEAR) + 0.001 ); 375 pTm->tm_year += yearsSince1900; 376 /* determine if this is a leap year. 377 */ 378 if( isleap( pTm->tm_year ) ) 379 { 380 leapYear = 1; 381 wholePart++; 382 } 383 384 /* find what day of that year the "wholePart" corresponds to. 385 * Note: nDay is in [1-366] format 386 */ 387 nDay = (int) ( wholePart - floor( yearsSince1900 * DAYS_IN_ONE_YEAR ) ); 388 /* Set the tm_yday value. 389 * Note: The day must be converted from [1-366] to [0-365] 390 */ 391 /*pTm->tm_yday = nDay - 1;*/ 392 /* find which month this day corresponds to. 393 */ 394 if( nDay <= 31 ) 395 { 396 pTm->tm_mday = nDay; 397 pTm->tm_mon = 0; 398 } 399 else if( nDay <= ( 59 + leapYear ) ) 400 { 401 pTm->tm_mday = nDay - 31; 402 pTm->tm_mon = 1; 403 } 404 else if( nDay <= ( 90 + leapYear ) ) 405 { 406 pTm->tm_mday = nDay - ( 59 + leapYear ); 407 pTm->tm_mon = 2; 408 } 409 else if( nDay <= ( 120 + leapYear ) ) 410 { 411 pTm->tm_mday = nDay - ( 90 + leapYear ); 412 pTm->tm_mon = 3; 413 } 414 else if( nDay <= ( 151 + leapYear ) ) 415 { 416 pTm->tm_mday = nDay - ( 120 + leapYear ); 417 pTm->tm_mon = 4; 418 } 419 else if( nDay <= ( 181 + leapYear ) ) 420 { 421 pTm->tm_mday = nDay - ( 151 + leapYear ); 422 pTm->tm_mon = 5; 423 } 424 else if( nDay <= ( 212 + leapYear ) ) 425 { 426 pTm->tm_mday = nDay - ( 181 + leapYear ); 427 pTm->tm_mon = 6; 428 } 429 else if( nDay <= ( 243 + leapYear ) ) 430 { 431 pTm->tm_mday = nDay - ( 212 + leapYear ); 432 pTm->tm_mon = 7; 433 } 434 else if( nDay <= ( 273 + leapYear ) ) 435 { 436 pTm->tm_mday = nDay - ( 243 + leapYear ); 437 pTm->tm_mon = 8; 438 } 439 else if( nDay <= ( 304 + leapYear ) ) 440 { 441 pTm->tm_mday = nDay - ( 273 + leapYear ); 442 pTm->tm_mon = 9; 443 } 444 else if( nDay <= ( 334 + leapYear ) ) 445 { 446 pTm->tm_mday = nDay - ( 304 + leapYear ); 447 pTm->tm_mon = 10; 448 } 449 else if( nDay <= ( 365 + leapYear ) ) 450 { 451 pTm->tm_mday = nDay - ( 334 + leapYear ); 452 pTm->tm_mon = 11; 453 } 454 } 455 if( !(dwFlags & VAR_DATEVALUEONLY) ) 456 { 457 /* find the number of seconds in this day. 458 * fractional part times, hours, minutes, seconds. 459 */ 460 pTm->tm_hour = (int) ( decimalPart * 24 ); 461 pTm->tm_min = (int) ( ( ( decimalPart * 24 ) - pTm->tm_hour ) * 60 ); 462 pTm->tm_sec = (int) ( ( ( decimalPart * 24 * 60 ) - ( pTm->tm_hour * 60 ) - pTm->tm_min ) * 60 ); 463 } 464 return TRUE; 465 } 466 return FALSE; 342 double decimalPart = 0.0; 343 double wholePart = 0.0; 344 345 /* Do not process dates smaller than January 1, 1900. 346 * Which corresponds to 2.0 in the windows DATE format. 347 */ 348 if( dateIn < 2.0 ) return FALSE; 349 350 memset(pTm,0,sizeof(*pTm)); 351 352 /* Because of the nature of DATE format which 353 * associates 2.0 to January 1, 1900. We will 354 * remove 1.0 from the whole part of the DATE 355 * so that in the following code 1.0 356 * will correspond to January 1, 1900. 357 * This simplifies the processing of the DATE value. 358 */ 359 dateIn -= 1.0; 360 361 wholePart = (double) floor( dateIn ); 362 decimalPart = fmod( dateIn, wholePart ); 363 364 if( !(dwFlags & VAR_TIMEVALUEONLY) ) 365 { 366 int nDay = 0; 367 int leapYear = 0; 368 double yearsSince1900 = 0; 369 /* Start at 1900, this is where the DATE time 0.0 starts. 370 */ 371 pTm->tm_year = 1900; 372 /* find in what year the day in the "wholePart" falls into. 373 * add the value to the year field. 374 */ 375 yearsSince1900 = floor( (wholePart / DAYS_IN_ONE_YEAR) + 0.001 ); 376 pTm->tm_year += yearsSince1900; 377 /* determine if this is a leap year. 378 */ 379 if( isleap( pTm->tm_year ) ) 380 { 381 leapYear = 1; 382 wholePart++; 383 } 384 385 /* find what day of that year the "wholePart" corresponds to. 386 * Note: nDay is in [1-366] format 387 */ 388 nDay = (int) ( wholePart - floor( yearsSince1900 * DAYS_IN_ONE_YEAR ) ); 389 /* Set the tm_yday value. 390 * Note: The day must be converted from [1-366] to [0-365] 391 */ 392 /*pTm->tm_yday = nDay - 1;*/ 393 /* find which month this day corresponds to. 394 */ 395 if( nDay <= 31 ) 396 { 397 pTm->tm_mday = nDay; 398 pTm->tm_mon = 0; 399 } 400 else if( nDay <= ( 59 + leapYear ) ) 401 { 402 pTm->tm_mday = nDay - 31; 403 pTm->tm_mon = 1; 404 } 405 else if( nDay <= ( 90 + leapYear ) ) 406 { 407 pTm->tm_mday = nDay - ( 59 + leapYear ); 408 pTm->tm_mon = 2; 409 } 410 else if( nDay <= ( 120 + leapYear ) ) 411 { 412 pTm->tm_mday = nDay - ( 90 + leapYear ); 413 pTm->tm_mon = 3; 414 } 415 else if( nDay <= ( 151 + leapYear ) ) 416 { 417 pTm->tm_mday = nDay - ( 120 + leapYear ); 418 pTm->tm_mon = 4; 419 } 420 else if( nDay <= ( 181 + leapYear ) ) 421 { 422 pTm->tm_mday = nDay - ( 151 + leapYear ); 423 pTm->tm_mon = 5; 424 } 425 else if( nDay <= ( 212 + leapYear ) ) 426 { 427 pTm->tm_mday = nDay - ( 181 + leapYear ); 428 pTm->tm_mon = 6; 429 } 430 else if( nDay <= ( 243 + leapYear ) ) 431 { 432 pTm->tm_mday = nDay - ( 212 + leapYear ); 433 pTm->tm_mon = 7; 434 } 435 else if( nDay <= ( 273 + leapYear ) ) 436 { 437 pTm->tm_mday = nDay - ( 243 + leapYear ); 438 pTm->tm_mon = 8; 439 } 440 else if( nDay <= ( 304 + leapYear ) ) 441 { 442 pTm->tm_mday = nDay - ( 273 + leapYear ); 443 pTm->tm_mon = 9; 444 } 445 else if( nDay <= ( 334 + leapYear ) ) 446 { 447 pTm->tm_mday = nDay - ( 304 + leapYear ); 448 pTm->tm_mon = 10; 449 } 450 else if( nDay <= ( 365 + leapYear ) ) 451 { 452 pTm->tm_mday = nDay - ( 334 + leapYear ); 453 pTm->tm_mon = 11; 454 } 455 } 456 if( !(dwFlags & VAR_DATEVALUEONLY) ) 457 { 458 /* find the number of seconds in this day. 459 * fractional part times, hours, minutes, seconds. 460 */ 461 pTm->tm_hour = (int) ( decimalPart * 24 ); 462 pTm->tm_min = (int) ( ( ( decimalPart * 24 ) - pTm->tm_hour ) * 60 ); 463 pTm->tm_sec = (int) ( ( ( decimalPart * 24 * 60 ) - ( pTm->tm_hour * 60 ) - pTm->tm_min ) * 60 ); 464 } 465 return TRUE; 467 466 } 468 467 … … 615 614 LPSTR pNewString = NULL; 616 615 LPSTR strToken = NULL; 617 618 616 619 617 /* Check if we have a valid argument … … 1680 1678 * VariantInit [OLEAUT32.8] 1681 1679 * 1682 * Initializes the Variant. Unlike VariantClear it does not interpret the current1683 * contents of the Variant.1680 * Initializes the Variant. Unlike VariantClear it does not interpret 1681 * the current contents of the Variant. 1684 1682 */ 1685 1683 void WINAPI VariantInit(VARIANTARG* pvarg) 1686 1684 { 1687 TRACE("(%p) ,stub\n",pvarg);1685 TRACE("(%p)\n",pvarg); 1688 1686 1689 1687 memset(pvarg, 0, sizeof (VARIANTARG)); … … 1764 1762 HRESULT res = S_OK; 1765 1763 1766 TRACE("(%p, %p) \n", pvargDest, pvargSrc);1764 TRACE("(%p, %p), vt=%d\n", pvargDest, pvargSrc, V_VT(pvargSrc)); 1767 1765 1768 1766 res = ValidateVariantType( V_VT(pvargSrc) ); … … 1797 1795 { 1798 1796 /* In the case of by value we need to 1799 * copy the actual lvalue. In the case of1797 * copy the actual value. In the case of 1800 1798 * VT_BSTR a copy of the string is made, 1801 * if VT_DISPATCH or VT_IUNKNOWN AddRef fis1799 * if VT_DISPATCH or VT_IUNKNOWN AddRef is 1802 1800 * called to increment the object's reference count. 1803 1801 */ … … 1805 1803 { 1806 1804 case( VT_BSTR ): 1807 V_UNION(pvargDest,bstrVal) = S ysAllocString( V_UNION(pvargSrc,bstrVal) );1805 V_UNION(pvargDest,bstrVal) = SYSDUPSTRING( V_UNION(pvargSrc,bstrVal) ); 1808 1806 break; 1809 1807 case( VT_DISPATCH ): … … 1894 1892 { 1895 1893 case( VT_BSTR ): 1896 V_UNION(pvargDest,bstrVal) = S ysAllocString( *(V_UNION(pvargSrc,pbstrVal)) );1894 V_UNION(pvargDest,bstrVal) = SYSDUPSTRING( *(V_UNION(pvargSrc,pbstrVal)) ); 1897 1895 break; 1898 1896 case( VT_DISPATCH ): … … 1986 1984 VariantInit( &varg ); 1987 1985 1988 TRACE("(%p, %p, %ld, %u, %u) ,stub\n", pvargDest, pvargSrc, lcid, wFlags, vt);1986 TRACE("(%p, %p, %ld, %u, %u) vt=%d\n", pvargDest, pvargSrc, lcid, wFlags, vt, V_VT(pvargSrc)); 1989 1987 1990 1988 /* validate our source argument. … … 3251 3249 */ 3252 3250 HRESULT WINAPI VarBstrFromCy(CY cyIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut) { 3253 /* FIXME */3251 FIXME("([cyIn], %08lx, %08lx, %p), stub.\n", lcid, dwFlags, pbstrOut); 3254 3252 return E_NOTIMPL; 3255 3253 } … … 3316 3314 TRACE("( %d, %ld, %ld, %p ), stub\n", boolIn, lcid, dwFlags, pbstrOut ); 3317 3315 3318 if( boolIn == VARIANT_FALSE ) 3319 { 3320 sprintf( pBuffer, "False" ); 3321 } 3322 else 3323 { 3324 sprintf( pBuffer, "True" ); 3325 } 3316 sprintf( pBuffer, (boolIn == VARIANT_FALSE) ? "False" : "True" ); 3326 3317 3327 3318 *pbstrOut = StringDupAtoBstr( pBuffer ); … … 3392 3383 TRACE("( %d, %p ), stub\n", sIn, pboolOut ); 3393 3384 3394 if( sIn == 0 ) 3395 { 3396 *pboolOut = VARIANT_FALSE; 3397 } 3398 else 3399 { 3400 *pboolOut = VARIANT_TRUE; 3401 } 3385 *pboolOut = (sIn) ? VARIANT_TRUE : VARIANT_FALSE; 3402 3386 3403 3387 return S_OK; … … 3411 3395 TRACE("( %ld, %p ), stub\n", lIn, pboolOut ); 3412 3396 3413 if( lIn == 0 ) 3414 { 3415 *pboolOut = VARIANT_FALSE; 3416 } 3417 else 3418 { 3419 *pboolOut = VARIANT_TRUE; 3420 } 3397 *pboolOut = (lIn) ? VARIANT_TRUE : VARIANT_FALSE; 3421 3398 3422 3399 return S_OK; … … 3430 3407 TRACE("( %f, %p ), stub\n", fltIn, pboolOut ); 3431 3408 3432 if( fltIn == 0.0 ) 3433 { 3434 *pboolOut = VARIANT_FALSE; 3435 } 3436 else 3437 { 3438 *pboolOut = VARIANT_TRUE; 3439 } 3409 *pboolOut = (fltIn == 0.0) ? VARIANT_FALSE : VARIANT_TRUE; 3440 3410 3441 3411 return S_OK; … … 3449 3419 TRACE("( %f, %p ), stub\n", dblIn, pboolOut ); 3450 3420 3451 if( dblIn == 0.0 ) 3452 { 3453 *pboolOut = VARIANT_FALSE; 3454 } 3455 else 3456 { 3457 *pboolOut = VARIANT_TRUE; 3458 } 3421 *pboolOut = (dblIn == 0.0) ? VARIANT_FALSE : VARIANT_TRUE; 3459 3422 3460 3423 return S_OK; … … 3468 3431 TRACE("( %f, %p ), stub\n", dateIn, pboolOut ); 3469 3432 3470 if( dateIn == 0.0 ) 3471 { 3472 *pboolOut = VARIANT_FALSE; 3473 } 3474 else 3475 { 3476 *pboolOut = VARIANT_TRUE; 3477 } 3433 *pboolOut = (dateIn == 0.0) ? VARIANT_FALSE : VARIANT_TRUE; 3478 3434 3479 3435 return S_OK; … … 3517 3473 ret = DISP_E_TYPEMISMATCH; 3518 3474 } 3519 else if( dValue == 0.0 )3520 {3521 *pboolOut = VARIANT_FALSE;3522 }3523 3475 else 3524 { 3525 *pboolOut = VARIANT_TRUE; 3526 } 3476 *pboolOut = (dValue == 0.0) ? 3477 VARIANT_FALSE : VARIANT_TRUE; 3527 3478 } 3528 3479 } … … 3540 3491 TRACE("( %c, %p ), stub\n", cIn, pboolOut ); 3541 3492 3542 if( cIn == 0 ) 3543 { 3544 *pboolOut = VARIANT_FALSE; 3545 } 3546 else 3547 { 3548 *pboolOut = VARIANT_TRUE; 3549 } 3493 *pboolOut = (cIn == 0) ? VARIANT_FALSE : VARIANT_TRUE; 3550 3494 3551 3495 return S_OK; … … 3559 3503 TRACE("( %d, %p ), stub\n", uiIn, pboolOut ); 3560 3504 3561 if( uiIn == 0 ) 3562 { 3563 *pboolOut = VARIANT_FALSE; 3564 } 3565 else 3566 { 3567 *pboolOut = VARIANT_TRUE; 3568 } 3505 *pboolOut = (uiIn == 0) ? VARIANT_FALSE : VARIANT_TRUE; 3569 3506 3570 3507 return S_OK; … … 3578 3515 TRACE("( %ld, %p ), stub\n", ulIn, pboolOut ); 3579 3516 3580 if( ulIn == 0 ) 3581 { 3582 *pboolOut = VARIANT_FALSE; 3583 } 3584 else 3585 { 3586 *pboolOut = VARIANT_TRUE; 3587 } 3517 *pboolOut = (ulIn == 0) ? VARIANT_FALSE : VARIANT_TRUE; 3588 3518 3589 3519 return S_OK; … … 4111 4041 TRACE("( %f, %p ), stub\n", dblIn, pulOut ); 4112 4042 4113 4043 dblIn = round( dblIn ); 4114 4044 if( dblIn < UI4_MIN || dblIn > UI4_MAX ) 4115 4045 { 4116 4046 return DISP_E_OVERFLOW; 4117 4047 } 4118 4048 4119 4049 *pulOut = (ULONG) dblIn; … … 4129 4059 TRACE("( %f, %p ), stub\n", dateIn, pulOut ); 4130 4060 4131 4132 4061 dateIn = round( dateIn ); 4062 if( dateIn < UI4_MIN || dateIn > UI4_MAX ) 4133 4063 { 4134 4064 return DISP_E_OVERFLOW; … … 4195 4125 */ 4196 4126 HRESULT WINAPI VarCyFromUI1(BYTE bIn, CY* pcyOut) { 4197 pcyOut->s.Hi = 0;4198 pcyOut->s.Lo = ((ULONG)bIn) * 10000;4199 4200 return S_OK;4127 pcyOut->s.Hi = 0; 4128 pcyOut->s.Lo = ((ULONG)bIn) * 10000; 4129 4130 return S_OK; 4201 4131 } 4202 4132 … … 4206 4136 */ 4207 4137 HRESULT WINAPI VarCyFromI2(short sIn, CY* pcyOut) { 4208 if (sIn < 0) pcyOut->s.Hi = -1;4209 else pcyOut->s.Hi = 0;4210 pcyOut->s.Lo = ((ULONG)sIn) * 10000;4211 4212 return S_OK;4138 if (sIn < 0) pcyOut->s.Hi = -1; 4139 else pcyOut->s.Hi = 0; 4140 pcyOut->s.Lo = ((ULONG)sIn) * 10000; 4141 4142 return S_OK; 4213 4143 } 4214 4144 … … 4269 4199 */ 4270 4200 HRESULT WINAPI VarCyFromStr(OLECHAR *strIn, LCID lcid, ULONG dwFlags, CY *pcyOut) { 4271 /* FIXME */4272 4201 FIXME("(%p, %08lx, %08lx, %p), stub.\n", strIn, lcid, dwFlags, pcyOut); 4202 return E_NOTIMPL; 4273 4203 } 4274 4204 … … 4414 4344 4415 4345 /********************************************************************** 4416 * VariantTimeToDosDateTime [OLEAUT32. ??]4346 * VariantTimeToDosDateTime [OLEAUT32.13] 4417 4347 * Convert variant representation of time to the date and time representation 4418 4348 * stored in dos. … … 4440 4370 4441 4371 4372 /*********************************************************************** 4373 * SystemTimeToVariantTime [OLEAUT32.184] 4374 */ 4442 4375 HRESULT WINAPI SystemTimeToVariantTime( LPSYSTEMTIME lpSystemTime, double *pvtime ) 4443 4376 { … … 4488 4421 } 4489 4422 4423 /*********************************************************************** 4424 * VariantTimeToSystemTime [OLEAUT32.185] 4425 */ 4490 4426 HRESULT WINAPI VariantTimeToSystemTime( double vtime, LPSYSTEMTIME lpSystemTime ) 4491 4427 { … … 4603 4539 } 4604 4540 4541 /*********************************************************************** 4542 * VarUdateFromDate [OLEAUT32.331] 4543 */ 4605 4544 HRESULT WINAPI VarUdateFromDate( DATE datein, ULONG dwFlags, UDATE *pudateout) 4606 4545 { … … 4635 4574 } 4636 4575 4576 /*********************************************************************** 4577 * VarDateFromUdate [OLEAUT32.330] 4578 */ 4637 4579 HRESULT WINAPI VarDateFromUdate(UDATE *pudateout, 4638 4580 ULONG dwFlags, DATE *datein)
Note:
See TracChangeset
for help on using the changeset viewer.