Changeset 4876 in vbox
- Timestamp:
- Sep 17, 2007 9:28:52 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleVRDPServer.cpp
r4849 r4876 29 29 #include <iprt/asm.h> 30 30 #include <iprt/ldr.h> 31 #include <iprt/alloca.h> 31 32 32 33 #include <VBox/err.h> … … 380 381 { 381 382 memset (pu8DstAndMask, 0xFF, cbDstAndMask); 382 383 383 384 int y; 384 385 for (y = 0; y < h; y++) 385 386 { 386 387 uint8_t bitmask = 0x80; 387 388 388 389 int x; 389 390 for (x = 0; x < w; x++, bitmask >>= 1) … … 393 394 bitmask = 0x80; 394 395 } 395 396 396 397 /* Whether alpha channel value is not transparent enough for the pixel to be seen. */ 397 398 if (pu8SrcAlpha[x * 4 + 3] > 0x7f) … … 400 401 } 401 402 } 402 403 403 404 /* Point to next source and dest scans. */ 404 405 pu8SrcAlpha += w * 4; … … 645 646 com::Bstr address; 646 647 server->mConsole->getVRDPServer ()->COMGETTER(NetAddress) (address.asOutParam()); 647 648 648 649 if (cbBuffer >= address.length ()) 649 650 { … … 654 655 rc = VINF_SUCCESS; 655 656 } 656 657 657 658 *pcbOut = address.length (); 658 659 } break; … … 663 664 664 665 server->mConsole->machine ()->COMGETTER(MonitorCount)(&cMonitors); 665 666 666 667 if (cbBuffer >= sizeof (uint32_t)) 667 668 { … … 687 688 { 688 689 ConsoleVRDPServer *server = static_cast <ConsoleVRDPServer *> (pvCallback); 689 690 690 691 return server->mConsole->VRDPClientLogon (u32ClientId, pszUser, pszPassword, pszDomain); 691 692 } … … 694 695 { 695 696 ConsoleVRDPServer *server = static_cast <ConsoleVRDPServer *> (pvCallback); 696 697 697 698 server->mConsole->VRDPClientConnect (u32ClientId); 698 699 } … … 701 702 { 702 703 ConsoleVRDPServer *server = static_cast <ConsoleVRDPServer *> (pvCallback); 703 704 704 705 server->mConsole->VRDPClientDisconnect (u32ClientId, fu32Intercepted); 705 706 } … … 708 709 { 709 710 ConsoleVRDPServer *server = static_cast <ConsoleVRDPServer *> (pvCallback); 710 711 711 712 LogFlowFunc(("%x\n", fu32Intercept)); 712 713 … … 754 755 #else 755 756 return VERR_NOT_SUPPORTED; 756 #endif 757 #endif 757 758 } 758 759 … … 802 803 pInfo->cBitsPerPixel = bitsPerPixel; 803 804 pInfo->cbLine = lineSize; 804 805 805 806 pfb->Unlock (); 806 807 807 808 fAvailable = true; 808 809 } … … 820 821 { 821 822 ConsoleVRDPServer *server = static_cast <ConsoleVRDPServer *> (pvCallback); 822 823 823 824 if (server->maFramebuffers[uScreenId]) 824 825 { … … 830 831 { 831 832 ConsoleVRDPServer *server = static_cast <ConsoleVRDPServer *> (pvCallback); 832 833 833 834 if (server->maFramebuffers[uScreenId]) 834 835 { … … 928 929 int rc = RTCritSectInit (&mCritSect); 929 930 AssertRC (rc); 930 931 931 932 mcClipboardRefs = 0; 932 933 mpfnClipboardCallback = NULL; … … 935 936 mUSBBackends.pHead = NULL; 936 937 mUSBBackends.pTail = NULL; 937 938 938 939 mUSBBackends.thread = NIL_RTTHREAD; 939 940 mUSBBackends.fThreadRunning = false; … … 943 944 #ifdef VBOX_VRDP 944 945 mhServer = 0; 945 946 946 947 #ifdef VRDP_NO_COM 947 948 m_fGuestWantsAbsolute = false; 948 949 m_mousex = 0; 949 950 m_mousey = 0; 950 951 951 952 memset (maFramebuffers, 0, sizeof (maFramebuffers)); 952 953 953 954 mConsoleCallback = new VRDPConsoleCallback(this); 954 955 mConsoleCallback->AddRef(); … … 1129 1130 1130 1131 LogFlow(("Console::threadRemoteUSB: start. owner = %p.\n", pOwner)); 1131 1132 1132 1133 pOwner->notifyRemoteUSBThreadRunning (self); 1133 1134 … … 1135 1136 { 1136 1137 RemoteUSBBackend *pRemoteUSBBackend = NULL; 1137 1138 1138 1139 while ((pRemoteUSBBackend = pOwner->usbBackendGetNext (pRemoteUSBBackend)) != NULL) 1139 1140 { … … 1156 1157 AssertRC (rc); 1157 1158 } 1158 1159 1159 1160 bool ConsoleVRDPServer::isRemoteUSBThreadRunning (void) 1160 1161 { 1161 1162 return mUSBBackends.fThreadRunning; 1162 1163 } 1163 1164 1164 1165 void ConsoleVRDPServer::waitRemoteUSBThreadEvent (unsigned cMillies) 1165 1166 { … … 1178 1179 mUSBBackends.event = 0; 1179 1180 } 1180 1181 1181 1182 if (VBOX_SUCCESS (rc)) 1182 1183 { … … 1184 1185 RTTHREADTYPE_VRDP_IO, RTTHREADFLAGS_WAITABLE, "remote usb"); 1185 1186 } 1186 1187 1187 1188 if (VBOX_FAILURE (rc)) 1188 1189 { … … 1202 1203 { 1203 1204 mUSBBackends.fThreadRunning = false; 1204 1205 1205 1206 if (mUSBBackends.thread != NIL_RTTHREAD) 1206 1207 { 1207 1208 Assert (mUSBBackends.event != 0); 1208 1209 1209 1210 RTSemEventSignal (mUSBBackends.event); 1210 1211 1211 1212 int rc = RTThreadWait (mUSBBackends.thread, 60000, NULL); 1212 1213 AssertRC (rc); 1213 1214 1214 1215 mUSBBackends.thread = NIL_RTTHREAD; 1215 1216 } 1216 1217 1217 1218 if (mUSBBackends.event) 1218 1219 { … … 1371 1372 1372 1373 int rc = VINF_SUCCESS; 1373 1374 1374 1375 ConsoleVRDPServer *pServer = static_cast <ConsoleVRDPServer *>(pvCallback); 1375 1376 1376 1377 NOREF(u32ClientId); 1377 1378 1378 1379 switch (u32Function) 1379 1380 { … … 1387 1388 cbData); 1388 1389 } 1389 } break; 1390 1390 } break; 1391 1391 1392 case VRDP_CLIPBOARD_FUNCTION_DATA_READ: 1392 1393 { … … 1398 1399 cbData); 1399 1400 } 1400 } break; 1401 1402 default: 1401 } break; 1402 1403 default: 1403 1404 rc = VERR_NOT_SUPPORTED; 1404 1405 } 1405 1406 1406 1407 return rc; 1407 1408 } … … 1414 1415 LogFlowFunc(("pvExtension = %p, u32Function = %d, pvParms = %p, cbParms = %d\n", 1415 1416 pvExtension, u32Function, pvParms, cbParms)); 1416 1417 1417 1418 int rc = VINF_SUCCESS; 1418 1419 1419 1420 #ifdef VBOX_VRDP 1420 1421 ConsoleVRDPServer *pServer = static_cast <ConsoleVRDPServer *>(pvExtension); 1421 1422 1422 1423 VBOXCLIPBOARDEXTPARMS *pParms = (VBOXCLIPBOARDEXTPARMS *)pvParms; 1423 1424 1424 1425 switch (u32Function) 1425 1426 { … … 1435 1436 if (mpEntryPoints && pServer->mhServer) 1436 1437 { 1437 mpEntryPoints->VRDPClipboard (pServer->mhServer, 1438 mpEntryPoints->VRDPClipboard (pServer->mhServer, 1438 1439 VRDP_CLIPBOARD_FUNCTION_FORMAT_ANNOUNCE, 1439 1440 pParms->u32Format, … … 1445 1446 if (mpfnVRDPClipboard) 1446 1447 { 1447 mpfnVRDPClipboard (pServer->mhServer, 1448 mpfnVRDPClipboard (pServer->mhServer, 1448 1449 VRDP_CLIPBOARD_FUNCTION_FORMAT_ANNOUNCE, 1449 1450 pParms->u32Format, … … 1464 1465 if (mpEntryPoints && pServer->mhServer) 1465 1466 { 1466 mpEntryPoints->VRDPClipboard (pServer->mhServer, 1467 mpEntryPoints->VRDPClipboard (pServer->mhServer, 1467 1468 VRDP_CLIPBOARD_FUNCTION_DATA_READ, 1468 1469 pParms->u32Format, … … 1474 1475 if (mpfnVRDPClipboard) 1475 1476 { 1476 mpfnVRDPClipboard (pServer->mhServer, 1477 mpfnVRDPClipboard (pServer->mhServer, 1477 1478 VRDP_CLIPBOARD_FUNCTION_DATA_READ, 1478 1479 pParms->u32Format, … … 1489 1490 if (mpEntryPoints && pServer->mhServer) 1490 1491 { 1491 mpEntryPoints->VRDPClipboard (pServer->mhServer, 1492 mpEntryPoints->VRDPClipboard (pServer->mhServer, 1492 1493 VRDP_CLIPBOARD_FUNCTION_DATA_WRITE, 1493 1494 pParms->u32Format, … … 1499 1500 if (mpfnVRDPClipboard) 1500 1501 { 1501 mpfnVRDPClipboard (pServer->mhServer, 1502 mpfnVRDPClipboard (pServer->mhServer, 1502 1503 VRDP_CLIPBOARD_FUNCTION_DATA_WRITE, 1503 1504 pParms->u32Format, … … 1508 1509 #endif /* VRDP_NO_COM */ 1509 1510 } break; 1510 1511 default: 1511 1512 default: 1512 1513 rc = VERR_NOT_SUPPORTED; 1513 1514 } … … 1524 1525 { 1525 1526 int rc = lockConsoleVRDPServer (); 1526 1527 1527 1528 if (VBOX_SUCCESS (rc)) 1528 1529 { … … 1530 1531 { 1531 1532 rc = HGCMHostRegisterServiceExtension (&mhClipboard, "VBoxSharedClipboard", ClipboardServiceExtension, this); 1532 1533 1533 1534 if (VBOX_SUCCESS (rc)) 1534 1535 { … … 1536 1537 } 1537 1538 } 1538 1539 1539 1540 #ifdef VRDP_NO_COM 1540 1541 #else … … 1553 1554 { 1554 1555 int rc = lockConsoleVRDPServer (); 1555 1556 1556 1557 if (VBOX_SUCCESS (rc)) 1557 1558 { 1558 1559 mcClipboardRefs--; 1559 1560 1560 1561 if (mcClipboardRefs == 0) 1561 1562 { … … 1578 1579 #ifdef VBOX_WITH_USB 1579 1580 LogFlow(("ConsoleVRDPServer::USBBackendCreate: u32ClientId = %d\n", u32ClientId)); 1580 1581 1581 1582 /* Create a new instance of the USB backend for the new client. */ 1582 1583 RemoteUSBBackend *pRemoteUSBBackend = new RemoteUSBBackend (mConsole, this, u32ClientId); … … 1585 1586 { 1586 1587 pRemoteUSBBackend->AddRef (); /* 'Release' called in USBBackendDelete. */ 1587 1588 1588 1589 /* Append the new instance in the list. */ 1589 1590 int rc = lockConsoleVRDPServer (); 1590 1591 1591 1592 if (VBOX_SUCCESS (rc)) 1592 1593 { … … 1600 1601 mUSBBackends.pTail = pRemoteUSBBackend; 1601 1602 } 1602 1603 1603 1604 mUSBBackends.pHead = pRemoteUSBBackend; 1604 1605 1605 1606 unlockConsoleVRDPServer (); 1606 1607 1607 1608 #ifdef VRDP_NO_COM 1608 1609 if (ppvIntercept) … … 1629 1630 1630 1631 RemoteUSBBackend *pRemoteUSBBackend = NULL; 1631 1632 1632 1633 /* Find the instance. */ 1633 1634 int rc = lockConsoleVRDPServer (); 1634 1635 1635 1636 if (VBOX_SUCCESS (rc)) 1636 1637 { 1637 1638 pRemoteUSBBackend = usbBackendFind (u32ClientId); 1638 1639 1639 1640 if (pRemoteUSBBackend) 1640 1641 { … … 1642 1643 pRemoteUSBBackend->NotifyDelete (); 1643 1644 } 1644 1645 1645 1646 unlockConsoleVRDPServer (); 1646 1647 } 1647 1648 1648 1649 if (pRemoteUSBBackend) 1649 1650 { … … 1658 1659 #ifdef VBOX_WITH_USB 1659 1660 RemoteUSBBackend *pRemoteUSBBackend = NULL; 1660 1661 1661 1662 /* Find the instance. */ 1662 1663 int rc = lockConsoleVRDPServer (); 1663 1664 1664 1665 if (VBOX_SUCCESS (rc)) 1665 1666 { 1666 1667 pRemoteUSBBackend = usbBackendFind (u32ClientId); 1667 1668 1668 1669 if (pRemoteUSBBackend) 1669 1670 { 1670 1671 /* Inform the backend instance that it is referenced by the Guid. */ 1671 1672 bool fAdded = pRemoteUSBBackend->addUUID (pGuid); 1672 1673 1673 1674 if (fAdded) 1674 1675 { … … 1681 1682 } 1682 1683 } 1683 1684 1684 1685 unlockConsoleVRDPServer (); 1685 1686 } 1686 1687 1687 1688 if (pRemoteUSBBackend) 1688 1689 { 1689 1690 return pRemoteUSBBackend->GetBackendCallbackPointer (); 1690 1691 } 1691 1692 1692 1693 #endif 1693 1694 return NULL; … … 1698 1699 #ifdef VBOX_WITH_USB 1699 1700 RemoteUSBBackend *pRemoteUSBBackend = NULL; 1700 1701 1701 1702 /* Find the instance. */ 1702 1703 int rc = lockConsoleVRDPServer (); 1703 1704 1704 1705 if (VBOX_SUCCESS (rc)) 1705 1706 { 1706 1707 pRemoteUSBBackend = usbBackendFindByUUID (pGuid); 1707 1708 1708 1709 if (pRemoteUSBBackend) 1709 1710 { 1710 1711 pRemoteUSBBackend->removeUUID (pGuid); 1711 1712 } 1712 1713 1713 1714 unlockConsoleVRDPServer (); 1714 1715 1715 1716 if (pRemoteUSBBackend) 1716 1717 { … … 1727 1728 RemoteUSBBackend *pNextRemoteUSBBackend = NULL; 1728 1729 #ifdef VBOX_WITH_USB 1729 1730 1730 1731 int rc = lockConsoleVRDPServer (); 1731 1732 1732 1733 if (VBOX_SUCCESS (rc)) 1733 1734 { … … 1742 1743 pNextRemoteUSBBackend = (RemoteUSBBackend *)pRemoteUSBBackend->pNext; 1743 1744 } 1744 1745 1745 1746 if (pNextRemoteUSBBackend) 1746 1747 { 1747 1748 pNextRemoteUSBBackend->AddRef (); 1748 1749 } 1749 1750 1750 1751 unlockConsoleVRDPServer (); 1751 1752 1752 1753 if (pRemoteUSBBackend) 1753 1754 { … … 1756 1757 } 1757 1758 #endif 1758 1759 1759 1760 return pNextRemoteUSBBackend; 1760 1761 } … … 1765 1766 { 1766 1767 RemoteUSBBackend *pRemoteUSBBackend = mUSBBackends.pHead; 1767 1768 1768 1769 while (pRemoteUSBBackend) 1769 1770 { … … 1772 1773 break; 1773 1774 } 1774 1775 1775 1776 pRemoteUSBBackend = (RemoteUSBBackend *)pRemoteUSBBackend->pNext; 1776 1777 } 1777 1778 1778 1779 return pRemoteUSBBackend; 1779 1780 } … … 1783 1784 { 1784 1785 RemoteUSBBackend *pRemoteUSBBackend = mUSBBackends.pHead; 1785 1786 1786 1787 while (pRemoteUSBBackend) 1787 1788 { … … 1790 1791 break; 1791 1792 } 1792 1793 1793 1794 pRemoteUSBBackend = (RemoteUSBBackend *)pRemoteUSBBackend->pNext; 1794 1795 } 1795 1796 1796 1797 return pRemoteUSBBackend; 1797 1798 } … … 1804 1805 int rc = lockConsoleVRDPServer (); 1805 1806 AssertRC (rc); 1806 1807 1807 1808 /* Exclude the found instance from the list. */ 1808 1809 if (pRemoteUSBBackend->pNext) … … 1814 1815 mUSBBackends.pTail = (RemoteUSBBackend *)pRemoteUSBBackend->pPrev; 1815 1816 } 1816 1817 1817 1818 if (pRemoteUSBBackend->pPrev) 1818 1819 { … … 1823 1824 mUSBBackends.pHead = (RemoteUSBBackend *)pRemoteUSBBackend->pNext; 1824 1825 } 1825 1826 1826 1827 pRemoteUSBBackend->pNext = pRemoteUSBBackend->pPrev = NULL; 1827 1828 1828 1829 unlockConsoleVRDPServer (); 1829 1830 #endif
Note:
See TracChangeset
for help on using the changeset viewer.