internal void FromSafeBuffer(SafeAlpcPortMessageBuffer buffer, NtAlpc port)
 {
     Header = buffer.Result;
     AllocatedDataLength = buffer.Length - _header_size;
     OnFromSafeBuffer(buffer, port);
     _port = port;
 }
Beispiel #2
0
 /// <summary>
 /// Create a safe buffer for this message.
 /// </summary>
 /// <returns>The safe buffer.</returns>
 public SafeAlpcPortMessageBuffer ToSafeBuffer()
 {
     using (SafeAlpcPortMessageBuffer buffer = new SafeAlpcPortMessageBuffer(Header, AllocatedDataLength)) {
         OnToSafeBuffer(buffer);
         return(buffer.Detach());
     }
 }
 /// <summary>
 /// Method to handle when FromSafeBuffer is called.
 /// </summary>
 /// <param name="buffer">The message buffer to initialize from..</param>
 /// <param name="port">The ALPC port associated with this message.</param>
 protected abstract void OnFromSafeBuffer(SafeAlpcPortMessageBuffer buffer, NtAlpc port);
 /// <summary>
 /// Method to handle when ToSafeBuffer is called.
 /// </summary>
 /// <param name="buffer">The message buffer being created.</param>
 protected abstract void OnToSafeBuffer(SafeAlpcPortMessageBuffer buffer);