This patch fixes some issues when building for Windows on Visual Studio 2022 
(only supports target version 10) and current driver SDKs. The build is 
currently failing due to missing variables in msbuild properties and fails in 
driver verification.

Tested with VS 2022 and --with-vstudiotargetver=win10 and tested if it still 
works for VS2019 / Win8/8.1/10 using the ci build scripts. 
Tested for VS 2019 with same SDKs/WDKs installed in appveyor 2019 VM, as 
documented here: https://www.appveyor.com/docs/windows-images-software/

Remarks: It is getting more and more difficult to build for Win8 these days - 
so dropping support for Win8 in the near future is something that should be 
considered. Currently, installing an SDK above the Windows 11 SDK/WDK (build 
10.0.22000.1) will break the Win8 build regardless of whether it is installed 
for VS 2022 or VS 2019.


datapath-windows/automake / build script
-----------------------------------------------
VS2022 requires Version to be passed to StampInf, added version to Windows10 
make datapath_*. Splitted datapath_windows_analyze for win8 and win10, so this 
is now datapath_windows_analyze_win10 and datapath_windows_analyze_win8, both 
are called from build script. The ci build script will continue to work only 
with VS 2019 as it requires to build Win8 for install. 

msbuild configuration for Win10
-----------------------------------
- Fixed missing TargetVersion Windows10 which works currently for but building 
but is inconsistent set between build and package. In package it fails without 
TargetVersion as inf stamping requires a valid target version and target 
platform.
- Set DriverTargetPlatform to Universal, which is recommended here 
https://learn.microsoft.com/en-us/windows-hardware/drivers/develop/get-started-developing-windows-drivers
 if supported (see inf file updates).
- Set _NT_TARGET_VERSION=0x0A00 to target minimal Win 10/ Server 2016 version, 
see also 
https://techcommunity.microsoft.com/blog/windowsdriverdev/building-drivers-for-previous-os-releases-using-the-latest-windows-driver-kit-wd/4374910

datapath-windows/ovsext/Util.c
-----------------------------------
ExAllocatePoolWithTagPriority is deprecated and fails in Win10 driver 
verification.
Replaced ExAllocatePoolWithTagPriority with 
ExAllocatePoolPriorityUninitialized. The function OvsAllocateAlignedMemory 
seems to be unused, so a alternative may be to remove entire function. 


datapath-windows/ovsext/ovsext.inf
----------------------------------------
The inf file was minimally fixed in this patch. In second patch - as it is 
optional - I will add an updated inf file that supports running from driver 
store on supporting OS versions. 

Signed-off-by: Frank Wagner <frank.wag...@dbosoft.eu>

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to