WinFsp on ARM64
This document summarizes the changes made to WinFsp to support Windows on ARM64. With these changes WinFsp runs natively in the ARM64 environment, while maintaining backwards compatibility.
Build System
-
Visual Studio 2019 or later is required to build WinFsp. Visual Studio 2015 builds are no longer possible because of lack of ARM64 support.
-
The script
tools\gensrc\remove-build-arm64.bat
can be used to remove the ARM64 configuration from the project files. This allows WinFsp to be built with Visual Studio 2015, but without ARM64 support. This is a hack to support AppVeyor builds on Server 2012 images that have only Visual Studio 2015 installed.
-
-
Build configuration is now done by the file
build.common.props
located inbuild\VStudio
. -
Product configuration (
MyProductName
, etc.) is done by the filebuild.version.props
located inbuild\VStudio
. This file was previously namedversion.properties
. -
Project files under
build\VStudio
have been updated to support ARM64 builds.
Include Files
-
The macros
FSP_FSCTL_PRODUCT_FULL_REGKEY
andFSP_FSCTL_PRODUCT_FILE_ARCH
have been added to header fileinc\winfsp\fsctl.h
:-
FSP_FSCTL_PRODUCT_FULL_REGKEY
: The full registry path for WinFsp. -
FSP_FSCTL_PRODUCT_FILE_ARCH
: The expected computer architecture suffix to use for file names (a64
for ARM64,x64
for x64,x86
for x86).
-
File System Driver
-
The
IoInitializeTimer
,IoStartTimer
andIoStopTimer
DDI’s are missing from Windows on ARM64 (link). The same functionality is now implemented within WinFsp in filesrc\sys\devtimer.c
-
The FSD (and other WinFsp components) used a number of memory barriers primarily for the purpose of lock-free access of certain variables. Most of these memory barriers have been removed and replaced with "interlocked" loads/stores so that any such accesses would continue to be correct under ARM64, which has weaker consistency guarantees than x86/x64. The new
FspInterlocked*
calls are implemented ininc/winfsp/fsctl.h
and are used by both kernel and user mode code.
Samples
-
The sample project files have been updated to support ARM64 builds.
Installer
-
The installer has been retrofitted to support native installation on ARM64, x64 and x86 environments.
-
The installer remains a single MSI file that supports all architectures.
-
NOTE: The current technique for detecting OS architecture relies on reading the registry value
PROCESSOR_ARCHITECTURE
from keyHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
. This may be fragile and a better technique may be required.
-
-
Files are installed in
\Program Files (x86)\WinFsp
on ARM64 and x64 Windows and\Program Files
on x86 Windows. -
Registry settings are placed in
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\WinFsp
on ARM64 and x64 Windows andHKEY_LOCAL_MACHINE\SOFTWARE\WinFsp
on x86 Windows. -
Files for all architectures are always installed regardless of OS architecture. For example, all of
winfsp-a64.dll
,winfsp-x64.dll
andwinfsp-x86.dll
are found in thebin
subdirectory on ARM64, x64 and x86 Windows. -
WinFsp supports x86 file systems on x86 Windows, x86 and x64 file systems on x64 Windows and x86, x64 and ARM64 file systems on ARM64 Windows.
License
-
The special exception for FLOSS to GPLv3 has been updated to mention that linking to
winfsp-a64.dll
is also allowed.