Exemple #1
0
        internal Job()
        {
            m_Job = Native.CreateJobObject(IntPtr.Zero, null);
            Native.ThrowOnFailure(() => m_Job != IntPtr.Zero);

            var lpJobObjectInfo = new Native.JOBOBJECT_EXTENDED_LIMIT_INFORMATION
                {
                    BasicLimitInformation =
                    {
                        LimitFlags = Native.JOB_OBJECT_LIMIT.JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE
                    }
                };

            Native.ThrowOnFailure(() => Native.SetInformationJobObject(m_Job, Native.JobObject.JobObjectExtendedLimitInformation, ref lpJobObjectInfo, (uint)Marshal.SizeOf(typeof(Native.JOBOBJECT_EXTENDED_LIMIT_INFORMATION))));
        }
Exemple #2
0
        internal Job()
        {
            m_Job = Native.CreateJobObject(IntPtr.Zero, null);
            Native.ThrowOnFailure(() => m_Job != IntPtr.Zero);

            var lpJobObjectInfo = new Native.JOBOBJECT_EXTENDED_LIMIT_INFORMATION
            {
                BasicLimitInformation =
                {
                    LimitFlags = Native.JOB_OBJECT_LIMIT.JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE
                }
            };

            Native.ThrowOnFailure(() => Native.SetInformationJobObject(m_Job, Native.JobObject.JobObjectExtendedLimitInformation, ref lpJobObjectInfo, (uint)Marshal.SizeOf(typeof(Native.JOBOBJECT_EXTENDED_LIMIT_INFORMATION))));
        }