VirtualBox

Ignore:
Timestamp:
May 18, 2007 1:32:20 PM (18 years ago)
Author:
vboxsync
Message:

Do not allow to use VbglGr* if VBoxGuest is not available. Backed out r21276.

Location:
trunk/src/VBox/Additions/common/VBoxGuestLib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuestLib/GenericRequest.cpp

    r2304 r2714  
    2929{
    3030    int rc = VbglEnter ();
    31     VMMDevRequestHeader *pReq;
    3231
    3332    if (VBOX_FAILURE(rc))
     
    4039    }
    4140
    42     pReq = (VMMDevRequestHeader *)VbglPhysHeapAlloc (cbSize);
     41    VMMDevRequestHeader *pReq = (VMMDevRequestHeader *)VbglPhysHeapAlloc (cbSize);
    4342    if (!pReq)
    4443    {
     
    7473        return VERR_INVALID_PARAMETER;
    7574
    76     if (g_vbgldata.portVMMDev == 0)
    77         return VERR_VBGL_NOT_INITIALIZED;
    78 
    7975    physaddr = VbglPhysHeapGetPhysAddr (pReq);
    8076    if (!physaddr)
  • trunk/src/VBox/Additions/common/VBoxGuestLib/Init.cpp

    r2698 r2714  
    3333
    3434#ifndef VBGL_VBOXGUEST
    35 static int vbglQueryVMMDevPort (void)
     35/* The guest library uses lazy initialization for VMMDev port and memory,
     36 * because these values are provided by the VBoxGuest driver and it might
     37 * be loaded later than other drivers.
     38 * The VbglEnter checks the current library status, tries to retrive these
     39 * values and fails if they are unavailable.
     40 */
     41static void vbglQueryVMMDevPort (void)
    3642{
    3743    int rc = VINF_SUCCESS;
     
    6167
    6268    dprintf (("vbglQueryVMMDevPort rc = %d\n", rc));
    63    
    64     return rc;
    6569}
    6670#endif
     
    7781#endif
    7882
    79     rc = g_vbgldata.status != VbglStatusNotInitialized? VINF_SUCCESS: VERR_VBGL_NOT_INITIALIZED;
     83    rc = g_vbgldata.status == VbglStatusReady? VINF_SUCCESS: VERR_VBGL_NOT_INITIALIZED;
    8084   
    8185    // dprintf(("VbglEnter: rc = %d\n", rc));
     
    171175    if (VBOX_SUCCESS(rc))
    172176    {
    173         /* Obtain VMMDev port via IOCTL to VBoxGuest main driver. */
    174         rc = vbglQueryVMMDevPort ();
     177        /* Try to obtain VMMDev port via IOCTL to VBoxGuest main driver. */
     178        vbglQueryVMMDevPort ();
    175179
    176180#ifdef VBOX_HGCM
    177         if (VBOX_SUCCESS(rc))
    178         {
    179             rc = vbglHGCMInit ();
    180         }
    181 #endif
     181        rc = vbglHGCMInit ();
     182#endif /* VBOX_HGCM */
    182183
    183184        if (VBOX_FAILURE(rc))
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette