public static extern NtStatus NtAlpcQueryInformationMessage(
     SafeKernelObjectHandle PortHandle,
     AlpcPortMessage PortMessage,
     AlpcMessageInformationClass MessageInformationClass,
     IntPtr MessageInformation,
     int Length,
     IntPtr ReturnLength
     );
Ejemplo n.º 2
0
 /// <summary>
 /// Query a fixed structure from the object.
 /// </summary>
 /// <typeparam name="T">The type of structure to return.</typeparam>
 /// <param name="info_class">The information class to query.</param>
 /// <param name="port">The port which has processed the message.</param>
 /// <param name="default_value">A default value for the query.</param>
 /// <param name="throw_on_error">True to throw on error.</param>
 /// <returns>The result of the query.</returns>
 /// <exception cref="NtException">Thrown on error.</exception>
 public NtResult <T> Query <T>(NtAlpc port, AlpcMessageInformationClass info_class,
                               T default_value, bool throw_on_error) where T : new()
 {
     using (var buffer = new SafeStructureInOutBuffer <T>(default_value)) {
         return(QueryInformation(port, info_class,
                                 buffer, out int return_length).CreateResult(throw_on_error, () => buffer.Result));
     }
 }
 /// <summary>
 /// Method to query information for a message.
 /// </summary>
 /// <param name="info_class">The information class.</param>
 /// <param name="port">The port which has processed the message.</param>
 /// <param name="buffer">The buffer to return data in.</param>
 /// <param name="return_length">Return length from the query.</param>
 /// <returns>The NT status code for the query.</returns>
 public NtStatus QueryInformation(NtAlpc port, AlpcMessageInformationClass info_class,
                                  SafeBuffer buffer, out int return_length)
 {
     if (_port == null)
     {
         throw new ArgumentNullException("Message must be associated with a port");
     }
     return(NtSystemCalls.NtAlpcQueryInformationMessage(port.Handle, Header,
                                                        info_class, buffer, buffer.GetLength(), out return_length));
 }
 /// <summary>
 /// Query a fixed structure from the object.
 /// </summary>
 /// <typeparam name="T">The type of structure to return.</typeparam>
 /// <param name="port">The port which has processed the message.</param>
 /// <param name="info_class">The information class to query.</param>
 /// <returns>The result of the query.</returns>
 /// <exception cref="NtException">Thrown on error.</exception>
 public T Query <T>(NtAlpc port, AlpcMessageInformationClass info_class) where T : new()
 {
     return(Query(port, info_class, new T()));
 }
 /// <summary>
 /// Query a fixed structure from the object.
 /// </summary>
 /// <typeparam name="T">The type of structure to return.</typeparam>
 /// <param name="port">The port which has processed the message.</param>
 /// <param name="info_class">The information class to query.</param>
 /// <param name="default_value">A default value for the query.</param>
 /// <returns>The result of the query.</returns>
 /// <exception cref="NtException">Thrown on error.</exception>
 public T Query <T>(NtAlpc port, AlpcMessageInformationClass info_class, T default_value) where T : new()
 {
     return(Query(port, info_class, default_value, true).Result);
 }