pastebin - collaborative debugging tool
nrubsig.kpaste.net RSS


ms-nfs41-client VC22 support
Posted by Anonymous on Tue 8th Oct 2024 17:05
raw | new post

  1. diff --git a/build.vc19/nfs41_driver/nfs41_driver.vcxproj b/build.vc19/nfs41_driver/nfs41_driver.vcxproj
  2. index a786711..619fdf6 100644
  3. --- a/build.vc19/nfs41_driver/nfs41_driver.vcxproj
  4. +++ b/build.vc19/nfs41_driver/nfs41_driver.vcxproj
  5. @@ -135,13 +135,13 @@
  6.    </PropertyGroup>
  7.    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
  8.      <ClCompile>
  9. -      <AdditionalIncludeDirectories>..\..\include;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  10. +      <AdditionalIncludeDirectories>..\..\include;..\..\dll;..\..;$(WindowsSdkDir)Include0.0.19041.0\km;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  11.        <WarningLevel>Level4</WarningLevel>
  12.        <Optimization>Disabled</Optimization>
  13.        <PreprocessorDefinitions>EXPLODE_POOLTAGS;MONOLITHIC_MINIRDR;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  14.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  15.        <StringPooling>true</StringPooling>
  16. -      <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
  17. +      <AdditionalOptions>/std:c17 /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
  18.      </ClCompile>
  19.      <Link>
  20.        <AdditionalDependencies>$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\ntoskrnl.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\hal.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\BufferOverflowfastfailK.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\ksecdd.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\rxce.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\rdbsslib.lib</AdditionalDependencies>
  21. @@ -149,13 +149,13 @@
  22.    </ItemDefinitionGroup>
  23.    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
  24.      <ClCompile>
  25. -      <AdditionalIncludeDirectories>..\..\include;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  26. +      <AdditionalIncludeDirectories>..\..\include;..\..\dll;..\..;$(WindowsSdkDir)Include0.0.19041.0\km;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  27.        <WarningLevel>Level4</WarningLevel>
  28.        <Optimization>MaxSpeed</Optimization>
  29.        <PreprocessorDefinitions>EXPLODE_POOLTAGS;MONOLITHIC_MINIRDR;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  30.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  31.        <StringPooling>true</StringPooling>
  32. -      <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
  33. +      <AdditionalOptions>/std:c17 /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
  34.      </ClCompile>
  35.      <Link>
  36.        <AdditionalDependencies>$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\ntoskrnl.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\hal.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\BufferOverflowfastfailK.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\ksecdd.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\rxce.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\rdbsslib.lib</AdditionalDependencies>
  37. @@ -163,13 +163,13 @@
  38.    </ItemDefinitionGroup>
  39.    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
  40.      <ClCompile>
  41. -      <AdditionalIncludeDirectories>..\..\include;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  42. +      <AdditionalIncludeDirectories>..\..\include;..\..\dll;..\..;$(WindowsSdkDir)Include0.0.19041.0\km;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  43.        <WarningLevel>Level4</WarningLevel>
  44.        <Optimization>Disabled</Optimization>
  45.        <PreprocessorDefinitions>EXPLODE_POOLTAGS;MONOLITHIC_MINIRDR;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  46.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  47.        <StringPooling>true</StringPooling>
  48. -      <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
  49. +      <AdditionalOptions>/std:c17 /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
  50.      </ClCompile>
  51.      <Link>
  52.        <AdditionalDependencies>$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\ntoskrnl.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\hal.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\BufferOverflowfastfailK.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\ksecdd.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\rxce.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\rdbsslib.lib;$(WindowsSdkDir)lib\win7\km\$(DDKPlatform)\copysup.lib</AdditionalDependencies>
  53. @@ -177,13 +177,13 @@
  54.    </ItemDefinitionGroup>
  55.    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
  56.      <ClCompile>
  57. -      <AdditionalIncludeDirectories>..\..\include;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  58. +      <AdditionalIncludeDirectories>..\..\include;..\..\dll;..\..;$(WindowsSdkDir)Include0.0.19041.0\km;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  59.        <WarningLevel>Level4</WarningLevel>
  60.        <Optimization>MaxSpeed</Optimization>
  61.        <PreprocessorDefinitions>EXPLODE_POOLTAGS;MONOLITHIC_MINIRDR;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  62.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  63.        <StringPooling>true</StringPooling>
  64. -      <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
  65. +      <AdditionalOptions>/std:c17 /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
  66.      </ClCompile>
  67.      <Link>
  68.        <AdditionalDependencies>$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\ntoskrnl.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\hal.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\BufferOverflowfastfailK.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\ksecdd.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\rxce.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\rdbsslib.lib;$(WindowsSdkDir)lib\win7\km\$(DDKPlatform)\copysup.lib</AdditionalDependencies>
  69. @@ -191,13 +191,13 @@
  70.    </ItemDefinitionGroup>
  71.    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
  72.      <ClCompile>
  73. -      <AdditionalIncludeDirectories>..\..\include;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  74. +      <AdditionalIncludeDirectories>..\..\include;..\..\dll;..\..;$(WindowsSdkDir)Include0.0.19041.0\km;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  75.        <WarningLevel>Level4</WarningLevel>
  76.        <Optimization>Disabled</Optimization>
  77.        <PreprocessorDefinitions>EXPLODE_POOLTAGS;MONOLITHIC_MINIRDR;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  78.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  79.        <StringPooling>true</StringPooling>
  80. -      <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
  81. +      <AdditionalOptions>/std:c17 /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
  82.      </ClCompile>
  83.      <Link>
  84.        <AdditionalDependencies>$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\ntoskrnl.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\hal.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\BufferOverflowfastfailK.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\ksecdd.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\rxce.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\rdbsslib.lib</AdditionalDependencies>
  85. @@ -205,13 +205,13 @@
  86.    </ItemDefinitionGroup>
  87.    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
  88.      <ClCompile>
  89. -      <AdditionalIncludeDirectories>..\..\include;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  90. +      <AdditionalIncludeDirectories>..\..\include;..\..\dll;..\..;$(WindowsSdkDir)Include0.0.19041.0\km;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  91.        <WarningLevel>Level4</WarningLevel>
  92.        <Optimization>MaxSpeed</Optimization>
  93.        <PreprocessorDefinitions>EXPLODE_POOLTAGS;MONOLITHIC_MINIRDR;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  94.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  95.        <StringPooling>true</StringPooling>
  96. -      <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
  97. +      <AdditionalOptions>/std:c17 /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
  98.      </ClCompile>
  99.      <Link>
  100.        <AdditionalDependencies>$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\ntoskrnl.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\hal.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\BufferOverflowfastfailK.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\ksecdd.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\rxce.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\rdbsslib.lib</AdditionalDependencies>
  101. @@ -219,13 +219,13 @@
  102.    </ItemDefinitionGroup>
  103.    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
  104.      <ClCompile>
  105. -      <AdditionalIncludeDirectories>..\..\include;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  106. +      <AdditionalIncludeDirectories>..\..\include;..\..\dll;..\..;$(WindowsSdkDir)Include0.0.19041.0\km;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  107.        <WarningLevel>Level4</WarningLevel>
  108.        <Optimization>Disabled</Optimization>
  109.        <PreprocessorDefinitions>EXPLODE_POOLTAGS;MONOLITHIC_MINIRDR;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  110.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  111.        <StringPooling>true</StringPooling>
  112. -      <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
  113. +      <AdditionalOptions>/std:c17 /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
  114.      </ClCompile>
  115.      <Link>
  116.        <AdditionalDependencies>$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\ntoskrnl.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\hal.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\BufferOverflowfastfailK.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\ksecdd.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\rxce.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\rdbsslib.lib;$(WindowsSdkDir)lib\win7\km\$(DDKPlatform)\copysup.lib</AdditionalDependencies>
  117. @@ -233,13 +233,13 @@
  118.    </ItemDefinitionGroup>
  119.    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
  120.      <ClCompile>
  121. -      <AdditionalIncludeDirectories>..\..\include;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  122. +      <AdditionalIncludeDirectories>..\..\include;..\..\dll;..\..;$(WindowsSdkDir)Include0.0.19041.0\km;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  123.        <WarningLevel>Level4</WarningLevel>
  124.        <Optimization>MaxSpeed</Optimization>
  125.        <PreprocessorDefinitions>EXPLODE_POOLTAGS;MONOLITHIC_MINIRDR;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  126.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  127.        <StringPooling>true</StringPooling>
  128. -      <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
  129. +      <AdditionalOptions>/std:c17 /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
  130.      </ClCompile>
  131.      <Link>
  132.        <AdditionalDependencies>$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\ntoskrnl.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\hal.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\BufferOverflowfastfailK.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\ksecdd.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\rxce.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\rdbsslib.lib;$(WindowsSdkDir)lib\win7\km\$(DDKPlatform)\copysup.lib</AdditionalDependencies>
  133. diff --git a/sys/copysup.c b/sys/copysup.c
  134. index 799caf9..26ff10a 100644
  135. --- a/sys/copysup.c
  136. +++ b/sys/copysup.c
  137. @@ -26,6 +26,22 @@
  138.  #error Code requires ISO C17
  139.  #endif
  140.  
  141. +/* FIXME: Why does VS22 need this, but not VC19 ? */
  142. +#if _MSC_VER >= 1900
  143. +#if defined(_WIN64) && defined(_M_X64)
  144. +#define _AMD64_
  145. +#elif defined(_WIN32) && defined(_M_IX86)
  146. +#define _X86_
  147. +#elif defined(_WIN64) && defined(_M_ARM64)
  148. +#define _ARM64_
  149. +#elif defined(_WIN32) && defined(_M_ARM)
  150. +#define _ARM_
  151. +#else
  152. +#error Unsupported arch
  153. +#endif
  154. +#endif /* _MSC_VER >= 1900 */
  155. +
  156. +
  157.  #include <rx.h>
  158.  #include <windef.h>
  159.  #include <winerror.h>
  160. diff --git a/sys/nfs41_debug.c b/sys/nfs41_debug.c
  161. index d169611..f8c99c0 100644
  162. --- a/sys/nfs41_debug.c
  163. +++ b/sys/nfs41_debug.c
  164. @@ -20,6 +20,23 @@
  165.   */
  166.  
  167.  #define MINIRDR__NAME "Value is ignored, only fact of definition"
  168. +
  169. +/* FIXME: Why does VS22 need this, but not VC19 ? */
  170. +#if _MSC_VER >= 1900
  171. +#if defined(_WIN64) && defined(_M_X64)
  172. +#define _AMD64_
  173. +#elif defined(_WIN32) && defined(_M_IX86)
  174. +#define _X86_
  175. +#elif defined(_WIN64) && defined(_M_ARM64)
  176. +#define _ARM64_
  177. +#elif defined(_WIN32) && defined(_M_ARM)
  178. +#define _ARM_
  179. +#else
  180. +#error Unsupported arch
  181. +#endif
  182. +#endif /* _MSC_VER >= 1900 */
  183. +
  184. +
  185.  #include <rx.h>
  186.  
  187.  #include "nfs41_driver.h"
  188. diff --git a/sys/nfs41_debug.h b/sys/nfs41_debug.h
  189. index 8f45e51..0c3f7c4 100644
  190. --- a/sys/nfs41_debug.h
  191. +++ b/sys/nfs41_debug.h
  192. @@ -63,18 +63,18 @@ const char *fsctl2string(ULONG fsctl);
  193.  
  194.  #define DbgEn() DbgPrintEx(DPFLTR_IHVNETWORK_ID, DPFLTR_ERROR_LEVEL, \
  195.          "--> [%s] [%04x] %s\n", _DRIVER_NAME_, PsGetCurrentProcessShortDebugId(), \
  196. -        __func__); try {
  197. +        __func__); __try {
  198.  
  199.  #define DbgEx() DbgPrintEx(DPFLTR_IHVNETWORK_ID, DPFLTR_ERROR_LEVEL, \
  200.          "<-- [%s] [%04x] %s status = %08lx\n", _DRIVER_NAME_, PsGetCurrentProcessShortDebugId(), \
  201.          __func__, status); \
  202. -        } except (EXCEPTION_EXECUTE_HANDLER) { \
  203. +        } __except (EXCEPTION_EXECUTE_HANDLER) { \
  204.              status = GetExceptionCode() ; \
  205.              DbgP("Exception encountered with value = Ox%x\n", status); \
  206.          }
  207.  #define DbgR() DbgPrintEx(DPFLTR_IHVNETWORK_ID, DPFLTR_ERROR_LEVEL, \
  208.          "<-- [%s] [%04x] %s\n", _DRIVER_NAME_, PsGetCurrentProcessShortDebugId(), __func__); \
  209. -        } except (EXCEPTION_EXECUTE_HANDLER) { \
  210. +        } __except (EXCEPTION_EXECUTE_HANDLER) { \
  211.              NTSTATUS exc_status; \
  212.              exc_status = GetExceptionCode() ; \
  213.              DbgP("Exception encountered with value = Ox%x\n", (int)exc_status); \
  214. diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
  215. index 1214fa8..fc573bb 100644
  216. --- a/sys/nfs41_driver.c
  217. +++ b/sys/nfs41_driver.c
  218. @@ -28,6 +28,21 @@
  219.  #error Code requires ISO C17
  220.  #endif
  221.  
  222. +/* FIXME: Why does VS22 need this, but not VC19 ? */
  223. +#if _MSC_VER >= 1900
  224. +#if defined(_WIN64) && defined(_M_X64)
  225. +#define _AMD64_
  226. +#elif defined(_WIN32) && defined(_M_IX86)
  227. +#define _X86_
  228. +#elif defined(_WIN64) && defined(_M_ARM64)
  229. +#define _ARM64_
  230. +#elif defined(_WIN32) && defined(_M_ARM)
  231. +#define _ARM_
  232. +#else
  233. +#error Unsupported arch
  234. +#endif
  235. +#endif /* _MSC_VER >= 1900 */
  236. +
  237.  #define MINIRDR__NAME "Value is ignored, only fact of definition"
  238.  #include <rx.h>
  239.  #include <windef.h>
  240. @@ -292,6 +307,18 @@ typedef struct _updowncall_list {
  241.  nfs41_updowncall_list upcall, downcall;
  242.  
  243.  
  244. +#if _MSC_VER >= 1900
  245. +/*
  246. + * gisburn: VS22 chokes on the original define for
  247. + * |DECLARE_CONST_UNICODE_STRING|, so we use one
  248. + * without the offending stuff
  249. + */
  250. +#undef DECLARE_CONST_UNICODE_STRING
  251. +#define DECLARE_CONST_UNICODE_STRING(_var, _string) \
  252. +       const WCHAR _var ## _buffer[] = _string; \
  253. +       const UNICODE_STRING _var = { sizeof(_string) - sizeof(WCHAR), sizeof(_string), (PWCH) _var ## _buffer }
  254. +#endif /* _MSC_VER >= 1900 */
  255. +
  256.  
  257.  /*
  258.   * In order to cooperate with other network providers,
  259. @@ -2804,7 +2831,7 @@ static NTSTATUS nfs41_CreateSrvCall(
  260.          status = _nfs41_CreateSrvCall(pCallbackContext);
  261.      } else {
  262.          status = RxDispatchToWorkerThread(nfs41_dev, DelayedWorkQueue,
  263. -            _nfs41_CreateSrvCall, pCallbackContext);
  264. +           (PRX_WORKERTHREAD_ROUTINE)_nfs41_CreateSrvCall, pCallbackContext);
  265.          if (status != STATUS_SUCCESS) {
  266.              print_error("RxDispatchToWorkerThread returned status %08lx\n",
  267.                  status);
  268. @@ -7618,83 +7645,83 @@ static NTSTATUS nfs41_init_ops()
  269.      // while the others continue to operate.
  270.      //
  271.  
  272. -    nfs41_ops.MRxStart                = nfs41_Start;
  273. -    nfs41_ops.MRxStop                 = nfs41_Stop;
  274. -    nfs41_ops.MRxDevFcbXXXControlFile = nfs41_DevFcbXXXControlFile;
  275. +    nfs41_ops.MRxStart                = (PMRX_CALLDOWN_CTX)nfs41_Start;
  276. +    nfs41_ops.MRxStop                 = (PMRX_CALLDOWN_CTX)nfs41_Stop;
  277. +    nfs41_ops.MRxDevFcbXXXControlFile = (PMRX_CALLDOWN)nfs41_DevFcbXXXControlFile;
  278.  
  279.      //
  280.      // Mini redirector name resolution.
  281.      //
  282.  
  283. -    nfs41_ops.MRxCreateSrvCall       = nfs41_CreateSrvCall;
  284. -    nfs41_ops.MRxSrvCallWinnerNotify = nfs41_SrvCallWinnerNotify;
  285. -    nfs41_ops.MRxCreateVNetRoot      = nfs41_CreateVNetRoot;
  286. -    nfs41_ops.MRxExtractNetRootName  = nfs41_ExtractNetRootName;
  287. -    nfs41_ops.MRxFinalizeSrvCall     = nfs41_FinalizeSrvCall;
  288. -    nfs41_ops.MRxFinalizeNetRoot     = nfs41_FinalizeNetRoot;
  289. -    nfs41_ops.MRxFinalizeVNetRoot    = nfs41_FinalizeVNetRoot;
  290. +    nfs41_ops.MRxCreateSrvCall       = (PMRX_CREATE_SRVCALL)nfs41_CreateSrvCall;
  291. +    nfs41_ops.MRxSrvCallWinnerNotify = (PMRX_SRVCALL_WINNER_NOTIFY)nfs41_SrvCallWinnerNotify;
  292. +    nfs41_ops.MRxCreateVNetRoot      = (PMRX_CREATE_V_NET_ROOT)nfs41_CreateVNetRoot;
  293. +    nfs41_ops.MRxExtractNetRootName  = (PMRX_EXTRACT_NETROOT_NAME)nfs41_ExtractNetRootName;
  294. +    nfs41_ops.MRxFinalizeSrvCall     = (PMRX_FINALIZE_SRVCALL_CALLDOWN)nfs41_FinalizeSrvCall;
  295. +    nfs41_ops.MRxFinalizeNetRoot     = (PMRX_FINALIZE_NET_ROOT_CALLDOWN)nfs41_FinalizeNetRoot;
  296. +    nfs41_ops.MRxFinalizeVNetRoot    = (PMRX_FINALIZE_V_NET_ROOT_CALLDOWN)nfs41_FinalizeVNetRoot;
  297.  
  298.      //
  299.      // File System Object Creation/Deletion.
  300.      //
  301.  
  302. -    nfs41_ops.MRxCreate            = nfs41_Create;
  303. -    nfs41_ops.MRxCollapseOpen      = nfs41_CollapseOpen;
  304. -    nfs41_ops.MRxShouldTryToCollapseThisOpen = nfs41_ShouldTryToCollapseThisOpen;
  305. -    nfs41_ops.MRxExtendForCache    = nfs41_ExtendForCache;
  306. -    nfs41_ops.MRxExtendForNonCache = nfs41_ExtendForCache;
  307. -    nfs41_ops.MRxCloseSrvOpen      = nfs41_CloseSrvOpen;
  308. -    nfs41_ops.MRxFlush             = nfs41_Flush;
  309. -    nfs41_ops.MRxDeallocateForFcb  = nfs41_DeallocateForFcb;
  310. -    nfs41_ops.MRxDeallocateForFobx = nfs41_DeallocateForFobx;
  311. -    nfs41_ops.MRxIsLockRealizable    = nfs41_IsLockRealizable;
  312. +    nfs41_ops.MRxCreate            = (PMRX_CALLDOWN)nfs41_Create;
  313. +    nfs41_ops.MRxCollapseOpen      = (PMRX_CALLDOWN)nfs41_CollapseOpen;
  314. +    nfs41_ops.MRxShouldTryToCollapseThisOpen = (PMRX_CALLDOWN)nfs41_ShouldTryToCollapseThisOpen;
  315. +    nfs41_ops.MRxExtendForCache    = (PMRX_EXTENDFILE_CALLDOWN)nfs41_ExtendForCache;
  316. +    nfs41_ops.MRxExtendForNonCache = (PMRX_EXTENDFILE_CALLDOWN)nfs41_ExtendForCache;
  317. +    nfs41_ops.MRxCloseSrvOpen      = (PMRX_CALLDOWN)nfs41_CloseSrvOpen;
  318. +    nfs41_ops.MRxFlush             = (PMRX_CALLDOWN)nfs41_Flush;
  319. +    nfs41_ops.MRxDeallocateForFcb  = (PMRX_DEALLOCATE_FOR_FCB)nfs41_DeallocateForFcb;
  320. +    nfs41_ops.MRxDeallocateForFobx = (PMRX_DEALLOCATE_FOR_FOBX)nfs41_DeallocateForFobx;
  321. +    nfs41_ops.MRxIsLockRealizable    = (PMRX_IS_LOCK_REALIZABLE)nfs41_IsLockRealizable;
  322.  
  323.      //
  324.      // File System Objects query/Set
  325.      //
  326.  
  327. -    nfs41_ops.MRxQueryDirectory       = nfs41_QueryDirectory;
  328. -    nfs41_ops.MRxQueryVolumeInfo      = nfs41_QueryVolumeInformation;
  329. -    nfs41_ops.MRxQueryEaInfo          = nfs41_QueryEaInformation;
  330. -    nfs41_ops.MRxSetEaInfo            = nfs41_SetEaInformation;
  331. -    nfs41_ops.MRxQuerySdInfo          = nfs41_QuerySecurityInformation;
  332. -    nfs41_ops.MRxSetSdInfo            = nfs41_SetSecurityInformation;
  333. -    nfs41_ops.MRxQueryFileInfo        = nfs41_QueryFileInformation;
  334. -    nfs41_ops.MRxSetFileInfo          = nfs41_SetFileInformation;
  335. +    nfs41_ops.MRxQueryDirectory       = (PMRX_CALLDOWN)nfs41_QueryDirectory;
  336. +    nfs41_ops.MRxQueryVolumeInfo      = (PMRX_CALLDOWN)nfs41_QueryVolumeInformation;
  337. +    nfs41_ops.MRxQueryEaInfo          = (PMRX_CALLDOWN)nfs41_QueryEaInformation;
  338. +    nfs41_ops.MRxSetEaInfo            = (PMRX_CALLDOWN)nfs41_SetEaInformation;
  339. +    nfs41_ops.MRxQuerySdInfo          = (PMRX_CALLDOWN)nfs41_QuerySecurityInformation;
  340. +    nfs41_ops.MRxSetSdInfo            = (PMRX_CALLDOWN)nfs41_SetSecurityInformation;
  341. +    nfs41_ops.MRxQueryFileInfo        = (PMRX_CALLDOWN)nfs41_QueryFileInformation;
  342. +    nfs41_ops.MRxSetFileInfo          = (PMRX_CALLDOWN)nfs41_SetFileInformation;
  343.  
  344.      //
  345.      // Buffering state change
  346.      //
  347.  
  348. -    nfs41_ops.MRxComputeNewBufferingState = nfs41_ComputeNewBufferingState;
  349. +    nfs41_ops.MRxComputeNewBufferingState = (PMRX_COMPUTE_NEW_BUFFERING_STATE)nfs41_ComputeNewBufferingState;
  350.  
  351.      //
  352.      // File System Object I/O
  353.      //
  354.  
  355. -    nfs41_ops.MRxLowIOSubmit[LOWIO_OP_READ]            = nfs41_Read;
  356. -    nfs41_ops.MRxLowIOSubmit[LOWIO_OP_WRITE]           = nfs41_Write;
  357. -    nfs41_ops.MRxLowIOSubmit[LOWIO_OP_SHAREDLOCK]      = nfs41_Lock;
  358. -    nfs41_ops.MRxLowIOSubmit[LOWIO_OP_EXCLUSIVELOCK]   = nfs41_Lock;
  359. -    nfs41_ops.MRxLowIOSubmit[LOWIO_OP_UNLOCK]          = nfs41_Unlock;
  360. -    nfs41_ops.MRxLowIOSubmit[LOWIO_OP_UNLOCK_MULTIPLE] = nfs41_Unlock;
  361. -    nfs41_ops.MRxLowIOSubmit[LOWIO_OP_FSCTL]           = nfs41_FsCtl;
  362. -    nfs41_ops.MRxLowIOSubmit[LOWIO_OP_IOCTL]           = nfs41_IoCtl;
  363. +    nfs41_ops.MRxLowIOSubmit[LOWIO_OP_READ]            = (PMRX_CALLDOWN)nfs41_Read;
  364. +    nfs41_ops.MRxLowIOSubmit[LOWIO_OP_WRITE]           = (PMRX_CALLDOWN)nfs41_Write;
  365. +    nfs41_ops.MRxLowIOSubmit[LOWIO_OP_SHAREDLOCK]      = (PMRX_CALLDOWN)nfs41_Lock;
  366. +    nfs41_ops.MRxLowIOSubmit[LOWIO_OP_EXCLUSIVELOCK]   = (PMRX_CALLDOWN)nfs41_Lock;
  367. +    nfs41_ops.MRxLowIOSubmit[LOWIO_OP_UNLOCK]          = (PMRX_CALLDOWN)nfs41_Unlock;
  368. +    nfs41_ops.MRxLowIOSubmit[LOWIO_OP_UNLOCK_MULTIPLE] = (PMRX_CALLDOWN)nfs41_Unlock;
  369. +    nfs41_ops.MRxLowIOSubmit[LOWIO_OP_FSCTL]           = (PMRX_CALLDOWN)nfs41_FsCtl;
  370. +    nfs41_ops.MRxLowIOSubmit[LOWIO_OP_IOCTL]           = (PMRX_CALLDOWN)nfs41_IoCtl;
  371.  
  372.      //
  373.      // Miscellanous
  374.      //
  375.  
  376. -    nfs41_ops.MRxCompleteBufferingStateChangeRequest =
  377. -        nfs41_CompleteBufferingStateChangeRequest;
  378. -    nfs41_ops.MRxIsValidDirectory     = nfs41_IsValidDirectory;
  379. +    nfs41_ops.MRxCompleteBufferingStateChangeRequest =
  380. +        (PMRX_CHANGE_BUFFERING_STATE_CALLDOWN)nfs41_CompleteBufferingStateChangeRequest;
  381. +    nfs41_ops.MRxIsValidDirectory     = (PMRX_CHKDIR_CALLDOWN)nfs41_IsValidDirectory;
  382.  
  383. -    nfs41_ops.MRxTruncate = nfs41_Unimplemented;
  384. -    nfs41_ops.MRxZeroExtend = nfs41_Unimplemented;
  385. -    nfs41_ops.MRxAreFilesAliased = nfs41_AreFilesAliased;
  386. -    nfs41_ops.MRxQueryQuotaInfo = nfs41_Unimplemented;
  387. -    nfs41_ops.MRxSetQuotaInfo = nfs41_Unimplemented;
  388. -    nfs41_ops.MRxSetVolumeInfo = nfs41_Unimplemented;
  389. +    nfs41_ops.MRxTruncate = (PMRX_CALLDOWN)nfs41_Unimplemented;
  390. +    nfs41_ops.MRxZeroExtend = (PMRX_CALLDOWN)nfs41_Unimplemented;
  391. +    nfs41_ops.MRxAreFilesAliased = (PMRX_CHKFCB_CALLDOWN)nfs41_AreFilesAliased;
  392. +    nfs41_ops.MRxQueryQuotaInfo = (PMRX_CALLDOWN)nfs41_Unimplemented;
  393. +    nfs41_ops.MRxSetQuotaInfo = (PMRX_CALLDOWN)nfs41_Unimplemented;
  394. +    nfs41_ops.MRxSetVolumeInfo = (PMRX_CALLDOWN)nfs41_Unimplemented;
  395.  
  396.      DbgR();
  397.      return(STATUS_SUCCESS);
  398. diff --git a/sys/wmlkm.c b/sys/wmlkm.c
  399. index 6c7161c..37fd8db 100644
  400. --- a/sys/wmlkm.c
  401. +++ b/sys/wmlkm.c
  402. @@ -23,6 +23,23 @@
  403.  
  404.  #pragma hdrstop
  405.  
  406. +/* FIXME: Why does VS22 need this, but not VC19 ? */
  407. +#if _MSC_VER >= 1900
  408. +#if defined(_WIN64) && defined(_M_X64)
  409. +#define _AMD64_
  410. +#elif defined(_WIN32) && defined(_M_IX86)
  411. +#define _X86_
  412. +#elif defined(_WIN64) && defined(_M_ARM64)
  413. +#define _ARM64_
  414. +#elif defined(_WIN32) && defined(_M_ARM)
  415. +#define _ARM_
  416. +#else
  417. +#error Unsupported arch
  418. +#endif
  419. +#endif /* _MSC_VER >= 1900 */
  420. +
  421. +
  422. +
  423.  #include <ntddk.h>
  424.  #include <ntdef.h>
  425.  #define LPVOID PVOID64 // BUG - need to find include for this

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