Changeset 57979 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- Oct 1, 2015 8:25:21 AM (9 years ago)
- Location:
- trunk/src/VBox/Main/src-server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r57832 r57979 353 353 for (ULONG slot = 0; slot < RT_ELEMENTS(mSerialPorts); ++slot) 354 354 mSerialPorts[slot]->i_applyDefaults(aOsType); 355 356 /* Apply parallel port defaults */ 357 for (ULONG slot = 0; slot < RT_ELEMENTS(mParallelPorts); ++slot) 358 mParallelPorts[slot]->i_applyDefaults(); 355 359 356 360 /* Let the OS type select 64-bit ness. */ -
trunk/src/VBox/Main/src-server/ParallelPortImpl.cpp
r54971 r57979 215 215 if (m->bd->fEnabled != !!aEnabled) 216 216 { 217 if (aEnabled &&218 m->bd->strPath.isEmpty())219 return setError(E_INVALIDARG,220 tr("Cannot enable the parallel port %d because the port path is empty or null"),221 m->bd->ulSlot);222 223 217 m->bd.backup(); 224 218 m->bd->fEnabled = !!aEnabled; … … 352 346 if (aPath != m->bd->strPath) 353 347 { 354 HRESULT rc = i_checkSetPath(aPath);355 if (FAILED(rc)) return rc;356 357 348 m->bd.backup(); 358 349 m->bd->strPath = aPath; … … 498 489 499 490 /** 500 * Validates COMSETTER(Path) arguments. 501 */ 502 HRESULT ParallelPort::i_checkSetPath(const Utf8Str &str) 503 { 504 AssertReturn(isWriteLockOnCurrentThread(), E_FAIL); 505 506 if ( m->bd->fEnabled 507 && str.isEmpty() 508 ) 509 return setError(E_INVALIDARG, 510 tr("Path of the parallel port %d may not be empty or null " 511 "when the port is enabled"), 512 m->bd->ulSlot); 513 514 return S_OK; 515 } 516 491 * Applies the defaults for the given parallel port. 492 */ 493 void ParallelPort::i_applyDefaults() 494 { 495 /* sanity */ 496 AutoCaller autoCaller(this); 497 AssertComRCReturnVoid (autoCaller.rc()); 498 499 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 500 501 /* Set some more defaults based on the slot. */ 502 switch (m->bd->ulSlot) 503 { 504 case 0: 505 { 506 m->bd->ulIOBase = 0x378; 507 m->bd->ulIRQ = 7; 508 break; 509 } 510 case 1: 511 { 512 m->bd->ulIOBase = 0x278; 513 m->bd->ulIRQ = 5; 514 break; 515 } 516 default: break; 517 } 518 } 517 519 518 520 /* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note:
See TracChangeset
for help on using the changeset viewer.