/// <summary> /// Create an ALPC port. /// </summary> /// <param name="port_name">The name of the port to create.</param> /// <param name="port_attributes">The attributes for the port.</param> /// <returns>The created object.</returns> /// <exception cref="NtException">Thrown on error.</exception> public static NtAlpc Create(string port_name = null, AlpcPortAttributes port_attributes = null) { using (var obj_attr = new ObjectAttributes(port_name, AttributeFlags.CaseInsensitive)) { return(Create(obj_attr, port_attributes)); } }
/// <summary> /// Connect to an ALPC port. /// </summary> /// <param name="port_name">The name of the port to connect to.</param> /// <param name="port_attributes">Attributes for the port.</param> /// <returns>The connected ALPC port object.</returns> public static NtAlpc Connect(string port_name, AlpcPortAttributes port_attributes = null) { AlpcPortAttributes attrs = new AlpcPortAttributes(); NtSystemCalls.NtAlpcConnectPort(out SafeKernelObjectHandle handle, new UnicodeString(port_name), null, port_attributes, 0).ToNtException(); return(new NtAlpc(handle, true)); }
public static extern NtStatus NtAlpcConnectPortEx( out SafeKernelObjectHandle PortHandle, [In] ObjectAttributes ConnectionPortObjectAttributes, [Optional, In] ObjectAttributes ClientPortObjectAttributes, [Optional, In] AlpcPortAttributes PortAttributes, uint Flags, [Optional] IntPtr ServerSecurityRequirements, // SECURITY_DESCRIPTOR [Optional, In, Out] AlpcPortMessage ConnectionMessage, [Optional, In, Out] OptionalLength BufferLength, [Optional, In, Out] AlpcMessageAtributes OutMessageAttributes, [Optional, In, Out] AlpcMessageAtributes InMessageAttributes, [Optional, In] LargeInteger Timeout);
public static extern NtStatus NtAlpcConnectPort( out SafeKernelObjectHandle PortHandle, [In] UnicodeString PortName, [Optional, In] ObjectAttributes ObjectAttributes, [Optional, In] AlpcPortAttributes PortAttributes, uint Flags, [Optional] IntPtr RequiredServerSid, [Optional, In, Out] AlpcPortMessage ConnectionMessage, [Optional, In, Out] OptionalInt32 BufferLength, [Optional, In, Out] AlpcMessageAtributes OutMessageAttributes, [Optional, In, Out] AlpcMessageAtributes InMessageAttributes, [Optional, In] LargeInteger Timeout );
public static extern NtStatus NtAlpcCreatePort( out SafeKernelObjectHandle PortHandle, [In] ObjectAttributes ObjectAttributes, AlpcPortAttributes PortAttributes );
/// <summary> /// Create an ALPC port. /// </summary> /// <param name="object_attributes">The object attributes for the port.</param> /// <param name="port_attributes">The attributes for the port.</param> /// <returns>The created object.</returns> /// <exception cref="NtException">Thrown on error.</exception> public static NtAlpc Create(ObjectAttributes object_attributes, AlpcPortAttributes port_attributes) { return(Create(object_attributes, port_attributes, true).Result); }
/// <summary> /// Create an ALPC port. /// </summary> /// <param name="object_attributes">The object attributes for the port.</param> /// <param name="port_attributes">The attributes for the port.</param> /// <param name="throw_on_error">True to throw on error.</param> /// <returns>The created object.</returns> public static NtResult <NtAlpc> Create(ObjectAttributes object_attributes, AlpcPortAttributes port_attributes, bool throw_on_error) { return(NtSystemCalls.NtAlpcCreatePort(out SafeKernelObjectHandle handle, object_attributes, port_attributes).CreateResult(throw_on_error, () => new NtAlpc(handle))); }