pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client: Patches for nfsclientdutil+misc, 2025-10-18
Posted by Anonymous on Sat 18th Oct 2025 14:56
raw | new post

  1. From 1cee61c019130af0d13cd2782ae90c5026cdf328 Mon Sep 17 00:00:00 2001
  2. From: Roland Mainz <roland.mainz@nrubsig.org>
  3. Date: Fri, 17 Oct 2025 16:17:26 +0200
  4. Subject: [PATCH 1/4] build.vc19,cygwin,nfsclientdctl: Add VC2019 config+stub
  5.  for nfsclientdctl utility
  6.  
  7. Add VC2019 config+stub for nfsclientdctl utility.
  8.  
  9. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  10. ---
  11. build.vc19/nfs41-client.sln                   |  72 ++++--
  12.  .../nfsclientdctl/nfsclientdctl.vcxproj       | 243 ++++++++++++++++++
  13.  .../nfsclientdctl.vcxproj.filters             |  22 ++
  14.  .../nfsclientdctl/nfsclientdctl.vcxproj.user  |   4 +
  15.  cygwin/Makefile                               |   3 +
  16.  cygwin/Makefile.install                       |   3 +
  17.  nfsclientdctl/nfsclientdctl.c                 |  51 ++++
  18.  7 files changed, 370 insertions(+), 28 deletions(-)
  19.  create mode 100755 build.vc19/nfsclientdctl/nfsclientdctl.vcxproj
  20.  create mode 100755 build.vc19/nfsclientdctl/nfsclientdctl.vcxproj.filters
  21.  create mode 100755 build.vc19/nfsclientdctl/nfsclientdctl.vcxproj.user
  22.  create mode 100644 nfsclientdctl/nfsclientdctl.c
  23.  
  24. diff --git a/build.vc19/nfs41-client.sln b/build.vc19/nfs41-client.sln
  25. index df40a34..3f8fa72 100644
  26. --- a/build.vc19/nfs41-client.sln
  27. +++ b/build.vc19/nfs41-client.sln
  28. @@ -1,7 +1,7 @@
  29.  
  30.  Microsoft Visual Studio Solution File, Format Version 12.00
  31. -# Visual Studio 14
  32. -VisualStudioVersion = 14.0.23107.0
  33. +# Visual Studio Version 16
  34. +VisualStudioVersion = 16.0.36602.28
  35.  MinimumVisualStudioVersion = 10.0.40219.1
  36.  Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nfs_install", "nfs_install\nfs_install.vcxproj", "{D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}"
  37.  EndProject
  38. @@ -18,93 +18,109 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nfsd", "nfsd\nfsd.vcxproj",
  39.  EndProject
  40.  Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtirpc", "libtirpc\libtirpc.vcxproj", "{3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}"
  41.  EndProject
  42. +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nfsclientdctl", "nfsclientdctl\nfsclientdctl.vcxproj", "{3E612F91-75FB-419B-8663-8DC530D17C33}"
  43. +EndProject
  44.  Global
  45.         GlobalSection(SolutionConfigurationPlatforms) = preSolution
  46. +               Debug|ARM64 = Debug|ARM64
  47.                 Debug|x64 = Debug|x64
  48.                 Debug|x86 = Debug|x86
  49. -               Debug|ARM64 = Debug|ARM64
  50.                 Release|ARM64 = Release|ARM64
  51.                 Release|x64 = Release|x64
  52.                 Release|x86 = Release|x86
  53.         EndGlobalSection
  54.         GlobalSection(ProjectConfigurationPlatforms) = postSolution
  55. +               {D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}.Debug|ARM64.ActiveCfg = Debug|ARM64
  56. +               {D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}.Debug|ARM64.Build.0 = Debug|ARM64
  57.                 {D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}.Debug|x64.ActiveCfg = Debug|x64
  58.                 {D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}.Debug|x64.Build.0 = Debug|x64
  59.                 {D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}.Debug|x86.ActiveCfg = Debug|Win32
  60.                 {D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}.Debug|x86.Build.0 = Debug|Win32
  61. -               {D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}.Debug|ARM64.ActiveCfg = Debug|ARM64
  62. -               {D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}.Debug|ARM64.Build.0 = Debug|ARM64
  63. +               {D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}.Release|ARM64.ActiveCfg = Release|ARM64
  64. +               {D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}.Release|ARM64.Build.0 = Release|ARM64
  65.                 {D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}.Release|x64.ActiveCfg = Release|x64
  66.                 {D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}.Release|x64.Build.0 = Release|x64
  67.                 {D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}.Release|x86.ActiveCfg = Release|Win32
  68.                 {D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}.Release|x86.Build.0 = Release|Win32
  69. -               {D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}.Release|ARM64.ActiveCfg = Release|ARM64
  70. -               {D99CCE56-FF7D-44D3-8E75-EB6D8F47CFA1}.Release|ARM64.Build.0 = Release|ARM64
  71. +               {896D812D-B4AC-4661-A9ED-7DE94BB68365}.Debug|ARM64.ActiveCfg = Debug|ARM64
  72. +               {896D812D-B4AC-4661-A9ED-7DE94BB68365}.Debug|ARM64.Build.0 = Debug|ARM64
  73.                 {896D812D-B4AC-4661-A9ED-7DE94BB68365}.Debug|x64.ActiveCfg = Debug|x64
  74.                 {896D812D-B4AC-4661-A9ED-7DE94BB68365}.Debug|x64.Build.0 = Debug|x64
  75.                 {896D812D-B4AC-4661-A9ED-7DE94BB68365}.Debug|x86.ActiveCfg = Debug|Win32
  76.                 {896D812D-B4AC-4661-A9ED-7DE94BB68365}.Debug|x86.Build.0 = Debug|Win32
  77. +               {896D812D-B4AC-4661-A9ED-7DE94BB68365}.Release|ARM64.ActiveCfg = Release|ARM64
  78. +               {896D812D-B4AC-4661-A9ED-7DE94BB68365}.Release|ARM64.Build.0 = Release|ARM64
  79.                 {896D812D-B4AC-4661-A9ED-7DE94BB68365}.Release|x64.ActiveCfg = Release|x64
  80.                 {896D812D-B4AC-4661-A9ED-7DE94BB68365}.Release|x64.Build.0 = Release|x64
  81.                 {896D812D-B4AC-4661-A9ED-7DE94BB68365}.Release|x86.ActiveCfg = Release|Win32
  82.                 {896D812D-B4AC-4661-A9ED-7DE94BB68365}.Release|x86.Build.0 = Release|Win32
  83. -               {896D812D-B4AC-4661-A9ED-7DE94BB68365}.Debug|ARM64.ActiveCfg = Debug|ARM64
  84. -               {896D812D-B4AC-4661-A9ED-7DE94BB68365}.Debug|ARM64.Build.0 = Debug|ARM64
  85. -               {896D812D-B4AC-4661-A9ED-7DE94BB68365}.Release|ARM64.ActiveCfg = Release|ARM64
  86. -               {896D812D-B4AC-4661-A9ED-7DE94BB68365}.Release|ARM64.Build.0 = Release|ARM64
  87. +               {833F4171-5B96-4BB0-8D9D-BB926ECA8976}.Debug|ARM64.ActiveCfg = Debug|ARM64
  88. +               {833F4171-5B96-4BB0-8D9D-BB926ECA8976}.Debug|ARM64.Build.0 = Debug|ARM64
  89.                 {833F4171-5B96-4BB0-8D9D-BB926ECA8976}.Debug|x64.ActiveCfg = Debug|x64
  90.                 {833F4171-5B96-4BB0-8D9D-BB926ECA8976}.Debug|x64.Build.0 = Debug|x64
  91.                 {833F4171-5B96-4BB0-8D9D-BB926ECA8976}.Debug|x86.ActiveCfg = Debug|Win32
  92.                 {833F4171-5B96-4BB0-8D9D-BB926ECA8976}.Debug|x86.Build.0 = Debug|Win32
  93. +               {833F4171-5B96-4BB0-8D9D-BB926ECA8976}.Release|ARM64.ActiveCfg = Release|ARM64
  94. +               {833F4171-5B96-4BB0-8D9D-BB926ECA8976}.Release|ARM64.Build.0 = Release|ARM64
  95.                 {833F4171-5B96-4BB0-8D9D-BB926ECA8976}.Release|x64.ActiveCfg = Release|x64
  96.                 {833F4171-5B96-4BB0-8D9D-BB926ECA8976}.Release|x64.Build.0 = Release|x64
  97.                 {833F4171-5B96-4BB0-8D9D-BB926ECA8976}.Release|x86.ActiveCfg = Release|Win32
  98.                 {833F4171-5B96-4BB0-8D9D-BB926ECA8976}.Release|x86.Build.0 = Release|Win32
  99. -               {833F4171-5B96-4BB0-8D9D-BB926ECA8976}.Debug|ARM64.ActiveCfg = Debug|ARM64
  100. -               {833F4171-5B96-4BB0-8D9D-BB926ECA8976}.Debug|ARM64.Build.0 = Debug|ARM64
  101. -               {833F4171-5B96-4BB0-8D9D-BB926ECA8976}.Release|ARM64.ActiveCfg = Release|ARM64
  102. -               {833F4171-5B96-4BB0-8D9D-BB926ECA8976}.Release|ARM64.Build.0 = Release|ARM64
  103. +               {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Debug|ARM64.ActiveCfg = Debug|ARM64
  104. +               {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Debug|ARM64.Build.0 = Debug|ARM64
  105.                 {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Debug|x64.ActiveCfg = Debug|x64
  106.                 {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Debug|x64.Build.0 = Debug|x64
  107.                 {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Debug|x86.ActiveCfg = Debug|Win32
  108.                 {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Debug|x86.Build.0 = Debug|Win32
  109.                 {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Debug|x86.Deploy.0 = Debug|Win32
  110. +               {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Release|ARM64.ActiveCfg = Release|ARM64
  111. +               {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Release|ARM64.Build.0 = Release|ARM64
  112.                 {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Release|x64.ActiveCfg = Release|x64
  113.                 {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Release|x64.Build.0 = Release|x64
  114.                 {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Release|x86.ActiveCfg = Release|Win32
  115.                 {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Release|x86.Build.0 = Release|Win32
  116.                 {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Release|x86.Deploy.0 = Release|Win32
  117. -               {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Debug|ARM64.ActiveCfg = Debug|ARM64
  118. -               {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Debug|ARM64.Build.0 = Debug|ARM64
  119. -               {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Release|ARM64.ActiveCfg = Release|ARM64
  120. -               {78E2A6FE-05E7-40F8-AE1E-29BC3C307859}.Release|ARM64.Build.0 = Release|ARM64
  121. +               {FAE57101-F0EE-46CB-986D-E19A796693F7}.Debug|ARM64.ActiveCfg = Debug|ARM64
  122. +               {FAE57101-F0EE-46CB-986D-E19A796693F7}.Debug|ARM64.Build.0 = Debug|ARM64
  123.                 {FAE57101-F0EE-46CB-986D-E19A796693F7}.Debug|x64.ActiveCfg = Debug|x64
  124.                 {FAE57101-F0EE-46CB-986D-E19A796693F7}.Debug|x64.Build.0 = Debug|x64
  125.                 {FAE57101-F0EE-46CB-986D-E19A796693F7}.Debug|x86.ActiveCfg = Debug|Win32
  126.                 {FAE57101-F0EE-46CB-986D-E19A796693F7}.Debug|x86.Build.0 = Debug|Win32
  127. +               {FAE57101-F0EE-46CB-986D-E19A796693F7}.Release|ARM64.ActiveCfg = Release|ARM64
  128. +               {FAE57101-F0EE-46CB-986D-E19A796693F7}.Release|ARM64.Build.0 = Release|ARM64
  129.                 {FAE57101-F0EE-46CB-986D-E19A796693F7}.Release|x64.ActiveCfg = Release|x64
  130.                 {FAE57101-F0EE-46CB-986D-E19A796693F7}.Release|x64.Build.0 = Release|x64
  131.                 {FAE57101-F0EE-46CB-986D-E19A796693F7}.Release|x86.ActiveCfg = Release|Win32
  132.                 {FAE57101-F0EE-46CB-986D-E19A796693F7}.Release|x86.Build.0 = Release|Win32
  133. -               {FAE57101-F0EE-46CB-986D-E19A796693F7}.Debug|ARM64.ActiveCfg = Debug|ARM64
  134. -               {FAE57101-F0EE-46CB-986D-E19A796693F7}.Debug|ARM64.Build.0 = Debug|ARM64
  135. -               {FAE57101-F0EE-46CB-986D-E19A796693F7}.Release|ARM64.ActiveCfg = Release|ARM64
  136. -               {FAE57101-F0EE-46CB-986D-E19A796693F7}.Release|ARM64.Build.0 = Release|ARM64
  137. +               {3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}.Debug|ARM64.ActiveCfg = Debug|ARM64
  138. +               {3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}.Debug|ARM64.Build.0 = Debug|ARM64
  139.                 {3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}.Debug|x64.ActiveCfg = Debug|x64
  140.                 {3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}.Debug|x64.Build.0 = Debug|x64
  141.                 {3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}.Debug|x86.ActiveCfg = Debug|Win32
  142.                 {3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}.Debug|x86.Build.0 = Debug|Win32
  143. +               {3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}.Release|ARM64.ActiveCfg = Release|ARM64
  144. +               {3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}.Release|ARM64.Build.0 = Release|ARM64
  145.                 {3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}.Release|x64.ActiveCfg = Release|x64
  146.                 {3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}.Release|x64.Build.0 = Release|x64
  147.                 {3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}.Release|x86.ActiveCfg = Release|Win32
  148.                 {3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}.Release|x86.Build.0 = Release|Win32
  149. -               {3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}.Debug|ARM64.ActiveCfg = Debug|ARM64
  150. -               {3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}.Debug|ARM64.Build.0 = Debug|ARM64
  151. -               {3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}.Release|ARM64.ActiveCfg = Release|ARM64
  152. -               {3B0A10FB-7CF3-4A91-9767-3BA6FEDE7FFE}.Release|ARM64.Build.0 = Release|ARM64
  153. -
  154. +               {3E612F91-75FB-419B-8663-8DC530D17C33}.Debug|ARM64.ActiveCfg = Debug|ARM64
  155. +               {3E612F91-75FB-419B-8663-8DC530D17C33}.Debug|ARM64.Build.0 = Debug|ARM64
  156. +               {3E612F91-75FB-419B-8663-8DC530D17C33}.Debug|x64.ActiveCfg = Debug|x64
  157. +               {3E612F91-75FB-419B-8663-8DC530D17C33}.Debug|x64.Build.0 = Debug|x64
  158. +               {3E612F91-75FB-419B-8663-8DC530D17C33}.Debug|x86.ActiveCfg = Debug|Win32
  159. +               {3E612F91-75FB-419B-8663-8DC530D17C33}.Debug|x86.Build.0 = Debug|Win32
  160. +               {3E612F91-75FB-419B-8663-8DC530D17C33}.Release|ARM64.ActiveCfg = Release|ARM64
  161. +               {3E612F91-75FB-419B-8663-8DC530D17C33}.Release|ARM64.Build.0 = Release|ARM64
  162. +               {3E612F91-75FB-419B-8663-8DC530D17C33}.Release|x64.ActiveCfg = Release|x64
  163. +               {3E612F91-75FB-419B-8663-8DC530D17C33}.Release|x64.Build.0 = Release|x64
  164. +               {3E612F91-75FB-419B-8663-8DC530D17C33}.Release|x86.ActiveCfg = Release|Win32
  165. +               {3E612F91-75FB-419B-8663-8DC530D17C33}.Release|x86.Build.0 = Release|Win32
  166.         EndGlobalSection
  167.         GlobalSection(SolutionProperties) = preSolution
  168.                 HideSolutionNode = FALSE
  169.         EndGlobalSection
  170. +       GlobalSection(ExtensibilityGlobals) = postSolution
  171. +               SolutionGuid = {9AEA2540-709B-468E-9FFB-6E1838DBCE45}
  172. +       EndGlobalSection
  173.  EndGlobal
  174. diff --git a/build.vc19/nfsclientdctl/nfsclientdctl.vcxproj b/build.vc19/nfsclientdctl/nfsclientdctl.vcxproj
  175. new file mode 100755
  176. index 0000000..afe031e
  177. --- /dev/null
  178. +++ b/build.vc19/nfsclientdctl/nfsclientdctl.vcxproj
  179. @@ -0,0 +1,243 @@
  180. +<?xml version="1.0" encoding="utf-8"?>
  181. +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  182. +  <Target Name="Sign" AfterTargets="Build">
  183. +    <SignFile CertificateThumbprint="$(CERTIFICATE_THUMBPRINT)" SigningTarget="$(OutputPath)\nfsclientdctl.exe" TargetFrameworkVersion="v4.5" />
  184. +  </Target>
  185. +  <ItemGroup Label="ProjectConfigurations">
  186. +    <ProjectConfiguration Include="Debug|Win32">
  187. +      <Configuration>Debug</Configuration>
  188. +      <Platform>Win32</Platform>
  189. +    </ProjectConfiguration>
  190. +    <ProjectConfiguration Include="Release|Win32">
  191. +      <Configuration>Release</Configuration>
  192. +      <Platform>Win32</Platform>
  193. +    </ProjectConfiguration>
  194. +    <ProjectConfiguration Include="Debug|x64">
  195. +      <Configuration>Debug</Configuration>
  196. +      <Platform>x64</Platform>
  197. +    </ProjectConfiguration>
  198. +    <ProjectConfiguration Include="Release|x64">
  199. +      <Configuration>Release</Configuration>
  200. +      <Platform>x64</Platform>
  201. +    </ProjectConfiguration>
  202. +    <ProjectConfiguration Include="Debug|ARM64">
  203. +      <Configuration>Debug</Configuration>
  204. +      <Platform>ARM64</Platform>
  205. +    </ProjectConfiguration>
  206. +    <ProjectConfiguration Include="Release|ARM64">
  207. +      <Configuration>Release</Configuration>
  208. +      <Platform>ARM64</Platform>
  209. +    </ProjectConfiguration>
  210. +  </ItemGroup>
  211. +  <PropertyGroup Label="Globals">
  212. +    <ProjectGuid>{3e612f91-75fb-419b-8663-8dc530d17c33}</ProjectGuid>
  213. +    <Keyword>Win32Proj</Keyword>
  214. +    <RootNamespace>nfsclientdctl</RootNamespace>
  215. +    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
  216. +  </PropertyGroup>
  217. +  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
  218. +  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
  219. +    <ConfigurationType>Application</ConfigurationType>
  220. +    <UseDebugLibraries>true</UseDebugLibraries>
  221. +    <PlatformToolset>v142</PlatformToolset>
  222. +    <CharacterSet>Unicode</CharacterSet>
  223. +  </PropertyGroup>
  224. +  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
  225. +    <ConfigurationType>Application</ConfigurationType>
  226. +    <UseDebugLibraries>false</UseDebugLibraries>
  227. +    <PlatformToolset>v142</PlatformToolset>
  228. +    <WholeProgramOptimization>true</WholeProgramOptimization>
  229. +    <CharacterSet>Unicode</CharacterSet>
  230. +  </PropertyGroup>
  231. +  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
  232. +    <ConfigurationType>Application</ConfigurationType>
  233. +    <UseDebugLibraries>true</UseDebugLibraries>
  234. +    <PlatformToolset>v142</PlatformToolset>
  235. +    <CharacterSet>Unicode</CharacterSet>
  236. +  </PropertyGroup>
  237. +  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
  238. +    <ConfigurationType>Application</ConfigurationType>
  239. +    <UseDebugLibraries>false</UseDebugLibraries>
  240. +    <PlatformToolset>v142</PlatformToolset>
  241. +    <WholeProgramOptimization>true</WholeProgramOptimization>
  242. +    <CharacterSet>Unicode</CharacterSet>
  243. +  </PropertyGroup>
  244. +  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
  245. +    <ConfigurationType>Application</ConfigurationType>
  246. +    <UseDebugLibraries>true</UseDebugLibraries>
  247. +    <PlatformToolset>v142</PlatformToolset>
  248. +    <CharacterSet>Unicode</CharacterSet>
  249. +  </PropertyGroup>
  250. +  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
  251. +    <ConfigurationType>Application</ConfigurationType>
  252. +    <UseDebugLibraries>false</UseDebugLibraries>
  253. +    <PlatformToolset>v142</PlatformToolset>
  254. +    <WholeProgramOptimization>true</WholeProgramOptimization>
  255. +    <CharacterSet>Unicode</CharacterSet>
  256. +  </PropertyGroup>
  257. +  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
  258. +  <ImportGroup Label="ExtensionSettings">
  259. +  </ImportGroup>
  260. +  <ImportGroup Label="Shared">
  261. +  </ImportGroup>
  262. +  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
  263. +    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  264. +  </ImportGroup>
  265. +  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
  266. +    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  267. +  </ImportGroup>
  268. +  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
  269. +    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  270. +  </ImportGroup>
  271. +  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
  272. +    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  273. +  </ImportGroup>
  274. +  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
  275. +    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  276. +  </ImportGroup>
  277. +  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
  278. +    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  279. +  </ImportGroup>
  280. +  <PropertyGroup Label="UserMacros" />
  281. +  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
  282. +    <LinkIncremental>true</LinkIncremental>
  283. +  </PropertyGroup>
  284. +  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
  285. +    <LinkIncremental>true</LinkIncremental>
  286. +  </PropertyGroup>
  287. +  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
  288. +    <LinkIncremental>true</LinkIncremental>
  289. +  </PropertyGroup>
  290. +  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
  291. +    <LinkIncremental>false</LinkIncremental>
  292. +  </PropertyGroup>
  293. +  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
  294. +    <LinkIncremental>false</LinkIncremental>
  295. +  </PropertyGroup>
  296. +  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
  297. +    <LinkIncremental>false</LinkIncremental>
  298. +  </PropertyGroup>
  299. +  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
  300. +    <ClCompile>
  301. +      <PrecompiledHeader>
  302. +      </PrecompiledHeader>
  303. +      <WarningLevel>Level4</WarningLevel>
  304. +      <Optimization>Disabled</Optimization>
  305. +      <PreprocessorDefinitions>WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;_MEMCPY_INLINE_=1;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  306. +      <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  307. +      <LanguageStandard_C>stdc17</LanguageStandard_C>
  308. +      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
  309. +      <AdditionalOptions>/wd5105</AdditionalOptions>
  310. +      <SupportJustMyCode>false</SupportJustMyCode>
  311. +    </ClCompile>
  312. +    <Link>
  313. +      <SubSystem>Console</SubSystem>
  314. +      <GenerateDebugInformation>true</GenerateDebugInformation>
  315. +    </Link>
  316. +  </ItemDefinitionGroup>
  317. +  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
  318. +    <ClCompile>
  319. +      <PrecompiledHeader>
  320. +      </PrecompiledHeader>
  321. +      <WarningLevel>Level4</WarningLevel>
  322. +      <Optimization>Disabled</Optimization>
  323. +      <PreprocessorDefinitions>WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;_MEMCPY_INLINE_=1;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  324. +      <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  325. +      <LanguageStandard_C>stdc17</LanguageStandard_C>
  326. +      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
  327. +      <AdditionalOptions>/wd5105</AdditionalOptions>
  328. +      <SupportJustMyCode>false</SupportJustMyCode>
  329. +    </ClCompile>
  330. +    <Link>
  331. +      <SubSystem>Console</SubSystem>
  332. +      <GenerateDebugInformation>true</GenerateDebugInformation>
  333. +    </Link>
  334. +  </ItemDefinitionGroup>
  335. +  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
  336. +    <ClCompile>
  337. +      <PrecompiledHeader>
  338. +      </PrecompiledHeader>
  339. +      <WarningLevel>Level4</WarningLevel>
  340. +      <Optimization>Disabled</Optimization>
  341. +      <PreprocessorDefinitions>WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;_MEMCPY_INLINE_=1;PopulationCount64=1;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  342. +      <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  343. +      <LanguageStandard_C>stdc17</LanguageStandard_C>
  344. +      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
  345. +      <AdditionalOptions>/wd5105</AdditionalOptions>
  346. +      <SupportJustMyCode>false</SupportJustMyCode>
  347. +    </ClCompile>
  348. +    <Link>
  349. +      <SubSystem>Console</SubSystem>
  350. +      <GenerateDebugInformation>true</GenerateDebugInformation>
  351. +    </Link>
  352. +  </ItemDefinitionGroup>
  353. +  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
  354. +    <ClCompile>
  355. +      <WarningLevel>Level4</WarningLevel>
  356. +      <PrecompiledHeader>
  357. +      </PrecompiledHeader>
  358. +      <Optimization>MaxSpeed</Optimization>
  359. +      <FunctionLevelLinking>true</FunctionLevelLinking>
  360. +      <IntrinsicFunctions>true</IntrinsicFunctions>
  361. +      <PreprocessorDefinitions>WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;_MEMCPY_INLINE_=1;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  362. +      <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  363. +      <LanguageStandard_C>stdc17</LanguageStandard_C>
  364. +      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
  365. +      <AdditionalOptions>/wd5105</AdditionalOptions>
  366. +    </ClCompile>
  367. +    <Link>
  368. +      <SubSystem>Console</SubSystem>
  369. +      <GenerateDebugInformation>true</GenerateDebugInformation>
  370. +      <EnableCOMDATFolding>true</EnableCOMDATFolding>
  371. +      <OptimizeReferences>true</OptimizeReferences>
  372. +    </Link>
  373. +  </ItemDefinitionGroup>
  374. +  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
  375. +    <ClCompile>
  376. +      <WarningLevel>Level4</WarningLevel>
  377. +      <PrecompiledHeader>
  378. +      </PrecompiledHeader>
  379. +      <Optimization>MaxSpeed</Optimization>
  380. +      <FunctionLevelLinking>true</FunctionLevelLinking>
  381. +      <IntrinsicFunctions>true</IntrinsicFunctions>
  382. +      <PreprocessorDefinitions>WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;_MEMCPY_INLINE_=1;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  383. +      <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  384. +      <LanguageStandard_C>stdc17</LanguageStandard_C>
  385. +      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
  386. +      <AdditionalOptions>/wd5105</AdditionalOptions>
  387. +    </ClCompile>
  388. +    <Link>
  389. +      <SubSystem>Console</SubSystem>
  390. +      <GenerateDebugInformation>true</GenerateDebugInformation>
  391. +      <EnableCOMDATFolding>true</EnableCOMDATFolding>
  392. +      <OptimizeReferences>true</OptimizeReferences>
  393. +    </Link>
  394. +  </ItemDefinitionGroup>
  395. +  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
  396. +    <ClCompile>
  397. +      <WarningLevel>Level4</WarningLevel>
  398. +      <PrecompiledHeader>
  399. +      </PrecompiledHeader>
  400. +      <Optimization>MaxSpeed</Optimization>
  401. +      <FunctionLevelLinking>true</FunctionLevelLinking>
  402. +      <IntrinsicFunctions>true</IntrinsicFunctions>
  403. +      <PreprocessorDefinitions>WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;_MEMCPY_INLINE_=1;PopulationCount64=1;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  404. +      <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  405. +      <LanguageStandard_C>stdc17</LanguageStandard_C>
  406. +      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
  407. +      <AdditionalOptions>/wd5105</AdditionalOptions>
  408. +    </ClCompile>
  409. +    <Link>
  410. +      <SubSystem>Console</SubSystem>
  411. +      <GenerateDebugInformation>true</GenerateDebugInformation>
  412. +      <EnableCOMDATFolding>true</EnableCOMDATFolding>
  413. +      <OptimizeReferences>true</OptimizeReferences>
  414. +    </Link>
  415. +  </ItemDefinitionGroup>
  416. +  <ItemGroup>
  417. +    <ClCompile Include="..\..\nfsclientdctl\nfsclientdctl.c" />
  418. +  </ItemGroup>
  419. +  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
  420. +  <ImportGroup Label="ExtensionTargets">
  421. +  </ImportGroup>
  422. +</Project>
  423. \ No newline at end of file
  424. diff --git a/build.vc19/nfsclientdctl/nfsclientdctl.vcxproj.filters b/build.vc19/nfsclientdctl/nfsclientdctl.vcxproj.filters
  425. new file mode 100755
  426. index 0000000..5af7a2e
  427. --- /dev/null
  428. +++ b/build.vc19/nfsclientdctl/nfsclientdctl.vcxproj.filters
  429. @@ -0,0 +1,22 @@
  430. +<?xml version="1.0" encoding="utf-8"?>
  431. +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  432. +  <ItemGroup>
  433. +    <Filter Include="Source Files">
  434. +      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
  435. +      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
  436. +    </Filter>
  437. +    <Filter Include="Header Files">
  438. +      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
  439. +      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
  440. +    </Filter>
  441. +    <Filter Include="Resource Files">
  442. +      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
  443. +      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
  444. +    </Filter>
  445. +  </ItemGroup>
  446. +  <ItemGroup>
  447. +    <ClCompile Include="..\..\nfsclientdctl\nfsclientdctl.c">
  448. +      <Filter>Source Files</Filter>
  449. +    </ClCompile>
  450. +  </ItemGroup>
  451. +</Project>
  452. \ No newline at end of file
  453. diff --git a/build.vc19/nfsclientdctl/nfsclientdctl.vcxproj.user b/build.vc19/nfsclientdctl/nfsclientdctl.vcxproj.user
  454. new file mode 100755
  455. index 0000000..88a5509
  456. --- /dev/null
  457. +++ b/build.vc19/nfsclientdctl/nfsclientdctl.vcxproj.user
  458. @@ -0,0 +1,4 @@
  459. +<?xml version="1.0" encoding="utf-8"?>
  460. +<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  461. +  <PropertyGroup />
  462. +</Project>
  463. \ No newline at end of file
  464. diff --git a/cygwin/Makefile b/cygwin/Makefile
  465. index 06d808a..e400eef 100644
  466. --- a/cygwin/Makefile
  467. +++ b/cygwin/Makefile
  468. @@ -146,6 +146,7 @@ installdest32: \
  469.         $(VS_BUILD_DIR_I686)/nfsd.exe \
  470.         $(VS_BUILD_DIR_I686)/nfs_mount.exe \
  471.         $(VS_BUILD_DIR_I686)/nfs_install.exe \
  472. +       $(VS_BUILD_DIR_I686)/nfsclientdctl.exe \
  473.         $(VS_BUILD_DIR_I686)/nfs41_driver.sys \
  474.         $(VS_BUILD_DIR_I686)/libtirpc.dll \
  475.         $(VS_BUILD_DIR_I686)/nfs41_np.dll \
  476. @@ -162,12 +163,14 @@ installdest64: \
  477.         $(VS_BUILD_DIR_X64)/nfsd.exe \
  478.         $(VS_BUILD_DIR_X64)/nfs_mount.exe \
  479.         $(VS_BUILD_DIR_X64)/nfs_install.exe \
  480. +       $(VS_BUILD_DIR_X64)/nfsclientdctl.exe \
  481.         $(VS_BUILD_DIR_X64)/nfs41_driver.sys \
  482.         $(VS_BUILD_DIR_X64)/libtirpc.dll \
  483.         $(VS_BUILD_DIR_X64)/nfs41_np.dll \
  484.         $(VS_BUILD_DIR_ARM64)/nfsd.exe \
  485.         $(VS_BUILD_DIR_ARM64)/nfs_mount.exe \
  486.         $(VS_BUILD_DIR_ARM64)/nfs_install.exe \
  487. +       $(VS_BUILD_DIR_ARM64)/nfsclientdctl.exe \
  488.         $(VS_BUILD_DIR_ARM64)/nfs41_driver.sys \
  489.         $(VS_BUILD_DIR_ARM64)/libtirpc.dll \
  490.         $(VS_BUILD_DIR_ARM64)/nfs41_np.dll \
  491. diff --git a/cygwin/Makefile.install b/cygwin/Makefile.install
  492. index f02fb50..1619e03 100644
  493. --- a/cygwin/Makefile.install
  494. +++ b/cygwin/Makefile.install
  495. @@ -49,6 +49,7 @@ installdest:
  496.                 cp $(VS_BUILD_DIR_I686)/nfsd.*          $(DESTDIR)/lib/msnfs41client/i686/. ; \
  497.                 cp $(VS_BUILD_DIR_I686)/libtirpc.*      $(DESTDIR)/lib/msnfs41client/i686/. ; \
  498.                 cp $(VS_BUILD_DIR_I686)/nfs_install.*   $(DESTDIR)/lib/msnfs41client/i686/. ; \
  499. +               cp $(VS_BUILD_DIR_I686)/nfsclientdctl.* $(DESTDIR)/lib/msnfs41client/i686/. ; \
  500.         fi
  501.         cp $(VS_BUILD_DIR_I686)/nfs_mount.*     $(DESTDIR)/lib/msnfs41client/i686/.
  502.         # install 32bit nfs_mount.exe on 64bit Windows to assist with debugging 32bit issues
  503. @@ -68,6 +69,7 @@ installdest:
  504.                         cp $(VS_BUILD_DIR_X64)/nfsd.*           $(DESTDIR)/lib/msnfs41client/x64/. ; \
  505.                         cp $(VS_BUILD_DIR_X64)/libtirpc.*       $(DESTDIR)/lib/msnfs41client/x64/. ; \
  506.                         cp $(VS_BUILD_DIR_X64)/nfs_install.*    $(DESTDIR)/lib/msnfs41client/x64/. ; \
  507. +                       cp $(VS_BUILD_DIR_X64)/nfsclientdctl.*  $(DESTDIR)/lib/msnfs41client/x64/. ; \
  508.                 fi ; \
  509.                 cp $(VS_BUILD_DIR_X64)/nfs_mount.*      $(DESTDIR)/lib/msnfs41client/x64/. ; \
  510.                 cp $(VS_BUILD_DIR_X64)/nfs41_np.*       $(DESTDIR)/lib/msnfs41client/x64/. ; \
  511. @@ -83,6 +85,7 @@ installdest:
  512.                         cp $(VS_BUILD_DIR_ARM64)/nfsd.*         $(DESTDIR)/lib/msnfs41client/arm64/. ; \
  513.                         cp $(VS_BUILD_DIR_ARM64)/libtirpc.*     $(DESTDIR)/lib/msnfs41client/arm64/. ; \
  514.                         cp $(VS_BUILD_DIR_ARM64)/nfs_install.*  $(DESTDIR)/lib/msnfs41client/arm64/. ; \
  515. +                       cp $(VS_BUILD_DIR_ARM64)/nfsclientdctl.*        $(DESTDIR)/lib/msnfs41client/arm64/. ; \
  516.                 fi ; \
  517.                 cp $(VS_BUILD_DIR_ARM64)/nfs_mount.*    $(DESTDIR)/lib/msnfs41client/arm64/. ; \
  518.                 cp $(VS_BUILD_DIR_ARM64)/nfs41_np.*     $(DESTDIR)/lib/msnfs41client/arm64/. ; \
  519. diff --git a/nfsclientdctl/nfsclientdctl.c b/nfsclientdctl/nfsclientdctl.c
  520. new file mode 100644
  521. index 0000000..68fe57a
  522. --- /dev/null
  523. +++ b/nfsclientdctl/nfsclientdctl.c
  524. @@ -0,0 +1,51 @@
  525. +/*
  526. + * NFSv4.1 client for Windows
  527. + * Copyright (C) 2025 Roland Mainz
  528. + *
  529. + * Roland Mainz <roland.mainz@nrubsig.org>
  530. + *
  531. + * This library is free software; you can redistribute it and/or modify it
  532. + * under the terms of the GNU Lesser General Public License as published by
  533. + * the Free Software Foundation; either version 2.1 of the License, or (at
  534. + * your option) any later version.
  535. + *
  536. + * This library is distributed in the hope that it will be useful, but
  537. + * without any warranty; without even the implied warranty of merchantability
  538. + * or fitness for a particular purpose.  See the GNU Lesser General Public
  539. + * License for more details.
  540. + *
  541. + * You should have received a copy of the GNU Lesser General Public License
  542. + * along with this library; if not, write to the Free Software Foundation,
  543. + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  544. + */
  545. +
  546. +/*
  547. + * nfsclientdctlexe - Controls for NFS41 client daemon
  548. + */
  549. +
  550. +#if ((__STDC_VERSION__-0) < 201710L)
  551. +#error Code requires ISO C17
  552. +#endif
  553. +
  554. +#define UNICODE 1
  555. +#define _UNICODE 1
  556. +
  557. +#include <windows.h>
  558. +#include <stdio.h>
  559. +#include <stdbool.h>
  560. +#include <string.h>
  561. +
  562. +
  563. +#define DPRINTF(level, fmt) \
  564. +    if ((level) <= _dprintf_debug_level) { \
  565. +        (void)printf fmt; \
  566. +    }
  567. +
  568. +static int _dprintf_debug_level = 0;
  569. +
  570. +int main(int ac, char *av[])
  571. +{
  572. +    (void)ac;
  573. +    (void)av;
  574. +    return EXIT_SUCCESS;
  575. +}
  576. --
  577. 2.51.0
  578.  
  579. From 2b6a9bbe4d4a92c26dad68e4b4c1f9c4c6ff4d03 Mon Sep 17 00:00:00 2001
  580. From: Roland Mainz <roland.mainz@nrubsig.org>
  581. Date: Fri, 17 Oct 2025 17:28:28 +0200
  582. Subject: [PATCH 2/4] nfsclientdctl: Add "stopdaemon" subcmd
  583.  
  584. Add "stopdaemon" subcmd to ask nfsd.exe to exit.
  585.  
  586. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  587. ---
  588. nfsclientdctl/nfsclientdctl.c | 73 +++++++++++++++++++++++++++++++++--
  589.  1 file changed, 69 insertions(+), 4 deletions(-)
  590.  
  591. diff --git a/nfsclientdctl/nfsclientdctl.c b/nfsclientdctl/nfsclientdctl.c
  592. index 68fe57a..49a185b 100644
  593. --- a/nfsclientdctl/nfsclientdctl.c
  594. +++ b/nfsclientdctl/nfsclientdctl.c
  595. @@ -20,7 +20,7 @@
  596.   */
  597.  
  598.  /*
  599. - * nfsclientdctlexe - Controls for NFS41 client daemon
  600. + * nfsclientdctl.exe - Controls for NFS41 client daemon
  601.   */
  602.  
  603.  #if ((__STDC_VERSION__-0) < 201710L)
  604. @@ -35,6 +35,10 @@
  605.  #include <stdbool.h>
  606.  #include <string.h>
  607.  
  608. +#include <devioctl.h>
  609. +#include "../include/nfs41_driver.h"
  610. +
  611. +#define EXIT_USAGE (2) /* Traditional UNIX exit code for usage */
  612.  
  613.  #define DPRINTF(level, fmt) \
  614.      if ((level) <= _dprintf_debug_level) { \
  615. @@ -43,9 +47,70 @@
  616.  
  617.  static int _dprintf_debug_level = 0;
  618.  
  619. -int main(int ac, char *av[])
  620. +static
  621. +HANDLE create_nfs41sys_device_pipe(void)
  622. +{
  623. +    HANDLE pipe;
  624. +    pipe = CreateFileA(NFS41_USER_DEVICE_NAME_A,
  625. +        GENERIC_READ|GENERIC_WRITE,
  626. +        FILE_SHARE_READ|FILE_SHARE_WRITE,
  627. +        NULL,
  628. +        OPEN_EXISTING,
  629. +        0,
  630. +        NULL);
  631. +    return pipe;
  632. +}
  633. +
  634. +static
  635. +void close_nfs41sys_device_pipe(HANDLE pipe)
  636. +{
  637. +    (void)CloseHandle(pipe);
  638. +}
  639. +
  640. +void usage(const char *progname)
  641. +{
  642. +    (void)fprintf(stderr, "Usage: %s [stopdaemon]", progname);
  643. +}
  644. +
  645. +static
  646. +int cmd_stopdaemon(const char *progname)
  647.  {
  648. -    (void)ac;
  649. -    (void)av;
  650. +    HANDLE pipe;
  651. +    DWORD status;
  652. +    DWORD dstatus;
  653. +    DWORD outbuf_len;
  654. +
  655. +    pipe = create_nfs41sys_device_pipe();
  656. +    if (pipe == INVALID_HANDLE_VALUE) {
  657. +        status = GetLastError();
  658. +        (void)fprintf(stderr,
  659. +            "%s: stopdaemon: "
  660. +            "Unable to open nfs41_driver pipe, lasterr=%d\n",
  661. +            progname,
  662. +            (int)status);
  663. +        return EXIT_FAILURE;
  664. +    }
  665. +    dstatus = DeviceIoControl(pipe, IOCTL_NFS41_STOP,
  666. +        NULL, 0, NULL, 0, &outbuf_len, NULL);
  667. +
  668. +    close_nfs41sys_device_pipe(pipe);
  669.      return EXIT_SUCCESS;
  670.  }
  671. +
  672. +
  673. +int main(int ac, char *av[])
  674. +{
  675. +    if (ac < 2) {
  676. +        usage(av[0]);
  677. +        return EXIT_USAGE;
  678. +    }
  679. +
  680. +    if (!strcmp(av[1], "stopdaemon")) {
  681. +        return cmd_stopdaemon(av[0]);
  682. +    }
  683. +    else {
  684. +        (void)fprintf(stderr, "%s: Unknown cmd '%s'\n",
  685. +            av[0], av[1]);
  686. +        return EXIT_FAILURE;
  687. +    }
  688. +}
  689. --
  690. 2.51.0
  691.  
  692. From 6b964443b08107ff2a7e82a7d0155c6bb6b9eff6 Mon Sep 17 00:00:00 2001
  693. From: Roland Mainz <roland.mainz@nrubsig.org>
  694. Date: Fri, 17 Oct 2025 20:17:47 +0200
  695. Subject: [PATCH 3/4] daemon,include,nfsclientdctl,sys: Add nfsclientdctl.exe
  696.  "setdaemondebuglevel" subcmd
  697.  
  698. Add nfsclientdctl.exe "setdaemondebuglevel" subcmd to set the
  699. debug level of a running nfsd.exe.
  700.  
  701. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  702. ---
  703. daemon/daemon_debug.c         | 54 +++++++++++++++++++++++++++--
  704.  daemon/upcall.c               | 16 ++++++---
  705.  daemon/upcall.h               |  5 +++
  706.  include/nfs41_driver.h        |  2 ++
  707.  nfsclientdctl/nfsclientdctl.c | 55 ++++++++++++++++++++++++++++-
  708.  sys/nfs41sys_driver.c         | 65 +++++++++++++++++++++++++++++++++++
  709.  sys/nfs41sys_driver.h         |  8 +++++
  710.  sys/nfs41sys_updowncall.c     |  7 ++++
  711.  8 files changed, 205 insertions(+), 7 deletions(-)
  712.  
  713. diff --git a/daemon/daemon_debug.c b/daemon/daemon_debug.c
  714. index 19d9e6e..7b840ce 100644
  715. --- a/daemon/daemon_debug.c
  716. +++ b/daemon/daemon_debug.c
  717. @@ -462,7 +462,6 @@ const char* opcode2string(nfs41_opcodes opcode)
  718.      switch(opcode) {
  719.  #define NFSOPCODE_TO_STRLITERAL(e) case e: return #e;
  720.          NFSOPCODE_TO_STRLITERAL(NFS41_SYSOP_INVALID_OPCODE0)
  721. -        NFSOPCODE_TO_STRLITERAL(NFS41_SYSOP_SHUTDOWN)
  722.          NFSOPCODE_TO_STRLITERAL(NFS41_SYSOP_MOUNT)
  723.          NFSOPCODE_TO_STRLITERAL(NFS41_SYSOP_UNMOUNT)
  724.          NFSOPCODE_TO_STRLITERAL(NFS41_SYSOP_OPEN)
  725. @@ -486,6 +485,8 @@ const char* opcode2string(nfs41_opcodes opcode)
  726.          NFSOPCODE_TO_STRLITERAL(NFS41_SYSOP_FSCTL_SET_ZERO_DATA)
  727.          NFSOPCODE_TO_STRLITERAL(NFS41_SYSOP_FSCTL_DUPLICATE_DATA)
  728.          NFSOPCODE_TO_STRLITERAL(NFS41_SYSOP_FSCTL_OFFLOAD_DATACOPY)
  729. +        NFSOPCODE_TO_STRLITERAL(NFS41_SYSOP_SET_DAEMON_DEBUGLEVEL)
  730. +        NFSOPCODE_TO_STRLITERAL(NFS41_SYSOP_SHUTDOWN)
  731.          NFSOPCODE_TO_STRLITERAL(NFS41_SYSOP_INVALID_OPCODE1)
  732.          default: break;
  733.      }
  734. @@ -1486,4 +1487,53 @@ void debug_print_ea(PFILE_FULL_EA_INFORMATION ea)
  735.  out:
  736.      dprintf_out("<-- debug_print_ea()\n");
  737.  
  738. -}
  739. \ No newline at end of file
  740. +}
  741. +
  742. +/*
  743. + * Handle |NFS41_SYSOP_SET_DAEMON_DEBUGLEVEL|
  744. + */
  745. +#include "upcall.h"
  746. +
  747. +static int parse_setdaemondebuglevel(
  748. +    const unsigned char *restrict buffer,
  749. +    uint32_t length,
  750. +    nfs41_upcall *upcall)
  751. +{
  752. +    int status;
  753. +    setdaemondebuglevel_upcall_args *args = &upcall->args.setdaemondebuglevel;
  754. +
  755. +    status = safe_read(&buffer, &length, &args->debuglevel, sizeof(args->debuglevel));
  756. +    if (status) goto out;
  757. +
  758. +    EASSERT(length == 0);
  759. +
  760. +out:
  761. +    return status;
  762. +}
  763. +
  764. +static
  765. +int handle_setdaemondebuglevel(void *daemon_context,
  766. +    nfs41_upcall *upcall)
  767. +{
  768. +    setdaemondebuglevel_upcall_args *args = &upcall->args.setdaemondebuglevel;
  769. +
  770. +    if ((args->debuglevel < -1L) || (args->debuglevel > 8L)) {
  771. +        eprintf("handle_setdaemondebuglevel: invalid debug level %ld\n",
  772. +            (long)args->debuglevel);
  773. +        return ERROR_INVALID_PARAMETER;
  774. +    }
  775. +
  776. +    DPRINTF(0,
  777. +        ("handle_setdaemondebuglevel: Setting debug level to %ld\n",
  778. +        (long)args->debuglevel));
  779. +    set_debug_level(args->debuglevel);
  780. +
  781. +    return ERROR_SUCCESS;
  782. +}
  783. +
  784. +const nfs41_upcall_op nfs41_op_setdaemondebuglevel = {
  785. +    .parse = parse_setdaemondebuglevel,
  786. +    .handle = handle_setdaemondebuglevel,
  787. +    .marshall = NULL,
  788. +    .arg_size = 0
  789. +};
  790. diff --git a/daemon/upcall.c b/daemon/upcall.c
  791. index afd7130..8d5d335 100644
  792. --- a/daemon/upcall.c
  793. +++ b/daemon/upcall.c
  794. @@ -53,6 +53,7 @@ extern const nfs41_upcall_op nfs41_op_queryallocatedranges;
  795.  extern const nfs41_upcall_op nfs41_op_setzerodata;
  796.  extern const nfs41_upcall_op nfs41_op_duplicatedata;
  797.  extern const nfs41_upcall_op nfs41_op_offload_datacopy;
  798. +extern const nfs41_upcall_op nfs41_op_setdaemondebuglevel;
  799.  
  800.  /* |_nfs41_opcodes| and |g_upcall_op_table| must be in sync! */
  801.  static const nfs41_upcall_op *g_upcall_op_table[] = {
  802. @@ -80,7 +81,8 @@ static const nfs41_upcall_op *g_upcall_op_table[] = {
  803.      &nfs41_op_setzerodata,
  804.      &nfs41_op_duplicatedata,
  805.      &nfs41_op_offload_datacopy,
  806. -    NULL,
  807. +    &nfs41_op_setdaemondebuglevel,
  808. +    NULL, /* NFS41_SYSOP_SHUTDOWN */
  809.      NULL
  810.  };
  811.  static const uint32_t g_upcall_op_table_size = ARRAYSIZE(g_upcall_op_table);
  812. @@ -164,10 +166,16 @@ int upcall_parse(
  813.      op = g_upcall_op_table[upcall_upcode];
  814.  
  815.      if (op) {
  816. -        /* |NFS41_SYSOP_UNMOUNT| has 0 payload */
  817. -        if (upcall_upcode != NFS41_SYSOP_UNMOUNT) {
  818. +        /*
  819. +         * |NFS41_SYSOP_UNMOUNT| has 0 payload,
  820. +         * |NFS41_SYSOP_SET_DAEMON_DEBUGLEVEL| has a |ULONG| payload
  821. +         */
  822. +        if ((upcall_upcode != NFS41_SYSOP_UNMOUNT) &&
  823. +            (upcall_upcode != NFS41_SYSOP_SET_DAEMON_DEBUGLEVEL)) {
  824.              EASSERT_MSG(op->arg_size >= sizeof(void*),
  825. -                ("upcall->opcode=%u\n", (unsigned int)upcall_upcode));
  826. +                ("upcall->opcode=%u, op->arg_size=%ld\n",
  827. +                (unsigned int)upcall_upcode,
  828. +                (long)op->arg_size));
  829.          }
  830.          (void)memset(&upcall->args, 0, op->arg_size);
  831.      }
  832. diff --git a/daemon/upcall.h b/daemon/upcall.h
  833. index f0c2016..4d7afb6 100644
  834. --- a/daemon/upcall.h
  835. +++ b/daemon/upcall.h
  836. @@ -226,6 +226,10 @@ typedef struct __duplicatedata_upcall_args {
  837.      ULONGLONG           ctime;
  838.  } duplicatedata_upcall_args;
  839.  
  840. +typedef struct __setdaemondebuglevel_upcall_args {
  841. +    LONG debuglevel;
  842. +} setdaemondebuglevel_upcall_args;
  843. +
  844.  typedef union __upcall_args {
  845.      mount_upcall_args       mount;
  846.      open_upcall_args        open;
  847. @@ -245,6 +249,7 @@ typedef union __upcall_args {
  848.      queryallocatedranges_upcall_args queryallocatedranges;
  849.      setzerodata_upcall_args setzerodata;
  850.      duplicatedata_upcall_args duplicatedata;
  851. +    setdaemondebuglevel_upcall_args setdaemondebuglevel;
  852.  } upcall_args;
  853.  
  854.  typedef enum _nfs41_opcodes nfs41_opcodes;
  855. diff --git a/include/nfs41_driver.h b/include/nfs41_driver.h
  856. index 1b6bae2..4e8b4b2 100644
  857. --- a/include/nfs41_driver.h
  858. +++ b/include/nfs41_driver.h
  859. @@ -52,6 +52,7 @@
  860.  #define IOCTL_NFS41_WRITE       _RDR_CTL_CODE(7, METHOD_BUFFERED)
  861.  #define IOCTL_NFS41_DELAYXID    _RDR_CTL_CODE(8, METHOD_BUFFERED)
  862.  #define IOCTL_NFS41_INVALCACHE  _RDR_CTL_CODE(9, METHOD_BUFFERED)
  863. +#define IOCTL_NFS41_SET_DAEMON_DEBUG_LEVEL  _RDR_CTL_CODE(10, METHOD_BUFFERED)
  864.  
  865.  /*
  866.   * NFS41_SYS_MAX_PATH_LEN - Maximum path length
  867. @@ -90,6 +91,7 @@ typedef enum _nfs41_opcodes {
  868.      NFS41_SYSOP_FSCTL_SET_ZERO_DATA,
  869.      NFS41_SYSOP_FSCTL_DUPLICATE_DATA,
  870.      NFS41_SYSOP_FSCTL_OFFLOAD_DATACOPY,
  871. +    NFS41_SYSOP_SET_DAEMON_DEBUGLEVEL,
  872.      NFS41_SYSOP_SHUTDOWN,
  873.      NFS41_SYSOP_INVALID_OPCODE1
  874.  } nfs41_opcodes;
  875. diff --git a/nfsclientdctl/nfsclientdctl.c b/nfsclientdctl/nfsclientdctl.c
  876. index 49a185b..4fee75d 100644
  877. --- a/nfsclientdctl/nfsclientdctl.c
  878. +++ b/nfsclientdctl/nfsclientdctl.c
  879. @@ -69,7 +69,10 @@ void close_nfs41sys_device_pipe(HANDLE pipe)
  880.  
  881.  void usage(const char *progname)
  882.  {
  883. -    (void)fprintf(stderr, "Usage: %s [stopdaemon]", progname);
  884. +    (void)fprintf(stderr,
  885. +        "Usage: %s "
  886. +        "[stopdaemon|setdaemondebuglevel <debuglevel>]",
  887. +        progname);
  888.  }
  889.  
  890.  static
  891. @@ -97,6 +100,53 @@ int cmd_stopdaemon(const char *progname)
  892.      return EXIT_SUCCESS;
  893.  }
  894.  
  895. +static
  896. +int cmd_setdaemondebuglevel(const char *progname, const char *levelstr)
  897. +{
  898. +    HANDLE pipe;
  899. +    DWORD status;
  900. +    BOOL dstatus;
  901. +    DWORD outbuf_len;
  902. +    LONG debuglevel;
  903. +
  904. +    if (levelstr == NULL) {
  905. +        (void)fprintf(stderr,
  906. +            "%s: setdaemondebuglevel: "
  907. +            "Missing <debuglevel> argument\n",
  908. +            progname);
  909. +        return EXIT_FAILURE;
  910. +    }
  911. +
  912. +    debuglevel = atol(levelstr);
  913. +
  914. +    pipe = create_nfs41sys_device_pipe();
  915. +    if (pipe == INVALID_HANDLE_VALUE) {
  916. +        status = GetLastError();
  917. +        (void)fprintf(stderr,
  918. +            "%s: setdaemondebuglevel: "
  919. +            "Unable to open nfs41_driver pipe, lasterr=%d\n",
  920. +            progname,
  921. +            (int)status);
  922. +        return EXIT_FAILURE;
  923. +    }
  924. +
  925. +    dstatus = DeviceIoControl(pipe,
  926. +        IOCTL_NFS41_SET_DAEMON_DEBUG_LEVEL,
  927. +        &debuglevel, sizeof(debuglevel),
  928. +        NULL, 0,
  929. +        &outbuf_len, NULL);
  930. +    if (dstatus == FALSE) {
  931. +        status = GetLastError();
  932. +        (void)fprintf(stderr,
  933. +            "%s: stopdaemon: "
  934. +            "IOCTL_NFS41_SET_DAEMON_DEBUG_LEVEL failed with lasterr=%d\n",
  935. +            progname,
  936. +            (int)status);
  937. +    }
  938. +
  939. +    close_nfs41sys_device_pipe(pipe);
  940. +    return EXIT_SUCCESS;
  941. +}
  942.  
  943.  int main(int ac, char *av[])
  944.  {
  945. @@ -108,6 +158,9 @@ int main(int ac, char *av[])
  946.      if (!strcmp(av[1], "stopdaemon")) {
  947.          return cmd_stopdaemon(av[0]);
  948.      }
  949. +    else if (!strcmp(av[1], "setdaemondebuglevel")) {
  950. +        return cmd_setdaemondebuglevel(av[0], av[2]);
  951. +    }
  952.      else {
  953.          (void)fprintf(stderr, "%s: Unknown cmd '%s'\n",
  954.              av[0], av[1]);
  955. diff --git a/sys/nfs41sys_driver.c b/sys/nfs41sys_driver.c
  956. index 42c1e15..c5c2a99 100644
  957. --- a/sys/nfs41sys_driver.c
  958. +++ b/sys/nfs41sys_driver.c
  959. @@ -310,6 +310,62 @@ NTSTATUS nfs41_invalidate_cache(
  960.      return status;
  961.  }
  962.  
  963. +NTSTATUS marshal_nfs41_set_daemon_debuglevel(
  964. +    nfs41_updowncall_entry *entry,
  965. +    unsigned char *buf,
  966. +    ULONG buf_len,
  967. +    ULONG *len)
  968. +{
  969. +    NTSTATUS status = STATUS_SUCCESS;
  970. +    ULONG header_len = 0;
  971. +    unsigned char *tmp = buf;
  972. +
  973. +    status = marshal_nfs41_header(entry, tmp, buf_len, len);
  974. +    if (status) goto out;
  975. +    else tmp += *len;
  976. +
  977. +    header_len = *len + sizeof(LONG);
  978. +    if (header_len > buf_len) {
  979. +        status = STATUS_INSUFFICIENT_RESOURCES;
  980. +        goto out;
  981. +    }
  982. +
  983. +    RtlCopyMemory(tmp, &entry->u.SetDaemonDebugLevel.debuglevel,
  984. +        sizeof(entry->u.SetDaemonDebugLevel.debuglevel));
  985. +    tmp += sizeof(entry->u.SetDaemonDebugLevel.debuglevel);
  986. +    *len = header_len;
  987. +
  988. +out:
  989. +    return status;
  990. +}
  991. +
  992. +NTSTATUS nfs41_set_daemon_debuglevel(
  993. +    DWORD version,
  994. +    LONG debuglevel)
  995. +{
  996. +    NTSTATUS status = STATUS_SUCCESS;
  997. +    nfs41_updowncall_entry *entry = NULL;
  998. +
  999. +    DbgEn();
  1000. +    status = nfs41_UpcallCreate(NFS41_SYSOP_SET_DAEMON_DEBUGLEVEL, NULL,
  1001. +        INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE, version, NULL, &entry);
  1002. +    if (status) goto out;
  1003. +
  1004. +    entry->u.SetDaemonDebugLevel.debuglevel = debuglevel;
  1005. +
  1006. +    status = nfs41_UpcallWaitForReply(entry, UPCALL_TIMEOUT_DEFAULT);
  1007. +    if (status) {
  1008. +        /* Timeout - |nfs41_downcall()| will free |entry|+contents */
  1009. +        entry = NULL;
  1010. +        goto out;
  1011. +    }
  1012. +
  1013. +    nfs41_UpcallDestroy(entry);
  1014. +out:
  1015. +    DbgEx();
  1016. +    return status;
  1017. +}
  1018. +
  1019.  NTSTATUS nfs41_shutdown_daemon(
  1020.      DWORD version)
  1021.  {
  1022. @@ -576,6 +632,15 @@ NTSTATUS nfs41_DevFcbXXXControlFile(
  1023.              if (status == STATUS_PENDING && RxContext->PostRequest == TRUE )
  1024.                  status = STATUS_MORE_PROCESSING_REQUIRED;
  1025.              break;
  1026. +        case IOCTL_NFS41_SET_DAEMON_DEBUG_LEVEL:
  1027. +            if (in_len == sizeof(LONG)) {
  1028. +                LONG debuglevel = 0;
  1029. +                RtlCopyMemory(&debuglevel, inbuf, sizeof(debuglevel));
  1030. +                nfs41_set_daemon_debuglevel(DevExt->nfs41d_version,
  1031. +                    debuglevel);
  1032. +                status = STATUS_SUCCESS;
  1033. +            }
  1034. +            break;
  1035.          default:
  1036.              status = STATUS_INVALID_DEVICE_REQUEST;
  1037.          };
  1038. diff --git a/sys/nfs41sys_driver.h b/sys/nfs41sys_driver.h
  1039. index b984878..3f50257 100644
  1040. --- a/sys/nfs41sys_driver.h
  1041. +++ b/sys/nfs41sys_driver.h
  1042. @@ -190,6 +190,9 @@ typedef struct _updowncall_entry {
  1043.      ULONG buf_len;
  1044.      ULONGLONG ChangeTime;
  1045.      union {
  1046. +        struct {
  1047. +            LONG debuglevel;
  1048. +        } SetDaemonDebugLevel;
  1049.          struct {
  1050.              PUNICODE_STRING srv_name; /* hostname, or hostname@port */
  1051.              PUNICODE_STRING root;
  1052. @@ -647,6 +650,11 @@ NTSTATUS marshal_nfs41_shutdown(
  1053.      unsigned char *buf,
  1054.      ULONG buf_len,
  1055.      ULONG *len);
  1056. +NTSTATUS marshal_nfs41_set_daemon_debuglevel(
  1057. +    nfs41_updowncall_entry *entry,
  1058. +    unsigned char *buf,
  1059. +    ULONG buf_len,
  1060. +    ULONG *len);
  1061.  void enable_caching(
  1062.      PMRX_SRV_OPEN SrvOpen,
  1063.      PNFS41_FOBX nfs41_fobx,
  1064. diff --git a/sys/nfs41sys_updowncall.c b/sys/nfs41sys_updowncall.c
  1065. index f491a29..30a5793 100644
  1066. --- a/sys/nfs41sys_updowncall.c
  1067. +++ b/sys/nfs41sys_updowncall.c
  1068. @@ -260,6 +260,9 @@ NTSTATUS handle_upcall(
  1069.      }
  1070.  
  1071.      switch(entry->opcode) {
  1072. +    case NFS41_SYSOP_SET_DAEMON_DEBUGLEVEL:
  1073. +        status = marshal_nfs41_set_daemon_debuglevel(entry, pbOut, cbOut, len);
  1074. +        break;
  1075.      case NFS41_SYSOP_SHUTDOWN:
  1076.          status = marshal_nfs41_shutdown(entry, pbOut, cbOut, len);
  1077.          (void)KeSetEvent(&entry->cond, IO_NFS41FS_INCREMENT, FALSE);
  1078. @@ -775,6 +778,10 @@ NTSTATUS nfs41_downcall(
  1079.          case NFS41_SYSOP_FSCTL_OFFLOAD_DATACOPY:
  1080.              unmarshal_nfs41_duplicatedata(cur, &inbuf);
  1081.              break;
  1082. +        case NFS41_SYSOP_SET_DAEMON_DEBUGLEVEL:
  1083. +        case NFS41_SYSOP_SHUTDOWN:
  1084. +            /* no unmarshal function */
  1085. +            break;
  1086.          }
  1087.  
  1088.          /*
  1089. --
  1090. 2.51.0
  1091.  
  1092. From 7f219a67d8fe471cb3ad90b6de1601f766dc6fe2 Mon Sep 17 00:00:00 2001
  1093. From: Dan Shelton <dan.f.shelton@gmail.com>
  1094. Date: Sat, 18 Oct 2025 12:30:21 +0200
  1095. Subject: [PATCH 4/4] sys: Set
  1096.  FO_WRITE_THROUGH,FO_NO_INTERMEDIATE_BUFFERING,FO_CACHE_SUPPORTED per
  1097.  create/mount flags
  1098.  
  1099. Set FO_WRITE_THROUGH,FO_NO_INTERMEDIATE_BUFFERING,FO_CACHE_SUPPORTED per
  1100. create/mount flags. It seems the Win10 RDR is not doing that itself,
  1101. so we have to set those flags.
  1102.  
  1103. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  1104. ---
  1105. sys/nfs41sys_openclose.c | 31 +++++++++++++++++++++++++++++++
  1106.  1 file changed, 31 insertions(+)
  1107.  
  1108. diff --git a/sys/nfs41sys_openclose.c b/sys/nfs41sys_openclose.c
  1109. index 8c6e287..a7dbcc2 100644
  1110. --- a/sys/nfs41sys_openclose.c
  1111. +++ b/sys/nfs41sys_openclose.c
  1112. @@ -931,6 +931,37 @@ retry_on_link:
  1113.              RxFinishFcbInitialization(Fcb,
  1114.                  RDBSS_STORAGE_NTC(StorageType),
  1115.                  &InitPacket);
  1116. +
  1117. +#if 1
  1118. +            if (!entry->u.Open.sinfo.Directory) {
  1119. +                PFILE_OBJECT fo = RxContext->CurrentIrpSp->FileObject;
  1120. +
  1121. +                if ((params->CreateOptions & FILE_WRITE_THROUGH) ||
  1122. +                    pVNetRootContext->write_thru) {
  1123. +                    fo->Flags |= FO_WRITE_THROUGH;
  1124. +                }
  1125. +                else {
  1126. +                    fo->Flags &= ~FO_WRITE_THROUGH;
  1127. +                }
  1128. +
  1129. +                if ((params->CreateOptions & FILE_NO_INTERMEDIATE_BUFFERING) ||
  1130. +                    pVNetRootContext->nocache) {
  1131. +                    fo->Flags |= FO_NO_INTERMEDIATE_BUFFERING;
  1132. +                }
  1133. +                else {
  1134. +                    fo->Flags &= ~FO_NO_INTERMEDIATE_BUFFERING;
  1135. +                }
  1136. +
  1137. +                if ((fo->Flags &
  1138. +                    (FO_WRITE_THROUGH|FO_NO_INTERMEDIATE_BUFFERING)) == 0) {
  1139. +                    fo->Flags |= FO_CACHE_SUPPORTED;
  1140. +                    DbgP("nfs41_Create: set FO_CACHE_SUPPORTED\n");
  1141. +                }
  1142. +                else {
  1143. +                    fo->Flags &= ~FO_CACHE_SUPPORTED;
  1144. +                }
  1145. +            }
  1146. +#endif
  1147.          }
  1148.          else {
  1149.  #ifndef NFS41_DRIVER_HACK_DISABLE_FCB_ATTR_UPDATE_ON_OPEN
  1150. --
  1151. 2.51.0

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.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at