MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / InstallFileSystems

Method InstallFileSystems

Engine/source/platformWin32/winVolume.cpp:766–806  ·  view source on GitHub ↗

Function invoked by the kernel layer to install OS specific file systems.

Source from the content-addressed store, hash-verified

764/// Function invoked by the kernel layer to install OS specific
765/// file systems.
766bool Platform::FS::InstallFileSystems()
767{
768#ifndef TORQUE_SECURE_VFS
769 WCHAR buffer[1024];
770
771 // [8/24/2009 tomb] This stops Windows from complaining about drives that have no disks in
772 SetErrorMode(SEM_FAILCRITICALERRORS);
773
774 // Load all the Win32 logical drives.
775 DWORD mask = ::GetLogicalDrives();
776 char drive[] = "A";
777 char volume[] = "A:/";
778 while (mask)
779 {
780 if (mask & 1)
781 {
782 volume[0] = drive[0];
783 Platform::FS::Mount(drive, Platform::FS::createNativeFS(volume));
784 }
785 mask >>= 1;
786 drive[0]++;
787 }
788
789 // Set the current working dir. Windows normally returns
790 // upper case driver letters, but the cygwin bash shell
791 // seems to make it return lower case drives. Force upper
792 // to be consistent with the mounts.
793 ::GetCurrentDirectory(sizeof(buffer), buffer);
794
795 if (buffer[1] == ':')
796 buffer[0] = dToupper(buffer[0]);
797
798 String wd = buffer;
799
800 wd += '/';
801
802 Platform::FS::SetCwd(wd);
803#endif
804
805 return true;
806}
807
808

Callers

nothing calls this directly

Calls 3

MountFunction · 0.85
dToupperFunction · 0.85
SetCwdFunction · 0.85

Tested by

no test coverage detected