- From 1cee61c019130af0d13cd2782ae90c5026cdf328 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Fri, 17 Oct 2025 16:17:26 +0200
- Subject: [PATCH 1/4] build.vc19,cygwin,nfsclientdctl: Add VC2019 config+stub
- for nfsclientdctl utility
- Add VC2019 config+stub for nfsclientdctl utility.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- build.vc19/nfs41-client.sln | 72 ++++--
- .../nfsclientdctl/nfsclientdctl.vcxproj | 243 ++++++++++++++++++
- .../nfsclientdctl.vcxproj.filters | 22 ++
- .../nfsclientdctl/nfsclientdctl.vcxproj.user | 4 +
- cygwin/Makefile | 3 +
- cygwin/Makefile.install | 3 +
- nfsclientdctl/nfsclientdctl.c | 51 ++++
- 7 files changed, 370 insertions(+), 28 deletions(-)
- create mode 100755 build.vc19/nfsclientdctl/nfsclientdctl.vcxproj
- create mode 100755 build.vc19/nfsclientdctl/nfsclientdctl.vcxproj.filters
- create mode 100755 build.vc19/nfsclientdctl/nfsclientdctl.vcxproj.user
- create mode 100644 nfsclientdctl/nfsclientdctl.c
- diff --git a/build.vc19/nfs41-client.sln b/build.vc19/nfs41-client.sln
- index df40a34..3f8fa72 100644
- --- a/build.vc19/nfs41-client.sln
- +++ b/build.vc19/nfs41-client.sln
- @@ -1,7 +1,7 @@
- Microsoft Visual Studio Solution File, Format Version 12.00
- -# Visual Studio 14
- -VisualStudioVersion = 14.0.23107.0
- +# Visual Studio Version 16
- +VisualStudioVersion = 16.0.36602.28
- MinimumVisualStudioVersion = 10.0.40219.1
- Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nfs_install", "nfs_install\nfs_install.vcxproj", "{D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}"
- EndProject
- @@ -18,93 +18,109 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nfsd", "nfsd\nfsd.vcxproj",
- EndProject
- Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtirpc", "libtirpc\libtirpc.vcxproj", "{3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}"
- EndProject
- +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nfsclientdctl", "nfsclientdctl\nfsclientdctl.vcxproj", "{3E612F91-75FB-419B-8663-8DC530D17C33}"
- +EndProject
- Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- + Debug|ARM64 = Debug|ARM64
- Debug|x64 = Debug|x64
- Debug|x86 = Debug|x86
- - Debug|ARM64 = Debug|ARM64
- Release|ARM64 = Release|ARM64
- Release|x64 = Release|x64
- Release|x86 = Release|x86
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- + {D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}.Debug|ARM64.ActiveCfg = Debug|ARM64
- + {D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}.Debug|ARM64.Build.0 = Debug|ARM64
- {D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}.Debug|x64.ActiveCfg = Debug|x64
- {D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}.Debug|x64.Build.0 = Debug|x64
- {D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}.Debug|x86.ActiveCfg = Debug|Win32
- {D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}.Debug|x86.Build.0 = Debug|Win32
- - {D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}.Debug|ARM64.ActiveCfg = Debug|ARM64
- - {D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}.Debug|ARM64.Build.0 = Debug|ARM64
- + {D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}.Release|ARM64.ActiveCfg = Release|ARM64
- + {D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}.Release|ARM64.Build.0 = Release|ARM64
- {D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}.Release|x64.ActiveCfg = Release|x64
- {D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}.Release|x64.Build.0 = Release|x64
- {D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}.Release|x86.ActiveCfg = Release|Win32
- {D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}.Release|x86.Build.0 = Release|Win32
- - {D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}.Release|ARM64.ActiveCfg = Release|ARM64
- - {D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}.Release|ARM64.Build.0 = Release|ARM64
- + {896D812D-B4AC-4661-A9ED-7DE94BB68365}.Debug|ARM64.ActiveCfg = Debug|ARM64
- + {896D812D-B4AC-4661-A9ED-7DE94BB68365}.Debug|ARM64.Build.0 = Debug|ARM64
- {896D812D-B4AC-4661-A9ED-7DE94BB68365}.Debug|x64.ActiveCfg = Debug|x64
- {896D812D-B4AC-4661-A9ED-7DE94BB68365}.Debug|x64.Build.0 = Debug|x64
- {896D812D-B4AC-4661-A9ED-7DE94BB68365}.Debug|x86.ActiveCfg = Debug|Win32
- {896D812D-B4AC-4661-A9ED-7DE94BB68365}.Debug|x86.Build.0 = Debug|Win32
- + {896D812D-B4AC-4661-A9ED-7DE94BB68365}.Release|ARM64.ActiveCfg = Release|ARM64
- + {896D812D-B4AC-4661-A9ED-7DE94BB68365}.Release|ARM64.Build.0 = Release|ARM64
- {896D812D-B4AC-4661-A9ED-7DE94BB68365}.Release|x64.ActiveCfg = Release|x64
- {896D812D-B4AC-4661-A9ED-7DE94BB68365}.Release|x64.Build.0 = Release|x64
- {896D812D-B4AC-4661-A9ED-7DE94BB68365}.Release|x86.ActiveCfg = Release|Win32
- {896D812D-B4AC-4661-A9ED-7DE94BB68365}.Release|x86.Build.0 = Release|Win32
- - {896D812D-B4AC-4661-A9ED-7DE94BB68365}.Debug|ARM64.ActiveCfg = Debug|ARM64
- - {896D812D-B4AC-4661-A9ED-7DE94BB68365}.Debug|ARM64.Build.0 = Debug|ARM64
- - {896D812D-B4AC-4661-A9ED-7DE94BB68365}.Release|ARM64.ActiveCfg = Release|ARM64
- - {896D812D-B4AC-4661-A9ED-7DE94BB68365}.Release|ARM64.Build.0 = Release|ARM64
- + {833F4171-5B96-4BB0-8D9D-BB926ECA8976}.Debug|ARM64.ActiveCfg = Debug|ARM64
- + {833F4171-5B96-4BB0-8D9D-BB926ECA8976}.Debug|ARM64.Build.0 = Debug|ARM64
- {833F4171-5B96-4BB0-8D9D-BB926ECA8976}.Debug|x64.ActiveCfg = Debug|x64
- {833F4171-5B96-4BB0-8D9D-BB926ECA8976}.Debug|x64.Build.0 = Debug|x64
- {833F4171-5B96-4BB0-8D9D-BB926ECA8976}.Debug|x86.ActiveCfg = Debug|Win32
- {833F4171-5B96-4BB0-8D9D-BB926ECA8976}.Debug|x86.Build.0 = Debug|Win32
- + {833F4171-5B96-4BB0-8D9D-BB926ECA8976}.Release|ARM64.ActiveCfg = Release|ARM64
- + {833F4171-5B96-4BB0-8D9D-BB926ECA8976}.Release|ARM64.Build.0 = Release|ARM64
- {833F4171-5B96-4BB0-8D9D-BB926ECA8976}.Release|x64.ActiveCfg = Release|x64
- {833F4171-5B96-4BB0-8D9D-BB926ECA8976}.Release|x64.Build.0 = Release|x64
- {833F4171-5B96-4BB0-8D9D-BB926ECA8976}.Release|x86.ActiveCfg = Release|Win32
- {833F4171-5B96-4BB0-8D9D-BB926ECA8976}.Release|x86.Build.0 = Release|Win32
- - {833F4171-5B96-4BB0-8D9D-BB926ECA8976}.Debug|ARM64.ActiveCfg = Debug|ARM64
- - {833F4171-5B96-4BB0-8D9D-BB926ECA8976}.Debug|ARM64.Build.0 = Debug|ARM64
- - {833F4171-5B96-4BB0-8D9D-BB926ECA8976}.Release|ARM64.ActiveCfg = Release|ARM64
- - {833F4171-5B96-4BB0-8D9D-BB926ECA8976}.Release|ARM64.Build.0 = Release|ARM64
- + {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Debug|ARM64.ActiveCfg = Debug|ARM64
- + {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Debug|ARM64.Build.0 = Debug|ARM64
- {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Debug|x64.ActiveCfg = Debug|x64
- {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Debug|x64.Build.0 = Debug|x64
- {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Debug|x86.ActiveCfg = Debug|Win32
- {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Debug|x86.Build.0 = Debug|Win32
- {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Debug|x86.Deploy.0 = Debug|Win32
- + {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Release|ARM64.ActiveCfg = Release|ARM64
- + {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Release|ARM64.Build.0 = Release|ARM64
- {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Release|x64.ActiveCfg = Release|x64
- {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Release|x64.Build.0 = Release|x64
- {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Release|x86.ActiveCfg = Release|Win32
- {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Release|x86.Build.0 = Release|Win32
- {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Release|x86.Deploy.0 = Release|Win32
- - {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Debug|ARM64.ActiveCfg = Debug|ARM64
- - {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Debug|ARM64.Build.0 = Debug|ARM64
- - {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Release|ARM64.ActiveCfg = Release|ARM64
- - {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Release|ARM64.Build.0 = Release|ARM64
- + {FAE57101-F0EE-46CB-986D-E19A796693F7}.Debug|ARM64.ActiveCfg = Debug|ARM64
- + {FAE57101-F0EE-46CB-986D-E19A796693F7}.Debug|ARM64.Build.0 = Debug|ARM64
- {FAE57101-F0EE-46CB-986D-E19A796693F7}.Debug|x64.ActiveCfg = Debug|x64
- {FAE57101-F0EE-46CB-986D-E19A796693F7}.Debug|x64.Build.0 = Debug|x64
- {FAE57101-F0EE-46CB-986D-E19A796693F7}.Debug|x86.ActiveCfg = Debug|Win32
- {FAE57101-F0EE-46CB-986D-E19A796693F7}.Debug|x86.Build.0 = Debug|Win32
- + {FAE57101-F0EE-46CB-986D-E19A796693F7}.Release|ARM64.ActiveCfg = Release|ARM64
- + {FAE57101-F0EE-46CB-986D-E19A796693F7}.Release|ARM64.Build.0 = Release|ARM64
- {FAE57101-F0EE-46CB-986D-E19A796693F7}.Release|x64.ActiveCfg = Release|x64
- {FAE57101-F0EE-46CB-986D-E19A796693F7}.Release|x64.Build.0 = Release|x64
- {FAE57101-F0EE-46CB-986D-E19A796693F7}.Release|x86.ActiveCfg = Release|Win32
- {FAE57101-F0EE-46CB-986D-E19A796693F7}.Release|x86.Build.0 = Release|Win32
- - {FAE57101-F0EE-46CB-986D-E19A796693F7}.Debug|ARM64.ActiveCfg = Debug|ARM64
- - {FAE57101-F0EE-46CB-986D-E19A796693F7}.Debug|ARM64.Build.0 = Debug|ARM64
- - {FAE57101-F0EE-46CB-986D-E19A796693F7}.Release|ARM64.ActiveCfg = Release|ARM64
- - {FAE57101-F0EE-46CB-986D-E19A796693F7}.Release|ARM64.Build.0 = Release|ARM64
- + {3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}.Debug|ARM64.ActiveCfg = Debug|ARM64
- + {3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}.Debug|ARM64.Build.0 = Debug|ARM64
- {3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}.Debug|x64.ActiveCfg = Debug|x64
- {3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}.Debug|x64.Build.0 = Debug|x64
- {3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}.Debug|x86.ActiveCfg = Debug|Win32
- {3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}.Debug|x86.Build.0 = Debug|Win32
- + {3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}.Release|ARM64.ActiveCfg = Release|ARM64
- + {3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}.Release|ARM64.Build.0 = Release|ARM64
- {3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}.Release|x64.ActiveCfg = Release|x64
- {3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}.Release|x64.Build.0 = Release|x64
- {3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}.Release|x86.ActiveCfg = Release|Win32
- {3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}.Release|x86.Build.0 = Release|Win32
- - {3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}.Debug|ARM64.ActiveCfg = Debug|ARM64
- - {3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}.Debug|ARM64.Build.0 = Debug|ARM64
- - {3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}.Release|ARM64.ActiveCfg = Release|ARM64
- - {3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}.Release|ARM64.Build.0 = Release|ARM64
- -
- + {3E612F91-75FB-419B-8663-8DC530D17C33}.Debug|ARM64.ActiveCfg = Debug|ARM64
- + {3E612F91-75FB-419B-8663-8DC530D17C33}.Debug|ARM64.Build.0 = Debug|ARM64
- + {3E612F91-75FB-419B-8663-8DC530D17C33}.Debug|x64.ActiveCfg = Debug|x64
- + {3E612F91-75FB-419B-8663-8DC530D17C33}.Debug|x64.Build.0 = Debug|x64
- + {3E612F91-75FB-419B-8663-8DC530D17C33}.Debug|x86.ActiveCfg = Debug|Win32
- + {3E612F91-75FB-419B-8663-8DC530D17C33}.Debug|x86.Build.0 = Debug|Win32
- + {3E612F91-75FB-419B-8663-8DC530D17C33}.Release|ARM64.ActiveCfg = Release|ARM64
- + {3E612F91-75FB-419B-8663-8DC530D17C33}.Release|ARM64.Build.0 = Release|ARM64
- + {3E612F91-75FB-419B-8663-8DC530D17C33}.Release|x64.ActiveCfg = Release|x64
- + {3E612F91-75FB-419B-8663-8DC530D17C33}.Release|x64.Build.0 = Release|x64
- + {3E612F91-75FB-419B-8663-8DC530D17C33}.Release|x86.ActiveCfg = Release|Win32
- + {3E612F91-75FB-419B-8663-8DC530D17C33}.Release|x86.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- + GlobalSection(ExtensibilityGlobals) = postSolution
- + SolutionGuid = {9AEA2540-709B-468E-9FFB-6E1838DBCE45}
- + EndGlobalSection
- EndGlobal
- diff --git a/build.vc19/nfsclientdctl/nfsclientdctl.vcxproj b/build.vc19/nfsclientdctl/nfsclientdctl.vcxproj
- new file mode 100755
- index 0000000..afe031e
- --- /dev/null
- +++ b/build.vc19/nfsclientdctl/nfsclientdctl.vcxproj
- @@ -0,0 +1,243 @@
- +<?xml version="1.0" encoding="utf-8"?>
- +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- + <Target Name="Sign" AfterTargets="Build">
- + <SignFile CertificateThumbprint="$(CERTIFICATE_THUMBPRINT)" SigningTarget="$(OutputPath)\nfsclientdctl.exe" TargetFrameworkVersion="v4.5" />
- + </Target>
- + <ItemGroup Label="ProjectConfigurations">
- + <ProjectConfiguration Include="Debug|Win32">
- + <Configuration>Debug</Configuration>
- + <Platform>Win32</Platform>
- + </ProjectConfiguration>
- + <ProjectConfiguration Include="Release|Win32">
- + <Configuration>Release</Configuration>
- + <Platform>Win32</Platform>
- + </ProjectConfiguration>
- + <ProjectConfiguration Include="Debug|x64">
- + <Configuration>Debug</Configuration>
- + <Platform>x64</Platform>
- + </ProjectConfiguration>
- + <ProjectConfiguration Include="Release|x64">
- + <Configuration>Release</Configuration>
- + <Platform>x64</Platform>
- + </ProjectConfiguration>
- + <ProjectConfiguration Include="Debug|ARM64">
- + <Configuration>Debug</Configuration>
- + <Platform>ARM64</Platform>
- + </ProjectConfiguration>
- + <ProjectConfiguration Include="Release|ARM64">
- + <Configuration>Release</Configuration>
- + <Platform>ARM64</Platform>
- + </ProjectConfiguration>
- + </ItemGroup>
- + <PropertyGroup Label="Globals">
- + <ProjectGuid>{3e612f91-75fb-419b-8663-8dc530d17c33}</ProjectGuid>
- + <Keyword>Win32Proj</Keyword>
- + <RootNamespace>nfsclientdctl</RootNamespace>
- + <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
- + </PropertyGroup>
- + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- + <ConfigurationType>Application</ConfigurationType>
- + <UseDebugLibraries>true</UseDebugLibraries>
- + <PlatformToolset>v142</PlatformToolset>
- + <CharacterSet>Unicode</CharacterSet>
- + </PropertyGroup>
- + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- + <ConfigurationType>Application</ConfigurationType>
- + <UseDebugLibraries>false</UseDebugLibraries>
- + <PlatformToolset>v142</PlatformToolset>
- + <WholeProgramOptimization>true</WholeProgramOptimization>
- + <CharacterSet>Unicode</CharacterSet>
- + </PropertyGroup>
- + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
- + <ConfigurationType>Application</ConfigurationType>
- + <UseDebugLibraries>true</UseDebugLibraries>
- + <PlatformToolset>v142</PlatformToolset>
- + <CharacterSet>Unicode</CharacterSet>
- + </PropertyGroup>
- + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
- + <ConfigurationType>Application</ConfigurationType>
- + <UseDebugLibraries>false</UseDebugLibraries>
- + <PlatformToolset>v142</PlatformToolset>
- + <WholeProgramOptimization>true</WholeProgramOptimization>
- + <CharacterSet>Unicode</CharacterSet>
- + </PropertyGroup>
- + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
- + <ConfigurationType>Application</ConfigurationType>
- + <UseDebugLibraries>true</UseDebugLibraries>
- + <PlatformToolset>v142</PlatformToolset>
- + <CharacterSet>Unicode</CharacterSet>
- + </PropertyGroup>
- + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
- + <ConfigurationType>Application</ConfigurationType>
- + <UseDebugLibraries>false</UseDebugLibraries>
- + <PlatformToolset>v142</PlatformToolset>
- + <WholeProgramOptimization>true</WholeProgramOptimization>
- + <CharacterSet>Unicode</CharacterSet>
- + </PropertyGroup>
- + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- + <ImportGroup Label="ExtensionSettings">
- + </ImportGroup>
- + <ImportGroup Label="Shared">
- + </ImportGroup>
- + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- + </ImportGroup>
- + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- + </ImportGroup>
- + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- + </ImportGroup>
- + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- + </ImportGroup>
- + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
- + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- + </ImportGroup>
- + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
- + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- + </ImportGroup>
- + <PropertyGroup Label="UserMacros" />
- + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- + <LinkIncremental>true</LinkIncremental>
- + </PropertyGroup>
- + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- + <LinkIncremental>true</LinkIncremental>
- + </PropertyGroup>
- + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
- + <LinkIncremental>true</LinkIncremental>
- + </PropertyGroup>
- + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- + <LinkIncremental>false</LinkIncremental>
- + </PropertyGroup>
- + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- + <LinkIncremental>false</LinkIncremental>
- + </PropertyGroup>
- + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
- + <LinkIncremental>false</LinkIncremental>
- + </PropertyGroup>
- + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- + <ClCompile>
- + <PrecompiledHeader>
- + </PrecompiledHeader>
- + <WarningLevel>Level4</WarningLevel>
- + <Optimization>Disabled</Optimization>
- + <PreprocessorDefinitions>WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;_MEMCPY_INLINE_=1;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- + <LanguageStandard_C>stdc17</LanguageStandard_C>
- + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- + <AdditionalOptions>/wd5105</AdditionalOptions>
- + <SupportJustMyCode>false</SupportJustMyCode>
- + </ClCompile>
- + <Link>
- + <SubSystem>Console</SubSystem>
- + <GenerateDebugInformation>true</GenerateDebugInformation>
- + </Link>
- + </ItemDefinitionGroup>
- + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- + <ClCompile>
- + <PrecompiledHeader>
- + </PrecompiledHeader>
- + <WarningLevel>Level4</WarningLevel>
- + <Optimization>Disabled</Optimization>
- + <PreprocessorDefinitions>WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;_MEMCPY_INLINE_=1;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- + <LanguageStandard_C>stdc17</LanguageStandard_C>
- + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- + <AdditionalOptions>/wd5105</AdditionalOptions>
- + <SupportJustMyCode>false</SupportJustMyCode>
- + </ClCompile>
- + <Link>
- + <SubSystem>Console</SubSystem>
- + <GenerateDebugInformation>true</GenerateDebugInformation>
- + </Link>
- + </ItemDefinitionGroup>
- + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
- + <ClCompile>
- + <PrecompiledHeader>
- + </PrecompiledHeader>
- + <WarningLevel>Level4</WarningLevel>
- + <Optimization>Disabled</Optimization>
- + <PreprocessorDefinitions>WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;_MEMCPY_INLINE_=1;PopulationCount64=1;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- + <LanguageStandard_C>stdc17</LanguageStandard_C>
- + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- + <AdditionalOptions>/wd5105</AdditionalOptions>
- + <SupportJustMyCode>false</SupportJustMyCode>
- + </ClCompile>
- + <Link>
- + <SubSystem>Console</SubSystem>
- + <GenerateDebugInformation>true</GenerateDebugInformation>
- + </Link>
- + </ItemDefinitionGroup>
- + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- + <ClCompile>
- + <WarningLevel>Level4</WarningLevel>
- + <PrecompiledHeader>
- + </PrecompiledHeader>
- + <Optimization>MaxSpeed</Optimization>
- + <FunctionLevelLinking>true</FunctionLevelLinking>
- + <IntrinsicFunctions>true</IntrinsicFunctions>
- + <PreprocessorDefinitions>WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;_MEMCPY_INLINE_=1;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- + <LanguageStandard_C>stdc17</LanguageStandard_C>
- + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- + <AdditionalOptions>/wd5105</AdditionalOptions>
- + </ClCompile>
- + <Link>
- + <SubSystem>Console</SubSystem>
- + <GenerateDebugInformation>true</GenerateDebugInformation>
- + <EnableCOMDATFolding>true</EnableCOMDATFolding>
- + <OptimizeReferences>true</OptimizeReferences>
- + </Link>
- + </ItemDefinitionGroup>
- + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- + <ClCompile>
- + <WarningLevel>Level4</WarningLevel>
- + <PrecompiledHeader>
- + </PrecompiledHeader>
- + <Optimization>MaxSpeed</Optimization>
- + <FunctionLevelLinking>true</FunctionLevelLinking>
- + <IntrinsicFunctions>true</IntrinsicFunctions>
- + <PreprocessorDefinitions>WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;_MEMCPY_INLINE_=1;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- + <LanguageStandard_C>stdc17</LanguageStandard_C>
- + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- + <AdditionalOptions>/wd5105</AdditionalOptions>
- + </ClCompile>
- + <Link>
- + <SubSystem>Console</SubSystem>
- + <GenerateDebugInformation>true</GenerateDebugInformation>
- + <EnableCOMDATFolding>true</EnableCOMDATFolding>
- + <OptimizeReferences>true</OptimizeReferences>
- + </Link>
- + </ItemDefinitionGroup>
- + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
- + <ClCompile>
- + <WarningLevel>Level4</WarningLevel>
- + <PrecompiledHeader>
- + </PrecompiledHeader>
- + <Optimization>MaxSpeed</Optimization>
- + <FunctionLevelLinking>true</FunctionLevelLinking>
- + <IntrinsicFunctions>true</IntrinsicFunctions>
- + <PreprocessorDefinitions>WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;_MEMCPY_INLINE_=1;PopulationCount64=1;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- + <LanguageStandard_C>stdc17</LanguageStandard_C>
- + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- + <AdditionalOptions>/wd5105</AdditionalOptions>
- + </ClCompile>
- + <Link>
- + <SubSystem>Console</SubSystem>
- + <GenerateDebugInformation>true</GenerateDebugInformation>
- + <EnableCOMDATFolding>true</EnableCOMDATFolding>
- + <OptimizeReferences>true</OptimizeReferences>
- + </Link>
- + </ItemDefinitionGroup>
- + <ItemGroup>
- + <ClCompile Include="..\..\nfsclientdctl\nfsclientdctl.c" />
- + </ItemGroup>
- + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- + <ImportGroup Label="ExtensionTargets">
- + </ImportGroup>
- +</Project>
- \ No newline at end of file
- diff --git a/build.vc19/nfsclientdctl/nfsclientdctl.vcxproj.filters b/build.vc19/nfsclientdctl/nfsclientdctl.vcxproj.filters
- new file mode 100755
- index 0000000..5af7a2e
- --- /dev/null
- +++ b/build.vc19/nfsclientdctl/nfsclientdctl.vcxproj.filters
- @@ -0,0 +1,22 @@
- +<?xml version="1.0" encoding="utf-8"?>
- +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- + <ItemGroup>
- + <Filter Include="Source Files">
- + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
- + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
- + </Filter>
- + <Filter Include="Header Files">
- + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
- + <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
- + </Filter>
- + <Filter Include="Resource Files">
- + <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
- + <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
- + </Filter>
- + </ItemGroup>
- + <ItemGroup>
- + <ClCompile Include="..\..\nfsclientdctl\nfsclientdctl.c">
- + <Filter>Source Files</Filter>
- + </ClCompile>
- + </ItemGroup>
- +</Project>
- \ No newline at end of file
- diff --git a/build.vc19/nfsclientdctl/nfsclientdctl.vcxproj.user b/build.vc19/nfsclientdctl/nfsclientdctl.vcxproj.user
- new file mode 100755
- index 0000000..88a5509
- --- /dev/null
- +++ b/build.vc19/nfsclientdctl/nfsclientdctl.vcxproj.user
- @@ -0,0 +1,4 @@
- +<?xml version="1.0" encoding="utf-8"?>
- +<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- + <PropertyGroup />
- +</Project>
- \ No newline at end of file
- diff --git a/cygwin/Makefile b/cygwin/Makefile
- index 06d808a..e400eef 100644
- --- a/cygwin/Makefile
- +++ b/cygwin/Makefile
- @@ -146,6 +146,7 @@ installdest32: \
- $(VS_BUILD_DIR_I686)/nfsd.exe \
- $(VS_BUILD_DIR_I686)/nfs_mount.exe \
- $(VS_BUILD_DIR_I686)/nfs_install.exe \
- + $(VS_BUILD_DIR_I686)/nfsclientdctl.exe \
- $(VS_BUILD_DIR_I686)/nfs41_driver.sys \
- $(VS_BUILD_DIR_I686)/libtirpc.dll \
- $(VS_BUILD_DIR_I686)/nfs41_np.dll \
- @@ -162,12 +163,14 @@ installdest64: \
- $(VS_BUILD_DIR_X64)/nfsd.exe \
- $(VS_BUILD_DIR_X64)/nfs_mount.exe \
- $(VS_BUILD_DIR_X64)/nfs_install.exe \
- + $(VS_BUILD_DIR_X64)/nfsclientdctl.exe \
- $(VS_BUILD_DIR_X64)/nfs41_driver.sys \
- $(VS_BUILD_DIR_X64)/libtirpc.dll \
- $(VS_BUILD_DIR_X64)/nfs41_np.dll \
- $(VS_BUILD_DIR_ARM64)/nfsd.exe \
- $(VS_BUILD_DIR_ARM64)/nfs_mount.exe \
- $(VS_BUILD_DIR_ARM64)/nfs_install.exe \
- + $(VS_BUILD_DIR_ARM64)/nfsclientdctl.exe \
- $(VS_BUILD_DIR_ARM64)/nfs41_driver.sys \
- $(VS_BUILD_DIR_ARM64)/libtirpc.dll \
- $(VS_BUILD_DIR_ARM64)/nfs41_np.dll \
- diff --git a/cygwin/Makefile.install b/cygwin/Makefile.install
- index f02fb50..1619e03 100644
- --- a/cygwin/Makefile.install
- +++ b/cygwin/Makefile.install
- @@ -49,6 +49,7 @@ installdest:
- cp $(VS_BUILD_DIR_I686)/nfsd.* $(DESTDIR)/lib/msnfs41client/i686/. ; \
- cp $(VS_BUILD_DIR_I686)/libtirpc.* $(DESTDIR)/lib/msnfs41client/i686/. ; \
- cp $(VS_BUILD_DIR_I686)/nfs_install.* $(DESTDIR)/lib/msnfs41client/i686/. ; \
- + cp $(VS_BUILD_DIR_I686)/nfsclientdctl.* $(DESTDIR)/lib/msnfs41client/i686/. ; \
- fi
- cp $(VS_BUILD_DIR_I686)/nfs_mount.* $(DESTDIR)/lib/msnfs41client/i686/.
- # install 32bit nfs_mount.exe on 64bit Windows to assist with debugging 32bit issues
- @@ -68,6 +69,7 @@ installdest:
- cp $(VS_BUILD_DIR_X64)/nfsd.* $(DESTDIR)/lib/msnfs41client/x64/. ; \
- cp $(VS_BUILD_DIR_X64)/libtirpc.* $(DESTDIR)/lib/msnfs41client/x64/. ; \
- cp $(VS_BUILD_DIR_X64)/nfs_install.* $(DESTDIR)/lib/msnfs41client/x64/. ; \
- + cp $(VS_BUILD_DIR_X64)/nfsclientdctl.* $(DESTDIR)/lib/msnfs41client/x64/. ; \
- fi ; \
- cp $(VS_BUILD_DIR_X64)/nfs_mount.* $(DESTDIR)/lib/msnfs41client/x64/. ; \
- cp $(VS_BUILD_DIR_X64)/nfs41_np.* $(DESTDIR)/lib/msnfs41client/x64/. ; \
- @@ -83,6 +85,7 @@ installdest:
- cp $(VS_BUILD_DIR_ARM64)/nfsd.* $(DESTDIR)/lib/msnfs41client/arm64/. ; \
- cp $(VS_BUILD_DIR_ARM64)/libtirpc.* $(DESTDIR)/lib/msnfs41client/arm64/. ; \
- cp $(VS_BUILD_DIR_ARM64)/nfs_install.* $(DESTDIR)/lib/msnfs41client/arm64/. ; \
- + cp $(VS_BUILD_DIR_ARM64)/nfsclientdctl.* $(DESTDIR)/lib/msnfs41client/arm64/. ; \
- fi ; \
- cp $(VS_BUILD_DIR_ARM64)/nfs_mount.* $(DESTDIR)/lib/msnfs41client/arm64/. ; \
- cp $(VS_BUILD_DIR_ARM64)/nfs41_np.* $(DESTDIR)/lib/msnfs41client/arm64/. ; \
- diff --git a/nfsclientdctl/nfsclientdctl.c b/nfsclientdctl/nfsclientdctl.c
- new file mode 100644
- index 0000000..68fe57a
- --- /dev/null
- +++ b/nfsclientdctl/nfsclientdctl.c
- @@ -0,0 +1,51 @@
- +/*
- + * NFSv4.1 client for Windows
- + * Copyright (C) 2025 Roland Mainz
- + *
- + * Roland Mainz <roland.mainz@nrubsig.org>
- + *
- + * This library is free software; you can redistribute it and/or modify it
- + * under the terms of the GNU Lesser General Public License as published by
- + * the Free Software Foundation; either version 2.1 of the License, or (at
- + * your option) any later version.
- + *
- + * This library is distributed in the hope that it will be useful, but
- + * without any warranty; without even the implied warranty of merchantability
- + * or fitness for a particular purpose. See the GNU Lesser General Public
- + * License for more details.
- + *
- + * You should have received a copy of the GNU Lesser General Public License
- + * along with this library; if not, write to the Free Software Foundation,
- + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- + */
- +
- +/*
- + * nfsclientdctlexe - Controls for NFS41 client daemon
- + */
- +
- +#if ((__STDC_VERSION__-0) < 201710L)
- +#error Code requires ISO C17
- +#endif
- +
- +#define UNICODE 1
- +#define _UNICODE 1
- +
- +#include <windows.h>
- +#include <stdio.h>
- +#include <stdbool.h>
- +#include <string.h>
- +
- +
- +#define DPRINTF(level, fmt) \
- + if ((level) <= _dprintf_debug_level) { \
- + (void)printf fmt; \
- + }
- +
- +static int _dprintf_debug_level = 0;
- +
- +int main(int ac, char *av[])
- +{
- + (void)ac;
- + (void)av;
- + return EXIT_SUCCESS;
- +}
- --
- 2.51.0
- From 2b6a9bbe4d4a92c26dad68e4b4c1f9c4c6ff4d03 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Fri, 17 Oct 2025 17:28:28 +0200
- Subject: [PATCH 2/4] nfsclientdctl: Add "stopdaemon" subcmd
- Add "stopdaemon" subcmd to ask nfsd.exe to exit.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- nfsclientdctl/nfsclientdctl.c | 73 +++++++++++++++++++++++++++++++++--
- 1 file changed, 69 insertions(+), 4 deletions(-)
- diff --git a/nfsclientdctl/nfsclientdctl.c b/nfsclientdctl/nfsclientdctl.c
- index 68fe57a..49a185b 100644
- --- a/nfsclientdctl/nfsclientdctl.c
- +++ b/nfsclientdctl/nfsclientdctl.c
- @@ -20,7 +20,7 @@
- */
- /*
- - * nfsclientdctlexe - Controls for NFS41 client daemon
- + * nfsclientdctl.exe - Controls for NFS41 client daemon
- */
- #if ((__STDC_VERSION__-0) < 201710L)
- @@ -35,6 +35,10 @@
- #include <stdbool.h>
- #include <string.h>
- +#include <devioctl.h>
- +#include "../include/nfs41_driver.h"
- +
- +#define EXIT_USAGE (2) /* Traditional UNIX exit code for usage */
- #define DPRINTF(level, fmt) \
- if ((level) <= _dprintf_debug_level) { \
- @@ -43,9 +47,70 @@
- static int _dprintf_debug_level = 0;
- -int main(int ac, char *av[])
- +static
- +HANDLE create_nfs41sys_device_pipe(void)
- +{
- + HANDLE pipe;
- + pipe = CreateFileA(NFS41_USER_DEVICE_NAME_A,
- + GENERIC_READ|GENERIC_WRITE,
- + FILE_SHARE_READ|FILE_SHARE_WRITE,
- + NULL,
- + OPEN_EXISTING,
- + 0,
- + NULL);
- + return pipe;
- +}
- +
- +static
- +void close_nfs41sys_device_pipe(HANDLE pipe)
- +{
- + (void)CloseHandle(pipe);
- +}
- +
- +void usage(const char *progname)
- +{
- + (void)fprintf(stderr, "Usage: %s [stopdaemon]", progname);
- +}
- +
- +static
- +int cmd_stopdaemon(const char *progname)
- {
- - (void)ac;
- - (void)av;
- + HANDLE pipe;
- + DWORD status;
- + DWORD dstatus;
- + DWORD outbuf_len;
- +
- + pipe = create_nfs41sys_device_pipe();
- + if (pipe == INVALID_HANDLE_VALUE) {
- + status = GetLastError();
- + (void)fprintf(stderr,
- + "%s: stopdaemon: "
- + "Unable to open nfs41_driver pipe, lasterr=%d\n",
- + progname,
- + (int)status);
- + return EXIT_FAILURE;
- + }
- + dstatus = DeviceIoControl(pipe, IOCTL_NFS41_STOP,
- + NULL, 0, NULL, 0, &outbuf_len, NULL);
- +
- + close_nfs41sys_device_pipe(pipe);
- return EXIT_SUCCESS;
- }
- +
- +
- +int main(int ac, char *av[])
- +{
- + if (ac < 2) {
- + usage(av[0]);
- + return EXIT_USAGE;
- + }
- +
- + if (!strcmp(av[1], "stopdaemon")) {
- + return cmd_stopdaemon(av[0]);
- + }
- + else {
- + (void)fprintf(stderr, "%s: Unknown cmd '%s'\n",
- + av[0], av[1]);
- + return EXIT_FAILURE;
- + }
- +}
- --
- 2.51.0
- From 6b964443b08107ff2a7e82a7d0155c6bb6b9eff6 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Fri, 17 Oct 2025 20:17:47 +0200
- Subject: [PATCH 3/4] daemon,include,nfsclientdctl,sys: Add nfsclientdctl.exe
- "setdaemondebuglevel" subcmd
- Add nfsclientdctl.exe "setdaemondebuglevel" subcmd to set the
- debug level of a running nfsd.exe.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/daemon_debug.c | 54 +++++++++++++++++++++++++++--
- daemon/upcall.c | 16 ++++++---
- daemon/upcall.h | 5 +++
- include/nfs41_driver.h | 2 ++
- nfsclientdctl/nfsclientdctl.c | 55 ++++++++++++++++++++++++++++-
- sys/nfs41sys_driver.c | 65 +++++++++++++++++++++++++++++++++++
- sys/nfs41sys_driver.h | 8 +++++
- sys/nfs41sys_updowncall.c | 7 ++++
- 8 files changed, 205 insertions(+), 7 deletions(-)
- diff --git a/daemon/daemon_debug.c b/daemon/daemon_debug.c
- index 19d9e6e..7b840ce 100644
- --- a/daemon/daemon_debug.c
- +++ b/daemon/daemon_debug.c
- @@ -462,7 +462,6 @@ const char* opcode2string(nfs41_opcodes opcode)
- switch(opcode) {
- #define NFSOPCODE_TO_STRLITERAL(e) case e: return #e;
- NFSOPCODE_TO_STRLITERAL(NFS41_SYSOP_INVALID_OPCODE0)
- - NFSOPCODE_TO_STRLITERAL(NFS41_SYSOP_SHUTDOWN)
- NFSOPCODE_TO_STRLITERAL(NFS41_SYSOP_MOUNT)
- NFSOPCODE_TO_STRLITERAL(NFS41_SYSOP_UNMOUNT)
- NFSOPCODE_TO_STRLITERAL(NFS41_SYSOP_OPEN)
- @@ -486,6 +485,8 @@ const char* opcode2string(nfs41_opcodes opcode)
- NFSOPCODE_TO_STRLITERAL(NFS41_SYSOP_FSCTL_SET_ZERO_DATA)
- NFSOPCODE_TO_STRLITERAL(NFS41_SYSOP_FSCTL_DUPLICATE_DATA)
- NFSOPCODE_TO_STRLITERAL(NFS41_SYSOP_FSCTL_OFFLOAD_DATACOPY)
- + NFSOPCODE_TO_STRLITERAL(NFS41_SYSOP_SET_DAEMON_DEBUGLEVEL)
- + NFSOPCODE_TO_STRLITERAL(NFS41_SYSOP_SHUTDOWN)
- NFSOPCODE_TO_STRLITERAL(NFS41_SYSOP_INVALID_OPCODE1)
- default: break;
- }
- @@ -1486,4 +1487,53 @@ void debug_print_ea(PFILE_FULL_EA_INFORMATION ea)
- out:
- dprintf_out("<-- debug_print_ea()\n");
- -}
- \ No newline at end of file
- +}
- +
- +/*
- + * Handle |NFS41_SYSOP_SET_DAEMON_DEBUGLEVEL|
- + */
- +#include "upcall.h"
- +
- +static int parse_setdaemondebuglevel(
- + const unsigned char *restrict buffer,
- + uint32_t length,
- + nfs41_upcall *upcall)
- +{
- + int status;
- + setdaemondebuglevel_upcall_args *args = &upcall->args.setdaemondebuglevel;
- +
- + status = safe_read(&buffer, &length, &args->debuglevel, sizeof(args->debuglevel));
- + if (status) goto out;
- +
- + EASSERT(length == 0);
- +
- +out:
- + return status;
- +}
- +
- +static
- +int handle_setdaemondebuglevel(void *daemon_context,
- + nfs41_upcall *upcall)
- +{
- + setdaemondebuglevel_upcall_args *args = &upcall->args.setdaemondebuglevel;
- +
- + if ((args->debuglevel < -1L) || (args->debuglevel > 8L)) {
- + eprintf("handle_setdaemondebuglevel: invalid debug level %ld\n",
- + (long)args->debuglevel);
- + return ERROR_INVALID_PARAMETER;
- + }
- +
- + DPRINTF(0,
- + ("handle_setdaemondebuglevel: Setting debug level to %ld\n",
- + (long)args->debuglevel));
- + set_debug_level(args->debuglevel);
- +
- + return ERROR_SUCCESS;
- +}
- +
- +const nfs41_upcall_op nfs41_op_setdaemondebuglevel = {
- + .parse = parse_setdaemondebuglevel,
- + .handle = handle_setdaemondebuglevel,
- + .marshall = NULL,
- + .arg_size = 0
- +};
- diff --git a/daemon/upcall.c b/daemon/upcall.c
- index afd7130..8d5d335 100644
- --- a/daemon/upcall.c
- +++ b/daemon/upcall.c
- @@ -53,6 +53,7 @@ extern const nfs41_upcall_op nfs41_op_queryallocatedranges;
- extern const nfs41_upcall_op nfs41_op_setzerodata;
- extern const nfs41_upcall_op nfs41_op_duplicatedata;
- extern const nfs41_upcall_op nfs41_op_offload_datacopy;
- +extern const nfs41_upcall_op nfs41_op_setdaemondebuglevel;
- /* |_nfs41_opcodes| and |g_upcall_op_table| must be in sync! */
- static const nfs41_upcall_op *g_upcall_op_table[] = {
- @@ -80,7 +81,8 @@ static const nfs41_upcall_op *g_upcall_op_table[] = {
- &nfs41_op_setzerodata,
- &nfs41_op_duplicatedata,
- &nfs41_op_offload_datacopy,
- - NULL,
- + &nfs41_op_setdaemondebuglevel,
- + NULL, /* NFS41_SYSOP_SHUTDOWN */
- NULL
- };
- static const uint32_t g_upcall_op_table_size = ARRAYSIZE(g_upcall_op_table);
- @@ -164,10 +166,16 @@ int upcall_parse(
- op = g_upcall_op_table[upcall_upcode];
- if (op) {
- - /* |NFS41_SYSOP_UNMOUNT| has 0 payload */
- - if (upcall_upcode != NFS41_SYSOP_UNMOUNT) {
- + /*
- + * |NFS41_SYSOP_UNMOUNT| has 0 payload,
- + * |NFS41_SYSOP_SET_DAEMON_DEBUGLEVEL| has a |ULONG| payload
- + */
- + if ((upcall_upcode != NFS41_SYSOP_UNMOUNT) &&
- + (upcall_upcode != NFS41_SYSOP_SET_DAEMON_DEBUGLEVEL)) {
- EASSERT_MSG(op->arg_size >= sizeof(void*),
- - ("upcall->opcode=%u\n", (unsigned int)upcall_upcode));
- + ("upcall->opcode=%u, op->arg_size=%ld\n",
- + (unsigned int)upcall_upcode,
- + (long)op->arg_size));
- }
- (void)memset(&upcall->args, 0, op->arg_size);
- }
- diff --git a/daemon/upcall.h b/daemon/upcall.h
- index f0c2016..4d7afb6 100644
- --- a/daemon/upcall.h
- +++ b/daemon/upcall.h
- @@ -226,6 +226,10 @@ typedef struct __duplicatedata_upcall_args {
- ULONGLONG ctime;
- } duplicatedata_upcall_args;
- +typedef struct __setdaemondebuglevel_upcall_args {
- + LONG debuglevel;
- +} setdaemondebuglevel_upcall_args;
- +
- typedef union __upcall_args {
- mount_upcall_args mount;
- open_upcall_args open;
- @@ -245,6 +249,7 @@ typedef union __upcall_args {
- queryallocatedranges_upcall_args queryallocatedranges;
- setzerodata_upcall_args setzerodata;
- duplicatedata_upcall_args duplicatedata;
- + setdaemondebuglevel_upcall_args setdaemondebuglevel;
- } upcall_args;
- typedef enum _nfs41_opcodes nfs41_opcodes;
- diff --git a/include/nfs41_driver.h b/include/nfs41_driver.h
- index 1b6bae2..4e8b4b2 100644
- --- a/include/nfs41_driver.h
- +++ b/include/nfs41_driver.h
- @@ -52,6 +52,7 @@
- #define IOCTL_NFS41_WRITE _RDR_CTL_CODE(7, METHOD_BUFFERED)
- #define IOCTL_NFS41_DELAYXID _RDR_CTL_CODE(8, METHOD_BUFFERED)
- #define IOCTL_NFS41_INVALCACHE _RDR_CTL_CODE(9, METHOD_BUFFERED)
- +#define IOCTL_NFS41_SET_DAEMON_DEBUG_LEVEL _RDR_CTL_CODE(10, METHOD_BUFFERED)
- /*
- * NFS41_SYS_MAX_PATH_LEN - Maximum path length
- @@ -90,6 +91,7 @@ typedef enum _nfs41_opcodes {
- NFS41_SYSOP_FSCTL_SET_ZERO_DATA,
- NFS41_SYSOP_FSCTL_DUPLICATE_DATA,
- NFS41_SYSOP_FSCTL_OFFLOAD_DATACOPY,
- + NFS41_SYSOP_SET_DAEMON_DEBUGLEVEL,
- NFS41_SYSOP_SHUTDOWN,
- NFS41_SYSOP_INVALID_OPCODE1
- } nfs41_opcodes;
- diff --git a/nfsclientdctl/nfsclientdctl.c b/nfsclientdctl/nfsclientdctl.c
- index 49a185b..4fee75d 100644
- --- a/nfsclientdctl/nfsclientdctl.c
- +++ b/nfsclientdctl/nfsclientdctl.c
- @@ -69,7 +69,10 @@ void close_nfs41sys_device_pipe(HANDLE pipe)
- void usage(const char *progname)
- {
- - (void)fprintf(stderr, "Usage: %s [stopdaemon]", progname);
- + (void)fprintf(stderr,
- + "Usage: %s "
- + "[stopdaemon|setdaemondebuglevel <debuglevel>]",
- + progname);
- }
- static
- @@ -97,6 +100,53 @@ int cmd_stopdaemon(const char *progname)
- return EXIT_SUCCESS;
- }
- +static
- +int cmd_setdaemondebuglevel(const char *progname, const char *levelstr)
- +{
- + HANDLE pipe;
- + DWORD status;
- + BOOL dstatus;
- + DWORD outbuf_len;
- + LONG debuglevel;
- +
- + if (levelstr == NULL) {
- + (void)fprintf(stderr,
- + "%s: setdaemondebuglevel: "
- + "Missing <debuglevel> argument\n",
- + progname);
- + return EXIT_FAILURE;
- + }
- +
- + debuglevel = atol(levelstr);
- +
- + pipe = create_nfs41sys_device_pipe();
- + if (pipe == INVALID_HANDLE_VALUE) {
- + status = GetLastError();
- + (void)fprintf(stderr,
- + "%s: setdaemondebuglevel: "
- + "Unable to open nfs41_driver pipe, lasterr=%d\n",
- + progname,
- + (int)status);
- + return EXIT_FAILURE;
- + }
- +
- + dstatus = DeviceIoControl(pipe,
- + IOCTL_NFS41_SET_DAEMON_DEBUG_LEVEL,
- + &debuglevel, sizeof(debuglevel),
- + NULL, 0,
- + &outbuf_len, NULL);
- + if (dstatus == FALSE) {
- + status = GetLastError();
- + (void)fprintf(stderr,
- + "%s: stopdaemon: "
- + "IOCTL_NFS41_SET_DAEMON_DEBUG_LEVEL failed with lasterr=%d\n",
- + progname,
- + (int)status);
- + }
- +
- + close_nfs41sys_device_pipe(pipe);
- + return EXIT_SUCCESS;
- +}
- int main(int ac, char *av[])
- {
- @@ -108,6 +158,9 @@ int main(int ac, char *av[])
- if (!strcmp(av[1], "stopdaemon")) {
- return cmd_stopdaemon(av[0]);
- }
- + else if (!strcmp(av[1], "setdaemondebuglevel")) {
- + return cmd_setdaemondebuglevel(av[0], av[2]);
- + }
- else {
- (void)fprintf(stderr, "%s: Unknown cmd '%s'\n",
- av[0], av[1]);
- diff --git a/sys/nfs41sys_driver.c b/sys/nfs41sys_driver.c
- index 42c1e15..c5c2a99 100644
- --- a/sys/nfs41sys_driver.c
- +++ b/sys/nfs41sys_driver.c
- @@ -310,6 +310,62 @@ NTSTATUS nfs41_invalidate_cache(
- return status;
- }
- +NTSTATUS marshal_nfs41_set_daemon_debuglevel(
- + nfs41_updowncall_entry *entry,
- + unsigned char *buf,
- + ULONG buf_len,
- + ULONG *len)
- +{
- + NTSTATUS status = STATUS_SUCCESS;
- + ULONG header_len = 0;
- + unsigned char *tmp = buf;
- +
- + status = marshal_nfs41_header(entry, tmp, buf_len, len);
- + if (status) goto out;
- + else tmp += *len;
- +
- + header_len = *len + sizeof(LONG);
- + if (header_len > buf_len) {
- + status = STATUS_INSUFFICIENT_RESOURCES;
- + goto out;
- + }
- +
- + RtlCopyMemory(tmp, &entry->u.SetDaemonDebugLevel.debuglevel,
- + sizeof(entry->u.SetDaemonDebugLevel.debuglevel));
- + tmp += sizeof(entry->u.SetDaemonDebugLevel.debuglevel);
- + *len = header_len;
- +
- +out:
- + return status;
- +}
- +
- +NTSTATUS nfs41_set_daemon_debuglevel(
- + DWORD version,
- + LONG debuglevel)
- +{
- + NTSTATUS status = STATUS_SUCCESS;
- + nfs41_updowncall_entry *entry = NULL;
- +
- + DbgEn();
- + status = nfs41_UpcallCreate(NFS41_SYSOP_SET_DAEMON_DEBUGLEVEL, NULL,
- + INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE, version, NULL, &entry);
- + if (status) goto out;
- +
- + entry->u.SetDaemonDebugLevel.debuglevel = debuglevel;
- +
- + status = nfs41_UpcallWaitForReply(entry, UPCALL_TIMEOUT_DEFAULT);
- + if (status) {
- + /* Timeout - |nfs41_downcall()| will free |entry|+contents */
- + entry = NULL;
- + goto out;
- + }
- +
- + nfs41_UpcallDestroy(entry);
- +out:
- + DbgEx();
- + return status;
- +}
- +
- NTSTATUS nfs41_shutdown_daemon(
- DWORD version)
- {
- @@ -576,6 +632,15 @@ NTSTATUS nfs41_DevFcbXXXControlFile(
- if (status == STATUS_PENDING && RxContext->PostRequest == TRUE )
- status = STATUS_MORE_PROCESSING_REQUIRED;
- break;
- + case IOCTL_NFS41_SET_DAEMON_DEBUG_LEVEL:
- + if (in_len == sizeof(LONG)) {
- + LONG debuglevel = 0;
- + RtlCopyMemory(&debuglevel, inbuf, sizeof(debuglevel));
- + nfs41_set_daemon_debuglevel(DevExt->nfs41d_version,
- + debuglevel);
- + status = STATUS_SUCCESS;
- + }
- + break;
- default:
- status = STATUS_INVALID_DEVICE_REQUEST;
- };
- diff --git a/sys/nfs41sys_driver.h b/sys/nfs41sys_driver.h
- index b984878..3f50257 100644
- --- a/sys/nfs41sys_driver.h
- +++ b/sys/nfs41sys_driver.h
- @@ -190,6 +190,9 @@ typedef struct _updowncall_entry {
- ULONG buf_len;
- ULONGLONG ChangeTime;
- union {
- + struct {
- + LONG debuglevel;
- + } SetDaemonDebugLevel;
- struct {
- PUNICODE_STRING srv_name; /* hostname, or hostname@port */
- PUNICODE_STRING root;
- @@ -647,6 +650,11 @@ NTSTATUS marshal_nfs41_shutdown(
- unsigned char *buf,
- ULONG buf_len,
- ULONG *len);
- +NTSTATUS marshal_nfs41_set_daemon_debuglevel(
- + nfs41_updowncall_entry *entry,
- + unsigned char *buf,
- + ULONG buf_len,
- + ULONG *len);
- void enable_caching(
- PMRX_SRV_OPEN SrvOpen,
- PNFS41_FOBX nfs41_fobx,
- diff --git a/sys/nfs41sys_updowncall.c b/sys/nfs41sys_updowncall.c
- index f491a29..30a5793 100644
- --- a/sys/nfs41sys_updowncall.c
- +++ b/sys/nfs41sys_updowncall.c
- @@ -260,6 +260,9 @@ NTSTATUS handle_upcall(
- }
- switch(entry->opcode) {
- + case NFS41_SYSOP_SET_DAEMON_DEBUGLEVEL:
- + status = marshal_nfs41_set_daemon_debuglevel(entry, pbOut, cbOut, len);
- + break;
- case NFS41_SYSOP_SHUTDOWN:
- status = marshal_nfs41_shutdown(entry, pbOut, cbOut, len);
- (void)KeSetEvent(&entry->cond, IO_NFS41FS_INCREMENT, FALSE);
- @@ -775,6 +778,10 @@ NTSTATUS nfs41_downcall(
- case NFS41_SYSOP_FSCTL_OFFLOAD_DATACOPY:
- unmarshal_nfs41_duplicatedata(cur, &inbuf);
- break;
- + case NFS41_SYSOP_SET_DAEMON_DEBUGLEVEL:
- + case NFS41_SYSOP_SHUTDOWN:
- + /* no unmarshal function */
- + break;
- }
- /*
- --
- 2.51.0
- From 7f219a67d8fe471cb3ad90b6de1601f766dc6fe2 Mon Sep 17 00:00:00 2001
- From: Dan Shelton <dan.f.shelton@gmail.com>
- Date: Sat, 18 Oct 2025 12:30:21 +0200
- Subject: [PATCH 4/4] sys: Set
- FO_WRITE_THROUGH,FO_NO_INTERMEDIATE_BUFFERING,FO_CACHE_SUPPORTED per
- create/mount flags
- Set FO_WRITE_THROUGH,FO_NO_INTERMEDIATE_BUFFERING,FO_CACHE_SUPPORTED per
- create/mount flags. It seems the Win10 RDR is not doing that itself,
- so we have to set those flags.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- sys/nfs41sys_openclose.c | 31 +++++++++++++++++++++++++++++++
- 1 file changed, 31 insertions(+)
- diff --git a/sys/nfs41sys_openclose.c b/sys/nfs41sys_openclose.c
- index 8c6e287..a7dbcc2 100644
- --- a/sys/nfs41sys_openclose.c
- +++ b/sys/nfs41sys_openclose.c
- @@ -931,6 +931,37 @@ retry_on_link:
- RxFinishFcbInitialization(Fcb,
- RDBSS_STORAGE_NTC(StorageType),
- &InitPacket);
- +
- +#if 1
- + if (!entry->u.Open.sinfo.Directory) {
- + PFILE_OBJECT fo = RxContext->CurrentIrpSp->FileObject;
- +
- + if ((params->CreateOptions & FILE_WRITE_THROUGH) ||
- + pVNetRootContext->write_thru) {
- + fo->Flags |= FO_WRITE_THROUGH;
- + }
- + else {
- + fo->Flags &= ~FO_WRITE_THROUGH;
- + }
- +
- + if ((params->CreateOptions & FILE_NO_INTERMEDIATE_BUFFERING) ||
- + pVNetRootContext->nocache) {
- + fo->Flags |= FO_NO_INTERMEDIATE_BUFFERING;
- + }
- + else {
- + fo->Flags &= ~FO_NO_INTERMEDIATE_BUFFERING;
- + }
- +
- + if ((fo->Flags &
- + (FO_WRITE_THROUGH|FO_NO_INTERMEDIATE_BUFFERING)) == 0) {
- + fo->Flags |= FO_CACHE_SUPPORTED;
- + DbgP("nfs41_Create: set FO_CACHE_SUPPORTED\n");
- + }
- + else {
- + fo->Flags &= ~FO_CACHE_SUPPORTED;
- + }
- + }
- +#endif
- }
- else {
- #ifndef NFS41_DRIVER_HACK_DISABLE_FCB_ATTR_UPDATE_ON_OPEN
- --
- 2.51.0
msnfs41client: Patches for nfsclientdutil+misc, 2025-10-18
Posted by Anonymous on Sat 18th Oct 2025 14:56
raw | new post
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.
rovema.kpaste.net RSS