update sharpcifs

This commit is contained in:
Luke Pulverenti
2017-07-07 23:12:21 -04:00
parent a30e22c3a2
commit 0d10dfe471
221 changed files with 23704 additions and 25614 deletions

View File

@@ -19,68 +19,66 @@ using SharpCifs.Util.Sharpen;
namespace SharpCifs.Smb
{
internal class SmbComTreeConnectAndXResponse : AndXServerMessageBlock
{
private const int SmbSupportSearchBits = unchecked(0x0001);
internal class SmbComTreeConnectAndXResponse : AndXServerMessageBlock
{
private const int SmbSupportSearchBits = unchecked(0x0001);
private const int SmbShareIsInDfs = unchecked(0x0002);
private const int SmbShareIsInDfs = unchecked(0x0002);
internal bool SupportSearchBits;
internal bool SupportSearchBits;
internal bool ShareIsInDfs;
internal bool ShareIsInDfs;
internal string Service;
internal string Service;
internal string NativeFileSystem = string.Empty;
internal string NativeFileSystem = string.Empty;
internal SmbComTreeConnectAndXResponse(ServerMessageBlock andx) : base(andx)
{
}
internal SmbComTreeConnectAndXResponse(ServerMessageBlock andx) : base(andx)
{
}
internal override int WriteParameterWordsWireFormat(byte[] dst, int dstIndex)
{
return 0;
}
internal override int WriteParameterWordsWireFormat(byte[] dst, int dstIndex)
{
return 0;
}
internal override int WriteBytesWireFormat(byte[] dst, int dstIndex)
{
return 0;
}
internal override int WriteBytesWireFormat(byte[] dst, int dstIndex)
{
return 0;
}
internal override int ReadParameterWordsWireFormat(byte[] buffer, int bufferIndex)
{
SupportSearchBits = (buffer[bufferIndex] & SmbSupportSearchBits) == SmbSupportSearchBits;
ShareIsInDfs = (buffer[bufferIndex] & SmbShareIsInDfs) == SmbShareIsInDfs;
return 2;
}
internal override int ReadParameterWordsWireFormat(byte[] buffer, int bufferIndex
)
{
SupportSearchBits = (buffer[bufferIndex] & SmbSupportSearchBits) == SmbSupportSearchBits;
ShareIsInDfs = (buffer[bufferIndex] & SmbShareIsInDfs) == SmbShareIsInDfs;
return 2;
}
internal override int ReadBytesWireFormat(byte[] buffer, int bufferIndex)
{
int start = bufferIndex;
int len = ReadStringLength(buffer, bufferIndex, 32);
try
{
//Service = Runtime.GetStringForBytes(buffer, bufferIndex, len, "ASCII");
internal override int ReadBytesWireFormat(byte[] buffer, int bufferIndex)
{
int start = bufferIndex;
int len = ReadStringLength(buffer, bufferIndex, 32);
try
{
//Service = Runtime.GetStringForBytes(buffer, bufferIndex, len, "ASCII");
Service = Runtime.GetStringForBytes(buffer, bufferIndex, len, "UTF-8");
}
catch (UnsupportedEncodingException)
{
return 0;
}
bufferIndex += len + 1;
// win98 observed not returning nativeFileSystem
return bufferIndex - start;
}
}
catch (UnsupportedEncodingException)
{
return 0;
}
bufferIndex += len + 1;
// win98 observed not returning nativeFileSystem
return bufferIndex - start;
}
public override string ToString()
{
string result = "SmbComTreeConnectAndXResponse["
+ base.ToString()
+ ",supportSearchBits=" + SupportSearchBits
+ ",shareIsInDfs=" + ShareIsInDfs
+ ",service=" + Service
+ ",nativeFileSystem=" + NativeFileSystem + "]";
return result;
}
}
public override string ToString()
{
string result = "SmbComTreeConnectAndXResponse[" + base.ToString() + ",supportSearchBits="
+ SupportSearchBits + ",shareIsInDfs=" + ShareIsInDfs + ",service=" + Service +
",nativeFileSystem=" + NativeFileSystem + "]";
return result;
}
}
}