WIP
DirectOutput framework for virtual pinball cabinets WIP
Go to:
Overview 
Kernel32Imports.cs
Go to the documentation of this file.
1 using System.Runtime.InteropServices;
2 using System;
3 
4 namespace DirectOutput.General
5 {
9  public class Kernel32Imports
10  {
17  [DllImport("kernel32.dll")]
18  public extern static int GetCurrentProcessorNumber();
19 
20 
21  private static bool GetCurrentProcessorNumberIsAvailableResult = false;
22  private static bool GetCurrentProcessorNumberIsAvailableChecked=false;
23  private static object GetCurrentProcessorNumberIsAvailableLocker = new object();
28  public static bool GetCurrentProcessorNumberIsAvailable
29  {
30  get
31  {
32  lock (GetCurrentProcessorNumberIsAvailableLocker)
33  {
34  if (GetCurrentProcessorNumberIsAvailableChecked) return GetCurrentProcessorNumberIsAvailableResult;
35  try
36  {
38  GetCurrentProcessorNumberIsAvailableResult = true;
39  }
40  catch (Exception)
41  {
42  GetCurrentProcessorNumberIsAvailableResult = false;
43  }
44  }
45  return GetCurrentProcessorNumberIsAvailableResult;
46  }
47  }
48 
49  }
50 }
static int GetCurrentProcessorNumber()
Gets the current processor number.
This class contains import of the kernel32.dll