分别在2台  win7 64上测试过,FileExists, 'C:\Windows\System32\adsldpc.dll‘   一台true  一台false不太确认是否是目录重定向引起

解决方案 »

  1.   

    这个问题很神奇 经过验证关闭重定向确确实是可以解决问题。
    但是让我疑惑的是C:\Windows\System32  有些文件FileExists为true有些false  来点大神解释下。
    按1楼方法关掉重定向 function DisableWowRedirection: Boolean;var
     OldWow64RedirectionValue: LongBool;function DisableWowRedirection: Boolean;
     type
     TWow64DisableWow64FsRedirection = function(var Wow64FsEnableRedirection: LongBool): LongBool; StdCall;var
     hHandle: THandle;
     Wow64DisableWow64FsRedirection: TWow64DisableWow64FsRedirection;
    begin
     Result := true;  try
       hHandle := GetModuleHandle('kernel32.dll');
       @Wow64DisableWow64FsRedirection := GetProcAddress(hHandle,'Wow64DisableWow64FsRedirection');  if ((hHandle <> 0) and (@Wow64DisableWow64FsRedirection <> nil)) then
        Wow64DisableWow64FsRedirection(OldWow64RedirectionValue);
      except
        Result := False;
      end;
    end;