pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client: Patches for changetime+assert issues, cleanup, less kernel debug messages+misc, 2024-07-30
Posted by Anonymous on Tue 30th Jul 2024 17:52
raw | new post

  1. From 1071b20d1bbd00a632b2845c2e3eea0b5ea43541 Mon Sep 17 00:00:00 2001
  2. From: Roland Mainz <roland.mainz@nrubsig.org>
  3. Date: Tue, 30 Jul 2024 14:26:28 +0200
  4. Subject: [PATCH 1/5] build.vc19,daemon,include,sys: Move Nfs EA definitions
  5.  into new header
  6.  
  7. Move Nfs EA definitions into new header
  8.  
  9. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  10. ---
  11. build.vc19/nfs41_driver/nfs41_driver.vcxproj  | 17 +++++----
  12.  .../nfs41_driver/nfs41_driver.vcxproj.filters |  3 ++
  13.  build.vc19/nfsd/nfsd.vcxproj                  |  9 +++--
  14.  build.vc19/nfsd/nfsd.vcxproj.filters          |  3 ++
  15.  daemon/ea.c                                   | 22 ++++++-----
  16.  include/nfs_ea.h                              | 38 +++++++++++++++++++
  17.  sys/nfs41_driver.c                            |  7 ++--
  18.  7 files changed, 74 insertions(+), 25 deletions(-)
  19.  create mode 100644 include/nfs_ea.h
  20.  
  21. diff --git a/build.vc19/nfs41_driver/nfs41_driver.vcxproj b/build.vc19/nfs41_driver/nfs41_driver.vcxproj
  22. index 8b89f78..08d77b3 100644
  23. --- a/build.vc19/nfs41_driver/nfs41_driver.vcxproj
  24. +++ b/build.vc19/nfs41_driver/nfs41_driver.vcxproj
  25. @@ -135,7 +135,7 @@
  26.    </PropertyGroup>
  27.    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
  28.      <ClCompile>
  29. -      <AdditionalIncludeDirectories>..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  30. +      <AdditionalIncludeDirectories>..\..\include;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  31.        <WarningLevel>Level4</WarningLevel>
  32.        <PreprocessorDefinitions>EXPLODE_POOLTAGS;MONOLITHIC_MINIRDR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  33.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  34. @@ -147,7 +147,7 @@
  35.    </ItemDefinitionGroup>
  36.    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
  37.      <ClCompile>
  38. -      <AdditionalIncludeDirectories>..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  39. +      <AdditionalIncludeDirectories>..\..\include;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  40.        <WarningLevel>Level4</WarningLevel>
  41.        <PreprocessorDefinitions>EXPLODE_POOLTAGS;MONOLITHIC_MINIRDR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  42.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  43. @@ -159,7 +159,7 @@
  44.    </ItemDefinitionGroup>
  45.    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
  46.      <ClCompile>
  47. -      <AdditionalIncludeDirectories>..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  48. +      <AdditionalIncludeDirectories>..\..\include;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  49.        <WarningLevel>Level4</WarningLevel>
  50.        <PreprocessorDefinitions>EXPLODE_POOLTAGS;MONOLITHIC_MINIRDR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  51.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  52. @@ -171,7 +171,7 @@
  53.    </ItemDefinitionGroup>
  54.    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
  55.      <ClCompile>
  56. -      <AdditionalIncludeDirectories>..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  57. +      <AdditionalIncludeDirectories>..\..\include;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  58.        <WarningLevel>Level4</WarningLevel>
  59.        <PreprocessorDefinitions>EXPLODE_POOLTAGS;MONOLITHIC_MINIRDR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  60.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  61. @@ -183,7 +183,7 @@
  62.    </ItemDefinitionGroup>
  63.    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
  64.      <ClCompile>
  65. -      <AdditionalIncludeDirectories>..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  66. +      <AdditionalIncludeDirectories>..\..\include;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  67.        <WarningLevel>Level4</WarningLevel>
  68.        <PreprocessorDefinitions>EXPLODE_POOLTAGS;MONOLITHIC_MINIRDR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  69.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  70. @@ -195,7 +195,7 @@
  71.    </ItemDefinitionGroup>
  72.    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
  73.      <ClCompile>
  74. -      <AdditionalIncludeDirectories>..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  75. +      <AdditionalIncludeDirectories>..\..\include;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  76.        <WarningLevel>Level4</WarningLevel>
  77.        <PreprocessorDefinitions>EXPLODE_POOLTAGS;MONOLITHIC_MINIRDR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  78.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  79. @@ -207,7 +207,7 @@
  80.    </ItemDefinitionGroup>
  81.    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
  82.      <ClCompile>
  83. -      <AdditionalIncludeDirectories>..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  84. +      <AdditionalIncludeDirectories>..\..\include;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  85.        <WarningLevel>Level4</WarningLevel>
  86.        <PreprocessorDefinitions>EXPLODE_POOLTAGS;MONOLITHIC_MINIRDR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  87.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  88. @@ -219,7 +219,7 @@
  89.    </ItemDefinitionGroup>
  90.    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
  91.      <ClCompile>
  92. -      <AdditionalIncludeDirectories>..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  93. +      <AdditionalIncludeDirectories>..\..\include;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  94.        <WarningLevel>Level4</WarningLevel>
  95.        <PreprocessorDefinitions>EXPLODE_POOLTAGS;MONOLITHIC_MINIRDR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  96.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  97. @@ -241,6 +241,7 @@
  98.      <ClInclude Include="..\..\sys\nfs41_debug.h" />
  99.      <ClInclude Include="..\..\sys\nfs41_driver.h" />
  100.      <ClInclude Include="..\..\sys\wmlkm.h" />
  101. +    <ClInclude Include="..\..\daemon\nfs_ea.h" />
  102.    </ItemGroup>
  103.    <ItemGroup>
  104.      <ResourceCompile Include="..\..\sys\nfs41_driver.rc" />
  105. diff --git a/build.vc19/nfs41_driver/nfs41_driver.vcxproj.filters b/build.vc19/nfs41_driver/nfs41_driver.vcxproj.filters
  106. index 4b93149..35013bf 100644
  107. --- a/build.vc19/nfs41_driver/nfs41_driver.vcxproj.filters
  108. +++ b/build.vc19/nfs41_driver/nfs41_driver.vcxproj.filters
  109. @@ -39,6 +39,9 @@
  110.      <ClInclude Include="..\..\sys\wmlkm.h">
  111.        <Filter>Header Files</Filter>
  112.      </ClInclude>
  113. +    <ClInclude Include="..\..\daemon\nfs_ea.h">
  114. +      <Filter>Header Files</Filter>
  115. +    </ClInclude>
  116.    </ItemGroup>
  117.    <ItemGroup>
  118.      <ResourceCompile Include="..\..\sys\nfs41_driver.rc">
  119. diff --git a/build.vc19/nfsd/nfsd.vcxproj b/build.vc19/nfsd/nfsd.vcxproj
  120. index 8121996..49241cc 100644
  121. --- a/build.vc19/nfsd/nfsd.vcxproj
  122. +++ b/build.vc19/nfsd/nfsd.vcxproj
  123. @@ -88,7 +88,7 @@
  124.        <WarningLevel>Level4</WarningLevel>
  125.        <Optimization>Disabled</Optimization>
  126.        <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;STANDALONE_NFSD;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  127. -      <AdditionalIncludeDirectories>..\..\libtirpc\tirpc;..\..\sys;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  128. +      <AdditionalIncludeDirectories>..\..\include;..\..\libtirpc\tirpc;..\..\sys;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  129.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  130.        <BasicRuntimeChecks>Default</BasicRuntimeChecks>
  131.        <BufferSecurityCheck>false</BufferSecurityCheck>
  132. @@ -109,7 +109,7 @@
  133.        <WarningLevel>Level4</WarningLevel>
  134.        <Optimization>Disabled</Optimization>
  135.        <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;STANDALONE_NFSD;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  136. -      <AdditionalIncludeDirectories>..\..\libtirpc\tirpc;..\..\sys;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  137. +      <AdditionalIncludeDirectories>..\..\include;..\..\libtirpc\tirpc;..\..\sys;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  138.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  139.        <BasicRuntimeChecks>Default</BasicRuntimeChecks>
  140.        <BufferSecurityCheck>false</BufferSecurityCheck>
  141. @@ -132,7 +132,7 @@
  142.        <FunctionLevelLinking>true</FunctionLevelLinking>
  143.        <IntrinsicFunctions>true</IntrinsicFunctions>
  144.        <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  145. -      <AdditionalIncludeDirectories>..\..\libtirpc\tirpc;..\..\sys;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  146. +      <AdditionalIncludeDirectories>..\..\include;..\..\libtirpc\tirpc;..\..\sys;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  147.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  148.        <BufferSecurityCheck>false</BufferSecurityCheck>
  149.        <StringPooling>true</StringPooling>
  150. @@ -156,7 +156,7 @@
  151.        <FunctionLevelLinking>true</FunctionLevelLinking>
  152.        <IntrinsicFunctions>true</IntrinsicFunctions>
  153.        <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  154. -      <AdditionalIncludeDirectories>..\..\libtirpc\tirpc;..\..\sys;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  155. +      <AdditionalIncludeDirectories>..\..\include;..\..\libtirpc\tirpc;..\..\sys;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  156.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  157.        <BufferSecurityCheck>false</BufferSecurityCheck>
  158.        <StringPooling>true</StringPooling>
  159. @@ -236,6 +236,7 @@
  160.      <ClInclude Include="..\..\daemon\tree.h" />
  161.      <ClInclude Include="..\..\daemon\upcall.h" />
  162.      <ClInclude Include="..\..\daemon\util.h" />
  163. +    <ClInclude Include="..\..\include\nfs_ea.h" />
  164.    </ItemGroup>
  165.    <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
  166.    <ImportGroup Label="ExtensionTargets">
  167. diff --git a/build.vc19/nfsd/nfsd.vcxproj.filters b/build.vc19/nfsd/nfsd.vcxproj.filters
  168. index 6ef3f60..2880b46 100644
  169. --- a/build.vc19/nfsd/nfsd.vcxproj.filters
  170. +++ b/build.vc19/nfsd/nfsd.vcxproj.filters
  171. @@ -197,5 +197,8 @@
  172.      <ClInclude Include="..\..\daemon\util.h">
  173.        <Filter>Header Files</Filter>
  174.      </ClInclude>
  175. +    <ClInclude Include="..\..\include\nfs_ea.h">
  176. +      <Filter>Header Files</Filter>
  177. +    </ClInclude>
  178.    </ItemGroup>
  179.  </Project>
  180. \ No newline at end of file
  181. diff --git a/daemon/ea.c b/daemon/ea.c
  182. index 70dd543..c9715c4 100644
  183. --- a/daemon/ea.c
  184. +++ b/daemon/ea.c
  185. @@ -29,6 +29,7 @@
  186.  #include "delegation.h"
  187.  #include "upcall.h"
  188.  #include "daemon_debug.h"
  189. +#include "nfs_ea.h"
  190.  
  191.  
  192.  #define EALVL 2 /* dprintf level for extended attribute logging */
  193. @@ -101,15 +102,16 @@ out:
  194.      return status;
  195.  }
  196.  
  197. -static int is_cygwin_ea(
  198. +/* Is this a NFS extended attribute (commonly used by Cygwin) ? */
  199. +static bool is_nfs_ea(
  200.      PFILE_FULL_EA_INFORMATION ea)
  201.  {
  202. -    return (strncmp("NfsV3Attributes", ea->EaName, ea->EaNameLength) == 0
  203. -            && sizeof("NfsV3Attributes")-1 == ea->EaNameLength)
  204. -        || (strncmp("NfsActOnLink", ea->EaName, ea->EaNameLength) == 0
  205. -            && sizeof("NfsActOnLink")-1 == ea->EaNameLength)
  206. -        || (strncmp("NfsSymlinkTargetName", ea->EaName, ea->EaNameLength) == 0
  207. -            && sizeof("NfsSymlinkTargetName")-1 == ea->EaNameLength);
  208. +    return (((ea->EaNameLength == EA_NFSV3ATTRIBUTES_LEN) &&
  209. +            (!strncmp(EA_NFSV3ATTRIBUTES, ea->EaName, ea->EaNameLength)))
  210. +        || ((ea->EaNameLength == EA_NFSACTONLINK_LEN) &&
  211. +            (!strncmp(EA_NFSACTONLINK, ea->EaName, ea->EaNameLength)))
  212. +        || ((ea->EaNameLength == EA_NFSSYMLINKTARGETNAME_LEN) &&
  213. +            (!strncmp(EA_NFSSYMLINKTARGETNAME, ea->EaName, ea->EaNameLength))));
  214.  }
  215.  
  216.  #define NEXT_ENTRY(ea) ((PBYTE)(ea) + (ea)->NextEntryOffset)
  217. @@ -129,7 +131,7 @@ int nfs41_ea_set(
  218.      }
  219.  
  220.      while (status == NFS4_OK) {
  221. -        if (!is_cygwin_ea(ea))
  222. +        if (!is_nfs_ea(ea))
  223.              status = set_ea_value(state->session, &attrdir, &state->owner, ea);
  224.  
  225.          if (ea->NextEntryOffset == 0)
  226. @@ -172,8 +174,8 @@ static int handle_setexattr(void *daemon_context, nfs41_upcall *upcall)
  227.      nfs41_delegation_return(state->session, &state->file,
  228.          OPEN_DELEGATE_READ, FALSE);
  229.  
  230. -    if (strncmp("NfsV3Attributes", ea->EaName, ea->EaNameLength) == 0
  231. -            && sizeof("NfsV3Attributes")-1 == ea->EaNameLength) {
  232. +    if ((ea->EaNameLength == EA_NFSV3ATTRIBUTES_LEN) &&
  233. +        (!strncmp(EA_NFSV3ATTRIBUTES, ea->EaName, ea->EaNameLength))) {
  234.          nfs41_file_info info;
  235.          stateid_arg stateid;
  236.  
  237. diff --git a/include/nfs_ea.h b/include/nfs_ea.h
  238. new file mode 100644
  239. index 0000000..aaf36c0
  240. --- /dev/null
  241. +++ b/include/nfs_ea.h
  242. @@ -0,0 +1,38 @@
  243. +/*
  244. + * NFSv4.1 client for Windows
  245. + * Copyright (C) 2024 Roland Mainz <roland.mainz@nrubsig.org>
  246. + *
  247. + * Roland Mainz <roland.mainz@nrubsig.org>
  248. + *
  249. + * This library is free software; you can redistribute it and/or modify it
  250. + * under the terms of the GNU Lesser General Public License as published by
  251. + * the Free Software Foundation; either version 2.1 of the License, or (at
  252. + * your option) any later version.
  253. + *
  254. + * This library is distributed in the hope that it will be useful, but
  255. + * without any warranty; without even the implied warranty of merchantability
  256. + * or fitness for a particular purpose.  See the GNU Lesser General Public
  257. + * License for more details.
  258. + *
  259. + * You should have received a copy of the GNU Lesser General Public License
  260. + * along with this library; if not, write to the Free Software Foundation,
  261. + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  262. + */
  263. +
  264. +#ifndef __NFS41_DAEMON_NFSV4_EA
  265. +#define __NFS41_DAEMON_NFSV4_EA 1
  266. +
  267. +/*
  268. + * ToDo: Add documentation how these EAs (extended attributes) work
  269. + */
  270. +
  271. +#define EA_NFSV3ATTRIBUTES "NfsV3Attributes"
  272. +#define EA_NFSV3ATTRIBUTES_LEN (15)
  273. +
  274. +#define EA_NFSSYMLINKTARGETNAME "NfsSymlinkTargetName"
  275. +#define EA_NFSSYMLINKTARGETNAME_LEN (17)
  276. +
  277. +#define EA_NFSACTONLINK "NfsActOnLink"
  278. +#define EA_NFSACTONLINK_LEN (11)
  279. +
  280. +#endif /* !__NFS41_DAEMON_NFSV4_EA */
  281. diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
  282. index e084eda..ab36692 100644
  283. --- a/sys/nfs41_driver.c
  284. +++ b/sys/nfs41_driver.c
  285. @@ -39,6 +39,7 @@
  286.  #include "nfs41_np.h"
  287.  #include "nfs41_debug.h"
  288.  #include "nfs41_build_features.h"
  289. +#include "nfs_ea.h"
  290.  
  291.  // #define USE_ENTIRE_PATH_FOR_NETROOT 1
  292.  
  293. @@ -113,9 +114,9 @@ LONG open_owner_id = 1;
  294.  #define MILLISECONDS(milli) (((signed __int64)(milli)) * MICROSECONDS(1000L))
  295.  #define SECONDS(seconds) (((signed __int64)(seconds)) * MILLISECONDS(1000L))
  296.  
  297. -DECLARE_CONST_ANSI_STRING(NfsV3Attributes, "NfsV3Attributes");
  298. -DECLARE_CONST_ANSI_STRING(NfsSymlinkTargetName, "NfsSymlinkTargetName");
  299. -DECLARE_CONST_ANSI_STRING(NfsActOnLink, "NfsActOnLink");
  300. +DECLARE_CONST_ANSI_STRING(NfsV3Attributes, EA_NFSV3ATTRIBUTES);
  301. +DECLARE_CONST_ANSI_STRING(NfsSymlinkTargetName, EA_NFSSYMLINKTARGETNAME);
  302. +DECLARE_CONST_ANSI_STRING(NfsActOnLink, EA_NFSACTONLINK);
  303.  
  304.  INLINE BOOL AnsiStrEq(
  305.      IN const ANSI_STRING *lhs,
  306. --
  307. 2.45.1
  308.  
  309. From 70fd0d5dfd00f064f731485f8cdd09c455b27b21 Mon Sep 17 00:00:00 2001
  310. From: Roland Mainz <roland.mainz@nrubsig.org>
  311. Date: Tue, 30 Jul 2024 15:56:29 +0200
  312. Subject: [PATCH 2/5] daemon: set |args->ctime| only on success
  313.  
  314. |handle_setacl()|, |handle_nfs41_setattr()|, |handle_nfs41_link()|
  315. should set |args->ctime| only on succes, and assert for
  316. |FATTR4_WORD0_CHANGE| should only be tested in case of success.
  317.  
  318. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  319. ---
  320. daemon/acl.c     | 9 +++++----
  321.  daemon/setattr.c | 2 ++
  322.  2 files changed, 7 insertions(+), 4 deletions(-)
  323.  
  324. diff --git a/daemon/acl.c b/daemon/acl.c
  325. index 7ee91d9..3c5ba5b 100644
  326. --- a/daemon/acl.c
  327. +++ b/daemon/acl.c
  328. @@ -1424,15 +1424,16 @@ static int handle_setacl(void *daemon_context, nfs41_upcall *upcall)
  329.          status = nfs_to_windows_error(status, ERROR_NOT_SUPPORTED);
  330.      }
  331.      else {
  332. +        args->ctime = info.change;
  333. +
  334. +        EASSERT((info.attrmask.count >= 1) &&
  335. +            (info.attrmask.arr[0] & FATTR4_WORD0_CHANGE));
  336. +
  337.          if (DPRINTF_LEVEL_ENABLED(ACLLVL1)) {
  338.              print_nfs41_file_info("handle_setacl: nfs41_setattr() success info OUT:", &info);
  339.          }
  340.      }
  341.  
  342. -    EASSERT((info.attrmask.count >= 1) &&
  343. -        (info.attrmask.arr[0] & FATTR4_WORD0_CHANGE));
  344. -    args->ctime = info.change;
  345. -
  346.      if (args->query & DACL_SECURITY_INFORMATION)
  347.          free(nfs4_acl.aces);
  348.  out:
  349. diff --git a/daemon/setattr.c b/daemon/setattr.c
  350. index 97ec027..c111e0b 100644
  351. --- a/daemon/setattr.c
  352. +++ b/daemon/setattr.c
  353. @@ -143,6 +143,7 @@ static int handle_nfs41_setattr(void *daemon_context, setattr_upcall_args *args)
  354.          DPRINTF(1, ("nfs41_setattr() failed with error '%s'.\n",
  355.              nfs_error_string(status)));
  356.          status = nfs_to_windows_error(status, ERROR_NOT_SUPPORTED);
  357. +        goto out;
  358.      }
  359.      EASSERT((info.attrmask.count >= 1) &&
  360.          (info.attrmask.arr[0] & FATTR4_WORD0_CHANGE));
  361. @@ -487,6 +488,7 @@ static int handle_nfs41_link(void *daemon_context, setattr_upcall_args *args)
  362.          DPRINTF(1, ("nfs41_link() failed with error '%s'.\n",
  363.              nfs_error_string(status)));
  364.          status = nfs_to_windows_error(status, ERROR_INVALID_PARAMETER);
  365. +        goto out;
  366.      }
  367.      EASSERT((info.attrmask.count >= 1) &&
  368.          (info.attrmask.arr[0] & FATTR4_WORD0_CHANGE));
  369. --
  370. 2.45.1
  371.  
  372. From bd38668d6d2746d54a4810fa24fe2df76b5dbf92 Mon Sep 17 00:00:00 2001
  373. From: Dan Shelton <dan.f.shelton@gmail.com>
  374. Date: Tue, 30 Jul 2024 16:16:43 +0200
  375. Subject: [PATCH 3/5] daemon,libtirpc,sys: Replace __FUNCTION__ with C99
  376.  __func__
  377.  
  378. Replace __FUNCTION__ with C99 __func__.
  379.  
  380. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  381. ---
  382. daemon/callback_xdr.c       |  2 +-
  383.  libtirpc/src/getnetconfig.c | 12 ++++++------
  384.  libtirpc/src/svc.c          |  6 +++---
  385.  sys/nfs41_debug.h           | 10 +++++-----
  386.  4 files changed, 15 insertions(+), 15 deletions(-)
  387.  
  388. diff --git a/daemon/callback_xdr.c b/daemon/callback_xdr.c
  389. index 6eebc63..ae2ff27 100644
  390. --- a/daemon/callback_xdr.c
  391. +++ b/daemon/callback_xdr.c
  392. @@ -26,7 +26,7 @@
  393.  
  394.  
  395.  #define CBXLVL 2 /* dprintf level for callback xdr logging */
  396. -#define CBX_ERR(msg) DPRINTF((CBXLVL),( __FUNCTION__ ": failed at " msg "\n"))
  397. +#define CBX_ERR(msg) DPRINTF(CBXLVL, ("'%s': failed at '%s'\n", __func__, (msg)))
  398.  
  399.  
  400.  /* common types */
  401. diff --git a/libtirpc/src/getnetconfig.c b/libtirpc/src/getnetconfig.c
  402. index 674582f..15e9de1 100644
  403. --- a/libtirpc/src/getnetconfig.c
  404. +++ b/libtirpc/src/getnetconfig.c
  405. @@ -302,14 +302,14 @@ void *handlep;
  406.      list->next = NULL;
  407.      list->ncp->nc_lookups = NULL;
  408.      list->linep = stringp;
  409. -       wintirpc_debug("%s: before parse: &list->linep %p, list->linep %p, stringp %p\n", __FUNCTION__, &list->linep, list->linep, stringp);
  410. +       wintirpc_debug("%s: before parse: &list->linep %p, list->linep %p, stringp %p\n", __func__, &list->linep, list->linep, stringp);
  411.      if (parse_ncp(stringp, list->ncp) == -1) {
  412.                 free(stringp);
  413.                 free(np);
  414.                 free(list);
  415.                 return (NULL);
  416.      } else {
  417. -               wintirpc_debug("%s: after  parse: list->linep %p, stringp %p\n", __FUNCTION__, list->linep, stringp);
  418. +               wintirpc_debug("%s: after  parse: list->linep %p, stringp %p\n", __func__, list->linep, stringp);
  419.                 /*
  420.                  * If this is the first entry that's been read, it is the head of
  421.                  * the list.  If not, put the entry at the end of the list.
  422. @@ -526,11 +526,11 @@ struct netconfig *ncp;    /* where to put results */
  423.      char    *lasts;
  424.  
  425.      nc_error = NC_BADFILE;     /* nearly anything that breaks is for this reason */
  426. -       wintirpc_debug("%s: The last character being chopped is '%02x'\n", __FUNCTION__, stringp[strlen(stringp)-1]);
  427. -       wintirpc_debug("%s: The string before chopping is '%s'\n", __FUNCTION__, stringp);
  428. +       wintirpc_debug("%s: The last character being chopped is '%02x'\n", __func__, stringp[strlen(stringp)-1]);
  429. +       wintirpc_debug("%s: The string before chopping is '%s'\n", __func__, stringp);
  430.      stringp[strlen(stringp)-1] = '\0'; /* get rid of newline */
  431. -       wintirpc_debug("%s: The last character after chopping is '%02x'\n", __FUNCTION__, stringp[strlen(stringp)-1]);
  432. -       wintirpc_debug("%s: The string after  chopping is '%s'\n", __FUNCTION__, stringp);
  433. +       wintirpc_debug("%s: The last character after chopping is '%02x'\n", __func__, stringp[strlen(stringp)-1]);
  434. +       wintirpc_debug("%s: The string after  chopping is '%s'\n", __func__, stringp);
  435.      /* netid */
  436.      if ((ncp->nc_netid = strtok_r(stringp, "\t ", &lasts)) == NULL) {
  437.                 return (-1);
  438. diff --git a/libtirpc/src/svc.c b/libtirpc/src/svc.c
  439. index 7bfc1cc..6826831 100644
  440. --- a/libtirpc/src/svc.c
  441. +++ b/libtirpc/src/svc.c
  442. @@ -119,7 +119,7 @@ xprt_register (xprt)
  443.      svc_maxfd = max (svc_maxfd, sock);
  444.    }
  445.  #else
  446. -  fprintf(stderr, "%s: Yikes!  Figure out __svc_xports[] issue!!\n", __FUNCTION__);
  447. +  fprintf(stderr, "%s: Yikes!  Figure out __svc_xports[] issue!!\n", __func__);
  448.  #endif
  449.    rwlock_unlock (&svc_fd_lock);
  450.  }
  451. @@ -165,7 +165,7 @@ bool_t dolock;
  452.    if (dolock)
  453.      rwlock_unlock (&svc_fd_lock);
  454.  #else
  455. -  fprintf(stderr, "%s: Yikes!  Figure out __svc_xports[] issue!!\n", __FUNCTION__);
  456. +  fprintf(stderr, "%s: Yikes!  Figure out __svc_xports[] issue!!\n", __func__);
  457.  #endif
  458.  }
  459.  
  460. @@ -633,7 +633,7 @@ svc_getreqset (readfds)
  461.         }
  462.      }
  463.  #else
  464. -       fprintf(stderr, "%s: Yikes!\n", __FUNCTION__);
  465. +       fprintf(stderr, "%s: Yikes!\n", __func__);
  466.  #endif
  467.  }
  468.  
  469. diff --git a/sys/nfs41_debug.h b/sys/nfs41_debug.h
  470. index 463db12..ea11dd6 100644
  471. --- a/sys/nfs41_debug.h
  472. +++ b/sys/nfs41_debug.h
  473. @@ -63,17 +63,17 @@ const char *fsctl2string(ULONG fsctl);
  474.  
  475.  #define DbgEn() DbgPrintEx(DPFLTR_IHVNETWORK_ID, DPFLTR_ERROR_LEVEL, \
  476.          "--> [%s] [%04x] %s\n", _DRIVER_NAME_, PsGetCurrentProcessShortDebugId(), \
  477. -        __FUNCTION__); try {
  478. +        __func__); try {
  479.  
  480.  #define DbgEx() DbgPrintEx(DPFLTR_IHVNETWORK_ID, DPFLTR_ERROR_LEVEL, \
  481.          "<-- [%s] [%04x] %s status = %08lx\n", _DRIVER_NAME_, PsGetCurrentProcessShortDebugId(), \
  482. -        __FUNCTION__, status); \
  483. +        __func__, status); \
  484.          } except (EXCEPTION_EXECUTE_HANDLER) { \
  485.              status = GetExceptionCode() ; \
  486.              DbgP("Exception encountered with value = Ox%x\n", status); \
  487.          }
  488.  #define DbgR() DbgPrintEx(DPFLTR_IHVNETWORK_ID, DPFLTR_ERROR_LEVEL, \
  489. -        "<-- [%s] [%04x] %s\n", _DRIVER_NAME_, PsGetCurrentProcessShortDebugId(), __FUNCTION__); \
  490. +        "<-- [%s] [%04x] %s\n", _DRIVER_NAME_, PsGetCurrentProcessShortDebugId(), __func__); \
  491.          } except (EXCEPTION_EXECUTE_HANDLER) { \
  492.              NTSTATUS exc_status; \
  493.              exc_status = GetExceptionCode() ; \
  494. @@ -97,9 +97,9 @@ const char *fsctl2string(ULONG fsctl);
  495.  #define PNFS_FLTR_ID        DPFLTR_IHVDRIVER_ID
  496.  
  497.  #define DbgEnter()      DbgPrintEx(PNFS_FLTR_ID, DPFLTR_MASK | DBG_DISP_IN, "%s*** %s ***\n", \
  498. -                                PNFS_TRACE_TAG, __FUNCTION__);
  499. +                                PNFS_TRACE_TAG, __func__);
  500.  #define DbgExit(status) DbgPrintEx(PNFS_FLTR_ID, DPFLTR_MASK | DBG_DISP_OUT, "%s<-- %s <-- 0x%08lx\n", \
  501. -                                PNFS_TRACE_TAG, __FUNCTION__, status);
  502. +                                PNFS_TRACE_TAG, __func__, status);
  503.  ULONG
  504.  dprintk(
  505.      IN PCHAR func,
  506. --
  507. 2.45.1
  508.  
  509. From 562423a673f538a8da30fbf62a8fc7b62b9e69b1 Mon Sep 17 00:00:00 2001
  510. From: Dan Shelton <dan.f.shelton@gmail.com>
  511. Date: Tue, 30 Jul 2024 16:50:58 +0200
  512. Subject: [PATCH 4/5] sys: Make all internal driver functions static
  513.  
  514. Make all internal driver functions static, so static
  515. analysis producess less false-positives.
  516.  
  517. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  518. ---
  519. sys/nfs41_driver.c | 334 ++++++++++++++++++++++++---------------------
  520.  1 file changed, 182 insertions(+), 152 deletions(-)
  521.  
  522. diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
  523. index ab36692..920b34b 100644
  524. --- a/sys/nfs41_driver.c
  525. +++ b/sys/nfs41_driver.c
  526. @@ -518,10 +518,36 @@ typedef enum _NULMRX_STORAGE_TYPE_CODES {
  527.  nfs41_init_driver_state nfs41_init_state = NFS41_INIT_DRIVER_STARTABLE;
  528.  nfs41_start_driver_state nfs41_start_state = NFS41_START_DRIVER_STARTABLE;
  529.  
  530. -NTSTATUS map_readwrite_errors(DWORD status);
  531. -
  532. -
  533. -void copy_nfs41_mount_config(NFS41_MOUNT_CONFIG *dest, NFS41_MOUNT_CONFIG *src)
  534. +/* Local prototypes */
  535. +static NTSTATUS map_mount_errors(
  536. +    DWORD status);
  537. +static NTSTATUS map_sec_flavor(
  538. +    IN PUNICODE_STRING sec_flavor_name,
  539. +    OUT PDWORD sec_flavor);
  540. +static NTSTATUS map_open_errors(
  541. +    DWORD status,
  542. +    USHORT len);
  543. +static NTSTATUS map_close_errors(
  544. +    DWORD status);
  545. +static NTSTATUS map_querydir_errors(
  546. +    DWORD status);
  547. +static NTSTATUS map_volume_errors(
  548. +    DWORD status);
  549. +static NTSTATUS map_setea_error(
  550. +    DWORD error);
  551. +static NTSTATUS map_query_acl_error(
  552. +    DWORD error);
  553. +static NTSTATUS map_queryfile_error(
  554. +    DWORD error);
  555. +static NTSTATUS map_setfile_error(
  556. +    DWORD error);
  557. +static NTSTATUS map_readwrite_errors(DWORD status);
  558. +static NTSTATUS map_lock_errors(
  559. +    DWORD status);
  560. +static NTSTATUS map_symlink_errors(
  561. +    NTSTATUS status);
  562. +
  563. +static void copy_nfs41_mount_config(NFS41_MOUNT_CONFIG *dest, NFS41_MOUNT_CONFIG *src)
  564.  {
  565.      RtlCopyMemory(dest, src, sizeof(NFS41_MOUNT_CONFIG));
  566.      dest->SrvName.Buffer = dest->srv_buffer;
  567. @@ -529,7 +555,7 @@ void copy_nfs41_mount_config(NFS41_MOUNT_CONFIG *dest, NFS41_MOUNT_CONFIG *src)
  568.      dest->SecFlavor.Buffer = dest->sec_flavor_buffer;
  569.  }
  570.  
  571. -void print_debug_header(
  572. +static void print_debug_header(
  573.      PRX_CONTEXT RxContext)
  574.  {
  575.  
  576. @@ -553,7 +579,7 @@ void print_debug_header(
  577.  
  578.  /* convert strings from unicode -> ansi during marshalling to
  579.   * save space in the upcall buffers and avoid extra copies */
  580. -INLINE ULONG length_as_utf8(
  581. +static INLINE ULONG length_as_utf8(
  582.      PCUNICODE_STRING str)
  583.  {
  584.      ULONG ActualCount = 0;
  585. @@ -561,7 +587,7 @@ INLINE ULONG length_as_utf8(
  586.      return sizeof(str->MaximumLength) + ActualCount + sizeof(UNICODE_NULL);
  587.  }
  588.  
  589. -NTSTATUS marshall_unicode_as_utf8(
  590. +static NTSTATUS marshall_unicode_as_utf8(
  591.      IN OUT unsigned char **pos,
  592.      IN PCUNICODE_STRING str)
  593.  {
  594. @@ -605,7 +631,7 @@ out:
  595.      return status;
  596.  }
  597.  
  598. -NTSTATUS marshal_nfs41_header(
  599. +static NTSTATUS marshal_nfs41_header(
  600.      nfs41_updowncall_entry *entry,
  601.      unsigned char *buf,
  602.      ULONG buf_len,
  603. @@ -656,7 +682,7 @@ out:
  604.      return status;
  605.  }
  606.  
  607. -const char* secflavorop2name(
  608. +static const char* secflavorop2name(
  609.      DWORD sec_flavor)
  610.  {
  611.      switch(sec_flavor) {
  612. @@ -668,7 +694,8 @@ const char* secflavorop2name(
  613.  
  614.      return "UNKNOWN FLAVOR";
  615.  }
  616. -NTSTATUS marshal_nfs41_mount(
  617. +
  618. +static NTSTATUS marshal_nfs41_mount(
  619.      nfs41_updowncall_entry *entry,
  620.      unsigned char *buf,
  621.      ULONG buf_len,
  622. @@ -720,7 +747,7 @@ out:
  623.      return status;
  624.  }
  625.  
  626. -NTSTATUS marshal_nfs41_unmount(
  627. +static NTSTATUS marshal_nfs41_unmount(
  628.      nfs41_updowncall_entry *entry,
  629.      unsigned char *buf,
  630.      ULONG buf_len,
  631. @@ -729,7 +756,7 @@ NTSTATUS marshal_nfs41_unmount(
  632.      return marshal_nfs41_header(entry, buf, buf_len, len);
  633.  }
  634.  
  635. -NTSTATUS marshal_nfs41_open(
  636. +static NTSTATUS marshal_nfs41_open(
  637.      nfs41_updowncall_entry *entry,
  638.      unsigned char *buf,
  639.      ULONG buf_len,
  640. @@ -827,7 +854,7 @@ out:
  641.      return status;
  642.  }
  643.  
  644. -NTSTATUS marshal_nfs41_rw(
  645. +static NTSTATUS marshal_nfs41_rw(
  646.      nfs41_updowncall_entry *entry,
  647.      unsigned char *buf,
  648.      ULONG buf_len,
  649. @@ -893,7 +920,7 @@ out:
  650.      return status;
  651.  }
  652.  
  653. -NTSTATUS marshal_nfs41_lock(
  654. +static NTSTATUS marshal_nfs41_lock(
  655.      nfs41_updowncall_entry *entry,
  656.      unsigned char *buf,
  657.      ULONG buf_len,
  658. @@ -930,7 +957,7 @@ out:
  659.      return status;
  660.  }
  661.  
  662. -NTSTATUS marshal_nfs41_unlock(
  663. +static NTSTATUS marshal_nfs41_unlock(
  664.      nfs41_updowncall_entry *entry,
  665.      unsigned char *buf,
  666.      ULONG buf_len,
  667. @@ -971,7 +998,7 @@ out:
  668.      return status;
  669.  }
  670.  
  671. -NTSTATUS marshal_nfs41_close(
  672. +static NTSTATUS marshal_nfs41_close(
  673.      nfs41_updowncall_entry *entry,
  674.      unsigned char *buf,
  675.      ULONG buf_len,
  676. @@ -1014,7 +1041,7 @@ out:
  677.      return status;
  678.  }
  679.  
  680. -NTSTATUS marshal_nfs41_dirquery(
  681. +static NTSTATUS marshal_nfs41_dirquery(
  682.      nfs41_updowncall_entry *entry,
  683.      unsigned char *buf,
  684.      ULONG buf_len,
  685. @@ -1081,7 +1108,7 @@ out:
  686.      return status;
  687.  }
  688.  
  689. -NTSTATUS marshal_nfs41_filequery(
  690. +static NTSTATUS marshal_nfs41_filequery(
  691.      nfs41_updowncall_entry *entry,
  692.      unsigned char *buf,
  693.      ULONG buf_len,
  694. @@ -1116,7 +1143,7 @@ out:
  695.      return status;
  696.  }
  697.  
  698. -NTSTATUS marshal_nfs41_fileset(
  699. +static NTSTATUS marshal_nfs41_fileset(
  700.      nfs41_updowncall_entry *entry,
  701.      unsigned char *buf,
  702.      ULONG buf_len,
  703. @@ -1153,7 +1180,7 @@ out:
  704.      return status;
  705.  }
  706.  
  707. -NTSTATUS marshal_nfs41_easet(
  708. +static NTSTATUS marshal_nfs41_easet(
  709.      nfs41_updowncall_entry *entry,
  710.      unsigned char *buf,
  711.      ULONG buf_len,
  712. @@ -1191,7 +1218,7 @@ out:
  713.      return status;
  714.  }
  715.  
  716. -NTSTATUS marshal_nfs41_eaget(
  717. +static NTSTATUS marshal_nfs41_eaget(
  718.      nfs41_updowncall_entry *entry,
  719.      unsigned char *buf,
  720.      ULONG buf_len,
  721. @@ -1240,7 +1267,7 @@ out:
  722.      return status;
  723.  }
  724.  
  725. -NTSTATUS marshal_nfs41_symlink(
  726. +static NTSTATUS marshal_nfs41_symlink(
  727.      nfs41_updowncall_entry *entry,
  728.      unsigned char *buf,
  729.      ULONG buf_len,
  730. @@ -1281,7 +1308,7 @@ out:
  731.      return status;
  732.  }
  733.  
  734. -NTSTATUS marshal_nfs41_volume(
  735. +static NTSTATUS marshal_nfs41_volume(
  736.      nfs41_updowncall_entry *entry,
  737.      unsigned char *buf,
  738.      ULONG buf_len,
  739. @@ -1311,7 +1338,7 @@ out:
  740.      return status;
  741.  }
  742.  
  743. -NTSTATUS marshal_nfs41_getacl(
  744. +static NTSTATUS marshal_nfs41_getacl(
  745.      nfs41_updowncall_entry *entry,
  746.      unsigned char *buf,
  747.      ULONG buf_len,
  748. @@ -1341,7 +1368,7 @@ out:
  749.      return status;
  750.  }
  751.  
  752. -NTSTATUS marshal_nfs41_setacl(
  753. +static NTSTATUS marshal_nfs41_setacl(
  754.      nfs41_updowncall_entry *entry,
  755.      unsigned char *buf,
  756.      ULONG buf_len,
  757. @@ -1377,7 +1404,7 @@ out:
  758.      return status;
  759.  }
  760.  
  761. -NTSTATUS marshal_nfs41_shutdown(
  762. +static NTSTATUS marshal_nfs41_shutdown(
  763.      nfs41_updowncall_entry *entry,
  764.      unsigned char *buf,
  765.      ULONG buf_len,
  766. @@ -1386,7 +1413,7 @@ NTSTATUS marshal_nfs41_shutdown(
  767.      return marshal_nfs41_header(entry, buf, buf_len, len);
  768.  }
  769.  
  770. -void nfs41_invalidate_cache (
  771. +static void nfs41_invalidate_cache(
  772.      IN PRX_CONTEXT RxContext)
  773.  {
  774.      PLOWIO_CONTEXT LowIoContext = &RxContext->LowIoContext;
  775. @@ -1405,7 +1432,7 @@ void nfs41_invalidate_cache (
  776.              srv_open->Key, ULongToPtr(flag));
  777.  }
  778.  
  779. -NTSTATUS handle_upcall(
  780. +static NTSTATUS handle_upcall(
  781.      IN PRX_CONTEXT RxContext,
  782.      IN nfs41_updowncall_entry *entry,
  783.      OUT ULONG *len)
  784. @@ -1540,7 +1567,7 @@ out:
  785.      return status;
  786.  }
  787.  
  788. -NTSTATUS nfs41_UpcallCreate(
  789. +static NTSTATUS nfs41_UpcallCreate(
  790.      IN DWORD opcode,
  791.      IN PSECURITY_CLIENT_CONTEXT clnt_sec_ctx,
  792.      IN HANDLE session,
  793. @@ -1622,7 +1649,7 @@ out:
  794.      return status;
  795.  }
  796.  
  797. -void nfs41_UpcallDestroy(nfs41_updowncall_entry *entry)
  798. +static void nfs41_UpcallDestroy(nfs41_updowncall_entry *entry)
  799.  {
  800.      if (!entry)
  801.          return;
  802. @@ -1635,7 +1662,7 @@ void nfs41_UpcallDestroy(nfs41_updowncall_entry *entry)
  803.  }
  804.  
  805.  
  806. -NTSTATUS nfs41_UpcallWaitForReply(
  807. +static NTSTATUS nfs41_UpcallWaitForReply(
  808.      IN nfs41_updowncall_entry *entry,
  809.      IN DWORD secs)
  810.  {
  811. @@ -1695,7 +1722,7 @@ out:
  812.      return status;
  813.  }
  814.  
  815. -NTSTATUS nfs41_upcall(
  816. +static NTSTATUS nfs41_upcall(
  817.      IN PRX_CONTEXT RxContext)
  818.  {
  819.      NTSTATUS status = STATUS_SUCCESS;
  820. @@ -1762,7 +1789,7 @@ out:
  821.      return status;
  822.  }
  823.  
  824. -void unmarshal_nfs41_header(
  825. +static void unmarshal_nfs41_header(
  826.      nfs41_updowncall_entry *tmp,
  827.      unsigned char **buf)
  828.  {
  829. @@ -1784,7 +1811,7 @@ void unmarshal_nfs41_header(
  830.  #endif
  831.  }
  832.  
  833. -void unmarshal_nfs41_mount(
  834. +static void unmarshal_nfs41_mount(
  835.      nfs41_updowncall_entry *cur,
  836.      unsigned char **buf)
  837.  {
  838. @@ -1801,7 +1828,7 @@ void unmarshal_nfs41_mount(
  839.  #endif
  840.  }
  841.  
  842. -VOID unmarshal_nfs41_setattr(
  843. +static void unmarshal_nfs41_setattr(
  844.      nfs41_updowncall_entry *cur,
  845.      PULONGLONG dest_buf,
  846.      unsigned char **buf)
  847. @@ -1812,7 +1839,7 @@ VOID unmarshal_nfs41_setattr(
  848.  #endif
  849.  }
  850.  
  851. -NTSTATUS unmarshal_nfs41_rw(
  852. +static NTSTATUS unmarshal_nfs41_rw(
  853.      nfs41_updowncall_entry *cur,
  854.      unsigned char **buf)
  855.  {
  856. @@ -1844,7 +1871,7 @@ NTSTATUS unmarshal_nfs41_rw(
  857.      return status;
  858.  }
  859.  
  860. -NTSTATUS unmarshal_nfs41_open(
  861. +static NTSTATUS unmarshal_nfs41_open(
  862.      nfs41_updowncall_entry *cur,
  863.      unsigned char **buf)
  864.  {
  865. @@ -1914,7 +1941,7 @@ out:
  866.      return status;
  867.  }
  868.  
  869. -NTSTATUS unmarshal_nfs41_dirquery(
  870. +static NTSTATUS unmarshal_nfs41_dirquery(
  871.      nfs41_updowncall_entry *cur,
  872.      unsigned char **buf)
  873.  {
  874. @@ -1941,7 +1968,7 @@ NTSTATUS unmarshal_nfs41_dirquery(
  875.      return status;
  876.  }
  877.  
  878. -void unmarshal_nfs41_attrget(
  879. +static void unmarshal_nfs41_attrget(
  880.      nfs41_updowncall_entry *cur,
  881.      PVOID attr_value,
  882.      ULONG *attr_len,
  883. @@ -1959,7 +1986,7 @@ void unmarshal_nfs41_attrget(
  884.      *buf += buf_len;
  885.  }
  886.  
  887. -void unmarshal_nfs41_eaget(
  888. +static void unmarshal_nfs41_eaget(
  889.      nfs41_updowncall_entry *cur,
  890.      unsigned char **buf)
  891.  {
  892. @@ -1973,7 +2000,7 @@ void unmarshal_nfs41_eaget(
  893.      }
  894.  }
  895.  
  896. -void unmarshal_nfs41_getattr(
  897. +static void unmarshal_nfs41_getattr(
  898.      nfs41_updowncall_entry *cur,
  899.      unsigned char **buf)
  900.  {
  901. @@ -1985,7 +2012,7 @@ void unmarshal_nfs41_getattr(
  902.  #endif
  903.  }
  904.  
  905. -NTSTATUS unmarshal_nfs41_getacl(
  906. +static NTSTATUS unmarshal_nfs41_getacl(
  907.      nfs41_updowncall_entry *cur,
  908.      unsigned char **buf)
  909.  {
  910. @@ -2009,7 +2036,7 @@ out:
  911.      return status;
  912.  }
  913.  
  914. -void unmarshal_nfs41_symlink(
  915. +static void unmarshal_nfs41_symlink(
  916.      nfs41_updowncall_entry *cur,
  917.      unsigned char **buf)
  918.  {
  919. @@ -2027,7 +2054,7 @@ void unmarshal_nfs41_symlink(
  920.      cur->u.Symlink.target->Length -= sizeof(UNICODE_NULL);
  921.  }
  922.  
  923. -NTSTATUS nfs41_downcall(
  924. +static NTSTATUS nfs41_downcall(
  925.      IN PRX_CONTEXT RxContext)
  926.  {
  927.      NTSTATUS status = STATUS_SUCCESS;
  928. @@ -2164,7 +2191,7 @@ out:
  929.      return status;
  930.  }
  931.  
  932. -NTSTATUS nfs41_shutdown_daemon(
  933. +static NTSTATUS nfs41_shutdown_daemon(
  934.      DWORD version)
  935.  {
  936.      NTSTATUS status = STATUS_SUCCESS;
  937. @@ -2188,7 +2215,7 @@ out:
  938.      return status;
  939.  }
  940.  
  941. -NTSTATUS SharedMemoryInit(
  942. +static NTSTATUS SharedMemoryInit(
  943.      OUT PHANDLE phSection)
  944.  {
  945.      NTSTATUS status;
  946. @@ -2238,7 +2265,7 @@ out:
  947.      return status;
  948.  }
  949.  
  950. -NTSTATUS SharedMemoryFree(
  951. +static NTSTATUS SharedMemoryFree(
  952.      IN HANDLE hSection)
  953.  {
  954.      NTSTATUS status;
  955. @@ -2248,7 +2275,7 @@ NTSTATUS SharedMemoryFree(
  956.      return status;
  957.  }
  958.  
  959. -NTSTATUS nfs41_Start(
  960. +static NTSTATUS nfs41_Start(
  961.      IN OUT PRX_CONTEXT RxContext,
  962.      IN OUT PRDBSS_DEVICE_OBJECT dev)
  963.  {
  964. @@ -2272,7 +2299,7 @@ out:
  965.      return status;
  966.  }
  967.  
  968. -NTSTATUS nfs41_Stop(
  969. +static NTSTATUS nfs41_Stop(
  970.      IN OUT PRX_CONTEXT RxContext,
  971.      IN OUT PRDBSS_DEVICE_OBJECT dev)
  972.  {
  973. @@ -2284,7 +2311,7 @@ NTSTATUS nfs41_Stop(
  974.      return status;
  975.  }
  976.  
  977. -NTSTATUS GetConnectionHandle(
  978. +static NTSTATUS GetConnectionHandle(
  979.      IN PUNICODE_STRING ConnectionName,
  980.      IN PVOID EaBuffer,
  981.      IN ULONG EaLength,
  982. @@ -2313,7 +2340,7 @@ NTSTATUS GetConnectionHandle(
  983.      return status;
  984.  }
  985.  
  986. -NTSTATUS nfs41_GetConnectionInfoFromBuffer(
  987. +static NTSTATUS nfs41_GetConnectionInfoFromBuffer(
  988.      IN PVOID Buffer,
  989.      IN ULONG BufferLen,
  990.      OUT PUNICODE_STRING pConnectionName,
  991. @@ -2370,7 +2397,7 @@ out:
  992.      return status;
  993.  }
  994.  
  995. -NTSTATUS nfs41_CreateConnection(
  996. +static NTSTATUS nfs41_CreateConnection(
  997.      IN PRX_CONTEXT RxContext,
  998.      OUT PBOOLEAN PostToFsp)
  999.  {
  1000. @@ -2410,7 +2437,7 @@ out:
  1001.  }
  1002.  
  1003.  #ifdef ENABLE_TIMINGS
  1004. -void print_op_stat(
  1005. +static void print_op_stat(
  1006.      const char *op_str,
  1007.      nfs41_timings *time, BOOLEAN clear)
  1008.  {
  1009. @@ -2425,7 +2452,7 @@ void print_op_stat(
  1010.      }
  1011.  }
  1012.  #endif
  1013. -NTSTATUS nfs41_unmount(
  1014. +static NTSTATUS nfs41_unmount(
  1015.      HANDLE session,
  1016.      DWORD version,
  1017.      DWORD timeout)
  1018. @@ -2471,7 +2498,7 @@ out:
  1019.      return status;
  1020.  }
  1021.  
  1022. -NTSTATUS nfs41_DeleteConnection (
  1023. +static NTSTATUS nfs41_DeleteConnection (
  1024.      IN PRX_CONTEXT RxContext,
  1025.      OUT PBOOLEAN PostToFsp)
  1026.  {
  1027. @@ -2533,7 +2560,7 @@ out:
  1028.      return status;
  1029.  }
  1030.  
  1031. -NTSTATUS nfs41_DevFcbXXXControlFile(
  1032. +static NTSTATUS nfs41_DevFcbXXXControlFile(
  1033.      IN OUT PRX_CONTEXT RxContext)
  1034.  {
  1035.      NTSTATUS status = STATUS_INVALID_DEVICE_REQUEST;
  1036. @@ -2669,7 +2696,7 @@ NTSTATUS nfs41_DevFcbXXXControlFile(
  1037.      return status;
  1038.  }
  1039.  
  1040. -NTSTATUS _nfs41_CreateSrvCall(
  1041. +static NTSTATUS _nfs41_CreateSrvCall(
  1042.      PMRX_SRVCALL_CALLBACK_CONTEXT pCallbackContext)
  1043.  {
  1044.      NTSTATUS status = STATUS_SUCCESS;
  1045. @@ -2730,7 +2757,7 @@ out:
  1046.      return status;
  1047.  }
  1048.  
  1049. -NTSTATUS nfs41_CreateSrvCall(
  1050. +static NTSTATUS nfs41_CreateSrvCall(
  1051.      PMRX_SRV_CALL pSrvCall,
  1052.      PMRX_SRVCALL_CALLBACK_CONTEXT pCallbackContext)
  1053.  {
  1054. @@ -2760,7 +2787,7 @@ NTSTATUS nfs41_CreateSrvCall(
  1055.      return status;
  1056.  }
  1057.  
  1058. -NTSTATUS nfs41_SrvCallWinnerNotify(
  1059. +static NTSTATUS nfs41_SrvCallWinnerNotify(
  1060.      IN OUT PMRX_SRV_CALL pSrvCall,
  1061.      IN BOOLEAN ThisMinirdrIsTheWinner,
  1062.      IN OUT PVOID pSrvCallContext)
  1063. @@ -2780,7 +2807,7 @@ out:
  1064.      return status;
  1065.  }
  1066.  
  1067. -NTSTATUS map_mount_errors(
  1068. +static NTSTATUS map_mount_errors(
  1069.      DWORD status)
  1070.  {
  1071.      switch (status) {
  1072. @@ -2800,7 +2827,7 @@ NTSTATUS map_mount_errors(
  1073.      }
  1074.  }
  1075.  
  1076. -NTSTATUS nfs41_mount(
  1077. +static NTSTATUS nfs41_mount(
  1078.      PNFS41_MOUNT_CONFIG config,
  1079.      DWORD sec_flavor,
  1080.      PHANDLE session,
  1081. @@ -2851,7 +2878,7 @@ out:
  1082.  
  1083.  /* TODO: move mount config stuff to another file -cbodley */
  1084.  
  1085. -void nfs41_MountConfig_InitDefaults(
  1086. +static void nfs41_MountConfig_InitDefaults(
  1087.      OUT PNFS41_MOUNT_CONFIG Config)
  1088.  {
  1089.      RtlZeroMemory(Config, sizeof(NFS41_MOUNT_CONFIG));
  1090. @@ -2877,7 +2904,7 @@ void nfs41_MountConfig_InitDefaults(
  1091.      Config->createmode.mode = NFS41_DRIVER_DEFAULT_CREATE_MODE;
  1092.  }
  1093.  
  1094. -NTSTATUS nfs41_MountConfig_ParseBoolean(
  1095. +static NTSTATUS nfs41_MountConfig_ParseBoolean(
  1096.      IN PFILE_FULL_EA_INFORMATION Option,
  1097.      IN PUNICODE_STRING usValue,
  1098.      IN BOOLEAN negate_val,
  1099. @@ -2899,8 +2926,7 @@ NTSTATUS nfs41_MountConfig_ParseBoolean(
  1100.  
  1101.  
  1102.  /* Parse |signed| integer value */
  1103. -static
  1104. -NTSTATUS nfs41_MountConfig_ParseINT64(
  1105. +static NTSTATUS nfs41_MountConfig_ParseINT64(
  1106.      IN PFILE_FULL_EA_INFORMATION Option,
  1107.      IN PUNICODE_STRING usValue,
  1108.      OUT INT64 *outValue,
  1109. @@ -2933,8 +2959,7 @@ NTSTATUS nfs41_MountConfig_ParseINT64(
  1110.  }
  1111.  
  1112.  /* Parse |unsigned| integer value */
  1113. -static
  1114. -NTSTATUS nfs41_MountConfig_ParseDword(
  1115. +static NTSTATUS nfs41_MountConfig_ParseDword(
  1116.      IN PFILE_FULL_EA_INFORMATION Option,
  1117.      IN PUNICODE_STRING usValue,
  1118.      OUT PDWORD outValue,
  1119. @@ -2955,7 +2980,7 @@ NTSTATUS nfs41_MountConfig_ParseDword(
  1120.      return status;
  1121.  }
  1122.  
  1123. -NTSTATUS nfs41_MountConfig_ParseOptions(
  1124. +static NTSTATUS nfs41_MountConfig_ParseOptions(
  1125.      IN PFILE_FULL_EA_INFORMATION EaBuffer,
  1126.      IN ULONG EaLength,
  1127.      IN OUT PNFS41_MOUNT_CONFIG Config)
  1128. @@ -3145,7 +3170,7 @@ out:
  1129.      return status;
  1130.  }
  1131.  
  1132. -NTSTATUS has_nfs_prefix(
  1133. +static NTSTATUS has_nfs_prefix(
  1134.      IN PUNICODE_STRING SrvCallName,
  1135.      IN PUNICODE_STRING NetRootName,
  1136.      OUT BOOLEAN *pubfh_prefix)
  1137. @@ -3223,7 +3248,7 @@ NTSTATUS has_nfs_prefix(
  1138.      return status;
  1139.  }
  1140.  
  1141. -NTSTATUS map_sec_flavor(
  1142. +static NTSTATUS map_sec_flavor(
  1143.      IN PUNICODE_STRING sec_flavor_name,
  1144.      OUT PDWORD sec_flavor)
  1145.  {
  1146. @@ -3239,7 +3264,7 @@ NTSTATUS map_sec_flavor(
  1147.      return STATUS_SUCCESS;
  1148.  }
  1149.  
  1150. -NTSTATUS nfs41_GetLUID(
  1151. +static NTSTATUS nfs41_GetLUID(
  1152.      PLUID id)
  1153.  {
  1154.      NTSTATUS status = STATUS_SUCCESS;
  1155. @@ -3280,7 +3305,7 @@ release_sec_ctx:
  1156.      return status;
  1157.  }
  1158.  
  1159. -NTSTATUS nfs41_get_sec_ctx(
  1160. +static NTSTATUS nfs41_get_sec_ctx(
  1161.      IN enum _SECURITY_IMPERSONATION_LEVEL level,
  1162.      OUT PSECURITY_CLIENT_CONTEXT out_ctx)
  1163.  {
  1164. @@ -3314,7 +3339,7 @@ NTSTATUS nfs41_get_sec_ctx(
  1165.      return status;
  1166.  }
  1167.  
  1168. -NTSTATUS nfs41_CreateVNetRoot(
  1169. +static NTSTATUS nfs41_CreateVNetRoot(
  1170.      IN OUT PMRX_CREATENETROOT_CONTEXT pCreateNetRootContext)
  1171.  {
  1172.      NTSTATUS status = STATUS_SUCCESS;
  1173. @@ -3683,7 +3708,7 @@ out:
  1174.      return status;
  1175.  }
  1176.  
  1177. -VOID nfs41_ExtractNetRootName(
  1178. +static VOID nfs41_ExtractNetRootName(
  1179.      IN PUNICODE_STRING FilePathName,
  1180.      IN PMRX_SRV_CALL SrvCall,
  1181.      OUT PUNICODE_STRING NetRootName,
  1182. @@ -3720,7 +3745,7 @@ VOID nfs41_ExtractNetRootName(
  1183.  
  1184.  }
  1185.  
  1186. -NTSTATUS nfs41_FinalizeSrvCall(
  1187. +static NTSTATUS nfs41_FinalizeSrvCall(
  1188.      PMRX_SRV_CALL pSrvCall,
  1189.      BOOLEAN Force)
  1190.  {
  1191. @@ -3747,7 +3772,7 @@ out:
  1192.      return status;
  1193.  }
  1194.  
  1195. -NTSTATUS nfs41_FinalizeNetRoot(
  1196. +static NTSTATUS nfs41_FinalizeNetRoot(
  1197.      IN OUT PMRX_NET_ROOT pNetRoot,
  1198.      IN PBOOLEAN ForceDisconnect)
  1199.  {
  1200. @@ -3852,7 +3877,7 @@ out:
  1201.  }
  1202.  
  1203.  
  1204. -NTSTATUS nfs41_FinalizeVNetRoot(
  1205. +static NTSTATUS nfs41_FinalizeVNetRoot(
  1206.      IN OUT PMRX_V_NET_ROOT pVNetRoot,
  1207.      IN PBOOLEAN ForceDisconnect)
  1208.  {
  1209. @@ -3870,7 +3895,7 @@ NTSTATUS nfs41_FinalizeVNetRoot(
  1210.      return status;
  1211.  }
  1212.  
  1213. -BOOLEAN isDataAccess(
  1214. +static BOOLEAN isDataAccess(
  1215.      ACCESS_MASK mask)
  1216.  {
  1217.      if (mask & (FILE_READ_DATA | FILE_WRITE_DATA | FILE_APPEND_DATA))
  1218. @@ -3878,7 +3903,7 @@ BOOLEAN isDataAccess(
  1219.      return FALSE;
  1220.  }
  1221.  
  1222. -BOOLEAN isOpen2Create(
  1223. +static BOOLEAN isOpen2Create(
  1224.      ULONG disposition)
  1225.  {
  1226.      if (disposition == FILE_CREATE || disposition == FILE_OPEN_IF ||
  1227. @@ -3887,7 +3912,7 @@ BOOLEAN isOpen2Create(
  1228.      return FALSE;
  1229.  }
  1230.  
  1231. -BOOLEAN isFilenameTooLong(
  1232. +static BOOLEAN isFilenameTooLong(
  1233.      PUNICODE_STRING name,
  1234.      PNFS41_V_NET_ROOT_EXTENSION pVNetRootContext)
  1235.  {
  1236. @@ -3906,7 +3931,7 @@ BOOLEAN isFilenameTooLong(
  1237.      return FALSE;
  1238.  }
  1239.  
  1240. -BOOLEAN isStream(
  1241. +static BOOLEAN isStream(
  1242.      PUNICODE_STRING name)
  1243.  {
  1244.      LONG i;
  1245. @@ -3919,7 +3944,7 @@ BOOLEAN isStream(
  1246.      return FALSE;
  1247.  }
  1248.  
  1249. -BOOLEAN areOpenParamsValid(NT_CREATE_PARAMETERS *params)
  1250. +static BOOLEAN areOpenParamsValid(NT_CREATE_PARAMETERS *params)
  1251.  {
  1252.      /* from ms-fsa page 52 */
  1253.      if ((params->CreateOptions & FILE_DELETE_ON_CLOSE) &&
  1254. @@ -3941,8 +3966,8 @@ BOOLEAN areOpenParamsValid(NT_CREATE_PARAMETERS *params)
  1255.      return TRUE;
  1256.  }
  1257.  
  1258. -NTSTATUS map_open_errors(
  1259. -    DWORD status,
  1260. +static NTSTATUS map_open_errors(
  1261. +    DWORD status,
  1262.      USHORT len)
  1263.  {
  1264.      switch (status) {
  1265. @@ -3975,7 +4000,7 @@ NTSTATUS map_open_errors(
  1266.      }
  1267.  }
  1268.  
  1269. -DWORD map_disposition_to_create_retval(
  1270. +static DWORD map_disposition_to_create_retval(
  1271.      DWORD disposition,
  1272.      DWORD errno)
  1273.  {
  1274. @@ -4013,7 +4038,7 @@ static BOOLEAN create_should_pass_ea(
  1275.          || disposition == FILE_OVERWRITE_IF;
  1276.  }
  1277.  
  1278. -NTSTATUS check_nfs41_create_args(
  1279. +static NTSTATUS check_nfs41_create_args(
  1280.      IN PRX_CONTEXT RxContext)
  1281.  {
  1282.      NTSTATUS status = STATUS_SUCCESS;
  1283. @@ -4128,7 +4153,7 @@ out:
  1284.      return status;
  1285.  }
  1286.  
  1287. -NTSTATUS nfs41_Create(
  1288. +static NTSTATUS nfs41_Create(
  1289.      IN OUT PRX_CONTEXT RxContext)
  1290.  {
  1291.      NTSTATUS status = STATUS_INSUFFICIENT_RESOURCES;
  1292. @@ -4506,7 +4531,7 @@ out:
  1293.      return status;
  1294.  }
  1295.  
  1296. -NTSTATUS nfs41_CollapseOpen(
  1297. +static NTSTATUS nfs41_CollapseOpen(
  1298.      IN OUT PRX_CONTEXT RxContext)
  1299.  {
  1300.      NTSTATUS status = STATUS_MORE_PROCESSING_REQUIRED;
  1301. @@ -4515,7 +4540,7 @@ NTSTATUS nfs41_CollapseOpen(
  1302.      return status;
  1303.  }
  1304.  
  1305. -NTSTATUS nfs41_ShouldTryToCollapseThisOpen(
  1306. +static NTSTATUS nfs41_ShouldTryToCollapseThisOpen(
  1307.      IN OUT PRX_CONTEXT RxContext)
  1308.  {
  1309.      if (RxContext->pRelevantSrvOpen == NULL)
  1310. @@ -4523,7 +4548,7 @@ NTSTATUS nfs41_ShouldTryToCollapseThisOpen(
  1311.      else return STATUS_MORE_PROCESSING_REQUIRED;
  1312.  }
  1313.  
  1314. -ULONG nfs41_ExtendForCache(
  1315. +static ULONG nfs41_ExtendForCache(
  1316.      IN OUT PRX_CONTEXT RxContext,
  1317.      IN PLARGE_INTEGER pNewFileSize,
  1318.      OUT PLARGE_INTEGER pNewAllocationSize)
  1319. @@ -4552,7 +4577,7 @@ ULONG nfs41_ExtendForCache(
  1320.      return status;
  1321.  }
  1322.  
  1323. -VOID nfs41_remove_fcb_entry(
  1324. +static VOID nfs41_remove_fcb_entry(
  1325.      PMRX_FCB fcb)
  1326.  {
  1327.      PLIST_ENTRY pEntry;
  1328. @@ -4583,7 +4608,7 @@ VOID nfs41_remove_fcb_entry(
  1329.      ExReleaseFastMutex(&fcblistLock);
  1330.  }
  1331.  
  1332. -NTSTATUS map_close_errors(
  1333. +static NTSTATUS map_close_errors(
  1334.      DWORD status)
  1335.  {
  1336.      switch (status) {
  1337. @@ -4602,7 +4627,7 @@ NTSTATUS map_close_errors(
  1338.      }
  1339.  }
  1340.  
  1341. -NTSTATUS nfs41_CloseSrvOpen(
  1342. +static NTSTATUS nfs41_CloseSrvOpen(
  1343.      IN OUT PRX_CONTEXT RxContext)
  1344.  {
  1345.      NTSTATUS status = STATUS_INSUFFICIENT_RESOURCES;
  1346. @@ -4666,7 +4691,7 @@ out:
  1347.      return status;
  1348.  }
  1349.  
  1350. -NTSTATUS nfs41_Flush(
  1351. +static NTSTATUS nfs41_Flush(
  1352.      IN OUT PRX_CONTEXT RxContext)
  1353.  {
  1354.      DbgP("nfs41_Flush: FileName='%wZ'\n",
  1355. @@ -4675,13 +4700,13 @@ NTSTATUS nfs41_Flush(
  1356.      return STATUS_SUCCESS;
  1357.  }
  1358.  
  1359. -NTSTATUS nfs41_DeallocateForFcb(
  1360. +static NTSTATUS nfs41_DeallocateForFcb(
  1361.      IN OUT PMRX_FCB pFcb)
  1362.  {
  1363.      return STATUS_SUCCESS;
  1364.  }
  1365.  
  1366. -NTSTATUS nfs41_DeallocateForFobx(
  1367. +static NTSTATUS nfs41_DeallocateForFobx(
  1368.      IN OUT PMRX_FOBX pFobx)
  1369.  {
  1370.      __notnull PNFS41_FOBX nfs41_fobx = NFS41GetFobxExtension(pFobx);
  1371. @@ -4698,7 +4723,7 @@ NTSTATUS nfs41_DeallocateForFobx(
  1372.      return STATUS_SUCCESS;
  1373.  }
  1374.  
  1375. -void print_debug_filedirquery_header(
  1376. +static void print_debug_filedirquery_header(
  1377.      PRX_CONTEXT RxContext)
  1378.  {
  1379.      print_debug_header(RxContext);
  1380. @@ -4707,7 +4732,7 @@ void print_debug_filedirquery_header(
  1381.          print_file_information_class(RxContext->Info.FileInformationClass));
  1382.  }
  1383.  
  1384. -void print_querydir_args(
  1385. +static void print_querydir_args(
  1386.      PRX_CONTEXT RxContext)
  1387.  {
  1388.      print_debug_filedirquery_header(RxContext);
  1389. @@ -4720,7 +4745,7 @@ void print_querydir_args(
  1390.          RxContext->QueryDirectory.InitialQuery);
  1391.  }
  1392.  
  1393. -NTSTATUS map_querydir_errors(
  1394. +static NTSTATUS map_querydir_errors(
  1395.      DWORD status)
  1396.  {
  1397.      switch (status) {
  1398. @@ -4741,7 +4766,7 @@ NTSTATUS map_querydir_errors(
  1399.      }
  1400.  }
  1401.  
  1402. -NTSTATUS check_nfs41_dirquery_args(
  1403. +static NTSTATUS check_nfs41_dirquery_args(
  1404.      IN PRX_CONTEXT RxContext)
  1405.  {
  1406.      if (RxContext->Info.Buffer == NULL)
  1407. @@ -4749,7 +4774,7 @@ NTSTATUS check_nfs41_dirquery_args(
  1408.      return STATUS_SUCCESS;
  1409.  }
  1410.  
  1411. -NTSTATUS nfs41_QueryDirectory(
  1412. +static NTSTATUS nfs41_QueryDirectory(
  1413.      IN OUT PRX_CONTEXT RxContext)
  1414.  {
  1415.      NTSTATUS status = STATUS_INVALID_PARAMETER;
  1416. @@ -4859,7 +4884,7 @@ out:
  1417.      return status;
  1418.  }
  1419.  
  1420. -void print_queryvolume_args(
  1421. +static void print_queryvolume_args(
  1422.      PRX_CONTEXT RxContext)
  1423.  {
  1424.      print_debug_header(RxContext);
  1425. @@ -4869,7 +4894,7 @@ void print_queryvolume_args(
  1426.          RxContext->Info.LengthRemaining);
  1427.  }
  1428.  
  1429. -NTSTATUS map_volume_errors(
  1430. +static NTSTATUS map_volume_errors(
  1431.      DWORD status)
  1432.  {
  1433.      switch (status) {
  1434. @@ -4887,7 +4912,7 @@ NTSTATUS map_volume_errors(
  1435.      }
  1436.  }
  1437.  
  1438. -void nfs41_create_volume_info(PFILE_FS_VOLUME_INFORMATION pVolInfo, DWORD *len)
  1439. +static void nfs41_create_volume_info(PFILE_FS_VOLUME_INFORMATION pVolInfo, DWORD *len)
  1440.  {
  1441.      DECLARE_CONST_UNICODE_STRING(VolName, VOL_NAME);
  1442.  
  1443. @@ -4915,7 +4940,7 @@ static BOOLEAN is_root_directory(
  1444.      return RxContext->CurrentIrpSp->FileObject->FileName.Length <= RootPathLen;
  1445.  }
  1446.  
  1447. -NTSTATUS nfs41_QueryVolumeInformation(
  1448. +static NTSTATUS nfs41_QueryVolumeInformation(
  1449.      IN OUT PRX_CONTEXT RxContext)
  1450.  {
  1451.      NTSTATUS status = STATUS_INVALID_PARAMETER;
  1452. @@ -5067,7 +5092,7 @@ out:
  1453.      return status;
  1454.  }
  1455.  
  1456. -VOID nfs41_update_fcb_list(
  1457. +static VOID nfs41_update_fcb_list(
  1458.      PMRX_FCB fcb,
  1459.      ULONGLONG ChangeTime)
  1460.  {
  1461. @@ -5103,7 +5128,7 @@ VOID nfs41_update_fcb_list(
  1462.      ExReleaseFastMutex(&fcblistLock);
  1463.  }
  1464.  
  1465. -void print_nfs3_attrs(
  1466. +static void print_nfs3_attrs(
  1467.      nfs3_attrs *attrs)
  1468.  {
  1469.      DbgP("type=%d mode=0%o nlink=%d size=%d "
  1470. @@ -5112,7 +5137,7 @@ void print_nfs3_attrs(
  1471.          attrs->mtime, attrs->ctime);
  1472.  }
  1473.  
  1474. -void file_time_to_nfs_time(
  1475. +static void file_time_to_nfs_time(
  1476.      IN const PLARGE_INTEGER file_time,
  1477.      OUT LONGLONG *nfs_time)
  1478.  {
  1479. @@ -5121,7 +5146,7 @@ void file_time_to_nfs_time(
  1480.      *nfs_time = diff.QuadPart / 10000000;
  1481.  }
  1482.  
  1483. -void create_nfs3_attrs(
  1484. +static void create_nfs3_attrs(
  1485.      nfs3_attrs *attrs,
  1486.      PNFS41_FCB nfs41_fcb)
  1487.  {
  1488. @@ -5146,7 +5171,7 @@ void create_nfs3_attrs(
  1489.  }
  1490.  
  1491.  
  1492. -NTSTATUS map_setea_error(
  1493. +static NTSTATUS map_setea_error(
  1494.      DWORD error)
  1495.  {
  1496.      switch (error) {
  1497. @@ -5173,7 +5198,7 @@ NTSTATUS map_setea_error(
  1498.      }
  1499.  }
  1500.  
  1501. -NTSTATUS check_nfs41_setea_args(
  1502. +static NTSTATUS check_nfs41_setea_args(
  1503.      IN PRX_CONTEXT RxContext)
  1504.  {
  1505.      NTSTATUS status;
  1506. @@ -5215,7 +5240,7 @@ out:
  1507.      return status;
  1508.  }
  1509.  
  1510. -NTSTATUS nfs41_SetEaInformation(
  1511. +static NTSTATUS nfs41_SetEaInformation(
  1512.      IN OUT PRX_CONTEXT RxContext)
  1513.  {
  1514.      NTSTATUS status = STATUS_EAS_NOT_SUPPORTED;
  1515. @@ -5308,7 +5333,7 @@ out:
  1516.      return status;
  1517.  }
  1518.  
  1519. -NTSTATUS check_nfs41_queryea_args(
  1520. +static NTSTATUS check_nfs41_queryea_args(
  1521.      IN PRX_CONTEXT RxContext)
  1522.  {
  1523.      NTSTATUS status;
  1524. @@ -5486,7 +5511,7 @@ out:
  1525.      return status;
  1526.  }
  1527.  
  1528. -NTSTATUS nfs41_QueryEaInformation(
  1529. +static NTSTATUS nfs41_QueryEaInformation(
  1530.      IN OUT PRX_CONTEXT RxContext)
  1531.  {
  1532.      NTSTATUS status = STATUS_EAS_NOT_SUPPORTED;
  1533. @@ -5574,7 +5599,7 @@ out:
  1534.      return status;
  1535.  }
  1536.  
  1537. -NTSTATUS map_query_acl_error(
  1538. +static NTSTATUS map_query_acl_error(
  1539.      DWORD error)
  1540.  {
  1541.      switch (error) {
  1542. @@ -5593,7 +5618,7 @@ NTSTATUS map_query_acl_error(
  1543.      }
  1544.  }
  1545.  
  1546. -NTSTATUS check_nfs41_getacl_args(
  1547. +static NTSTATUS check_nfs41_getacl_args(
  1548.      PRX_CONTEXT RxContext)
  1549.  {
  1550.      NTSTATUS status = STATUS_SUCCESS;
  1551. @@ -5613,7 +5638,7 @@ out:
  1552.      return status;
  1553.  }
  1554.  
  1555. -NTSTATUS nfs41_QuerySecurityInformation(
  1556. +static NTSTATUS nfs41_QuerySecurityInformation(
  1557.      IN OUT PRX_CONTEXT RxContext)
  1558.  {
  1559.      NTSTATUS status = STATUS_NOT_SUPPORTED;
  1560. @@ -5732,7 +5757,7 @@ out:
  1561.      return status;
  1562.  }
  1563.  
  1564. -NTSTATUS check_nfs41_setacl_args(
  1565. +static NTSTATUS check_nfs41_setacl_args(
  1566.      PRX_CONTEXT RxContext)
  1567.  {
  1568.      NTSTATUS status = STATUS_SUCCESS;
  1569. @@ -5756,7 +5781,7 @@ out:
  1570.      return status;
  1571.  }
  1572.  
  1573. -NTSTATUS nfs41_SetSecurityInformation(
  1574. +static NTSTATUS nfs41_SetSecurityInformation(
  1575.      IN OUT PRX_CONTEXT RxContext)
  1576.  {
  1577.      NTSTATUS status = STATUS_NOT_SUPPORTED;
  1578. @@ -5843,7 +5868,7 @@ out:
  1579.      return status;
  1580.  }
  1581.  
  1582. -NTSTATUS map_queryfile_error(
  1583. +static NTSTATUS map_queryfile_error(
  1584.      DWORD error)
  1585.  {
  1586.      switch (error) {
  1587. @@ -5859,7 +5884,7 @@ NTSTATUS map_queryfile_error(
  1588.      }
  1589.  }
  1590.  
  1591. -NTSTATUS nfs41_QueryFileInformation(
  1592. +static NTSTATUS nfs41_QueryFileInformation(
  1593.      IN OUT PRX_CONTEXT RxContext)
  1594.  {
  1595.      NTSTATUS status = STATUS_OBJECT_NAME_NOT_FOUND;
  1596. @@ -6024,7 +6049,7 @@ out:
  1597.      return status;
  1598.  }
  1599.  
  1600. -NTSTATUS map_setfile_error(
  1601. +static NTSTATUS map_setfile_error(
  1602.      DWORD error)
  1603.  {
  1604.      switch (error) {
  1605. @@ -6052,7 +6077,7 @@ NTSTATUS map_setfile_error(
  1606.      }
  1607.  }
  1608.  
  1609. -NTSTATUS check_nfs41_setattr_args(
  1610. +static NTSTATUS check_nfs41_setattr_args(
  1611.      IN PRX_CONTEXT RxContext)
  1612.  {
  1613.      NTSTATUS status = STATUS_SUCCESS;
  1614. @@ -6144,7 +6169,7 @@ out:
  1615.      return status;
  1616.  }
  1617.  
  1618. -NTSTATUS nfs41_SetFileInformation(
  1619. +static NTSTATUS nfs41_SetFileInformation(
  1620.      IN OUT PRX_CONTEXT RxContext)
  1621.  {
  1622.      NTSTATUS status = STATUS_INVALID_PARAMETER;
  1623. @@ -6293,7 +6318,7 @@ out:
  1624.      return status;
  1625.  }
  1626.  
  1627. -NTSTATUS nfs41_SetFileInformationAtCleanup(
  1628. +static NTSTATUS nfs41_SetFileInformationAtCleanup(
  1629.        IN OUT PRX_CONTEXT RxContext)
  1630.  {
  1631.      NTSTATUS status;
  1632. @@ -6303,14 +6328,14 @@ NTSTATUS nfs41_SetFileInformationAtCleanup(
  1633.      return status;
  1634.  }
  1635.  
  1636. -NTSTATUS nfs41_IsValidDirectory (
  1637. +static NTSTATUS nfs41_IsValidDirectory (
  1638.      IN OUT PRX_CONTEXT RxContext,
  1639.      IN PUNICODE_STRING DirectoryName)
  1640.  {
  1641.      return STATUS_SUCCESS;
  1642.  }
  1643.  
  1644. -NTSTATUS nfs41_ComputeNewBufferingState(
  1645. +static NTSTATUS nfs41_ComputeNewBufferingState(
  1646.      IN OUT PMRX_SRV_OPEN pSrvOpen,
  1647.      IN PVOID pMRxContext,
  1648.      OUT ULONG *pNewBufferingState)
  1649. @@ -6354,7 +6379,7 @@ NTSTATUS nfs41_ComputeNewBufferingState(
  1650.      return status;
  1651.  }
  1652.  
  1653. -void print_readwrite_args(
  1654. +static void print_readwrite_args(
  1655.      PRX_CONTEXT RxContext)
  1656.  {
  1657.      PLOWIO_CONTEXT LowIoContext  = &RxContext->LowIoContext;
  1658. @@ -6366,7 +6391,7 @@ void print_readwrite_args(
  1659.          LowIoContext->ParamsFor.ReadWrite.Buffer);
  1660.  }
  1661.  
  1662. -void enable_caching(
  1663. +static void enable_caching(
  1664.      PMRX_SRV_OPEN SrvOpen,
  1665.      PNFS41_FOBX nfs41_fobx,
  1666.      ULONGLONG ChangeTime,
  1667. @@ -6439,7 +6464,7 @@ void enable_caching(
  1668.      ExReleaseFastMutex(&fcblistLock);
  1669.  }
  1670.  
  1671. -NTSTATUS map_readwrite_errors(
  1672. +static NTSTATUS map_readwrite_errors(
  1673.      DWORD status)
  1674.  {
  1675.      switch (status) {
  1676. @@ -6462,7 +6487,7 @@ NTSTATUS map_readwrite_errors(
  1677.      }
  1678.  }
  1679.  
  1680. -NTSTATUS check_nfs41_read_args(
  1681. +static NTSTATUS check_nfs41_read_args(
  1682.      IN PRX_CONTEXT RxContext)
  1683.  {
  1684.      if (!RxContext->LowIoContext.ParamsFor.ReadWrite.Buffer)
  1685. @@ -6470,7 +6495,7 @@ NTSTATUS check_nfs41_read_args(
  1686.      return STATUS_SUCCESS;
  1687.  }
  1688.  
  1689. -NTSTATUS nfs41_Read(
  1690. +static NTSTATUS nfs41_Read(
  1691.      IN OUT PRX_CONTEXT RxContext)
  1692.  {
  1693.      NTSTATUS status = STATUS_INSUFFICIENT_RESOURCES;
  1694. @@ -6565,7 +6590,7 @@ out:
  1695.      return status;
  1696.  }
  1697.  
  1698. -NTSTATUS check_nfs41_write_args(
  1699. +static NTSTATUS check_nfs41_write_args(
  1700.      IN PRX_CONTEXT RxContext)
  1701.  {
  1702.      NTSTATUS status = STATUS_SUCCESS;
  1703. @@ -6586,7 +6611,7 @@ out:
  1704.      return status;
  1705.  }
  1706.  
  1707. -NTSTATUS nfs41_Write(
  1708. +static NTSTATUS nfs41_Write(
  1709.      IN OUT PRX_CONTEXT RxContext)
  1710.  {
  1711.      NTSTATUS status = STATUS_INSUFFICIENT_RESOURCES;
  1712. @@ -6692,7 +6717,7 @@ out:
  1713.      return status;
  1714.  }
  1715.  
  1716. -NTSTATUS nfs41_IsLockRealizable(
  1717. +static NTSTATUS nfs41_IsLockRealizable(
  1718.      IN OUT PMRX_FCB pFcb,
  1719.      IN PLARGE_INTEGER  ByteOffset,
  1720.      IN PLARGE_INTEGER  Length,
  1721. @@ -6717,7 +6742,7 @@ NTSTATUS nfs41_IsLockRealizable(
  1722.      return status;
  1723.  }
  1724.  
  1725. -NTSTATUS map_lock_errors(
  1726. +static NTSTATUS map_lock_errors(
  1727.      DWORD status)
  1728.  {
  1729.      switch (status) {
  1730. @@ -6741,7 +6766,7 @@ NTSTATUS map_lock_errors(
  1731.      }
  1732.  }
  1733.  
  1734. -void print_lock_args(
  1735. +static void print_lock_args(
  1736.      PRX_CONTEXT RxContext)
  1737.  {
  1738.      PLOWIO_CONTEXT LowIoContext = &RxContext->LowIoContext;
  1739. @@ -6760,7 +6785,7 @@ void print_lock_args(
  1740.  #define MIN_LOCK_POLL_WAIT      (500 * MSEC_TO_RELATIVE_WAIT) /* 500ms */
  1741.  #define MAX_LOCK_POLL_WAIT      (30000 * MSEC_TO_RELATIVE_WAIT) /* 30s */
  1742.  
  1743. -void denied_lock_backoff(
  1744. +static void denied_lock_backoff(
  1745.      IN OUT PLARGE_INTEGER delay)
  1746.  {
  1747.      if (delay->QuadPart == 0)
  1748. @@ -6772,7 +6797,7 @@ void denied_lock_backoff(
  1749.          delay->QuadPart = MAX_LOCK_POLL_WAIT;
  1750.  }
  1751.  
  1752. -NTSTATUS nfs41_Lock(
  1753. +static NTSTATUS nfs41_Lock(
  1754.      IN OUT PRX_CONTEXT RxContext)
  1755.  {
  1756.      NTSTATUS status = STATUS_SUCCESS;
  1757. @@ -6845,7 +6870,7 @@ out:
  1758.      return status;
  1759.  }
  1760.  
  1761. -void print_unlock_args(
  1762. +static void print_unlock_args(
  1763.      PRX_CONTEXT RxContext)
  1764.  {
  1765.      PLOWIO_CONTEXT LowIoContext = &RxContext->LowIoContext;
  1766. @@ -6876,7 +6901,7 @@ __inline ULONG unlock_list_count(
  1767.      return count;
  1768.  }
  1769.  
  1770. -NTSTATUS nfs41_Unlock(
  1771. +static NTSTATUS nfs41_Unlock(
  1772.      IN OUT PRX_CONTEXT RxContext)
  1773.  {
  1774.      NTSTATUS status = STATUS_SUCCESS;
  1775. @@ -6941,7 +6966,7 @@ out:
  1776.      return status;
  1777.  }
  1778.  
  1779. -NTSTATUS map_symlink_errors(
  1780. +static NTSTATUS map_symlink_errors(
  1781.      NTSTATUS status)
  1782.  {
  1783.      switch (status) {
  1784. @@ -6967,7 +6992,7 @@ NTSTATUS map_symlink_errors(
  1785.      }
  1786.  }
  1787.  
  1788. -void print_reparse_buffer(
  1789. +static void print_reparse_buffer(
  1790.      PREPARSE_DATA_BUFFER Reparse)
  1791.  {
  1792.      UNICODE_STRING name;
  1793. @@ -6998,7 +7023,7 @@ void print_reparse_buffer(
  1794.      DbgP("PrintName:            '%wZ'\n", &name);
  1795.  }
  1796.  
  1797. -NTSTATUS check_nfs41_setreparse_args(
  1798. +static NTSTATUS check_nfs41_setreparse_args(
  1799.      IN PRX_CONTEXT RxContext)
  1800.  {
  1801.      NTSTATUS status = STATUS_SUCCESS;
  1802. @@ -7059,7 +7084,7 @@ out:
  1803.      return status;
  1804.  }
  1805.  
  1806. -NTSTATUS nfs41_SetReparsePoint(
  1807. +static NTSTATUS nfs41_SetReparsePoint(
  1808.      IN OUT PRX_CONTEXT RxContext)
  1809.  {
  1810.      NTSTATUS status;
  1811. @@ -7107,7 +7132,7 @@ out:
  1812.      return status;
  1813.  }
  1814.  
  1815. -NTSTATUS check_nfs41_getreparse_args(
  1816. +static NTSTATUS check_nfs41_getreparse_args(
  1817.      PRX_CONTEXT RxContext)
  1818.  {
  1819.      NTSTATUS status = STATUS_SUCCESS;
  1820. @@ -7147,7 +7172,7 @@ out:
  1821.      return status;
  1822.  }
  1823.  
  1824. -NTSTATUS nfs41_GetReparsePoint(
  1825. +static NTSTATUS nfs41_GetReparsePoint(
  1826.      IN OUT PRX_CONTEXT RxContext)
  1827.  {
  1828.      NTSTATUS status;
  1829. @@ -7214,7 +7239,7 @@ out:
  1830.      return status;
  1831.  }
  1832.  
  1833. -NTSTATUS nfs41_FsCtl(
  1834. +static NTSTATUS nfs41_FsCtl(
  1835.      IN OUT PRX_CONTEXT RxContext)
  1836.  {
  1837.      NTSTATUS status = STATUS_INVALID_DEVICE_REQUEST;
  1838. @@ -7255,7 +7280,7 @@ NTSTATUS nfs41_FsCtl(
  1839.      return status;
  1840.  }
  1841.  
  1842. -NTSTATUS nfs41_CompleteBufferingStateChangeRequest(
  1843. +static NTSTATUS nfs41_CompleteBufferingStateChangeRequest(
  1844.      IN OUT PRX_CONTEXT RxContext,
  1845.      IN OUT PMRX_SRV_OPEN SrvOpen,
  1846.      IN PVOID pContext)
  1847. @@ -7263,6 +7288,7 @@ NTSTATUS nfs41_CompleteBufferingStateChangeRequest(
  1848.      return STATUS_SUCCESS;
  1849.  }
  1850.  
  1851. +/* nfs41_FsdDispatch() - must be public symbol */
  1852.  NTSTATUS nfs41_FsdDispatch (
  1853.      IN PDEVICE_OBJECT dev,
  1854.      IN PIRP Irp)
  1855. @@ -7302,20 +7328,20 @@ out:
  1856.      return status;
  1857.  }
  1858.  
  1859. -NTSTATUS nfs41_Unimplemented(
  1860. +static NTSTATUS nfs41_Unimplemented(
  1861.      PRX_CONTEXT RxContext)
  1862.  {
  1863.      return STATUS_NOT_IMPLEMENTED;
  1864.  }
  1865.  
  1866. -NTSTATUS nfs41_AreFilesAliased(
  1867. +static NTSTATUS nfs41_AreFilesAliased(
  1868.      PFCB a,
  1869.      PFCB b)
  1870.  {
  1871.      return STATUS_NOT_IMPLEMENTED;
  1872.  }
  1873.  
  1874. -NTSTATUS nfs41_init_ops()
  1875. +static NTSTATUS nfs41_init_ops()
  1876.  {
  1877.      DbgEn();
  1878.  
  1879. @@ -7555,6 +7581,8 @@ out:
  1880.      DbgEx();
  1881.  }
  1882.  
  1883. +
  1884. +/* Main driver entry point, must be public symbol */
  1885.  NTSTATUS DriverEntry(
  1886.      IN PDRIVER_OBJECT drv,
  1887.      IN PUNICODE_STRING path)
  1888. @@ -7640,6 +7668,8 @@ out:
  1889.      return status;
  1890.  }
  1891.  
  1892. +
  1893. +/* nfs41_driver_unload() - must be public symbol */
  1894.  VOID nfs41_driver_unload(IN PDRIVER_OBJECT drv)
  1895.  {
  1896.      PRX_CONTEXT RxContext;
  1897. --
  1898. 2.45.1
  1899.  
  1900. From e713651b6450df6b6ee3090877d801f99d1fdd90 Mon Sep 17 00:00:00 2001
  1901. From: Roland Mainz <roland.mainz@nrubsig.org>
  1902. Date: Tue, 30 Jul 2024 17:09:26 +0200
  1903. Subject: [PATCH 5/5] sys: Move *marshal_nfs41_rw/token debug messages into new
  1904.  debug switches
  1905.  
  1906. Move *marshal_nfs41_rw/token debug messages into new #define debug
  1907. switches so we get less debugf message noise by default.
  1908.  
  1909. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  1910. ---
  1911. sys/nfs41_driver.c | 8 +++++---
  1912.  1 file changed, 5 insertions(+), 3 deletions(-)
  1913.  
  1914. diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
  1915. index 920b34b..288046b 100644
  1916. --- a/sys/nfs41_driver.c
  1917. +++ b/sys/nfs41_driver.c
  1918. @@ -46,6 +46,8 @@
  1919.  /* debugging printout defines */
  1920.  #define DEBUG_MARSHAL_HEADER
  1921.  #define DEBUG_MARSHAL_DETAIL
  1922. +//#define DEBUG_MARSHAL_DETAIL_RW
  1923. +//#define DEBUG_SECURITY_TOKEN
  1924.  #define DEBUG_MOUNTCONFIG
  1925.  //#define DEBUG_OPEN
  1926.  //#define DEBUG_CLOSE
  1927. @@ -910,7 +912,7 @@ static NTSTATUS marshal_nfs41_rw(
  1928.      RtlCopyMemory(tmp, &entry->buf, sizeof(HANDLE));
  1929.      *len = header_len;
  1930.  
  1931. -#ifdef DEBUG_MARSHAL_DETAIL
  1932. +#ifdef DEBUG_MARSHAL_DETAIL_RW
  1933.      DbgP("marshal_nfs41_rw: len=%lu offset=%llu "
  1934.          "MdlAddress=0x%p Userspace=0x%p\n",
  1935.          entry->buf_len, entry->u.ReadWrite.offset,
  1936. @@ -1848,7 +1850,7 @@ static NTSTATUS unmarshal_nfs41_rw(
  1937.      RtlCopyMemory(&cur->buf_len, *buf, sizeof(cur->buf_len));
  1938.      *buf += sizeof(cur->buf_len);
  1939.      RtlCopyMemory(&cur->ChangeTime, *buf, sizeof(ULONGLONG));
  1940. -#ifdef DEBUG_MARSHAL_DETAIL
  1941. +#ifdef DEBUG_MARSHAL_DETAIL_RW
  1942.      DbgP("unmarshal_nfs41_rw: returned len %lu ChangeTime %llu\n",
  1943.          cur->buf_len, cur->ChangeTime);
  1944.  #endif
  1945. @@ -3331,7 +3333,7 @@ static NTSTATUS nfs41_get_sec_ctx(
  1946.          print_error("SeCreateClientSecurityFromSubjectContext "
  1947.              "failed with 0x%x\n", status);
  1948.      }
  1949. -#ifdef DEBUG_MOUNT
  1950. +#ifdef DEBUG_SECURITY_TOKEN
  1951.      DbgP("Created client security token 0x%p\n", out_ctx->ClientToken);
  1952.  #endif
  1953.      SeReleaseSubjectContext(&ctx);
  1954. --
  1955. 2.45.1

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