- Timestamp:
- Jun 29, 2021 1:22:29 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 145409
- Location:
- trunk/src/VBox/Main/src-client
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r87391 r89951 10730 10730 } 10731 10731 10732 if (UuidCopy == COM_IIDOF(IKeyboard)) 10733 { 10734 IKeyboard *pIKeyboard = pConsole->mKeyboard; 10735 return pIKeyboard; 10736 } 10737 10738 if (UuidCopy == COM_IIDOF(IMouse)) 10739 { 10740 IMouse *pIMouse = pConsole->mMouse; 10741 return pIMouse; 10742 } 10743 10732 10744 if (UuidCopy == COM_IIDOF(ISnapshot)) 10733 10745 return ((MYVMM2USERMETHODS *)pThis)->pISnapshot; -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r89921 r89951 1702 1702 InsertConfigNode(pLunL0, "AttachedDriver", &pLunL1); 1703 1703 InsertConfigString(pLunL1, "Driver", "MainKeyboard"); 1704 InsertConfigNode(pLunL1, "Config", &pCfg);1705 Keyboard *pKeyboard = mKeyboard;1706 InsertConfigInteger(pCfg, "Object", (uintptr_t)pKeyboard);1707 1704 } 1708 1705 … … 1718 1715 InsertConfigNode(pLunL0, "AttachedDriver", &pLunL1); 1719 1716 InsertConfigString(pLunL1, "Driver", "MainMouse"); 1720 InsertConfigNode(pLunL1, "Config", &pCfg);1721 Mouse *pMouse = mMouse;1722 InsertConfigInteger(pCfg, "Object", (uintptr_t)pMouse);1723 1717 } 1724 1718 … … 2235 2229 InsertConfigNode(pLunL0, "AttachedDriver", &pLunL1); 2236 2230 InsertConfigString(pLunL1, "Driver", "MainMouse"); 2237 InsertConfigNode(pLunL1, "Config", &pCfg);2238 Mouse *pMouse = mMouse;2239 InsertConfigInteger(pCfg, "Object", (uintptr_t)pMouse);2240 2231 } 2241 2232 if (aPointingHID == PointingHIDType_USBMultiTouch) … … 2252 2243 InsertConfigNode(pLunL0, "AttachedDriver", &pLunL1); 2253 2244 InsertConfigString(pLunL1, "Driver", "MainMouse"); 2254 InsertConfigNode(pLunL1, "Config", &pCfg);2255 Mouse *pMouse = mMouse;2256 InsertConfigInteger(pCfg, "Object", (uintptr_t)pMouse);2257 2245 } 2258 2246 … … 2271 2259 InsertConfigNode(pLunL0, "AttachedDriver", &pLunL1); 2272 2260 InsertConfigString(pLunL1, "Driver", "MainKeyboard"); 2273 InsertConfigNode(pLunL1, "Config", &pCfg);2274 Keyboard *pKeyboard = mKeyboard;2275 InsertConfigInteger(pCfg, "Object", (uintptr_t)pKeyboard);2276 2261 } 2277 2262 } -
trunk/src/VBox/Main/src-client/KeyboardImpl.cpp
r89935 r89951 437 437 * Validate configuration. 438 438 */ 439 if (!CFGMR3AreValuesValid(pCfg, " Object\0"))439 if (!CFGMR3AreValuesValid(pCfg, "")) 440 440 return VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES; 441 441 AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER, … … 464 464 * Get the Keyboard object pointer and update the mpDrv member. 465 465 */ 466 void *pv; 467 int rc = CFGMR3QueryPtr(pCfg, "Object", &pv); 468 if (RT_FAILURE(rc)) 469 { 470 AssertMsgFailed(("Configuration error: No/bad \"Object\" value! rc=%Rrc\n", rc)); 471 return rc; 472 } 473 pThis->pKeyboard = (Keyboard *)pv; /** @todo Check this cast! */ 466 com::Guid uuid(COM_IIDOF(IKeyboard)); 467 IKeyboard *pIKeyboard = (IKeyboard *)PDMDrvHlpQueryGenericUserObject(pDrvIns, uuid.raw()); 468 if (!pIKeyboard) 469 { 470 AssertMsgFailed(("Configuration error: No/bad Keyboard object!\n")); 471 return VERR_NOT_FOUND; 472 } 473 pThis->pKeyboard = static_cast<Keyboard *>(pIKeyboard); 474 474 475 unsigned cDev; 475 476 for (cDev = 0; cDev < KEYBOARD_MAX_DEVICES; ++cDev) -
trunk/src/VBox/Main/src-client/MouseImpl.cpp
r85301 r89951 1242 1242 * Validate configuration. 1243 1243 */ 1244 if (!CFGMR3AreValuesValid(pCfg, " Object\0"))1244 if (!CFGMR3AreValuesValid(pCfg, "")) 1245 1245 return VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES; 1246 1246 AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER, … … 1268 1268 * Get the Mouse object pointer and update the mpDrv member. 1269 1269 */ 1270 void *pv; 1271 int rc = CFGMR3QueryPtr(pCfg, "Object", &pv); 1272 if (RT_FAILURE(rc)) 1273 { 1274 AssertMsgFailed(("Configuration error: No/bad \"Object\" value! rc=%Rrc\n", rc)); 1275 return rc; 1276 } 1277 pThis->pMouse = (Mouse *)pv; /** @todo Check this cast! */ 1270 com::Guid uuid(COM_IIDOF(IMouse)); 1271 IMouse *pIMouse = (IMouse *)PDMDrvHlpQueryGenericUserObject(pDrvIns, uuid.raw()); 1272 if (!pIMouse) 1273 { 1274 AssertMsgFailed(("Configuration error: No/bad Mouse object!\n")); 1275 return VERR_NOT_FOUND; 1276 } 1277 pThis->pMouse = static_cast<Mouse *>(pIMouse); 1278 1278 1279 unsigned cDev; 1279 1280 {
Note:
See TracChangeset
for help on using the changeset viewer.