Exemple #1
0
 internal void CopyTo(IntPtr ptr)
 {
     if (ptr != IntPtr.Zero)
     {
         var data = new ArchiveHeaderStruct
         {
             ArchiveName  = ArchiveName,
             FileName     = FileName,
             FileAttr     = (int)FileAttributes,
             FileCRC      = FileCRC,
             FileTime     = DateTimeUtil.ToArchiveHeaderTime(FileTime),
             PackSizeHigh = (uint)LongUtil.High(PackedSize),
             PackSizeLow  = (uint)LongUtil.Low(PackedSize),
             UnpSizeHigh  = (uint)LongUtil.High(UnpackedSize),
             UnpSizeLow   = (uint)LongUtil.Low(UnpackedSize),
         };
         Marshal.StructureToPtr(data, ptr, false);
     }
 }
 internal void CopyTo(IntPtr pFindData)
 {
     if (pFindData != IntPtr.Zero)
     {
         var findData = new FsFindData()
         {
             FileName          = FileName,
             AlternateFileName = AlternateFileName,
             FileAttributes    = (int)Attributes,
             FileSizeHigh      = LongUtil.High(FileSize),
             FileSizeLow       = LongUtil.Low(FileSize),
             CreationTime      = DateTimeUtil.ToFileTime(CreationTime),
             LastAccessTime    = DateTimeUtil.ToFileTime(LastAccessTime),
             LastWriteTime     = DateTimeUtil.ToFileTime(LastWriteTime),
             Reserved0         = Reserved0,
             Reserved1         = Reserved1,
         };
         Marshal.StructureToPtr(findData, pFindData, false);
     }
 }