Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學

SysWow64 資料夾是什麼?64 位元 Windows 執行 32 位元程式的核心機制

編輯:Windows 7 系統介紹

在 64 位元 Windows 的 C:\Windows\ 下,同時存在 System32 與 SysWOW64 兩個資料夾。名稱極易誤導:System32 存放 64 位元系統檔,SysWOW64 存放 32 位元系統檔。本文深入解析 WoW64 (Windows 32-bit on Windows 64-bit) 重導向機制與設計哲學。

核心架構:WoW64 子系統

  • WoW64 = Windows 32-bit on Windows 64-bit
  • 64 位元核心載入 32 位元使用者模式環境 (ntdll.dll、wow64.dll、wow64cpu.dll、wow64win.dll)
  • 32 位元程式以為自己運行在 32 位元系統:C:\Windows\System32 實際指向 SysWOW64

檔案系統重導向

為什麼不叫 System64 / System32?

相容性優先:數百萬既有 32 位元應用程式將 System32 硬編碼在路徑中。若 64 位元系統建立 System64,所有舊程式重新編譯才能正確存取系統檔案。微軟選擇:保留 System32 給 64 位元程式,將 32 位元程式透明重導向至 SysWOW64,零修改即可移植。

登錄表重導向

  • 32 位元程式存取 HKLM\Software\ → 重導向至 HKLM\Software\Wow6432Node\
  • 確保 32/64 位元程式設定隔離,避免衝突。

效能考量

重導向僅發生於 32 位元程式。64 位元程式直接存取 System32、Program Files、原生登錄表路徑,**零額外開銷**。犧牲 32 位元程式微小重導向成本,換取 64 位元原生效能最大化。

驗證實驗

  1. 32 位元 CMD:Win+R → %windir%\SysWOW64\cmd.exe → echo %ProgramFiles% → 輸出 C:\Program Files (x86)
  2. 64 位元 CMD:Win+R → cmd.exe → echo %ProgramFiles% → 輸出 C:\Program Files

結論

SysWOW64 是 64 位元 Windows 為了執行 32 位元應用程式而建立的「32 位元系統檔案倉庫」。名稱含義:System Windows on Windows 64。這是微軟為相容性付出的精妙工程代價。

彩蛋:Windows 版本號謎題

Win+R → winver → Windows 7 顯示版本 6.1。因 Vista 為 6.0,許多舊程式只檢查主版本號 ≠ 5 即拒絕執行 (以為是 Win2000 之前)。微軟吸取教訓,Win7 保持 6.x 避免相容性災難,或許未來永遠不會有 Windows 7.0 版本號。

Copyright © Windows教程網 All Rights Reserved
32 位元程式請求路徑實際重導向至備註
C:\Windows\System32\C:\Windows\SysWOW64\核心重導向
C:\Program Files\C:\Program Files (x86)\程式檔案重導向
%windir%\System32\drivers\不重導向驅動程式必須 64 位元