public void ExplicitLayoutTest(Int32 testIterations)
        {
            Console.WriteLine("Test Iteration for each type: {0}", testIterations);
            // Blittable reference type with explicit struct layout
            // Start with a fresh managed heap
            GC.Collect();
            GC.WaitForPendingFinalizers();
            GC.Collect();

            // Start time
            DateTime start = DateTime.Now;

            // Create the marshalled instance and perform calls
            OSVersionInfoEx_Layout_Explicit info_explicit_layout = new OSVersionInfoEx_Layout_Explicit();

            for (Int32 index = 0; index < testIterations; index++)
            {
                // We will not user wrapper method so that we can test on pure performance
                // WrapperGetVersionEx_Layout_Explicit(out info_explicit_layout);
                GetVersionEx_Layout_Explicit(info_explicit_layout);
            }

            // End time
            TimeSpan span = DateTime.Now - start;

            // Output results
            Console.WriteLine("Explicit layout blittable type marshalling took : \t{0} secs", span.TotalSeconds);

            // Dump version info
            Console.WriteLine("{0}Current system version information:", Environment.NewLine);
            Console.WriteLine("OSVersionInfoSize: \t{0}", info_explicit_layout.OSVersionInfoSize);
            Console.WriteLine("MajorVersion: \t\t{0}", info_explicit_layout.MajorVersion);
            Console.WriteLine("MinorVersion: \t\t{0}", info_explicit_layout.MinorVersion);
            Console.WriteLine("BuildNumber: \t\t{0}", info_explicit_layout.BuildNumber);
            Console.WriteLine("PlatformId: \t\t{0}", info_explicit_layout.PlatformId);
            Console.WriteLine("ServicePackMajor: \t{0}", info_explicit_layout.ServicePackMajor);
            Console.WriteLine("ServicePackMinor: \t{0}", info_explicit_layout.ServicePackMinor);
            Console.WriteLine("SuiteMask: \t\t{0}", info_explicit_layout.SuiteMask);
            Console.WriteLine("ProductType: \t\t{0}", info_explicit_layout.ProductType);
            Console.WriteLine("Reserved: \t\t{0}", info_explicit_layout.Reserved);
            Console.WriteLine();
        }
 private static extern Boolean GetVersionEx_Layout_Explicit(OSVersionInfoEx_Layout_Explicit versionInfor);
 /// <summary>
 /// ���Ƕ�Win32 API����GetVersionEx���з�װ��İ�װ����
 /// </summary>
 /// <param name="type"></param>
 public void WrapperGetVersionEx_Layout_Explicit(OSVersionInfoEx_Layout_Explicit versionInfo)
 {
     if (!GetVersionEx_Layout_Explicit(versionInfo))
     {
         // ���ʧ�ܣ�������Ĵ����룬���׳���Ӧ��Win32�쳣
         Int32 err = Marshal.GetLastWin32Error();
         throw new Win32Exception(err);
     }
 }