瀏覽代碼

SMB1: SMB_COM_QUERY_INFORMATION Response: Bugfix: LastWriteTime is UTime

Tal Aloni 8 年之前
父節點
當前提交
dabc3260be
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5 5
      SMBLibrary/SMB1/Commands/QueryInformationResponse.cs

+ 5 - 5
SMBLibrary/SMB1/Commands/QueryInformationResponse.cs

@@ -1,4 +1,4 @@
-/* Copyright (C) 2014 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
+/* Copyright (C) 2014-2017 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,
@@ -12,7 +12,7 @@ using Utilities;
 namespace SMBLibrary.SMB1
 {
     /// <summary>
-    /// SMB_COM_QUERY_INFORMATION Request.
+    /// SMB_COM_QUERY_INFORMATION Response.
     /// This command is deprecated.
     /// This command is used by Windows NT4 SP6.
     /// </summary>
@@ -21,7 +21,7 @@ namespace SMBLibrary.SMB1
         public const int ParameterLength = 20;
         // Parameters:
         public SMBFileAttributes FileAttributes;
-        public DateTime LastWriteTime;
+        public DateTime? LastWriteTime;
         public uint FileSize;
         public byte[] Reserved; // 10 bytes
 
@@ -33,7 +33,7 @@ namespace SMBLibrary.SMB1
         public QueryInformationResponse(byte[] buffer, int offset) : base(buffer, offset, false)
         {
             FileAttributes = (SMBFileAttributes)LittleEndianConverter.ToUInt16(this.SMBParameters, 0);
-            LastWriteTime = SMB1Helper.ReadSMBDateTime(this.SMBParameters, 2);
+            LastWriteTime = UTimeHelper.ReadNullableUTime(this.SMBParameters, 2);
             FileSize = LittleEndianConverter.ToUInt32(this.SMBParameters, 6);
             Reserved = ByteReader.ReadBytes(this.SMBParameters, 10, 10);
         }
@@ -42,7 +42,7 @@ namespace SMBLibrary.SMB1
         {
             this.SMBParameters = new byte[ParameterLength];
             LittleEndianWriter.WriteUInt16(this.SMBParameters, 0, (ushort)FileAttributes);
-            SMB1Helper.WriteSMBDateTime(this.SMBParameters, 2, LastWriteTime);
+            UTimeHelper.WriteUTime(this.SMBParameters, 2, LastWriteTime);
             LittleEndianWriter.WriteUInt32(this.SMBParameters, 6, FileSize);
             ByteWriter.WriteBytes(this.SMBParameters, 10, Reserved, 10);