コード例 #1
0
ファイル: MemArea.cs プロジェクト: fabrimaciel/colosoft
            public void RawRead(MmfFileView raw, int offset)
            {
                int count = raw.ReadInt32(offset);

                this.Data = new byte[count];
                raw.Read(this.Data, offset + 4, count);
            }
コード例 #2
0
ファイル: View.cs プロジェクト: fabrimaciel/colosoft
 public void RawWrite(MmfFileView view, int offset)
 {
     view.WriteUInt32(offset, this.Signature);
     offset += 4;
     view.WriteUInt32(offset, this.FreeSpace);
     offset += 4;
     view.WriteUInt32(offset, this.MaxFreeSpace);
 }
コード例 #3
0
ファイル: View.cs プロジェクト: fabrimaciel/colosoft
 public void RawRead(MmfFileView view, int offset)
 {
     this.Signature    = view.ReadUInt32(offset);
     offset           += 4;
     this.FreeSpace    = view.ReadUInt32(offset);
     offset           += 4;
     this.MaxFreeSpace = view.ReadUInt32(offset);
 }
コード例 #4
0
ファイル: View.cs プロジェクト: fabrimaciel/colosoft
 /// <summary>
 /// Abrea a visão.
 /// </summary>
 public virtual int Open()
 {
     _view = _mmf.MapView((ulong)(_vid * _size), _size);
     if (_view != null)
     {
         this.ReadHeader();
     }
     return(0);
 }
コード例 #5
0
ファイル: MemArea.cs プロジェクト: fabrimaciel/colosoft
 /// <summary>
 /// Escreve os dados na view informada.
 /// </summary>
 /// <param name="raw"></param>
 /// <param name="offset"></param>
 public void RawWrite(MmfFileView raw, int offset)
 {
     raw.WriteByte(offset, this.Status);
     offset++;
     raw.WriteUInt32(offset, this.Capacity);
     offset += 4;
     raw.WriteUInt32(offset, this.OffsetNext);
     offset += 4;
     raw.WriteUInt32(offset, this.OffsetPrev);
 }
コード例 #6
0
ファイル: MemArea.cs プロジェクト: fabrimaciel/colosoft
 /// <summary>
 /// Lê os dados da view informada.
 /// </summary>
 /// <param name="raw"></param>
 /// <param name="offset"></param>
 public void RawRead(MmfFileView raw, int offset)
 {
     this.Status = raw.ReadByte(offset);
     offset++;
     this.Capacity   = raw.ReadUInt32(offset);
     offset         += 4;
     this.OffsetNext = raw.ReadUInt32(offset);
     offset         += 4;
     this.OffsetPrev = raw.ReadUInt32(offset);
 }
コード例 #7
0
ファイル: View.cs プロジェクト: fabrimaciel/colosoft
 /// <summary>
 /// Fecha a <see cref="View"/>.
 /// </summary>
 public virtual int Close()
 {
     if (this.IsOpen)
     {
         _mmf.UnMapView(_view);
         _view  = null;
         _usage = 0;
     }
     return(0);
 }
コード例 #8
0
 public void UnMapView(MmfFileView view)
 {
     SafeNativeMethods.UnmapViewOfFile(view.ViewPtr);
 }
コード例 #9
0
ファイル: MemArea.cs プロジェクト: fabrimaciel/colosoft
 public void RawWrite(MmfFileView raw, int offset)
 {
     raw.WriteInt32(offset, this.Data.Length);
     raw.Write(this.Data, offset + 4, this.Data.Length);
 }