mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-06-05 20:07:13 +02:00
Renamed SMB1\SMBCommands to SMB1\Commands
This commit is contained in:
parent
3d6694fd9a
commit
cb45290dc4
72 changed files with 71 additions and 71 deletions
57
SMBLibrary/SMB1/Commands/DeleteRequest.cs
Normal file
57
SMBLibrary/SMB1/Commands/DeleteRequest.cs
Normal file
|
@ -0,0 +1,57 @@
|
|||
/* Copyright (C) 2014 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
|
||||
*
|
||||
* You can redistribute this program and/or modify it under the terms of
|
||||
* the GNU Lesser Public License as published by the Free Software Foundation,
|
||||
* either version 3 of the License, or (at your option) any later version.
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Utilities;
|
||||
|
||||
namespace SMBLibrary.SMB1
|
||||
{
|
||||
/// <summary>
|
||||
/// SMB_COM_DELETE Request
|
||||
/// </summary>
|
||||
public class DeleteRequest : SMBCommand
|
||||
{
|
||||
public const int SupportedBufferFormat = 0x04;
|
||||
public const int ParametersLength = 2;
|
||||
// Parameters;
|
||||
public FileAttributes SearchAttributes;
|
||||
// Data:
|
||||
public byte BufferFormat;
|
||||
public string FileName; // SMB_STRING
|
||||
|
||||
public DeleteRequest() : base()
|
||||
{
|
||||
BufferFormat = SupportedBufferFormat;
|
||||
}
|
||||
|
||||
public DeleteRequest(byte[] buffer, int offset, bool isUnicode) : base(buffer, offset, isUnicode)
|
||||
{
|
||||
SearchAttributes = (FileAttributes)LittleEndianConverter.ToUInt16(this.SMBParameters, 0);
|
||||
|
||||
BufferFormat = ByteReader.ReadByte(this.SMBData, 0);
|
||||
if (BufferFormat != SupportedBufferFormat)
|
||||
{
|
||||
throw new InvalidRequestException("Unsupported Buffer Format");
|
||||
}
|
||||
FileName = SMBHelper.ReadSMBString(this.SMBData, 1, isUnicode);
|
||||
}
|
||||
|
||||
public override byte[] GetBytes(bool isUnicode)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override CommandName CommandName
|
||||
{
|
||||
get
|
||||
{
|
||||
return CommandName.SMB_COM_DELETE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue