[Windows Phone 7 Development and Hacking] mjmeans:
My gift... I discovered this .NET trick 4 years ago that allows execution of preassemblyed machine code in .NET. Someone doing WP7 development may want to see if this trick works in WP7 to bypass the Interop security exception in order to directly call the COM interfaces. Code is VB, sorry. You'll need to translate to C#. Maybe there is a way to use a similar trick in WP7.1.

Namespace MachineCode

<UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)> _
Public Delegate Sub MachineCodeDelegate(ByVal bufferptr As IntPtr)

<Flags()> _
Friend Enum AllocationTypes As UInteger
Commit = &H1000
Reserve = &H2000
Reset = &H80000
LargePages = &H20000000
Physical = &H400000
TopDown = &H100000
WriteWatch = &H200000
End Enum

<Flags()> _
Friend Enum MemoryProtections As UInteger
Execute = &H10
ExecuteRead = &H20
ExecuteReadWrite = &H40
ExecuteWriteCopy = &H80
NoAccess = &H1
[ReadOnly] = &H2
ReadWrite = &H4
WriteCopy = &H8
GuartModifierflag = &H100
NoCacheModifierflag = &H200
WriteCombineModifierflag = &H400
End Enum

<Flags()> _
Friend Enum FreeTypes As UInteger
Decommit = &H4000
Release = &H8000
End Enum

Public Class CpuId

Public Shared Function CallMachineCode(x86() As Byte, x64() As Byte) As Byte()
Dim buffer(Math.Max(x86.Length, x64.Length) - 1) As Byte

If IntPtr.Size = 4 Then
Dim p As IntPtr = NativeMethods.VirtualAlloc( _
IntPtr.Zero, _
New UIntPtr(CType(x86.Length, UInteger)), _
AllocationTypes.Commit Or AllocationTypes.Reserve, _
MemoryProtections.ExecuteReadWrite)
Try
Marshal.Copy(x86, 0, p, x86.Length)
Dim del As MachineCodeDelegate = CType(Marshal.GetDelegateForFunctionPointer(p, GetType(MachineCodeDelegate)), MachineCodeDelegate)
Dim sourceGCHandle As GCHandle = GCHandle.Alloc(buffer, GCHandleType.Pinned)
Dim sourceAddress As Integer = sourceGCHandle.AddrOfPinnedObject.ToInt32
del.Invoke(sourceAddress)
sourceGCHandle.Free()
Finally
NativeMethods.VirtualFree(p, 0, FreeTypes.Release)
End Try
ElseIf IntPtr.Size = 8 Then
Dim p As IntPtr = NativeMethods.VirtualAlloc( _
IntPtr.Zero, _
New UIntPtr(CType(x64.Length, UInteger)), _
AllocationTypes.Commit Or AllocationTypes.Reserve, _
MemoryProtections.ExecuteReadWrite)
Try
Marshal.Copy(x64, 0, p, x64.Length)
Dim del As MachineCodeDelegate = CType(Marshal.GetDelegateForFunctionPointer(p, GetType(MachineCodeDelegate)), MachineCodeDelegate)
Dim sourceGCHandle As GCHandle = GCHandle.Alloc(buffer, GCHandleType.Pinned)
Dim sourceAddress As Integer = sourceGCHandle.AddrOfPinnedObject.ToInt32
del.Invoke(sourceAddress)
sourceGCHandle.Free()
Finally
NativeMethods.VirtualFree(p, 0, FreeTypes.Release)
End Try
End If
Return buffer
End Function

#Region "ASM"
Private Shared x86 As Byte() = New Byte() { _
&H53, _
&H31, &HC0, _
&HF, &HA2, _
&H8B, &H44, &H24, &H8, _
&H89, &H18, _
&H89, &H50, &H4, _
&H89, &H48, &H8, _
&H5B, _
&HC3}
'0x53, // push %ebx
'0x31, 0xc0, // xor %eax,%eax
'0x0f, 0xa2, // cpuid
'0x8b, 0x44, 0x24, 0x08, // mov 0x8(%esp),%eax
'0x89, 0x18, // mov %ebx,0x0(%eax)
'0x89, 0x50, 0x04, // mov %edx,0x4(%eax)
'0x89, 0x48, 0x08, // mov %ecx,0x8(%eax)
'0x5b, // pop %ebx
'0xc3 // ret

Private Shared x64 As Byte() = New Byte() { _
&H49, &H89, &HD8, _
&H49, &H89, &HC9, _
&H48, &H31, &HC0, _
&HF, &HA2, _
&H4C, &H89, &HC8, _
&H89, &H18, _
&H89, &H50, &H4, _
&H89, &H48, &H8, _
&H4C, &H89, &HC3, _
&HC3}
'0x49, 0x89, 0xd8, // mov %rbx,%r8
'0x49, 0x89, 0xc9, // mov %rcx,%r9
'0x48, 0x31, 0xc0, // xor %rax,%rax
'0x0f, 0xa2, // cpuid
'0x4c, 0x89, 0xc8, // mov %r9,%rax
'0x89, 0x18, // mov %ebx,0x0(%rax)
'0x89, 0x50, 0x04, // mov %edx,0x4(%rax)
'0x89, 0x48, 0x08, // mov %ecx,0x8(%rax)
'0x4c, 0x89, 0xc3, // mov %r8,%rbx
'0xc3 // retq

#End Region

Private Class NativeMethods

Declare Auto Function VirtualAlloc Lib "kernel32.dll" ( _
ByVal lpAddress As IntPtr, _
ByVal dwSize As UIntPtr, _
ByVal flAllocationType As AllocationTypes, _
ByVal flProtect As MemoryProtections) As IntPtr

'[return: MarshalAs(UnmanagedType.Bool)]
Declare Auto Function VirtualFree Lib "kernel32.dll" ( _
ByVal lpAddress As IntPtr, _
ByVal dwSize As UIntPtr, _
ByVal flFreeType As FreeTypes) As Boolean

End Class

End Class

End Namespace