mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-08-03 22:41:49 +02:00
Bugfixes and improvements to the WriteBytes methods of several SMB1 structures
This commit is contained in:
parent
387b3b6709
commit
84a771641e
3 changed files with 17 additions and 5 deletions
|
@ -26,14 +26,14 @@ namespace SMBLibrary.SMB1
|
|||
|
||||
public void WriteBytes(byte[] buffer, int offset)
|
||||
{
|
||||
buffer[0] = (byte)OpenResult;
|
||||
buffer[offset + 0] = (byte)OpenResult;
|
||||
if (OpLockGranted)
|
||||
{
|
||||
buffer[1] = 0x80;
|
||||
buffer[offset + 1] = 0x80;
|
||||
}
|
||||
else
|
||||
{
|
||||
buffer[1] = 0x00;
|
||||
buffer[offset + 1] = 0x00;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -82,6 +82,12 @@ namespace SMBLibrary.SMB1
|
|||
buffer[offset + 1] |= (byte)(((byte)WriteThroughMode << 6) & 0x40);
|
||||
}
|
||||
|
||||
public void WriteBytes(byte[] buffer, ref int offset)
|
||||
{
|
||||
WriteBytes(buffer, offset);
|
||||
offset += Length;
|
||||
}
|
||||
|
||||
public static AccessModeOptions Read(byte[] buffer, ref int offset)
|
||||
{
|
||||
offset += Length;
|
||||
|
|
|
@ -38,8 +38,14 @@ namespace SMBLibrary.SMB1
|
|||
|
||||
public void WriteBytes(byte[] buffer, int offset)
|
||||
{
|
||||
buffer[0] = (byte)FileExistsOpts;
|
||||
buffer[0] |= (byte)((byte)CreateFile << 4);
|
||||
buffer[offset + 0] = (byte)FileExistsOpts;
|
||||
buffer[offset + 0] |= (byte)((byte)CreateFile << 4);
|
||||
}
|
||||
|
||||
public void WriteBytes(byte[] buffer, ref int offset)
|
||||
{
|
||||
WriteBytes(buffer, offset);
|
||||
offset += Length;
|
||||
}
|
||||
|
||||
public static OpenMode Read(byte[] buffer, ref int offset)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue