VBoxServiceInternal.h revision 348188d7b4dbc0e8fccd10c903eba81e068dfe87
083dd76e9fd7a829b1ed67ffc9003276643e7db1vboxsync/* $Id$ */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync/** @file
083dd76e9fd7a829b1ed67ffc9003276643e7db1vboxsync * VBoxService - Guest Additions Services.
85c594c1140f082dd862abde9dc7825137a3d51avboxsync */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync
85c594c1140f082dd862abde9dc7825137a3d51avboxsync/*
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync * Copyright (C) 2007-2011 Oracle Corporation
85c594c1140f082dd862abde9dc7825137a3d51avboxsync *
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * available from http://www.virtualbox.org. This file is free software;
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * you can redistribute it and/or modify it under the terms of the GNU
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * General Public License (GPL) as published by the Free Software
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync */
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync#ifndef ___VBoxServiceInternal_h
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync#define ___VBoxServiceInternal_h
85c594c1140f082dd862abde9dc7825137a3d51avboxsync
85c594c1140f082dd862abde9dc7825137a3d51avboxsync#include <stdio.h>
85c594c1140f082dd862abde9dc7825137a3d51avboxsync#ifdef RT_OS_WINDOWS
85c594c1140f082dd862abde9dc7825137a3d51avboxsync# include <Windows.h>
85c594c1140f082dd862abde9dc7825137a3d51avboxsync# include <process.h> /* Needed for file version information. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync#endif
85c594c1140f082dd862abde9dc7825137a3d51avboxsync
85c594c1140f082dd862abde9dc7825137a3d51avboxsync#include <iprt/list.h>
85c594c1140f082dd862abde9dc7825137a3d51avboxsync#include <iprt/critsect.h>
85c594c1140f082dd862abde9dc7825137a3d51avboxsync
b29e03c9044019d9c77222336e8f8616052824f5vboxsync#include <VBox/VBoxGuestLib.h>
87b2fb3f8283472ba7010aedbf2b4dc12302155cvboxsync
87b2fb3f8283472ba7010aedbf2b4dc12302155cvboxsync/**
11a862be79fe123488bccca60c06e92cdbfec6e8vboxsync * A service descriptor.
87b2fb3f8283472ba7010aedbf2b4dc12302155cvboxsync */
e38719852d98638514dba23fbacf53ad11361d6avboxsynctypedef struct
85c594c1140f082dd862abde9dc7825137a3d51avboxsync{
85c594c1140f082dd862abde9dc7825137a3d51avboxsync /** The short service name. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync const char *pszName;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync /** The longer service name. */
463d00559e51c6e08ccc9f5a77d2ee6d122b6e8cvboxsync const char *pszDescription;
463d00559e51c6e08ccc9f5a77d2ee6d122b6e8cvboxsync /** The usage options stuff for the --help screen. */
463d00559e51c6e08ccc9f5a77d2ee6d122b6e8cvboxsync const char *pszUsage;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync /** The option descriptions for the --help screen. */
3598f07e0e71a448a04d478320a9ca6314160ff6vboxsync const char *pszOptions;
083dd76e9fd7a829b1ed67ffc9003276643e7db1vboxsync
85c594c1140f082dd862abde9dc7825137a3d51avboxsync /**
463d00559e51c6e08ccc9f5a77d2ee6d122b6e8cvboxsync * Called before parsing arguments.
463d00559e51c6e08ccc9f5a77d2ee6d122b6e8cvboxsync * @returns VBox status code.
463d00559e51c6e08ccc9f5a77d2ee6d122b6e8cvboxsync */
463d00559e51c6e08ccc9f5a77d2ee6d122b6e8cvboxsync DECLCALLBACKMEMBER(int, pfnPreInit)(void);
463d00559e51c6e08ccc9f5a77d2ee6d122b6e8cvboxsync
8ab60c04baaf509b2aaae2a260adaf1281aaac03vboxsync /**
8ab60c04baaf509b2aaae2a260adaf1281aaac03vboxsync * Tries to parse the given command line option.
8ab60c04baaf509b2aaae2a260adaf1281aaac03vboxsync *
463d00559e51c6e08ccc9f5a77d2ee6d122b6e8cvboxsync * @returns 0 if we parsed, -1 if it didn't and anything else means exit.
6edb4183bc898fddcd0987b6c5c3903b8246fe45vboxsync * @param ppszShort If not NULL it points to the short option iterator. a short argument.
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * If NULL examine argv[*pi].
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * @param argc The argument count.
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * @param argv The argument vector.
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * @param pi The argument vector index. Update if any value(s) are eaten.
34822e8b7d00c04a0bc98c0d1a565a00d9bb1fd9vboxsync */
34822e8b7d00c04a0bc98c0d1a565a00d9bb1fd9vboxsync DECLCALLBACKMEMBER(int, pfnOption)(const char **ppszShort, int argc, char **argv, int *pi);
34822e8b7d00c04a0bc98c0d1a565a00d9bb1fd9vboxsync
85c594c1140f082dd862abde9dc7825137a3d51avboxsync /**
34822e8b7d00c04a0bc98c0d1a565a00d9bb1fd9vboxsync * Called before parsing arguments.
507ebf9b3b77c84000a55645867db6617b5324bcvboxsync * @returns VBox status code.
34822e8b7d00c04a0bc98c0d1a565a00d9bb1fd9vboxsync */
34822e8b7d00c04a0bc98c0d1a565a00d9bb1fd9vboxsync DECLCALLBACKMEMBER(int, pfnInit)(void);
34822e8b7d00c04a0bc98c0d1a565a00d9bb1fd9vboxsync
34822e8b7d00c04a0bc98c0d1a565a00d9bb1fd9vboxsync /** Called from the worker thread.
507ebf9b3b77c84000a55645867db6617b5324bcvboxsync *
507ebf9b3b77c84000a55645867db6617b5324bcvboxsync * @returns VBox status code.
4ad933b349952e43d0b6ce21b3f5e2833ca04e85vboxsync * @retval VINF_SUCCESS if exitting because *pfTerminate was set.
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * @param pfTerminate Pointer to a per service termination flag to check
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * before and after blocking.
34822e8b7d00c04a0bc98c0d1a565a00d9bb1fd9vboxsync */
507ebf9b3b77c84000a55645867db6617b5324bcvboxsync DECLCALLBACKMEMBER(int, pfnWorker)(bool volatile *pfTerminate);
34822e8b7d00c04a0bc98c0d1a565a00d9bb1fd9vboxsync
507ebf9b3b77c84000a55645867db6617b5324bcvboxsync /**
507ebf9b3b77c84000a55645867db6617b5324bcvboxsync * Stop an service.
34822e8b7d00c04a0bc98c0d1a565a00d9bb1fd9vboxsync */
98da2c2cca8786e117ad93a31c6b2c6c1c3cdc78vboxsync DECLCALLBACKMEMBER(void, pfnStop)(void);
507ebf9b3b77c84000a55645867db6617b5324bcvboxsync
507ebf9b3b77c84000a55645867db6617b5324bcvboxsync /**
507ebf9b3b77c84000a55645867db6617b5324bcvboxsync * Does termination cleanups.
507ebf9b3b77c84000a55645867db6617b5324bcvboxsync *
507ebf9b3b77c84000a55645867db6617b5324bcvboxsync * @remarks This may be called even if pfnInit hasn't been called!
507ebf9b3b77c84000a55645867db6617b5324bcvboxsync */
507ebf9b3b77c84000a55645867db6617b5324bcvboxsync DECLCALLBACKMEMBER(void, pfnTerm)(void);
507ebf9b3b77c84000a55645867db6617b5324bcvboxsync} VBOXSERVICE;
98da2c2cca8786e117ad93a31c6b2c6c1c3cdc78vboxsync/** Pointer to a VBOXSERVICE. */
34822e8b7d00c04a0bc98c0d1a565a00d9bb1fd9vboxsynctypedef VBOXSERVICE *PVBOXSERVICE;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync/** Pointer to a const VBOXSERVICE. */
34822e8b7d00c04a0bc98c0d1a565a00d9bb1fd9vboxsynctypedef VBOXSERVICE const *PCVBOXSERVICE;
507ebf9b3b77c84000a55645867db6617b5324bcvboxsync
507ebf9b3b77c84000a55645867db6617b5324bcvboxsync/** The service name.
507ebf9b3b77c84000a55645867db6617b5324bcvboxsync * @note Used on windows to name the service as well as the global mutex. */
507ebf9b3b77c84000a55645867db6617b5324bcvboxsync#define VBOXSERVICE_NAME "VBoxService"
98da2c2cca8786e117ad93a31c6b2c6c1c3cdc78vboxsync
34822e8b7d00c04a0bc98c0d1a565a00d9bb1fd9vboxsync#ifdef RT_OS_WINDOWS
85c594c1140f082dd862abde9dc7825137a3d51avboxsync/** The friendly service name. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync# define VBOXSERVICE_FRIENDLY_NAME "VirtualBox Guest Additions Service"
85c594c1140f082dd862abde9dc7825137a3d51avboxsync/** The service description (only W2K+ atm) */
e38719852d98638514dba23fbacf53ad11361d6avboxsync# define VBOXSERVICE_DESCRIPTION "Manages VM runtime information, time synchronization, remote sysprep execution and miscellaneous utilities for guest operating systems."
e38719852d98638514dba23fbacf53ad11361d6avboxsync/** The following constant may be defined by including NtStatus.h. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync# define STATUS_SUCCESS ((NTSTATUS)0x00000000L)
85c594c1140f082dd862abde9dc7825137a3d51avboxsync#endif /* RT_OS_WINDOWS */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync
85c594c1140f082dd862abde9dc7825137a3d51avboxsync#ifdef VBOX_WITH_GUEST_CONTROL
85c594c1140f082dd862abde9dc7825137a3d51avboxsynctypedef enum VBOXSERVICECTRLTHREADDATATYPE
85c594c1140f082dd862abde9dc7825137a3d51avboxsync{
85c594c1140f082dd862abde9dc7825137a3d51avboxsync kVBoxServiceCtrlThreadDataUnknown = 0,
85c594c1140f082dd862abde9dc7825137a3d51avboxsync kVBoxServiceCtrlThreadDataExec
85c594c1140f082dd862abde9dc7825137a3d51avboxsync} VBOXSERVICECTRLTHREADDATATYPE;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync
85c594c1140f082dd862abde9dc7825137a3d51avboxsynctypedef enum VBOXSERVICECTRLPIPEID
85c594c1140f082dd862abde9dc7825137a3d51avboxsync{
85c594c1140f082dd862abde9dc7825137a3d51avboxsync VBOXSERVICECTRLPIPEID_STDIN_ERROR = 0,
85c594c1140f082dd862abde9dc7825137a3d51avboxsync VBOXSERVICECTRLPIPEID_STDIN_WRITABLE,
85c594c1140f082dd862abde9dc7825137a3d51avboxsync VBOXSERVICECTRLPIPEID_STDIN_INPUT_NOTIFY,
85c594c1140f082dd862abde9dc7825137a3d51avboxsync VBOXSERVICECTRLPIPEID_STDOUT,
85c594c1140f082dd862abde9dc7825137a3d51avboxsync VBOXSERVICECTRLPIPEID_STDERR
85c594c1140f082dd862abde9dc7825137a3d51avboxsync} VBOXSERVICECTRLPIPEID;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync
85c594c1140f082dd862abde9dc7825137a3d51avboxsync/**
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * Structure for holding buffered pipe data.
85c594c1140f082dd862abde9dc7825137a3d51avboxsync */
85c594c1140f082dd862abde9dc7825137a3d51avboxsynctypedef struct
85c594c1140f082dd862abde9dc7825137a3d51avboxsync{
85c594c1140f082dd862abde9dc7825137a3d51avboxsync /** The data buffer. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync uint8_t *pbData;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync /** The amount of allocated buffer space. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync uint32_t cbAllocated;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync /** The actual used/occupied buffer space. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync uint32_t cbSize;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync /** Helper variable for keeping track of what
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * already was processed and what not. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync uint32_t cbOffset;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync /** Critical section protecting this buffer structure. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync RTCRITSECT CritSect;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync /** Flag indicating whether this pipe buffer accepts new
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * data to be written to or not. If not enabled, already
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * (allocated) buffered data still can be read out. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync bool fEnabled;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync /** Set if it's necessary to write to the notification pipe. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync bool fNeedNotification;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync /** Set if the pipe needs to be closed after the next read/write. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync bool fPendingClose;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync /** The notification pipe associated with this buffer.
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * This is NIL_RTPIPE for output pipes. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync RTPIPE hNotificationPipeW;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync /** The other end of hNotificationPipeW. */
34822e8b7d00c04a0bc98c0d1a565a00d9bb1fd9vboxsync RTPIPE hNotificationPipeR;
463d00559e51c6e08ccc9f5a77d2ee6d122b6e8cvboxsync /** The event semaphore for getting notified whether something
507ebf9b3b77c84000a55645867db6617b5324bcvboxsync * has changed, e.g. written or read from this buffer. */
507ebf9b3b77c84000a55645867db6617b5324bcvboxsync RTSEMEVENT hEventSem;
34822e8b7d00c04a0bc98c0d1a565a00d9bb1fd9vboxsync} VBOXSERVICECTRLEXECPIPEBUF;
34822e8b7d00c04a0bc98c0d1a565a00d9bb1fd9vboxsync/** Pointer to buffered pipe data. */
6edb4183bc898fddcd0987b6c5c3903b8246fe45vboxsynctypedef VBOXSERVICECTRLEXECPIPEBUF *PVBOXSERVICECTRLEXECPIPEBUF;
6edb4183bc898fddcd0987b6c5c3903b8246fe45vboxsync
85c594c1140f082dd862abde9dc7825137a3d51avboxsync/**
6edb4183bc898fddcd0987b6c5c3903b8246fe45vboxsync * Structure for holding guest exection relevant data.
85c594c1140f082dd862abde9dc7825137a3d51avboxsync */
85c594c1140f082dd862abde9dc7825137a3d51avboxsynctypedef struct
85c594c1140f082dd862abde9dc7825137a3d51avboxsync{
85c594c1140f082dd862abde9dc7825137a3d51avboxsync uint32_t uPID;
e38719852d98638514dba23fbacf53ad11361d6avboxsync char *pszCmd;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync uint32_t uFlags;
3598f07e0e71a448a04d478320a9ca6314160ff6vboxsync char **papszArgs;
3598f07e0e71a448a04d478320a9ca6314160ff6vboxsync uint32_t uNumArgs;
3598f07e0e71a448a04d478320a9ca6314160ff6vboxsync char **papszEnv;
3598f07e0e71a448a04d478320a9ca6314160ff6vboxsync uint32_t uNumEnvVars;
3598f07e0e71a448a04d478320a9ca6314160ff6vboxsync char *pszUser;
3598f07e0e71a448a04d478320a9ca6314160ff6vboxsync char *pszPassword;
3598f07e0e71a448a04d478320a9ca6314160ff6vboxsync uint32_t uTimeLimitMS;
3598f07e0e71a448a04d478320a9ca6314160ff6vboxsync
3598f07e0e71a448a04d478320a9ca6314160ff6vboxsync RTPIPE pipeStdInW;
3598f07e0e71a448a04d478320a9ca6314160ff6vboxsync VBOXSERVICECTRLEXECPIPEBUF stdIn;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync VBOXSERVICECTRLEXECPIPEBUF stdOut;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync VBOXSERVICECTRLEXECPIPEBUF stdErr;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync
85c594c1140f082dd862abde9dc7825137a3d51avboxsync} VBOXSERVICECTRLTHREADDATAEXEC;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync/** Pointer to thread data. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsynctypedef VBOXSERVICECTRLTHREADDATAEXEC *PVBOXSERVICECTRLTHREADDATAEXEC;
34822e8b7d00c04a0bc98c0d1a565a00d9bb1fd9vboxsync
34822e8b7d00c04a0bc98c0d1a565a00d9bb1fd9vboxsync/* Structure for holding thread relevant data. */
34822e8b7d00c04a0bc98c0d1a565a00d9bb1fd9vboxsynctypedef struct VBOXSERVICECTRLTHREAD
34822e8b7d00c04a0bc98c0d1a565a00d9bb1fd9vboxsync{
507ebf9b3b77c84000a55645867db6617b5324bcvboxsync /** Node. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync RTLISTNODE Node;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync /** The worker thread. */
507ebf9b3b77c84000a55645867db6617b5324bcvboxsync RTTHREAD Thread;
507ebf9b3b77c84000a55645867db6617b5324bcvboxsync /** Shutdown indicator. */
34822e8b7d00c04a0bc98c0d1a565a00d9bb1fd9vboxsync bool volatile fShutdown;
34822e8b7d00c04a0bc98c0d1a565a00d9bb1fd9vboxsync /** Indicator set by the service thread exiting. */
34822e8b7d00c04a0bc98c0d1a565a00d9bb1fd9vboxsync bool volatile fStopped;
507ebf9b3b77c84000a55645867db6617b5324bcvboxsync /** Whether the service was started or not. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync bool fStarted;
34822e8b7d00c04a0bc98c0d1a565a00d9bb1fd9vboxsync /** Client ID. */
507ebf9b3b77c84000a55645867db6617b5324bcvboxsync uint32_t uClientID;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync /** Context ID. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync uint32_t uContextID;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync /** Type of thread. See VBOXSERVICECTRLTHREADDATATYPE for more info. */
507ebf9b3b77c84000a55645867db6617b5324bcvboxsync VBOXSERVICECTRLTHREADDATATYPE enmType;
34822e8b7d00c04a0bc98c0d1a565a00d9bb1fd9vboxsync /** Pointer to actual thread data, depending on enmType. */
463d00559e51c6e08ccc9f5a77d2ee6d122b6e8cvboxsync void *pvData;
34822e8b7d00c04a0bc98c0d1a565a00d9bb1fd9vboxsync} VBOXSERVICECTRLTHREAD;
507ebf9b3b77c84000a55645867db6617b5324bcvboxsync/** Pointer to thread data. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsynctypedef VBOXSERVICECTRLTHREAD *PVBOXSERVICECTRLTHREAD;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync#endif /* VBOX_WITH_GUEST_CONTROL */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync#ifdef VBOX_WITH_GUEST_PROPS
85c594c1140f082dd862abde9dc7825137a3d51avboxsync
85c594c1140f082dd862abde9dc7825137a3d51avboxsync/**
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * A guest property cache.
85c594c1140f082dd862abde9dc7825137a3d51avboxsync */
85c594c1140f082dd862abde9dc7825137a3d51avboxsynctypedef struct VBOXSERVICEVEPROPCACHE
85c594c1140f082dd862abde9dc7825137a3d51avboxsync{
e38719852d98638514dba23fbacf53ad11361d6avboxsync /** The client ID for HGCM communication. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync uint32_t uClientID;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync /** Head in a list of VBOXSERVICEVEPROPCACHEENTRY nodes. */
e38719852d98638514dba23fbacf53ad11361d6avboxsync RTLISTNODE NodeHead;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync /** Critical section for thread-safe use. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync RTCRITSECT CritSect;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync} VBOXSERVICEVEPROPCACHE;
e38719852d98638514dba23fbacf53ad11361d6avboxsync/** Pointer to a guest property cache. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsynctypedef VBOXSERVICEVEPROPCACHE *PVBOXSERVICEVEPROPCACHE;
e38719852d98638514dba23fbacf53ad11361d6avboxsync
85c594c1140f082dd862abde9dc7825137a3d51avboxsync/**
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * An entry in the property cache (VBOXSERVICEVEPROPCACHE).
0c1bdc5adae416967cb64e09f8ec81a5b77fe31dvboxsync */
85c594c1140f082dd862abde9dc7825137a3d51avboxsynctypedef struct VBOXSERVICEVEPROPCACHEENTRY
85c594c1140f082dd862abde9dc7825137a3d51avboxsync{
85c594c1140f082dd862abde9dc7825137a3d51avboxsync /** Node to successor.
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * @todo r=bird: This is not really the node to the successor, but
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * rather the OUR node in the list. If it helps, remember that
e38719852d98638514dba23fbacf53ad11361d6avboxsync * its a doubly linked list. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync RTLISTNODE NodeSucc;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync /** Name (and full path) of guest property. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync char *pszName;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync /** The last value stored (for reference). */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync char *pszValue;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync /** Reset value to write if property is temporary. If NULL, it will be
b29e03c9044019d9c77222336e8f8616052824f5vboxsync * deleted. */
1c8130d3c423590046a8ed4f3059de38ac5dcc14vboxsync char *pszValueReset;
1c8130d3c423590046a8ed4f3059de38ac5dcc14vboxsync /** Flags. */
1c8130d3c423590046a8ed4f3059de38ac5dcc14vboxsync uint32_t fFlags;
11a862be79fe123488bccca60c06e92cdbfec6e8vboxsync} VBOXSERVICEVEPROPCACHEENTRY;
1c8130d3c423590046a8ed4f3059de38ac5dcc14vboxsync/** Pointer to a cached guest property. */
507ebf9b3b77c84000a55645867db6617b5324bcvboxsynctypedef VBOXSERVICEVEPROPCACHEENTRY *PVBOXSERVICEVEPROPCACHEENTRY;
11a862be79fe123488bccca60c06e92cdbfec6e8vboxsync
1c8130d3c423590046a8ed4f3059de38ac5dcc14vboxsync#endif /* VBOX_WITH_GUEST_PROPS */
34822e8b7d00c04a0bc98c0d1a565a00d9bb1fd9vboxsync
1c8130d3c423590046a8ed4f3059de38ac5dcc14vboxsyncRT_C_DECLS_BEGIN
34822e8b7d00c04a0bc98c0d1a565a00d9bb1fd9vboxsync
34822e8b7d00c04a0bc98c0d1a565a00d9bb1fd9vboxsyncextern char *g_pszProgName;
34822e8b7d00c04a0bc98c0d1a565a00d9bb1fd9vboxsyncextern int g_cVerbosity;
1c8130d3c423590046a8ed4f3059de38ac5dcc14vboxsyncextern uint32_t g_DefaultInterval;
507ebf9b3b77c84000a55645867db6617b5324bcvboxsyncextern VBOXSERVICE g_TimeSync;
507ebf9b3b77c84000a55645867db6617b5324bcvboxsyncextern VBOXSERVICE g_Clipboard;
507ebf9b3b77c84000a55645867db6617b5324bcvboxsyncextern VBOXSERVICE g_Control;
463d00559e51c6e08ccc9f5a77d2ee6d122b6e8cvboxsyncextern VBOXSERVICE g_VMInfo;
34822e8b7d00c04a0bc98c0d1a565a00d9bb1fd9vboxsyncextern VBOXSERVICE g_CpuHotPlug;
463d00559e51c6e08ccc9f5a77d2ee6d122b6e8cvboxsync#ifdef VBOXSERVICE_MANAGEMENT
34822e8b7d00c04a0bc98c0d1a565a00d9bb1fd9vboxsyncextern VBOXSERVICE g_MemBalloon;
507ebf9b3b77c84000a55645867db6617b5324bcvboxsyncextern VBOXSERVICE g_VMStatistics;
507ebf9b3b77c84000a55645867db6617b5324bcvboxsync#endif
507ebf9b3b77c84000a55645867db6617b5324bcvboxsync#ifdef VBOX_WITH_PAGE_SHARING
507ebf9b3b77c84000a55645867db6617b5324bcvboxsyncextern VBOXSERVICE g_PageSharing;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync#endif
85c594c1140f082dd862abde9dc7825137a3d51avboxsync#ifdef VBOX_WITH_SHARED_FOLDERS
85c594c1140f082dd862abde9dc7825137a3d51avboxsyncextern VBOXSERVICE g_AutoMount;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync#endif
85c594c1140f082dd862abde9dc7825137a3d51avboxsync
85c594c1140f082dd862abde9dc7825137a3d51avboxsyncextern RTEXITCODE VBoxServiceSyntax(const char *pszFormat, ...);
85c594c1140f082dd862abde9dc7825137a3d51avboxsyncextern RTEXITCODE VBoxServiceError(const char *pszFormat, ...);
85c594c1140f082dd862abde9dc7825137a3d51avboxsyncextern void VBoxServiceVerbose(int iLevel, const char *pszFormat, ...);
extern int VBoxServiceArgUInt32(int argc, char **argv, const char *psz, int *pi, uint32_t *pu32,
uint32_t u32Min, uint32_t u32Max);
extern int VBoxServiceStartServices(void);
extern int VBoxServiceStopServices(void);
extern void VBoxServiceMainWait(void);
extern int VBoxServiceReportStatus(VBoxGuestFacilityStatus enmStatus);
#ifdef RT_OS_WINDOWS
extern RTEXITCODE VBoxServiceWinInstall(void);
extern RTEXITCODE VBoxServiceWinUninstall(void);
extern RTEXITCODE VBoxServiceWinEnterCtrlDispatcher(void);
extern void VBoxServiceWinSetStopPendingStatus(uint32_t uCheckPoint);
#endif
#ifdef VBOXSERVICE_TOOLBOX
extern bool VBoxServiceToolboxMain(int argc, char **argv, RTEXITCODE *prcExit);
#endif
#ifdef RT_OS_WINDOWS
# ifdef VBOX_WITH_GUEST_PROPS
extern int VBoxServiceVMInfoWinWriteUsers(char **ppszUserList, uint32_t *pcUsersInList);
extern int VBoxServiceWinGetComponentVersions(uint32_t uiClientID);
# endif /* VBOX_WITH_GUEST_PROPS */
#endif /* RT_OS_WINDOWS */
#ifdef VBOX_WITH_GUEST_CONTROL
extern int VBoxServiceControlExecHandleCmdStartProcess(uint32_t u32ClientId, uint32_t uNumParms);
extern int VBoxServiceControlExecHandleCmdSetInput(uint32_t u32ClientId, uint32_t uNumParms, size_t cbMaxBufSize);
extern int VBoxServiceControlExecHandleCmdGetOutput(uint32_t u32ClientId, uint32_t uNumParms);
extern int VBoxServiceControlExecProcess(uint32_t uContext, const char *pszCmd, uint32_t uFlags,
const char *pszArgs, uint32_t uNumArgs,
const char *pszEnv, uint32_t cbEnv, uint32_t uNumEnvVars,
const char *pszUser, const char *pszPassword, uint32_t uTimeLimitMS);
extern void VBoxServiceControlExecDestroyThreadData(PVBOXSERVICECTRLTHREADDATAEXEC pThread);
#endif /* VBOX_WITH_GUEST_CONTROL */
#ifdef VBOXSERVICE_MANAGEMENT
extern uint32_t VBoxServiceBalloonQueryPages(uint32_t cbPage);
#endif
#if defined(VBOX_WITH_PAGE_SHARING) && defined(RT_OS_WINDOWS)
extern RTEXITCODE VBoxServicePageSharingInitFork(void);
#endif
RT_C_DECLS_END
#endif