Changeset 1222
- Timestamp:
- 9/29/2009 2:47:29 PM (4 years ago)
- Location:
- trunk/eraser6
- Files:
-
- 3 edited
-
Eraser.Util.FileSystem/Fat32Api.cpp (modified) (1 diff)
-
Eraser.Util.FileSystem/FatApi.cpp (modified) (1 diff)
-
Eraser.Util/KernelApi.cs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/eraser6/Eraser.Util.FileSystem/Fat32Api.cpp
r1220 r1222 116 116 { 117 117 //The path must start with a backslash as it must be volume-relative. 118 if (path [0] != L'\\')118 if (path->Length != 0 && path[0] != L'\\') 119 119 throw gcnew ArgumentException(L"The path provided is not volume relative. " + 120 120 gcnew String(L"Volume relative paths must begin with a backslash.")); 121 121 122 122 //Chop the path into it's constituent directory components 123 array<String^>^ components = path->S ubstring(1)->Split(Path::DirectorySeparatorChar,123 array<String^>^ components = path->Split(Path::DirectorySeparatorChar, 124 124 Path::AltDirectorySeparatorChar); 125 125 -
trunk/eraser6/Eraser.Util.FileSystem/FatApi.cpp
r1220 r1222 80 80 FatDirectory^ FatApi::LoadDirectory(String^ directory) 81 81 { 82 //Return the root directory if nothing is specified 83 if (directory == String::Empty) 84 return LoadDirectory(DirectoryToCluster(directory), String::Empty, nullptr); 85 82 86 array<wchar_t>^ pathSeparators = { Path::DirectorySeparatorChar, Path::AltDirectorySeparatorChar }; 83 DirectoryInfo^ info = gcnew DirectoryInfo(directory); 84 return LoadDirectory(DirectoryToCluster(directory), directory->Substring( 85 directory->IndexOfAny(pathSeparators)), 86 info->Parent == nullptr ? nullptr : LoadDirectory(info->Parent->FullName)); 87 int lastIndex = directory->LastIndexOfAny(pathSeparators); 88 return LoadDirectory(DirectoryToCluster(directory), directory->Substring(lastIndex + 1), 89 LoadDirectory(directory->Substring(0, lastIndex == 0 ? 0 : lastIndex - 1))); 87 90 } 88 91 -
trunk/eraser6/Eraser.Util/KernelApi.cs
r1188 r1222 662 662 public extern static bool DeviceIoControl(SafeFileHandle hDevice, 663 663 uint dwIoControlCode, IntPtr lpInBuffer, uint nInBufferSize, 664 IntPtr lpOutBuffer, uint nOutBufferSize, out uint lpBytesReturned, 665 IntPtr lpOverlapped); 666 public const uint FSCTL_LOCK_VOLUME = 0x90018; 667 public const uint FSCTL_UNLOCK_VOLUME = 0x9001C; 668 669 [DllImport("Kernel32.dll", SetLastError = true)] 670 [return: MarshalAs(UnmanagedType.Bool)] 671 public extern static bool DeviceIoControl(SafeFileHandle hDevice, 672 uint dwIoControlCode, IntPtr lpInBuffer, uint nInBufferSize, 664 673 out DiskPerformanceInfoInternal lpOutBuffer, uint nOutBufferSize, out uint lpBytesReturned, 665 674 IntPtr lpOverlapped);
Note: See TracChangeset
for help on using the changeset viewer.
