On 8/6/24 03:06, Alin Gabriel Serdean wrote:
> Building with the latest WDK and SDK 10.0.26100.1. MSVC complains:
> warning C4996: 'ExAllocatePoolWithTagPriority': ExAllocatePoolWithTagPriority 
> is
>  deprecated, use ExAllocatePool3.
> warnings are treated as errors.
> 
> More information:
> https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-exallocatepoolwithtagpriority
> 
> Signed-off-by: Alin Gabriel Serdean <[email protected]>
> ---
>  datapath-windows/ovsext/Util.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/datapath-windows/ovsext/Util.c b/datapath-windows/ovsext/Util.c
> index d703b2468..387951f5e 100644
> --- a/datapath-windows/ovsext/Util.c
> +++ b/datapath-windows/ovsext/Util.c
> @@ -59,9 +59,12 @@ OvsAllocateAlignedMemory(size_t size, UINT16 align)
>           * XXX: NdisAllocateMemory*() functions don't talk anything about
>           * alignment. Hence using ExAllocatePool*();
>           */
> -        return (VOID *)ExAllocatePoolWithTagPriority(NonPagedPoolNx, size,
> -                                                     OVS_MEMORY_TAG,
> -                                                     NormalPoolPriority);
> +        POOL_EXTENDED_PARAMETER params = { 0 };
> +        params.Type = PoolExtendedParameterPriority;
> +        params.Priority = NormalPoolPriority;
> +        return (VOID *)ExAllocatePool3(POOL_FLAG_NON_PAGED, size,
> +                                       OVS_MEMORY_TAG, &params,
> +                                       1);
>      }

Looking at the docs, this API requires Windows 10, right?  Are we OK with
requiring Windows 10 to run OVS?  I guess, it's fine since Windows 8 reached
EoL last year.

However, do we even need this whole function at all?  I don't see functions
for aligned memory allocation (OvsAllocate/FreeAlignedMemory) to be used
anywhere in the code.  Maybe it's better to just remove them instead of trying
to maintain for no apparent reason?  Or am I missing something?

Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to