- Timestamp:
- Aug 26, 2009 12:50:12 PM (15 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp
r22465 r22469 1375 1375 1376 1376 /** 1377 * Send a request to the host to make the absolute pointer visible 1378 */ 1379 static BOOLEAN ShowPointer(PVOID HwDeviceExtension) 1380 { 1381 LogRelFlowFunc(("\n")); 1382 BOOLEAN Result; 1383 1384 if (DEV_MOUSE_HIDDEN((PDEVICE_EXTENSION)HwDeviceExtension)) 1385 { 1386 // tell the host to use the guest's pointer 1387 VIDEO_POINTER_ATTRIBUTES PointerAttributes; 1388 1389 /* Visible and No Shape means Show the pointer. 1390 * It is enough to init only this field. 1391 */ 1392 PointerAttributes.Enable = VBOX_MOUSE_POINTER_VISIBLE; 1393 1394 #ifndef VBOX_WITH_HGSMI 1395 Result = vboxUpdatePointerShape(&PointerAttributes, sizeof (PointerAttributes)); 1396 #else 1397 Result = vboxUpdatePointerShape(((PDEVICE_EXTENSION)HwDeviceExtension)->pPrimary, &PointerAttributes, sizeof (PointerAttributes)); 1398 #endif /* VBOX_WITH_HGSMI */ 1399 1400 if (Result) 1401 DEV_SET_MOUSE_SHOWN((PDEVICE_EXTENSION)HwDeviceExtension); 1402 else 1403 dprintf(("VBoxVideo::ShowPointer: Could not show the hardware pointer -> fallback\n")); 1404 } 1405 LogRelFlowFunc(("returning %d\n", Result)); 1406 return Result; 1407 } 1408 1409 /** 1377 1410 * VBoxVideoStartIO 1378 1411 * … … 1584 1617 dprintf(("VBoxVideo::VBoxVideoStartIO: IOCTL_VIDEO_ENABLE_POINTER\n")); 1585 1618 // find out whether the host wants absolute positioning 1619 /// @todo this is now obsolete - remove it? 1586 1620 if (vboxQueryHostWantsAbsolute()) 1587 { 1588 // tell the host to use the guest's pointer 1621 Result = ShowPointer(HwDeviceExtension); 1622 else 1623 { 1624 // fallback to software pointer 1625 RequestPacket->StatusBlock->Status = ERROR_INVALID_FUNCTION; 1626 Result = FALSE; 1627 } 1628 break; 1629 } 1630 1631 // hide the pointer 1632 case IOCTL_VIDEO_DISABLE_POINTER: 1633 { 1634 dprintf(("VBoxVideo::VBoxVideoStartIO: IOCTL_VIDEO_DISABLE_POINTER\n")); 1635 // find out whether the host wants absolute positioning 1636 if (vboxQueryHostWantsAbsolute()) 1637 { 1638 // tell the host to hide pointer 1589 1639 VIDEO_POINTER_ATTRIBUTES PointerAttributes; 1590 1640 1591 /* Visible and No Shape means Show the pointer.1641 /* Enable == 0 means no shape, not visible. 1592 1642 * It is enough to init only this field. 1593 1643 */ 1594 PointerAttributes.Enable = VBOX_MOUSE_POINTER_VISIBLE;1644 PointerAttributes.Enable = 0; 1595 1645 1596 1646 #ifndef VBOX_WITH_HGSMI … … 1600 1650 #endif /* VBOX_WITH_HGSMI */ 1601 1651 1602 if (!Result) 1603 dprintf(("VBoxVideo::VBoxVideoStartIO: Could not hide hardware pointer -> fallback\n")); 1604 } else 1605 { 1606 // fallback to software pointer 1607 RequestPacket->StatusBlock->Status = ERROR_INVALID_FUNCTION; 1608 Result = FALSE; 1609 } 1610 break; 1611 } 1612 1613 // hide the pointer 1614 case IOCTL_VIDEO_DISABLE_POINTER: 1615 { 1616 dprintf(("VBoxVideo::VBoxVideoStartIO: IOCTL_VIDEO_DISABLE_POINTER\n")); 1617 // find out whether the host wants absolute positioning 1618 if (vboxQueryHostWantsAbsolute()) 1619 { 1620 // tell the host to hide pointer 1621 VIDEO_POINTER_ATTRIBUTES PointerAttributes; 1622 1623 /* Enable == 0 means no shape, not visible. 1624 * It is enough to init only this field. 1625 */ 1626 PointerAttributes.Enable = 0; 1627 1628 #ifndef VBOX_WITH_HGSMI 1629 Result = vboxUpdatePointerShape(&PointerAttributes, sizeof (PointerAttributes)); 1630 #else 1631 Result = vboxUpdatePointerShape(((PDEVICE_EXTENSION)HwDeviceExtension)->pPrimary, &PointerAttributes, sizeof (PointerAttributes)); 1632 #endif /* VBOX_WITH_HGSMI */ 1633 1634 if (!Result) 1652 if (Result) 1653 DEV_SET_MOUSE_HIDDEN((PDEVICE_EXTENSION)HwDeviceExtension); 1654 else 1635 1655 dprintf(("VBoxVideo::VBoxVideoStartIO: Could not hide hardware pointer -> fallback\n")); 1636 1656 } else … … 1702 1722 case IOCTL_VIDEO_SET_POINTER_POSITION: 1703 1723 { 1704 /// @todo There is an issue when we disable pointer integration.1705 // The guest pointer will be invisible. We have to somehow cause1706 // the pointer attributes to be set again. But how? The same holds1707 // true for the opposite case where we get two pointers.1708 1709 //dprintf(("VBoxVideo::VBoxVideoStartIO: IOCTL_VIDEO_SET_POINTER_POSITION\n"));1710 1724 // find out whether the host wants absolute positioning 1725 /// @todo this is now obsolete - remove it? 1711 1726 if (vboxQueryHostWantsAbsolute()) 1712 { 1713 // @todo we are supposed to show currently invisible pointer? 1714 Result = TRUE; 1715 } else 1727 Result = ShowPointer(HwDeviceExtension); 1728 else 1716 1729 { 1717 1730 // fallback to software pointer -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h
r22465 r22469 126 126 ULONG ulMaxFrameBufferSize; /* The size of the VRAM allocated for the a single framebuffer. */ 127 127 128 BOOLEAN fMouseHidden; /* Has the mouse cursor been hidden by the guest? */ 129 128 130 #ifndef VBOX_WITH_HGSMI 129 131 ULONG ulDisplayInformationSize; /* The size of the Display information, which is at offset: … … 164 166 #endif /* VBOX_WITH_HGSMI */ 165 167 } DEVICE_EXTENSION, *PDEVICE_EXTENSION; 168 169 #define DEV_MOUSE_HIDDEN(dev) ((dev)->pPrimary->u.primary.fMouseHidden) 170 #define DEV_SET_MOUSE_HIDDEN(dev) \ 171 do { \ 172 (dev)->pPrimary->u.primary.fMouseHidden = TRUE; \ 173 } while (0) 174 #define DEV_SET_MOUSE_SHOWN(dev) \ 175 do { \ 176 (dev)->pPrimary->u.primary.fMouseHidden = FALSE; \ 177 } while (0) 166 178 167 179 extern "C"
Note:
See TracChangeset
for help on using the changeset viewer.