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);
     }
 }
예제 #3
0
        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>());
            }
        }
예제 #5
0
 public static extern NtStatus NtSetInformationJobObject(SafeKernelObjectHandle JobHandle, JobObjectInformationClass JobInfoClass,
                                                         SafeBuffer JobInformation, int JobInformationLength);
예제 #6
0
 static unsafe extern bool QueryInformationJobObject(
     IntPtr JobHandle,
     JobObjectInformationClass InformationClass,
     void *Buffer,
     int BufferLength,
     out int ReturnLength);
예제 #7
0
 internal static extern bool QueryInformationJobObject(SafeJobObjectHandle hJob, JobObjectInformationClass JobObjectInfoClass, IntPtr lpJobObjectInfo, int cbJobObjectInfoLength, out int lpReturnLength);
예제 #8
0
 internal static extern bool QueryInformationJobObject(SafeJobObjectHandle hJob, JobObjectInformationClass JobObjectInfoClass, [Out] out JOBOBJECT_LIMIT_VIOLATION_INFORMATION lpJobObjectInfo, int cbJobObjectInfoLength, IntPtr lpReturnLength);
예제 #9
0
 internal static extern bool QueryInformationJobObject(SafeJobObjectHandle hJob, JobObjectInformationClass JobObjectInfoClass, [Out] out JOBOBJECT_BASIC_UI_RESTRICTIONS lpJobObjectInfo, int cbJobObjectInfoLength, IntPtr lpReturnLength);
예제 #10
0
 internal static extern bool QueryInformationJobObject(SafeJobObjectHandle hJob, JobObjectInformationClass JobObjectInfoClass, [Out] out JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION lpJobObjectInfo, int cbJobObjectInfoLength, IntPtr lpReturnLength);
예제 #11
0
 internal static extern bool SetInformationJobObject(SafeJobObjectHandle hJob, JobObjectInformationClass JobObjectInfoClass, [In] ref JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION lpJobObjectInfo, int cbJobObjectInfoLength);
예제 #12
0
 internal static extern bool SetInformationJobObject(SafeJobObjectHandle hJob, JobObjectInformationClass JobObjectInfoClass, [In] ref JOBOBJECT_CPU_RATE_CONTROL_INFORMATION lpJobObjectInfo, int cbJobObjectInfoLength);
예제 #13
0
 internal static extern bool SetInformationJobObject(SafeJobObjectHandle hJob, JobObjectInformationClass JobObjectInfoClass, [In] ref JOBOBJECT_BASIC_UI_RESTRICTIONS lpJobObjectInfo, int cbJobObjectInfoLength);
예제 #14
0
 internal static extern bool SetInformationJobObject(SafeJobObjectHandle hJob, JobObjectInformationClass JobObjectInfoClass, [In] ref JOBOBJECT_END_OF_JOB_TIME_INFORMATION lpJobObjectInfo, int cbJobObjectInfoLength);
예제 #15
0
 internal static extern bool SetInformationJobObject(SafeJobObjectHandle hJob, JobObjectInformationClass JobObjectInfoClass, [In] ref JOBOBJECT_ASSOCIATE_COMPLETION_PORT lpJobObjectInfo, int cbJobObjectInfoLength);