Cpu id

I found this API
Code:
Private Declare Sub GetSystemInfo Lib "kernel32.dll" (ByRef lpSystemInfo As SYSTEM_INFO)
    Private Structure SYSTEM_INFO
        Public dwOemID As Int32
        Public dwPageSize As Int32
        Public lpMinimumApplicationAddress As Int32
        Public lpMaximumApplicationAddress As Int32
        Public dwActiveProcessorMask As Int32
        Public dwNumberOrfProcessors As Int32
        Public dwProcessorType As Int32
        Public dwAllocationGranularity As Int32
        Public dwReserved As Int32
    End Structure
 
Last edited by a moderator:
I dont know. Try some things:
IntPtr ptr = GetSystemInfo.SYSTEM_INFO.dwProcessorType;
That is C# syntax.
Fool around a little and you will probably get it.
By the way, you need to copy and paste AndreRyans code into your app first.
 
Code:
    Private Declare Sub GetSystemInfo Lib "kernel32.dll" (ByRef lpSystemInfo As SYSTEM_INFO)
    Private Structure SYSTEM_INFO
        Public dwOemID As Int32
        Public dwPageSize As Int32
        Public lpMinimumApplicationAddress As Int32
        Public lpMaximumApplicationAddress As Int32
        Public dwActiveProcessorMask As Int32
        Public dwNumberOrfProcessors As Int32
        Public dwProcessorType As Int32
        Public dwAllocationGranularity As Int32
        Public dwReserved As Int32
    End Structure

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim s As SYSTEM_INFO
        GetSystemInfo(s)
        MsgBox(s.dwProcessorType & Chr(10) & s.dwNumberOrfProcessors & Chr(10) & s.dwPageSize)
    End Sub
 
Back
Top