Compare commits

...

11 Commits

11 changed files with 44 additions and 32 deletions

View File

@ -5,7 +5,9 @@ v1.0RC2::
This is the WinFsp 2017 Release Candidate 2. Some important changes included below: This is the WinFsp 2017 Release Candidate 2. Some important changes included below:
- The `ReadDirectory` `FSP_FILE_SYSTEM_INTERFACE` operation has been changed. Extensive testing with multiple file systems has shown that `ReadDirectory` was hard to implement correctly. The new definition should make implementation easier for most file system. [See GitHub issue #34.] - WinFsp is now available under the GPLv3 with a special exception for Free/Libre and Open Source Software.
- The location of the WinFsp launcher registry entries is now `HKEY_LOCAL_MACHINE\Software\WinFsp\Services`. [On Win64 the actual location is `HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\WinFsp\Services`.] This change was necessary to avoid loss of third party file system registry entries during WinFsp uninstallation. [See GitHub issue #31.]
- Despite stating in the previous release that the API has been finalized the `ReadDirectory` `FSP_FILE_SYSTEM_INTERFACE` operation has been changed. Extensive testing with multiple file systems has shown that `ReadDirectory` was hard to implement correctly. The new definition should make implementation easier for most file systems. [See GitHub issue #34.]
- Some API's to facilitate `ReadDirectory` implementation have been added. Look for `FspFileSystem*DirectoryBuffer` symbols. - Some API's to facilitate `ReadDirectory` implementation have been added. Look for `FspFileSystem*DirectoryBuffer` symbols.
- The installer now (optionally) installs a sample file system called "passthrough". This is a simple file system that passes all operations to an underlying file system. There is also a tutorial for this file system (in the doc directory). - The installer now (optionally) installs a sample file system called "passthrough". This is a simple file system that passes all operations to an underlying file system. There is also a tutorial for this file system (in the doc directory).
- The installer now (optionally) installs a sample file system called "passthrough-fuse". This file system performs the same function as the "passthrough" file system, but uses the FUSE compatibility layer. It builds and runs on both Windows and Cygwin. - The installer now (optionally) installs a sample file system called "passthrough-fuse". This file system performs the same function as the "passthrough" file system, but uses the FUSE compatibility layer. It builds and runs on both Windows and Cygwin.

View File

@ -17,7 +17,7 @@ Some of the benefits of using WinFsp are listed below:
* Easy to understand but comprehensive API. Consult the [API Reference](http://www.secfs.net/winfsp/apiref/). There is also a simple [Tutorial](doc/WinFsp-Tutorial.asciidoc). * Easy to understand but comprehensive API. Consult the [API Reference](http://www.secfs.net/winfsp/apiref/). There is also a simple [Tutorial](doc/WinFsp-Tutorial.asciidoc).
* FUSE compatibility layer for native Windows and Cygwin. See [fuse.h](inc/fuse/fuse.h). * FUSE compatibility layer for native Windows and Cygwin. See [fuse.h](inc/fuse/fuse.h).
* Signed drivers provided on every release. * Signed drivers provided on every release.
* Available under the GPLv3. * Available under the [GPLv3](License.txt) license with a special exception for Free/Libre and Open Source Software.
To learn more about WinFsp, please visit its website: http://www.secfs.net/winfsp/ To learn more about WinFsp, please visit its website: http://www.secfs.net/winfsp/
@ -79,4 +79,4 @@ If you wish to discuss WinFsp there are now two options:
## License ## License
WinFsp is available under the [GPLv3](http://www.gnu.org/licenses/gpl-3.0.html) license. If you find the constraints of the GPLv3 too onerous, a commercial license is also available. Please contact Bill Zissimopoulos <billziss at navimatics.com> for more details. WinFsp is available under the [GPLv3](License.txt) license with a special exception for Free/Libre and Open Source Software. A commercial license is also available. Please contact Bill Zissimopoulos \<billziss at navimatics.com> for more details.

View File

@ -22,7 +22,7 @@
<Media Id="1" Cabinet="WinFsp.cab" EmbedCab="yes" /> <Media Id="1" Cabinet="WinFsp.cab" EmbedCab="yes" />
<Property Id="P.LauncherName">$(var.MyProductName).Launcher</Property> <Property Id="P.LauncherName">$(var.MyProductName).Launcher</Property>
<Property Id="P.LauncherRegistryKey">SYSTEM\\CurrentControlSet\\Services\\$(var.MyProductName).Launcher\\Services</Property> <Property Id="P.LauncherRegistryKey">Software\$(var.MyProductName)\Services</Property>
<Property Id="P.RegistryKey">Software\$(var.MyProductName)</Property> <Property Id="P.RegistryKey">Software\$(var.MyProductName)</Property>
<Property Id="INSTALLDIR"> <Property Id="INSTALLDIR">
<RegistrySearch <RegistrySearch

View File

@ -20,19 +20,21 @@ In order to overcome the issue with launching multiple instances of a particular
Services that wish to be controlled by the WinFsp.Launcher must add themselves under the following registry key: Services that wish to be controlled by the WinFsp.Launcher must add themselves under the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinFsp.Launcher\Services HKEY_LOCAL_MACHINE\Software\WinFsp\Services
For example, the MEMFS sample adds the following registry entries under this key: NOTE: Please note that in a 64-bit system the actual location is `HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\WinFsp\Services`.
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinFsp.Launcher\Services\memfs32] For example, the MEMFS sample adds the following registry entries in a 64-bit system:
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\WinFsp\Services\memfs32]
"Executable"="C:\\Program Files (x86)\\WinFsp\\bin\\memfs-x86.exe" "Executable"="C:\\Program Files (x86)\\WinFsp\\bin\\memfs-x86.exe"
"CommandLine"="-u %1 -m %2" "CommandLine"="-i -F NTFS -n 65536 -s 67108864 -u %1 -m %2"
"Security"="D:P(A;;RPWPLC;;;WD)" "Security"="D:P(A;;RPWPLC;;;WD)"
"JobControl"=dword:00000001 "JobControl"=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinFsp.Launcher\Services\memfs64] [HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\WinFsp\Services\memfs64]
"Executable"="C:\\Program Files (x86)\\WinFsp\\bin\\memfs-x64.exe" "Executable"="C:\\Program Files (x86)\\WinFsp\\bin\\memfs-x64.exe"
"CommandLine"="-u %1 -m %2" "CommandLine"="-i -F NTFS -n 65536 -s 67108864 -u %1 -m %2"
"Security"="D:P(A;;RPWPLC;;;WD)" "Security"="D:P(A;;RPWPLC;;;WD)"
"JobControl"=dword:00000001 "JobControl"=dword:00000001
@ -44,4 +46,4 @@ One final note regarding security. Notice the `Security` registry value in the e
WinFsp includes a Network Provider that integrates with Windows and can be used to start and stop user mode file systems from the Windows shell. To achieve this the Network Provider (implemented as part of the WinFsp DLL) works closely with the WinFsp.Launcher service. WinFsp includes a Network Provider that integrates with Windows and can be used to start and stop user mode file systems from the Windows shell. To achieve this the Network Provider (implemented as part of the WinFsp DLL) works closely with the WinFsp.Launcher service.
For example, if a user uses the Windows Explorer to map `\\memfs64\share` to the `Z:` drive, the Network Provider will instruct the WinFsp.Launcher to start an instance of the memfs64 service with command line `-u \\memfs64\share -m Z:`. When the user disconnects the `Z:` drive, the Network Provider will instruct the WinFsp.Launcher to stop the previously started instance of the memfs64 service. For example, if a user uses the Windows Explorer to map `\\memfs64\share` to the `Z:` drive, the Network Provider will instruct the WinFsp.Launcher to start an instance of the memfs64 service with command line `-i -F NTFS -n 65536 -s 67108864 -u \\memfs64\share -m Z:`. When the user disconnects the `Z:` drive, the Network Provider will instruct the WinFsp.Launcher to stop the previously started instance of the memfs64 service.

View File

@ -622,9 +622,14 @@ static NTSTATUS ReadDirectory(FSP_FILE_SYSTEM *FileSystem,
Length = GetFinalPathNameByHandleW(Handle, FullPath, FULLPATH_SIZE - 1, 0); Length = GetFinalPathNameByHandleW(Handle, FullPath, FULLPATH_SIZE - 1, 0);
if (0 == Length) if (0 == Length)
return FspNtStatusFromWin32(GetLastError()); DirBufferResult = FspNtStatusFromWin32(GetLastError());
if (Length + 1 + PatternLength >= FULLPATH_SIZE) else if (Length + 1 + PatternLength >= FULLPATH_SIZE)
return STATUS_OBJECT_NAME_INVALID; DirBufferResult = STATUS_OBJECT_NAME_INVALID;
if (!NT_SUCCESS(DirBufferResult))
{
FspFileSystemReleaseDirectoryBuffer(&FileContext->DirBuffer);
return DirBufferResult;
}
if (L'\\' != FullPath[Length - 1]) if (L'\\' != FullPath[Length - 1])
FullPath[Length++] = L'\\'; FullPath[Length++] = L'\\';

View File

@ -284,7 +284,8 @@ static DWORD FspNpGetCredentialsKind(PWSTR RemoteName, PDWORD PCredentialsKind)
memcpy(ClassNameBuf, ClassName, ClassNameLen * sizeof(WCHAR)); memcpy(ClassNameBuf, ClassName, ClassNameLen * sizeof(WCHAR));
ClassNameBuf[ClassNameLen] = '\0'; ClassNameBuf[ClassNameLen] = '\0';
NpResult = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"" LAUNCHER_REGKEY, 0, KEY_READ, &RegKey); NpResult = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"" LAUNCHER_REGKEY,
0, LAUNCHER_REGKEY_WOW64 | KEY_READ, &RegKey);
if (ERROR_SUCCESS != NpResult) if (ERROR_SUCCESS != NpResult)
goto exit; goto exit;

View File

@ -19,7 +19,6 @@
#include <sddl.h> #include <sddl.h>
#define PROGNAME "WinFsp.Launcher" #define PROGNAME "WinFsp.Launcher"
#define REGKEY LAUNCHER_REGKEY
BOOL CreateOverlappedPipe( BOOL CreateOverlappedPipe(
PHANDLE PReadPipe, PHANDLE PWritePipe, PSECURITY_ATTRIBUTES SecurityAttributes, DWORD Size, PHANDLE PReadPipe, PHANDLE PWritePipe, PSECURITY_ATTRIBUTES SecurityAttributes, DWORD Size,
@ -441,7 +440,8 @@ NTSTATUS SvcInstanceCreate(HANDLE ClientToken,
goto exit; goto exit;
} }
RegResult = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"" REGKEY, 0, KEY_READ, &RegKey); RegResult = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"" LAUNCHER_REGKEY,
0, LAUNCHER_REGKEY_WOW64 | KEY_READ, &RegKey);
if (ERROR_SUCCESS != RegResult) if (ERROR_SUCCESS != RegResult)
{ {
Result = FspNtStatusFromWin32(RegResult); Result = FspNtStatusFromWin32(RegResult);

View File

@ -21,7 +21,8 @@
#include <winfsp/winfsp.h> #include <winfsp/winfsp.h>
#include <shared/minimal.h> #include <shared/minimal.h>
#define LAUNCHER_REGKEY "SYSTEM\\CurrentControlSet\\Services\\WinFsp.Launcher\\Services" #define LAUNCHER_REGKEY "Software\\WinFsp\\Services"
#define LAUNCHER_REGKEY_WOW64 KEY_WOW64_32KEY
#define LAUNCHER_STOP_TIMEOUT 5500 #define LAUNCHER_STOP_TIMEOUT 5500
#define LAUNCHER_KILL_TIMEOUT 5000 #define LAUNCHER_KILL_TIMEOUT 5000

View File

@ -2,8 +2,8 @@
setlocal setlocal
echo WINFSP INSTALLATION DIRECTORY echo WINFSP INSTALLATION DIRECTORY AND LAUNCHER REGISTRATIONS
reg query HKLM\SOFTWARE\WinFsp /reg:32 reg query HKLM\SOFTWARE\WinFsp /s /reg:32
echo. echo.
echo WINFSP DLL REGISTRATIONS echo WINFSP DLL REGISTRATIONS
@ -12,10 +12,6 @@ reg query HKLM\SYSTEM\CurrentControlSet\Services\WinFsp.Np\NetworkProvider
reg query HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application\WinFsp reg query HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application\WinFsp
echo. echo.
echo WINFSP LAUNCHER REGISTRATIONS
reg query HKLM\SYSTEM\CurrentControlSet\Services\WinFsp.Launcher\Services /s
echo.
echo WINFSP FSD CONFIGURATION AND STATUS echo WINFSP FSD CONFIGURATION AND STATUS
sc query WinFsp sc query WinFsp
sc qc WinFsp sc qc WinFsp

View File

@ -3,7 +3,7 @@
setlocal setlocal
setlocal EnableDelayedExpansion setlocal EnableDelayedExpansion
set RegKey=HKLM\SYSTEM\CurrentControlSet\Services\WinFsp.Launcher\Services set RegKey=HKLM\Software\WinFsp\Services
if not X%1==X-u ( if not X%1==X-u (
set unreg=0 set unreg=0
@ -16,9 +16,9 @@ if not X%1==X-u (
if X!fscmdl!==X goto usage if X!fscmdl!==X goto usage
if not exist !fsexec! goto notfound if not exist !fsexec! goto notfound
reg add !RegKey!\!fsname! /v Executable /t REG_SZ /d !fsexec! /f reg add !RegKey!\!fsname! /v Executable /t REG_SZ /d !fsexec! /f /reg:32
reg add !RegKey!\!fsname! /v CommandLine /t REG_SZ /d !fscmdl! /f reg add !RegKey!\!fsname! /v CommandLine /t REG_SZ /d !fscmdl! /f /reg:32
if not X!fssecu!==X reg add !RegKey!\!fsname! /v Security /t REG_SZ /d !fssecu! /f if not X!fssecu!==X reg add !RegKey!\!fsname! /v Security /t REG_SZ /d !fssecu! /f /reg:32
) else ( ) else (
set unreg=1 set unreg=1
@ -26,7 +26,7 @@ if not X%1==X-u (
if X!fsname!==X goto usage if X!fsname!==X goto usage
reg delete !RegKey!\!fsname! /f reg delete !RegKey!\!fsname! /f /reg:32
) )
exit /b 0 exit /b 0

View File

@ -538,9 +538,14 @@ static NTSTATUS ReadDirectory(FSP_FILE_SYSTEM *FileSystem,
Length = GetFinalPathNameByHandleW(Handle, FullPath, FULLPATH_SIZE - 1, 0); Length = GetFinalPathNameByHandleW(Handle, FullPath, FULLPATH_SIZE - 1, 0);
if (0 == Length) if (0 == Length)
return FspNtStatusFromWin32(GetLastError()); DirBufferResult = FspNtStatusFromWin32(GetLastError());
if (Length + 1 + PatternLength >= FULLPATH_SIZE) else if (Length + 1 + PatternLength >= FULLPATH_SIZE)
return STATUS_OBJECT_NAME_INVALID; DirBufferResult = STATUS_OBJECT_NAME_INVALID;
if (!NT_SUCCESS(DirBufferResult))
{
FspFileSystemReleaseDirectoryBuffer(&FileContext->DirBuffer);
return DirBufferResult;
}
if (L'\\' != FullPath[Length - 1]) if (L'\\' != FullPath[Length - 1])
FullPath[Length++] = L'\\'; FullPath[Length++] = L'\\';