mirror of
https://github.com/winfsp/winfsp.git
synced 2025-07-02 17:02:57 -05:00
Compare commits
23 Commits
Author | SHA1 | Date | |
---|---|---|---|
858df29ba2 | |||
4366866653 | |||
e4b808806c | |||
13cee6e019 | |||
35b9cb15a3 | |||
0d8f0f9ac8 | |||
a4e2ad9dd6 | |||
9b4318c655 | |||
5827b1fa9c | |||
913f7ac9cd | |||
0e2f46dc90 | |||
e7cba96c74 | |||
03db443406 | |||
0b65bc7e01 | |||
12e1caaa98 | |||
7a690a789b | |||
8ca419830c | |||
c310d8ea1b | |||
c3ddf73661 | |||
6b00b8e28a | |||
35c722e91b | |||
ae8802514b | |||
e90aa46a27 |
39
README.md
39
README.md
@ -1,5 +1,7 @@
|
||||
# WinFsp - Windows File System Proxy
|
||||
|
||||

|
||||
|
||||
WinFsp is a set of software components for Windows computers that allows the creation of user mode file systems. In this sense it is similar to FUSE (Filesystem in Userspace), which provides the same functionality on UNIX-like computers.
|
||||
|
||||
Some of the benefits and features of using WinFsp are listed below:
|
||||
@ -34,10 +36,41 @@ The project source code is organized as follows:
|
||||
* tst/memfs: Source code to an example file system written in C++ (memfs).
|
||||
* tst/winfsp-tests: WinFsp test suite.
|
||||
|
||||
## Building
|
||||
## Building and Running
|
||||
|
||||
In order to build WinFsp you will need Windows 10 and Visual Studio 2015. You will also need the Windows Driver Kit (WDK) 10.
|
||||
In order to build WinFsp you will need the following:
|
||||
|
||||
* Windows 10
|
||||
* Visual Studio 2015
|
||||
* Windows Driver Kit (WDK) 10
|
||||
* [Wix toolset](http://wixtoolset.org)
|
||||
|
||||
If you build the driver yourself it will not be signed and Windows will refuse to load it unless you enable "testsigning". You can enable "testsigning" using the command `bcdedit.exe -set testsigning`. For more information see this [document](http://www.secfs.net/winfsp/develop/debug/).
|
||||
|
||||
WinFsp is designed to run on Vista and above. It has been tested on the following platforms so far:
|
||||
|
||||
* Windows 7 Enterprise
|
||||
* Windows 8 Pro
|
||||
* Windows 10 Pro
|
||||
* Windows Server 2012
|
||||
|
||||
## How to Help
|
||||
|
||||
I am looking for help in the following areas:
|
||||
|
||||
* If you have a file system that runs on FUSE please consider porting it to WinFsp. WinFsp has a native API, but it also has a FUSE (high-level) API.
|
||||
* If you are working with a language other than C/C++ (e.g. Delphi, C#, etc.) and you are interested in porting/wrapping WinFsp I would love to hear from you.
|
||||
* There are a number of outstanding issues listed in the [GitHub repository](https://github.com/billziss-gh/winfsp/issues) ~~[BitBucket repository](https://bitbucket.org/billziss/winfsp/issues?status=new&status=open)~~. Many of these require knowledge of Windows kernel-mode and an understanding of the internals of WinFsp so they are not for the faint of heart. If you decide to tackle any of those please coordinate with me as I am actively working on that issue list.
|
||||
|
||||
In all cases I can provide ideas and/or support.
|
||||
|
||||
## Where to Discuss
|
||||
|
||||
If you wish to discuss WinFsp there are now two options:
|
||||
|
||||
- [WinFsp Google Group](https://groups.google.com/forum/#!forum/winfsp)
|
||||
- [Author's Twitter](https://twitter.com/BZissimopoulos)
|
||||
|
||||
## License
|
||||
|
||||
WinFsp is available under the [AGPLv3](http://www.gnu.org/licenses/agpl-3.0.html) license. If you find the constraints of the AGPLv3 too onerous, a commercial license is also available. Please contact Bill Zissimopoulos <billziss at navimatics.com> for more details.
|
||||
WinFsp is available under the [AGPLv3](http://www.gnu.org/licenses/agpl-3.0.html) license. If you find the constraints of the AGPLv3 too onerous, a commercial license is also available. Please contact Bill Zissimopoulos <billziss at navimatics.com> for more details.
|
||||
|
@ -6,6 +6,7 @@ environment:
|
||||
install:
|
||||
- git submodule update --init --recursive
|
||||
- appveyor AddMessage "Change boot configuration and reboot" -Category Information
|
||||
- verifier /standard /driver winfsp-x64.sys
|
||||
- bcdedit /set testsigning on
|
||||
- ps: Restart-Computer -Force
|
||||
- ps: Start-Sleep -s 10
|
||||
@ -19,3 +20,4 @@ test_script:
|
||||
- for %%f in ("build\VStudio\build\%CONFIGURATION%\winfsp-*.msi") do start /wait msiexec /i %%f /qn INSTALLLEVEL=1000
|
||||
- tools\nmake-ext-test.bat %CONFIGURATION%
|
||||
- tools\run-tests.bat %CONFIGURATION%
|
||||
- verifier /query
|
||||
|
BIN
art/winfsp-outln.afdesign
Normal file
BIN
art/winfsp-outln.afdesign
Normal file
Binary file not shown.
BIN
art/winfsp-solid.afdesign
Normal file
BIN
art/winfsp-solid.afdesign
Normal file
Binary file not shown.
BIN
art/winfsp-solid.png
Normal file
BIN
art/winfsp-solid.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
BIN
art/wixbanner.pxm
Normal file
BIN
art/wixbanner.pxm
Normal file
Binary file not shown.
BIN
art/wixdialog.pxm
Normal file
BIN
art/wixdialog.pxm
Normal file
Binary file not shown.
@ -326,6 +326,8 @@
|
||||
</Feature>
|
||||
</Feature>
|
||||
|
||||
<WixVariable Id="WixUIBannerBmp" Value="wixbanner.bmp" />
|
||||
<WixVariable Id="WixUIDialogBmp" Value="wixdialog.bmp" />
|
||||
<UI Id="FeatureTree">
|
||||
<UIRef Id="WixUI_FeatureTree" />
|
||||
<!-- skip the license agreement dialog; higher Order takes priority (weird) -->
|
||||
|
BIN
build/VStudio/installer/wixbanner.bmp
Normal file
BIN
build/VStudio/installer/wixbanner.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 112 KiB |
BIN
build/VStudio/installer/wixdialog.bmp
Normal file
BIN
build/VStudio/installer/wixdialog.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 601 KiB |
@ -7,7 +7,12 @@
|
||||
<MyCopyright>2015-2016 Bill Zissimopoulos</MyCopyright>
|
||||
<!-- build number: concat 2-digit year with 3-digit day of the year (16-bits until 2066) -->
|
||||
<MyBuildNumber>$([System.DateTime]::Now.ToString(`yy`))$([System.DateTime]::Now.DayOfYear.ToString(`000`))</MyBuildNumber>
|
||||
<MyVersion>0.14.$(MyBuildNumber)</MyVersion>
|
||||
<MyVersion>0.15.$(MyBuildNumber)</MyVersion>
|
||||
<MyVersionWithCommas>$(MyVersion.Replace('.',',')),0</MyVersionWithCommas>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>NTDDI_VERSION=0x06000000;_WIN32_WINNT=0x0600</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
</Project>
|
@ -34,6 +34,7 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<TargetVersion>Windows10</TargetVersion>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<KernelBufferOverflowLib>$(DDK_LIB_PATH)\BufferOverflowK.lib</KernelBufferOverflowLib>
|
||||
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
|
||||
<ConfigurationType>Driver</ConfigurationType>
|
||||
<DriverType>WDM</DriverType>
|
||||
@ -41,6 +42,7 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<TargetVersion>Windows10</TargetVersion>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<KernelBufferOverflowLib>$(DDK_LIB_PATH)\BufferOverflowK.lib</KernelBufferOverflowLib>
|
||||
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
|
||||
<ConfigurationType>Driver</ConfigurationType>
|
||||
<DriverType>WDM</DriverType>
|
||||
@ -48,6 +50,7 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<TargetVersion>Windows10</TargetVersion>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<KernelBufferOverflowLib>$(DDK_LIB_PATH)\BufferOverflowK.lib</KernelBufferOverflowLib>
|
||||
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
|
||||
<ConfigurationType>Driver</ConfigurationType>
|
||||
<DriverType>WDM</DriverType>
|
||||
@ -55,6 +58,7 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<TargetVersion>Windows10</TargetVersion>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<KernelBufferOverflowLib>$(DDK_LIB_PATH)\BufferOverflowK.lib</KernelBufferOverflowLib>
|
||||
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
|
||||
<ConfigurationType>Driver</ConfigurationType>
|
||||
<DriverType>WDM</DriverType>
|
||||
|
@ -1,6 +1,14 @@
|
||||
= Changelog
|
||||
|
||||
|
||||
v0.15::
|
||||
|
||||
This is a minor release that brings support for Windows 7 and 32-bit OS'es.
|
||||
|
||||
- Fixes a number of issues for Windows 7. Windows 7 is now officially supported.
|
||||
- Fixes a number of issues with the 32-bit FSD and user mode components. 32-bit versions of Windows are now officially supported.
|
||||
|
||||
|
||||
v0.14::
|
||||
|
||||
This release includes support for file systems protected by credentials.
|
||||
|
@ -132,7 +132,9 @@ exit:
|
||||
|
||||
FSP_API NTSTATUS FspFsctlStop(HANDLE VolumeHandle)
|
||||
{
|
||||
if (!DeviceIoControl(VolumeHandle, FSP_FSCTL_STOP, 0, 0, 0, 0, 0, 0))
|
||||
DWORD Bytes;
|
||||
|
||||
if (!DeviceIoControl(VolumeHandle, FSP_FSCTL_STOP, 0, 0, 0, 0, &Bytes, 0))
|
||||
return FspNtStatusFromWin32(GetLastError());
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
|
@ -161,7 +161,7 @@ static inline BOOLEAN FspNpParseUserName(PWSTR RemoteName,
|
||||
&ClassName, &ClassNameLen, &InstanceName, &InstanceNameLen))
|
||||
{
|
||||
for (P = InstanceName; *P; P++)
|
||||
if ('@' == *P && P - InstanceName < UserNameSize)
|
||||
if ('@' == *P && (ULONG)(P - InstanceName) < UserNameSize)
|
||||
{
|
||||
memcpy(UserName, InstanceName, (P - InstanceName) * sizeof(WCHAR));
|
||||
UserName[P - InstanceName] = L'\0';
|
||||
|
@ -686,6 +686,7 @@ NTSTATUS SvcInstanceStart(HANDLE ClientToken,
|
||||
UINT8 RspBuf[2];
|
||||
DWORD BytesTransferred;
|
||||
OVERLAPPED Overlapped;
|
||||
DWORD WaitResult;
|
||||
|
||||
if (0 == (BytesTransferred =
|
||||
WideCharToMultiByte(CP_UTF8, 0, Secret, lstrlenW(Secret), ReqBuf, sizeof ReqBuf, 0, 0)))
|
||||
@ -711,13 +712,22 @@ NTSTATUS SvcInstanceStart(HANDLE ClientToken,
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!GetOverlappedResultEx(SvcInstance->StdioHandles[1], &Overlapped, &BytesTransferred,
|
||||
LAUNCHER_START_WITH_SECRET_TIMEOUT, FALSE))
|
||||
/*
|
||||
* We need to perform a GetOverlappedResult with a timeout. GetOverlappedResultEx would
|
||||
* be perfect except that it is a Windows 8 and above API. We will therefore replace with
|
||||
* WaitForSingleObject followed by GetOverlappedResult on success.
|
||||
*/
|
||||
WaitResult = WaitForSingleObject(SvcInstance->StdioHandles[1],
|
||||
LAUNCHER_START_WITH_SECRET_TIMEOUT);
|
||||
if (WAIT_OBJECT_0 == WaitResult)
|
||||
Result = GetOverlappedResult(SvcInstance->StdioHandles[1], &Overlapped, &BytesTransferred, TRUE) ?
|
||||
STATUS_SUCCESS : FspNtStatusFromWin32(GetLastError());
|
||||
else if (WAIT_TIMEOUT == WaitResult)
|
||||
Result = STATUS_TIMEOUT;
|
||||
else
|
||||
Result = FspNtStatusFromWin32(GetLastError());
|
||||
if (!NT_SUCCESS(Result) || STATUS_TIMEOUT == Result)
|
||||
{
|
||||
if (WAIT_TIMEOUT == GetLastError())
|
||||
Result = STATUS_TIMEOUT;
|
||||
else
|
||||
Result = FspNtStatusFromWin32(GetLastError());
|
||||
CancelIoEx(SvcInstance->StdioHandles[1], &Overlapped);
|
||||
goto exit;
|
||||
}
|
||||
|
@ -655,13 +655,14 @@ enum
|
||||
#define FspIopPostWorkRequestBestEffort(D, R)\
|
||||
FspIopPostWorkRequestFunnel(D, R, TRUE)
|
||||
#define FspIopCompleteIrp(I, R) FspIopCompleteIrpEx(I, R, TRUE)
|
||||
#define REQ_ALIGN_SIZE 16
|
||||
typedef VOID FSP_IOP_REQUEST_FINI(FSP_FSCTL_TRANSACT_REQ *Request, PVOID Context[4]);
|
||||
typedef struct
|
||||
{
|
||||
FSP_IOP_REQUEST_FINI *RequestFini;
|
||||
PVOID Context[4];
|
||||
FSP_FSCTL_TRANSACT_RSP *Response;
|
||||
__declspec(align(MEMORY_ALLOCATION_ALIGNMENT)) UINT8 RequestBuf[];
|
||||
__declspec(align(REQ_ALIGN_SIZE)) UINT8 RequestBuf[];
|
||||
} FSP_FSCTL_TRANSACT_REQ_HEADER;
|
||||
static inline
|
||||
PVOID *FspIopRequestContextAddress(FSP_FSCTL_TRANSACT_REQ *Request, ULONG I)
|
||||
@ -1034,4 +1035,26 @@ extern WCHAR FspFileDescDirectoryPatternMatchAll[];
|
||||
extern FSP_MV_CcCoherencyFlushAndPurgeCache *FspMvCcCoherencyFlushAndPurgeCache;
|
||||
extern ULONG FspMvMdlMappingNoWrite;
|
||||
|
||||
/*
|
||||
* Fixes
|
||||
*/
|
||||
|
||||
/* ObCloseHandle: add missing prototype */
|
||||
#if (NTDDI_VERSION < NTDDI_WIN7)
|
||||
NTKERNELAPI
|
||||
NTSTATUS
|
||||
ObCloseHandle(
|
||||
_In_ HANDLE Handle,
|
||||
_In_ KPROCESSOR_MODE PreviousMode
|
||||
);
|
||||
#endif
|
||||
|
||||
/* RtlEqualMemory: this is defined as memcmp, which does not exist on Win7 x86! */
|
||||
#undef RtlEqualMemory
|
||||
static inline
|
||||
LOGICAL RtlEqualMemory(const VOID *Source1, const VOID *Source2, SIZE_T Length)
|
||||
{
|
||||
return Length == RtlCompareMemory(Source1, Source2, Length);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
150
src/sys/ioctl.i
150
src/sys/ioctl.i
@ -89,82 +89,82 @@ SYM(FSCTL_DFSR_SET_GHOST_HANDLE_STATE)
|
||||
SYM(FSCTL_TXFS_LIST_TRANSACTIONS)
|
||||
SYM(FSCTL_QUERY_PAGEFILE_ENCRYPTION)
|
||||
SYM(FSCTL_RESET_VOLUME_ALLOCATION_HINTS)
|
||||
SYM(FSCTL_QUERY_DEPENDENT_VOLUME)
|
||||
SYM(FSCTL_SD_GLOBAL_CHANGE)
|
||||
//SYM(FSCTL_QUERY_DEPENDENT_VOLUME)
|
||||
//SYM(FSCTL_SD_GLOBAL_CHANGE)
|
||||
SYM(FSCTL_TXFS_READ_BACKUP_INFORMATION2)
|
||||
SYM(FSCTL_LOOKUP_STREAM_FROM_CLUSTER)
|
||||
SYM(FSCTL_TXFS_WRITE_BACKUP_INFORMATION2)
|
||||
SYM(FSCTL_FILE_TYPE_NOTIFICATION)
|
||||
SYM(FSCTL_FILE_LEVEL_TRIM)
|
||||
SYM(FSCTL_GET_BOOT_AREA_INFO)
|
||||
SYM(FSCTL_GET_RETRIEVAL_POINTER_BASE)
|
||||
SYM(FSCTL_SET_PERSISTENT_VOLUME_STATE)
|
||||
SYM(FSCTL_QUERY_PERSISTENT_VOLUME_STATE)
|
||||
SYM(FSCTL_REQUEST_OPLOCK)
|
||||
SYM(FSCTL_CSV_TUNNEL_REQUEST)
|
||||
SYM(FSCTL_IS_CSV_FILE)
|
||||
SYM(FSCTL_QUERY_FILE_SYSTEM_RECOGNITION)
|
||||
SYM(FSCTL_CSV_GET_VOLUME_PATH_NAME)
|
||||
SYM(FSCTL_CSV_GET_VOLUME_NAME_FOR_VOLUME_MOUNT_POINT)
|
||||
SYM(FSCTL_CSV_GET_VOLUME_PATH_NAMES_FOR_VOLUME_NAME)
|
||||
SYM(FSCTL_IS_FILE_ON_CSV_VOLUME)
|
||||
SYM(FSCTL_CORRUPTION_HANDLING)
|
||||
SYM(FSCTL_OFFLOAD_READ)
|
||||
SYM(FSCTL_OFFLOAD_WRITE)
|
||||
SYM(FSCTL_CSV_INTERNAL)
|
||||
SYM(FSCTL_SET_PURGE_FAILURE_MODE)
|
||||
SYM(FSCTL_QUERY_FILE_LAYOUT)
|
||||
SYM(FSCTL_IS_VOLUME_OWNED_BYCSVFS)
|
||||
SYM(FSCTL_GET_INTEGRITY_INFORMATION)
|
||||
SYM(FSCTL_SET_INTEGRITY_INFORMATION)
|
||||
SYM(FSCTL_QUERY_FILE_REGIONS)
|
||||
SYM(FSCTL_DEDUP_FILE)
|
||||
SYM(FSCTL_DEDUP_QUERY_FILE_HASHES)
|
||||
SYM(FSCTL_DEDUP_QUERY_RANGE_STATE)
|
||||
SYM(FSCTL_DEDUP_QUERY_REPARSE_INFO)
|
||||
SYM(FSCTL_RKF_INTERNAL)
|
||||
SYM(FSCTL_SCRUB_DATA)
|
||||
SYM(FSCTL_REPAIR_COPIES)
|
||||
SYM(FSCTL_DISABLE_LOCAL_BUFFERING)
|
||||
SYM(FSCTL_CSV_MGMT_LOCK)
|
||||
SYM(FSCTL_CSV_QUERY_DOWN_LEVEL_FILE_SYSTEM_CHARACTERISTICS)
|
||||
SYM(FSCTL_ADVANCE_FILE_ID)
|
||||
SYM(FSCTL_CSV_SYNC_TUNNEL_REQUEST)
|
||||
SYM(FSCTL_CSV_QUERY_VETO_FILE_DIRECT_IO)
|
||||
SYM(FSCTL_WRITE_USN_REASON)
|
||||
SYM(FSCTL_CSV_CONTROL)
|
||||
SYM(FSCTL_GET_REFS_VOLUME_DATA)
|
||||
SYM(FSCTL_CSV_H_BREAKING_SYNC_TUNNEL_REQUEST)
|
||||
SYM(FSCTL_QUERY_STORAGE_CLASSES)
|
||||
SYM(FSCTL_QUERY_REGION_INFO)
|
||||
SYM(FSCTL_USN_TRACK_MODIFIED_RANGES)
|
||||
SYM(FSCTL_QUERY_SHARED_VIRTUAL_DISK_SUPPORT)
|
||||
SYM(FSCTL_SVHDX_SYNC_TUNNEL_REQUEST)
|
||||
SYM(FSCTL_SVHDX_SET_INITIATOR_INFORMATION)
|
||||
SYM(FSCTL_SET_EXTERNAL_BACKING)
|
||||
SYM(FSCTL_GET_EXTERNAL_BACKING)
|
||||
SYM(FSCTL_DELETE_EXTERNAL_BACKING)
|
||||
SYM(FSCTL_ENUM_EXTERNAL_BACKING)
|
||||
SYM(FSCTL_ENUM_OVERLAY)
|
||||
SYM(FSCTL_ADD_OVERLAY)
|
||||
SYM(FSCTL_REMOVE_OVERLAY)
|
||||
SYM(FSCTL_UPDATE_OVERLAY)
|
||||
SYM(FSCTL_DUPLICATE_EXTENTS_TO_FILE)
|
||||
SYM(FSCTL_SPARSE_OVERALLOCATE)
|
||||
SYM(FSCTL_STORAGE_QOS_CONTROL)
|
||||
SYM(FSCTL_INITIATE_FILE_METADATA_OPTIMIZATION)
|
||||
SYM(FSCTL_QUERY_FILE_METADATA_OPTIMIZATION)
|
||||
SYM(FSCTL_SVHDX_ASYNC_TUNNEL_REQUEST)
|
||||
SYM(FSCTL_GET_WOF_VERSION)
|
||||
SYM(FSCTL_HCS_SYNC_TUNNEL_REQUEST)
|
||||
SYM(FSCTL_HCS_ASYNC_TUNNEL_REQUEST)
|
||||
SYM(FSCTL_QUERY_EXTENT_READ_CACHE_INFO)
|
||||
SYM(FSCTL_QUERY_REFS_VOLUME_COUNTER_INFO)
|
||||
SYM(FSCTL_CLEAN_VOLUME_METADATA)
|
||||
SYM(FSCTL_SET_INTEGRITY_INFORMATION_EX)
|
||||
SYM(FSCTL_SUSPEND_OVERLAY)
|
||||
SYM(FSCTL_VIRTUAL_STORAGE_QUERY_PROPERTY)
|
||||
SYM(FSCTL_FILESYSTEM_GET_STATISTICS_EX)
|
||||
//SYM(FSCTL_LOOKUP_STREAM_FROM_CLUSTER)
|
||||
//SYM(FSCTL_TXFS_WRITE_BACKUP_INFORMATION2)
|
||||
//SYM(FSCTL_FILE_TYPE_NOTIFICATION)
|
||||
//SYM(FSCTL_FILE_LEVEL_TRIM)
|
||||
//SYM(FSCTL_GET_BOOT_AREA_INFO)
|
||||
//SYM(FSCTL_GET_RETRIEVAL_POINTER_BASE)
|
||||
//SYM(FSCTL_SET_PERSISTENT_VOLUME_STATE)
|
||||
//SYM(FSCTL_QUERY_PERSISTENT_VOLUME_STATE)
|
||||
//SYM(FSCTL_REQUEST_OPLOCK)
|
||||
//SYM(FSCTL_CSV_TUNNEL_REQUEST)
|
||||
//SYM(FSCTL_IS_CSV_FILE)
|
||||
//SYM(FSCTL_QUERY_FILE_SYSTEM_RECOGNITION)
|
||||
//SYM(FSCTL_CSV_GET_VOLUME_PATH_NAME)
|
||||
//SYM(FSCTL_CSV_GET_VOLUME_NAME_FOR_VOLUME_MOUNT_POINT)
|
||||
//SYM(FSCTL_CSV_GET_VOLUME_PATH_NAMES_FOR_VOLUME_NAME)
|
||||
//SYM(FSCTL_IS_FILE_ON_CSV_VOLUME)
|
||||
//SYM(FSCTL_CORRUPTION_HANDLING)
|
||||
//SYM(FSCTL_OFFLOAD_READ)
|
||||
//SYM(FSCTL_OFFLOAD_WRITE)
|
||||
//SYM(FSCTL_CSV_INTERNAL)
|
||||
//SYM(FSCTL_SET_PURGE_FAILURE_MODE)
|
||||
//SYM(FSCTL_QUERY_FILE_LAYOUT)
|
||||
//SYM(FSCTL_IS_VOLUME_OWNED_BYCSVFS)
|
||||
//SYM(FSCTL_GET_INTEGRITY_INFORMATION)
|
||||
//SYM(FSCTL_SET_INTEGRITY_INFORMATION)
|
||||
//SYM(FSCTL_QUERY_FILE_REGIONS)
|
||||
//SYM(FSCTL_DEDUP_FILE)
|
||||
//SYM(FSCTL_DEDUP_QUERY_FILE_HASHES)
|
||||
//SYM(FSCTL_DEDUP_QUERY_RANGE_STATE)
|
||||
//SYM(FSCTL_DEDUP_QUERY_REPARSE_INFO)
|
||||
//SYM(FSCTL_RKF_INTERNAL)
|
||||
//SYM(FSCTL_SCRUB_DATA)
|
||||
//SYM(FSCTL_REPAIR_COPIES)
|
||||
//SYM(FSCTL_DISABLE_LOCAL_BUFFERING)
|
||||
//SYM(FSCTL_CSV_MGMT_LOCK)
|
||||
//SYM(FSCTL_CSV_QUERY_DOWN_LEVEL_FILE_SYSTEM_CHARACTERISTICS)
|
||||
//SYM(FSCTL_ADVANCE_FILE_ID)
|
||||
//SYM(FSCTL_CSV_SYNC_TUNNEL_REQUEST)
|
||||
//SYM(FSCTL_CSV_QUERY_VETO_FILE_DIRECT_IO)
|
||||
//SYM(FSCTL_WRITE_USN_REASON)
|
||||
//SYM(FSCTL_CSV_CONTROL)
|
||||
//SYM(FSCTL_GET_REFS_VOLUME_DATA)
|
||||
//SYM(FSCTL_CSV_H_BREAKING_SYNC_TUNNEL_REQUEST)
|
||||
//SYM(FSCTL_QUERY_STORAGE_CLASSES)
|
||||
//SYM(FSCTL_QUERY_REGION_INFO)
|
||||
//SYM(FSCTL_USN_TRACK_MODIFIED_RANGES)
|
||||
//SYM(FSCTL_QUERY_SHARED_VIRTUAL_DISK_SUPPORT)
|
||||
//SYM(FSCTL_SVHDX_SYNC_TUNNEL_REQUEST)
|
||||
//SYM(FSCTL_SVHDX_SET_INITIATOR_INFORMATION)
|
||||
//SYM(FSCTL_SET_EXTERNAL_BACKING)
|
||||
//SYM(FSCTL_GET_EXTERNAL_BACKING)
|
||||
//SYM(FSCTL_DELETE_EXTERNAL_BACKING)
|
||||
//SYM(FSCTL_ENUM_EXTERNAL_BACKING)
|
||||
//SYM(FSCTL_ENUM_OVERLAY)
|
||||
//SYM(FSCTL_ADD_OVERLAY)
|
||||
//SYM(FSCTL_REMOVE_OVERLAY)
|
||||
//SYM(FSCTL_UPDATE_OVERLAY)
|
||||
//SYM(FSCTL_DUPLICATE_EXTENTS_TO_FILE)
|
||||
//SYM(FSCTL_SPARSE_OVERALLOCATE)
|
||||
//SYM(FSCTL_STORAGE_QOS_CONTROL)
|
||||
//SYM(FSCTL_INITIATE_FILE_METADATA_OPTIMIZATION)
|
||||
//SYM(FSCTL_QUERY_FILE_METADATA_OPTIMIZATION)
|
||||
//SYM(FSCTL_SVHDX_ASYNC_TUNNEL_REQUEST)
|
||||
//SYM(FSCTL_GET_WOF_VERSION)
|
||||
//SYM(FSCTL_HCS_SYNC_TUNNEL_REQUEST)
|
||||
//SYM(FSCTL_HCS_ASYNC_TUNNEL_REQUEST)
|
||||
//SYM(FSCTL_QUERY_EXTENT_READ_CACHE_INFO)
|
||||
//SYM(FSCTL_QUERY_REFS_VOLUME_COUNTER_INFO)
|
||||
//SYM(FSCTL_CLEAN_VOLUME_METADATA)
|
||||
//SYM(FSCTL_SET_INTEGRITY_INFORMATION_EX)
|
||||
//SYM(FSCTL_SUSPEND_OVERLAY)
|
||||
//SYM(FSCTL_VIRTUAL_STORAGE_QUERY_PROPERTY)
|
||||
//SYM(FSCTL_FILESYSTEM_GET_STATISTICS_EX)
|
||||
SYM(FSCTL_LMR_GET_LINK_TRACKING_INFORMATION)
|
||||
SYM(FSCTL_LMR_SET_LINK_TRACKING_INFORMATION)
|
||||
SYM(IOCTL_LMR_ARE_FILE_OBJECTS_ON_SAME_SERVER)
|
||||
|
@ -48,10 +48,12 @@ NTSTATUS FspIopDispatchComplete(PIRP Irp, const FSP_FSCTL_TRANSACT_RSP *Response
|
||||
#endif
|
||||
|
||||
/* Requests (and RequestHeaders) must be 16-byte aligned, because we use the low 4 bits for flags */
|
||||
#if 16 != MEMORY_ALLOCATION_ALIGNMENT
|
||||
#define REQ_HEADER_ALIGNMASK 15
|
||||
#if REQ_ALIGN_SIZE <= MEMORY_ALLOCATION_ALIGNMENT
|
||||
#define REQ_HEADER_ALIGN_MASK 0
|
||||
#define REQ_HEADER_ALIGN_OVERHEAD 0
|
||||
#else
|
||||
#define REQ_HEADER_ALIGNMASK 0
|
||||
#define REQ_HEADER_ALIGN_MASK (REQ_ALIGN_SIZE - 1)
|
||||
#define REQ_HEADER_ALIGN_OVERHEAD (sizeof(PVOID) + REQ_HEADER_ALIGN_MASK)
|
||||
#endif
|
||||
|
||||
NTSTATUS FspIopCreateRequestFunnel(
|
||||
@ -74,20 +76,23 @@ NTSTATUS FspIopCreateRequestFunnel(
|
||||
if (FlagOn(Flags, FspIopRequestMustSucceed))
|
||||
RequestHeader = FspAllocatePoolMustSucceed(
|
||||
FlagOn(Flags, FspIopRequestNonPaged) ? NonPagedPool : PagedPool,
|
||||
sizeof *RequestHeader + sizeof *Request + ExtraSize + REQ_HEADER_ALIGNMASK,
|
||||
sizeof *RequestHeader + sizeof *Request + ExtraSize + REQ_HEADER_ALIGN_OVERHEAD,
|
||||
FSP_ALLOC_INTERNAL_TAG);
|
||||
else
|
||||
{
|
||||
RequestHeader = ExAllocatePoolWithTag(
|
||||
FlagOn(Flags, FspIopRequestNonPaged) ? NonPagedPool : PagedPool,
|
||||
sizeof *RequestHeader + sizeof *Request + ExtraSize + REQ_HEADER_ALIGNMASK,
|
||||
sizeof *RequestHeader + sizeof *Request + ExtraSize + REQ_HEADER_ALIGN_OVERHEAD,
|
||||
FSP_ALLOC_INTERNAL_TAG);
|
||||
if (0 == RequestHeader)
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
}
|
||||
|
||||
#if 0 != REQ_HEADER_ALIGNMASK
|
||||
RequestHeader = (PVOID)(((UINT_PTR)RequestHeader + REQ_HEADER_ALIGNMASK) & REQ_HEADER_ALIGNMASK);
|
||||
#if 0 != REQ_HEADER_ALIGN_MASK
|
||||
PVOID Allocation = RequestHeader;
|
||||
RequestHeader = (PVOID)(((UINT_PTR)RequestHeader + REQ_HEADER_ALIGN_OVERHEAD) &
|
||||
~REQ_HEADER_ALIGN_MASK);
|
||||
((PVOID *)RequestHeader)[-1] = Allocation;
|
||||
#endif
|
||||
|
||||
RtlZeroMemory(RequestHeader, sizeof *RequestHeader + sizeof *Request + ExtraSize);
|
||||
@ -127,6 +132,10 @@ VOID FspIopDeleteRequest(FSP_FSCTL_TRANSACT_REQ *Request)
|
||||
if (0 != RequestHeader->Response)
|
||||
FspFree(RequestHeader->Response);
|
||||
|
||||
#if 0 != REQ_HEADER_ALIGN_MASK
|
||||
RequestHeader = ((PVOID *)RequestHeader)[-1];
|
||||
#endif
|
||||
|
||||
FspFree(RequestHeader);
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <sddl.h>
|
||||
#include <map>
|
||||
#include <cassert>
|
||||
#include <VersionHelpers.h>
|
||||
|
||||
/*
|
||||
* Define the DEBUG_BUFFER_CHECK macro on Windows 8 or above. This includes
|
||||
@ -539,7 +540,8 @@ static NTSTATUS Write(FSP_FILE_SYSTEM *FileSystem,
|
||||
__try
|
||||
{
|
||||
*P = *P | 0;
|
||||
assert(0);
|
||||
assert(!IsWindows8OrGreater());
|
||||
/* only on Windows 8 we can make the buffer read-only! */
|
||||
}
|
||||
__except (EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
|
Reference in New Issue
Block a user