Skip to content

ProjFS: tolerate ACCESS_DENIED on FilterAttach, remove dead bundled-driver code - #1980

Merged
Tyrie Vella (tyrielv) merged 1 commit into
microsoft:masterfrom
tyrielv:tyrielv/fix-filter-attach
May 26, 2026
Merged

Tyrie Vella (tyrielv) merged 1 commit into
microsoft:masterfrom
tyrielv:tyrielv/fix-filter-attach

Conversation

@tyrielv

@tyrielv Tyrie Vella (tyrielv) commented May 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Updates to improve resilience around GVFS failed to attach filter driver with result 2147942405 (0x80070005 / ACCESS_DENIED).

The ProjFS filter driver and native library are no longer bundled with the GVFS installer — ProjFS is required as a Windows Optional Feature (available since Windows 10 1809, our minimum supported OS). This PR removes the dead code paths that referenced those bundled files and fixes the FilterAttach ACCESS_DENIED error.

Changes

Fix FilterAttach ACCESS_DENIED

  • Add TryAttachToVolume() that tolerates ACCESS_DENIED when the ProjFS service is already running (the filter is already attached to the volume but the caller lacks SE_LOAD_DRIVER_PRIVILEGE).
  • The service-side EnableAndAttachProjFSHandler.Run() now uses TryAttachToVolume instead of raw TryAttach, matching the tolerance already present in the client-side IsReady() path.
  • Fix Run() to preserve the first error from TryEnablePrjFlt instead of potentially overwriting it with a subsequent attach error.

Remove dead non-inbox ProjFS code paths

  • Remove TryInstallProjFSViaINF (referenced {app}\Filter\prjflt.inf which is no longer shipped).
  • Remove TryCopyNativeLibIfDriverVersionsMatch and supporting methods (referenced {app}\Filter\prjflt.sys and {app}\ProjFS\ProjectedFSLib.dll which are no longer shipped).
  • Simplify TryEnableOrInstallDriver to always use the Windows Optional Feature path; keep build number logging as best-effort telemetry.
  • Simplify IsNativeLibInstalled to require System32; warn if stale app-local DLL found from a legacy non-inbox install.

Improve error messaging

  • When ProjFS native library is missing, error now includes the PowerShell command to enable the optional feature.
  • When ProjFS cannot be enabled, error directs user to the optional feature instead of referencing non-existent bundled files.

Testing

  • Unit tests updated and passing (3/3 ProjFSFilterTests).
  • Installer Setup.iss legacy cleanup left intact (still needed for old→new upgrades).

Stats

3 files changed, 80 insertions, 412 deletions

@tyrielv
Tyrie Vella (tyrielv) marked this pull request as ready for review May 19, 2026 21:06
@tyrielv
Tyrie Vella (tyrielv) force-pushed the tyrielv/fix-filter-attach branch 4 times, most recently from 4e580fa to a70f58a Compare May 19, 2026 21:29
…river code

The ProjFS filter driver and native library are no longer bundled with
the GVFS installer — ProjFS is required as a Windows Optional Feature
(available since Windows 10 1809, our minimum supported OS).

Fix FilterAttach ACCESS_DENIED (bug 62349777):
- Add TryAttachToVolume() that tolerates ACCESS_DENIED when the ProjFS
  service is already running (the filter is already attached to the
  volume but the caller lacks SE_LOAD_DRIVER_PRIVILEGE).
- The service-side EnableAndAttachProjFSHandler.Run() now uses
  TryAttachToVolume instead of raw TryAttach, matching the tolerance
  already present in the client-side IsReady() path.
- Fix Run() to preserve the first error from TryEnablePrjFlt instead
  of potentially overwriting it with a subsequent attach error.

Remove dead non-inbox ProjFS code paths:
- Remove TryInstallProjFSViaINF (referenced {app}\Filter\prjflt.inf
  which is no longer shipped).
- Remove TryCopyNativeLibIfDriverVersionsMatch and supporting methods
  (referenced {app}\Filter\prjflt.sys and {app}\ProjFS\ProjectedFSLib.dll
  which are no longer shipped).
- Simplify TryEnableOrInstallDriver to always use the Windows Optional
  Feature path; keep build number logging as best-effort telemetry.
- Simplify IsNativeLibInstalled to require System32; warn if stale
  app-local DLL found from a legacy non-inbox install.

Improve error messaging:
- When ProjFS native library is missing, error now includes the
  PowerShell command to enable the optional feature.
- When ProjFS cannot be enabled, error directs user to the optional
  feature instead of referencing non-existent bundled files.

Assisted-by: Claude Opus 4.6
Signed-off-by: Tyler Vella <[email protected]>
@tyrielv
Tyrie Vella (tyrielv) merged commit 781ff2c into microsoft:master May 26, 2026
51 checks passed
Tyrie Vella (tyrielv) added a commit that referenced this pull request Jul 15, 2026
PR #1980 made TryAttachToVolume tolerate ACCESS_DENIED from FilterAttach
whenever the ProjFS service is running. Because both callers share this
method, the elevated GVFS.Service (running as LocalSystem) also began
swallowing ACCESS_DENIED — but the service holds SE_LOAD_DRIVER_PRIVILEGE,
so ACCESS_DENIED there is never the benign "unprivileged caller" case. It
signals a real problem (AV/EDR lock, Group Policy, or driver corruption),
and tolerating it lets a broken mount proceed instead of surfacing an
actionable error. Before #1980 the service called raw TryAttach and
reported that failure.

FilterAttach's ACCESS_DENIED is a privilege gate, not a transient
contention error: an unelevated caller always gets it (regardless of the
actual attach state), while an elevated caller only gets it when something
is genuinely wrong. Narrow the tolerance to unelevated callers so the
unelevated `gvfs mount` fix is preserved while the elevated service once
again surfaces genuine attach failures. This also aligns the code with the
existing comment's stated intent ("when the caller lacks this privilege").

Assisted-by: Claude Opus 4.8
Signed-off-by: Tyrie Vella <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants