1
0
mirror of https://github.com/winfsp/winfsp.git synced 2026-06-04 11:56:54 -05:00

Compare commits

..

52 Commits

Author SHA1 Message Date
Bill Zissimopoulos 0a89d2ecaf tools: make-release: add new signatures 2026-04-22 18:21:32 +03:00
Bill Zissimopoulos d9ffc24334 changelog: 2026 Beta1 2026-04-22 18:16:39 +03:00
Bill Zissimopoulos 624f285452 update source copyright for 2026 2026-03-04 15:54:27 +02:00
Bill Zissimopoulos 6ab7532d5b Merge branch 'pvt-np-nolaunch' 2026-03-04 15:25:53 +02:00
Bill Zissimopoulos cc533632a2 build: version 2026 Beta1 2026-03-04 15:23:14 +02:00
Bill Zissimopoulos 8b1e2d3020 build,tools: updates for new EV cert 2026-03-04 15:16:54 +02:00
Bill Zissimopoulos 7f82326454 sys: FspFastIoDeviceControl: add a couple of fixes
- Check that the operation succeeded prior to copying to the output buffer.
- Avoid information leaks by only copying what is necessary to the output
buffer (suggestion by Tay Kiat Loong).
2026-02-17 20:48:01 +02:00
Bill Zissimopoulos 13d306f586 sys: FspFastIoDeviceControl: check input/output buffer lengths 2026-02-17 17:07:28 +02:00
Bill Zissimopoulos ae40f0edb1 sys: FspFastIoDeviceControl: fix exploit reported by Tay Kiat Loong
The WinFsp "transact" protocol is used by user mode file systems to interface
with the FSD. This protocol works via the DeviceIoControl API and uses the
FSP_IOCTL_TRANSACT control code. The FSP_IOCTL_TRANSACT code is marked as
METHOD_BUFFERED.

When the DeviceIoControl call is forwarded as an IRP, the METHOD_BUFFERED flag
instructs the kernel to copy user mode buffers to kernel mode buffers (and
vice-versa). However when the DeviceIoControl call is forwarded via the FastIO
mechanism the METHOD_BUFFERED flag is ignored. This means that when WinFsp
added support for DeviceIoControl FastIO, the FSD started accessing user mode
buffers directly.

This means that a malicious file system could attempt exploits like changing
or freeing a buffer while the FSD is reading it. Tay Kiat Loong developed a
POC exploit which demonstrated this vulnerability.

