зеркало из https://github.com/microsoft/msquic.git
Update XDP Usage to v1.0 (#3796)
This commit is contained in:
Родитель
9d83455384
Коммит
41f0aa12c6
|
@ -16,7 +16,7 @@ trigger:
|
|||
- scripts/performance-helper.psm1
|
||||
- scripts/prepare-machine.ps1
|
||||
- scripts/RemoteTests.json
|
||||
- scripts/xdp-devkit.json
|
||||
- scripts/xdp.json
|
||||
- src/bin/*
|
||||
- src/core/*
|
||||
- src/platform/*
|
||||
|
|
|
@ -145,7 +145,7 @@ $NugetSourceFolder = Join-Path $RootDir "src/distribution"
|
|||
if ($UWP) {
|
||||
$PackageName = "Microsoft.Native.Quic.MsQuic.UWP.$Tls"
|
||||
} elseif ($XDP) {
|
||||
Copy-Item -Path (Join-Path $PSScriptRoot xdp-devkit.json) -Destination (Join-Path $PackagingDir xdp-devkit-temp.json)
|
||||
Copy-Item -Path (Join-Path $PSScriptRoot xdp.json) -Destination (Join-Path $PackagingDir xdp-temp.json)
|
||||
$PackageName = "Microsoft.Native.Quic.MsQuic.XDP.$Tls"
|
||||
} else {
|
||||
$PackageName = "Microsoft.Native.Quic.MsQuic.$Tls"
|
||||
|
|
|
@ -296,9 +296,8 @@ $RemoteDirectorySMB = $null
|
|||
# Copy manifest and log script to local directory
|
||||
Copy-Item -Path (Join-Path $RootDir scripts get-buildconfig.ps1) -Destination $LocalDirectory
|
||||
Copy-Item -Path (Join-Path $RootDir scripts log.ps1) -Destination $LocalDirectory
|
||||
Copy-Item -Path (Join-Path $RootDir scripts xdp-devkit.json) -Destination $LocalDirectory
|
||||
Copy-Item -Path (Join-Path $RootDir scripts xdp.json) -Destination $LocalDirectory
|
||||
Copy-Item -Path (Join-Path $RootDir scripts prepare-machine.ps1) -Destination $LocalDirectory
|
||||
Copy-Item -Path (Join-Path $RootDir scripts xdp-devkit.json) -Destination $LocalDirectory
|
||||
Copy-Item -Path (Join-Path $RootDir src manifest MsQuic.wprp) -Destination $LocalDirectory
|
||||
|
||||
if ($Local) {
|
||||
|
|
|
@ -225,9 +225,10 @@ function Install-Xdp-Sdk {
|
|||
rm -Force -Recurse $XdpPath -ErrorAction Ignore | Out-Null
|
||||
}
|
||||
if (!(Test-Path $XdpPath)) {
|
||||
Write-Host "Downloading XDP"
|
||||
Write-Host "Downloading XDP kit"
|
||||
$ZipPath = Join-Path $ArtifactsPath "xdp.zip"
|
||||
Invoke-WebRequest -Uri (Get-Content (Join-Path $PSScriptRoot "xdp-devkit.json") | ConvertFrom-Json).Path -OutFile $ZipPath
|
||||
Invoke-WebRequest -Uri (Get-Content (Join-Path $PSScriptRoot "xdp.json") | ConvertFrom-Json).kit -OutFile $ZipPath
|
||||
Write-Host "Extracting XDP kit"
|
||||
Expand-Archive -Path $ZipPath -DestinationPath $XdpPath -Force
|
||||
New-Item -Path "$ArtifactsPath\bin\xdp" -ItemType Directory -Force
|
||||
Copy-Item -Path "$XdpPath\symbols\*" -Destination "$ArtifactsPath\bin\xdp" -Force
|
||||
|
@ -240,24 +241,26 @@ function Install-Xdp-Sdk {
|
|||
# NB: XDP can be uninstalled via Uninstall-Xdp
|
||||
function Install-Xdp-Driver {
|
||||
if (!$IsWindows) { return } # Windows only
|
||||
$XdpPath = Join-Path $ArtifactsPath "xdp"
|
||||
if (!(Test-Path $XdpPath)) {
|
||||
Write-Error "XDP installation failed: driver file not present"
|
||||
}
|
||||
|
||||
Write-Host "Downloading XDP msi"
|
||||
$MsiPath = Join-Path $ArtifactsPath "xdp.msi"
|
||||
Invoke-WebRequest -Uri (Get-Content (Join-Path $PSScriptRoot "xdp.json") | ConvertFrom-Json).installer -OutFile $MsiPath
|
||||
Write-Host "Installing XDP driver"
|
||||
msiexec.exe /i $XdpPath\bin\xdp-for-windows.msi /quiet | Out-Null
|
||||
msiexec.exe /i $MsiPath /quiet | Out-Null
|
||||
}
|
||||
|
||||
# Completely removes the XDP driver and SDK.
|
||||
function Uninstall-Xdp {
|
||||
if (!$IsWindows) { return } # Windows only
|
||||
$MsiPath = Join-Path $ArtifactsPath "xdp.msi"
|
||||
if (Test-Path $MsiPath) {
|
||||
Write-Host "Uninstalling XDP driver"
|
||||
try { msiexec.exe /x $MsiPath /quiet | Out-Null } catch {}
|
||||
}
|
||||
$XdpPath = Join-Path $ArtifactsPath "xdp"
|
||||
if (!(Test-Path $XdpPath)) { return; }
|
||||
|
||||
Write-Host "Uninstalling XDP"
|
||||
try { msiexec.exe /x $XdpPath\bin\xdp-for-windows.msi /quiet | Out-Null } catch {}
|
||||
rm -Force -Recurse $XdpPath -ErrorAction Ignore | Out-Null
|
||||
if (Test-Path $XdpPath) {
|
||||
Write-Host "Deleting XDP kit"
|
||||
rm -Force -Recurse $XdpPath -ErrorAction Ignore | Out-Null
|
||||
}
|
||||
}
|
||||
|
||||
# Installs DuoNic from the CoreNet-CI repo.
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"path" : "https://github.com/microsoft/xdp-for-windows/releases/download/v0.17.0/xdp-devkit-x64-0.17.0.zip"
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
# Copyright (c) Microsoft Corporation.
|
||||
# Licensed under the MIT License.
|
||||
<#
|
||||
.Synopsis
|
||||
Install (or uninstall) XDP on Windows.
|
||||
.Parameter Destination
|
||||
The installation path of XDP.
|
||||
.Parameter Uninstall
|
||||
Uninstall XDP if installed. If not set, install XDP.
|
||||
.EXAMPLE
|
||||
Invoke this script directly from the web
|
||||
iex "& { $(irm https://aka.ms/xdp-install) }"
|
||||
#>
|
||||
param(
|
||||
[Parameter(Mandatory = $false)]
|
||||
[string] $Destination = ".\",
|
||||
|
||||
[Parameter(Mandatory = $false)]
|
||||
[switch] $Uninstall,
|
||||
|
||||
[Parameter(Mandatory = $false)]
|
||||
[switch] $SkipCerts
|
||||
)
|
||||
|
||||
#Requires -RunAsAdministrator
|
||||
|
||||
Set-StrictMode -Version 'Latest'
|
||||
$PSDefaultParameterValues['*:ErrorAction'] = 'Stop'
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
|
||||
$NetworkPath = (irm "https://raw.githubusercontent.com/microsoft/msquic/main/scripts/xdp-devkit.json").path
|
||||
$ZipPath = Join-Path $Destination "xdp.zip"
|
||||
$XdpPath = Join-Path $Destination "xdp"
|
||||
$InstallId = (Get-CimInstance Win32_Product -Filter "Name = 'XDP for Windows'").IdentifyingNumber
|
||||
|
||||
if (!$Uninstall) {
|
||||
# Clean up any previous install. Don't delete the old directory as it might
|
||||
# contain some other non-XDP files.
|
||||
if ($InstallId) {
|
||||
Write-Output "Uninstalling old XDP driver"
|
||||
try {
|
||||
msiexec.exe /x $InstallId /quiet | Out-Null
|
||||
} catch { }
|
||||
}
|
||||
|
||||
# Download and extract the latest version of the XDP kit (overwriting as
|
||||
# necessary).
|
||||
Write-Host "Downloading and extracting $NetworkPath"
|
||||
Invoke-WebRequest -Uri $NetworkPath -OutFile $ZipPath
|
||||
Expand-Archive -Path $ZipPath -DestinationPath $XdpPath -Force
|
||||
Remove-Item -Path $ZipPath
|
||||
|
||||
if (!$SkipCerts) {
|
||||
# Install the certificates to the necessary stores.
|
||||
Write-Host "Installing certificates"
|
||||
CertUtil.exe -addstore Root "$XdpPath\bin\CoreNetSignRoot.cer"
|
||||
CertUtil.exe -addstore TrustedPublisher "$XdpPath\bin\CoreNetSignRoot.cer"
|
||||
}
|
||||
|
||||
# Install the XDP driver.
|
||||
Write-Host "Installing XDP driver"
|
||||
msiexec.exe /i $XdpPath\bin\xdp-for-windows.msi /quiet | Out-Null
|
||||
|
||||
} elseif ($InstallId) {
|
||||
# Uninstall the XDP driver and delete the folder.
|
||||
Write-Output "Uninstalling XDP driver"
|
||||
try {
|
||||
msiexec.exe /x $InstallId /quiet
|
||||
} catch { }
|
||||
Remove-Item -Path $XdpPath -Recurse -Force
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"kit" : "https://github.com/microsoft/xdp-for-windows/releases/download/v1.0.0/xdp-devkit-x64-1.0.0.zip",
|
||||
"installer": "https://github.com/microsoft/xdp-for-windows/releases/download/v1.0.0/xdp-for-windows.1.0.0.msi"
|
||||
}
|
|
@ -1021,7 +1021,7 @@ CxPlatDpRawInitialize(
|
|||
const uint16_t* ProcessorList;
|
||||
|
||||
CxPlatListInitializeHead(&Xdp->Interfaces);
|
||||
if (QUIC_FAILED(XdpLoadApi(XDP_VERSION_PRERELEASE, &Xdp->XdpApiLoadContext, &Xdp->XdpApi))) {
|
||||
if (QUIC_FAILED(XdpLoadApi(XDP_API_VERSION_1, &Xdp->XdpApiLoadContext, &Xdp->XdpApi))) {
|
||||
Status = QUIC_STATUS_NOT_SUPPORTED;
|
||||
goto Error;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче