VirtualBox

Changeset 22728 in vbox


Ignore:
Timestamp:
Sep 3, 2009 7:59:53 AM (15 years ago)
Author:
vboxsync
Message:

VBoxService: Get rid of TCHARs, implemented better sysprep support.

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

Legend:

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

    r22551 r22728  
    3535VBoxService_TEMPLATE      = VBOXGUESTR3EXE
    3636VBoxService_DEFS          = VBOXSERVICE_TIMESYNC
    37 VBoxService_DEFS.win     += _WIN32_WINNT=0x0501 _UNICODE UNICODE
     37VBoxService_DEFS.win     += _WIN32_WINNT=0x0501
    3838VBoxService_DEFS.os2      = VBOX_WITH_HGCM VBOXSERVICE_CLIPBOARD
    3939ifdef VBOX_WITH_GUEST_PROPS
     
    8181VBoxServiceNT_TEMPLATE    = VBOXGUESTR3EXE
    8282VBoxServiceNT_EXTENDS     = VBoxService
    83 VBoxServiceNT_DEFS.win    = _WIN32_WINNT=0x0400 _UNICODE UNICODE TARGET_NT4
     83VBoxServiceNT_DEFS.win    = _WIN32_WINNT=0x0400 TARGET_NT4
    8484
    8585#VBoxServiceVMInfo.cpp uses VBOX_SVN_REV.
  • trunk/src/VBox/Additions/common/VBoxService/VBoxService-win.cpp

    r21247 r22728  
    195195    {
    196196        HKEY hKey = NULL;
    197         if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("SYSTEM\\CurrentControlSet\\Services\\EventLog\\System"), 0, KEY_ALL_ACCESS, &hKey) == ERROR_SUCCESS) {
     197        if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Services\\EventLog\\System", 0, KEY_ALL_ACCESS, &hKey) == ERROR_SUCCESS) {
    198198            RegDeleteKey(hKey, VBOXSERVICE_NAME);
    199199            RegCloseKey(hKey);
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceExec.cpp

    r22586 r22728  
    3838#include "VBoxServiceInternal.h"
    3939#include "VBoxServiceUtils.h"
     40#ifdef VBOX_WITH_GUEST_PROPS
     41# include <VBox/HostServices/GuestPropertySvc.h>
     42#endif
    4043
    4144
     
    4952/** The guest property service client ID. */
    5053static uint32_t         g_VMExecGuestPropSvcClientID = 0;
    51 
     54/** The maximum of arguments a command can have. */
     55#define EXEC_MAX_ARGS   32
    5256
    5357/** @copydoc VBOXSERVICE::pfnPreInit */
     
    99103
    100104
     105/**
     106 * Validates flags for executable guest properties.
     107 *
     108 * @returns boolean.
     109 * @retval  true on success.
     110 * @retval  false if not valid.
     111 *
     112 * @param   pszFlags     Pointer to flags to be checked.
     113 */
     114bool VBoxServiceExecValidateFlags(char* pszFlags)
     115{
     116    if (pszFlags == NULL)
     117        return false;
     118
     119    if (   (NULL != RTStrStr(pszFlags, "TRANSIENT"))
     120        && (NULL != RTStrStr(pszFlags, "RDONLYGUEST")))
     121    {
     122        return true;
     123    }
     124    return false;
     125}
     126
     127
    101128/** @copydoc VBOXSERVICE::pfnWorker */
    102129DECLCALLBACK(int) VBoxServiceExecWorker(bool volatile *pfShutdown)
    103130{
     131    using namespace guestProp;
    104132    int rc = VINF_SUCCESS;
    105133
     
    109137     */
    110138    RTThreadUserSignal(RTThreadSelf());
     139    Assert(g_VMExecGuestPropSvcClientID > 0);
    111140
    112141    /*
     
    119148    for (;;)
    120149    {
    121 #ifndef TARGET_NT4 /** @todo r=bird: Add comment explaining why please. */
    122150        /*
    123151         * The thread at the moment does nothing but checking for one specific guest property
     
    129157        if (!fSysprepDone)
    130158        {
     159            uint32_t cbBuf = MAX_VALUE_LEN + MAX_FLAGS_LEN + 1024;
     160
    131161            /* Get arguments. */
    132162            /** @todo r=bird: How exactly does this work wrt. enabled/disabled?  In
     
    136166             *        additions this will be executed everytime the system starts now - if
    137167             *        I understand the code correctly. Is this intentional? */
    138             char *pszArgs;
    139             rc = VbglR3GuestPropReadValueAlloc(g_VMExecGuestPropSvcClientID, "/VirtualBox/HostGuest/SysprepArgs", &pszArgs);
    140             if (RT_FAILURE(rc))
    141                 VBoxServiceVerbose(2, "Sysprep guest property not found or broken communication. Error: %Rrc\n", pszArgs, rc);
    142 
    143             /** @todo r=bird: You must check that the flags, you should require it to the
    144              *  TRANSIENT and RDONLYGUEST. Otherwise, we'll have a potential priviledge
    145              *  escalation issue inside the guest if the variable is removed. */
    146 
    147             static char *s_pszSysprepImage = "c:\\sysprep\\sysprep.exe";
    148             if (    RT_SUCCESS(rc)
    149                 &&  !RTFileExists(s_pszSysprepImage))
    150             {
    151                 VBoxServiceError("Sysprep executable not found! Search path=%s\n", s_pszSysprepImage);
     168            void* pvSysprepCmd = RTMemAllocZ(cbBuf);
     169            char* pszSysprepCmdValue = NULL;
     170            uint64_t u64SysprepCmdTimestamp = 0;
     171            char* pszSysprepCmdFlags = NULL;
     172#ifdef SYSPREP_WITH_CMD
     173            /* Get sysprep properties. */
     174            if (RT_SUCCESS(rc))
     175            {
     176                rc = VbglR3GuestPropRead(g_VMExecGuestPropSvcClientID, "/VirtualBox/HostGuest/SysprepCmd",
     177                                         pvSysprepCmd, cbBuf,
     178                                         &pszSysprepCmdValue, &u64SysprepCmdTimestamp, &pszSysprepCmdFlags, NULL);
     179                if (RT_FAILURE(rc))
     180                {
     181                    if (rc == VERR_NOT_FOUND)
     182                        VBoxServiceVerbose(2, "Sysprep cmd guest property not found\n");
     183                    else
     184                        VBoxServiceError("Sysprep cmd guest property: Error = %Rrc\n", rc);
     185                }
     186                else
     187                {
     188                    !VBoxServiceExecValidateFlags(pszSysprepCmdFlags) ? rc = rc : rc = VERR_ACCESS_DENIED;
     189                    if (RT_SUCCESS(rc))
     190                    {
     191                        if (RTStrNLen(pszSysprepCmdValue, _MAX_PATH) <= 0)
     192                            rc = VERR_NOT_FOUND;
     193                    }
     194                    VBoxServiceVerbose(2, "Sysprep cmd guest property: %Rrc\n", rc);
     195                }
     196            }
     197#else
     198            /* Choose sysprep image based on OS version. */
     199            char szSysprepCmd[_MAX_PATH] = "c:\\sysprep\\sysprep.exe";
     200            OSVERSIONINFOEX OSInfoEx;
     201            memset(&OSInfoEx, '\0', sizeof(OSInfoEx));
     202            OSInfoEx.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
     203            if (GetVersionEx((LPOSVERSIONINFO) &OSInfoEx))
     204            {
     205                if (OSInfoEx.dwMajorVersion >= 6) /* Use built-in sysprep on Vista or later. */
     206                    RTStrPrintf(szSysprepCmd, sizeof(szSysprepCmd), "%s\\system32\\sysprep\\sysprep.exe", RTEnvGet("windir"));
     207            }
     208            pszSysprepCmdValue = szSysprepCmd;
     209#endif
     210            void* pvSysprepArgs = RTMemAllocZ(cbBuf);
     211            char* pszSysprepArgsValue = NULL;
     212            uint64_t u64SysprepArgsTimestamp = 0;
     213            char* pszSysprepArgsFlags = NULL;
     214
     215            if (RT_SUCCESS(rc))
     216            {
     217                pvSysprepArgs = RTMemAllocZ(cbBuf);
     218                char szVal[] = "/VirtualBox/HostGuest/SysprepArgs";
     219                char *pTmp = NULL;
     220                rc = RTStrCurrentCPToUtf8(&pTmp, szVal);
     221                rc = VbglR3GuestPropRead(g_VMExecGuestPropSvcClientID, pTmp,
     222                                         pvSysprepArgs, cbBuf,
     223                                         &pszSysprepArgsValue, &u64SysprepArgsTimestamp, &pszSysprepArgsFlags, NULL);
     224                RTStrFree(pTmp);
     225                if (RT_FAILURE(rc))
     226                {
     227                    if (rc == VERR_NOT_FOUND)
     228                        VBoxServiceVerbose(2, "Sysprep argument guest property not found\n");
     229                    else
     230                        VBoxServiceError("Sysprep argument guest property: Error = %Rrc\n", rc);
     231                }
     232                else
     233                {
     234                    !VBoxServiceExecValidateFlags(pszSysprepArgsFlags) ? rc = rc : rc = VERR_ACCESS_DENIED;
     235                    if (RT_SUCCESS(rc))
     236                    {
     237                        if (RTStrNLen(pszSysprepArgsValue, EXEC_MAX_ARGS) <= 0)
     238                            rc = VERR_NOT_FOUND;
     239                    }
     240                    VBoxServiceVerbose(2, "Sysprep argument guest property: %Rrc\n", rc);
     241                }
     242            }
     243
     244            if (   RT_SUCCESS(rc)
     245                && !RTFileExists(pszSysprepCmdValue))
     246            {
     247                VBoxServiceError("Sysprep executable not found! Search path=%s\n", pszSysprepCmdValue);
    152248                rc = VERR_FILE_NOT_FOUND;
    153249            }
     
    155251            if (RT_SUCCESS(rc))
    156252            {
    157                 RTPROCESS   pid;
    158                 const char *papszArgs[6] = { s_pszSysprepImage, "-quiet", "-reseal", "-mini", "-activated", NULL};
    159 
    160                 /** @todo append the arguments in SysprepArgs/pszArgs.  */
     253                RTPROCESS pid;
     254
     255                /* Construct arguments list. */
     256                /** @todo would be handy to have such a function in IPRT. */
     257                int16_t index = 0;
     258                char* pszArg = pszSysprepArgsValue;
     259
     260                const char* pArgs[EXEC_MAX_ARGS]; /* Do we have a #define in IPRT for max args? */
     261
     262                VBoxServiceVerbose(3, "Sysprep argument value: %s\n", pszSysprepArgsValue);
     263                pArgs[index++] = pszSysprepCmdValue; /* Store image name as first argument. */
     264                while (   (pszArg != NULL)
     265                       && (*pszArg != NULL))
     266                {
     267                    char* pCurArg = (char*)RTMemAllocZ(_MAX_PATH);
     268                    int arg = 0;
     269                    while (   (*pszArg != ' ')
     270                           && (*pszArg != NULL))
     271                    {
     272                        pCurArg[arg++] = *pszArg;
     273                        pszArg++;
     274                    }
     275                    pszArg++; /* Skip leading space. */
     276                    VBoxServiceVerbose(3, "Sysprep argument %d = %s\n", index, pCurArg);
     277                    pArgs[index++] = pCurArg;
     278                }
     279                pArgs[index] = NULL;
     280
     281                /* Execute ... */
    161282                VBoxServiceVerbose(3, "Executing sysprep ...\n");
    162                 rc = RTProcCreate(papszArgs[0], papszArgs, RTENV_DEFAULT, 0, &pid);
     283                rc = RTProcCreate(pszSysprepCmdValue, pArgs, RTENV_DEFAULT, 0, &pid);
    163284                if (RT_SUCCESS(rc))
    164285                {
     
    172293                            &&  Status.enmReason == RTPROCEXITREASON_NORMAL)
    173294                        {
    174                             rc = VINF_SUCCESS;
    175                             fSysprepDone = true; /** r=bird: So, if sysprep fails, the idea is to continue executing the code every 10 seconds? */
     295                            fSysprepDone = true; /* We're done, no need to repeat the sysprep exec. */
    176296                        }
    177297                    }
    178298
    179299                    /* Set return value so the host knows what happend. */
    180                     rc = VbglR3GuestPropWriteValueF(g_VMExecGuestPropSvcClientID, "/VirtualBox/HostGuest/SysprepRet", "%d", Status.iStatus);
     300                    rc = VboxServiceWritePropInt(g_VMExecGuestPropSvcClientID, "HostGuest/SysprepRet", Status.iStatus);
    181301                    if (RT_FAILURE(rc))
    182302                        VBoxServiceError("Failed to write SysprepRet: rc=%Rrc\n", rc);
    183303                }
    184             }
    185 
    186             VbglR3GuestPropReadValueFree(pszArgs);
     304
     305                /* Destroy argument list (all but the first and last arg, it's just a pointer). */
     306                for (int i=1; i<index-1; i++)
     307                    RTMemFree((void*)pArgs[i]);
     308            }
    187309        }
    188 #endif /* !TARGET_NT4 */
    189310
    190311#ifdef FULL_FEATURED_EXEC
     
    244365{
    245366    /* Nothing here yet. */
    246     /** @todo r=bird: Shouldn't you do the following here:
    247      *        VbglR3GuestPropDisconnect(g_VMExecGuestPropSvcClientID);
    248      *        g_VMExecGuestPropSvcClientID = 0;
    249      * And quite possibly:
    250      *        RTSemEventMultiDestroy(g_hVMExecEvent);
    251      *        g_hVMExecEvent = NIL_RTSEMEVENTMULTI;
    252      */
     367    VbglR3GuestPropDisconnect(g_VMExecGuestPropSvcClientID);
     368    g_VMExecGuestPropSvcClientID = 0;
     369
     370    RTSemEventMultiDestroy(g_VMExecEvent);
     371    g_VMExecEvent = NIL_RTSEMEVENTMULTI;
    253372}
    254373
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceInternal.h

    r22503 r22728  
    2626#ifdef RT_OS_WINDOWS
    2727# include <Windows.h>
    28 # include <tchar.h>   /**@todo just drop this, this will be compiled as UTF-8/ANSI. */
    29 # include <process.h> /**@todo what's this here for?  */
     28# include <process.h> /* Needed for file version information. */
    3029#endif
    3130
     
    9695#ifdef RT_OS_WINDOWS
    9796/** The service name (needed for mutex creation on Windows). */
    98 #define VBOXSERVICE_NAME           L"VBoxService"
     97#define VBOXSERVICE_NAME          "VBoxService"
    9998/** The friendly service name. */
    100 #define VBOXSERVICE_FRIENDLY_NAME  L"VBoxService"
     99#define VBOXSERVICE_FRIENDLY_NAME "VBoxService"
    101100/** The following constant may be defined by including NtStatus.h. */
    102101#define STATUS_SUCCESS ((NTSTATUS)0x00000000L)
     
    104103typedef struct
    105104{
    106     TCHAR szUser [_MAX_PATH];
    107     TCHAR szAuthenticationPackage [_MAX_PATH];
    108     TCHAR szLogonDomain [_MAX_PATH];
     105    WCHAR szUser [_MAX_PATH];
     106    WCHAR szAuthenticationPackage [_MAX_PATH];
     107    WCHAR szLogonDomain [_MAX_PATH];
    109108} VBOXSERVICEVMINFOUSER, *PVBOXSERVICEVMINFOUSER;
    110109/** Structure for the file information lookup. */
    111110typedef struct
    112111{
    113     TCHAR* pszFilePath;
    114     TCHAR* pszFileName;
     112    char* pszFilePath;
     113    char* pszFileName;
    115114} VBOXSERVICEVMINFOFILE, *PVBOXSERVICEVMINFOFILE;
    116115/** Function prototypes for dynamic loading. */
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceUtils.cpp

    r21218 r22728  
    9090
    9191#ifdef RT_OS_WINDOWS
    92 /** @todo Use TCHAR here instead of LPC*STR crap. */
    93 BOOL VboxServiceGetFileString(LPCWSTR pszFileName,
    94                               LPWSTR pszBlock,
    95                               LPWSTR pszString,
     92BOOL VboxServiceGetFileString(const char* pszFileName,
     93                              char* pszBlock,
     94                              char* pszString,
    9695                              PUINT puiSize)
    9796{
    9897    DWORD dwHandle, dwLen = 0;
    9998    UINT uiDataLen = 0;
    100     LPTSTR lpData = NULL;
     99    char* lpData = NULL;
    101100    UINT uiValueLen = 0;
    102101    LPTSTR lpValue = NULL;
     
    115114    if (!dwLen)
    116115    {
    117         VBoxServiceError("No file information found! File = %ls, Error: %ld\n", pszFileName, GetLastError());
     116        VBoxServiceError("No file information found! File = %s, Error: %ld\n", pszFileName, GetLastError());
    118117        return FALSE;
    119118    }
     
    130129        if((bRet = VerQueryValue(lpData, pszBlock, (LPVOID*)&lpValue, (PUINT)&uiValueLen)))
    131130        {
    132             UINT uiSize = uiValueLen * sizeof(TCHAR);
     131            UINT uiSize = uiValueLen * sizeof(char);
    133132
    134133            if(uiSize > *puiSize)
     
    147146
    148147
    149 BOOL VboxServiceGetFileVersion(LPCWSTR pszFileName,
     148BOOL VboxServiceGetFileVersion(const char* pszFileName,
    150149                               DWORD* pdwMajor,
    151150                               DWORD* pdwMinor,
     
    170169
    171170    /* Try own fields defined in block "\\StringFileInfo\\040904b0\\FileVersion". */
    172     TCHAR szValueUTF16[_MAX_PATH] = {0};
    173     char szValueUTF8[_MAX_PATH] = {0};
    174     char *pszValueUTF8  = szValueUTF8;
     171    char szValue[_MAX_PATH] = {0};
     172    char *pszValue  = szValue;
    175173    UINT uiSize = _MAX_PATH;
    176174    int r = 0;
    177175
    178     bRet = VboxServiceGetFileString(pszFileName, TEXT("\\StringFileInfo\\040904b0\\FileVersion"), szValueUTF16, &uiSize);
     176    bRet = VboxServiceGetFileString(pszFileName, "\\StringFileInfo\\040904b0\\FileVersion", szValue, &uiSize);
    179177    if (bRet)
    180178    {
    181         r = RTUtf16ToUtf8Ex(szValueUTF16, uiSize, &pszValueUTF8, _MAX_PATH, NULL);
    182         sscanf(szValueUTF8, "%ld.%ld.%ld.%ld", pdwMajor, pdwMinor, pdwBuildNumber, pdwRevisionNumber);
     179        sscanf(pszValue, "%ld.%ld.%ld.%ld", pdwMajor, pdwMinor, pdwBuildNumber, pdwRevisionNumber);
    183180    }
    184181    else if (dwLen > 0)
     
    194191        if (GetFileVersionInfo(pszFileName, dwHandle, dwLen, lpData))
    195192        {
    196             if((bRet = VerQueryValue(lpData, TEXT("\\"), (LPVOID*)&pFileInfo, (PUINT)&BufLen)))
     193            if((bRet = VerQueryValue(lpData, "\\", (LPVOID*)&pFileInfo, (PUINT)&BufLen)))
    197194            {
    198195                *pdwMajor = HIWORD(pFileInfo->dwFileVersionMS);
     
    211208
    212209
    213 BOOL VboxServiceGetFileVersionString(LPCWSTR pszPath, LPCWSTR pszFileName, char* pszVersion, UINT uiSize)
     210BOOL VboxServiceGetFileVersionString(const char* pszPath, const char* pszFileName, char* pszVersion, UINT uiSize)
    214211{
    215212    BOOL bRet = FALSE;
    216     TCHAR szFullPath[_MAX_PATH] = {0};
    217     TCHAR szValueUTF16[_MAX_PATH] = {0};
    218     char szValueUTF8[_MAX_PATH] = {0};
     213    char szFullPath[_MAX_PATH] = {0};
     214    char szValue[_MAX_PATH] = {0};
    219215    int r = 0;
    220216
    221     swprintf(szFullPath, 4096, TEXT("%s\\%s"), pszPath, pszFileName); /** @todo here as well. */
     217    RTStrPrintf(szFullPath, 4096, "%s\\%s", pszPath, pszFileName);
    222218
    223219    DWORD dwMajor, dwMinor, dwBuild, dwRev;
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceUtils.h

    r19644 r22728  
    3131#ifdef RT_OS_WINDOWS
    3232/** Gets a pre-formatted version string from the VS_FIXEDFILEINFO table. */
    33 BOOL VboxServiceGetFileVersionString(LPCWSTR pszPath, LPCWSTR pszFileName, char* pszVersion, UINT uiSize);
     33BOOL VboxServiceGetFileVersionString(const char* pszPath, const char* pszFileName, char* pszVersion, UINT uiSize);
    3434#endif
    3535
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo-win.cpp

    r21323 r22728  
    272272                if (SidTypeUser == ownerType)
    273273                {
    274                     LPWSTR pBuffer = NULL;
     274                    char* pBuffer = NULL;
    275275                    DWORD dwBytesRet = 0;
    276276                    int iState = 0;
     
    411411    char szVer[_MAX_PATH] = {0};
    412412    char szPropPath[_MAX_PATH] = {0};
    413     TCHAR szSysDir[_MAX_PATH] = {0};
    414     TCHAR szWinDir[_MAX_PATH] = {0};
    415     TCHAR szDriversDir[_MAX_PATH + 32] = {0};
     413    char szSysDir[_MAX_PATH] = {0};
     414    char szWinDir[_MAX_PATH] = {0};
     415    char szDriversDir[_MAX_PATH + 32] = {0};
    416416
    417417    GetSystemDirectory(szSysDir, _MAX_PATH);
    418418    GetWindowsDirectory(szWinDir, _MAX_PATH);
    419     swprintf(szDriversDir, (_MAX_PATH + 32), TEXT("%s\\drivers"), szSysDir);
     419    RTStrPrintf(szDriversDir, (_MAX_PATH + 32), "%s\\drivers", szSysDir);
    420420#ifdef RT_ARCH_AMD64
    421     TCHAR szSysWowDir[_MAX_PATH + 32] = {0};
    422     swprintf(szSysWowDir, (_MAX_PATH + 32), TEXT("%s\\SysWow64"), szWinDir);
     421    char szSysWowDir[_MAX_PATH + 32] = {0};
     422    RTStrPrintf(szSysWowDir, (_MAX_PATH + 32), "%s\\SysWow64", szWinDir);
    423423#endif
    424424
     
    427427    VBOXSERVICEVMINFOFILE vboxFileInfoTable[] =
    428428    {
    429         { szSysDir, TEXT("VBoxControl.exe"), },
    430         { szSysDir, TEXT("VBoxHook.dll"), },
    431         { szSysDir, TEXT("VBoxDisp.dll"), },
    432         { szSysDir, TEXT("VBoxMRXNP.dll"), },
    433         { szSysDir, TEXT("VBoxService.exe"), },
    434         { szSysDir, TEXT("VBoxTray.exe"), },
    435         { szSysDir, TEXT("VBoxGINA.dll"), },
     429        { szSysDir, "VBoxControl.exe", },
     430        { szSysDir, "VBoxHook.dll", },
     431        { szSysDir, "VBoxDisp.dll", },
     432        { szSysDir, "VBoxMRXNP.dll", },
     433        { szSysDir, "VBoxService.exe", },
     434        { szSysDir, "VBoxTray.exe", },
     435        { szSysDir, "VBoxGINA.dll", },
    436436
    437437 /* On 64-bit we don't yet have the OpenGL DLLs in native format.
    438438    So just enumerate the 32-bit files in the SYSWOW directory. */
    439439 #ifdef RT_ARCH_AMD64
    440         { szSysWowDir, TEXT("VBoxOGLarrayspu.dll"), },
    441         { szSysWowDir, TEXT("VBoxOGLcrutil.dll"), },
    442         { szSysWowDir, TEXT("VBoxOGLerrorspu.dll"), },
    443         { szSysWowDir, TEXT("VBoxOGLpackspu.dll"), },
    444         { szSysWowDir, TEXT("VBoxOGLpassthroughspu.dll"), },
    445         { szSysWowDir, TEXT("VBoxOGLfeedbackspu.dll"), },
    446         { szSysWowDir, TEXT("VBoxOGL.dll"), },
     440        { szSysWowDir, "VBoxOGLarrayspu.dll", },
     441        { szSysWowDir, "VBoxOGLcrutil.dll", },
     442        { szSysWowDir, "VBoxOGLerrorspu.dll", },
     443        { szSysWowDir, "VBoxOGLpackspu.dll", },
     444        { szSysWowDir, "VBoxOGLpassthroughspu.dll", },
     445        { szSysWowDir, "VBoxOGLfeedbackspu.dll", },
     446        { szSysWowDir, "VBoxOGL.dll", },
    447447 #else
    448         { szSysDir, TEXT("VBoxOGLarrayspu.dll"), },
    449         { szSysDir, TEXT("VBoxOGLcrutil.dll"), },
    450         { szSysDir, TEXT("VBoxOGLerrorspu.dll"), },
    451         { szSysDir, TEXT("VBoxOGLpackspu.dll"), },
    452         { szSysDir, TEXT("VBoxOGLpassthroughspu.dll"), },
    453         { szSysDir, TEXT("VBoxOGLfeedbackspu.dll"), },
    454         { szSysDir, TEXT("VBoxOGL.dll"), }, 
     448        { szSysDir, "VBoxOGLarrayspu.dll", },
     449        { szSysDir, "VBoxOGLcrutil.dll", },
     450        { szSysDir, "VBoxOGLerrorspu.dll", },
     451        { szSysDir, "VBoxOGLpackspu.dll", },
     452        { szSysDir, "VBoxOGLpassthroughspu.dll", },
     453        { szSysDir, "VBoxOGLfeedbackspu.dll", },
     454        { szSysDir, "VBoxOGL.dll", },
    455455 #endif
    456456
    457         { szDriversDir, TEXT("VBoxGuest.sys"), },
    458         { szDriversDir, TEXT("VBoxMouse.sys"), },
    459         { szDriversDir, TEXT("VBoxSF.sys"),    },
    460         { szDriversDir, TEXT("VBoxVideo.sys"), },
     457        { szDriversDir, "VBoxGuest.sys", },
     458        { szDriversDir, "VBoxMouse.sys", },
     459        { szDriversDir, "VBoxSF.sys",    },
     460        { szDriversDir, "VBoxVideo.sys", },
    461461
    462462        {
     
    467467    VBOXSERVICEVMINFOFILE vboxFileInfoTable[] =
    468468    {
    469         { szSysDir, TEXT("VBoxControl.exe"), },
    470         { szSysDir, TEXT("VBoxHook.dll"), },
    471         { szSysDir, TEXT("VBoxDisp.dll"), },
    472         { szSysDir, TEXT("VBoxService.exe"), },
    473         { szSysDir, TEXT("VBoxTray.exe"), },
    474 
    475         { szDriversDir, TEXT("VBoxGuestNT.sys"), },
    476         { szDriversDir, TEXT("VBoxMouseNT.sys"), },
    477         { szDriversDir, TEXT("VBoxVideo.sys"), },
     469        { szSysDir, "VBoxControl.exe", },
     470        { szSysDir, "VBoxHook.dll", },
     471        { szSysDir, "VBoxDisp.dll", },
     472        { szSysDir, "VBoxService.exe", },
     473        { szSysDir, "VBoxTray.exe", },
     474
     475        { szDriversDir, "VBoxGuestNT.sys", },
     476        { szDriversDir, "VBoxMouseNT.sys", },
     477        { szDriversDir, "VBoxVideo.sys", },
    478478
    479479        {
     
    488488    {
    489489        rc = VboxServiceGetFileVersionString(pTable->pszFilePath, pTable->pszFileName, szVer, sizeof(szVer));
    490         RTStrPrintf(szPropPath, sizeof(szPropPath), "GuestAdd/Components/%ls", pTable->pszFileName);
     490        RTStrPrintf(szPropPath, sizeof(szPropPath), "GuestAdd/Components/%s", pTable->pszFileName);
    491491        VboxServiceWriteProp(uiClientID, szPropPath, szVer);
    492492        pTable++;
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp

    r22575 r22728  
    115115#ifdef RT_OS_WINDOWS
    116116    /* Get function pointers. */
    117     HMODULE hKernel32 = LoadLibrary(_T("kernel32"));
     117    HMODULE hKernel32 = LoadLibrary("kernel32");
    118118    if (NULL != hKernel32)
    119119    {
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