Changeset 53463 in vbox for trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibVideo.cpp
- Timestamp:
- Dec 5, 2014 2:43:21 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibVideo.cpp
r53454 r53463 383 383 { 384 384 rc = VbglR3GuestPropWriteValue(u32ClientId, szModeName, szModeParms); 385 if (cScreen == 0) /* Write out the mode using the legacy name too, in 386 * case the user installs older Additions. */ 385 /* Write out the mode using the legacy name too, in case the user 386 * re-installs older Additions. */ 387 if (cScreen == 0) 388 { 389 RTStrPrintf(szModeParms, sizeof(szModeParms), "%ux%ux%u", cx, cy, 390 cBits); 387 391 VbglR3GuestPropWriteValue(u32ClientId, VIDEO_PROP_PREFIX"SavedMode", 388 392 szModeParms); 393 } 389 394 } 390 395 if (u32ClientId != 0) … … 447 452 uint32_t u32ClientId = 0; 448 453 int cMatches; 449 unsigned cx, cy, cBits, x, y, fEnabled; 450 int rc, rc2 = VERR_UNRESOLVED_ERROR; 454 unsigned cx, cy, cBits; 455 unsigned x = 0; 456 unsigned y = 0; 457 unsigned fEnabled = 1; 458 int rc; 459 int rc2 = VERR_UNRESOLVED_ERROR; 451 460 452 461 /** @todo add a VbglR3GuestPropReadValueF/FV that does the RTStrPrintf for you. */ … … 457 466 rc = VbglR3GuestPropReadValue(u32ClientId, szModeName, szModeParms, 458 467 sizeof(szModeParms), NULL); 459 if (rc == VERR_NOT_FOUND) /* Try legacy single screen name. */ 468 /* Try legacy single screen name. */ 469 if (rc == VERR_NOT_FOUND && cScreen == 0) 460 470 rc = VbglR3GuestPropReadValue(u32ClientId, 461 471 VIDEO_PROP_PREFIX"SavedMode", … … 473 483 if (RT_SUCCESS(rc)) 474 484 { 475 cMatches = sscanf(szModeParms, "%ux%ux%u,%ux%u,%u\n", &cx, &cy, &cBits, 476 &x, &y, &fEnabled); 477 if (cMatches == 6) 485 char c1, c2; 486 cMatches = sscanf(szModeParms, "%ux%ux%u%c%ux%u,%u%c", &cx, &cy, &cBits, 487 &c1, &x, &y, &fEnabled, &c2); 488 if ((cMatches == 7 && c1 == ',') || cMatches == 3) 478 489 rc = VINF_SUCCESS; 479 490 else if (cMatches < 0)
Note:
See TracChangeset
for help on using the changeset viewer.