VirtualBox

Changeset 69812 in vbox


Ignore:
Timestamp:
Nov 23, 2017 3:20:33 PM (7 years ago)
Author:
vboxsync
Message:

VBoxGuest-netbsd.c: paste here a copy of VBoxGuestIDC() as now required.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-netbsd.c

    r69500 r69812  
    599599}
    600600
    601 /* Common code that depend on g_DevExt. */
    602 #include "VBoxGuestIDC-unix.c.h"
     601/**
     602 * @note This code is duplicated on other platforms with variations, so please
     603 *       keep them all up to date when making changes!
     604 */
     605int VBOXCALL VBoxGuestIDC(void *pvSession, uintptr_t uReq, PVBGLREQHDR pReqHdr, size_t cbReq)
     606{
     607    /*
     608     * Simple request validation (common code does the rest).
     609     */
     610    int rc;
     611    if (   RT_VALID_PTR(pReqHdr)
     612        && cbReq >= sizeof(*pReqHdr))
     613    {
     614        /*
     615         * All requests except the connect one requires a valid session.
     616         */
     617        PVBOXGUESTSESSION pSession = (PVBOXGUESTSESSION)pvSession;
     618        if (pSession)
     619        {
     620            if (   RT_VALID_PTR(pSession)
     621                && pSession->pDevExt == &g_DevExt)
     622                rc = VGDrvCommonIoCtl(uReq, &g_DevExt, pSession, pReqHdr, cbReq);
     623            else
     624                rc = VERR_INVALID_HANDLE;
     625        }
     626        else if (uReq == VBGL_IOCTL_IDC_CONNECT)
     627        {
     628            rc = VGDrvCommonCreateKernelSession(&g_DevExt, &pSession);
     629            if (RT_SUCCESS(rc))
     630            {
     631                rc = VGDrvCommonIoCtl(uReq, &g_DevExt, pSession, pReqHdr, cbReq);
     632                if (RT_FAILURE(rc))
     633                    VGDrvCommonCloseSession(&g_DevExt, pSession);
     634            }
     635        }
     636        else
     637            rc = VERR_INVALID_HANDLE;
     638    }
     639    else
     640        rc = VERR_INVALID_POINTER;
     641    return rc;
     642}
    603643
    604644CFATTACH_DECL_NEW(vboxguest, sizeof(vboxguest_softc),
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