アプリケーションからGetSystemWow64Direcoryメソッドを使用しようとしています。PInvoke.netのサンプルは正しくないようです。アンマネージ呼び出しに渡す前に配列を固定する必要はありませんか?
[DllImport("Kernel32.dll")]
public static extern int GetSystemWow64Directory([In, Out] char[] lpBuffer
[MarshalAs(UnmanagedType.U4)] uint size);
char[] path = new char[256];
int result = GetSystemWow64Directory(path, (uint)path.Length);
if (result != 0)
MessageBox.Show(new String(path, 0, result));