VirtualBox

Changeset 32266 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Sep 7, 2010 9:23:05 AM (14 years ago)
Author:
vboxsync
Message:

Guest Additions/Windows: First working version of unified driver (no NT4 yet).

Location:
trunk/src/VBox/Additions/common/VBoxGuest
Files:
10 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuest/Makefile.kmk

    r32183 r32266  
    2020
    2121
    22 if1of ($(KBUILD_TARGET), freebsd $(if $(defined VBOX_WITH_ADDITION_DRIVERS),linux,) os2 solaris)
     22if1of ($(KBUILD_TARGET), freebsd $(if $(defined VBOX_WITH_ADDITION_DRIVERS),linux,) os2 solaris win)
    2323 #
    2424 # VBoxGuest - The Guest Additions Driver.
     
    3131 VBoxGuest_NOINST.linux  = true
    3232 VBoxGuest_DEFS.linux    = KBUILD_MODNAME=KBUILD_STR\(vboxguest\) KBUILD_BASENAME=KBUILD_STR\(vboxguest\) DEBUG_HASH=2 DEBUG_HASH2=3 EXPORT_SYMTAB
     33 VBoxGuest_DEFS.win      = VBOX_REBOOT_ON_UNINSTALL VBOX_SVN_REV=$(VBOX_SVN_REV) # VBOX_WITH_VRDP_SESSION_HANDLING
     34ifdef VBOX_SIGN_ADDITIONS # (See the parent makefile.)
     35 VBoxGuest_NOINST        = true
     36endif
     37ifdef VBOX_WITH_GUEST_BUGCHECK_DETECTION
     38 VBoxGuest_DEFS.win     += VBOX_WITH_GUEST_BUGCHECK_DETECTION
     39endif
    3340 VBoxGuest_DEFS.solaris  = VBOX_SVN_REV=$(VBOX_SVN_REV)
    3441 VBoxGuest_DEPS.solaris += $(VBOX_SVN_REV_KMK)
     
    4047 VBoxGuest_INCS.linux    = ../../../Runtime/r0drv/linux
    4148 ifneq ($(KBUILD_TARGET),os2)
    42   ifn1of ($(KBUILD_TARGET), linux freebsd solaris)
    43    VBoxGuest_SOURCES     = VBoxGuest-$(KBUILD_TARGET).cpp
    44   else
    45    VBoxGuest_SOURCES     = VBoxGuest-$(KBUILD_TARGET).c
    46   endif
    47   VBoxGuest_SOURCES     += \
    48         VBoxGuest.cpp \
    49         VBoxGuest2.cpp
    50   VBoxGuest2.cpp_DEFS    = VBOX_SVN_REV=$(VBOX_SVN_REV)
    51   VBoxGuest_LIBS         = \
     49  ifeq ($(KBUILD_TARGET),win)
     50   VBoxGuest_SOURCES     = \
     51        VBoxGuest-$(KBUILD_TARGET).cpp \
     52        VBoxGuest-$(KBUILD_TARGET)-pnp.cpp \
     53        win/VBoxGuest.rc
     54   VBoxGuest_LDFLAGS.x86   = -Entry:DriverEntry@8
     55   VBoxGuest_LDFLAGS.amd64 = -Entry:DriverEntry
     56   VBoxGuest_LIBS          = \
     57                $(PATH_SDK_W2K3DDK_LIB)/ntoskrnl.lib \
     58                $(PATH_SDK_W2K3DDK_LIB)/hal.lib
     59   ifdef VBOX_WITH_GUEST_BUGCHECK_DETECTION
     60    VBoxGuest_LIBS += \
     61                $(PATH_SDK_WINDDKWLH_LIB)/aux_klib.lib \
     62                $(PATH_SDK_WINDDKWLH_LIB)/ksecdd.lib \
     63                $(PATH_SDK_WINDDKWLH_LIB)/BufferOverflowK.lib
     64    VBoxGuest.cpp_SDKS = WINDDKWLH
     65   endif # VBOX_WITH_GUEST_BUGCHECK_DETECTION
     66
     67   #SYSMODS.x86 += VBoxGuestNT # Not yet buildable!
     68   VBoxGuestNT_EXTENDS   = VBoxGuest
     69   VBoxGuestNT_NOINST    = $(NO_SUCH_VARIABLE)
     70   VBoxGuestNT_DEFS      = $(VBoxGuest_DEFS) TARGET_NT4
     71   VBoxGuestNT_SOURCES   = \
     72                VBoxGuest-$(KBUILD_TARGET).cpp \
     73                VBoxGuest-$(KBUILD_TARGET)-legacy.cpp \
     74                win/VBoxGuest.rc
     75   VBoxGuestNT_LIBS      = \
     76                $(PATH_SDK_W2K3DDK_LIB)/exsup.lib \
     77                $(PATH_SDK_W2K3DDK_LIB)/ntoskrnl.lib \
     78                $(PATH_SDK_W2K3DDK_LIB)/hal.lib \
     79                $(VBOX_LIB_VBGL_R0BASE) \
     80                $(VBOX_LIB_IPRT_GUEST_R0_NT4)
     81  else # not Windows
     82   ifn1of ($(KBUILD_TARGET), linux freebsd solaris)
     83    VBoxGuest_SOURCES     = VBoxGuest-$(KBUILD_TARGET).cpp
     84   else
     85    VBoxGuest_SOURCES     = VBoxGuest-$(KBUILD_TARGET).c
     86   endif
     87  endif # win
     88  VBoxGuest_SOURCES      += \
     89        VBoxGuest.cpp \
     90        VBoxGuest2.cpp
     91  VBoxGuest2.cpp_DEFS     = VBOX_SVN_REV=$(VBOX_SVN_REV)
     92  VBoxGuest.cpp_DEFS      = VBOX_SVN_REV=$(VBOX_SVN_REV)
     93  VBoxGuest_LIBS         += \
    5294        $(VBOX_LIB_VBGL_R0BASE) \
    5395        $(VBOX_LIB_IPRT_GUEST_R0)
     
    5698        $(PATH_INS)/gen-sys-hdrs/bus_if.h \
    5799        $(PATH_INS)/gen-sys-hdrs/device_if.h
    58 
    59100 else # OS/2:
    60101  # The library order is crucial, so a bit of trickery is necessary.
     
    163204endif # FreeBSD
    164205
     206ifeq ($(KBUILD_TARGET),win)
     207#
     208# VBoxGuestInst - The installer.
     209#
     210#PROGRAMS += VBoxGuestInst
     211VBoxGuestInst_TEMPLATE= VBOXGUESTR3EXE
     212VBoxGuestInst_SOURCES = win/VBoxGuestInst.cpp
     213endif
     214
    165215include $(KBUILD_PATH)/subfooter.kmk
    166216
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c

    • Property svn:keywords changed from Id to Author Date Id Revision
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-solaris.c

    • Property svn:keywords changed from Id to Author Date Id Revision
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-solaris.conf

    • Property svn:eol-style changed from LF to native
    • Property svn:keywords set to Author Date Id Revision
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp

    • Property svn:keywords changed from Id to Author Date Id Revision
    r31752 r32266  
    4040#if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD)
    4141# include "revision-generated.h"
     42#endif
     43#if defined(RT_OS_WINDOWS)
     44RT_C_DECLS_BEGIN
     45# include <ntddk.h>
     46RT_C_DECLS_END
    4247#endif
    4348
     
    15731578
    15741579
     1580/**
     1581 * Helper to (re-)init the HGCM communication.
     1582 *
     1583 * @param pDevExt   Device extension
     1584 */
     1585int VBoxGuestHGCMInitCommunication(PVBOXGUESTDEVEXT pDevExt, VBOXOSTYPE enmOSType)
     1586{
     1587    int rc = VBoxGuestReportGuestInfo(enmOSType);
     1588    if (RT_SUCCESS(rc))
     1589    {
     1590        rc = VBoxGuestReportDriverStatus(true /* Driver is active */);
     1591        if (RT_FAILURE(rc))
     1592            Log(("VBoxGuest::VBoxGuestInitHGCMCommunication: could not report guest driver status, vrc = %d\n", rc));
     1593    }
     1594    else
     1595        Log(("VBoxGuest::VBoxGuestInitHGCMCommunication: could not report guest information to host, vrc = %d\n", rc));
     1596    Log(("VBoxGuest::VBoxGuestInitHGCMCommunication: returned with vrc = %d\n", rc));
     1597    return rc;
     1598}
     1599
     1600
    15751601static int VBoxGuestCommonIOCtl_HGCMConnect(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession,
    15761602                                            VBoxGuestHGCMConnectInfo *pInfo, size_t *pcbDataReturned)
     
    19491975        if (pDevExt->MemBalloon.pOwner == pSession)
    19501976        {
    1951             rc = vboxGuestSetBalloonSizeFromUser(pDevExt, pSession, pInfo->u64ChunkAddr, pInfo->fInflate);
     1977            rc = vboxGuestSetBalloonSizeFromUser(pDevExt, pSession,
     1978                                                 pInfo->u64ChunkAddr,
     1979                                                 pInfo->fInflate > 0 ? true : false);
    19521980            if (pcbDataReturned)
    19531981                *pcbDataReturned = 0;
     
    19621990    return rc;
    19631991}
     1992
     1993
     1994#ifdef VBOX_WITH_VRDP_SESSION_HANDLING
     1995/**
     1996 * Enables the VRDP session and saves its session ID.
     1997 *
     1998 * @returns VBox status code.
     1999 *
     2000 * @param   pDevExt             The device extention.
     2001 * @param   pSession            The session.
     2002 */
     2003static int VBoxGuestCommonIOCtl_EnableVRDPSession(VBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession)
     2004{
     2005    /* Nothing to do here right now, since this only is supported on Windows at the moment. */
     2006    return VINF_SUCCESS;
     2007}
     2008
     2009
     2010/**
     2011 * Disables the VRDP session.
     2012 *
     2013 * @returns VBox status code.
     2014 *
     2015 * @param   pDevExt             The device extention.
     2016 * @param   pSession            The session.
     2017 */
     2018static int VBoxGuestCommonIOCtl_DisableVRDPSession(VBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession)
     2019{
     2020    /* Nothing to do here right now, since this only is supported on Windows at the moment. */
     2021    return VINF_SUCCESS;
     2022}
     2023#endif /* VBOX_WITH_VRDP_SESSION_HANDLING */
    19642024
    19652025
     
    21552215                break;
    21562216
     2217#ifdef VBOX_WITH_VRDP_SESSION_HANDLING
     2218            case VBOXGUEST_IOCTL_ENABLE_VRDP_SESSION:
     2219                rc = VBoxGuestCommonIOCtl_EnableVRDPSession(pDevExt, pSession);
     2220                break;
     2221
     2222            case VBOXGUEST_IOCTL_DISABLE_VRDP_SESSION:
     2223                rc = VBoxGuestCommonIOCtl_DisableVRDPSession(pDevExt, pSession);
     2224                break;
     2225#endif /* VBOX_WITH_VRDP_SESSION_HANDLING */
     2226
    21572227            default:
    21582228            {
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuestInternal.h

    • Property svn:keywords changed from Id to Author Date Id Revision
    r28800 r32266  
    55
    66/*
    7  * Copyright (C) 2007 Oracle Corporation
     7 * Copyright (C) 2010 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    143143     * For implementing the VBOXGUEST_IOCTL_CLIPBOARD_CONNECT interface. */
    144144    uint32_t                    u32ClipboardClientId;
    145 
     145#ifdef VBOX_WITH_VRDP_SESSION_HANDLING
     146    BOOL                        fVRDPEnabled;
     147#endif
    146148    /** Memory balloon information for RTR0MemObjAllocPhysNC(). */
    147149    VBOXGUESTMEMBALLOON         MemBalloon;
     150    /** Align the next bit on a 64-byte boundary and make sure it starts at the same
     151     *  offset in both 64-bit and 32-bit builds.
     152     *
     153     * @remarks The aligments of the members that are larger than 48 bytes should be
     154     *          64-byte for cache line reasons. structs containing small amounts of
     155     *          data could be lumped together at the end with a < 64 byte padding
     156     *          following it (to grow into and align the struct size).
     157     */
     158    uint8_t abAlignment1[HC_ARCH_BITS == 32 ? 24 : 4];
     159
     160    /** Windows part. */
     161    union
     162    {
     163#ifdef ___VBoxGuest_win_h
     164        VBOXGUESTDEVEXTWIN          s;
     165#endif
     166        uint8_t                     padding[256];      /* Multiple of 64; fix me! */
     167    } win;
    148168
    149169} VBOXGUESTDEVEXT;
     
    201221void VBoxGuestCloseSession(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession);
    202222
     223#ifdef VBOX_WITH_HGCM
     224int  VBoxGuestHGCMInitCommunication(PVBOXGUESTDEVEXT pDevExt, VBOXOSTYPE enmOSType);
     225#endif
     226
    203227int  VBoxGuestCommonIOCtlFast(unsigned iFunction, PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession);
    204228int  VBoxGuestCommonIOCtl(unsigned iFunction, PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession,
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