Вот урезанный код:
Код: Выделить всё
[DllImport("kernel32.dll", SetLastError = true)]
public static extern bool Wow64DisableWow64FsRedirection(ref IntPtr ptr);
[DllImport("kernel32.dll", SetLastError = true)]
public static extern bool Wow64RevertWow64FsRedirection(IntPtr ptr);
....
string myDLL = "c:\\windows\\system32\\my.dll";
IntPtr ptr = new IntPtr();
Wow64DisableWow64FsRedirection(ref ptr);
var ver = new Version(FileVersionInfo.GetVersionInfo(myDLL).FileVersion);
Debug.WriteLine(String.Format("file={0} ver={1}", myDLL, ver));
Wow64RevertWow64FsRedirection(ptr);