How can disable redirection on win64

There are Win32 functions available that can disable and enable redirection.

[DllImport("kernel32.dll", SetLastError = true)]
static extern bool Wow64DisableWow64FsRedirection(ref IntPtr ptr);

[DllImport("kernel32.dll", SetLastError = true)]
static extern bool Wow64RevertWow64FsRedirection(IntPtr ptr);

Example:

IntPtr wow64Value = IntPtr.Zero;

// Disable redirection.
Wow64DisableWow64FsRedirection(ref wow64Value);

// Do whatever you need
// .....................

// Re-enable redirection.
Wow64RevertWow64FsRedirection(wow64Value);

Leave a Comment