/// <summary> /// Associate a completion port with the job. /// </summary> /// <param name="port">The completion port.</param> /// <param name="key">The key associated with the port.</param> public void AssociateCompletionPort(NtIoCompletion port, IntPtr key) { JobObjectAssociateCompletionPort info = new JobObjectAssociateCompletionPort(); info.CompletionKey = key; info.CompletionPort = port.Handle.DangerousGetHandle(); SetInfo(JobObjectInformationClass.JobObjectAssociateCompletionPortInformation, info); }
/// <summary> /// Set an IO completion port on the resource manager. /// </summary> /// <param name="io_completion">The IO completion port.</param> /// <param name="completion_key">Associated completion key.</param> /// <param name="throw_on_error">True to throw on error.</param> /// <returns>The NT status code.</returns> public NtStatus SetIoCompletion(NtIoCompletion io_completion, IntPtr completion_key, bool throw_on_error) { return(Set(ResourceManagerInformationClass.ResourceManagerCompletionInformation, new ResourceManagerCompletionInformation() { IoCompletionPortHandle = io_completion.Handle.DangerousGetHandle(), CompletionKey = completion_key }, throw_on_error)); }
/// <summary> /// Set an IO completion port on the resource manager. /// </summary> /// <param name="io_completion">The IO completion port.</param> /// <param name="completion_key">Associated completion key.</param> public void SetIoCompletion(NtIoCompletion io_completion, IntPtr completion_key) { SetIoCompletion(io_completion, completion_key, true); }
protected override sealed NtResult <NtIoCompletion> OpenInternal(ObjectAttributes obj_attributes, IoCompletionAccessRights desired_access, bool throw_on_error) { return(NtIoCompletion.Open(obj_attributes, desired_access, throw_on_error)); }