private void SetInfo <T>(JobObjectInformationClass info_class, T value) where T : new() { using (var buffer = value.ToBuffer()) { NtSystemCalls.NtSetInformationJobObject(Handle, info_class, buffer, buffer.Length).ToNtException(); } }
private T QueryInfoFixed <T>(JobObjectInformationClass info_class) where T : new() { using (var buffer = new SafeStructureInOutBuffer <T>()) { int ret_length; NtSystemCalls.NtQueryInformationJobObject(Handle, info_class, buffer, buffer.Length, out ret_length).ToNtException(); return(buffer.Result); } }
private T QueryStruct <T>(JobObjectInformationClass informationClass) where T : struct { int retLength; using (MemoryAlloc data = new MemoryAlloc(Marshal.SizeOf(typeof(T)))) { if (!Win32.QueryInformationJobObject(this, informationClass, data, data.Size, out retLength)) { data.Resize(retLength); if (!Win32.QueryInformationJobObject(this, informationClass, data, data.Size, out retLength)) { Win32.ThrowLastError(); } } return(data.ReadStruct <T>()); } }
private T QueryStruct <T>(JobObjectInformationClass informationClass, int size) where T : struct { int retLength; using (MemoryAlloc data = new MemoryAlloc(size)) { bool ret = Win32.QueryInformationJobObject(this, informationClass, data, data.Size, out retLength); int res = System.Runtime.InteropServices.Marshal.GetLastWin32Error(); if (!Win32.QueryInformationJobObject(this, informationClass, data, data.Size, out retLength)) { data.ResizeNew(retLength); if (!Win32.QueryInformationJobObject(this, informationClass, data, data.Size, out retLength)) { Win32.Throw(); } } return(data.ReadStruct <T>()); } }
public static extern NtStatus NtSetInformationJobObject(SafeKernelObjectHandle JobHandle, JobObjectInformationClass JobInfoClass, SafeBuffer JobInformation, int JobInformationLength);
static unsafe extern bool QueryInformationJobObject( IntPtr JobHandle, JobObjectInformationClass InformationClass, void *Buffer, int BufferLength, out int ReturnLength);
internal static extern bool QueryInformationJobObject(SafeJobObjectHandle hJob, JobObjectInformationClass JobObjectInfoClass, IntPtr lpJobObjectInfo, int cbJobObjectInfoLength, out int lpReturnLength);
internal static extern bool QueryInformationJobObject(SafeJobObjectHandle hJob, JobObjectInformationClass JobObjectInfoClass, [Out] out JOBOBJECT_LIMIT_VIOLATION_INFORMATION lpJobObjectInfo, int cbJobObjectInfoLength, IntPtr lpReturnLength);
internal static extern bool QueryInformationJobObject(SafeJobObjectHandle hJob, JobObjectInformationClass JobObjectInfoClass, [Out] out JOBOBJECT_BASIC_UI_RESTRICTIONS lpJobObjectInfo, int cbJobObjectInfoLength, IntPtr lpReturnLength);
internal static extern bool QueryInformationJobObject(SafeJobObjectHandle hJob, JobObjectInformationClass JobObjectInfoClass, [Out] out JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION lpJobObjectInfo, int cbJobObjectInfoLength, IntPtr lpReturnLength);
internal static extern bool SetInformationJobObject(SafeJobObjectHandle hJob, JobObjectInformationClass JobObjectInfoClass, [In] ref JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION lpJobObjectInfo, int cbJobObjectInfoLength);
internal static extern bool SetInformationJobObject(SafeJobObjectHandle hJob, JobObjectInformationClass JobObjectInfoClass, [In] ref JOBOBJECT_CPU_RATE_CONTROL_INFORMATION lpJobObjectInfo, int cbJobObjectInfoLength);
internal static extern bool SetInformationJobObject(SafeJobObjectHandle hJob, JobObjectInformationClass JobObjectInfoClass, [In] ref JOBOBJECT_BASIC_UI_RESTRICTIONS lpJobObjectInfo, int cbJobObjectInfoLength);
internal static extern bool SetInformationJobObject(SafeJobObjectHandle hJob, JobObjectInformationClass JobObjectInfoClass, [In] ref JOBOBJECT_END_OF_JOB_TIME_INFORMATION lpJobObjectInfo, int cbJobObjectInfoLength);
internal static extern bool SetInformationJobObject(SafeJobObjectHandle hJob, JobObjectInformationClass JobObjectInfoClass, [In] ref JOBOBJECT_ASSOCIATE_COMPLETION_PORT lpJobObjectInfo, int cbJobObjectInfoLength);