public static void WriteSetSMBDateTime(byte[] buffer, int offset, DateTime?datetime) { if (datetime.HasValue) { SMBHelper.WriteSMBDateTime(buffer, offset, datetime.Value); } }
public override byte[] GetBytes() { byte[] buffer = new byte[Length]; SMBHelper.WriteSMBDateTime(buffer, 0, CreationDateTime); SMBHelper.WriteSMBDateTime(buffer, 4, LastAccessDateTime); SMBHelper.WriteSMBDateTime(buffer, 8, LastWriteDateTime); ByteWriter.WriteBytes(buffer, 12, Reserved); return(buffer); }
public override byte[] GetBytes(bool isUnicode) { this.SMBParameters = new byte[ParameterLength]; LittleEndianWriter.WriteUInt16(this.SMBParameters, 0, (ushort)FileAttributes); SMBHelper.WriteSMBDateTime(this.SMBParameters, 2, LastWriteTime); LittleEndianWriter.WriteUInt32(this.SMBParameters, 6, FileSize); ByteWriter.WriteBytes(this.SMBParameters, 10, Reserved, 10); return(base.GetBytes(isUnicode)); }
public override byte[] GetBytes() { byte[] buffer = new byte[Length]; int offset = 0; SMBHelper.WriteSMBDateTime(buffer, ref offset, CreationDateTime); SMBHelper.WriteSMBDateTime(buffer, ref offset, LastAccessDateTime); SMBHelper.WriteSMBDateTime(buffer, ref offset, LastWriteDateTime); LittleEndianWriter.WriteUInt32(buffer, ref offset, FileDataSize); LittleEndianWriter.WriteUInt32(buffer, ref offset, AllocationSize); LittleEndianWriter.WriteUInt16(buffer, ref offset, (ushort)Attributes); return(buffer); }
public override void WriteBytes(byte[] buffer, ref int offset, bool isUnicode) { byte fileNameLength = (byte)(isUnicode ? FileName.Length * 2 : FileName.Length); if (ReturnResumeKeys) { LittleEndianWriter.WriteUInt32(buffer, ref offset, ResumeKey); } SMBHelper.WriteSMBDateTime(buffer, ref offset, CreationDateTime); SMBHelper.WriteSMBDateTime(buffer, ref offset, LastAccessDateTime); SMBHelper.WriteSMBDateTime(buffer, ref offset, LastWriteDateTime); LittleEndianWriter.WriteUInt32(buffer, ref offset, FileDataSize); LittleEndianWriter.WriteUInt32(buffer, ref offset, AllocationSize); LittleEndianWriter.WriteUInt16(buffer, ref offset, (ushort)Attributes); ByteWriter.WriteByte(buffer, ref offset, fileNameLength); SMBHelper.WriteSMBString(buffer, ref offset, isUnicode, FileName); }