System.Diagnostics.Process.GetWorkingSetLimits C# (CSharp) Method

GetWorkingSetLimits() private method

Get the minimum and maximum working set limits.
private GetWorkingSetLimits ( IntPtr &minWorkingSet, IntPtr &maxWorkingSet ) : void
minWorkingSet System.IntPtr
maxWorkingSet System.IntPtr
return void
        private void GetWorkingSetLimits(out IntPtr minWorkingSet, out IntPtr maxWorkingSet)
        {
            SafeProcessHandle handle = null;
            try
            {
                handle = GetProcessHandle(Interop.Advapi32.ProcessOptions.PROCESS_QUERY_INFORMATION);

                // GetProcessWorkingSetSize is not exposed in coresys.  We use 
                // GetProcessWorkingSetSizeEx instead which also returns FLAGS which give some flexibility
                // in terms of Min and Max values which we neglect.
                int ignoredFlags;
                if (!Interop.Kernel32.GetProcessWorkingSetSizeEx(handle, out minWorkingSet, out maxWorkingSet, out ignoredFlags))
                {
                    throw new Win32Exception();
                }
            }
            finally
            {
                ReleaseProcessHandle(handle);
            }
        }