H0
''tell cpuid what we want
EAX = 0
''get address of Machine Code
VarAddr = VarPtr(MachineCode(0))
''get address of Sub Dummy
FunctAddr = GetAddress(AddressOf Dummy)
''copy the Machine Code to where it can be called
CopyMemory ByVal FunctAddr, ByVal VarAddr, 35 ''35 bytes machine code
''call it
On Error Resume Next ''apparently it gets a stack pointer error when in P-Code but i dont know why
CallWindowProc FunctAddr, EAX, VarPtr(CPUName(1)), VarPtr(CPUName(9)), VarPtr(CPUName(5))
''Debug.Print Err; Err.Description
''MsgBox Err & Err.Description
On Error GoTo 0
GetCpuName = StrConv(CPUName(), vbUnicode) ''UnicodeName
End Function
Private Function GetAddress(Address As Long) As Long
GetAddress = Address
End Function
Private Sub Dummy()
''the code below just reserves some space to copy the machine code into
''it is never executed
x = 0
x = 1
x = 2
x = 3
x = 4
x = 5
x = 6
x = 7
x = 8
x = 9
x = 10
x = 0
x = 1
x = 2
x = 3
x = 4
x = 5
x = 6
x = 7
x = 8
x = 9
x = 10
End Sub