Пример #1
0
        /// <summary>
        /// Determines the path to the base registry keys
        /// </summary>
        /// <returns>The path to the keys</returns>
        // Revision History
        // MM/DD/YY who Version Issue# Description
        // -------- --- ------- ------ ---------------------------------------
        // 12/03/10 RCG 2.45.14 153374 Created
        // 02/15/11 RCG 2.50.04 167806 Fixing issue where 32-bit machine could have Wow6432Node
        //                             registry key causing us to look in the wrong location

        public static string GetBaseRegistryKey()
        {
            string strBase = REG_KEY_BASE_32;

            if (OSVersionChecker.Is64BitOperatingSystem())
            {
                strBase = REG_KEY_BASE_64;
            }

            return(strBase);
        }
Пример #2
0
 public void TestWindowsXPAPI()
 {
     if (OSVersionChecker.IsWindowsXPSP2() && !OSVersionChecker.IsWindowsVista())
     {
         IWifiAdapterEnumerator enumerator = new XPWirelessEnumerator();
         List <string>          adapters   = enumerator.EnumerateWirelessAdapters();
         Assert.IsNotNull(adapters);
     }
     else
     {
         Assert.IsFalse(false, "Test is skipped when not run in Windows XP/SP2.");
     }
 }
Пример #3
0
        protected override void Capture(TraceEventSession session)//TODO: needs refactoring. too much logic and code in the same place.
        {
            if (OSVersionChecker.IsWindows7Or2008R2())
            {
                var dns = new DnsWin2008Parser(session.Source);
                session.EnableProvider(DnsWin2008Parser.ProviderName, providerLevel: TraceEventLevel.Informational,
                                       matchAnyKeywords: 0x8000000000000000);

                dns.DnsNameError += (Manifests.Dns.Win2008.DnsAllServersTimeoutArgs data) =>
                {
                    try
                    {
                        _sender.Send(data.ProcessID, data.QueryName, DNS_NAME_ERROR);
                    }
                    catch (ArgumentException)
                    {
                        //process is dead
                    }
                };

                dns.DnsServerTimeout += (Manifests.Dns.Win2008.DnsAllServersTimeoutArgs data) =>
                {
                    try
                    {
                        _sender.Send(data.ProcessID, data.QueryName, DNS_TIMED_OUT);
                    }
                    catch (ArgumentException)
                    {
                        //process is dead
                    }
                };
            }
            else
            {
                var dns = new DnsWin2012Parser(session.Source);
                session.EnableProvider(DnsWin2012Parser.ProviderGuid, TraceEventLevel.Informational,
                                       matchAnyKeywords: 0x8000000000000000);

                dns.DnsNameError += (Manifests.Dns.Win2012.DnsAllServersTimeoutArgs data) =>
                {
                    try
                    {   //TODO: identify only errors. currently it is getting all name resolutions
                        _sender.Send(data.ProcessID, data.QueryName, DNS_NAME_ERROR);
                    }
                    catch (ArgumentException)
                    {
                        //process is dead
                    }
                };

                dns.DnsServerTimeout += (Manifests.Dns.Win2012.DnsAllServersTimeoutArgs data) =>
                {
                    try
                    {
                        _sender.Send(data.ProcessID, data.QueryName, DNS_TIMED_OUT);
                    }
                    catch (ArgumentException)
                    {
                        //process is dead
                    }
                };
            }
        }