VirtualBox

Changeset 21246 in vbox for trunk/src/VBox/Additions/common


Ignore:
Timestamp:
Jul 6, 2009 11:24:43 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
49569
Message:

VBoxService/common: Now works with NT4 as well.

Location:
trunk/src/VBox/Additions/common/VBoxService
Files:
4 edited

Legend:

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

    r19644 r21246  
    2727endif
    2828
     29# Build special VBoxService version for NT4.
     30ifeq ($(KBUILD_TARGET), win)
     31 PROGRAMS.x86 += VBoxServiceNT
     32endif
     33
    2934#
    30 # VBoxService.exe
     35# VBoxService
    3136#
    3237VBoxService_TEMPLATE      = VBOXGUESTR3EXE
     
    6671endif
    6772
     73#
     74# VBoxServiceNT - NT version of VBoxService (x86 only).
     75#
     76VBoxServiceNT_TEMPLATE    = VBOXGUESTR3EXE
     77VBoxServiceNT_DEFS        = VBOXSERVICE_TIMESYNC
     78VBoxServiceNT_DEFS       += _WIN32_WINNT=0x0400 _UNICODE UNICODE TARGET_NT4
     79ifdef VBOX_WITH_GUEST_PROPS
     80 VBoxServiceNT_DEFS      += VBOX_WITH_GUEST_PROPS VBOXSERVICE_VMINFO
     81endif
     82VBoxServiceNT_SOURCES       = \
     83        VBoxService.cpp \
     84        VBoxServiceTimeSync.cpp \
     85        VBoxServiceUtils.cpp \
     86        VBoxService-win.rc \
     87        VBoxService-win.cpp
     88ifdef VBOX_WITH_GUEST_PROPS
     89 VBoxServiceNT_SOURCES     += \
     90        VBoxServiceVMInfo.cpp \
     91        VBoxServiceVMInfo-win.cpp
     92endif
     93VBoxServiceNT_LIBS          = \
     94        $(VBOX_LIB_IPRT_GUEST_R3) \
     95        $(VBOX_LIB_VBGL_R3) \
     96        $(VBOX_LIB_IPRT_GUEST_R3)
     97
    6898# The icon is configurable.
    6999VBoxService-win.rc_INCS = $(PATH_VBoxService)
  • trunk/src/VBox/Additions/common/VBoxService/VBoxService-win.cpp

    r21230 r21246  
    262262}
    263263
     264#ifdef TARGET_NT4
     265VOID WINAPI VBoxServiceWinCtrlHandler (DWORD dwControl)
     266#else
    264267DWORD WINAPI VBoxServiceWinCtrlHandler (DWORD dwControl,
    265268                                        DWORD dwEventType,
    266269                                        LPVOID lpEventData,
    267270                                        LPVOID lpContext)
     271#endif
    268272{
    269273    DWORD rc = NO_ERROR;
    270274
    271     VBoxServiceVerbose(2, "Control handler: Control=%ld, EventType=%ld\n", dwControl, dwEventType);
     275    VBoxServiceVerbose(2, "Control handler: Control=%ld\n", dwControl);
     276#ifndef TARGET_NT4
     277    VBoxServiceVerbose(2, "Control handler: EventType=%ld\n", dwEventType);
     278#endif
     279
    272280    switch (dwControl)
    273281    {
     
    290298    case SERVICE_CONTROL_SESSIONCHANGE:     /* Only Win XP and up. */
    291299
     300#ifndef TARGET_NT4
    292301        switch (dwEventType)
    293302        {
    294 
    295303        /*case WTS_SESSION_LOGON:
    296304            VBoxServiceVerbose(2, "A user has logged on to the session.\n");
     
    300308            VBoxServiceVerbose(2, "A user has logged off from the session.\n");
    301309            break;*/
    302 
    303310        default:
    304311            break;
    305312        }
     313#endif /* TARGET_NT4 */
    306314        break;
    307315
     
    312320        break;
    313321    }
     322
     323#ifndef TARGET_NT4
    314324    return rc;
     325#endif
    315326}
    316327
     
    320331
    321332    VBoxServiceVerbose(2, "Registering service control handler ...\n");
     333#ifdef TARGET_NT4
     334    g_hWinServiceStatus = RegisterServiceCtrlHandler (VBOXSERVICE_NAME, VBoxServiceWinCtrlHandler);
     335#else
    322336    g_hWinServiceStatus = RegisterServiceCtrlHandlerEx (VBOXSERVICE_NAME, VBoxServiceWinCtrlHandler, NULL);
     337#endif
    323338
    324339    if (NULL == g_hWinServiceStatus)
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo-win.cpp

    r21227 r21246  
    4444*   Global Variables                                                           *
    4545*******************************************************************************/
    46 /** Function prototypes for dynamic loading. */
    47 extern fnWTSGetActiveConsoleSessionId g_pfnWTSGetActiveConsoleSessionId;
    48 /** The vminfo interval (millseconds). */
    49 uint32_t g_VMInfoLoggedInUsersCount = 0;
    50 
    51 
     46#ifndef TARGET_NT4
     47 /** Function prototypes for dynamic loading. */
     48 extern fnWTSGetActiveConsoleSessionId g_pfnWTSGetActiveConsoleSessionId;
     49 /** The vminfo interval (millseconds). */
     50 uint32_t g_VMInfoLoggedInUsersCount = 0;
     51#endif
     52
     53
     54#ifndef TARGET_NT4
    5255/* Function GetLUIDsFromProcesses() written by Stefan Kuhr. */
    5356DWORD VboxServiceVMInfoWinGetLUIDsFromProcesses(PLUID *ppLuid)
     
    325328}
    326329
     330#endif /* TARGET_NT4 */
     331
    327332int VboxServiceWinGetAddsVersion(uint32_t uiClientID)
    328333{
     
    336341    DWORD dwType = 0;
    337342
     343    VBoxServiceVerbose(3, "Guest Additions version lookup: Looking up ...\n");
     344
    338345    /* Check the new path first. */
    339346    rc = RegOpenKeyExA (HKEY_LOCAL_MACHINE, "SOFTWARE\\Sun\\VirtualBox Guest Additions", 0, KEY_READ, &hKey);
    340     if ((rc != ERROR_SUCCESS) && (rc != ERROR_FILE_NOT_FOUND))
    341     {
     347    if (rc != ERROR_SUCCESS)
     348    {
     349        VBoxServiceVerbose(3, "Guest Additions version lookup: Looking in xVM key ...\n");
     350
    342351        /* New path does not exist, check the old one ... */
    343352        rc = RegOpenKeyExA (HKEY_LOCAL_MACHINE, "SOFTWARE\\Sun\\xVM VirtualBox Guest Additions", 0, KEY_READ, &hKey);
    344         if ((rc != ERROR_SUCCESS) && (rc != ERROR_FILE_NOT_FOUND))
     353        if (rc != ERROR_SUCCESS)
    345354        {
    346355            /* Nothing seems to exist, print some warning. */
     
    349358        }
    350359    }
     360
     361    VBoxServiceVerbose(3, "Guest Additions version lookup: Key: 0x%p, RC: %d\n", hKey, rc);
    351362
    352363    /* Installation directory. */
     
    409420
    410421    /* The file information table. */
     422#ifndef TARGET_NT4
    411423    VBOXSERVICEVMINFOFILE vboxFileInfoTable[] =
    412424    {
     
    436448        }
    437449    };
     450#else /* File lookup for NT4. */
     451    VBOXSERVICEVMINFOFILE vboxFileInfoTable[] =
     452    {
     453        { szSysDir, TEXT("VBoxControl.exe"), },
     454        { szSysDir, TEXT("VBoxHook.dll"), },
     455        { szSysDir, TEXT("VBoxDisp.dll"), },
     456        { szSysDir, TEXT("VBoxService.exe"), },
     457        { szSysDir, TEXT("VBoxTray.exe"), },
     458
     459        { szDriversDir, TEXT("VBoxGuestNT.sys"), },
     460        { szDriversDir, TEXT("VBoxMouseNT.sys"), },
     461        { szDriversDir, TEXT("VBoxVideo.sys"), },
     462
     463        {
     464            NULL
     465        }
     466    };
     467#endif
    438468
    439469    PVBOXSERVICEVMINFOFILE pTable = vboxFileInfoTable;
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp

    r21218 r21246  
    186186
    187187#ifdef RT_OS_WINDOWS
     188 #ifndef TARGET_NT4
    188189        PLUID pSessions = NULL;
    189190        ULONG ulCount = 0;
     
    228229
    229230        ::LsaFreeReturnBuffer(pSessions);
     231 #endif /* TARGET_NT4 */   
    230232#else
    231233        utmp* ut_user;
Note: See TracChangeset for help on using the changeset viewer.

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