Changeset 5888 in vbox
- Timestamp:
- Nov 30, 2007 12:36:21 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibSeamless.cpp
r5872 r5888 16 16 *******************************************************************************/ 17 17 #include <iprt/assert.h> 18 #include <iprt/string.h> 18 19 19 20 #include <VBox/VBoxGuest.h> … … 21 22 #include <VBox/log.h> 22 23 23 #include <string.h>24 24 25 25 /* Move this to a header { */ … … 33 33 * 34 34 * @returns IPRT status value 35 * @param bState whether or not we support seamless mode35 * @param fState whether or not we support seamless mode 36 36 * 37 37 * @todo Currently this will trample over any other capabilities the guest may have. 38 38 * This will have to be fixed when more capabilities are added at the latest. 39 39 */ 40 VBGLR3DECL(int) VbglR3SeamlessSetCap(bool bState)40 VBGLR3DECL(int) VbglR3SeamlessSetCap(bool fState) 41 41 { 42 VMMDevReqGuestCapabilities vmmreqGuestCaps = { {0} };42 VMMDevReqGuestCapabilities vmmreqGuestCaps; 43 43 int rc = VINF_SUCCESS; 44 44 45 memset(&vmmreqGuestCaps, 0, sizeof(vmmreqGuestCaps)); 45 46 vmmdevInitRequest(&vmmreqGuestCaps.header, VMMDevReq_ReportGuestCapabilities); 46 vmmreqGuestCaps.caps = bState ? VMMDEV_GUEST_SUPPORTS_SEAMLESS : 0;47 vmmreqGuestCaps.caps = fState ? VMMDEV_GUEST_SUPPORTS_SEAMLESS : 0; 47 48 rc = VbglR3GRPerform(&vmmreqGuestCaps.header); 48 49 #ifdef DEBUG 49 50 if (RT_SUCCESS(rc)) 50 {51 51 LogRel(("Successfully enabled seamless mode on the host.\n")); 52 }53 52 else 54 { 55 LogRel(("Failed to enabled seamless mode on the host, rc = %Vrc.\n", rc)); 56 } 53 LogRel(("Failed to enabled seamless mode on the host, rc = %Rrc.\n", rc)); 57 54 #endif 58 55 return rc; … … 71 68 int rc; 72 69 73 Assert Return(pMode != 0, VERR_INVALID_PARAMETER);70 AssertPtrReturn(pMode, VERR_INVALID_PARAMETER); 74 71 waitEvent.u32TimeoutIn = 0; 75 72 waitEvent.u32EventMaskIn = VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST; … … 114 111 int rc; 115 112 116 rc = VbglR3GRAlloc 117 sizeof (VMMDevVideoSetVisibleRegion) + (cRects-1)*sizeof(RTRECT),118 VMMDevReq_VideoSetVisibleRegion);113 rc = VbglR3GRAlloc((VMMDevRequestHeader **)&req, 114 sizeof(VMMDevVideoSetVisibleRegion) + (cRects - 1) * sizeof(RTRECT), 115 VMMDevReq_VideoSetVisibleRegion); 119 116 if (RT_SUCCESS(rc)) 120 117 { 121 118 req->cRect = cRects; 122 memcpy(&req->Rect, pRects, cRects *sizeof(RTRECT));123 rc = VbglR3GRPerform 119 memcpy(&req->Rect, pRects, cRects * sizeof(RTRECT)); 120 rc = VbglR3GRPerform(&req->header); 124 121 VbglR3GRFree(&req->header); 125 122 if (RT_SUCCESS(rc)) 126 123 { 127 124 if (RT_SUCCESS(req->header.rc)) 128 {129 125 return VINF_SUCCESS; 130 } 131 else 132 rc = req->header.rc; 126 rc = req->header.rc; 133 127 } 134 128 } 135 129 return rc; 136 130 } 131
Note:
See TracChangeset
for help on using the changeset viewer.