public override void GatherGeneralSystemInformation(ref MachineInformation information)
        {
            try
            {
                var osVersionInfoEx = new OSVERSIONINFOEX();
                var success         = Win32APIProvider.ntdll_RtlGetVersion(ref osVersionInfoEx);

                if (success == NTSTATUS.STATUS_SUCCESS)
                {
                    if (osVersionInfoEx.MajorVersion >= 10)
                    {
                        win10 = true;
                    }
                }
            }
            catch (Exception e)
            {
                MachineInformationGatherer.Logger.LogError(e, "Encountered while parsing OS Version info");
            }
        }
 internal static extern NTSTATUS ntdll_RtlGetVersion(ref OSVERSIONINFOEX versionInfo);
Exemplo n.º 3
0
        public void GatherInformation(ref MachineInformation information)
        {
            var win10 = false;

            try
            {
                var osVersionInfoEx = new OSVERSIONINFOEX();
                var success         = Win32APIProvider.ntdll_RtlGetVersion(ref osVersionInfoEx);

                if (success == NTSTATUS.STATUS_SUCCESS)
                {
                    if (osVersionInfoEx.MajorVersion >= 10)
                    {
                        win10 = true;
                    }
                }
            }
            catch (Exception e)
            {
                MachineInformationGatherer.Logger.LogError(e, "Encountered while parsing OS Version info");
            }

            try
            {
                GatherWin32ProcessorInformation(ref information, win10);
            }
            catch (Exception e)
            {
                MachineInformationGatherer.Logger.LogError(e, "Encountered while parsing CPU info");
            }

            try
            {
                GatherWin32PhysicalMemory(ref information, win10);
            }
            catch (Exception e)
            {
                MachineInformationGatherer.Logger.LogError(e, "Encountered while parsing RAM info");
            }

            try
            {
                GatherWin32Bios(ref information, win10);
            }
            catch (Exception e)
            {
                MachineInformationGatherer.Logger.LogError(e, "Encountered while parsing BIOS info");
            }

            try
            {
                GatherWin32BaseBoard(ref information, win10);
            }
            catch (Exception e)
            {
                MachineInformationGatherer.Logger.LogError(e, "Encountered while parsing Mainboard info");
            }

            try
            {
                GatherWin32DiskDrive(ref information, win10);
            }
            catch (Exception e)
            {
                MachineInformationGatherer.Logger.LogError(e, "Encountered while parsing Disk info");
            }

            try
            {
                GatherWin32VideoController(ref information, win10);
            }
            catch (Exception e)
            {
                MachineInformationGatherer.Logger.LogError(e, "Encountered while parsing GPU info");
            }

            try
            {
                GatherWmiMonitorId(ref information, win10);
            }
            catch (Exception e)
            {
                MachineInformationGatherer.Logger.LogError(e, "Encountered while parsing Monitor info");
            }

            try
            {
                GatherPnpDevices(ref information, win10);
            }
            catch (Exception e)
            {
                MachineInformationGatherer.Logger.LogError(e, "Encountered while parsing USB info");
            }
        }