tst: passthrough-dotnet: testing

This commit is contained in:
Bill Zissimopoulos 2017-04-09 02:01:19 -07:00
parent 8f8e8fe086
commit de60e76b1d

View File

@ -60,6 +60,7 @@ namespace passthrough
{ {
SetSectorSize(ALLOCATION_UNIT); SetSectorSize(ALLOCATION_UNIT);
SetSectorsPerAllocationUnit(1); SetSectorsPerAllocationUnit(1);
SetMaxComponentLength(255);
SetFileInfoTimeout(1000); SetFileInfoTimeout(1000);
SetCaseSensitiveSearch(false); SetCaseSensitiveSearch(false);
SetCasePreservedNames(true); SetCasePreservedNames(true);
@ -71,6 +72,8 @@ namespace passthrough
public void SetPath(String value) public void SetPath(String value)
{ {
_Path = Path.GetFullPath(value); _Path = Path.GetFullPath(value);
if (_Path.EndsWith("\\"))
_Path = _Path.Substring(0, _Path.Length - 1);
SetVolumeCreationTime((UInt64)File.GetCreationTimeUtc(_Path).ToFileTimeUtc()); SetVolumeCreationTime((UInt64)File.GetCreationTimeUtc(_Path).ToFileTimeUtc());
SetVolumeSerialNumber(0); SetVolumeSerialNumber(0);
} }
@ -84,7 +87,7 @@ namespace passthrough
} }
protected String ConcatPath(String FileName) protected String ConcatPath(String FileName)
{ {
return Path.Combine(_Path, FileName); return _Path + FileName;
} }
protected Int32 GetFileInfoInternal(FileSystemInfo Info, Boolean Refresh, protected Int32 GetFileInfoInternal(FileSystemInfo Info, Boolean Refresh,
out FileInfo FileInfo) out FileInfo FileInfo)
@ -258,7 +261,8 @@ namespace passthrough
Object FileDesc0) Object FileDesc0)
{ {
FileDesc FileDesc = (FileDesc)FileDesc0; FileDesc FileDesc = (FileDesc)FileDesc0;
FileDesc.Stream.Dispose(); if (null != FileDesc.Stream)
FileDesc.Stream.Dispose();
if (null != FileDesc.DirBuffer) if (null != FileDesc.DirBuffer)
FileDesc.DirBuffer.Dispose(); FileDesc.DirBuffer.Dispose();
} }
@ -482,7 +486,8 @@ namespace passthrough
FileDesc FileDesc = (FileDesc)FileDesc0; FileDesc FileDesc = (FileDesc)FileDesc0;
if (null == Pattern) if (null == Pattern)
Pattern = "*"; Pattern = "*";
Context = (FileDesc.Info as DirectoryInfo).EnumerateFileSystemInfos(Pattern); Context = (FileDesc.Info as DirectoryInfo).EnumerateFileSystemInfos(Pattern).
GetEnumerator();
} }
IEnumerator<FileSystemInfo> InfoEnumerator = (IEnumerator<FileSystemInfo>)Context; IEnumerator<FileSystemInfo> InfoEnumerator = (IEnumerator<FileSystemInfo>)Context;
if (InfoEnumerator.MoveNext()) if (InfoEnumerator.MoveNext())