Changeset 31430 in vbox
- Timestamp:
- Aug 6, 2010 8:47:51 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 64495
- Location:
- trunk
- Files:
-
- 8 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VBoxGuestLib.h
r31364 r31430 380 380 DECLVBGL(int) VbglQueryVMMDevMemory (VMMDevMemory **ppVMMDevMemory); 381 381 DECLR0VBGL(bool) VbglR0CanUsePhysPageList(void); 382 383 DECLR0VBGL(int) VbglR0MiscReportGuestInfo(VBOXOSTYPE enmOSType);384 382 385 383 #endif /* IN_RING0 && !IN_RING0_AGNOSTIC */ -
trunk/src/VBox/Additions/WINNT/VBoxGuest/Makefile.kmk
r29059 r31430 5 5 6 6 # 7 # Copyright (C) 2006-20 07Oracle Corporation7 # Copyright (C) 2006-2010 Oracle Corporation 8 8 # 9 9 # This file is part of VirtualBox Open Source Edition (OSE), as … … 43 43 HelperBugCheck.cpp \ 44 44 VBoxGuest.rc 45 VBoxGuest_LIBS = \ 45 VBoxGuest_SOURCES += \ 46 ../../common/VBoxGuest/VBoxHelper.cpp 47 VBoxGuest_LIBS = \ 46 48 $(PATH_SDK_W2K3DDK_LIB)/ntoskrnl.lib \ 47 49 $(PATH_SDK_W2K3DDK_LIB)/hal.lib \ … … 71 73 NTLegacy.cpp \ 72 74 VBoxGuest.rc 75 VBoxGuestNT_SOURCES += \ 76 ../../common/VBoxGuest/VBoxHelper.cpp 77 73 78 VBoxGuestNT_LIBS = \ 74 79 $(PATH_SDK_W2K3DDK_LIB)/exsup.lib \ -
trunk/src/VBox/Additions/WINNT/VBoxGuest/NTLegacy.cpp
r31364 r31430 3 3 * VBoxGuest -- VirtualBox Win32 guest support driver 4 4 * 5 * Copyright (C) 2006-20 07Oracle Corporation5 * Copyright (C) 2006-2010 Oracle Corporation 6 6 * 7 7 * This file is part of VirtualBox Open Source Edition (OSE), as … … 24 24 25 25 #include <VBox/VBoxGuestLib.h> 26 #include "../../common/VBoxGuest/VBoxHelper.h" 26 27 27 28 /******************************************************************************* … … 276 277 /** @todo Don't mix up IPRT rc and NTSTATUS rc above! */ 277 278 278 vrc = VBoxInitMemBalloon(pDevExt); 279 if (RT_SUCCESS(vrc)) 280 { 281 vrc = VbglR0MiscReportGuestInfo(hlpVBoxWinVersionToOSType(winVersion)); 279 if (NT_SUCCESS(rc)) 280 { 281 vrc = VBoxReportGuestInfo(hlpVBoxWinVersionToOSType(winVersion)); 282 if (RT_SUCCESS(vrc)) 283 { 284 vrc = VBoxInitMemBalloon(pDevExt); 285 if (RT_SUCCESS(vrc)) 286 { 287 vrc = VBoxReportGuestDriverStatus(true /* Driver is active */); 288 if (RT_FAILURE(vrc)) 289 dprintf(("VBoxGuest::VBoxGuestPnp::IRP_MN_START_DEVICE: could not report guest driver status, vrc = %d\n", vrc)); 290 } 291 else 292 dprintf(("VBoxGuest::VBoxGuestPnp::IRP_MN_START_DEVICE: could not init mem balloon, vrc = %d\n", vrc)); 293 } 294 else 295 dprintf(("VBoxGuest::VBoxGuestPnp::IRP_MN_START_DEVICE: could not report guest information to host, vrc = %d\n", vrc)); 296 282 297 if (RT_FAILURE(vrc)) 283 dprintf(("VBoxGuest::ntCreateDevice: could not report information to host, rc = %d, exiting!\n", rc)); 284 } 285 286 if ( NT_ERROR(rc) 287 || RT_FAILURE(vrc)) 298 rc = STATUS_UNSUCCESSFUL; 299 } 300 301 if (NT_SUCCESS(rc)) 302 { 303 // ready to rumble! 304 pDevExt->devState = WORKING; 305 } 306 else 288 307 { 289 308 freeDeviceResources(pDrvObj, pDevObj); 290 return STATUS_UNSUCCESSFUL; 291 } 292 293 // ready to rumble! 294 pDevExt->devState = WORKING; 309 } 310 295 311 dprintf(("returning from ntCreateDevice with rc = 0x%x\n, vrc = %Rrc", rc, vrc)); 296 312 return rc; -
trunk/src/VBox/Additions/WINNT/VBoxGuest/VBoxGuestPnP.cpp
r31364 r31430 25 25 26 26 #include <VBox/VBoxGuestLib.h> 27 #include "../../common/VBoxGuest/VBoxHelper.h" 27 28 28 29 /******************************************************************************* … … 230 231 } 231 232 } 233 234 /** @todo Don't mix up IPRT rc and NTSTATUS rc above! */ 235 236 if (NT_SUCCESS(rc)) 237 { 238 int vrc = VBoxReportGuestInfo(hlpVBoxWinVersionToOSType(winVersion)); 239 if (RT_SUCCESS(vrc)) 240 { 241 vrc = VBoxInitMemBalloon(pDevExt); 242 if (RT_SUCCESS(vrc)) 243 { 244 vrc = VBoxReportGuestDriverStatus(true /* Driver is active */); 245 if (RT_FAILURE(vrc)) 246 dprintf(("VBoxGuest::VBoxGuestPnp::IRP_MN_START_DEVICE: could not report guest driver status, vrc = %d\n", vrc)); 247 } 248 else 249 dprintf(("VBoxGuest::VBoxGuestPnp::IRP_MN_START_DEVICE: could not init mem balloon, vrc = %d\n", vrc)); 250 } 251 else 252 dprintf(("VBoxGuest::VBoxGuestPnp::IRP_MN_START_DEVICE: could not report guest information to host, vrc = %d\n", vrc)); 253 254 if (RT_FAILURE(vrc)) 255 rc = STATUS_UNSUCCESSFUL; 256 } 257 232 258 if (NT_SUCCESS(rc)) 233 259 { … … 241 267 pDevExt->HGCMWaitTimeout.QuadPart *= -10000; /* relative in 100ns units */ 242 268 243 int vrc = VBoxInitMemBalloon(pDevExt);244 if (RT_SUCCESS(vrc))245 {246 vrc = VbglR0MiscReportGuestInfo(hlpVBoxWinVersionToOSType(winVersion));247 if (RT_FAILURE(vrc))248 dprintf(("VBoxGuest::VBoxGuestPnp::IRP_MN_START_DEVICE: could not report information to host, rc = %d\n", rc));249 }250 251 269 // ready to rumble! 252 270 dprintf(("VBoxGuest::VBoxGuestPnp: device is ready!\n")); 253 271 pDevExt->devState = WORKING; 254 } else 272 } 273 else 255 274 { 256 275 dprintf(("VBoxGuest::VBoxGuestPnp: error: rc = 0x%x\n", rc)); -
trunk/src/VBox/Additions/common/VBoxGuest/Makefile.kmk
r29044 r31430 45 45 VBoxGuest_SOURCES = VBoxGuest-$(KBUILD_TARGET).c 46 46 endif 47 VBoxGuest_SOURCES += VBoxGuest.cpp 47 VBoxGuest_SOURCES += \ 48 VBoxGuest.cpp \ 49 VBoxHelper.cpp 48 50 VBoxGuest_LIBS = \ 49 51 $(VBOX_LIB_VBGL_R0BASE) \ -
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp
r31364 r31430 36 36 # include <iprt/thread.h> 37 37 #endif 38 #include "VBoxHelper.h" 38 39 #include "version-generated.h" 39 40 #if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) … … 733 734 Assert(pDevExt->PhysIrqAckEvents != 0); 734 735 735 rc = vboxGuestSetFilterMask(pDevExt, fFixedEvents);736 rc = VBoxReportGuestInfo(enmOSType); 736 737 if (RT_SUCCESS(rc)) 737 738 { 738 /* 739 * Disable guest graphics capability by default. The guest specific 740 * graphics driver will re-enable this when it is necessary. 741 */ 742 rc = VBoxGuestSetGuestCapabilities(0, VMMDEV_GUEST_SUPPORTS_GRAPHICS); 739 rc = vboxGuestSetFilterMask(pDevExt, fFixedEvents); 743 740 if (RT_SUCCESS(rc)) 744 741 { 745 vboxGuestInitFixateGuestMappings(pDevExt); 746 747 rc = VbglR0MiscReportGuestInfo(enmOSType); 748 if (RT_FAILURE(rc)) 749 LogRel(("VBoxGuestInitDevExt: VbglR0MiscReportGuestInfo failed, rc=%Rrc\n", rc)); 750 751 Log(("VBoxGuestInitDevExt: returns success\n")); 752 return VINF_SUCCESS; 742 /* 743 * Disable guest graphics capability by default. The guest specific 744 * graphics driver will re-enable this when it is necessary. 745 */ 746 rc = VBoxGuestSetGuestCapabilities(0, VMMDEV_GUEST_SUPPORTS_GRAPHICS); 747 if (RT_SUCCESS(rc)) 748 { 749 vboxGuestInitFixateGuestMappings(pDevExt); 750 751 rc = VBoxReportGuestDriverStatus(true /* Driver is active */); 752 if (RT_FAILURE(rc)) 753 LogRel(("VBoxGuestInitDevExt: VBoxReportGuestDriverStatus failed, rc=%Rrc\n", rc)); 754 755 Log(("VBoxGuestInitDevExt: returns success\n")); 756 return VINF_SUCCESS; 757 } 758 759 LogRel(("VBoxGuestInitDevExt: VBoxGuestSetGuestCapabilities failed, rc=%Rrc\n", rc)); 753 760 } 754 755 LogRel(("VBoxGuestInitDevExt: VBoxGuestSetGuestCapabilitiesfailed, rc=%Rrc\n", rc));761 else 762 LogRel(("VBoxGuestInitDevExt: vboxGuestSetFilterMask failed, rc=%Rrc\n", rc)); 756 763 } 757 764 else 758 LogRel(("VBoxGuestInitDevExt: vboxGuestSetFilterMaskfailed, rc=%Rrc\n", rc));765 LogRel(("VBoxGuestInitDevExt: VBoxReportGuestInfo failed, rc=%Rrc\n", rc)); 759 766 VbglGRFree((VMMDevRequestHeader *)pDevExt->pIrqAckEvents); 760 767 } -
trunk/src/VBox/Additions/common/VBoxGuest/VBoxHelper.cpp
r31388 r31430 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox GuestR0LibMisc- Miscellaneous functions.3 * VBoxHelper - Miscellaneous functions. 4 4 */ 5 5 … … 32 32 33 33 34 DECLR0VBGL(int) VbglR0MiscReportGuestInfo(VBOXOSTYPE enmOSType)34 int VBoxReportGuestInfo(VBOXOSTYPE enmOSType) 35 35 { 36 /* 37 * Important: VMMDev *awaits* a VMMDevReportGuestInfo or VMMDevReportGuestInfo2 message 38 * first in order to accept all other VMMDev messages! Otherwise you'd get 39 * a VERR_NOT_SUPPORTED error. 40 */ 36 41 VMMDevReportGuestInfo2 *pReq = NULL; 37 42 int rc = VbglGRAlloc((VMMDevRequestHeader **)&pReq, sizeof (VMMDevReportGuestInfo2), VMMDevReq_ReportGuestInfo2); 43 Log(("VBoxReportGuestInfo: VbglGRAlloc VMMDevReportGuestInfo2 completed with rc=%Rrc\n", rc)); 38 44 if (RT_SUCCESS(rc)) 39 45 { … … 46 52 47 53 rc = VbglGRPerform(&pReq->header); 54 Log(("VBoxReportGuestInfo: VbglGRPerform VMMDevReportGuestInfo2 completed with rc=%Rrc\n", rc)); 48 55 if (rc == VERR_NOT_IMPLEMENTED) /* Compatibility with older hosts. */ 49 56 rc = VINF_SUCCESS; 50 57 VbglGRFree(&pReq->header); 51 }52 53 /*54 * Report guest status of the VBox driver to the host.55 */56 if (RT_SUCCESS(rc))57 {58 VMMDevReportGuestStatus *pReq2;59 rc = VbglGRAlloc((VMMDevRequestHeader **)&pReq2, sizeof(*pReq2), VMMDevReq_ReportGuestStatus);60 if (RT_SUCCESS(rc))61 {62 pReq2->guestStatus.facility = VBoxGuestStatusFacility_VBoxGuestDriver;63 pReq2->guestStatus.status = VBoxGuestStatusCurrent_Active; /** @todo Are we actually *really* active at this point? */64 pReq2->guestStatus.flags = 0;65 rc = VbglGRPerform(&pReq2->header);66 if (rc == VERR_NOT_IMPLEMENTED) /* Compatibility with older hosts. */67 rc = VINF_SUCCESS;68 VbglGRFree(&pReq2->header);69 }70 58 } 71 59 … … 78 66 VMMDevReportGuestInfo *pReq3 = NULL; 79 67 rc = VbglGRAlloc((VMMDevRequestHeader **)&pReq3, sizeof (VMMDevReportGuestInfo), VMMDevReq_ReportGuestInfo); 68 Log(("VBoxReportGuestInfo: VbglGRAlloc VMMDevReportGuestInfo completed with rc=%Rrc\n", rc)); 80 69 if (RT_SUCCESS(rc)) 81 70 { … … 84 73 85 74 rc = VbglGRPerform(&pReq3->header); 75 Log(("VBoxReportGuestInfo: VbglGRPerform VMMDevReportGuestInfo completed with rc=%Rrc\n", rc)); 86 76 VbglGRFree(&pReq3->header); 87 77 } … … 91 81 } 92 82 83 int VBoxReportGuestDriverStatus(bool fActive) 84 { 85 /* 86 * Report guest status of the VBox driver to the host. 87 */ 88 VMMDevReportGuestStatus *pReq2 = NULL; 89 int rc = VbglGRAlloc((VMMDevRequestHeader **)&pReq2, sizeof(*pReq2), VMMDevReq_ReportGuestStatus); 90 Log(("VBoxReportGuestDriverStatus: VbglGRAlloc VMMDevReportGuestStatus completed with rc=%Rrc\n", rc)); 91 if (RT_SUCCESS(rc)) 92 { 93 pReq2->guestStatus.facility = VBoxGuestStatusFacility_VBoxGuestDriver; 94 pReq2->guestStatus.status = fActive ? 95 VBoxGuestStatusCurrent_Active 96 : VBoxGuestStatusCurrent_Inactive; 97 pReq2->guestStatus.flags = 0; 98 rc = VbglGRPerform(&pReq2->header); 99 Log(("VBoxReportGuestDriverStatus: VbglGRPerform VMMDevReportGuestStatus completed with fActive=%d, rc=%Rrc\n", 100 rc, fActive ? 1 : 0)); 101 if (rc == VERR_NOT_IMPLEMENTED) /* Compatibility with older hosts. */ 102 rc = VINF_SUCCESS; 103 VbglGRFree(&pReq2->header); 104 } 105 106 return rc; 107 } 108 -
trunk/src/VBox/Additions/common/VBoxGuestLib/Makefile.kmk
r31426 r31430 61 61 VMMDev.cpp \ 62 62 HGCM.cpp \ 63 VBoxGuestR0LibMisc.c \64 63 VBoxGuestR0LibSharedFolders.c \ 65 64 VbglR0CanUsePhysPageList.cpp 66 67 VBoxGuestR0LibMisc.c_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)68 69 65 70 66 # … … 82 78 VMMDev.cpp \ 83 79 HGCMInternal.cpp \ 84 VbglR0CanUsePhysPageList.cpp \ 85 VBoxGuestR0LibMisc.c 80 VbglR0CanUsePhysPageList.cpp 86 81 87 82 # -
trunk/src/VBox/Devices/VMMDev/VMMDev.cpp
r31241 r31430 425 425 Log2(("VMMDev request issued: %d\n", requestHeader.requestType)); 426 426 427 if ( requestHeader.requestType != VMMDevReq_ReportGuestInfo 428 && !pThis->fu32AdditionsOk) 427 /* Because VMMDevReq_ReportGuestInfo is sent last in the first information chain 428 * from the guest also check for VMMDevReq_ReportGuestInfo2. */ 429 if ( requestHeader.requestType != VMMDevReq_ReportGuestInfo2 430 && ( requestHeader.requestType != VMMDevReq_ReportGuestInfo 431 && !pThis->fu32AdditionsOk)) 429 432 { 430 433 Log(("VMMDev: guest has not yet reported to us. Refusing operation.\n"));
Note:
See TracChangeset
for help on using the changeset viewer.