From de60e76b1d5df442b735d0cb278e61f2cac55801 Mon Sep 17 00:00:00 2001 From: Bill Zissimopoulos Date: Sun, 9 Apr 2017 02:01:19 -0700 Subject: [PATCH] tst: passthrough-dotnet: testing --- tst/passthrough-dotnet/Program.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tst/passthrough-dotnet/Program.cs b/tst/passthrough-dotnet/Program.cs index 8f3c6b0e..18264405 100644 --- a/tst/passthrough-dotnet/Program.cs +++ b/tst/passthrough-dotnet/Program.cs @@ -60,6 +60,7 @@ namespace passthrough { SetSectorSize(ALLOCATION_UNIT); SetSectorsPerAllocationUnit(1); + SetMaxComponentLength(255); SetFileInfoTimeout(1000); SetCaseSensitiveSearch(false); SetCasePreservedNames(true); @@ -71,6 +72,8 @@ namespace passthrough public void SetPath(String value) { _Path = Path.GetFullPath(value); + if (_Path.EndsWith("\\")) + _Path = _Path.Substring(0, _Path.Length - 1); SetVolumeCreationTime((UInt64)File.GetCreationTimeUtc(_Path).ToFileTimeUtc()); SetVolumeSerialNumber(0); } @@ -84,7 +87,7 @@ namespace passthrough } protected String ConcatPath(String FileName) { - return Path.Combine(_Path, FileName); + return _Path + FileName; } protected Int32 GetFileInfoInternal(FileSystemInfo Info, Boolean Refresh, out FileInfo FileInfo) @@ -258,7 +261,8 @@ namespace passthrough Object FileDesc0) { FileDesc FileDesc = (FileDesc)FileDesc0; - FileDesc.Stream.Dispose(); + if (null != FileDesc.Stream) + FileDesc.Stream.Dispose(); if (null != FileDesc.DirBuffer) FileDesc.DirBuffer.Dispose(); } @@ -482,7 +486,8 @@ namespace passthrough FileDesc FileDesc = (FileDesc)FileDesc0; if (null == Pattern) Pattern = "*"; - Context = (FileDesc.Info as DirectoryInfo).EnumerateFileSystemInfos(Pattern); + Context = (FileDesc.Info as DirectoryInfo).EnumerateFileSystemInfos(Pattern). + GetEnumerator(); } IEnumerator InfoEnumerator = (IEnumerator)Context; if (InfoEnumerator.MoveNext())