Skip to content

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

Open
tyrielv wants to merge 1 commit into
microsoft:masterfrom
tyrielv:tyrielv/fix-filter-attach
Open

ProjFS: tolerate ACCESS_DENIED on FilterAttach, remove dead bundled-driver code#1980
tyrielv wants to merge 1 commit into
microsoft:masterfrom
tyrielv:tyrielv/fix-filter-attach

Conversation

@tyrielv
Copy link
Copy Markdown
Contributor

@tyrielv tyrielv commented May 19, 2026

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 tyrielv marked this pull request as ready for review May 19, 2026 21:06
@tyrielv 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 <tyrielv@gmail.com>
@tyrielv tyrielv force-pushed the tyrielv/fix-filter-attach branch from a70f58a to 1a5741b Compare May 19, 2026 21:32
@tyrielv tyrielv requested a review from KeithIsSleeping May 19, 2026 21:37
@tyrielv tyrielv enabled auto-merge May 22, 2026 20:27
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.

1 participant