파일 시스템 리디렉션은 %windir%\system32
디렉토리에만 존재합니다. description of the File System Redirector이이를 분명하게 보여줍니다.
주 페이지에서 주석이
응용 프로그램은 %의 ProgramFiles %의 디렉토리 이름을 결정하기 위해 SHGetSpecialFolderPath
기능을 사용해야합니다.
편집는 FOLDERID_ProgramFilesx64은 64 비트 윈도우에서 실행되는 32 비트 응용 프로그램에서 작동하지 않는 것으로 밝혀졌습니다. 이 경우 환경 변수 %ProgramW6432%
을 대신 사용할 수 있습니다. 이 변수는 이고 Windows 32 비트 응용 프로그램의 경우 Windows 7 이상에서 사용할 수있는 것은입니다. 당신은 윈도우 64 비트 버전의 경우
GetEnvironmentString('%ProgramW6432%');
은 다음 32 비트 응용 프로그램이 명시 적으로 FOLDERID_ProgramFilesX64
에 사용할 수 없습니다 :
function GetEnvironmentString(aString : string) : string;
var
dest : string;
retSize : integer;
begin
SetLength(dest, MAX_PATH);
retSize := ExpandEnvironmentStrings(pchar(aString), pchar(dest), MAX_PATH);
if retSize > 0 then
SetLength(dest, retSize - 1);
result := dest;
end;
로 호출 :
다음 델파이 조각은 변수에 접근 허용 Program Files
의 64 비트 위치를 얻지 만 대신 환경 변수 확장을 사용할 수 있습니다. 32 비트 버전의 Windows에서는이 위치가 잘못되어 값을 얻을 수 없습니다. 이 변수에 액세스하기 전에 시스템의 비트를 점검해야합니다.
이 기능을 확인하려면 IsWow64Process 함수를 사용할 수 있습니다. 요약에서
function IsWow64: Boolean;
type
TIsWow64Process = function(Handle: Windows.THandle; var Res: Windows.BOOL): Windows.BOOL; stdcall;
var
IsWow64Result: Windows.BOOL;
IsWow64Process: TIsWow64Process;
begin
// Try to load required function from kernel32
IsWow64Process := Windows.GetProcAddress(Windows.GetModuleHandle('kernel32.dll'), 'IsWow64Process');
if Assigned(IsWow64Process) then
begin
// Function is implemented: call it
if not IsWow64Process(Windows.GetCurrentProcess, IsWow64Result) then
raise SysUtils.Exception.Create('IsWow64: bad process handle');
// Return result of function
Result := IsWow64Result;
end
else
// Function not implemented: can't be running on Wow64
Result := False;
end;
: FOLDERID_ProgramFiles
당신에게 32/64 비트 프로그램에서 액세스 32/64 비트 변형을 제공 FOLDERID_ProgramFilesX64
64에 당신에게 명시 적으로 64 비트 버전을 제공하는 following snippet는 당신이 확인할 수 있도록해야한다 그리고 FOLDERID_ProgramFilesX86
은 32 비트 변형을 명시 적으로 제공합니다. 환경 변수 확장을 사용하여 32 비트 응용 프로그램에서 64 비트 값을 얻을 수 있습니다.
Wow64DisableWow64FsRedirection 부분의 상태를 언제 보여줄 수 있습니까? – BugFinder
Wow64DisableWow64FsRedirection은 "C : \ program files"로 시작하는 경로에 영향을 미칩니 까? – user382591
프로그램 파일 폴더가 리디렉션되지 않습니다. –