This commit fixes the problem by patching FspFastIoDeviceControl to add the
missing METHOD_BUFFERED handling.
2026-02-17 15:21:35 +02:00
Bill Zissimopoulos aed8bb745f Merge pull request #648 from chenjie4255/add_write_ea_perm
dll & fuse: Added "AddWriteEaPerm" mount option.
2026-02-05 12:07:23 +02:00
ethan 4dbea1f298 dll & fuse: Added "AddWriteEaPerm" mount option. 2026-02-05 12:09:19 +08:00
Bill Zissimopoulos f021496302 np: NPAddConnection: support file systems not managed by the launcher 2026-02-03 21:03:04 +02:00
Bill Zissimopoulos 2aa682ffa1 Merge pull request #626 from chenjie4255/directio
dll: add support for disabling directio.
2025-12-24 11:18:13 +00:00
ethan ccd75d7c47 remove outdated comments 2025-12-24 09:28:37 +08:00
ethan fbbb4c3de1 dll: add fuse directio flag support 2025-12-23 17:05:48 +08:00
Bill Zissimopoulos 4045ce2d19 Merge pull request #625 from tomgr/doc-add-buildbarn
doc: add bb-remote-execution to known file systems
2025-08-21 15:32:40 +03:00
Thomas Gibson-Robinson 5d8c692845 doc: add bb-remote-execution to known file systems 2025-08-20 09:55:16 +01:00
Bill Zissimopoulos 5b429bc445 Merge pull request #614 from chenjie4255/flush_on_cleanup
dll: Added FlushOnCleanup fuse param
2025-08-07 16:55:11 +03:00
Bill Zissimopoulos facd4bb9c4 Merge pull request #613 from chenjie4255/patch-1
Update Contributors.asciidoc
2025-08-07 16:54:31 +03:00
ethan e4ceb9010b moved FlushOnCleanup from VolumeParam to struct fuse 2025-08-07 15:30:07 +08:00
Bill Zissimopoulos d6444da2ef Merge pull request #617 from coderall2/fix_path_convert_bug
Fix: fix FspPosixMapPosixToWindowsPathEx pointer misuse
2025-08-06 18:19:19 +03:00
coderall2 b088221c82 Update Contributors.asciidoc with real name 2025-08-06 10:19:17 +08:00
coderall2 8f01618fad Update Contributors.asciidoc 2025-07-02 13:43:55 +08:00
coderall2 7e861c30ac Fix: fix FspPosixMapPosixToWindowsPathEx pointer misuse 2025-07-02 13:30:12 +08:00
ethan 1e5455653d Added "Ethan Chan" to the Contributors.asciidoc 2025-06-20 15:03:58 +08:00
ethan c8e182e1d4 sys & dll: Added FlushOnCleanup volume param 2025-06-20 14:56:01 +08:00
Bill Zissimopoulos ddca7bd548 sys: driver.inf: PnpLockdown=1 2025-06-05 16:02:43 +01:00
Bill Zissimopoulos d3700d3593 build: version: 2025 2025-05-15 20:35:01 +01:00
Bill Zissimopoulos c8366af48c update source copyright for 2025 2025-05-15 20:33:31 +01:00
Bill Zissimopoulos 44c621c0de changelog: 2025 2025-05-15 20:23:06 +01:00
Bill Zissimopoulos a2cd6978be sys: CcDeferWrite fix 2025-05-15 12:46:00 +01:00
Bill Zissimopoulos d75e9f7ee6 sys: oplock fix 2025-05-08 21:47:06 +01:00
Bill Zissimopoulos 6803bb4136 tools: build.bat: fix target SDK for AppVeyor 2025-04-25 20:18:21 +01:00
Bill Zissimopoulos fb14262e43 build: support VS2019 builds and also latest SDK/WDK builds 2025-04-25 19:51:21 +01:00
Bill Zissimopoulos 4fdec4d37f sys: FspFsvolCreate, FspFsvolSetSecurity: absolute security descriptors
Some third party filters send us security descriptors in absolute rather
than self-relative format. Handle this case by converting them to self-
relative format ourselves.
2024-10-10 12:34:04 +01:00
Bill Zissimopoulos 2da97d48f5 tools: make-release: add new signatures 2024-09-11 14:48:55 +01:00
Bill Zissimopoulos 7c5dc48414 build: version: 2024 Beta2 2024-09-11 14:46:38 +01:00
Bill Zissimopoulos 93c057571a changelog: 2024 Beta2 2024-09-11 13:23:41 +01:00
Bill Zissimopoulos da16d0e6ea Merge pull request #567 from siketyan/fix/string-h-import
fix: Add missing string.h import in winfsp_fuse.h
2024-09-10 09:25:12 +01:00
Natsuki Ikeguchi dbaee25ed2 fix: Add missing string.h import in winfsp_fuse.h
Signed-off-by: Naoki Ikeguchi <me@s6n.jp>
2024-09-10 01:02:29 +09:00
Bill Zissimopoulos 2bf9a6c16e sys: mup: correctly handle relative file object chain (#561) 2024-06-20 12:44:35 +01:00
Bill Zissimopoulos b058925692 tst: launcher-secrets: secret: replace gets with fgets 2024-06-03 11:49:38 +01:00
Bill Zissimopoulos 507c794470 doc: known file systems: remove nodejs library with no support for WinFsp 2024-02-20 13:18:30 +00:00
Bill Zissimopoulos 9a6571809e changelog: 2024 Beta1 2024-02-20 12:16:46 +00:00
Bill Zissimopoulos e452f75c9c doc: SxsDir registry setting 2024-01-20 10:55:26 +00:00
Bill Zissimopoulos 7551193ad7 update source copyright to 2024 2024-01-08 12:38:44 +00:00
Bill Zissimopoulos 65bf8c5319 dll: use adaptive locks when starting/stopping FSD 2023-12-12 12:36:41 +00:00
Bill Zissimopoulos be5faf34bc build: version: 2024 Beta1 2023-12-11 16:26:56 +00:00
Bill Zissimopoulos 0e1c8ae1dc build: version: correct version to 2023.1 Beta1 2023-08-30 11:33:54 +01:00
Bill Zissimopoulos 9aa67bdad4 build: version: bump to 2.1 (2023.1) 2023-08-30 11:30:36 +01:00
Bill Zissimopoulos de321620fd dll: FspFsctlServiceVersion as public API 2023-08-30 11:17:09 +01:00
Bill Zissimopoulos a482183149 sys: FspPropagateTopFlags: check TopLevelIrp not completed
Add a check to verify that the TopLevelIrp has not been completed. This
became necessary because on recent Windows kernels, IRP's can have "IRP
extensions", which are freed when an IRP is completed. This can trigger
a recursive CLOSE with a top-level IRP that has been completed, which
can bugcheck the system.

Case in point: the new (Win11) NtCopyFileChunk creates IRP's with
COPY_INFORMATION attached. Upon completion of such an IRP the
SourceFileObject is freed, which results in a recursive IRP_MJ_CLOSE
with a completed top-level IRP, which would lead to a BSOD.
2023-08-29 13:15:37 +01:00
201 changed files with 719 additions and 272 deletions
+40
View File
@@ -1,6 +1,46 @@
# Changelog # Changelog
## v2.2B1 (2026 Beta1)
- [FIX] Fixes vulnerability CVE-2026-3006 discovered by Tay Kiat Loong.
- [FIX] The WinFsp Network Provider provides improved shell support for network file systems not managed by the Launcher. See commit f021496.
- [FUSE] Add FUSE option `FlushOnCleanup`. See PR #614 by @chenjie4255.
- [FUSE] FUSE now respects the `direct_io` flag. See PR #646 by @chenjie4255.
- [FUSE] Add FUSE option `AddWriteEaAccess`. See PR #648 by @chenjie4255.
## v2.1 (2025)
- [FIX] Fixes a compatibility problem with certain AntiVirus products (e.g. Trend Micro).
- [FIX] Fixes a couple of rare BSODs on recent versions of Windows 11. See commits a482183, a2cd697 for details.
- [FIX] Fixes a rare problem when using `NtCreateFile` to perform "relative" opens on a network drive (see GitHub issue #561).
- [FIX] Fixes a racing issue with two processes competing to start the FSD discovered during testing.
## v2.1B2 (2024 Beta2)
- [FIX] Fixes a rare BSOD on recent versions of Windows. See commit a482183 for details.
- [FIX] Fixes a rare problem when using `NtCreateFile` to perform "relative" opens on a network drive (see GitHub issue #561).
- [FIX] Fixes a racing issue with two processes competing to start the FSD discovered during testing.
## v2.1B1 (2024 Beta1)
- [FIX] Fixes a rare BSOD on recent versions of Windows. See commit a482183 for details.
- [FIX] Fixes a racing issue with two processes competing to start the FSD discovered during testing.
## v2.0 (2023) ## v2.0 (2023)
This release is a major version change for WinFsp (from 1.x to 2.x). There are no backwards incompatible API changes in this release, but nevertheless enough things change that warrant a version change. This release is a major version change for WinFsp (from 1.x to 2.x). There are no backwards incompatible API changes in this release, but nevertheless enough things change that warrant a version change.
+4
View File
@@ -60,6 +60,7 @@ CONTRIBUTOR LIST
|Brett Dutro |brett.dutro at gmail.com |Brett Dutro |brett.dutro at gmail.com
|Changjian Gao (Juicedata, https://juicefs.com) |gcj at juicedata.io |Changjian Gao (Juicedata, https://juicefs.com) |gcj at juicedata.io
|Colin Atkinson (Atakama, https://atakama.com) |colin at atakama.com |Colin Atkinson (Atakama, https://atakama.com) |colin at atakama.com
|Ethan Chan (Juicedata, https://juicefs.com) |ethan at juicedata.io
|Felix Croes |felix at dworkin.nl |Felix Croes |felix at dworkin.nl
|Francois Karam (KS2, http://www.ks2.fr) |francois.karam at ks2.fr |Francois Karam (KS2, http://www.ks2.fr) |francois.karam at ks2.fr
|Fritz Elfert |fritz-github at fritz-elfert.de |Fritz Elfert |fritz-github at fritz-elfert.de
@@ -67,12 +68,15 @@ CONTRIBUTOR LIST
|John Oberschelp |john at oberschelp.net |John Oberschelp |john at oberschelp.net
|John Tyner |jtyner at gmail.com |John Tyner |jtyner at gmail.com
|Konstantinos Karakostas |noiredev at protonmail.com |Konstantinos Karakostas |noiredev at protonmail.com
|Naoki Ikeguchi |me at s6n.jp
|Paweł Wegner (Google LLC, https://google.com) |lemourin at google.com |Paweł Wegner (Google LLC, https://google.com) |lemourin at google.com
|Pedro Frejo (Arpa System, https://arpasystem.com) |pedro.frejo at arpasystem.com |Pedro Frejo (Arpa System, https://arpasystem.com) |pedro.frejo at arpasystem.com
|Ronny Chan |ronny at ronnychan.ca |Ronny Chan |ronny at ronnychan.ca
|Sam Kelly (DuroSoft Technologies LLC, https://durosoft.com) |sam at durosoft.com |Sam Kelly (DuroSoft Technologies LLC, https://durosoft.com) |sam at durosoft.com
|Santiago Ganis |sganis at gmail.com |Santiago Ganis |sganis at gmail.com
|Thomas Gibson-Robinson |tom at cocotec.io
|Tobias Urlaub |saibotu at outlook.de |Tobias Urlaub |saibotu at outlook.de
|Victor Gao |victgm at outlook.com |Victor Gao |victgm at outlook.com
|Zeho Huang |zeho11 at protonmail.com |Zeho Huang |zeho11 at protonmail.com
|Zhangfen Duan |lzcgwushuang at 163.com
|=== |===
+2 -2
View File
@@ -3,10 +3,10 @@
<Import Project="$(MsbuildThisFileDirectory)\build.version.props" /> <Import Project="$(MsbuildThisFileDirectory)\build.version.props" />
<ItemDefinitionGroup> <ItemDefinitionGroup>
<ClCompile> <ClCompile>
<PreprocessorDefinitions>NTDDI_VERSION=0x06010000;_WIN32_WINNT=0x0601;MyProductName=$(MyProductName);MyProductFileName=$(MyProductFileName);MyDescription=$(MyDescription);MyCompanyName=$(MyCompanyName);MyCopyright=$(MyCopyright);MyProductVersion=$(MyProductVersion);MyProductStage=$(MyProductStage);MyVersion=$(MyVersion);MyVersionWithCommas=$(MyVersionWithCommas);MyFullVersion=$(MyFullVersion);MyFspFsctlDeviceClassGuid=$(MyFspFsctlDeviceClassGuid);MyFspFsvrtDeviceClassGuid=$(MyFspFsvrtDeviceClassGuid);MyFsdLoadLogging=$(MyFsdLoadLogging);MyFsctlRegisterPath=$(MyFsctlRegisterPath);MyNpRegisterPath=$(MyNpRegisterPath);MyEventLogRegisterPath=$(MyEventLogRegisterPath)</PreprocessorDefinitions> <PreprocessorDefinitions>NTDDI_VERSION=$(MyNtddiVersion);_WIN32_WINNT=$(MyWin32Version);MyProductName=$(MyProductName);MyProductFileName=$(MyProductFileName);MyDescription=$(MyDescription);MyCompanyName=$(MyCompanyName);MyCopyright=$(MyCopyright);MyProductVersion=$(MyProductVersion);MyProductStage=$(MyProductStage);MyVersion=$(MyVersion);MyVersionWithCommas=$(MyVersionWithCommas);MyFullVersion=$(MyFullVersion);MyFspFsctlDeviceClassGuid=$(MyFspFsctlDeviceClassGuid);MyFspFsvrtDeviceClassGuid=$(MyFspFsvrtDeviceClassGuid);MyFsctlRegisterPath=$(MyFsctlRegisterPath);MyNpRegisterPath=$(MyNpRegisterPath);MyEventLogRegisterPath=$(MyEventLogRegisterPath)</PreprocessorDefinitions>
</ClCompile> </ClCompile>
<ResourceCompile> <ResourceCompile>
<PreprocessorDefinitions>MyProductName=$(MyProductName);MyProductFileName=$(MyProductFileName);MyDescription=$(MyDescription);MyCompanyName=$(MyCompanyName);MyCopyright=$(MyCopyright);MyProductVersion=$(MyProductVersion);MyProductStage=$(MyProductStage);MyVersion=$(MyVersion);MyVersionWithCommas=$(MyVersionWithCommas);MyFullVersion=$(MyFullVersion);MyFspFsctlDeviceClassGuid=$(MyFspFsctlDeviceClassGuid);MyFspFsvrtDeviceClassGuid=$(MyFspFsvrtDeviceClassGuid);MyFsdLoadLogging=$(MyFsdLoadLogging);MyFsctlRegisterPath=$(MyFsctlRegisterPath);MyNpRegisterPath=$(MyNpRegisterPath);MyEventLogRegisterPath=$(MyEventLogRegisterPath)</PreprocessorDefinitions> <PreprocessorDefinitions>MyProductName=$(MyProductName);MyProductFileName=$(MyProductFileName);MyDescription=$(MyDescription);MyCompanyName=$(MyCompanyName);MyCopyright=$(MyCopyright);MyProductVersion=$(MyProductVersion);MyProductStage=$(MyProductStage);MyVersion=$(MyVersion);MyVersionWithCommas=$(MyVersionWithCommas);MyFullVersion=$(MyFullVersion);MyFspFsctlDeviceClassGuid=$(MyFspFsctlDeviceClassGuid);MyFspFsvrtDeviceClassGuid=$(MyFspFsvrtDeviceClassGuid);MyFsctlRegisterPath=$(MyFsctlRegisterPath);MyNpRegisterPath=$(MyNpRegisterPath);MyEventLogRegisterPath=$(MyEventLogRegisterPath)</PreprocessorDefinitions>
</ResourceCompile> </ResourceCompile>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(IsKernelModeToolset)'=='true'"> <ItemDefinitionGroup Condition="'$(IsKernelModeToolset)'=='true'">
+21 -7
View File
@@ -18,12 +18,12 @@
<MyCompanyName>Navimatics LLC</MyCompanyName> <MyCompanyName>Navimatics LLC</MyCompanyName>
<MyCopyright>2015-$([System.DateTime]::Now.ToString(`yyyy`)) Bill Zissimopoulos</MyCopyright> <MyCopyright>2015-$([System.DateTime]::Now.ToString(`yyyy`)) Bill Zissimopoulos</MyCopyright>
<MyCanonicalVersion>2.0</MyCanonicalVersion> <MyCanonicalVersion>2.2</MyCanonicalVersion>
<MyProductVersion>2023</MyProductVersion> <MyProductVersion>2026 Beta1</MyProductVersion>
<MyProductStage>Gold</MyProductStage> <MyProductStage>Beta</MyProductStage>
<MyCrossCert>DigiCertGlobalG3CodeSigningECCSHA3842021CA1.cer</MyCrossCert> <MyCrossCert>CrossCert.cer</MyCrossCert>
<MyCertIssuer>DigiCert</MyCertIssuer> <MyCertIssuer>DigiCert</MyCertIssuer>
<MyVersion>$(MyCanonicalVersion).$(MyBuildNumber)</MyVersion> <MyVersion>$(MyCanonicalVersion).$(MyBuildNumber)</MyVersion>
@@ -41,9 +41,6 @@
<MyFspFsctlDeviceClassGuid>{ 0x6f9d25fa, 0x6dee, 0x4a9d, { 0x80, 0xf5, 0xe9, 0x8e, 0x14, 0xf3, 0x5e, 0x54 } }</MyFspFsctlDeviceClassGuid> <MyFspFsctlDeviceClassGuid>{ 0x6f9d25fa, 0x6dee, 0x4a9d, { 0x80, 0xf5, 0xe9, 0x8e, 0x14, 0xf3, 0x5e, 0x54 } }</MyFspFsctlDeviceClassGuid>
<MyFspFsvrtDeviceClassGuid>{ 0xb48171c3, 0xdd50, 0x4852, { 0x83, 0xa3, 0x34, 0x4c, 0x50, 0xd9, 0x3b, 0x17 } }</MyFspFsvrtDeviceClassGuid> <MyFspFsvrtDeviceClassGuid>{ 0xb48171c3, 0xdd50, 0x4852, { 0x83, 0xa3, 0x34, 0x4c, 0x50, 0xd9, 0x3b, 0x17 } }</MyFspFsvrtDeviceClassGuid>
<!-- FSD load/unload logging; set to 1 to enable -->
<MyFsdLoadLogging>0</MyFsdLoadLogging>
<!-- <!--
Configure paths used for registration via DllRegisterServer: Configure paths used for registration via DllRegisterServer:
@@ -75,5 +72,22 @@
<MyFsctlRegisterPath>"."</MyFsctlRegisterPath> <MyFsctlRegisterPath>"."</MyFsctlRegisterPath>
<MyNpRegisterPath>"."</MyNpRegisterPath> <MyNpRegisterPath>"."</MyNpRegisterPath>
<MyEventLogRegisterPath>"."</MyEventLogRegisterPath> <MyEventLogRegisterPath>"."</MyEventLogRegisterPath>
<!--
Target SDK/WDK version
For VS2019 builds (supports Win7/Win8/Win10+ x86/x64/a64):
MyTargetPlatformVersion = 10.0.19041.0
MyNtddiVersion = 0x06010000
MyWin32Version = 0x0601
For latest SDK/WDK builds (supports Win10+ x64/a64):
MyTargetPlatformVersion = $(LatestTargetPlatformVersion)
MyNtddiVersion = 0x0A000006
MyWin32Version = 0x0A00
-->
<MyTargetPlatformVersion>10.0.19041.0</MyTargetPlatformVersion>
<MyNtddiVersion>0x06010000</MyNtddiVersion>
<MyWin32Version>0x0601</MyWin32Version>
</PropertyGroup> </PropertyGroup>
</Project> </Project>
@@ -1,7 +1,7 @@
/** /**
* @file CustomActions.cpp * @file CustomActions.cpp
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
@@ -15,7 +15,7 @@
<ProjectGuid>{95C223E6-B5F1-4FD0-9376-41CDBC824445}</ProjectGuid> <ProjectGuid>{95C223E6-B5F1-4FD0-9376-41CDBC824445}</ProjectGuid>
<RootNamespace>CustomActions</RootNamespace> <RootNamespace>CustomActions</RootNamespace>
<Keyword>Win32Proj</Keyword> <Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>$(MyTargetPlatformVersion)</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+1 -1
View File
@@ -31,7 +31,7 @@
<ProjectGuid>{C4E1E9E5-0959-488E-8C6A-C327CC81BEFB}</ProjectGuid> <ProjectGuid>{C4E1E9E5-0959-488E-8C6A-C327CC81BEFB}</ProjectGuid>
<Keyword>Win32Proj</Keyword> <Keyword>Win32Proj</Keyword>
<RootNamespace>fsbench</RootNamespace> <RootNamespace>fsbench</RootNamespace>
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>$(MyTargetPlatformVersion)</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+1 -1
View File
@@ -31,7 +31,7 @@
<ProjectGuid>{10757011-749D-4954-873B-AE38D8145472}</ProjectGuid> <ProjectGuid>{10757011-749D-4954-873B-AE38D8145472}</ProjectGuid>
<Keyword>Win32Proj</Keyword> <Keyword>Win32Proj</Keyword>
<RootNamespace>fscrash</RootNamespace> <RootNamespace>fscrash</RootNamespace>
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>$(MyTargetPlatformVersion)</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+1 -1
View File
@@ -31,7 +31,7 @@
<ProjectGuid>{AA7190E8-877F-4827-8CDD-E0D85F83C8C1}</ProjectGuid> <ProjectGuid>{AA7190E8-877F-4827-8CDD-E0D85F83C8C1}</ProjectGuid>
<Keyword>Win32Proj</Keyword> <Keyword>Win32Proj</Keyword>
<RootNamespace>memfs</RootNamespace> <RootNamespace>memfs</RootNamespace>
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>$(MyTargetPlatformVersion)</WindowsTargetPlatformVersion>
<ProjectName>memfs</ProjectName> <ProjectName>memfs</ProjectName>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+1 -1
View File
@@ -31,7 +31,7 @@
<ProjectGuid>{262DF8CC-E7A8-4460-A22C-683CBA322C32}</ProjectGuid> <ProjectGuid>{262DF8CC-E7A8-4460-A22C-683CBA322C32}</ProjectGuid>
<Keyword>Win32Proj</Keyword> <Keyword>Win32Proj</Keyword>
<RootNamespace>winfsptests</RootNamespace> <RootNamespace>winfsptests</RootNamespace>
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>$(MyTargetPlatformVersion)</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+1 -1
View File
@@ -31,7 +31,7 @@
<ProjectGuid>{1E997BEC-1642-4A5C-B252-852DA094E11E}</ProjectGuid> <ProjectGuid>{1E997BEC-1642-4A5C-B252-852DA094E11E}</ProjectGuid>
<Keyword>Win32Proj</Keyword> <Keyword>Win32Proj</Keyword>
<RootNamespace>fsptool</RootNamespace> <RootNamespace>fsptool</RootNamespace>
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>$(MyTargetPlatformVersion)</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+1 -1
View File
@@ -31,7 +31,7 @@
<ProjectGuid>{264A5D09-126F-4760-A3F1-4B3B95C925AA}</ProjectGuid> <ProjectGuid>{264A5D09-126F-4760-A3F1-4B3B95C925AA}</ProjectGuid>
<Keyword>Win32Proj</Keyword> <Keyword>Win32Proj</Keyword>
<RootNamespace>launchctl</RootNamespace> <RootNamespace>launchctl</RootNamespace>
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>$(MyTargetPlatformVersion)</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+1 -1
View File
@@ -31,7 +31,7 @@
<ProjectGuid>{6CDF9411-B852-4EAC-822D-8F930675F17B}</ProjectGuid> <ProjectGuid>{6CDF9411-B852-4EAC-822D-8F930675F17B}</ProjectGuid>
<Keyword>Win32Proj</Keyword> <Keyword>Win32Proj</Keyword>
<RootNamespace>launcher</RootNamespace> <RootNamespace>launcher</RootNamespace>
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>$(MyTargetPlatformVersion)</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+1 -1
View File
@@ -163,7 +163,7 @@ copy /b $(OutDir)fuse3-$(MyProductFileArch).pc + %(FullPath) $(OutDir)fuse3-$(My
<ProjectGuid>{4A7C0B21-9E10-4C81-92DE-1493EFCF24EB}</ProjectGuid> <ProjectGuid>{4A7C0B21-9E10-4C81-92DE-1493EFCF24EB}</ProjectGuid>
<Keyword>Win32Proj</Keyword> <Keyword>Win32Proj</Keyword>
<RootNamespace>winfspdll</RootNamespace> <RootNamespace>winfspdll</RootNamespace>
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>$(MyTargetPlatformVersion)</WindowsTargetPlatformVersion>
<ProjectName>winfsp.dll</ProjectName> <ProjectName>winfsp.dll</ProjectName>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+1 -1
View File
@@ -35,7 +35,7 @@
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
<Platform Condition="'$(Platform)' == ''">Win32</Platform> <Platform Condition="'$(Platform)' == ''">Win32</Platform>
<RootNamespace>winfsp</RootNamespace> <RootNamespace>winfsp</RootNamespace>
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>$(MyTargetPlatformVersion)</WindowsTargetPlatformVersion>
<ProjectName>winfsp.sys</ProjectName> <ProjectName>winfsp.sys</ProjectName>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+2 -1
View File
@@ -5,6 +5,7 @@ This document contains a list of known open-source file systems and file system
== File Systems == File Systems
- https://github.com/wesley1975/blobfs-win[blobfs-win] - The native porting of the blobfs on the windows platform, blobfs can help you mount the Azure Blob storage as the local disk driver, no matter it is a Linux system or a Windows system. - https://github.com/wesley1975/blobfs-win[blobfs-win] - The native porting of the blobfs on the windows platform, blobfs can help you mount the Azure Blob storage as the local disk driver, no matter it is a Linux system or a Windows system.
- https://github.com/buildbarn/bb-remote-execution[buildbarn] - A bazel-compatible remote execution service that uses WinFSP to provide a virtual directory for performing builds
- https://github.com/cryptomator/cryptomator[Cryptomator] - Multi-platform transparent client-side encryption of your files in the cloud - https://github.com/cryptomator/cryptomator[Cryptomator] - Multi-platform transparent client-side encryption of your files in the cloud
- https://github.com/vgough/encfs[EncFS] - an Encrypted Filesystem for FUSE - https://github.com/vgough/encfs[EncFS] - an Encrypted Filesystem for FUSE
- https://github.com/lowleveldesign/fsmemfs[fsmemfs] - Memory File System written in F# - https://github.com/lowleveldesign/fsmemfs[fsmemfs] - Memory File System written in F#
@@ -28,9 +29,9 @@ This document contains a list of known open-source file systems and file system
== File System Libraries == File System Libraries
- https://github.com/winfsp/cgofuse[Go: cgofuse] - Cross-platform FUSE library for Go - https://github.com/winfsp/cgofuse[Go: cgofuse] - Cross-platform FUSE library for Go
- https://github.com/aegistudio/go-winfsp[Go: go-winfsp] - WinFSP bindings for Go
- https://github.com/SerCeMan/jnr-fuse[Java: jnr-fuse] - FUSE implementation in Java using Java Native Runtime (JNR) - https://github.com/SerCeMan/jnr-fuse[Java: jnr-fuse] - FUSE implementation in Java using Java Native Runtime (JNR)
- https://github.com/jnr-winfsp-team/jnr-winfsp[Java: jnr-winfsp] - A Java binding for WinFsp using Java Native Runtime (JNR) - https://github.com/jnr-winfsp-team/jnr-winfsp[Java: jnr-winfsp] - A Java binding for WinFsp using Java Native Runtime (JNR)
- https://github.com/DuroSoft/fuse-bindings[Nodejs: fuse-bindings] - Fully maintained FUSE bindings for Node that aims to cover the entire FUSE api
- https://github.com/billziss-gh/fusepy[Python: fusepy] - Simple ctypes bindings for FUSE - https://github.com/billziss-gh/fusepy[Python: fusepy] - Simple ctypes bindings for FUSE
- https://github.com/pleiszenburg/refuse[Python: refuse] - Simple cross-plattform ctypes bindings for libfuse / FUSE for macOS / WinFsp - https://github.com/pleiszenburg/refuse[Python: refuse] - Simple cross-plattform ctypes bindings for libfuse / FUSE for macOS / WinFsp
- https://github.com/Scille/winfspy[Python: winfspy] - WinFSP binding for Python - https://github.com/Scille/winfspy[Python: winfspy] - WinFSP binding for Python
+1 -1
View File
@@ -416,7 +416,7 @@ typedef struct _FSP_LAUNCH_REG_RECORD {
<br/> <br/>
<p align="center"> <p align="center">
<sub> <sub>
Copyright © 2015-2021 Bill Zissimopoulos Copyright © 2015-2026 Bill Zissimopoulos
<br/> <br/>
Generated with <a href="https://github.com/billziss-gh/prettydoc">prettydoc</a> Generated with <a href="https://github.com/billziss-gh/prettydoc">prettydoc</a>
</sub> </sub>
+90 -2
View File
@@ -404,6 +404,59 @@ NTSTATUS ( *DeleteReparsePoint)(
STATUS\_SUCCESS or error code. STATUS\_SUCCESS or error code.
</blockquote>
</details>
<details>
<summary>
<b>DispatcherStopped</b> - Inform the file system that its dispatcher has been stopped.
</summary>
<blockquote>
<br/>
```c
VOID ( *DispatcherStopped)(
FSP_FILE_SYSTEM *FileSystem,
BOOLEAN Normally);
```
**Parameters**
- _FileSystem_ \- The file system on which this request is posted.
- _Normally_ \- TRUE if the file system is being stopped via FspFileSystemStopDispatcher.
FALSE if the file system is being stopped because of another reason such
as driver unload/uninstall.
**Discussion**
Prior to WinFsp v2.0 the FSD would never unmount a file system volume unless
the user mode file system requested the unmount. Since WinFsp v2.0 it is possible
for the FSD to unmount a file system volume without an explicit user mode file system
request. For example, this happens when the FSD is being uninstalled.
A user mode file system can use this operation to determine when its dispatcher
has been stopped. The Normally parameter can be used to determine why the dispatcher
was stopped: it is TRUE when the file system is being stopped via
FspFileSystemStopDispatcher and FALSE otherwise.
When the file system receives a request with Normally == TRUE it need not take any
extra steps. This case is the same as for pre-v2.0 versions: since the file system
stopped the dispatcher via FspFileSystemStopDispatcher, it will likely exit its
process soon.
When the file system receives a request with Normally == FALSE it may need to take
extra steps to exit its process as this is not done by default.
A file system that uses the FspService infrastructure may use the
FspFileSystemStopServiceIfNecessary API to correctly handle all cases.
This operation is the last one that a file system will receive.
**See Also**
- FspFileSystemStopServiceIfNecessary
</blockquote> </blockquote>
</details> </details>
@@ -1655,7 +1708,7 @@ FSP_API NTSTATUS FspFileSystemCreate(
- _DevicePath_ \- The name of the control device for this file system. This must be either - _DevicePath_ \- The name of the control device for this file system. This must be either
FSP\_FSCTL\_DISK\_DEVICE\_NAME or FSP\_FSCTL\_NET\_DEVICE\_NAME. FSP\_FSCTL\_DISK\_DEVICE\_NAME or FSP\_FSCTL\_NET\_DEVICE\_NAME.
- _VolumeParams_ \- Volume parameters for the newly created file system. - _VolumeParams_ \- Volume parameters for the newly created file system.
- _Interface_ \- A pointer to the actual operations that actually implement this user mode file system. - _Interface_ \- A pointer to the operations that implement this user mode file system.
- _PFileSystem_ \- [out] - _PFileSystem_ \- [out]
Pointer that will receive the file system object created on successful return from this Pointer that will receive the file system object created on successful return from this
call. call.
@@ -2309,6 +2362,39 @@ FSP_API VOID FspFileSystemStopDispatcher(
- _FileSystem_ \- The file system object. - _FileSystem_ \- The file system object.
</blockquote>
</details>
<details>
<summary>
<b>FspFileSystemStopServiceIfNecessary</b> - Stop a file system service, if any.
</summary>
<blockquote>
<br/>
```c
FSP_API VOID FspFileSystemStopServiceIfNecessary(
FSP_FILE_SYSTEM *FileSystem,
BOOLEAN Normally);
```
**Parameters**
- _FileSystem_ \- The file system object.
- _Normally_ \- TRUE if the file system is being stopped via FspFileSystemStopDispatcher.
FALSE if the file system is being stopped because of another reason such
as driver unload/uninstall.
**Discussion**
This is a helper for implementing the DispatcherStopped operation, but only for file systems
that use the FspService infrastructure.
**See Also**
- DispatcherStopped
</blockquote> </blockquote>
</details> </details>
@@ -2651,6 +2737,8 @@ This function starts and runs a service. It executes the Windows StartServiceCtr
to connect the service process to the Service Control Manager. If the Service Control Manager is to connect the service process to the Service Control Manager. If the Service Control Manager is
not available (and console mode is allowed) it will enter console mode. not available (and console mode is allowed) it will enter console mode.
This function should be called once per process.
</blockquote> </blockquote>
</details> </details>
@@ -2775,7 +2863,7 @@ in a clean manner by calling this function.
<br/> <br/>
<p align="center"> <p align="center">
<sub> <sub>
Copyright © 2015-2021 Bill Zissimopoulos Copyright © 2015-2026 Bill Zissimopoulos
<br/> <br/>
Generated with <a href="https://github.com/billziss-gh/prettydoc">prettydoc</a> Generated with <a href="https://github.com/billziss-gh/prettydoc">prettydoc</a>
</sub> </sub>
+2
View File
@@ -65,6 +65,8 @@ Primary registry key used to store WinFsp settings. On a 64-bit system (x64 or A
* `InstallDir (REG_SZ)`: Contains the WinFsp installation directory. * `InstallDir (REG_SZ)`: Contains the WinFsp installation directory.
* `SxsDir (REG_SZ)`: Contains the WinFsp Side-by-Side (SxS) directory. The SxS directory allows for multiple versions of WinFsp to be active at the same time and among other benefits it enables reinstalling WinFsp without reboot. The SxS directory contains primarily executable files.
* `DistinctPermsForSameOwnerGroup (REG_DWORD)`: Directs how WinFsp-FUSE should consider UNIX owner and group permissions in the case when the Windows owner and group SID are the same (for example, this can happen when someone uses a Microsoft account as their primary login). When this setting is 0 and the Windows owner and group SID are the same, WinFsp-FUSE combines the UNIX owner and group permissions (for example, user permission `rw-` and group permission `---` combine to `---`), which can result in inadvertent "access denied" errors. When this setting is 1 and even if the Windows owner and group SID are the same, WinFsp-FUSE looks at the UNIX owner permissions and the UNIX group permissions separately. The default value is 1 since v1.11B1 and was 0 in earlier versions. * `DistinctPermsForSameOwnerGroup (REG_DWORD)`: Directs how WinFsp-FUSE should consider UNIX owner and group permissions in the case when the Windows owner and group SID are the same (for example, this can happen when someone uses a Microsoft account as their primary login). When this setting is 0 and the Windows owner and group SID are the same, WinFsp-FUSE combines the UNIX owner and group permissions (for example, user permission `rw-` and group permission `---` combine to `---`), which can result in inadvertent "access denied" errors. When this setting is 1 and even if the Windows owner and group SID are the same, WinFsp-FUSE looks at the UNIX owner permissions and the UNIX group permissions separately. The default value is 1 since v1.11B1 and was 0 in earlier versions.
* `MountBroadcastDriveChange (REG_DWORD)`: A value of 1 instructs WinFsp to broadcast an additional "drive change" message to all top-level windows during mounting and unmounting. The default value is 0. Normally the Windows infrastructure broadcasts a `WM_DEVICECHANGE` message whenever a drive gets added/removed. In some rare systems it is possible for this message to get lost or stalled. The workaround for these rare systems is to enable this registry setting, in which case WinFsp will broadcast the `WM_DEVICECHANGE` using a slightly different but more reliable method than the one Windows uses. * `MountBroadcastDriveChange (REG_DWORD)`: A value of 1 instructs WinFsp to broadcast an additional "drive change" message to all top-level windows during mounting and unmounting. The default value is 0. Normally the Windows infrastructure broadcasts a `WM_DEVICECHANGE` message whenever a drive gets added/removed. In some rare systems it is possible for this message to get lost or stalled. The workaround for these rare systems is to enable this registry setting, in which case WinFsp will broadcast the `WM_DEVICECHANGE` using a slightly different but more reliable method than the one Windows uses.
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file tlib/callstack.c * @file tlib/callstack.c
* *
* @copyright 2014-2022 Bill Zissimopoulos * @copyright 2014-2026 Bill Zissimopoulos
*/ */
#include <tlib/callstack.h> #include <tlib/callstack.h>
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file tlib/callstack.h * @file tlib/callstack.h
* *
* @copyright 2014-2022 Bill Zissimopoulos * @copyright 2014-2026 Bill Zissimopoulos
*/ */
#ifndef TLIB_CALLSTACK_H_INCLUDED #ifndef TLIB_CALLSTACK_H_INCLUDED
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file tlib/injected/allfunc.h * @file tlib/injected/allfunc.h
* *
* @copyright 2014-2022 Bill Zissimopoulos * @copyright 2014-2026 Bill Zissimopoulos
*/ */
#ifndef TLIB_INJECTED_ALLFUNC_H_INCLUDED #ifndef TLIB_INJECTED_ALLFUNC_H_INCLUDED
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file tlib/injected/curlfunc.c * @file tlib/injected/curlfunc.c
* *
* @copyright 2014-2022 Bill Zissimopoulos * @copyright 2014-2026 Bill Zissimopoulos
*/ */
#include <tlib/injected/curlfunc.h> #include <tlib/injected/curlfunc.h>
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file tlib/injected/curlfunc.h * @file tlib/injected/curlfunc.h
* *
* @copyright 2014-2022 Bill Zissimopoulos * @copyright 2014-2026 Bill Zissimopoulos
*/ */
#ifndef TLIB_INJECTED_CURLFUNC_H_INCLUDED #ifndef TLIB_INJECTED_CURLFUNC_H_INCLUDED
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file tlib/injected/stdfunc.c * @file tlib/injected/stdfunc.c
* *
* @copyright 2014-2022 Bill Zissimopoulos * @copyright 2014-2026 Bill Zissimopoulos
*/ */
#include <tlib/injected/stdfunc.h> #include <tlib/injected/stdfunc.h>
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file tlib/injected/stdfunc.h * @file tlib/injected/stdfunc.h
* *
* @copyright 2014-2022 Bill Zissimopoulos * @copyright 2014-2026 Bill Zissimopoulos
*/ */
#ifndef TLIB_INJECTED_STDFUNC_H_INCLUDED #ifndef TLIB_INJECTED_STDFUNC_H_INCLUDED
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file tlib/injection.c * @file tlib/injection.c
* *
* @copyright 2014-2022 Bill Zissimopoulos * @copyright 2014-2026 Bill Zissimopoulos
*/ */
#include <tlib/injection.h> #include <tlib/injection.h>
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file tlib/injection.h * @file tlib/injection.h
* *
* @copyright 2014-2022 Bill Zissimopoulos * @copyright 2014-2026 Bill Zissimopoulos
*/ */
/* NOTE: This header may usefully be included multiple times. /* NOTE: This header may usefully be included multiple times.
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file tlib/testsuite.c * @file tlib/testsuite.c
* *
* @copyright 2014-2022 Bill Zissimopoulos * @copyright 2014-2026 Bill Zissimopoulos
*/ */
#include <tlib/testsuite.h> #include <tlib/testsuite.h>
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file tlib/testsuite.h * @file tlib/testsuite.h
* *
* @copyright 2014-2022 Bill Zissimopoulos * @copyright 2014-2026 Bill Zissimopoulos
*/ */
#ifndef TLIB_TESTSUITE_H_INCLUDED #ifndef TLIB_TESTSUITE_H_INCLUDED
+1 -1
View File
@@ -6,7 +6,7 @@
* FUSE: Filesystem in Userspace * FUSE: Filesystem in Userspace
* Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu> * Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu>
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -6,7 +6,7 @@
* FUSE: Filesystem in Userspace * FUSE: Filesystem in Userspace
* Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu> * Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu>
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -6,7 +6,7 @@
* FUSE: Filesystem in Userspace * FUSE: Filesystem in Userspace
* Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu> * Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu>
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+2 -1
View File
@@ -2,7 +2,7 @@
* @file fuse/winfsp_fuse.h * @file fuse/winfsp_fuse.h
* WinFsp FUSE compatible API. * WinFsp FUSE compatible API.
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
@@ -27,6 +27,7 @@
#include <stdint.h> #include <stdint.h>
#if !defined(WINFSP_DLL_INTERNAL) #if !defined(WINFSP_DLL_INTERNAL)
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
+1 -1
View File
@@ -6,7 +6,7 @@
* FUSE: Filesystem in Userspace * FUSE: Filesystem in Userspace
* Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu> * Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu>
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -6,7 +6,7 @@
* FUSE: Filesystem in Userspace * FUSE: Filesystem in Userspace
* Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu> * Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu>
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -2,7 +2,7 @@
* @file fuse3/fuse_opt.h * @file fuse3/fuse_opt.h
* WinFsp FUSE3 compatible API. * WinFsp FUSE3 compatible API.
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -2,7 +2,7 @@
* @file fuse3/winfsp_fuse.h * @file fuse3/winfsp_fuse.h
* WinFsp FUSE3 compatible API. * WinFsp FUSE3 compatible API.
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+2 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file winfsp/fsctl.h * @file winfsp/fsctl.h
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
@@ -696,6 +696,7 @@ FSP_API NTSTATUS FspFsctlNotify(HANDLE VolumeHandle,
FSP_API NTSTATUS FspFsctlGetVolumeList(PWSTR DevicePath, FSP_API NTSTATUS FspFsctlGetVolumeList(PWSTR DevicePath,
PWCHAR VolumeListBuf, PSIZE_T PVolumeListSize); PWCHAR VolumeListBuf, PSIZE_T PVolumeListSize);
FSP_API NTSTATUS FspFsctlPreflight(PWSTR DevicePath); FSP_API NTSTATUS FspFsctlPreflight(PWSTR DevicePath);
FSP_API NTSTATUS FspFsctlServiceVersion(PUINT32 PVersion);
FSP_API NTSTATUS FspFsctlStartService(VOID); FSP_API NTSTATUS FspFsctlStartService(VOID);
FSP_API NTSTATUS FspFsctlStopService(VOID); FSP_API NTSTATUS FspFsctlStopService(VOID);
FSP_API NTSTATUS FspFsctlEnumServices( FSP_API NTSTATUS FspFsctlEnumServices(
+1 -1
View File
@@ -5,7 +5,7 @@
* In order to use the WinFsp Launch API a program must include &lt;winfsp/launch.h&gt; * In order to use the WinFsp Launch API a program must include &lt;winfsp/launch.h&gt;
* and link with the winfsp_x64.dll (or winfsp_x86.dll) library. * and link with the winfsp_x64.dll (or winfsp_x86.dll) library.
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -5,7 +5,7 @@
* In order to use the WinFsp API the user mode file system must include &lt;winfsp/winfsp.h&gt; * In order to use the WinFsp API the user mode file system must include &lt;winfsp/winfsp.h&gt;
* and link with the winfsp_x64.dll (or winfsp_x86.dll) library. * and link with the winfsp_x64.dll (or winfsp_x86.dll) library.
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -2,7 +2,7 @@
* @file winfsp/winfsp.hpp * @file winfsp/winfsp.hpp
* WinFsp C++ Layer. * WinFsp C++ Layer.
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file fuse/cygfuse.c * @file fuse/cygfuse.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file fuse3/cygfuse.c * @file fuse3/cygfuse.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file winfsp/fsext.h * @file winfsp/fsext.h
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file dll/debug.c * @file dll/debug.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file dll/debuglog.c * @file dll/debuglog.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file dll/dirbuf.c * @file dll/dirbuf.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file dll/eventlog.c * @file dll/eventlog.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file dll/fs.c * @file dll/fs.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+25 -9
View File
@@ -1,7 +1,7 @@
/** /**
* @file dll/fsctl.c * @file dll/fsctl.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
@@ -31,8 +31,6 @@ static ULONG FspFsctlServiceVersionValue;
static DWORD FspFsctlTransactCode = FSP_FSCTL_TRANSACT; static DWORD FspFsctlTransactCode = FSP_FSCTL_TRANSACT;
static DWORD FspFsctlTransactBatchCode = FSP_FSCTL_TRANSACT_BATCH; static DWORD FspFsctlTransactBatchCode = FSP_FSCTL_TRANSACT_BATCH;
static VOID FspFsctlServiceVersion(PUINT32 PVersion);
FSP_API NTSTATUS FspFsctlCreateVolume(PWSTR DevicePath, FSP_API NTSTATUS FspFsctlCreateVolume(PWSTR DevicePath,
const FSP_FSCTL_VOLUME_PARAMS *VolumeParams, const FSP_FSCTL_VOLUME_PARAMS *VolumeParams,
PWCHAR VolumeNameBuf, SIZE_T VolumeNameSize, PWCHAR VolumeNameBuf, SIZE_T VolumeNameSize,
@@ -423,15 +421,33 @@ exit:
return TRUE; return TRUE;
} }
static VOID FspFsctlServiceVersion(PUINT32 PVersion) FSP_API NTSTATUS FspFsctlServiceVersion(PUINT32 PVersion)
{ {
InitOnceExecuteOnce(&FspFsctlServiceVersionInitOnce, FspFsctlServiceVersionInitialize, 0, 0); InitOnceExecuteOnce(&FspFsctlServiceVersionInitOnce, FspFsctlServiceVersionInitialize, 0, 0);
if (0 != PVersion) if (0 != PVersion)
*PVersion = FspFsctlServiceVersionValue; *PVersion = FspFsctlServiceVersionValue;
return 0 != FspFsctlServiceVersionValue ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL;
} }
static SRWLOCK FspFsctlStartStopServiceLock = SRWLOCK_INIT; static FSP_ADAPTIVE_LOCK FspFsctlStartStopServiceLock = FSP_ADAPTIVE_LOCK_INIT;
static VOID FspFsctlStartStopServiceLockAcquire(VOID)
{
extern HINSTANCE DllInstance;
WCHAR DllPath[MAX_PATH];
PWSTR FileName = 0;
if (0 != GetModuleFileNameW(DllInstance, DllPath, MAX_PATH))
FileName = DllPath;
FspAdaptiveLockAcquire(&FspFsctlStartStopServiceLock,
FileName, 0xfffffffffffffff0ull, (10 + 1) * 1000);
}
static VOID FspFsctlStartStopServiceLockRelease(VOID)
{
FspAdaptiveLockRelease(&FspFsctlStartStopServiceLock);
}
static BOOLEAN FspFsctlRunningInContainer(VOID) static BOOLEAN FspFsctlRunningInContainer(VOID)
{ {
@@ -455,7 +471,7 @@ static NTSTATUS FspFsctlStartServiceByName(PWSTR DriverName)
DWORD LastError; DWORD LastError;
NTSTATUS Result; NTSTATUS Result;
AcquireSRWLockExclusive(&FspFsctlStartStopServiceLock); FspFsctlStartStopServiceLockAcquire();
if (FspFsctlRunningInContainer()) if (FspFsctlRunningInContainer())
{ {
@@ -517,7 +533,7 @@ exit:
if (0 != ScmHandle) if (0 != ScmHandle)
CloseServiceHandle(ScmHandle); CloseServiceHandle(ScmHandle);
ReleaseSRWLockExclusive(&FspFsctlStartStopServiceLock); FspFsctlStartStopServiceLockRelease();
return Result; return Result;
} }
@@ -587,7 +603,7 @@ FSP_API NTSTATUS FspFsctlStopService(VOID)
FspSxsAppendSuffix(DriverName, sizeof DriverName, L"" FSP_FSCTL_DRIVER_NAME); FspSxsAppendSuffix(DriverName, sizeof DriverName, L"" FSP_FSCTL_DRIVER_NAME);
AcquireSRWLockExclusive(&FspFsctlStartStopServiceLock); FspFsctlStartStopServiceLockAcquire();
if (FspFsctlRunningInContainer()) if (FspFsctlRunningInContainer())
{ {
@@ -659,7 +675,7 @@ exit:
if (0 != ProcessToken) if (0 != ProcessToken)
CloseHandle(ProcessToken); CloseHandle(ProcessToken);
ReleaseSRWLockExclusive(&FspFsctlStartStopServiceLock); FspFsctlStartStopServiceLockRelease();
return Result; return Result;
} }
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file dll/fsop.c * @file dll/fsop.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+7 -2
View File
@@ -1,7 +1,7 @@
/** /**
* @file dll/fuse/fuse.c * @file dll/fuse/fuse.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
@@ -98,6 +98,7 @@ static struct fuse_opt fsp_fuse_core_opts[] =
FSP_FUSE_CORE_OPT("VolumeInfoTimeout=", set_VolumeInfoTimeout, 1), FSP_FUSE_CORE_OPT("VolumeInfoTimeout=", set_VolumeInfoTimeout, 1),
FSP_FUSE_CORE_OPT("VolumeInfoTimeout=%d", VolumeParams.VolumeInfoTimeout, 0), FSP_FUSE_CORE_OPT("VolumeInfoTimeout=%d", VolumeParams.VolumeInfoTimeout, 0),
FSP_FUSE_CORE_OPT("KeepFileCache=", set_KeepFileCache, 1), FSP_FUSE_CORE_OPT("KeepFileCache=", set_KeepFileCache, 1),
FSP_FUSE_CORE_OPT("FlushOnCleanup=", set_FlushOnCleanup, 1),
FSP_FUSE_CORE_OPT("LegacyUnlinkRename=", set_LegacyUnlinkRename, 1), FSP_FUSE_CORE_OPT("LegacyUnlinkRename=", set_LegacyUnlinkRename, 1),
FSP_FUSE_CORE_OPT("ThreadCount=%u", ThreadCount, 0), FSP_FUSE_CORE_OPT("ThreadCount=%u", ThreadCount, 0),
FUSE_OPT_KEY("UNC=", 'U'), FUSE_OPT_KEY("UNC=", 'U'),
@@ -120,6 +121,8 @@ static struct fuse_opt fsp_fuse_core_opts[] =
FSP_FUSE_CORE_OPT("--GroupName=", set_gid, 1), FSP_FUSE_CORE_OPT("--GroupName=", set_gid, 1),
FUSE_OPT_KEY("--GroupName=", 'g'), FUSE_OPT_KEY("--GroupName=", 'g'),
FSP_FUSE_CORE_OPT("AddWriteEaAccess", add_write_ea_access, 1),
FUSE_OPT_END, FUSE_OPT_END,
}; };
@@ -880,7 +883,7 @@ FSP_FUSE_API struct fuse *fsp_fuse_new(struct fsp_fuse_env *env,
opt_data.VolumeParams.ReparsePointsAccessCheck = FALSE; opt_data.VolumeParams.ReparsePointsAccessCheck = FALSE;
opt_data.VolumeParams.NamedStreams = FALSE; opt_data.VolumeParams.NamedStreams = FALSE;
opt_data.VolumeParams.ReadOnlyVolume = FALSE; opt_data.VolumeParams.ReadOnlyVolume = FALSE;
opt_data.VolumeParams.PostCleanupWhenModifiedOnly = TRUE; opt_data.VolumeParams.PostCleanupWhenModifiedOnly = !opt_data.set_FlushOnCleanup;
opt_data.VolumeParams.PassQueryDirectoryFileName = TRUE; opt_data.VolumeParams.PassQueryDirectoryFileName = TRUE;
opt_data.VolumeParams.DeviceControl = TRUE; opt_data.VolumeParams.DeviceControl = TRUE;
#if defined(FSP_CFG_REJECT_EARLY_IRP) #if defined(FSP_CFG_REJECT_EARLY_IRP)
@@ -902,9 +905,11 @@ FSP_FUSE_API struct fuse *fsp_fuse_new(struct fsp_fuse_env *env,
f->set_create_dir_umask = opt_data.set_create_dir_umask; f->create_dir_umask = opt_data.create_dir_umask; f->set_create_dir_umask = opt_data.set_create_dir_umask; f->create_dir_umask = opt_data.create_dir_umask;
f->set_uid = opt_data.set_uid; f->uid = opt_data.uid; f->set_uid = opt_data.set_uid; f->uid = opt_data.uid;
f->set_gid = opt_data.set_gid; f->gid = opt_data.gid; f->set_gid = opt_data.set_gid; f->gid = opt_data.gid;
f->add_write_ea_access = opt_data.add_write_ea_access;
f->rellinks = opt_data.rellinks; f->rellinks = opt_data.rellinks;
f->dothidden = opt_data.dothidden; f->dothidden = opt_data.dothidden;
f->ThreadCount = opt_data.ThreadCount; f->ThreadCount = opt_data.ThreadCount;
f->FlushOnCleanup = !!opt_data.set_FlushOnCleanup;
memcpy(&f->ops, ops, opsize); memcpy(&f->ops, ops, opsize);
f->data = data; f->data = data;
f->DebugLog = opt_data.debug ? -1 : 0; f->DebugLog = opt_data.debug ? -1 : 0;
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file dll/fuse/fuse_compat.c * @file dll/fuse/fuse_compat.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+54 -10
View File
@@ -1,7 +1,7 @@
/** /**
* @file dll/fuse/fuse_intf.c * @file dll/fuse/fuse_intf.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
@@ -545,6 +545,39 @@ static NTSTATUS fsp_fuse_intf_GetFileInfoFunnel(FSP_FILE_SYSTEM *FileSystem,
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
static VOID fsp_fuse_intf_AddWriteEaAccess(
PSECURITY_DESCRIPTOR SecurityDescriptor)
{
BOOL DaclPresent, DaclDefaulted;
PACL Acl;
ACL_SIZE_INFORMATION AclSizeInfo;
PACE_HEADER Ace;
PACCESS_MASK AccessMask;
if (!GetSecurityDescriptorDacl(SecurityDescriptor, &DaclPresent, &Acl, &DaclDefaulted))
return;
if (0 == Acl)
return;
if (!GetAclInformation(Acl, &AclSizeInfo, sizeof AclSizeInfo, AclSizeInformation))
return;
for (DWORD I = 0; I < AclSizeInfo.AceCount; I++)
{
if (!GetAce(Acl, I, &Ace))
return;
if (Ace->AceType == ACCESS_ALLOWED_ACE_TYPE)
AccessMask = &((PACCESS_ALLOWED_ACE)Ace)->Mask;
else if (Ace->AceType == ACCESS_DENIED_ACE_TYPE)
AccessMask = &((PACCESS_DENIED_ACE)Ace)->Mask;
else
continue;
if (*AccessMask & FILE_WRITE_DATA)
*AccessMask |= FILE_WRITE_EA;
}
}
static NTSTATUS fsp_fuse_intf_GetSecurityEx(FSP_FILE_SYSTEM *FileSystem, static NTSTATUS fsp_fuse_intf_GetSecurityEx(FSP_FILE_SYSTEM *FileSystem,
const char *PosixPath, struct fuse_file_info *fi, const char *PosixPath, struct fuse_file_info *fi,
PUINT32 PFileAttributes, PUINT32 PFileAttributes,
@@ -579,7 +612,11 @@ static NTSTATUS fsp_fuse_intf_GetSecurityEx(FSP_FILE_SYSTEM *FileSystem,
*PSecurityDescriptorSize = SecurityDescriptorSize; *PSecurityDescriptorSize = SecurityDescriptorSize;
if (0 != SecurityDescriptorBuf) if (0 != SecurityDescriptorBuf)
{
memcpy(SecurityDescriptorBuf, SecurityDescriptor, SecurityDescriptorSize); memcpy(SecurityDescriptorBuf, SecurityDescriptor, SecurityDescriptorSize);
if (f->add_write_ea_access)
fsp_fuse_intf_AddWriteEaAccess(SecurityDescriptorBuf);
}
} }
if (0 != PFileAttributes) if (0 != PFileAttributes)
@@ -1046,13 +1083,12 @@ static NTSTATUS fsp_fuse_intf_Create(FSP_FILE_SYSTEM *FileSystem,
goto exit; goto exit;
/* /*
* Ignore fuse_file_info::direct_io, fuse_file_info::keep_cache. * Ignore fuse_file_info::keep_cache.
* NOTE: Originally WinFsp did not support disabling the cache manager
* for an individual file. This is now possible and we should revisit.
*
* Ignore fuse_file_info::nonseekable. * Ignore fuse_file_info::nonseekable.
*/ */
FspFileSystemGetOperationContext()->Response->Rsp.Create.Opened.DisableCache = fi.direct_io;
*PFileDesc = filedesc; *PFileDesc = filedesc;
memcpy(FileInfo, &FileInfoBuf, sizeof FileInfoBuf); memcpy(FileInfo, &FileInfoBuf, sizeof FileInfoBuf);
@@ -1191,13 +1227,12 @@ static NTSTATUS fsp_fuse_intf_Open(FSP_FILE_SYSTEM *FileSystem,
goto exit; goto exit;
/* /*
* Ignore fuse_file_info::direct_io, fuse_file_info::keep_cache. * Ignore fuse_file_info::keep_cache.
* NOTE: Originally WinFsp did not support disabling the cache manager
* for an individual file. This is now possible and we should revisit.
*
* Ignore fuse_file_info::nonseekable. * Ignore fuse_file_info::nonseekable.
*/ */
FspFileSystemGetOperationContext()->Response->Rsp.Create.Opened.DisableCache = fi.direct_io;
*PFileDesc = filedesc; *PFileDesc = filedesc;
memcpy(FileInfo, &FileInfoBuf, sizeof FileInfoBuf); memcpy(FileInfo, &FileInfoBuf, sizeof FileInfoBuf);
@@ -1305,6 +1340,7 @@ static VOID fsp_fuse_intf_Cleanup(FSP_FILE_SYSTEM *FileSystem,
{ {
struct fuse *f = FileSystem->UserContext; struct fuse *f = FileSystem->UserContext;
struct fsp_fuse_file_desc *filedesc = FileDesc; struct fsp_fuse_file_desc *filedesc = FileDesc;
struct fuse_file_info fi;
/* /*
* In Windows a DeleteFile/RemoveDirectory is the sequence of the following: * In Windows a DeleteFile/RemoveDirectory is the sequence of the following:
@@ -1331,6 +1367,14 @@ static VOID fsp_fuse_intf_Cleanup(FSP_FILE_SYSTEM *FileSystem,
* LegacyUnlinkRename option to opt out of the POSIX unlink semantics. * LegacyUnlinkRename option to opt out of the POSIX unlink semantics.
*/ */
if (f->FlushOnCleanup && !filedesc->IsDirectory && !filedesc->IsReparsePoint) {
memset(&fi, 0, sizeof fi);
fi.flags = filedesc->OpenFlags;
fi.fh = filedesc->FileHandle;
if (0 != f->ops.flush)
f->ops.flush(filedesc->PosixPath, &fi);
}
if (Flags & FspCleanupDelete) if (Flags & FspCleanupDelete)
if (filedesc->IsDirectory && !filedesc->IsReparsePoint) if (filedesc->IsDirectory && !filedesc->IsReparsePoint)
{ {
@@ -1366,7 +1410,7 @@ static VOID fsp_fuse_intf_Close(FSP_FILE_SYSTEM *FileSystem,
} }
else else
{ {
if (0 != f->ops.flush) if (!f->FlushOnCleanup && 0 != f->ops.flush)
f->ops.flush(filedesc->PosixPath, &fi); f->ops.flush(filedesc->PosixPath, &fi);
if (0 != f->ops.release) if (0 != f->ops.release)
f->ops.release(filedesc->PosixPath, &fi); f->ops.release(filedesc->PosixPath, &fi);
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file dll/fuse/fuse_loop.c * @file dll/fuse/fuse_loop.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file dll/fuse/fuse_main.c * @file dll/fuse/fuse_main.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file dll/fuse/fuse_opt.c * @file dll/fuse/fuse_opt.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+5 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file dll/fuse/library.h * @file dll/fuse/library.h
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
@@ -55,6 +55,7 @@ struct fuse
int set_create_dir_umask, create_dir_umask; int set_create_dir_umask, create_dir_umask;
int set_uid, uid; int set_uid, uid;
int set_gid, gid; int set_gid, gid;
int add_write_ea_access;
int rellinks; int rellinks;
int dothidden; int dothidden;
unsigned ThreadCount; unsigned ThreadCount;
@@ -63,6 +64,7 @@ struct fuse
unsigned conn_want; unsigned conn_want;
BOOLEAN fsinit; BOOLEAN fsinit;
BOOLEAN has_symlinks, has_slashdot; BOOLEAN has_symlinks, has_slashdot;
BOOLEAN FlushOnCleanup;
UINT32 DebugLog; UINT32 DebugLog;
FSP_FILE_SYSTEM_OPERATION_GUARD_STRATEGY OpGuardStrategy; FSP_FILE_SYSTEM_OPERATION_GUARD_STRATEGY OpGuardStrategy;
FSP_FSCTL_VOLUME_PARAMS VolumeParams; FSP_FSCTL_VOLUME_PARAMS VolumeParams;
@@ -147,6 +149,7 @@ struct fsp_fuse_core_opt_data
set_create_dir_umask, create_dir_umask, set_create_dir_umask, create_dir_umask,
set_uid, uid, username_to_uid_result, set_uid, uid, username_to_uid_result,
set_gid, gid, set_gid, gid,
add_write_ea_access,
set_uidmap, set_uidmap,
set_attr_timeout, attr_timeout, set_attr_timeout, attr_timeout,
rellinks, rellinks,
@@ -156,6 +159,7 @@ struct fsp_fuse_core_opt_data
set_EaTimeout, set_EaTimeout,
set_VolumeInfoTimeout, set_VolumeInfoTimeout,
set_KeepFileCache, set_KeepFileCache,
set_FlushOnCleanup,
set_LegacyUnlinkRename; set_LegacyUnlinkRename;
unsigned ThreadCount; unsigned ThreadCount;
FSP_FSCTL_VOLUME_PARAMS VolumeParams; FSP_FSCTL_VOLUME_PARAMS VolumeParams;
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file dll/fuse3/fuse2to3.c * @file dll/fuse3/fuse2to3.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file dll/fuse3/fuse3.c * @file dll/fuse3/fuse3.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file dll/fuse/fuse3_compat.c * @file dll/fuse/fuse3_compat.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file dll/fuse3/library.h * @file dll/fuse3/library.h
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file dll/launch.c * @file dll/launch.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file dll/ldap.c * @file dll/ldap.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file dll/library.c * @file dll/library.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+16 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file dll/library.h * @file dll/library.h
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
@@ -106,6 +106,21 @@ NTSTATUS FspGetModuleFileName(
ULONG Size, ULONG Size,
PWSTR RelativePath); PWSTR RelativePath);
typedef struct
{
SRWLOCK Lock;
HANDLE Handle;
UINT64 Offset;
} FSP_ADAPTIVE_LOCK;
#define FSP_ADAPTIVE_LOCK_INIT { SRWLOCK_INIT, INVALID_HANDLE_VALUE, 0 }
VOID FspAdaptiveLockAcquire(
FSP_ADAPTIVE_LOCK *Lock,
PWSTR FileName,
UINT64 Offset,
DWORD Timeout);
VOID FspAdaptiveLockRelease(
FSP_ADAPTIVE_LOCK *Lock);
#define FspFileSystemDirectoryBufferEntryInvalid ((ULONG)-1) #define FspFileSystemDirectoryBufferEntryInvalid ((ULONG)-1)
VOID FspFileSystemPeekInDirectoryBuffer(PVOID *PDirBuffer, VOID FspFileSystemPeekInDirectoryBuffer(PVOID *PDirBuffer,
PUINT8 *PBuffer, PULONG *PIndex, PULONG PCount); PUINT8 *PBuffer, PULONG *PIndex, PULONG PCount);
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file dll/mount.c * @file dll/mount.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+54 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file dll/np.c * @file dll/np.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
@@ -454,6 +454,41 @@ exit:
return NpResult; return NpResult;
} }
static BOOLEAN FspNpCheckRemoteVolume(PWSTR RemoteName)
{
PWSTR ClassName, InstanceName, P;
ULONG ClassNameLen, InstanceNameLen;
WCHAR RemoteNameBuf[9 + sizeof(((FSP_FSCTL_VOLUME_PARAMS *)0)->Prefix) / sizeof(WCHAR)];
HANDLE Handle;
DWORD Bytes;
BOOLEAN Result;
if (!FspNpParseRemoteName(RemoteName,
&ClassName, &ClassNameLen, &InstanceName, &InstanceNameLen))
return FALSE;
Result = FALSE;
P = RemoteNameBuf;
*P++ = L'\\'; *P++ = L'\\'; *P++ = L'?'; *P++ = L'\\';
*P++ = L'U'; *P++ = L'N'; *P++ = L'C'; *P++ = L'\\';
memcpy(P, ClassName, ClassNameLen * sizeof(WCHAR)); P += ClassNameLen; *P++ = L'\\';
memcpy(P, InstanceName, InstanceNameLen * sizeof(WCHAR)); P += InstanceNameLen; *P++ = L'\\';
*P++ = L'\0';
Handle = CreateFileW(RemoteNameBuf,
FILE_READ_ATTRIBUTES, 0, 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
if (INVALID_HANDLE_VALUE != Handle)
{
/* the file system is up and running; is it WinFsp? */
if (DeviceIoControl(Handle, FSP_FSCTL_QUERY_WINFSP, 0, 0, 0, 0, &Bytes, 0))
Result = TRUE;
CloseHandle(Handle);
}
return Result;
}
DWORD APIENTRY NPGetConnection( DWORD APIENTRY NPGetConnection(
LPWSTR lpLocalName, LPWSTR lpRemoteName, LPDWORD lpnBufferLen) LPWSTR lpLocalName, LPWSTR lpRemoteName, LPDWORD lpnBufferLen)
{ {
@@ -573,7 +608,16 @@ DWORD APIENTRY NPAddConnection(LPNETRESOURCEW lpNetResource, LPWSTR lpPassword,
NpResult = FspNpGetRemoteInfo(lpRemoteName, 0, &CredentialsKind, &AllowImpersonation); NpResult = FspNpGetRemoteInfo(lpRemoteName, 0, &CredentialsKind, &AllowImpersonation);
if (WN_SUCCESS != NpResult) if (WN_SUCCESS != NpResult)
{
/*
* This may still be a WinFsp network file system, but not managed by the Launcher.
* So if it is already live, one of ours and we do not need to map a drive, then go
* ahead and report success.
*/
if (L'\0' == LocalNameBuf[0] && FspNpCheckRemoteVolume(lpRemoteName))
NpResult = WN_SUCCESS;
return NpResult; return NpResult;
}
#if defined(FSP_NP_CREDENTIAL_MANAGER) #if defined(FSP_NP_CREDENTIAL_MANAGER)
/* if we need credentials and none were passed check with the credential manager */ /* if we need credentials and none were passed check with the credential manager */
@@ -720,6 +764,15 @@ DWORD APIENTRY NPAddConnection(LPNETRESOURCEW lpNetResource, LPWSTR lpPassword,
/* we are not being asked for a drive mapping, so whatever we have is good! */ /* we are not being asked for a drive mapping, so whatever we have is good! */
NpResult = WN_SUCCESS; NpResult = WN_SUCCESS;
break; break;
case WN_NO_NETWORK:
/*
* This may still be a WinFsp network file system, but not managed by the Launcher.
* So if it is already live, one of ours and we do not need to map a drive, then go
* ahead and report success.
*/
if (L'\0' == LocalNameBuf[0] && FspNpCheckRemoteVolume(lpRemoteName))
NpResult = WN_SUCCESS;
break;
default: default:
NpResult = WN_NO_NETWORK; NpResult = WN_NO_NETWORK;
break; break;
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file dll/ntstatus.c * @file dll/ntstatus.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file dll/path.c * @file dll/path.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file dll/security.c * @file dll/security.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file dll/service.c * @file dll/service.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file dll/sxs.c * @file dll/sxs.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+72 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file dll/util.c * @file dll/util.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
@@ -418,3 +418,74 @@ NTSTATUS FspGetModuleFileName(
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
VOID FspAdaptiveLockAcquire(
FSP_ADAPTIVE_LOCK *Lock,
PWSTR FileName,
UINT64 Offset,
DWORD Timeout)
{
AcquireSRWLockExclusive(&Lock->Lock);
if (0 != FileName)
{
HANDLE Handle;
DWORD BytesTransferred;
OVERLAPPED Overlapped;
BOOL Success;
Handle = CreateFileW(
FileName,
FILE_READ_DATA,
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
0,
OPEN_EXISTING,
FILE_FLAG_OVERLAPPED,
0);
if (INVALID_HANDLE_VALUE != Handle)
{
memset(&Overlapped, 0, sizeof Overlapped);
Overlapped.Offset = ((PLARGE_INTEGER)&Offset)->LowPart;
Overlapped.OffsetHigh = ((PLARGE_INTEGER)&Offset)->HighPart;
Success = LockFileEx(
Handle,
LOCKFILE_EXCLUSIVE_LOCK, 0,
1, 0,
&Overlapped);
if (Success || ERROR_IO_PENDING == GetLastError())
{
Success = FALSE;
if (WAIT_OBJECT_0 == WaitForSingleObject(Handle, Timeout))
Success = GetOverlappedResult(Handle, &Overlapped, &BytesTransferred, TRUE);
}
if (Success)
{
Lock->Handle = Handle;
Lock->Offset = Offset;
}
else
CloseHandle(Handle);
}
}
}
VOID FspAdaptiveLockRelease(
FSP_ADAPTIVE_LOCK *Lock)
{
if (INVALID_HANDLE_VALUE != Lock->Handle)
{
HANDLE Handle = Lock->Handle;
LARGE_INTEGER LargeOffset = *(PLARGE_INTEGER)&Lock->Offset;
UnlockFile(Handle, LargeOffset.LowPart, LargeOffset.HighPart, 1, 0);
CloseHandle(Handle);
Lock->Handle = INVALID_HANDLE_VALUE;
Lock->Offset = 0;
}
ReleaseSRWLockExclusive(&Lock->Lock);
}
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file dll/wksid.c * @file dll/wksid.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/* /*
* dotnet/FileSystemBase+Const.cs * dotnet/FileSystemBase+Const.cs
* *
* Copyright 2015-2022 Bill Zissimopoulos * Copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/* /*
* dotnet/FileSystemBase.cs * dotnet/FileSystemBase.cs
* *
* Copyright 2015-2022 Bill Zissimopoulos * Copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/* /*
* dotnet/FileSystemHost.cs * dotnet/FileSystemHost.cs
* *
* Copyright 2015-2022 Bill Zissimopoulos * Copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/* /*
* dotnet/Interop.cs * dotnet/Interop.cs
* *
* Copyright 2015-2022 Bill Zissimopoulos * Copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/* /*
* dotnet/Service.cs * dotnet/Service.cs
* *
* Copyright 2015-2022 Bill Zissimopoulos * Copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file fsptool/fsptool.c * @file fsptool/fsptool.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file launcher/launchctl.c * @file launcher/launchctl.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file launcher/launcher.c * @file launcher/launcher.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file launcher/ptrans.c * @file launcher/ptrans.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -4,7 +4,7 @@
* Shared kernel/user configuration. This file is to be included by the * Shared kernel/user configuration. This file is to be included by the
* FSD and DLL components ONLY! * FSD and DLL components ONLY!
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file shared/ku/library.h * @file shared/ku/library.h
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file shared/ku/mountmgr.c * @file shared/ku/mountmgr.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+2 -2
View File
@@ -14,7 +14,7 @@
* [SNAME] * [SNAME]
* https://www.cygwin.com/cygwin-ug-net/using-specialnames.html * https://www.cygwin.com/cygwin-ug-net/using-specialnames.html
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
@@ -1416,7 +1416,7 @@ FSP_API NTSTATUS FspPosixMapPosixToWindowsPathEx(const char *PosixPath, PWSTR *P
goto lasterror; goto lasterror;
WindowsPath = MemAlloc(Size * sizeof(WCHAR)); WindowsPath = MemAlloc(Size * sizeof(WCHAR));
if (0 == PosixPath) if (0 == WindowsPath)
{ {
Result = STATUS_INSUFFICIENT_RESOURCES; Result = STATUS_INSUFFICIENT_RESOURCES;
goto exit; goto exit;
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file shared/ku/uuid5.c * @file shared/ku/uuid5.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file shared/um/minimal.h * @file shared/um/minimal.h
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+4 -2
View File
@@ -2,7 +2,7 @@
* @file sys/callbacks.c * @file sys/callbacks.c
* Fast I/O and resource acquisition callbacks. * Fast I/O and resource acquisition callbacks.
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
@@ -324,7 +324,9 @@ VOID FspPropagateTopFlags(PIRP Irp, PIRP TopLevelIrp)
FspFileNodeAcquireMain : FspFileNodeAcquireMain :
FspFileNodeAcquireFull); FspFileNodeAcquireFull);
} }
else if ((PIRP)MM_SYSTEM_RANGE_START <= TopLevelIrp && IO_TYPE_IRP == TopLevelIrp->Type) else if ((PIRP)MM_SYSTEM_RANGE_START <= TopLevelIrp &&
IO_TYPE_IRP == TopLevelIrp->Type &&
TopLevelIrp->CurrentLocation <= TopLevelIrp->StackCount)
{ {
PFILE_OBJECT FileObject = IoGetCurrentIrpStackLocation(Irp)->FileObject; PFILE_OBJECT FileObject = IoGetCurrentIrpStackLocation(Irp)->FileObject;
PFILE_OBJECT TopLevelFileObject = IoGetCurrentIrpStackLocation(TopLevelIrp)->FileObject; PFILE_OBJECT TopLevelFileObject = IoGetCurrentIrpStackLocation(TopLevelIrp)->FileObject;
+2 -3
View File
@@ -1,7 +1,7 @@
/** /**
* @file sys/cleanup.c * @file sys/cleanup.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
@@ -242,8 +242,7 @@ static VOID FspFsvolCleanupRequestFini(FSP_FSCTL_TRANSACT_REQ *Request, PVOID Co
FspFileNodeReleaseOwner(FileNode, Pgio, Request); FspFileNodeReleaseOwner(FileNode, Pgio, Request);
FspFileNodeCleanupComplete(FileNode, FileObject, !!Request->Req.Cleanup.Delete); FspFileNodeCleanupComplete(FileNode, FileObject, !!Request->Req.Cleanup.Delete);
if (!FileNode->IsDirectory) FspFileNodeOplockCheck(FileNode, Irp);
FspFileNodeOplockCheck(FileNode, Irp);
SetFlag(FileObject->Flags, FO_CLEANUP_COMPLETE); SetFlag(FileObject->Flags, FO_CLEANUP_COMPLETE);
MainFileHandle = FileDesc->MainFileHandle; MainFileHandle = FileDesc->MainFileHandle;
+4 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file sys/close.c * @file sys/close.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
@@ -75,6 +75,9 @@ static NTSTATUS FspFsvolClose(
ASSERT(FileNode == FileDesc->FileNode); ASSERT(FileNode == FileDesc->FileNode);
if (!FlagOn(FileObject->Flags, FO_CLEANUP_COMPLETE))
FspFileNodeOplockCheck(FileNode, Irp);
/* create the user-mode file system request; MustSucceed because IRP_MJ_CLOSE cannot fail */ /* create the user-mode file system request; MustSucceed because IRP_MJ_CLOSE cannot fail */
FspIopCreateRequestMustSucceed(0, 0, 0, &Request); FspIopCreateRequestMustSucceed(0, 0, 0, &Request);
Request->Kind = FspFsctlTransactCloseKind; Request->Kind = FspFsctlTransactCloseKind;
+19 -4
View File
@@ -1,7 +1,7 @@
/** /**
* @file sys/create.c * @file sys/create.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
@@ -298,6 +298,8 @@ static NTSTATUS FspFsvolCreateNoLock(
ULONG CreateOptions = IrpSp->Parameters.Create.Options; ULONG CreateOptions = IrpSp->Parameters.Create.Options;
USHORT FileAttributes = IrpSp->Parameters.Create.FileAttributes; USHORT FileAttributes = IrpSp->Parameters.Create.FileAttributes;
PSECURITY_DESCRIPTOR SecurityDescriptor = AccessState->SecurityDescriptor; PSECURITY_DESCRIPTOR SecurityDescriptor = AccessState->SecurityDescriptor;
BOOLEAN SecurityDescriptorRelative = 0 != SecurityDescriptor &&
BooleanFlagOn(((SECURITY_DESCRIPTOR *)SecurityDescriptor)->Control, SE_SELF_RELATIVE);
ULONG SecurityDescriptorSize = 0; ULONG SecurityDescriptorSize = 0;
UINT64 AllocationSize = Irp->Overlay.AllocationSize.QuadPart; UINT64 AllocationSize = Irp->Overlay.AllocationSize.QuadPart;
UINT64 AllocationUnit; UINT64 AllocationUnit;
@@ -406,7 +408,10 @@ static NTSTATUS FspFsvolCreateNoLock(
if (!RtlValidSecurityDescriptor(SecurityDescriptor)) if (!RtlValidSecurityDescriptor(SecurityDescriptor))
return STATUS_INVALID_PARAMETER; return STATUS_INVALID_PARAMETER;
#endif #endif
SecurityDescriptorSize = RtlLengthSecurityDescriptor(SecurityDescriptor); if (SecurityDescriptorRelative)
SecurityDescriptorSize = RtlLengthSecurityDescriptor(SecurityDescriptor);
else
RtlAbsoluteToSelfRelativeSD(SecurityDescriptor, 0, &SecurityDescriptorSize);
} }
/* align allocation size */ /* align allocation size */
@@ -702,8 +707,18 @@ static NTSTATUS FspFsvolCreateNoLock(
/* copy the security descriptor (if any) into the request */ /* copy the security descriptor (if any) into the request */
if (0 != SecurityDescriptorSize) if (0 != SecurityDescriptorSize)
RtlCopyMemory(Request->Buffer + Request->Req.Create.SecurityDescriptor.Offset, {
SecurityDescriptor, SecurityDescriptorSize); if (SecurityDescriptorRelative)
RtlCopyMemory(
Request->Buffer + Request->Req.Create.SecurityDescriptor.Offset,
SecurityDescriptor,
SecurityDescriptorSize);
else
RtlAbsoluteToSelfRelativeSD(
SecurityDescriptor,
(PSECURITY_DESCRIPTOR)(Request->Buffer + Request->Req.Create.SecurityDescriptor.Offset),
&SecurityDescriptorSize);
}
/* copy the extra buffer (if any) into the request */ /* copy the extra buffer (if any) into the request */
if (0 != ExtraBuffer) if (0 != ExtraBuffer)
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file sys/debug.c * @file sys/debug.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+41 -13
View File
@@ -1,7 +1,7 @@
/** /**
* @file sys/devctl.c * @file sys/devctl.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
@@ -72,15 +72,32 @@ BOOLEAN FspFastIoDeviceControl(
if (!Result) if (!Result)
FSP_RETURN(); FSP_RETURN();
#if 0 if (0 != InputBufferLength &&
PDEVICE_OBJECT FsctlDeviceObject = DeviceObject; FSP_FSCTL_DEFAULT_ALIGN_UP(sizeof(FSP_FSCTL_TRANSACT_RSP)) > InputBufferLength)
if (!FspDeviceReference(FsctlDeviceObject)) FSP_RETURN(IoStatus->Status = STATUS_INVALID_PARAMETER);
if (0 != OutputBufferLength &&
FSP_FSCTL_TRANSACT_BUFFER_SIZEMIN > OutputBufferLength)
FSP_RETURN(IoStatus->Status = STATUS_BUFFER_TOO_SMALL);
PVOID SystemBuffer = 0;
if (0 != InputBufferLength || 0 != OutputBufferLength)
{ {
IoStatus->Status = STATUS_CANCELLED; SystemBuffer = FspAllocNonPaged(
IoStatus->Information = 0; InputBufferLength > OutputBufferLength ? InputBufferLength : OutputBufferLength);
FSP_RETURN(); if (0 == SystemBuffer)
FSP_RETURN(Result = FALSE);
if (0 != InputBuffer)
try
{
RtlCopyMemory(SystemBuffer, InputBuffer, InputBufferLength);
}
except (EXCEPTION_EXECUTE_HANDLER)
{
FspFree(SystemBuffer);
FSP_RETURN(Result = FALSE);
}
} }
#endif
ASSERT(0 == IoGetTopLevelIrp()); ASSERT(0 == IoGetTopLevelIrp());
IoSetTopLevelIrp((PIRP)FSRTL_FAST_IO_TOP_LEVEL_IRP); IoSetTopLevelIrp((PIRP)FSRTL_FAST_IO_TOP_LEVEL_IRP);
@@ -88,18 +105,29 @@ BOOLEAN FspFastIoDeviceControl(
IoStatus->Status = FspVolumeFastTransact( IoStatus->Status = FspVolumeFastTransact(
FileObject->FsContext2, FileObject->FsContext2,
IoControlCode, IoControlCode,
InputBuffer, SystemBuffer,
InputBufferLength, InputBufferLength,
OutputBuffer, 0 != OutputBufferLength ? SystemBuffer : 0,
OutputBufferLength, OutputBufferLength,
IoStatus, IoStatus,
(PIRP)FSRTL_FAST_IO_TOP_LEVEL_IRP); (PIRP)FSRTL_FAST_IO_TOP_LEVEL_IRP);
IoSetTopLevelIrp(0); IoSetTopLevelIrp(0);
#if 0 if (0 != SystemBuffer)
FspDeviceDereference(FsctlDeviceObject); {
#endif if (NT_SUCCESS(IoStatus->Status) && 0 != OutputBuffer)
try
{
RtlCopyMemory(OutputBuffer, SystemBuffer, IoStatus->Information);
}
except (EXCEPTION_EXECUTE_HANDLER)
{
IoStatus->Status = GetExceptionCode();
IoStatus->Information = 0;
}
FspFree(SystemBuffer);
}
FSP_LEAVE_BOOL( FSP_LEAVE_BOOL(
"%s, FileObject=%p", "%s, FileObject=%p",
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file sys/device.c * @file sys/device.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file sys/devtimer.c * @file sys/devtimer.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file sys/dirctl.c * @file sys/dirctl.c
* *
* @copyright 2015-2022 Bill Zissimopoulos * @copyright 2015-2026 Bill Zissimopoulos
*/ */
/* /*
* This file is part of WinFsp. * This file is part of WinFsp.

Some files were not shown because too many files have changed in this diff Show More