Show / Hide Table of Contents

Struct FileSystemRedirection

File system redirection functions. Can temporarily disable redirection, to allow this 32-bit process access the 64-bit System32 directory. Example: using (FileSystemRedirection r1 = new()) { r1.Disable(); ... }.

public struct FileSystemRedirection : IDisposable

Namespace: Au.More
Assembly: Au.dll

Methods

Name Description
Disable()

If osVersion.is32BitProcessAnd64BitOS, calls API Wow64DisableWow64FsRedirection, which disables file system redirection. The caller can call this without checking OS and process bitness. This function checks it and it is fast. Always call FileSystemRedirection.Revert or Dispose, for example use finally or using statement. Not calling it is more dangerous than a memory leak. It is not called by GC.

Dispose()

Calls FileSystemRedirection.Revert.

GetNonRedirectedSystemPath(string, bool)

If osVersion.is32BitProcessAnd64BitOS is true and path starts with folders.System, replaces that path part with folders.SystemX64. It disables redirection to folders.SystemX86 for that path.

IsSystem64PathIn32BitProcess(string)

Returns true if osVersion.is32BitProcessAnd64BitOS is true and path starts with folders.System. Most such paths are redirected, therefore you may want to disable redirection with this class.

Revert()

If redirected, calls API Wow64RevertWow64FsRedirection.