NanoByte.Common.Native.WindowsRestartManager.ListAppsInternal C# (CSharp) Method

ListAppsInternal() private method

private ListAppsInternal ( uint &arrayLength, System.NativeMethods &rebootReasons ) : NativeMethods.RM_PROCESS_INFO[]
arrayLength uint
rebootReasons System.NativeMethods
return NativeMethods.RM_PROCESS_INFO[]
        private NativeMethods.RM_PROCESS_INFO[] ListAppsInternal(out uint arrayLength, out NativeMethods.RM_REBOOT_REASON rebootReasons)
        {
            int ret;
            uint arrayLengthNeeded = 1;
            NativeMethods.RM_PROCESS_INFO[] processInfo;
            do
            {
                arrayLength = arrayLengthNeeded;
                processInfo = new NativeMethods.RM_PROCESS_INFO[arrayLength];
                ret = NativeMethods.RmGetList(_sessionHandle, out arrayLengthNeeded, ref arrayLength, processInfo, out rebootReasons);
            } while (ret == WindowsUtils.Win32ErrorMoreData);

            if (ret != 0) throw BuildException(ret);

            return processInfo;
        }
        #endregion