[DllImport("coredll", SetLastError = true)]
public static extern void GetSystemInfo(out SYSTEM_INFO pSi);
Declare Function GetSystemInfo Lib "coredll.dll" (TODO) As TODO
SYSTEM_INFO on MSDN
[StructLayout(LayoutKind.Sequential)]
public struct SYSTEM_INFO
{
[MarshalAs(UnmanagedType.U4)]
public int dwOemId;
[MarshalAs(UnmanagedType.U4)]
public int dwPageSize;
public uint lpMinimumApplicationAddress;
public uint lpMaximumApplicationAddress;
[MarshalAs(UnmanagedType.U4)]
public int dwActiveProcessorMask;
[MarshalAs(UnmanagedType.U4)]
public int dwNumberOfProcessors;
[MarshalAs(UnmanagedType.U4)]
public int dwProcessorType;
[MarshalAs(UnmanagedType.U4)]
public int dwAllocationGranularity;
[MarshalAs(UnmanagedType.U2)]
public short dwProcessorLevel;
[MarshalAs(UnmanagedType.U2)]
public short dwProcessorRevision;
}
Do you know one? Please contribute it!
Please add some!
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace Test
{
[StructLayout(LayoutKind.Sequential)]
public struct SYSTEM_INFO
{
[MarshalAs(UnmanagedType.U4)]
public int dwOemId;
[MarshalAs(UnmanagedType.U4)]
public int dwPageSize;
public uint lpMinimumApplicationAddress;
public uint lpMaximumApplicationAddress;
[MarshalAs(UnmanagedType.U4)]
public int dwActiveProcessorMask;
[MarshalAs(UnmanagedType.U4)]
public int dwNumberOfProcessors;
[MarshalAs(UnmanagedType.U4)]
public int dwProcessorType;
[MarshalAs(UnmanagedType.U4)]
public int dwAllocationGranularity;
[MarshalAs(UnmanagedType.U2)]
public short dwProcessorLevel;
[MarshalAs(UnmanagedType.U2)]
public short dwProcessorRevision;
}
class Program
{
[DllImport("coredll", SetLastError = true)]
public static extern void GetSystemInfo(out SYSTEM_INFO pSi);
static void Main(string[] args)
{
SYSTEM_INFO si;
GetSystemInfo(out si);
}
}
}