VirtualBox

Ignore:
Timestamp:
Apr 2, 2009 2:26:00 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
45560
Message:

Guest Additions/common: Update.

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

Legend:

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

    r18639 r18640  
    4848/** The default service interval (the -i | --interval) option). */
    4949uint32_t g_DefaultInterval = 0;
    50 /** Shutdown the main thread. (later, for signals) */
     50/** Shutdown the main thread. (later, for signals). */
    5151bool volatile g_fShutdown;
    5252
     
    242242int main(int argc, char **argv)
    243243{
    244     int rc;
     244    int rc = 0;
     245
     246#if defined(RT_OS_WINDOWS)
     247    /* Do not use a global namespace ("Global\\") for mutex name here, will blow up NT4 compatibility! */
     248    HANDLE hMutexAppRunning = CreateMutex (NULL, FALSE, VBOXSERVICE_NAME);
     249    if (   (hMutexAppRunning != NULL)
     250        && (GetLastError() == ERROR_ALREADY_EXISTS))
     251    {
     252        VBoxServiceError("%s is already running! Terminating.", g_pszProgName);
     253
     254        /* Close the mutex for this application instance. */
     255        CloseHandle(hMutexAppRunning);
     256        hMutexAppRunning = NULL;
     257    }
     258#endif
    245259
    246260    /*
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceInternal.h

    r18639 r18640  
    2222#ifndef ___VBoxServiceInternal_h
    2323#define ___VBoxServiceInternal_h
     24
     25#if defined(RT_OS_WINDOWS)
     26    #include <windows.h>
     27    #include <tchar.h>
     28    #include <process.h>
     29#endif
    2430
    2531/** Name of this program. */
     
    115121extern VBOXSERVICE g_Control;
    116122
     123/** Windows SCM stuff. */
     124#if defined(RT_OS_WINDOWS)
     125    extern DWORD                 g_vboxServiceStatusCode;
     126    extern SERVICE_STATUS_HANDLE g_vboxServiceStatusHandle;
     127#endif
     128
    117129__END_DECLS
    118130
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