VirtualBox

Changeset 107097 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Nov 22, 2024 12:28:19 AM (3 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
166063
Message:

Main/VBoxProxyStub: Print warning when registering VBoxSDS.exe on a network drive (it won't work). If you wan to run a development version of VBox on a network share, disabling VBoxSDS is currently the best option (LocalConfig.kmk: override VBOX_WITH_SDS := ). jiraref:VBP-1466

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-all/win/VBoxProxyStub.c

    r106061 r107097  
    5151#include <iprt/uuid.h>
    5252#include <iprt/utf16.h>
     53
     54#ifndef FILE_REMOTE_DEVICE
     55# define FILE_REMOTE_DEVICE UINT32_C(0x10)
     56#endif
    5357
    5458
     
    23372341    WCHAR const * const pwszServiceStartName = L"LocalSystem";
    23382342    static WCHAR const  wszzDependencies[]   = L"RPCSS\0";
     2343    HANDLE              hVBoxDir;
     2344
     2345    /*
     2346     * Output warning if the service module isn't on a local drive.
     2347     */
     2348    hVBoxDir = CreateFileW(pwszVBoxDir, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
     2349                           NULL, OPEN_EXISTING, FILE_ATTRIBUTE_DIRECTORY | FILE_FLAG_BACKUP_SEMANTICS, NULL);
     2350    if (hVBoxDir != INVALID_HANDLE_VALUE)
     2351    {
     2352        IO_STATUS_BLOCK             Ios       = RTNT_IO_STATUS_BLOCK_INITIALIZER;
     2353        FILE_FS_DEVICE_INFORMATION  FsDevInfo = { 0, 0 };
     2354        NTSTATUS rcNt = NtQueryVolumeInformationFile(hVBoxDir, &Ios, &FsDevInfo, sizeof(FsDevInfo), FileFsDeviceInformation);
     2355        if (NT_SUCCESS(rcNt))
     2356        {
     2357            if (   (FsDevInfo.Characteristics & FILE_REMOTE_DEVICE)
     2358                || FsDevInfo.DeviceType == FILE_DEVICE_NETWORK
     2359                || FsDevInfo.DeviceType == FILE_DEVICE_NETWORK_FILE_SYSTEM)
     2360                RTAssertMsg2("!WARNING! Service '%ls' will not work off a network drive ('%ls').\n"
     2361                             "          LocalConfig.kmk workaround for developers: override VBOX_WITH_SDS :=\n",
     2362                             pwszServiceName, pwszVBoxDir);
     2363        }
     2364        else
     2365            LogRel(("update service '%ls': NtQueryVolumeInformationFile/FileFsDeviceInformation on '%ls': %x\n",
     2366                    pwszServiceName, pwszVBoxDir, rcNt));
     2367        CloseHandle(hVBoxDir);
     2368    }
     2369    else
     2370        LogRel(("update service '%ls': failed to open '%ls': %u\n", pwszServiceName, pwszVBoxDir, GetLastError()));
    23392371
    23402372    /*
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