/// <summary>
        /// Get current waiting server information.
        /// </summary>
        /// <param name="throw_on_error">True to throw on error.</param>
        /// <returns>The thread ALPC server information.</returns>
        public NtResult <ThreadAlpcServerInformation> GetAlpcServerInformation(bool throw_on_error)
        {
            AlpcServerInformation info = new AlpcServerInformation()
            {
                ThreadHandle = Handle.DangerousGetHandle()
            };

            using (var buffer = info.ToBuffer(1024, true))
            {
                return(NtSystemCalls.NtAlpcQueryInformation(SafeKernelObjectHandle.Null, AlpcPortInformationClass.AlpcServerInformation,
                                                            buffer, buffer.Length, out int return_length).CreateResult(throw_on_error, () => new ThreadAlpcServerInformation(buffer.Result.Out)));
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Method to query information for this object type.
 /// </summary>
 /// <param name="info_class">The information class.</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 override NtStatus QueryInformation(AlpcPortInformationClass info_class, SafeBuffer buffer, out int return_length)
 {
     return(NtSystemCalls.NtAlpcQueryInformation(Handle, info_class, buffer, (int)buffer.ByteLength, out return_length));
 }