From 11893b19ac369f574d2b2202ffdc1caa7214c27e Mon Sep 17 00:00:00 2001 From: İsa Yurdagül <38290414+isayrdgl@users.noreply.github.com> Date: Mon, 4 Jul 2022 14:51:50 +0300 Subject: Memory leakage in message "sizeof(SCANNER_MESSAGE) * threadCount * requestCount" bytes long memory is allocated but only "sizeof(SCANNER_MESSAGE) * threadCount" bytes long of it is freed. --- filesys/miniFilter/scanner/user/scanUser.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/filesys/miniFilter/scanner/user/scanUser.c b/filesys/miniFilter/scanner/user/scanUser.c index e766261c..3160d5b4 100644 --- a/filesys/miniFilter/scanner/user/scanUser.c +++ b/filesys/miniFilter/scanner/user/scanUser.c @@ -151,7 +151,6 @@ Return Value { PSCANNER_NOTIFICATION notification; SCANNER_REPLY_MESSAGE replyMessage; - PSCANNER_MESSAGE message; LPOVERLAPPED pOvlp; BOOL result; DWORD outSize; @@ -254,8 +253,6 @@ Return Value } } - free( message ); - return hr; } @@ -271,7 +268,7 @@ main ( HANDLE threads[SCANNER_MAX_THREAD_COUNT]; SCANNER_THREAD_CONTEXT context; HANDLE port, completion; - PSCANNER_MESSAGE msg; + PSCANNER_MESSAGE messages; DWORD threadId; HRESULT hr; DWORD i, j; @@ -342,12 +339,14 @@ main ( context.Port = port; context.Completion = completion; + messages = malloc(sizeof(SCANNER_MESSAGE) * threadCount * requestCount); + // // Create specified number of threads. // for (i = 0; i < threadCount; i++) { - + threads[i] = CreateThread( NULL, 0, (LPTHREAD_START_ROUTINE) ScannerWorker, @@ -372,14 +371,8 @@ main ( // Allocate the message. // -#pragma prefast(suppress:__WARNING_MEMORY_LEAK, "msg will not be leaked because it is freed in ScannerWorker") - msg = malloc( sizeof( SCANNER_MESSAGE ) ); - if (msg == NULL) { - - hr = ERROR_NOT_ENOUGH_MEMORY; - goto main_cleanup; - } + PSCANNER_MESSAGE msg = &(messages[i * j]); memset( &msg->Ovlp, 0, sizeof( OVERLAPPED ) ); @@ -393,8 +386,6 @@ main ( &msg->Ovlp ); if (hr != HRESULT_FROM_WIN32( ERROR_IO_PENDING )) { - - free( msg ); goto main_cleanup; } } @@ -403,7 +394,7 @@ main ( hr = S_OK; WaitForMultipleObjectsEx( i, threads, TRUE, INFINITE, FALSE ); - + main_cleanup: printf( "Scanner: All done. Result = 0x%08x\n", hr ); @@ -411,6 +402,8 @@ main_cleanup: CloseHandle( port ); CloseHandle( completion ); + free(messages); + return hr; } -- cgit v1.3.1 From 054b7fd9bddba6e5d52eb894c6449b8637d5a9bc Mon Sep 17 00:00:00 2001 From: İsa Yurdagül <38290414+isayrdgl@users.noreply.github.com> Date: Tue, 5 Jul 2022 14:07:19 +0300 Subject: Handles malloc function fail case --- filesys/miniFilter/scanner/user/scanUser.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/filesys/miniFilter/scanner/user/scanUser.c b/filesys/miniFilter/scanner/user/scanUser.c index 3160d5b4..23ab37f3 100644 --- a/filesys/miniFilter/scanner/user/scanUser.c +++ b/filesys/miniFilter/scanner/user/scanUser.c @@ -341,6 +341,12 @@ main ( messages = malloc(sizeof(SCANNER_MESSAGE) * threadCount * requestCount); + if (messages == NULL) { + + hr = ERROR_NOT_ENOUGH_MEMORY; + goto main_cleanup; + } + // // Create specified number of threads. // -- cgit v1.3.1 From f6b5a19b6e6327b6ad97ac94bdc0a26c2f01437e Mon Sep 17 00:00:00 2001 From: İsa Yurdagül <38290414+isayrdgl@users.noreply.github.com> Date: Wed, 6 Jul 2022 12:24:25 +0300 Subject: Refactors comment line --- filesys/miniFilter/scanner/user/scanUser.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/filesys/miniFilter/scanner/user/scanUser.c b/filesys/miniFilter/scanner/user/scanUser.c index 23ab37f3..13dd3494 100644 --- a/filesys/miniFilter/scanner/user/scanUser.c +++ b/filesys/miniFilter/scanner/user/scanUser.c @@ -339,6 +339,10 @@ main ( context.Port = port; context.Completion = completion; + // + // Allocate messages. + // + messages = malloc(sizeof(SCANNER_MESSAGE) * threadCount * requestCount); if (messages == NULL) { @@ -373,11 +377,6 @@ main ( for (j = 0; j < requestCount; j++) { - // - // Allocate the message. - // - - PSCANNER_MESSAGE msg = &(messages[i * j]); memset( &msg->Ovlp, 0, sizeof( OVERLAPPED ) ); -- cgit v1.3.1 From a0e28e02cbd274de30e64abd38d8690dd45396a9 Mon Sep 17 00:00:00 2001 From: İsa Yurdagül <38290414+isayrdgl@users.noreply.github.com> Date: Wed, 6 Jul 2022 12:41:08 +0300 Subject: Solves the miscalculation of the message index --- filesys/miniFilter/scanner/user/scanUser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/filesys/miniFilter/scanner/user/scanUser.c b/filesys/miniFilter/scanner/user/scanUser.c index 13dd3494..b4605156 100644 --- a/filesys/miniFilter/scanner/user/scanUser.c +++ b/filesys/miniFilter/scanner/user/scanUser.c @@ -376,8 +376,8 @@ main ( } for (j = 0; j < requestCount; j++) { - - PSCANNER_MESSAGE msg = &(messages[i * j]); + + PSCANNER_MESSAGE msg = &(messages[i * requestCount + j]); memset( &msg->Ovlp, 0, sizeof( OVERLAPPED ) ); -- cgit v1.3.1 From 54466dac1149ba84e0ebff353eca8922cbdc5908 Mon Sep 17 00:00:00 2001 From: Fredrik Orderud Date: Mon, 11 Dec 2023 12:17:19 +0100 Subject: simbatt: Fix broken registry read-back The GetSimBattStateFromRegistry function is currently using default settings if GetSimBattStateFromRegistry succeeds, whereas settings from registry are only applied if GetSimBattStateFromRegistry fails. This does not make sense to me. Therefore proposing to remove the `!` negation from `if (!NT_SUCCESS(Status)) {` on the line after `Status = GetSimBattStateFromRegistry(Device, RegState);` so that default settings are loaded when registry read-back fails. --- simbatt/func/miniclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simbatt/func/miniclass.c b/simbatt/func/miniclass.c index ba2df340..612b4c66 100644 --- a/simbatt/func/miniclass.c +++ b/simbatt/func/miniclass.c @@ -202,7 +202,7 @@ Return Value: } Status = GetSimBattStateFromRegistry(Device, RegState); - if (!NT_SUCCESS(Status)) { + if (NT_SUCCESS(Status)) { RtlZeroMemory(RegState, sizeof(SIMBATT_STATE)); WdfWaitLockAcquire(DevExt->StateLock, NULL); -- cgit v1.3.1 From 59050f0d2a891f59987469ab79fe73411f5eb891 Mon Sep 17 00:00:00 2001 From: İsa Yurdagül <38290414+isayrdgl@users.noreply.github.com> Date: Thu, 23 May 2024 11:47:46 +0300 Subject: Issue of freeing memory without waiting completion of threads accessing it is fixed --- filesys/miniFilter/scanner/user/scanUser.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/filesys/miniFilter/scanner/user/scanUser.c b/filesys/miniFilter/scanner/user/scanUser.c index b4605156..82dc2fd5 100644 --- a/filesys/miniFilter/scanner/user/scanUser.c +++ b/filesys/miniFilter/scanner/user/scanUser.c @@ -151,6 +151,7 @@ Return Value { PSCANNER_NOTIFICATION notification; SCANNER_REPLY_MESSAGE replyMessage; + PSCANNER_MESSAGE message; LPOVERLAPPED pOvlp; BOOL result; DWORD outSize; @@ -265,13 +266,12 @@ main ( { DWORD requestCount = SCANNER_DEFAULT_REQUEST_COUNT; DWORD threadCount = SCANNER_DEFAULT_THREAD_COUNT; - HANDLE threads[SCANNER_MAX_THREAD_COUNT]; + HANDLE threads[SCANNER_MAX_THREAD_COUNT] = { NULL }; SCANNER_THREAD_CONTEXT context; HANDLE port, completion; PSCANNER_MESSAGE messages; DWORD threadId; HRESULT hr; - DWORD i, j; // // Check how many threads and per thread requests are desired. @@ -355,7 +355,7 @@ main ( // Create specified number of threads. // - for (i = 0; i < threadCount; i++) { + for (DWORD i = 0; i < threadCount; i++) { threads[i] = CreateThread( NULL, 0, @@ -375,7 +375,7 @@ main ( goto main_cleanup; } - for (j = 0; j < requestCount; j++) { + for (DWORD j = 0; j < requestCount; j++) { PSCANNER_MESSAGE msg = &(messages[i * requestCount + j]); @@ -397,11 +397,13 @@ main ( } hr = S_OK; - - WaitForMultipleObjectsEx( i, threads, TRUE, INFINITE, FALSE ); main_cleanup: + for (INT i = 0; threads[i] != NULL; ++i) { + WaitForSingleObjectEx(threads[i], INFINITE, FALSE); + } + printf( "Scanner: All done. Result = 0x%08x\n", hr ); CloseHandle( port ); -- cgit v1.3.1 From 015ee1d12e6f22c62aa3057668eea9ab737e5ed8 Mon Sep 17 00:00:00 2001 From: İsa Yurdagül <38290414+isayrdgl@users.noreply.github.com> Date: Fri, 24 May 2024 11:15:02 +0300 Subject: Fixes information leakage warning Fixes the issue of possible information leakage from uninitialized padding bytes --- filesys/miniFilter/scanner/user/scanUser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filesys/miniFilter/scanner/user/scanUser.c b/filesys/miniFilter/scanner/user/scanUser.c index 82dc2fd5..201f0a45 100644 --- a/filesys/miniFilter/scanner/user/scanUser.c +++ b/filesys/miniFilter/scanner/user/scanUser.c @@ -343,7 +343,7 @@ main ( // Allocate messages. // - messages = malloc(sizeof(SCANNER_MESSAGE) * threadCount * requestCount); + messages = calloc(threadCount * requestCount, sizeof(SCANNER_MESSAGE)); if (messages == NULL) { -- cgit v1.3.1 From fcb15d6e90b644fd13e545ff1cb5f3672a828733 Mon Sep 17 00:00:00 2001 From: İsa Yurdagül <38290414+isayrdgl@users.noreply.github.com> Date: Sat, 25 May 2024 21:54:02 +0300 Subject: Avoids possible multiplication overflow warning --- filesys/miniFilter/scanner/user/scanUser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filesys/miniFilter/scanner/user/scanUser.c b/filesys/miniFilter/scanner/user/scanUser.c index 201f0a45..f990c550 100644 --- a/filesys/miniFilter/scanner/user/scanUser.c +++ b/filesys/miniFilter/scanner/user/scanUser.c @@ -343,7 +343,7 @@ main ( // Allocate messages. // - messages = calloc(threadCount * requestCount, sizeof(SCANNER_MESSAGE)); + messages = calloc((DWORD) threadCount * requestCount, sizeof(SCANNER_MESSAGE)); if (messages == NULL) { -- cgit v1.3.1 From eeb01308a611b0f27e64aa7cca1e140b7ec902a0 Mon Sep 17 00:00:00 2001 From: İsa Yurdagül <38290414+isayrdgl@users.noreply.github.com> Date: Wed, 29 May 2024 21:24:30 +0300 Subject: Avoids possible multiplication overflow warning --- filesys/miniFilter/scanner/user/scanUser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filesys/miniFilter/scanner/user/scanUser.c b/filesys/miniFilter/scanner/user/scanUser.c index f990c550..08b948b3 100644 --- a/filesys/miniFilter/scanner/user/scanUser.c +++ b/filesys/miniFilter/scanner/user/scanUser.c @@ -343,7 +343,7 @@ main ( // Allocate messages. // - messages = calloc((DWORD) threadCount * requestCount, sizeof(SCANNER_MESSAGE)); + messages = calloc(((size_t) threadCount) * requestCount, sizeof(SCANNER_MESSAGE)); if (messages == NULL) { -- cgit v1.3.1 From e59949f40da211f378e8f76bee383506d9b97243 Mon Sep 17 00:00:00 2001 From: Matt <138825652+middlemose@users.noreply.github.com> Date: Mon, 24 Jun 2024 11:14:36 -0700 Subject: CI Pipelines build with WDK Nuget Packages (#1179) Integrate nuget into the workflow pipelines --- .github/scripts/Install-Vsix.ps1 | 68 +++++++++++++++++++++++++++++++++++++ .github/workflows/Code-Scanning.yml | 56 +++++++++++++++--------------- .github/workflows/ci-pr.yml | 10 +++--- .github/workflows/ci.yml | 13 +++---- Build-SampleSet.ps1 | 24 +++++++++---- Env-Vars.ps1 | 9 +++++ 6 files changed, 135 insertions(+), 45 deletions(-) create mode 100644 .github/scripts/Install-Vsix.ps1 create mode 100644 Env-Vars.ps1 diff --git a/.github/scripts/Install-Vsix.ps1 b/.github/scripts/Install-Vsix.ps1 new file mode 100644 index 00000000..24c7ef45 --- /dev/null +++ b/.github/scripts/Install-Vsix.ps1 @@ -0,0 +1,68 @@ +<# + +.SYNOPSIS +Checks WDK vsix version and downloads and installs as necessary. + +#> + +[CmdletBinding()] +param( + [bool]$optimize = $false +) + +$root = Get-Location + +# launch developer powershell (if necessary) +if (-not $env:VSCMD_VER) { + Import-Module (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*\Common7\Tools\Microsoft.VisualStudio.DevShell.dll") + Enter-VsDevShell -VsInstallPath (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*") + cd $root +} + +# source environment variables +. .\Env-Vars.ps1 + +$version = $env:SAMPLES_VSIX_VERSION +$uri = $env:SAMPLES_VSIX_URI + +function PrintWdkVsix { + $installed = ls "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=*" | Select -ExpandProperty Name + "WDK Vsix Version: $installed" +} + +function TestWdkVsix { + Test-Path "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=$version" +} + +if ($optimize) { + "---> Downloading vsix and configuring build environment..." + Invoke-WebRequest -Uri "$uri" -OutFile wdk.zip + Expand-Archive ".\wdk.zip" .\ + cp ".\`$MSBuild\*" (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*\MSBuild\") -Recurse -Force + "<--- Finished" +} +else { + "Getting installed WDK vsix..." + PrintWdkVsix + "Checking the WDK.vsix version installed..." + if (-not (TestWdkVsix)) { + "The correct WDK vsix is not installed." + "Will attempt to download and install now..." + Invoke-WebRequest -Uri "$uri" -OutFile wdk.vsix + "Finished downloading." + "Starting install process. This will take some time to complete..." + Start-Process vsixinstaller -ArgumentList "/f /q /sp .\wdk.vsix" -wait + "The install process has finished." + "Checking the WDK.vsix version installed..." + if (TestWdkVsix) { + PrintWdkVsix + "The WDK vsix version is OK" + } + else { + "The WDK vsix install FAILED" + Write-Host "`u{274C} wdk vsix install had an issue" + Write-Error "the wdk vsix cannot be installed at this time" + exit 1 + } + } +} \ No newline at end of file diff --git a/.github/workflows/Code-Scanning.yml b/.github/workflows/Code-Scanning.yml index a18bcf95..32bb5a65 100644 --- a/.github/workflows/Code-Scanning.yml +++ b/.github/workflows/Code-Scanning.yml @@ -32,31 +32,31 @@ jobs: language: [ 'cpp' ] steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - submodules: 'recursive' - - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - packs: microsoft/windows-drivers - - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v2 - - - name: Retrieve and build all available solutions - run: | - .\Build-AllSamples.ps1 -Verbose -ThrottleLimit 1 - env: - WDS_Configuration: Debug - WDS_Platform: x64 - WDS_WipeOutputs: ${{ true }} - - - name: Perform CodeQL analysis - uses: github/codeql-action/analyze@v3 - with: - category: "/language:${{matrix.language}}" - - - + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - name: Install WDK VSIX + run: .\.github\scripts\Install-Vsix.ps1 -optimize:$true + + - name: Install Nuget Packages + run: nuget restore .\packages.config -PackagesDirectory .\packages\ + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + packs: microsoft/windows-drivers + + - name: Retrieve and build all available solutions + run: .\Build-AllSamples.ps1 -Verbose -ThrottleLimit 1 + env: + WDS_Configuration: Debug + WDS_Platform: x64 + WDS_WipeOutputs: ${{ true }} + + - name: Perform CodeQL analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index 7640b966..a179127a 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -22,8 +22,11 @@ jobs: with: submodules: 'recursive' - - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v2 + - name: Install WDK VSIX + run: .\.github\scripts\Install-Vsix.ps1 -optimize:$true + + - name: Install Nuget Packages + run: nuget restore .\packages.config -PackagesDirectory .\packages\ - name: Get changed files id: get-changed-files @@ -63,8 +66,7 @@ jobs: path: _logs - name: Join and generate global reports - run: | - .\.github\scripts\Join-CsvReports.ps1 + run: .\.github\scripts\Join-CsvReports.ps1 - name: Archive global overview build reports uses: actions/upload-artifact@v3 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad92f83b..13563aa8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,12 +22,14 @@ jobs: with: submodules: 'recursive' - - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v2 + - name: Install WDK VSIX + run: .\.github\scripts\Install-Vsix.ps1 -optimize:$true + + - name: Install Nuget Packages + run: nuget restore .\packages.config -PackagesDirectory .\packages\ - name: Retrieve and build all available solutions - run: | - .\Build-AllSamples.ps1 -Verbose + run: .\Build-AllSamples.ps1 -Verbose env: WDS_Configuration: ${{ matrix.configuration }} WDS_Platform: ${{ matrix.platform }} @@ -56,8 +58,7 @@ jobs: path: _logs - name: Join and generate global reports - run: | - .\.github\scripts\Join-CsvReports.ps1 + run: .\.github\scripts\Join-CsvReports.ps1 - name: Archive global overview build reports uses: actions/upload-artifact@v3 diff --git a/Build-SampleSet.ps1 b/Build-SampleSet.ps1 index b0da097a..2197b967 100644 --- a/Build-SampleSet.ps1 +++ b/Build-SampleSet.ps1 @@ -9,6 +9,17 @@ param( ) $root = Get-Location + +# launch developer powershell (if necessary) +if (-not $env:VSCMD_VER) { + Import-Module (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*\Common7\Tools\Microsoft.VisualStudio.DevShell.dll") + Enter-VsDevShell -VsInstallPath (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*") + cd $root +} + +# source environment variables +. .\Env-Vars.ps1 + $ThrottleFactor = 5 $LogicalProcessors = (Get-CIMInstance -Class 'CIM_Processor' -Verbose:$false).NumberOfLogicalProcessors @@ -51,21 +62,20 @@ finally { $build_environment="" $build_number=0 # -# WDK NuGet will require presence of a folder 'packages' +# In Github we build using Nuget only and source version from repo .\Env-Vars.ps1. # -# -# Hack: In GitHub we do not have an environment variable where we can see WDK build number, so we have it hard coded. -# -if (-not $env:GITHUB_REPOSITORY -eq '') { +if ($env:GITHUB_REPOSITORY) { $build_environment="GitHub" - $build_number=22621 + $build_number=$env:SAMPLES_BUILD_NUMBER } # +# WDK NuGet will require presence of a folder 'packages'. The version is sourced from repo .\Env-Vars.ps1. +# # Hack: If user has hydrated nuget packages, then use those. That will be indicated by presence of a folder named .\packages. # elseif(Test-Path(".\packages")) { $build_environment=("NuGet") - $build_number=26100 + $build_number=$env:SAMPLES_BUILD_NUMBER } # # EWDK sets environment variable BuildLab. For example 'ni_release_svc_prod1.22621.2428'. diff --git a/Env-Vars.ps1 b/Env-Vars.ps1 new file mode 100644 index 00000000..0d37e03c --- /dev/null +++ b/Env-Vars.ps1 @@ -0,0 +1,9 @@ +# Environment variables for script sourcing. +# Note: When a new WDK ships the following need to be updated: +# 1. Environment variables in .\Env-Vars.ps1 (this script) +# 2. Nuget package versions in .\packages.config +# 3. Nuget package versions in .\Directory.Build.props +# 4. SDK and WDK versions and WDK vsix link in .\configuration.dsc.yaml +$env:SAMPLES_VSIX_VERSION = "10.0.26100.0" +$env:SAMPLES_VSIX_URI = "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/DriverDeveloperKits-WDK/vsextensions/WDKVsix/10.0.26100.0/vspackage?targetPlatform=5e3e564c-03bb-4499-8ae5-b2b35e9a86dc" +$env:SAMPLES_BUILD_NUMBER = "26100" -- cgit v1.3.1 From 1704d357a37623a8d03f0e5d2d6d4cfe45920b1c Mon Sep 17 00:00:00 2001 From: JakobL-MSFT <110699333+JakobL-MSFT@users.noreply.github.com> Date: Mon, 24 Jun 2024 18:56:23 -0700 Subject: FI from main to develop (#1188) Fix text and minor issues in Winget configuration files Co-authored-by: Adonais Romero Gonzalez --- configuration.dsc.yaml | 30 ++++++++++++------------------ configuration_vsonly.dsc.yaml | 6 +++--- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/configuration.dsc.yaml b/configuration.dsc.yaml index 3bb6b668..f8245c08 100644 --- a/configuration.dsc.yaml +++ b/configuration.dsc.yaml @@ -4,18 +4,18 @@ properties: - resource: Microsoft.WinGet.DSC/WinGetPackage id: vsPackage directives: - description: Install Visual Studio Community 2022 + description: Install Visual Studio 2022 Community allowPrerelease: true settings: id: Microsoft.VisualStudio.2022.Community source: winget + useLatest: true - resource: Microsoft.VisualStudio.DSC/VSComponents id: vsComponents dependsOn: - vsPackage directives: - description: Install required VS workloads - allowPrerelease: true + description: Install required VS workloads and components settings: productId: Microsoft.VisualStudio.Product.Community channelId: VisualStudio.17.Release @@ -42,28 +42,26 @@ properties: - Microsoft.VisualStudio.Component.VC.MFC.ARM64 - Microsoft.VisualStudio.Component.VC.MFC.ARM64.Spectre - Microsoft.VisualStudio.Workload.NativeDesktop - - resource: Microsoft.WinGet.DSC/WinGetPackage id: sdkPackage - dependsOn: - - vsComponents directives: - description: Install Windows SDK + description: Install Windows SDK version 26100 allowPrerelease: true settings: id: Microsoft.WindowsSDK.10.0.26100 source: winget + useLatest: true - resource: Microsoft.WinGet.DSC/WinGetPackage id: wdkPackage dependsOn: - sdkPackage - - vsComponents directives: - description: Install Windows Driver Kit + description: Install Windows Driver Kit version 26100 allowPrerelease: true settings: id: Microsoft.WindowsWDK.10.0.26100 source: winget + useLatest: true - resource: PSDscResources/Script id: wdkVsix dependsOn: @@ -73,15 +71,11 @@ properties: description: Install Windows Driver Kit VSIX settings: GetScript: | - return & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -nologo -latest -products Microsoft.VisualStudio.Product.Community -requires Microsoft.Windows.DriverKit -property installationVersion + return & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -nologo -version '[17.0,18.0)' -requires Microsoft.Windows.DriverKit -property installationVersion SetScript: | - $path = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -nologo -latest -products * -property enginePath | Join-Path -ChildPath 'VSIXInstaller.exe' - $arch = $env:PROCESSOR_ARCHITECTURE - if (Test-Path $path) { & $path /q "${env:ProgramFiles(x86)}\Windows Kits\10\Vsix\VS2022\10.0.26100.0\$arch\WDK.vsix" } + $installerPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -nologo -latest -products * -property enginePath | Join-Path -ChildPath 'VSIXInstaller.exe' + if (Test-Path $installerPath) { & $installerPath /q "${env:ProgramFiles(x86)}\Windows Kits\10\Vsix\VS2022\10.0.26100.0\${env:PROCESSOR_ARCHITECTURE}\WDK.vsix" } TestScript: | - $versionString = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -nologo -latest -products Microsoft.VisualStudio.Product.Community -requires Microsoft.Windows.DriverKit -Property installationVersion - if (-not $versionString) { return $false } - $versionArray = $versionString.Split('.') - if ($versionArray[0] -le 17) { return $false } - return $true + $versionString = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -nologo -version '[17.0,18.0)' -requires Microsoft.Windows.DriverKit -property installationVersion + return $versionString -match "^17\." configurationVersion: 0.2.0 diff --git a/configuration_vsonly.dsc.yaml b/configuration_vsonly.dsc.yaml index b7764f0f..6ce4fc83 100644 --- a/configuration_vsonly.dsc.yaml +++ b/configuration_vsonly.dsc.yaml @@ -4,18 +4,18 @@ properties: - resource: Microsoft.WinGet.DSC/WinGetPackage id: vsPackage directives: - description: Install Visual Studio Community 2022 + description: Install Visual Studio 2022 Community allowPrerelease: true settings: id: Microsoft.VisualStudio.2022.Community source: winget + useLatest: true - resource: Microsoft.VisualStudio.DSC/VSComponents id: vsComponents dependsOn: - vsPackage directives: - description: Install required VS workloads - allowPrerelease: true + description: Install required VS workloads and components settings: productId: Microsoft.VisualStudio.Product.Community channelId: VisualStudio.17.Release -- cgit v1.3.1 From 6dabe4ef5fa80d5a565705edeb6a0dcb98b30f80 Mon Sep 17 00:00:00 2001 From: Matt <138825652+middlemose@users.noreply.github.com> Date: Tue, 25 Jun 2024 10:51:36 -0700 Subject: Improve version info, vsix installation, and update building locally readme --- .github/scripts/Install-Vsix.ps1 | 40 ++++++++++++++++++++++++---------------- Build-SampleSet.ps1 | 23 ++++++++++++++--------- Building-Locally.md | 6 +++++- Env-Vars.ps1 | 9 --------- 4 files changed, 43 insertions(+), 35 deletions(-) delete mode 100644 Env-Vars.ps1 diff --git a/.github/scripts/Install-Vsix.ps1 b/.github/scripts/Install-Vsix.ps1 index 24c7ef45..8579b36b 100644 --- a/.github/scripts/Install-Vsix.ps1 +++ b/.github/scripts/Install-Vsix.ps1 @@ -12,34 +12,42 @@ param( $root = Get-Location -# launch developer powershell (if necessary) -if (-not $env:VSCMD_VER) { - Import-Module (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*\Common7\Tools\Microsoft.VisualStudio.DevShell.dll") - Enter-VsDevShell -VsInstallPath (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*") - cd $root -} +# launch developer powershell +Import-Module (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*\Common7\Tools\Microsoft.VisualStudio.DevShell.dll") +Enter-VsDevShell -VsInstallPath (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*") +cd $root + +# Automatically resolve the latest amd64 VSIX +$uri = "https://marketplace.visualstudio.com$((Invoke-WebRequest -Uri "https://marketplace.visualstudio.com/items?itemName=DriverDeveloperKits-WDK.WDKVsix").Links | Where-Object outerHTML -like '*(amd64)*' | select -expand href)" -# source environment variables -. .\Env-Vars.ps1 +# Set local version variable +$version = ([regex]'(\d+\.)(\d+\.)(\d+\.)(\d+)').Matches($uri).Value -$version = $env:SAMPLES_VSIX_VERSION -$uri = $env:SAMPLES_VSIX_URI +# Set github environment variable for vsix version +"SAMPLES_VSIX_VERSION=$version" | Out-File -FilePath "$env:GITHUB_ENV" -Append function PrintWdkVsix { - $installed = ls "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=*" | Select -ExpandProperty Name - "WDK Vsix Version: $installed" + "WDK Vsix Version: $(ls "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=*" | Select -ExpandProperty Name)" } function TestWdkVsix { Test-Path "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=$version" } +# NOTE: The '$optimize' code path examines the '.vsixmanifest' when downloaded and then examines it again (in the 'MSBuild' directory) once +# the necessary extension files are copied. if ($optimize) { - "---> Downloading vsix and configuring build environment..." + $msbuild_path = (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*\MSBuild\") + "---> Downloading vsix version: $version" Invoke-WebRequest -Uri "$uri" -OutFile wdk.zip Expand-Archive ".\wdk.zip" .\ - cp ".\`$MSBuild\*" (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*\MSBuild\") -Recurse -Force - "<--- Finished" + "Downloaded VSIX Version: $(([xml](Get-Content .\extension.vsixmanifest)).PackageManifest.Metadata.Identity.Version)" + "<--- Download complete" + "---> Configuring build environment..." + cp ".\`$MSBuild\*" "$msbuild_path" -Recurse -Force + cp ".\extension.vsixmanifest" "$msbuild_path" + "Installed VSIX Version: $(([xml](Get-Content ${msbuild_path}\extension.vsixmanifest)).PackageManifest.Metadata.Identity.Version)" + "<--- Configuration complete" } else { "Getting installed WDK vsix..." @@ -65,4 +73,4 @@ else { exit 1 } } -} \ No newline at end of file +} diff --git a/Build-SampleSet.ps1 b/Build-SampleSet.ps1 index 2197b967..5be14dcf 100644 --- a/Build-SampleSet.ps1 +++ b/Build-SampleSet.ps1 @@ -10,16 +10,13 @@ param( $root = Get-Location -# launch developer powershell (if necessary) +# launch developer powershell (if necessary to prevent multiple developer sessions) if (-not $env:VSCMD_VER) { Import-Module (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*\Common7\Tools\Microsoft.VisualStudio.DevShell.dll") Enter-VsDevShell -VsInstallPath (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*") cd $root } -# source environment variables -. .\Env-Vars.ps1 - $ThrottleFactor = 5 $LogicalProcessors = (Get-CIMInstance -Class 'CIM_Processor' -Verbose:$false).NumberOfLogicalProcessors @@ -56,26 +53,30 @@ finally { } # -# Determine build environment: 'GitHub', 'NuGet', 'EWDK', or 'WDK'. Only used to determine build number. +# Determine build environment: 'GitHub', 'NuGet', 'EWDK', or 'WDK'. # Determine build number (used for exclusions based on build number). Five digits. Say, '22621'. # $build_environment="" $build_number=0 +$nuget_package_version=0 # # In Github we build using Nuget only and source version from repo .\Env-Vars.ps1. # if ($env:GITHUB_REPOSITORY) { $build_environment="GitHub" - $build_number=$env:SAMPLES_BUILD_NUMBER + $nuget_package_version=([regex]'(?<=x64\.)(\d+\.)(\d+\.)(\d+\.)(\d+)').Matches((Get-Childitem .\packages\*WDK.x64* -Name)).Value + $build_number=$nuget_package_version.split('.')[2] } # # WDK NuGet will require presence of a folder 'packages'. The version is sourced from repo .\Env-Vars.ps1. # -# Hack: If user has hydrated nuget packages, then use those. That will be indicated by presence of a folder named .\packages. +# Hack: If user has hydrated nuget packages, then use those. That will be indicated by presence of a folder named '.\packages'. +# Further, we need to test that the directory has been hydrated using '.\packages\*'. # -elseif(Test-Path(".\packages")) { +elseif(Test-Path(".\packages\*")) { $build_environment=("NuGet") - $build_number=$env:SAMPLES_BUILD_NUMBER + $nuget_package_version=([regex]'(?<=x64\.)(\d+\.)(\d+\.)(\d+\.)(\d+)').Matches((Get-Childitem .\packages\*WDK.x64* -Name)).Value + $build_number=$nuget_package_version.split('.')[2] } # # EWDK sets environment variable BuildLab. For example 'ni_release_svc_prod1.22621.2428'. @@ -164,6 +165,10 @@ $jresult = @{ $SolutionsTotal = $sampleSet.Count * $Configurations.Count * $Platforms.Count Write-Output ("Build Environment: " + $build_environment) +if (($build_environment -eq "GitHub") -or ($build_environment -eq "NuGet")) { + Write-Output ("Nuget Package Version: " + $nuget_package_version) +} +Write-Output ("WDK VSIX Version: " + ($env:SAMPLES_VSIX_VERSION) ? $env:SAMPLES_VSIX_VERSION : (ls "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=*" | Select -ExpandProperty Name).split('=')[1]) Write-Output ("Build Number: " + $build_number) Write-Output ("Samples: " + $sampleSet.Count) Write-Output ("Configurations: " + $Configurations.Count + " (" + $Configurations + ")") diff --git a/Building-Locally.md b/Building-Locally.md index bb9fc610..e3db8dde 100644 --- a/Building-Locally.md +++ b/Building-Locally.md @@ -79,7 +79,11 @@ To build the Windows Driver Samples you need a "driver build environment". In e ### Option A: Use WDK NuGet Packages * See [Download the Windows Driver Kit (WDK)](https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk) for instructions on how to install Visual Studio, but only complete "Step 1". You do not need to install the SDK or the WDK. -* Install the Visual Studio Windows Driver Kit Extension (WDK.vsix). Open Visual Studio -> Extensions -> Manage Extensions... -> Online -> Visual Studio Market Place -> Windows Driver Kit -> 10.0.26100.0 -> Download +* Install the Visual Studio Windows Driver Kit Extension (WDK.vsix). + * Open Visual Studio -> Extensions -> Manage Extensions... -> Browse. + * In the search bar type: `Windows Driver Kit`. + * Find the `Microsoft` signed extension. + * Click the Install button. * Launch a "Developer Command Prompt for VS 2022". * Restore WDK packages from feed : diff --git a/Env-Vars.ps1 b/Env-Vars.ps1 deleted file mode 100644 index 0d37e03c..00000000 --- a/Env-Vars.ps1 +++ /dev/null @@ -1,9 +0,0 @@ -# Environment variables for script sourcing. -# Note: When a new WDK ships the following need to be updated: -# 1. Environment variables in .\Env-Vars.ps1 (this script) -# 2. Nuget package versions in .\packages.config -# 3. Nuget package versions in .\Directory.Build.props -# 4. SDK and WDK versions and WDK vsix link in .\configuration.dsc.yaml -$env:SAMPLES_VSIX_VERSION = "10.0.26100.0" -$env:SAMPLES_VSIX_URI = "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/DriverDeveloperKits-WDK/vsextensions/WDKVsix/10.0.26100.0/vspackage?targetPlatform=5e3e564c-03bb-4499-8ae5-b2b35e9a86dc" -$env:SAMPLES_BUILD_NUMBER = "26100" -- cgit v1.3.1 From 2e07f1b58a93eb36c616192045db654cf043a670 Mon Sep 17 00:00:00 2001 From: Matt <138825652+middlemose@users.noreply.github.com> Date: Tue, 25 Jun 2024 12:50:00 -0700 Subject: Fix printing vsix version --- Build-SampleSet.ps1 | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Build-SampleSet.ps1 b/Build-SampleSet.ps1 index 5be14dcf..2fccfdb8 100644 --- a/Build-SampleSet.ps1 +++ b/Build-SampleSet.ps1 @@ -164,12 +164,23 @@ $jresult = @{ $SolutionsTotal = $sampleSet.Count * $Configurations.Count * $Platforms.Count -Write-Output ("Build Environment: " + $build_environment) -if (($build_environment -eq "GitHub") -or ($build_environment -eq "NuGet")) { - Write-Output ("Nuget Package Version: " + $nuget_package_version) +# Find vsix version either from env variabel or from packages +$vsix_version = $env:SAMPLES_VSIX_VERSION +if (-not $vsix_version) { + $vsix_version = ls "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=*" | Select -ExpandProperty Name + if ($vsix_version) { + $vsix_version = $vsix_version.split('=')[1] + } + else { + Write-Error "No version for the WDK VSIX could be found. The WDK VSIX is not installed." + exit 1 + } } -Write-Output ("WDK VSIX Version: " + ($env:SAMPLES_VSIX_VERSION) ? $env:SAMPLES_VSIX_VERSION : (ls "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=*" | Select -ExpandProperty Name).split('=')[1]) + +Write-Output ("Build Environment: " + $build_environment) Write-Output ("Build Number: " + $build_number) +if (($build_environment -eq "GitHub") -or ($build_environment -eq "NuGet")) { Write-Output ("Nuget Package Version: " + $nuget_package_version) } +Write-Output ("WDK VSIX Version: " + $vsix_version) Write-Output ("Samples: " + $sampleSet.Count) Write-Output ("Configurations: " + $Configurations.Count + " (" + $Configurations + ")") Write-Output ("Platforms: " + $Platforms.Count + " (" + $Platforms + ")") -- cgit v1.3.1 From f9eb04d34edd823873e491a7da6e6ed7a064e823 Mon Sep 17 00:00:00 2001 From: Matt <138825652+middlemose@users.noreply.github.com> Date: Thu, 27 Jun 2024 14:17:05 -0700 Subject: Refactored vsix install and cleaned up build sampleset --- .github/scripts/Install-Vsix.ps1 | 94 +++++++++++-------------------------- .github/workflows/Code-Scanning.yml | 2 +- .github/workflows/ci-pr.yml | 2 +- .github/workflows/ci.yml | 2 +- Build-SampleSet.ps1 | 33 +++++++------ 5 files changed, 49 insertions(+), 84 deletions(-) diff --git a/.github/scripts/Install-Vsix.ps1 b/.github/scripts/Install-Vsix.ps1 index 8579b36b..50ef088b 100644 --- a/.github/scripts/Install-Vsix.ps1 +++ b/.github/scripts/Install-Vsix.ps1 @@ -1,76 +1,38 @@ <# .SYNOPSIS -Checks WDK vsix version and downloads and installs as necessary. +Download and install the latest WDK VSIX. #> -[CmdletBinding()] -param( - [bool]$optimize = $false -) - -$root = Get-Location - -# launch developer powershell -Import-Module (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*\Common7\Tools\Microsoft.VisualStudio.DevShell.dll") -Enter-VsDevShell -VsInstallPath (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*") -cd $root - -# Automatically resolve the latest amd64 VSIX +# set uri by resolving amd64 vsix $uri = "https://marketplace.visualstudio.com$((Invoke-WebRequest -Uri "https://marketplace.visualstudio.com/items?itemName=DriverDeveloperKits-WDK.WDKVsix").Links | Where-Object outerHTML -like '*(amd64)*' | select -expand href)" -# Set local version variable -$version = ([regex]'(\d+\.)(\d+\.)(\d+\.)(\d+)').Matches($uri).Value - -# Set github environment variable for vsix version -"SAMPLES_VSIX_VERSION=$version" | Out-File -FilePath "$env:GITHUB_ENV" -Append - -function PrintWdkVsix { - "WDK Vsix Version: $(ls "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=*" | Select -ExpandProperty Name)" +# set download version +$uri_version = ([regex]'(\d+\.)(\d+\.)(\d+\.)(\d+)').Matches($uri).Value + +# set msbuild path +$msbuild_path = (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*\MSBuild\") + +# download vsix, expand, and store the downloaded version extracted from the extension manifest +"Downloading WDK VSIX version: $uri_version..." +Invoke-WebRequest -Uri "$uri" -OutFile wdk.zip +"Expanding WDK VSIX archive..." +Expand-Archive ".\wdk.zip" .\ +"Extracting version from manifest..." +$downloaded_version = ([xml](Get-Content .\extension.vsixmanifest)).PackageManifest.Metadata.Identity.Version +"Downloaded WDK VSIX version: $downloaded_version" + +# copy msbuild files, extension manifest, and check installed version from the extension manifest +"Copying WDK extension files to build path..." +cp (".\`$MSBuild\*", ".\extension.vsixmanifest") "$msbuild_path" -Recurse -Force +"Extracting version from copied manifest..." +$installed_version = ([xml](Get-Content ${msbuild_path}\extension.vsixmanifest)).PackageManifest.Metadata.Identity.Version +"Installed WDK VSIX Version: $installed_version" +if (-not ("$downloaded_version" -eq "$installed_version")) { + "WDK VSIX installation failed due to version mismatch" + exit 1 } -function TestWdkVsix { - Test-Path "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=$version" -} - -# NOTE: The '$optimize' code path examines the '.vsixmanifest' when downloaded and then examines it again (in the 'MSBuild' directory) once -# the necessary extension files are copied. -if ($optimize) { - $msbuild_path = (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*\MSBuild\") - "---> Downloading vsix version: $version" - Invoke-WebRequest -Uri "$uri" -OutFile wdk.zip - Expand-Archive ".\wdk.zip" .\ - "Downloaded VSIX Version: $(([xml](Get-Content .\extension.vsixmanifest)).PackageManifest.Metadata.Identity.Version)" - "<--- Download complete" - "---> Configuring build environment..." - cp ".\`$MSBuild\*" "$msbuild_path" -Recurse -Force - cp ".\extension.vsixmanifest" "$msbuild_path" - "Installed VSIX Version: $(([xml](Get-Content ${msbuild_path}\extension.vsixmanifest)).PackageManifest.Metadata.Identity.Version)" - "<--- Configuration complete" -} -else { - "Getting installed WDK vsix..." - PrintWdkVsix - "Checking the WDK.vsix version installed..." - if (-not (TestWdkVsix)) { - "The correct WDK vsix is not installed." - "Will attempt to download and install now..." - Invoke-WebRequest -Uri "$uri" -OutFile wdk.vsix - "Finished downloading." - "Starting install process. This will take some time to complete..." - Start-Process vsixinstaller -ArgumentList "/f /q /sp .\wdk.vsix" -wait - "The install process has finished." - "Checking the WDK.vsix version installed..." - if (TestWdkVsix) { - PrintWdkVsix - "The WDK vsix version is OK" - } - else { - "The WDK vsix install FAILED" - Write-Host "`u{274C} wdk vsix install had an issue" - Write-Error "the wdk vsix cannot be installed at this time" - exit 1 - } - } -} +# set github environment variable for vsix version +"SAMPLES_VSIX_VERSION=$installed_version" | Out-File -FilePath "$env:GITHUB_ENV" -Append diff --git a/.github/workflows/Code-Scanning.yml b/.github/workflows/Code-Scanning.yml index 32bb5a65..cd0d8abf 100644 --- a/.github/workflows/Code-Scanning.yml +++ b/.github/workflows/Code-Scanning.yml @@ -38,7 +38,7 @@ jobs: submodules: 'recursive' - name: Install WDK VSIX - run: .\.github\scripts\Install-Vsix.ps1 -optimize:$true + run: .\.github\scripts\Install-Vsix.ps1 - name: Install Nuget Packages run: nuget restore .\packages.config -PackagesDirectory .\packages\ diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index a179127a..c04f4adb 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -23,7 +23,7 @@ jobs: submodules: 'recursive' - name: Install WDK VSIX - run: .\.github\scripts\Install-Vsix.ps1 -optimize:$true + run: .\.github\scripts\Install-Vsix.ps1 - name: Install Nuget Packages run: nuget restore .\packages.config -PackagesDirectory .\packages\ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 13563aa8..c35a81ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: submodules: 'recursive' - name: Install WDK VSIX - run: .\.github\scripts\Install-Vsix.ps1 -optimize:$true + run: .\.github\scripts\Install-Vsix.ps1 - name: Install Nuget Packages run: nuget restore .\packages.config -PackagesDirectory .\packages\ diff --git a/Build-SampleSet.ps1 b/Build-SampleSet.ps1 index 2fccfdb8..adae8bb0 100644 --- a/Build-SampleSet.ps1 +++ b/Build-SampleSet.ps1 @@ -55,17 +55,21 @@ finally { # # Determine build environment: 'GitHub', 'NuGet', 'EWDK', or 'WDK'. # Determine build number (used for exclusions based on build number). Five digits. Say, '22621'. +# Determine NuGet package version (if applicable). +# Determine WDK vsix version. # $build_environment="" $build_number=0 $nuget_package_version=0 +$vsix_version="" # -# In Github we build using Nuget only and source version from repo .\Env-Vars.ps1. +# In Github we build using NuGet and get the version from packages and vsix version from env var set from the install vsix step. # if ($env:GITHUB_REPOSITORY) { $build_environment="GitHub" $nuget_package_version=([regex]'(?<=x64\.)(\d+\.)(\d+\.)(\d+\.)(\d+)').Matches((Get-Childitem .\packages\*WDK.x64* -Name)).Value $build_number=$nuget_package_version.split('.')[2] + $vsix_version = $env:SAMPLES_VSIX_VERSION } # # WDK NuGet will require presence of a folder 'packages'. The version is sourced from repo .\Env-Vars.ps1. @@ -102,7 +106,19 @@ else { Write-Error "Could not determine build environment." exit 1 } - +# +# Get the vsix version from packages if not set +if (-not $vsix_version) { + $vsix_version = ls "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=*" | Select -ExpandProperty Name + if ($vsix_version) { + $vsix_version = $vsix_version.split('=')[1] + } + else { + Write-Error "No version of the WDK VSIX could be found. The WDK VSIX is not installed." + exit 1 + } +} +# # # InfVerif_AdditionalOptions # @@ -164,19 +180,6 @@ $jresult = @{ $SolutionsTotal = $sampleSet.Count * $Configurations.Count * $Platforms.Count -# Find vsix version either from env variabel or from packages -$vsix_version = $env:SAMPLES_VSIX_VERSION -if (-not $vsix_version) { - $vsix_version = ls "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=*" | Select -ExpandProperty Name - if ($vsix_version) { - $vsix_version = $vsix_version.split('=')[1] - } - else { - Write-Error "No version for the WDK VSIX could be found. The WDK VSIX is not installed." - exit 1 - } -} - Write-Output ("Build Environment: " + $build_environment) Write-Output ("Build Number: " + $build_number) if (($build_environment -eq "GitHub") -or ($build_environment -eq "NuGet")) { Write-Output ("Nuget Package Version: " + $nuget_package_version) } -- cgit v1.3.1 From 263b19b4347fcda2e236c14a9daf41e7d518625d Mon Sep 17 00:00:00 2001 From: JakobL-MSFT <110699333+JakobL-MSFT@users.noreply.github.com> Date: Fri, 28 Jun 2024 09:56:29 -0700 Subject: RI develop to main (#1189) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Memory leakage in message "sizeof(SCANNER_MESSAGE) * threadCount * requestCount" bytes long memory is allocated but only "sizeof(SCANNER_MESSAGE) * threadCount" bytes long of it is freed. * Handles malloc function fail case * Refactors comment line * Solves the miscalculation of the message index * simbatt: Fix broken registry read-back The GetSimBattStateFromRegistry function is currently using default settings if GetSimBattStateFromRegistry succeeds, whereas settings from registry are only applied if GetSimBattStateFromRegistry fails. This does not make sense to me. Therefore proposing to remove the `!` negation from `if (!NT_SUCCESS(Status)) {` on the line after `Status = GetSimBattStateFromRegistry(Device, RegState);` so that default settings are loaded when registry read-back fails. * Issue of freeing memory without waiting completion of threads accessing it is fixed * Fixes information leakage warning Fixes the issue of possible information leakage from uninitialized padding bytes * Avoids possible multiplication overflow warning * Avoids possible multiplication overflow warning * CI Pipelines build with WDK Nuget Packages (#1179) Integrate nuget into the workflow pipelines * FI from main to develop (#1188) Fix text and minor issues in Winget configuration files Co-authored-by: Adonais Romero Gonzalez * Improve version info, vsix installation, and update building locally readme * Fix printing vsix version * Refactored vsix install and cleaned up build sampleset --------- Co-authored-by: İsa Yurdagül <38290414+isayrdgl@users.noreply.github.com> Co-authored-by: Fredrik Orderud Co-authored-by: Christian Allred <13487734+cgallred@users.noreply.github.com> Co-authored-by: tristanb-ntdev <60945150+tristanb-ntdev@users.noreply.github.com> Co-authored-by: Matt <138825652+middlemose@users.noreply.github.com> Co-authored-by: Adonais Romero Gonzalez --- .github/scripts/Install-Vsix.ps1 | 38 ++++++++++++++++++++ .github/workflows/Code-Scanning.yml | 56 +++++++++++++++--------------- .github/workflows/ci-pr.yml | 10 +++--- .github/workflows/ci.yml | 13 +++---- Build-SampleSet.ps1 | 51 +++++++++++++++++++++------ Building-Locally.md | 6 +++- filesys/miniFilter/scanner/user/scanUser.c | 52 +++++++++++++-------------- simbatt/func/miniclass.c | 2 +- 8 files changed, 151 insertions(+), 77 deletions(-) create mode 100644 .github/scripts/Install-Vsix.ps1 diff --git a/.github/scripts/Install-Vsix.ps1 b/.github/scripts/Install-Vsix.ps1 new file mode 100644 index 00000000..50ef088b --- /dev/null +++ b/.github/scripts/Install-Vsix.ps1 @@ -0,0 +1,38 @@ +<# + +.SYNOPSIS +Download and install the latest WDK VSIX. + +#> + +# set uri by resolving amd64 vsix +$uri = "https://marketplace.visualstudio.com$((Invoke-WebRequest -Uri "https://marketplace.visualstudio.com/items?itemName=DriverDeveloperKits-WDK.WDKVsix").Links | Where-Object outerHTML -like '*(amd64)*' | select -expand href)" + +# set download version +$uri_version = ([regex]'(\d+\.)(\d+\.)(\d+\.)(\d+)').Matches($uri).Value + +# set msbuild path +$msbuild_path = (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*\MSBuild\") + +# download vsix, expand, and store the downloaded version extracted from the extension manifest +"Downloading WDK VSIX version: $uri_version..." +Invoke-WebRequest -Uri "$uri" -OutFile wdk.zip +"Expanding WDK VSIX archive..." +Expand-Archive ".\wdk.zip" .\ +"Extracting version from manifest..." +$downloaded_version = ([xml](Get-Content .\extension.vsixmanifest)).PackageManifest.Metadata.Identity.Version +"Downloaded WDK VSIX version: $downloaded_version" + +# copy msbuild files, extension manifest, and check installed version from the extension manifest +"Copying WDK extension files to build path..." +cp (".\`$MSBuild\*", ".\extension.vsixmanifest") "$msbuild_path" -Recurse -Force +"Extracting version from copied manifest..." +$installed_version = ([xml](Get-Content ${msbuild_path}\extension.vsixmanifest)).PackageManifest.Metadata.Identity.Version +"Installed WDK VSIX Version: $installed_version" +if (-not ("$downloaded_version" -eq "$installed_version")) { + "WDK VSIX installation failed due to version mismatch" + exit 1 +} + +# set github environment variable for vsix version +"SAMPLES_VSIX_VERSION=$installed_version" | Out-File -FilePath "$env:GITHUB_ENV" -Append diff --git a/.github/workflows/Code-Scanning.yml b/.github/workflows/Code-Scanning.yml index a18bcf95..cd0d8abf 100644 --- a/.github/workflows/Code-Scanning.yml +++ b/.github/workflows/Code-Scanning.yml @@ -32,31 +32,31 @@ jobs: language: [ 'cpp' ] steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - submodules: 'recursive' - - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - packs: microsoft/windows-drivers - - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v2 - - - name: Retrieve and build all available solutions - run: | - .\Build-AllSamples.ps1 -Verbose -ThrottleLimit 1 - env: - WDS_Configuration: Debug - WDS_Platform: x64 - WDS_WipeOutputs: ${{ true }} - - - name: Perform CodeQL analysis - uses: github/codeql-action/analyze@v3 - with: - category: "/language:${{matrix.language}}" - - - + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - name: Install WDK VSIX + run: .\.github\scripts\Install-Vsix.ps1 + + - name: Install Nuget Packages + run: nuget restore .\packages.config -PackagesDirectory .\packages\ + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + packs: microsoft/windows-drivers + + - name: Retrieve and build all available solutions + run: .\Build-AllSamples.ps1 -Verbose -ThrottleLimit 1 + env: + WDS_Configuration: Debug + WDS_Platform: x64 + WDS_WipeOutputs: ${{ true }} + + - name: Perform CodeQL analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index 7640b966..c04f4adb 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -22,8 +22,11 @@ jobs: with: submodules: 'recursive' - - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v2 + - name: Install WDK VSIX + run: .\.github\scripts\Install-Vsix.ps1 + + - name: Install Nuget Packages + run: nuget restore .\packages.config -PackagesDirectory .\packages\ - name: Get changed files id: get-changed-files @@ -63,8 +66,7 @@ jobs: path: _logs - name: Join and generate global reports - run: | - .\.github\scripts\Join-CsvReports.ps1 + run: .\.github\scripts\Join-CsvReports.ps1 - name: Archive global overview build reports uses: actions/upload-artifact@v3 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad92f83b..c35a81ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,12 +22,14 @@ jobs: with: submodules: 'recursive' - - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v2 + - name: Install WDK VSIX + run: .\.github\scripts\Install-Vsix.ps1 + + - name: Install Nuget Packages + run: nuget restore .\packages.config -PackagesDirectory .\packages\ - name: Retrieve and build all available solutions - run: | - .\Build-AllSamples.ps1 -Verbose + run: .\Build-AllSamples.ps1 -Verbose env: WDS_Configuration: ${{ matrix.configuration }} WDS_Platform: ${{ matrix.platform }} @@ -56,8 +58,7 @@ jobs: path: _logs - name: Join and generate global reports - run: | - .\.github\scripts\Join-CsvReports.ps1 + run: .\.github\scripts\Join-CsvReports.ps1 - name: Archive global overview build reports uses: actions/upload-artifact@v3 diff --git a/Build-SampleSet.ps1 b/Build-SampleSet.ps1 index b0da097a..adae8bb0 100644 --- a/Build-SampleSet.ps1 +++ b/Build-SampleSet.ps1 @@ -9,6 +9,14 @@ param( ) $root = Get-Location + +# launch developer powershell (if necessary to prevent multiple developer sessions) +if (-not $env:VSCMD_VER) { + Import-Module (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*\Common7\Tools\Microsoft.VisualStudio.DevShell.dll") + Enter-VsDevShell -VsInstallPath (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*") + cd $root +} + $ThrottleFactor = 5 $LogicalProcessors = (Get-CIMInstance -Class 'CIM_Processor' -Verbose:$false).NumberOfLogicalProcessors @@ -45,27 +53,34 @@ finally { } # -# Determine build environment: 'GitHub', 'NuGet', 'EWDK', or 'WDK'. Only used to determine build number. +# Determine build environment: 'GitHub', 'NuGet', 'EWDK', or 'WDK'. # Determine build number (used for exclusions based on build number). Five digits. Say, '22621'. +# Determine NuGet package version (if applicable). +# Determine WDK vsix version. # $build_environment="" $build_number=0 +$nuget_package_version=0 +$vsix_version="" # -# WDK NuGet will require presence of a folder 'packages' +# In Github we build using NuGet and get the version from packages and vsix version from env var set from the install vsix step. # -# -# Hack: In GitHub we do not have an environment variable where we can see WDK build number, so we have it hard coded. -# -if (-not $env:GITHUB_REPOSITORY -eq '') { +if ($env:GITHUB_REPOSITORY) { $build_environment="GitHub" - $build_number=22621 + $nuget_package_version=([regex]'(?<=x64\.)(\d+\.)(\d+\.)(\d+\.)(\d+)').Matches((Get-Childitem .\packages\*WDK.x64* -Name)).Value + $build_number=$nuget_package_version.split('.')[2] + $vsix_version = $env:SAMPLES_VSIX_VERSION } # -# Hack: If user has hydrated nuget packages, then use those. That will be indicated by presence of a folder named .\packages. +# WDK NuGet will require presence of a folder 'packages'. The version is sourced from repo .\Env-Vars.ps1. +# +# Hack: If user has hydrated nuget packages, then use those. That will be indicated by presence of a folder named '.\packages'. +# Further, we need to test that the directory has been hydrated using '.\packages\*'. # -elseif(Test-Path(".\packages")) { +elseif(Test-Path(".\packages\*")) { $build_environment=("NuGet") - $build_number=26100 + $nuget_package_version=([regex]'(?<=x64\.)(\d+\.)(\d+\.)(\d+\.)(\d+)').Matches((Get-Childitem .\packages\*WDK.x64* -Name)).Value + $build_number=$nuget_package_version.split('.')[2] } # # EWDK sets environment variable BuildLab. For example 'ni_release_svc_prod1.22621.2428'. @@ -91,7 +106,19 @@ else { Write-Error "Could not determine build environment." exit 1 } - +# +# Get the vsix version from packages if not set +if (-not $vsix_version) { + $vsix_version = ls "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=*" | Select -ExpandProperty Name + if ($vsix_version) { + $vsix_version = $vsix_version.split('=')[1] + } + else { + Write-Error "No version of the WDK VSIX could be found. The WDK VSIX is not installed." + exit 1 + } +} +# # # InfVerif_AdditionalOptions # @@ -155,6 +182,8 @@ $SolutionsTotal = $sampleSet.Count * $Configurations.Count * $Platforms.Count Write-Output ("Build Environment: " + $build_environment) Write-Output ("Build Number: " + $build_number) +if (($build_environment -eq "GitHub") -or ($build_environment -eq "NuGet")) { Write-Output ("Nuget Package Version: " + $nuget_package_version) } +Write-Output ("WDK VSIX Version: " + $vsix_version) Write-Output ("Samples: " + $sampleSet.Count) Write-Output ("Configurations: " + $Configurations.Count + " (" + $Configurations + ")") Write-Output ("Platforms: " + $Platforms.Count + " (" + $Platforms + ")") diff --git a/Building-Locally.md b/Building-Locally.md index bb9fc610..e3db8dde 100644 --- a/Building-Locally.md +++ b/Building-Locally.md @@ -79,7 +79,11 @@ To build the Windows Driver Samples you need a "driver build environment". In e ### Option A: Use WDK NuGet Packages * See [Download the Windows Driver Kit (WDK)](https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk) for instructions on how to install Visual Studio, but only complete "Step 1". You do not need to install the SDK or the WDK. -* Install the Visual Studio Windows Driver Kit Extension (WDK.vsix). Open Visual Studio -> Extensions -> Manage Extensions... -> Online -> Visual Studio Market Place -> Windows Driver Kit -> 10.0.26100.0 -> Download +* Install the Visual Studio Windows Driver Kit Extension (WDK.vsix). + * Open Visual Studio -> Extensions -> Manage Extensions... -> Browse. + * In the search bar type: `Windows Driver Kit`. + * Find the `Microsoft` signed extension. + * Click the Install button. * Launch a "Developer Command Prompt for VS 2022". * Restore WDK packages from feed : diff --git a/filesys/miniFilter/scanner/user/scanUser.c b/filesys/miniFilter/scanner/user/scanUser.c index e766261c..08b948b3 100644 --- a/filesys/miniFilter/scanner/user/scanUser.c +++ b/filesys/miniFilter/scanner/user/scanUser.c @@ -254,8 +254,6 @@ Return Value } } - free( message ); - return hr; } @@ -268,13 +266,12 @@ main ( { DWORD requestCount = SCANNER_DEFAULT_REQUEST_COUNT; DWORD threadCount = SCANNER_DEFAULT_THREAD_COUNT; - HANDLE threads[SCANNER_MAX_THREAD_COUNT]; + HANDLE threads[SCANNER_MAX_THREAD_COUNT] = { NULL }; SCANNER_THREAD_CONTEXT context; HANDLE port, completion; - PSCANNER_MESSAGE msg; + PSCANNER_MESSAGE messages; DWORD threadId; HRESULT hr; - DWORD i, j; // // Check how many threads and per thread requests are desired. @@ -343,11 +340,23 @@ main ( context.Completion = completion; // - // Create specified number of threads. + // Allocate messages. // - for (i = 0; i < threadCount; i++) { + messages = calloc(((size_t) threadCount) * requestCount, sizeof(SCANNER_MESSAGE)); + + if (messages == NULL) { + hr = ERROR_NOT_ENOUGH_MEMORY; + goto main_cleanup; + } + + // + // Create specified number of threads. + // + + for (DWORD i = 0; i < threadCount; i++) { + threads[i] = CreateThread( NULL, 0, (LPTHREAD_START_ROUTINE) ScannerWorker, @@ -366,20 +375,9 @@ main ( goto main_cleanup; } - for (j = 0; j < requestCount; j++) { - - // - // Allocate the message. - // - -#pragma prefast(suppress:__WARNING_MEMORY_LEAK, "msg will not be leaked because it is freed in ScannerWorker") - msg = malloc( sizeof( SCANNER_MESSAGE ) ); - - if (msg == NULL) { - - hr = ERROR_NOT_ENOUGH_MEMORY; - goto main_cleanup; - } + for (DWORD j = 0; j < requestCount; j++) { + + PSCANNER_MESSAGE msg = &(messages[i * requestCount + j]); memset( &msg->Ovlp, 0, sizeof( OVERLAPPED ) ); @@ -393,24 +391,26 @@ main ( &msg->Ovlp ); if (hr != HRESULT_FROM_WIN32( ERROR_IO_PENDING )) { - - free( msg ); goto main_cleanup; } } } hr = S_OK; - - WaitForMultipleObjectsEx( i, threads, TRUE, INFINITE, FALSE ); - + main_cleanup: + for (INT i = 0; threads[i] != NULL; ++i) { + WaitForSingleObjectEx(threads[i], INFINITE, FALSE); + } + printf( "Scanner: All done. Result = 0x%08x\n", hr ); CloseHandle( port ); CloseHandle( completion ); + free(messages); + return hr; } diff --git a/simbatt/func/miniclass.c b/simbatt/func/miniclass.c index ba2df340..612b4c66 100644 --- a/simbatt/func/miniclass.c +++ b/simbatt/func/miniclass.c @@ -202,7 +202,7 @@ Return Value: } Status = GetSimBattStateFromRegistry(Device, RegState); - if (!NT_SUCCESS(Status)) { + if (NT_SUCCESS(Status)) { RtlZeroMemory(RegState, sizeof(SIMBATT_STATE)); WdfWaitLockAcquire(DevExt->StateLock, NULL); -- cgit v1.3.1 From d5569c08aa2818c6240744bb47a00f67f20fdb54 Mon Sep 17 00:00:00 2001 From: Adonais Romero Gonzalez Date: Mon, 1 Jul 2024 17:33:16 -0700 Subject: Standarize INF files enconding to UTF-16 (LE with BOM); renormalize files --- .gitattributes | 5 ++++- audio/Acx/Samples/AudioCodec/Driver/AudioCodec.inf | Bin 8526 -> 4123 bytes .../Source/Main/SimpleAudioSample.inx | Bin 15004 -> 7299 bytes .../TabletAudioSample/ComponentizedApoSample.inx | Bin 22624 -> 11119 bytes .../TabletAudioSample/ComponentizedAudioSample.inx | Bin 52952 -> 25853 bytes .../ComponentizedAudioSampleExtension.inx | Bin 13660 -> 6686 bytes avstream/avscamera/sys/avscamera.inx | Bin 25172 -> 12364 bytes avstream/avshws/avshws.inx | Bin 6028 -> 2905 bytes avstream/avssamp/avssamp.inx | Bin 3278 -> 1567 bytes bluetooth/bthecho/bthcli/sys/BthEchoSampleCli.inx | Bin 4570 -> 2206 bytes bluetooth/bthecho/bthsrv/sys/BthEchoSampleSrv.inx | Bin 4578 -> 2210 bytes bluetooth/serialhcibus/WDK/SerialBusWdk.inx | Bin 4732 -> 2277 bytes filesys/miniFilter/MetadataManager/fmm.inf | Bin 8292 -> 4012 bytes filesys/miniFilter/NameChanger/NameChanger.inf | Bin 9004 -> 4361 bytes filesys/miniFilter/avscan/avscan.inf | Bin 8858 -> 4274 bytes filesys/miniFilter/cancelSafe/cancelSafe.inf | Bin 8792 -> 4262 bytes filesys/miniFilter/cdo/cdo.inf | Bin 8270 -> 4004 bytes filesys/miniFilter/change/change.inf | Bin 7816 -> 3782 bytes filesys/miniFilter/ctx/ctx.inf | Bin 8252 -> 3993 bytes filesys/miniFilter/delete/delete.inf | Bin 8084 -> 3913 bytes filesys/miniFilter/minispy/minispy.inf | Bin 9920 -> 4817 bytes filesys/miniFilter/nullFilter/nullFilter.inf | Bin 7928 -> 3836 bytes filesys/miniFilter/passThrough/passThrough.inf | Bin 8116 -> 3930 bytes filesys/miniFilter/scanner/scanner.inf | Bin 8340 -> 4035 bytes filesys/miniFilter/simrep/simrep.inf | Bin 9280 -> 4496 bytes filesys/miniFilter/swapBuffers/swapBuffers.inf | Bin 8270 -> 4005 bytes .../osrfx2_DCHU_base/osrfx2_DCHU_base.inx | Bin 7898 -> 3827 bytes .../osrfx2_DCHU_component/osrfx2_DCHU_component.inx | Bin 3386 -> 1628 bytes .../osrfx2_DCHU_extension/osrfx2_DCHU_extension.inx | Bin 3020 -> 1455 bytes .../osrfx2_DCHU_component/osrfx2_DCHU_component.inx | Bin 3386 -> 1628 bytes .../osrfx2_DCHU_extension/osrfx2_DCHU_extension.inx | Bin 2994 -> 1442 bytes general/PLX9x5x/sys/pci9x5x.inx | Bin 5334 -> 2574 bytes .../SimpleMediaSourceDriver.inf | Bin 6768 -> 3283 bytes general/echo/kmdf/driver/AutoSync/echo.inx | Bin 4138 -> 1981 bytes general/echo/kmdf/driver/DriverSync/echo_2.inx | Bin 4272 -> 2047 bytes general/echo/umdf2/driver/AutoSync/echoum.inx | Bin 4596 -> 2198 bytes general/pcidrv/kmdf/genpci.inx | Bin 6258 -> 3028 bytes .../toaster/toastDrv/kmdf/bus/dynamic/dynambus.inx | Bin 4794 -> 2309 bytes .../toaster/toastDrv/kmdf/bus/static/statbus.inx | Bin 4696 -> 2260 bytes general/toaster/toastDrv/kmdf/filter/filter.inx | Bin 6262 -> 3016 bytes .../toastDrv/kmdf/func/featured/wdffeatured.inx | Bin 5076 -> 2442 bytes .../toaster/toastDrv/kmdf/func/simple/wdfsimple.inx | Bin 6070 -> 2935 bytes .../toaster/toastDrv/kmdf/toastmon/wdftoastmon.inx | Bin 3964 -> 1898 bytes general/toaster/umdf2/filter/generic/filterum.inx | Bin 4586 -> 2197 bytes .../toaster/umdf2/func/featured/wdffeaturedum.inx | Bin 4730 -> 2267 bytes general/toaster/umdf2/func/simple/wdfsimpleum.inx | Bin 4606 -> 2206 bytes gnss/gnssUmdf/gnssUmdf.inf | Bin 2672 -> 1275 bytes gpio/samples/simdevice/kmdf/simdevice.inx | Bin 3068 -> 1462 bytes gpio/samples/simdevice/umdf/simdeviceumdf.inx | Bin 3444 -> 1652 bytes gpio/samples/simgpio/simgpio.inx | Bin 3714 -> 1776 bytes gpio/samples/simgpio_i2c/simgpio_i2c.inx | Bin 3786 -> 1812 bytes hid/firefly/driver/firefly.inx | Bin 6552 -> 3155 bytes hid/hidusbfx2/sys/hidusbfx2.inx | Bin 7642 -> 3686 bytes hid/vhidmini2/driver/kmdf/vhidmini.inx | Bin 4072 -> 1945 bytes hid/vhidmini2/driver/umdf2/VhidminiUm.inx | Bin 4588 -> 2200 bytes input/kbfiltr/sys/kbfiltr.inx | Bin 4976 -> 2362 bytes input/moufiltr/moufiltr.inx | Bin 4952 -> 2350 bytes network/modem/fakemodem/mdmfake.inx | Bin 24280 -> 11875 bytes .../ndis/extension/samples/forward/msforwardext.inf | Bin 5048 -> 2442 bytes .../samples/passthrough/mspassthroughext.inf | Bin 5218 -> 2529 bytes network/ndis/filter/netlwf.inf | Bin 19952 -> 9749 bytes network/ndis/mux/driver/60/mux_mp.inf | Bin 7718 -> 3736 bytes network/ndis/mux/driver/60/muxp.inf | Bin 7380 -> 3564 bytes network/ndis/ndisprot/6x/sys/60/ndisprot60.inf | Bin 7168 -> 3475 bytes network/ndis/ndisprot/6x/sys/630/ndisprot630.inf | Bin 8974 -> 4363 bytes network/ndis/ndisprot_kmdf/60/ndisprot.inx | Bin 13478 -> 6557 bytes network/ndis/netvmini/6x/60/netvmini60.inf | Bin 6470 -> 3138 bytes network/ndis/netvmini/6x/620/netvmini620.inf | Bin 11196 -> 5460 bytes network/ndis/netvmini/6x/630/netvmini630.inf | Bin 12318 -> 6011 bytes network/ndis/netvmini/6x/680/netvmini680.inf | Bin 12314 -> 6010 bytes network/trans/inspect/sys/inspect.inf | Bin 3944 -> 1919 bytes network/trans/msnmntr/sys/msnmntr.inf | Bin 3172 -> 1538 bytes .../WDI/PLATFORM/WinInf/SDIO/x64/netrtwlans.inf | Bin 74380 -> 36123 bytes network/wwan/cxwmbclass/cxwmbclass/cxwmbclass.inf | Bin 8266 -> 4013 bytes .../windows-drivertemplate-nfc.inf | Bin 3316 -> 1595 bytes pofx/PEP/acpi/sampleacpipep.inx | Bin 4270 -> 2053 bytes .../SingleComp/SingleComponentSingleStateUm.inx | Bin 4262 -> 2040 bytes pofx/WDF/Driver/MultiComp/driver/WdfMultiComp.inx | Bin 3608 -> 1726 bytes .../SingleComp/SingleComponentFStateSample.inx | Bin 5090 -> 2456 bytes .../SampleMagneticStripeReaderDrv.inf | Bin 3040 -> 1458 bytes .../barcodescanner/SampleBarcodeScannerDrv.inf | Bin 2912 -> 1394 bytes prm/PrmFunc/prmfuncsample.inf | Bin 2780 -> 1334 bytes sd/miniport/sdhc/sdhc.inx | Bin 7856 -> 3752 bytes sensors/ADXL345Acc/ADXL345Acc.inx | Bin 4398 -> 2114 bytes sensors/Activity/Activity.inx | Bin 4250 -> 2038 bytes sensors/CustomSensors/CustomSensors.inx | Bin 4524 -> 2175 bytes sensors/Fusion/FusionSensor.inx | Bin 4458 -> 2142 bytes sensors/Pedometer/Pedometer.inx | Bin 4302 -> 2064 bytes sensors/SensorsComboDriver/SensorsComboDriver.inx | Bin 4746 -> 2289 bytes .../SimpleDeviceOrientationSensor.inx | Bin 5444 -> 2635 bytes serial/VirtualSerial2/ComPort/virtualserial2um.inx | Bin 6316 -> 3053 bytes serial/VirtualSerial2/FakeModem/fakemodem2um.inx | Bin 16818 -> 8209 bytes serial/serial/serial.inx | Bin 5586 -> 2696 bytes simbatt/func/simbatt.inx | Bin 3946 -> 1891 bytes smartcrd/pscr/pscr.inx | Bin 6898 -> 3322 bytes spb/SkeletonI2C/skeletoni2c.inx | Bin 3914 -> 1883 bytes spb/SpbTestTool/sys/spbtesttool.inx | Bin 4846 -> 2334 bytes storage/msdsm/src/SampleDSM.inf | Bin 4388 -> 2108 bytes thermal/simsensor/simsensor.inf | Bin 5570 -> 2689 bytes thermal/thermalclient/simtc.inf | Bin 3860 -> 1852 bytes .../DV-FailDriver-WDM/driver/defect_toastmon.inf | Bin 3674 -> 1765 bytes usb/UcmCxUcsi/UcmCxUcsi.inf | Bin 3940 -> 1896 bytes .../UcmTcpciCxClientSample.inf | Bin 3352 -> 1616 bytes .../UcmUcsiAcpiSample/UcmUcsiAcpiSample.inf | Bin 3250 -> 1563 bytes usb/kmdf_enumswitches/sys/kmdf_enumswitches.inx | Bin 5330 -> 2567 bytes usb/kmdf_fx2/driver/osrusbfx2.inx | Bin 7006 -> 3386 bytes usb/ufxclientsample/UfxClientSample.inx | Bin 4470 -> 2156 bytes usb/umdf2_fx2/driver/osrusbfx2um.inx | Bin 6012 -> 2903 bytes usb/usbsamp/sys/driver/usbsamp.inx | Bin 5820 -> 2812 bytes usb/wdf_osrfx2_lab/kmdf/step1/osrusbfx2.inx | Bin 5046 -> 2423 bytes usb/wdf_osrfx2_lab/kmdf/step2/osrusbfx2.inx | Bin 5042 -> 2422 bytes usb/wdf_osrfx2_lab/kmdf/step3/osrusbfx2.inx | Bin 5042 -> 2422 bytes usb/wdf_osrfx2_lab/kmdf/step4/osrusbfx2.inx | Bin 5042 -> 2422 bytes usb/wdf_osrfx2_lab/kmdf/step5/osrusbfx2.inx | Bin 5042 -> 2422 bytes .../IddSampleDriver/IddSampleDriver.inf | Bin 4198 -> 2026 bytes wia/ProdScan/ProdScan.inx | Bin 3786 -> 1825 bytes wia/microdrv/testmcro.inx | Bin 3292 -> 1580 bytes wia/wiadriverex/usd/WiaDriver.inx | Bin 7566 -> 3682 bytes wmi/wmisamp/wmisamp.inx | Bin 5212 -> 2501 bytes 119 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 84b1bf11..a59c7386 100644 --- a/.gitattributes +++ b/.gitattributes @@ -24,6 +24,10 @@ *.vcxproj text eol=crlf *.xaml text eol=crlf +# Declare files that are encoded in UTF-16 +*.inf text diff working-tree-encoding=UTF-16LE-BOM eol=crlf +*.inx text diff working-tree-encoding=UTF-16LE-BOM eol=crlf + ############################################################################### # Set default behavior for command prompt diff. # @@ -32,4 +36,3 @@ # Note: This is only used by command line ############################################################################### *.cs diff=csharp - diff --git a/audio/Acx/Samples/AudioCodec/Driver/AudioCodec.inf b/audio/Acx/Samples/AudioCodec/Driver/AudioCodec.inf index 889f9bdb..0bc5fe23 100644 Binary files a/audio/Acx/Samples/AudioCodec/Driver/AudioCodec.inf and b/audio/Acx/Samples/AudioCodec/Driver/AudioCodec.inf differ diff --git a/audio/simpleaudiosample/Source/Main/SimpleAudioSample.inx b/audio/simpleaudiosample/Source/Main/SimpleAudioSample.inx index d0835f1f..db2b62c1 100644 Binary files a/audio/simpleaudiosample/Source/Main/SimpleAudioSample.inx and b/audio/simpleaudiosample/Source/Main/SimpleAudioSample.inx differ diff --git a/audio/sysvad/TabletAudioSample/ComponentizedApoSample.inx b/audio/sysvad/TabletAudioSample/ComponentizedApoSample.inx index 7c08f86a..2cda2dae 100644 Binary files a/audio/sysvad/TabletAudioSample/ComponentizedApoSample.inx and b/audio/sysvad/TabletAudioSample/ComponentizedApoSample.inx differ diff --git a/audio/sysvad/TabletAudioSample/ComponentizedAudioSample.inx b/audio/sysvad/TabletAudioSample/ComponentizedAudioSample.inx index 1c638273..c6655868 100644 Binary files a/audio/sysvad/TabletAudioSample/ComponentizedAudioSample.inx and b/audio/sysvad/TabletAudioSample/ComponentizedAudioSample.inx differ diff --git a/audio/sysvad/TabletAudioSample/ComponentizedAudioSampleExtension.inx b/audio/sysvad/TabletAudioSample/ComponentizedAudioSampleExtension.inx index 2ce2f6a0..7511017c 100644 Binary files a/audio/sysvad/TabletAudioSample/ComponentizedAudioSampleExtension.inx and b/audio/sysvad/TabletAudioSample/ComponentizedAudioSampleExtension.inx differ diff --git a/avstream/avscamera/sys/avscamera.inx b/avstream/avscamera/sys/avscamera.inx index f75da695..a7c58505 100644 Binary files a/avstream/avscamera/sys/avscamera.inx and b/avstream/avscamera/sys/avscamera.inx differ diff --git a/avstream/avshws/avshws.inx b/avstream/avshws/avshws.inx index 9409635d..a2d94aba 100644 Binary files a/avstream/avshws/avshws.inx and b/avstream/avshws/avshws.inx differ diff --git a/avstream/avssamp/avssamp.inx b/avstream/avssamp/avssamp.inx index c06925ea..0036dc50 100644 Binary files a/avstream/avssamp/avssamp.inx and b/avstream/avssamp/avssamp.inx differ diff --git a/bluetooth/bthecho/bthcli/sys/BthEchoSampleCli.inx b/bluetooth/bthecho/bthcli/sys/BthEchoSampleCli.inx index 6f326ff3..1002f10d 100644 Binary files a/bluetooth/bthecho/bthcli/sys/BthEchoSampleCli.inx and b/bluetooth/bthecho/bthcli/sys/BthEchoSampleCli.inx differ diff --git a/bluetooth/bthecho/bthsrv/sys/BthEchoSampleSrv.inx b/bluetooth/bthecho/bthsrv/sys/BthEchoSampleSrv.inx index 3079c6d0..ea9238e1 100644 Binary files a/bluetooth/bthecho/bthsrv/sys/BthEchoSampleSrv.inx and b/bluetooth/bthecho/bthsrv/sys/BthEchoSampleSrv.inx differ diff --git a/bluetooth/serialhcibus/WDK/SerialBusWdk.inx b/bluetooth/serialhcibus/WDK/SerialBusWdk.inx index 27f70ab6..813c52f1 100644 Binary files a/bluetooth/serialhcibus/WDK/SerialBusWdk.inx and b/bluetooth/serialhcibus/WDK/SerialBusWdk.inx differ diff --git a/filesys/miniFilter/MetadataManager/fmm.inf b/filesys/miniFilter/MetadataManager/fmm.inf index ad231a8c..63f0bd4b 100644 Binary files a/filesys/miniFilter/MetadataManager/fmm.inf and b/filesys/miniFilter/MetadataManager/fmm.inf differ diff --git a/filesys/miniFilter/NameChanger/NameChanger.inf b/filesys/miniFilter/NameChanger/NameChanger.inf index 7c0b2364..b4474bb1 100644 Binary files a/filesys/miniFilter/NameChanger/NameChanger.inf and b/filesys/miniFilter/NameChanger/NameChanger.inf differ diff --git a/filesys/miniFilter/avscan/avscan.inf b/filesys/miniFilter/avscan/avscan.inf index cfc9c9ab..8c1e329d 100644 Binary files a/filesys/miniFilter/avscan/avscan.inf and b/filesys/miniFilter/avscan/avscan.inf differ diff --git a/filesys/miniFilter/cancelSafe/cancelSafe.inf b/filesys/miniFilter/cancelSafe/cancelSafe.inf index 69d0ccf1..5367e66e 100644 Binary files a/filesys/miniFilter/cancelSafe/cancelSafe.inf and b/filesys/miniFilter/cancelSafe/cancelSafe.inf differ diff --git a/filesys/miniFilter/cdo/cdo.inf b/filesys/miniFilter/cdo/cdo.inf index cdac24d9..37af1d59 100644 Binary files a/filesys/miniFilter/cdo/cdo.inf and b/filesys/miniFilter/cdo/cdo.inf differ diff --git a/filesys/miniFilter/change/change.inf b/filesys/miniFilter/change/change.inf index e7da4250..6a1923d2 100644 Binary files a/filesys/miniFilter/change/change.inf and b/filesys/miniFilter/change/change.inf differ diff --git a/filesys/miniFilter/ctx/ctx.inf b/filesys/miniFilter/ctx/ctx.inf index 8edaf764..bc637613 100644 Binary files a/filesys/miniFilter/ctx/ctx.inf and b/filesys/miniFilter/ctx/ctx.inf differ diff --git a/filesys/miniFilter/delete/delete.inf b/filesys/miniFilter/delete/delete.inf index da348874..e0c8c04c 100644 Binary files a/filesys/miniFilter/delete/delete.inf and b/filesys/miniFilter/delete/delete.inf differ diff --git a/filesys/miniFilter/minispy/minispy.inf b/filesys/miniFilter/minispy/minispy.inf index 60eb8684..a368bd75 100644 Binary files a/filesys/miniFilter/minispy/minispy.inf and b/filesys/miniFilter/minispy/minispy.inf differ diff --git a/filesys/miniFilter/nullFilter/nullFilter.inf b/filesys/miniFilter/nullFilter/nullFilter.inf index c04e9f06..1fffa028 100644 Binary files a/filesys/miniFilter/nullFilter/nullFilter.inf and b/filesys/miniFilter/nullFilter/nullFilter.inf differ diff --git a/filesys/miniFilter/passThrough/passThrough.inf b/filesys/miniFilter/passThrough/passThrough.inf index 129a2ab6..f77c3e4c 100644 Binary files a/filesys/miniFilter/passThrough/passThrough.inf and b/filesys/miniFilter/passThrough/passThrough.inf differ diff --git a/filesys/miniFilter/scanner/scanner.inf b/filesys/miniFilter/scanner/scanner.inf index d7bf6256..b7c3ac9e 100644 Binary files a/filesys/miniFilter/scanner/scanner.inf and b/filesys/miniFilter/scanner/scanner.inf differ diff --git a/filesys/miniFilter/simrep/simrep.inf b/filesys/miniFilter/simrep/simrep.inf index 8eea42ce..76aa1f0c 100644 Binary files a/filesys/miniFilter/simrep/simrep.inf and b/filesys/miniFilter/simrep/simrep.inf differ diff --git a/filesys/miniFilter/swapBuffers/swapBuffers.inf b/filesys/miniFilter/swapBuffers/swapBuffers.inf index 0aab9452..e5acbdd3 100644 Binary files a/filesys/miniFilter/swapBuffers/swapBuffers.inf and b/filesys/miniFilter/swapBuffers/swapBuffers.inf differ diff --git a/general/DCHU/osrfx2_DCHU_base/osrfx2_DCHU_base/osrfx2_DCHU_base.inx b/general/DCHU/osrfx2_DCHU_base/osrfx2_DCHU_base/osrfx2_DCHU_base.inx index 39bd5468..eca5c5cc 100644 Binary files a/general/DCHU/osrfx2_DCHU_base/osrfx2_DCHU_base/osrfx2_DCHU_base.inx and b/general/DCHU/osrfx2_DCHU_base/osrfx2_DCHU_base/osrfx2_DCHU_base.inx differ diff --git a/general/DCHU/osrfx2_DCHU_extension_loose/osrfx2_DCHU_component/osrfx2_DCHU_component.inx b/general/DCHU/osrfx2_DCHU_extension_loose/osrfx2_DCHU_component/osrfx2_DCHU_component.inx index 045fc91f..cc9e43a9 100644 Binary files a/general/DCHU/osrfx2_DCHU_extension_loose/osrfx2_DCHU_component/osrfx2_DCHU_component.inx and b/general/DCHU/osrfx2_DCHU_extension_loose/osrfx2_DCHU_component/osrfx2_DCHU_component.inx differ diff --git a/general/DCHU/osrfx2_DCHU_extension_loose/osrfx2_DCHU_extension/osrfx2_DCHU_extension.inx b/general/DCHU/osrfx2_DCHU_extension_loose/osrfx2_DCHU_extension/osrfx2_DCHU_extension.inx index a762b235..d824d08b 100644 Binary files a/general/DCHU/osrfx2_DCHU_extension_loose/osrfx2_DCHU_extension/osrfx2_DCHU_extension.inx and b/general/DCHU/osrfx2_DCHU_extension_loose/osrfx2_DCHU_extension/osrfx2_DCHU_extension.inx differ diff --git a/general/DCHU/osrfx2_DCHU_extension_tight/osrfx2_DCHU_component/osrfx2_DCHU_component.inx b/general/DCHU/osrfx2_DCHU_extension_tight/osrfx2_DCHU_component/osrfx2_DCHU_component.inx index 045fc91f..cc9e43a9 100644 Binary files a/general/DCHU/osrfx2_DCHU_extension_tight/osrfx2_DCHU_component/osrfx2_DCHU_component.inx and b/general/DCHU/osrfx2_DCHU_extension_tight/osrfx2_DCHU_component/osrfx2_DCHU_component.inx differ diff --git a/general/DCHU/osrfx2_DCHU_extension_tight/osrfx2_DCHU_extension/osrfx2_DCHU_extension.inx b/general/DCHU/osrfx2_DCHU_extension_tight/osrfx2_DCHU_extension/osrfx2_DCHU_extension.inx index 17670efa..a8f2a505 100644 Binary files a/general/DCHU/osrfx2_DCHU_extension_tight/osrfx2_DCHU_extension/osrfx2_DCHU_extension.inx and b/general/DCHU/osrfx2_DCHU_extension_tight/osrfx2_DCHU_extension/osrfx2_DCHU_extension.inx differ diff --git a/general/PLX9x5x/sys/pci9x5x.inx b/general/PLX9x5x/sys/pci9x5x.inx index 8fdb2eea..0d98041d 100644 Binary files a/general/PLX9x5x/sys/pci9x5x.inx and b/general/PLX9x5x/sys/pci9x5x.inx differ diff --git a/general/SimpleMediaSource/SimpleMediaSourceDriver/SimpleMediaSourceDriver.inf b/general/SimpleMediaSource/SimpleMediaSourceDriver/SimpleMediaSourceDriver.inf index d9f05402..aa21c882 100644 Binary files a/general/SimpleMediaSource/SimpleMediaSourceDriver/SimpleMediaSourceDriver.inf and b/general/SimpleMediaSource/SimpleMediaSourceDriver/SimpleMediaSourceDriver.inf differ diff --git a/general/echo/kmdf/driver/AutoSync/echo.inx b/general/echo/kmdf/driver/AutoSync/echo.inx index cd83b6c0..60be19a8 100644 Binary files a/general/echo/kmdf/driver/AutoSync/echo.inx and b/general/echo/kmdf/driver/AutoSync/echo.inx differ diff --git a/general/echo/kmdf/driver/DriverSync/echo_2.inx b/general/echo/kmdf/driver/DriverSync/echo_2.inx index b4cf3c25..73987894 100644 Binary files a/general/echo/kmdf/driver/DriverSync/echo_2.inx and b/general/echo/kmdf/driver/DriverSync/echo_2.inx differ diff --git a/general/echo/umdf2/driver/AutoSync/echoum.inx b/general/echo/umdf2/driver/AutoSync/echoum.inx index 00320858..9962e6c2 100644 Binary files a/general/echo/umdf2/driver/AutoSync/echoum.inx and b/general/echo/umdf2/driver/AutoSync/echoum.inx differ diff --git a/general/pcidrv/kmdf/genpci.inx b/general/pcidrv/kmdf/genpci.inx index f8581414..1c474ca2 100644 Binary files a/general/pcidrv/kmdf/genpci.inx and b/general/pcidrv/kmdf/genpci.inx differ diff --git a/general/toaster/toastDrv/kmdf/bus/dynamic/dynambus.inx b/general/toaster/toastDrv/kmdf/bus/dynamic/dynambus.inx index f557b6e3..e42b1969 100644 Binary files a/general/toaster/toastDrv/kmdf/bus/dynamic/dynambus.inx and b/general/toaster/toastDrv/kmdf/bus/dynamic/dynambus.inx differ diff --git a/general/toaster/toastDrv/kmdf/bus/static/statbus.inx b/general/toaster/toastDrv/kmdf/bus/static/statbus.inx index 094bce09..8f433735 100644 Binary files a/general/toaster/toastDrv/kmdf/bus/static/statbus.inx and b/general/toaster/toastDrv/kmdf/bus/static/statbus.inx differ diff --git a/general/toaster/toastDrv/kmdf/filter/filter.inx b/general/toaster/toastDrv/kmdf/filter/filter.inx index 8a2ca006..31c6cf93 100644 Binary files a/general/toaster/toastDrv/kmdf/filter/filter.inx and b/general/toaster/toastDrv/kmdf/filter/filter.inx differ diff --git a/general/toaster/toastDrv/kmdf/func/featured/wdffeatured.inx b/general/toaster/toastDrv/kmdf/func/featured/wdffeatured.inx index b91edc1b..7310ceb2 100644 Binary files a/general/toaster/toastDrv/kmdf/func/featured/wdffeatured.inx and b/general/toaster/toastDrv/kmdf/func/featured/wdffeatured.inx differ diff --git a/general/toaster/toastDrv/kmdf/func/simple/wdfsimple.inx b/general/toaster/toastDrv/kmdf/func/simple/wdfsimple.inx index 549f20e1..203e251f 100644 Binary files a/general/toaster/toastDrv/kmdf/func/simple/wdfsimple.inx and b/general/toaster/toastDrv/kmdf/func/simple/wdfsimple.inx differ diff --git a/general/toaster/toastDrv/kmdf/toastmon/wdftoastmon.inx b/general/toaster/toastDrv/kmdf/toastmon/wdftoastmon.inx index 0c1a410b..384344c0 100644 Binary files a/general/toaster/toastDrv/kmdf/toastmon/wdftoastmon.inx and b/general/toaster/toastDrv/kmdf/toastmon/wdftoastmon.inx differ diff --git a/general/toaster/umdf2/filter/generic/filterum.inx b/general/toaster/umdf2/filter/generic/filterum.inx index e7e04b65..fad4882d 100644 Binary files a/general/toaster/umdf2/filter/generic/filterum.inx and b/general/toaster/umdf2/filter/generic/filterum.inx differ diff --git a/general/toaster/umdf2/func/featured/wdffeaturedum.inx b/general/toaster/umdf2/func/featured/wdffeaturedum.inx index 7b5f9c07..f93fcf91 100644 Binary files a/general/toaster/umdf2/func/featured/wdffeaturedum.inx and b/general/toaster/umdf2/func/featured/wdffeaturedum.inx differ diff --git a/general/toaster/umdf2/func/simple/wdfsimpleum.inx b/general/toaster/umdf2/func/simple/wdfsimpleum.inx index e07cf3a1..10f52074 100644 Binary files a/general/toaster/umdf2/func/simple/wdfsimpleum.inx and b/general/toaster/umdf2/func/simple/wdfsimpleum.inx differ diff --git a/gnss/gnssUmdf/gnssUmdf.inf b/gnss/gnssUmdf/gnssUmdf.inf index b7f3363e..e3815c9e 100644 Binary files a/gnss/gnssUmdf/gnssUmdf.inf and b/gnss/gnssUmdf/gnssUmdf.inf differ diff --git a/gpio/samples/simdevice/kmdf/simdevice.inx b/gpio/samples/simdevice/kmdf/simdevice.inx index c758f27a..cdb02c81 100644 Binary files a/gpio/samples/simdevice/kmdf/simdevice.inx and b/gpio/samples/simdevice/kmdf/simdevice.inx differ diff --git a/gpio/samples/simdevice/umdf/simdeviceumdf.inx b/gpio/samples/simdevice/umdf/simdeviceumdf.inx index 587cd604..1cfda2e7 100644 Binary files a/gpio/samples/simdevice/umdf/simdeviceumdf.inx and b/gpio/samples/simdevice/umdf/simdeviceumdf.inx differ diff --git a/gpio/samples/simgpio/simgpio.inx b/gpio/samples/simgpio/simgpio.inx index fd8a4c18..7cd926a1 100644 Binary files a/gpio/samples/simgpio/simgpio.inx and b/gpio/samples/simgpio/simgpio.inx differ diff --git a/gpio/samples/simgpio_i2c/simgpio_i2c.inx b/gpio/samples/simgpio_i2c/simgpio_i2c.inx index 7706cfbf..e57a67d3 100644 Binary files a/gpio/samples/simgpio_i2c/simgpio_i2c.inx and b/gpio/samples/simgpio_i2c/simgpio_i2c.inx differ diff --git a/hid/firefly/driver/firefly.inx b/hid/firefly/driver/firefly.inx index caab90fc..aec3a013 100644 Binary files a/hid/firefly/driver/firefly.inx and b/hid/firefly/driver/firefly.inx differ diff --git a/hid/hidusbfx2/sys/hidusbfx2.inx b/hid/hidusbfx2/sys/hidusbfx2.inx index f45b9708..b4944828 100644 Binary files a/hid/hidusbfx2/sys/hidusbfx2.inx and b/hid/hidusbfx2/sys/hidusbfx2.inx differ diff --git a/hid/vhidmini2/driver/kmdf/vhidmini.inx b/hid/vhidmini2/driver/kmdf/vhidmini.inx index e126977f..98ad43ec 100644 Binary files a/hid/vhidmini2/driver/kmdf/vhidmini.inx and b/hid/vhidmini2/driver/kmdf/vhidmini.inx differ diff --git a/hid/vhidmini2/driver/umdf2/VhidminiUm.inx b/hid/vhidmini2/driver/umdf2/VhidminiUm.inx index aa617a3f..92cdd4b9 100644 Binary files a/hid/vhidmini2/driver/umdf2/VhidminiUm.inx and b/hid/vhidmini2/driver/umdf2/VhidminiUm.inx differ diff --git a/input/kbfiltr/sys/kbfiltr.inx b/input/kbfiltr/sys/kbfiltr.inx index 1412bc67..c489caf0 100644 Binary files a/input/kbfiltr/sys/kbfiltr.inx and b/input/kbfiltr/sys/kbfiltr.inx differ diff --git a/input/moufiltr/moufiltr.inx b/input/moufiltr/moufiltr.inx index c3cf47c4..92aea951 100644 Binary files a/input/moufiltr/moufiltr.inx and b/input/moufiltr/moufiltr.inx differ diff --git a/network/modem/fakemodem/mdmfake.inx b/network/modem/fakemodem/mdmfake.inx index ea95a9ad..29629983 100644 Binary files a/network/modem/fakemodem/mdmfake.inx and b/network/modem/fakemodem/mdmfake.inx differ diff --git a/network/ndis/extension/samples/forward/msforwardext.inf b/network/ndis/extension/samples/forward/msforwardext.inf index 4af1b0fb..be4d37dc 100644 Binary files a/network/ndis/extension/samples/forward/msforwardext.inf and b/network/ndis/extension/samples/forward/msforwardext.inf differ diff --git a/network/ndis/extension/samples/passthrough/mspassthroughext.inf b/network/ndis/extension/samples/passthrough/mspassthroughext.inf index 8339e7c8..71ecfbe8 100644 Binary files a/network/ndis/extension/samples/passthrough/mspassthroughext.inf and b/network/ndis/extension/samples/passthrough/mspassthroughext.inf differ diff --git a/network/ndis/filter/netlwf.inf b/network/ndis/filter/netlwf.inf index e59b56fb..42a80912 100644 Binary files a/network/ndis/filter/netlwf.inf and b/network/ndis/filter/netlwf.inf differ diff --git a/network/ndis/mux/driver/60/mux_mp.inf b/network/ndis/mux/driver/60/mux_mp.inf index f216ac16..5c0944bb 100644 Binary files a/network/ndis/mux/driver/60/mux_mp.inf and b/network/ndis/mux/driver/60/mux_mp.inf differ diff --git a/network/ndis/mux/driver/60/muxp.inf b/network/ndis/mux/driver/60/muxp.inf index f9c4c04e..ea09e77d 100644 Binary files a/network/ndis/mux/driver/60/muxp.inf and b/network/ndis/mux/driver/60/muxp.inf differ diff --git a/network/ndis/ndisprot/6x/sys/60/ndisprot60.inf b/network/ndis/ndisprot/6x/sys/60/ndisprot60.inf index bae3936c..7022c0e6 100644 Binary files a/network/ndis/ndisprot/6x/sys/60/ndisprot60.inf and b/network/ndis/ndisprot/6x/sys/60/ndisprot60.inf differ diff --git a/network/ndis/ndisprot/6x/sys/630/ndisprot630.inf b/network/ndis/ndisprot/6x/sys/630/ndisprot630.inf index c5d7adb6..6a3e7da1 100644 Binary files a/network/ndis/ndisprot/6x/sys/630/ndisprot630.inf and b/network/ndis/ndisprot/6x/sys/630/ndisprot630.inf differ diff --git a/network/ndis/ndisprot_kmdf/60/ndisprot.inx b/network/ndis/ndisprot_kmdf/60/ndisprot.inx index ecd932c1..1c5762f1 100644 Binary files a/network/ndis/ndisprot_kmdf/60/ndisprot.inx and b/network/ndis/ndisprot_kmdf/60/ndisprot.inx differ diff --git a/network/ndis/netvmini/6x/60/netvmini60.inf b/network/ndis/netvmini/6x/60/netvmini60.inf index 63382e9b..31361685 100644 Binary files a/network/ndis/netvmini/6x/60/netvmini60.inf and b/network/ndis/netvmini/6x/60/netvmini60.inf differ diff --git a/network/ndis/netvmini/6x/620/netvmini620.inf b/network/ndis/netvmini/6x/620/netvmini620.inf index 4dc1c9b6..f2ece226 100644 Binary files a/network/ndis/netvmini/6x/620/netvmini620.inf and b/network/ndis/netvmini/6x/620/netvmini620.inf differ diff --git a/network/ndis/netvmini/6x/630/netvmini630.inf b/network/ndis/netvmini/6x/630/netvmini630.inf index eb7d61c8..40db5135 100644 Binary files a/network/ndis/netvmini/6x/630/netvmini630.inf and b/network/ndis/netvmini/6x/630/netvmini630.inf differ diff --git a/network/ndis/netvmini/6x/680/netvmini680.inf b/network/ndis/netvmini/6x/680/netvmini680.inf index 4160c520..5da91049 100644 Binary files a/network/ndis/netvmini/6x/680/netvmini680.inf and b/network/ndis/netvmini/6x/680/netvmini680.inf differ diff --git a/network/trans/inspect/sys/inspect.inf b/network/trans/inspect/sys/inspect.inf index cf7f7e76..1a1aa466 100644 Binary files a/network/trans/inspect/sys/inspect.inf and b/network/trans/inspect/sys/inspect.inf differ diff --git a/network/trans/msnmntr/sys/msnmntr.inf b/network/trans/msnmntr/sys/msnmntr.inf index 38589761..e3ec3563 100644 Binary files a/network/trans/msnmntr/sys/msnmntr.inf and b/network/trans/msnmntr/sys/msnmntr.inf differ diff --git a/network/wlan/WDI/PLATFORM/WinInf/SDIO/x64/netrtwlans.inf b/network/wlan/WDI/PLATFORM/WinInf/SDIO/x64/netrtwlans.inf index e7753ef3..4640bc85 100644 Binary files a/network/wlan/WDI/PLATFORM/WinInf/SDIO/x64/netrtwlans.inf and b/network/wlan/WDI/PLATFORM/WinInf/SDIO/x64/netrtwlans.inf differ diff --git a/network/wwan/cxwmbclass/cxwmbclass/cxwmbclass.inf b/network/wwan/cxwmbclass/cxwmbclass/cxwmbclass.inf index 48f893c6..496e5c6a 100644 Binary files a/network/wwan/cxwmbclass/cxwmbclass/cxwmbclass.inf and b/network/wwan/cxwmbclass/cxwmbclass/cxwmbclass.inf differ diff --git a/nfc/NfcCxSample/windows-drivertemplate-nfc/windows-drivertemplate-nfc.inf b/nfc/NfcCxSample/windows-drivertemplate-nfc/windows-drivertemplate-nfc.inf index 5d1afa6e..38d5d022 100644 Binary files a/nfc/NfcCxSample/windows-drivertemplate-nfc/windows-drivertemplate-nfc.inf and b/nfc/NfcCxSample/windows-drivertemplate-nfc/windows-drivertemplate-nfc.inf differ diff --git a/pofx/PEP/acpi/sampleacpipep.inx b/pofx/PEP/acpi/sampleacpipep.inx index 9f93ad5b..94063ad0 100644 Binary files a/pofx/PEP/acpi/sampleacpipep.inx and b/pofx/PEP/acpi/sampleacpipep.inx differ diff --git a/pofx/UMDF2/Driver/SingleComp/SingleComponentSingleStateUm.inx b/pofx/UMDF2/Driver/SingleComp/SingleComponentSingleStateUm.inx index ffdf5414..2a8dffc1 100644 Binary files a/pofx/UMDF2/Driver/SingleComp/SingleComponentSingleStateUm.inx and b/pofx/UMDF2/Driver/SingleComp/SingleComponentSingleStateUm.inx differ diff --git a/pofx/WDF/Driver/MultiComp/driver/WdfMultiComp.inx b/pofx/WDF/Driver/MultiComp/driver/WdfMultiComp.inx index 4642ce27..5bd9ee1c 100644 Binary files a/pofx/WDF/Driver/MultiComp/driver/WdfMultiComp.inx and b/pofx/WDF/Driver/MultiComp/driver/WdfMultiComp.inx differ diff --git a/pofx/WDF/Driver/SingleComp/SingleComponentFStateSample.inx b/pofx/WDF/Driver/SingleComp/SingleComponentFStateSample.inx index adaa2411..7f99b48c 100644 Binary files a/pofx/WDF/Driver/SingleComp/SingleComponentFStateSample.inx and b/pofx/WDF/Driver/SingleComp/SingleComponentFStateSample.inx differ diff --git a/pos/drivers/MagneticStripeReader/SampleMagneticStripeReaderDrv.inf b/pos/drivers/MagneticStripeReader/SampleMagneticStripeReaderDrv.inf index 1dbdcc58..94a9bd03 100644 Binary files a/pos/drivers/MagneticStripeReader/SampleMagneticStripeReaderDrv.inf and b/pos/drivers/MagneticStripeReader/SampleMagneticStripeReaderDrv.inf differ diff --git a/pos/drivers/barcodescanner/SampleBarcodeScannerDrv.inf b/pos/drivers/barcodescanner/SampleBarcodeScannerDrv.inf index 28a173ea..835a550a 100644 Binary files a/pos/drivers/barcodescanner/SampleBarcodeScannerDrv.inf and b/pos/drivers/barcodescanner/SampleBarcodeScannerDrv.inf differ diff --git a/prm/PrmFunc/prmfuncsample.inf b/prm/PrmFunc/prmfuncsample.inf index bdd78384..f583ca59 100644 Binary files a/prm/PrmFunc/prmfuncsample.inf and b/prm/PrmFunc/prmfuncsample.inf differ diff --git a/sd/miniport/sdhc/sdhc.inx b/sd/miniport/sdhc/sdhc.inx index 50026a87..379978b1 100644 Binary files a/sd/miniport/sdhc/sdhc.inx and b/sd/miniport/sdhc/sdhc.inx differ diff --git a/sensors/ADXL345Acc/ADXL345Acc.inx b/sensors/ADXL345Acc/ADXL345Acc.inx index 73fd9d97..a2f05fb6 100644 Binary files a/sensors/ADXL345Acc/ADXL345Acc.inx and b/sensors/ADXL345Acc/ADXL345Acc.inx differ diff --git a/sensors/Activity/Activity.inx b/sensors/Activity/Activity.inx index 5d111d86..7570a42c 100644 Binary files a/sensors/Activity/Activity.inx and b/sensors/Activity/Activity.inx differ diff --git a/sensors/CustomSensors/CustomSensors.inx b/sensors/CustomSensors/CustomSensors.inx index 86438b0d..ff288b6f 100644 Binary files a/sensors/CustomSensors/CustomSensors.inx and b/sensors/CustomSensors/CustomSensors.inx differ diff --git a/sensors/Fusion/FusionSensor.inx b/sensors/Fusion/FusionSensor.inx index 44d590c4..21419ef8 100644 Binary files a/sensors/Fusion/FusionSensor.inx and b/sensors/Fusion/FusionSensor.inx differ diff --git a/sensors/Pedometer/Pedometer.inx b/sensors/Pedometer/Pedometer.inx index 91a304bf..16a752c2 100644 Binary files a/sensors/Pedometer/Pedometer.inx and b/sensors/Pedometer/Pedometer.inx differ diff --git a/sensors/SensorsComboDriver/SensorsComboDriver.inx b/sensors/SensorsComboDriver/SensorsComboDriver.inx index 699be4de..00c1eebf 100644 Binary files a/sensors/SensorsComboDriver/SensorsComboDriver.inx and b/sensors/SensorsComboDriver/SensorsComboDriver.inx differ diff --git a/sensors/SimpleDeviceOrientationSensor/SimpleDeviceOrientationSensor.inx b/sensors/SimpleDeviceOrientationSensor/SimpleDeviceOrientationSensor.inx index b2ccfaba..9ea73281 100644 Binary files a/sensors/SimpleDeviceOrientationSensor/SimpleDeviceOrientationSensor.inx and b/sensors/SimpleDeviceOrientationSensor/SimpleDeviceOrientationSensor.inx differ diff --git a/serial/VirtualSerial2/ComPort/virtualserial2um.inx b/serial/VirtualSerial2/ComPort/virtualserial2um.inx index 6679d7ab..f40e466d 100644 Binary files a/serial/VirtualSerial2/ComPort/virtualserial2um.inx and b/serial/VirtualSerial2/ComPort/virtualserial2um.inx differ diff --git a/serial/VirtualSerial2/FakeModem/fakemodem2um.inx b/serial/VirtualSerial2/FakeModem/fakemodem2um.inx index 235bdddd..ecb8f875 100644 Binary files a/serial/VirtualSerial2/FakeModem/fakemodem2um.inx and b/serial/VirtualSerial2/FakeModem/fakemodem2um.inx differ diff --git a/serial/serial/serial.inx b/serial/serial/serial.inx index d6bfc3bb..2b26d20b 100644 Binary files a/serial/serial/serial.inx and b/serial/serial/serial.inx differ diff --git a/simbatt/func/simbatt.inx b/simbatt/func/simbatt.inx index 5aab816a..c628040b 100644 Binary files a/simbatt/func/simbatt.inx and b/simbatt/func/simbatt.inx differ diff --git a/smartcrd/pscr/pscr.inx b/smartcrd/pscr/pscr.inx index ad9040fe..5e62eee6 100644 Binary files a/smartcrd/pscr/pscr.inx and b/smartcrd/pscr/pscr.inx differ diff --git a/spb/SkeletonI2C/skeletoni2c.inx b/spb/SkeletonI2C/skeletoni2c.inx index 056423f9..67ca6582 100644 Binary files a/spb/SkeletonI2C/skeletoni2c.inx and b/spb/SkeletonI2C/skeletoni2c.inx differ diff --git a/spb/SpbTestTool/sys/spbtesttool.inx b/spb/SpbTestTool/sys/spbtesttool.inx index baf82127..b52c4ccc 100644 Binary files a/spb/SpbTestTool/sys/spbtesttool.inx and b/spb/SpbTestTool/sys/spbtesttool.inx differ diff --git a/storage/msdsm/src/SampleDSM.inf b/storage/msdsm/src/SampleDSM.inf index a820c7ec..f0dbb34d 100644 Binary files a/storage/msdsm/src/SampleDSM.inf and b/storage/msdsm/src/SampleDSM.inf differ diff --git a/thermal/simsensor/simsensor.inf b/thermal/simsensor/simsensor.inf index 2b9a4394..f1aa5512 100644 Binary files a/thermal/simsensor/simsensor.inf and b/thermal/simsensor/simsensor.inf differ diff --git a/thermal/thermalclient/simtc.inf b/thermal/thermalclient/simtc.inf index 7c27c1d2..e015a83c 100644 Binary files a/thermal/thermalclient/simtc.inf and b/thermal/thermalclient/simtc.inf differ diff --git a/tools/dv/samples/DV-FailDriver-WDM/driver/defect_toastmon.inf b/tools/dv/samples/DV-FailDriver-WDM/driver/defect_toastmon.inf index edb7ee89..e577f586 100644 Binary files a/tools/dv/samples/DV-FailDriver-WDM/driver/defect_toastmon.inf and b/tools/dv/samples/DV-FailDriver-WDM/driver/defect_toastmon.inf differ diff --git a/usb/UcmCxUcsi/UcmCxUcsi.inf b/usb/UcmCxUcsi/UcmCxUcsi.inf index 661424db..e238ba06 100644 Binary files a/usb/UcmCxUcsi/UcmCxUcsi.inf and b/usb/UcmCxUcsi/UcmCxUcsi.inf differ diff --git a/usb/UcmTcpciCxClientSample/UcmTcpciCxClientSample.inf b/usb/UcmTcpciCxClientSample/UcmTcpciCxClientSample.inf index 5a526ab9..6ee60372 100644 Binary files a/usb/UcmTcpciCxClientSample/UcmTcpciCxClientSample.inf and b/usb/UcmTcpciCxClientSample/UcmTcpciCxClientSample.inf differ diff --git a/usb/UcmUcsiAcpiSample/UcmUcsiAcpiSample/UcmUcsiAcpiSample.inf b/usb/UcmUcsiAcpiSample/UcmUcsiAcpiSample/UcmUcsiAcpiSample.inf index c52e7865..39b3c16a 100644 Binary files a/usb/UcmUcsiAcpiSample/UcmUcsiAcpiSample/UcmUcsiAcpiSample.inf and b/usb/UcmUcsiAcpiSample/UcmUcsiAcpiSample/UcmUcsiAcpiSample.inf differ diff --git a/usb/kmdf_enumswitches/sys/kmdf_enumswitches.inx b/usb/kmdf_enumswitches/sys/kmdf_enumswitches.inx index d9d1366b..eb3c3c4b 100644 Binary files a/usb/kmdf_enumswitches/sys/kmdf_enumswitches.inx and b/usb/kmdf_enumswitches/sys/kmdf_enumswitches.inx differ diff --git a/usb/kmdf_fx2/driver/osrusbfx2.inx b/usb/kmdf_fx2/driver/osrusbfx2.inx index 1185053e..b30e6dc9 100644 Binary files a/usb/kmdf_fx2/driver/osrusbfx2.inx and b/usb/kmdf_fx2/driver/osrusbfx2.inx differ diff --git a/usb/ufxclientsample/UfxClientSample.inx b/usb/ufxclientsample/UfxClientSample.inx index 01c37a10..357bf788 100644 Binary files a/usb/ufxclientsample/UfxClientSample.inx and b/usb/ufxclientsample/UfxClientSample.inx differ diff --git a/usb/umdf2_fx2/driver/osrusbfx2um.inx b/usb/umdf2_fx2/driver/osrusbfx2um.inx index 737295b0..de08b136 100644 Binary files a/usb/umdf2_fx2/driver/osrusbfx2um.inx and b/usb/umdf2_fx2/driver/osrusbfx2um.inx differ diff --git a/usb/usbsamp/sys/driver/usbsamp.inx b/usb/usbsamp/sys/driver/usbsamp.inx index 57dc4bf3..1dfa8473 100644 Binary files a/usb/usbsamp/sys/driver/usbsamp.inx and b/usb/usbsamp/sys/driver/usbsamp.inx differ diff --git a/usb/wdf_osrfx2_lab/kmdf/step1/osrusbfx2.inx b/usb/wdf_osrfx2_lab/kmdf/step1/osrusbfx2.inx index 0fc45d1a..3d5fe521 100644 Binary files a/usb/wdf_osrfx2_lab/kmdf/step1/osrusbfx2.inx and b/usb/wdf_osrfx2_lab/kmdf/step1/osrusbfx2.inx differ diff --git a/usb/wdf_osrfx2_lab/kmdf/step2/osrusbfx2.inx b/usb/wdf_osrfx2_lab/kmdf/step2/osrusbfx2.inx index f7e12d74..4805bc9c 100644 Binary files a/usb/wdf_osrfx2_lab/kmdf/step2/osrusbfx2.inx and b/usb/wdf_osrfx2_lab/kmdf/step2/osrusbfx2.inx differ diff --git a/usb/wdf_osrfx2_lab/kmdf/step3/osrusbfx2.inx b/usb/wdf_osrfx2_lab/kmdf/step3/osrusbfx2.inx index f7e12d74..4805bc9c 100644 Binary files a/usb/wdf_osrfx2_lab/kmdf/step3/osrusbfx2.inx and b/usb/wdf_osrfx2_lab/kmdf/step3/osrusbfx2.inx differ diff --git a/usb/wdf_osrfx2_lab/kmdf/step4/osrusbfx2.inx b/usb/wdf_osrfx2_lab/kmdf/step4/osrusbfx2.inx index f7e12d74..4805bc9c 100644 Binary files a/usb/wdf_osrfx2_lab/kmdf/step4/osrusbfx2.inx and b/usb/wdf_osrfx2_lab/kmdf/step4/osrusbfx2.inx differ diff --git a/usb/wdf_osrfx2_lab/kmdf/step5/osrusbfx2.inx b/usb/wdf_osrfx2_lab/kmdf/step5/osrusbfx2.inx index f7e12d74..4805bc9c 100644 Binary files a/usb/wdf_osrfx2_lab/kmdf/step5/osrusbfx2.inx and b/usb/wdf_osrfx2_lab/kmdf/step5/osrusbfx2.inx differ diff --git a/video/IndirectDisplay/IddSampleDriver/IddSampleDriver.inf b/video/IndirectDisplay/IddSampleDriver/IddSampleDriver.inf index dc63f6ad..4edee6b8 100644 Binary files a/video/IndirectDisplay/IddSampleDriver/IddSampleDriver.inf and b/video/IndirectDisplay/IddSampleDriver/IddSampleDriver.inf differ diff --git a/wia/ProdScan/ProdScan.inx b/wia/ProdScan/ProdScan.inx index 6e8036ef..f27b79b9 100644 Binary files a/wia/ProdScan/ProdScan.inx and b/wia/ProdScan/ProdScan.inx differ diff --git a/wia/microdrv/testmcro.inx b/wia/microdrv/testmcro.inx index 86e3d220..3d084142 100644 Binary files a/wia/microdrv/testmcro.inx and b/wia/microdrv/testmcro.inx differ diff --git a/wia/wiadriverex/usd/WiaDriver.inx b/wia/wiadriverex/usd/WiaDriver.inx index 5d394e80..f527cde2 100644 Binary files a/wia/wiadriverex/usd/WiaDriver.inx and b/wia/wiadriverex/usd/WiaDriver.inx differ diff --git a/wmi/wmisamp/wmisamp.inx b/wmi/wmisamp/wmisamp.inx index bdf4152f..3b6250b9 100644 Binary files a/wmi/wmisamp/wmisamp.inx and b/wmi/wmisamp/wmisamp.inx differ -- cgit v1.3.1 From 6f1d71fc66f007e50f2eaa96afd2f0dd78e58d56 Mon Sep 17 00:00:00 2001 From: taj0207 Date: Mon, 8 Jul 2024 08:13:17 -0700 Subject: update with codel fix --- network/wwan/cxwmbclass/datapipe.cpp | 4 +++- network/wwan/cxwmbclass/inc/util.h | 14 ++++++-------- network/wwan/cxwmbclass/utils.cpp | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/network/wwan/cxwmbclass/datapipe.cpp b/network/wwan/cxwmbclass/datapipe.cpp index 4452b761..b753a9e9 100644 --- a/network/wwan/cxwmbclass/datapipe.cpp +++ b/network/wwan/cxwmbclass/datapipe.cpp @@ -428,6 +428,7 @@ MbbBusWriteData(__in MBB_BUS_HANDLE BusHandle, __in MBB_REQUEST_HANDLE RequestHa WDFMEMORY BufferMemoryObject = NULL; WDFREQUEST WriteRequestZLP = NULL; PUSB_WRITE_REQ_CONTEXT writeContextZLP = NULL; + NTSTATUS ZlpStatus; usbDeviceContext = GetUsbDeviceContext(BusObject->WdfUsbDevice); @@ -641,7 +642,7 @@ MbbBusWriteData(__in MBB_BUS_HANDLE BusHandle, __in MBB_REQUEST_HANDLE RequestHa if (WriteRequestZLP != NULL) { - NTSTATUS ZlpStatus; + Status = WdfUsbTargetPipeFormatRequestForWrite(usbDeviceContext->BulkOutputPipe, WriteRequestZLP, NULL, NULL); if (!NT_SUCCESS(Status)) @@ -696,6 +697,7 @@ Cleanup: if (WriteRequestZLP != NULL) { + Status = ZlpStatus; FreeWriteRequest(BusObject->WdfUsbDevice, WriteRequestZLP); WriteRequestZLP = NULL; } diff --git a/network/wwan/cxwmbclass/inc/util.h b/network/wwan/cxwmbclass/inc/util.h index 12d166b4..e55c07e0 100644 --- a/network/wwan/cxwmbclass/inc/util.h +++ b/network/wwan/cxwmbclass/inc/util.h @@ -2,14 +2,12 @@ // Copyright (C) Microsoft. All rights reserved. // #pragma once -typedef enum -{ - MbbPoolTagDefault = '0CBM', - MbbPoolTagNtbSend = '1CBM', - MbbPoolTagNblSend = '2CBM', - MbbPoolTagNbSend = '3CBM', - MbbPoolTagMdlReceive = '6CBM' -} MBB_POOL_TAG; + +#define MbbPoolTagDefault '0CBM' +#define MbbPoolTagNtbSend '1CBM' +#define MbbPoolTagNblSend '2CBM' +#define MbbPoolTagNbSend '3CBM' +#define MbbPoolTagMdlReceive '6CBM' #define ALLOCATE_PAGED_POOL(_y) ExAllocatePool2(POOL_FLAG_PAGED, _y, MbbPoolTagDefault) #define ALLOCATE_NONPAGED_POOL(_y) ExAllocatePool2(POOL_FLAG_NON_PAGED, _y, MbbPoolTagDefault) diff --git a/network/wwan/cxwmbclass/utils.cpp b/network/wwan/cxwmbclass/utils.cpp index ec791ab4..bc74100d 100644 --- a/network/wwan/cxwmbclass/utils.cpp +++ b/network/wwan/cxwmbclass/utils.cpp @@ -248,7 +248,7 @@ MbbBusGetStat(__in MBB_BUS_HANDLE BusHandle, __in USHORT StatIndex, __out ULONGL if (NT_SUCCESS(Status)) { - if (BytesTransfered < sizeof(Value)) + if (BytesTransfered < sizeof(*Value)) { Status = STATUS_INFO_LENGTH_MISMATCH; } -- cgit v1.3.1 From 4dbe9c1e6afffdf799cb09467262179eb5fa42e4 Mon Sep 17 00:00:00 2001 From: Wei Mao Date: Fri, 16 Aug 2024 09:57:07 -0700 Subject: [serial/VirtualSerial2] Fix issue #1202 --- serial/VirtualSerial2/queue.c | 1 - 1 file changed, 1 deletion(-) diff --git a/serial/VirtualSerial2/queue.c b/serial/VirtualSerial2/queue.c index 80571b42..83b022de 100644 --- a/serial/VirtualSerial2/queue.c +++ b/serial/VirtualSerial2/queue.c @@ -173,7 +173,6 @@ RequestCopyToBuffer( return status; } - WdfRequestSetInformation(Request, NumBytesToCopyTo); return status; } -- cgit v1.3.1 From c4a093eed801a0b848e331c7ee64a91a1b114fdf Mon Sep 17 00:00:00 2001 From: Zac Lockard Date: Tue, 20 Aug 2024 14:41:03 -0700 Subject: Fix for sdhc sample using bootflags as a registry (#1207) Fix for bootflags being written as a regkey in sdhc Co-authored-by: Zac Lockard --- sd/miniport/sdhc/sdhc.inx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sd/miniport/sdhc/sdhc.inx b/sd/miniport/sdhc/sdhc.inx index 379978b1..f2b6c58a 100644 --- a/sd/miniport/sdhc/sdhc.inx +++ b/sd/miniport/sdhc/sdhc.inx @@ -5,7 +5,7 @@ Signature="$Windows NT$" Class=SDHost ClassGUID={a0a588a4-c46f-4b37-b7ea-c82fe89870c6} Provider=%ProviderString% -DriverVer=04/02/2015,10.0.10053 +DriverVer=04/02/2015,10.0.10053.0 CatalogFile=sdhc.cat PnpLockdown=1 @@ -16,9 +16,9 @@ PnpLockdown=1 sdhc.sys = 1 [Manufacturer] -%Generic%=Generic,NT$ARCH$ -%TED%=TED,NT$ARCH$ -%VIA%=VIA,NT$ARCH$ +%Generic%=Generic,NT$ARCH$.10.0...25398 +%TED%=TED,NT$ARCH$.10.0...25398 +%VIA%=VIA,NT$ARCH$.10.0...25398 [ControlFlags] ExcludeFromSelect=* @@ -27,7 +27,7 @@ ExcludeFromSelect=* ; Generic Device ; -[Generic.NT$ARCH$] +[Generic.NT$ARCH$.10.0...25398] %PCI\CC_080500.DeviceDesc%=SDHost, PCI\CC_080500 %PCI\CC_080501.DeviceDesc%=SDHost, PCI\CC_080501 %ACPI\PNP0D40.DeviceDesc%=SDHost, ACPI\PNP0D40 @@ -42,10 +42,10 @@ ExcludeFromSelect=* ; %% ; -[TED.NT$ARCH$] +[TED.NT$ARCH$.10.0...25398] %PCI\VEN_1679&DEV_3000.DeviceDesc%=SDHost, PCI\VEN_1679&DEV_3000 -[VIA.NT$ARCH$] +[VIA.NT$ARCH$.10.0...25398] %PCI\VEN_1106&DEV_365B.DeviceDesc%=SDHost, PCI\VEN_1106&DEV_365B %PCI\VEN_1106&DEV_401B.DeviceDesc%=SDHost, PCI\VEN_1106&DEV_401B %PCI\VEN_1106&DEV_95D0.DeviceDesc%=SDHost, PCI\VEN_1106&DEV_95D0 @@ -60,6 +60,7 @@ StartType = %SERVICE_DEMAND_START% ErrorControl = %SERVICE_ERROR_NORMAL% ServiceBinary = %12%\sdhc.sys LoadOrderGroup = System Bus Extender +BootFlags = 0x00000008 AddReg = SDHCServiceReg ; @@ -73,7 +74,6 @@ HKR,,UINumberDescFormat,,%SDHCSlot% HKR,,Driver,,"sdhc.sys" [SDHCServiceReg] -HKR,,BootFlags,0x00010003,0x00000008 HKR,Parameters,SdCmdFlags,1, 05,01, 06,01, 08,11, 09,19, 0A,19, 0D,11, \ 10,01, 11,01, 12,01, 17,01, 18,05, 19,05, \ 1A,01, 1B,01, 1C,01, \ @@ -172,4 +172,4 @@ REG_SZ = 0x00000000 ProviderString="TODO-Set-Provider" TED="Tokyo Electron Device" -VIA="VIA Technologies, Inc" +VIA="VIA Technologies, Inc" \ No newline at end of file -- cgit v1.3.1 From 3692e25f8cb37f62f8e89a659d0f64c1a34ab3e3 Mon Sep 17 00:00:00 2001 From: Wei Mao Date: Tue, 3 Sep 2024 16:23:42 -0700 Subject: Copy general\ioctl\wdm\exe to general\ioctl\kmdf\exe --- general/ioctl/kmdf/exe/install.c | 432 ++++++++------------------------------ general/ioctl/kmdf/exe/nonpnp.inf | 8 - general/ioctl/kmdf/exe/testapp.c | 120 +---------- 3 files changed, 86 insertions(+), 474 deletions(-) delete mode 100644 general/ioctl/kmdf/exe/nonpnp.inf diff --git a/general/ioctl/kmdf/exe/install.c b/general/ioctl/kmdf/exe/install.c index 7060243a..ed2aa6e8 100644 --- a/general/ioctl/kmdf/exe/install.c +++ b/general/ioctl/kmdf/exe/install.c @@ -22,101 +22,44 @@ Environment: --*/ -#include -_Analysis_mode_(_Analysis_code_type_user_code_) - #include -#include #include #include #include +#include #include "public.h" -#include - -#define ARRAY_SIZE(x) (sizeof(x) /sizeof(x[0])) - -extern -PCHAR -GetCoinstallerVersion( - VOID - ) ; - BOOLEAN InstallDriver( - IN SC_HANDLE SchSCManager, - IN LPCTSTR DriverName, - IN LPCTSTR ServiceExe + _In_ SC_HANDLE SchSCManager, + _In_ LPCTSTR DriverName, + _In_ LPCTSTR ServiceExe ); BOOLEAN RemoveDriver( - IN SC_HANDLE SchSCManager, - IN LPCTSTR DriverName + _In_ SC_HANDLE SchSCManager, + _In_ LPCTSTR DriverName ); BOOLEAN StartDriver( - IN SC_HANDLE SchSCManager, - IN LPCTSTR DriverName + _In_ SC_HANDLE SchSCManager, + _In_ LPCTSTR DriverName ); BOOLEAN StopDriver( - IN SC_HANDLE SchSCManager, - IN LPCTSTR DriverName + _In_ SC_HANDLE SchSCManager, + _In_ LPCTSTR DriverName ); -#define SYSTEM32_DRIVERS "\\System32\\Drivers\\" -#define NONPNP_INF_FILENAME L"\\nonpnp.inf" -#define WDF_SECTION_NAME L"nonpnp.NT.Wdf" - -//---------------------------------------------------------------------------- -// -//---------------------------------------------------------------------------- -PFN_WDFPREDEVICEINSTALLEX pfnWdfPreDeviceInstallEx; -PFN_WDFPOSTDEVICEINSTALL pfnWdfPostDeviceInstall; -PFN_WDFPREDEVICEREMOVE pfnWdfPreDeviceRemove; -PFN_WDFPOSTDEVICEREMOVE pfnWdfPostDeviceRemove; - -//----------------------------------------------------------------------------- -// 4127 -- Conditional Expression is Constant warning -//----------------------------------------------------------------------------- -#define WHILE(a) \ -__pragma(warning(suppress:4127)) while(a) - -LONG -GetPathToInf( - _Out_writes_(InfFilePathSize) PWCHAR InfFilePath, - IN ULONG InfFilePathSize - ) -{ - LONG error = ERROR_SUCCESS; - - if (GetCurrentDirectoryW(InfFilePathSize, InfFilePath) == 0) { - error = GetLastError(); - printf("InstallDriver failed! Error = %d \n", error); - return error; - } - if (FAILED( StringCchCatW(InfFilePath, - InfFilePathSize, - NONPNP_INF_FILENAME) )) { - error = ERROR_BUFFER_OVERFLOW; - return error; - } - return error; - -} - -//---------------------------------------------------------------------------- -// -//---------------------------------------------------------------------------- BOOLEAN InstallDriver( - IN SC_HANDLE SchSCManager, - IN LPCTSTR DriverName, - IN LPCTSTR ServiceExe + _In_ SC_HANDLE SchSCManager, + _In_ LPCTSTR DriverName, + _In_ LPCTSTR ServiceExe ) /*++ @@ -130,10 +73,6 @@ Return Value: { SC_HANDLE schService; DWORD err; - WCHAR infPath[MAX_PATH]; - WDF_COINSTALLER_INSTALL_OPTIONS clientOptions; - - WDF_COINSTALLER_INSTALL_OPTIONS_INIT(&clientOptions); // // NOTE: This creates an entry for a standalone driver. If this @@ -142,22 +81,6 @@ Return Value: // query the registry for existing driver information // (in order to determine a unique Tag, etc.). // - // - // PRE-INSTALL for WDF support - // - err = GetPathToInf(infPath, ARRAY_SIZE(infPath) ); - if (err != ERROR_SUCCESS) { - return FALSE; - } - err = pfnWdfPreDeviceInstallEx(infPath, WDF_SECTION_NAME, &clientOptions); - - if (err != ERROR_SUCCESS) { - if (err == ERROR_SUCCESS_REBOOT_REQUIRED) { - printf("System needs to be rebooted, before the driver installation can proceed.\n"); - } - - return FALSE; - } // // Create a new a service object. @@ -205,15 +128,10 @@ Return Value: // // Close the service object. // - CloseServiceHandle(schService); - // - // POST-INSTALL for WDF support - // - err = pfnWdfPostDeviceInstall( infPath, WDF_SECTION_NAME ); + if (schService) { - if (err != ERROR_SUCCESS) { - return FALSE; + CloseServiceHandle(schService); } // @@ -226,9 +144,9 @@ Return Value: BOOLEAN ManageDriver( - IN LPCTSTR DriverName, - IN LPCTSTR ServiceName, - IN USHORT Function + _In_ LPCTSTR DriverName, + _In_ LPCTSTR ServiceName, + _In_ USHORT Function ) { @@ -337,7 +255,11 @@ ManageDriver( // // Close handle to service control manager. // - CloseServiceHandle(schSCManager); + + if (schSCManager) { + + CloseServiceHandle(schSCManager); + } return rCode; @@ -346,28 +268,12 @@ ManageDriver( BOOLEAN RemoveDriver( - IN SC_HANDLE SchSCManager, - IN LPCTSTR DriverName + _In_ SC_HANDLE SchSCManager, + _In_ LPCTSTR DriverName ) { SC_HANDLE schService; BOOLEAN rCode; - DWORD err; - WCHAR infPath[MAX_PATH]; - - err = GetPathToInf(infPath, ARRAY_SIZE(infPath) ); - if (err != ERROR_SUCCESS) { - return FALSE; - } - - // - // PRE-REMOVE of WDF support - // - err = pfnWdfPreDeviceRemove( infPath, WDF_SECTION_NAME ); - - if (err != ERROR_SUCCESS) { - return FALSE; - } // // Open the handle to the existing service. @@ -415,15 +321,10 @@ RemoveDriver( // // Close the service object. // - CloseServiceHandle(schService); - // - // POST-REMOVE of WDF support - // - err = pfnWdfPostDeviceRemove(infPath, WDF_SECTION_NAME ); + if (schService) { - if (err != ERROR_SUCCESS) { - rCode = FALSE; + CloseServiceHandle(schService); } return rCode; @@ -434,59 +335,73 @@ RemoveDriver( BOOLEAN StartDriver( - IN SC_HANDLE SchSCManager, - IN LPCTSTR DriverName + _In_ SC_HANDLE SchSCManager, + _In_ LPCTSTR DriverName ) { SC_HANDLE schService; DWORD err; - BOOL ok; // // Open the handle to the existing service. // + schService = OpenService(SchSCManager, DriverName, SERVICE_ALL_ACCESS ); if (schService == NULL) { + + printf("OpenService failed! Error = %d \n", GetLastError()); + // // Indicate failure. // - printf("OpenService failed! Error = %d\n", GetLastError()); + return FALSE; } // // Start the execution of the service (i.e. start the driver). // - ok = StartService( schService, 0, NULL ); - if (!ok) { + if (!StartService(schService, // service identifier + 0, // number of arguments + NULL // pointer to arguments + )) { err = GetLastError(); if (err == ERROR_SERVICE_ALREADY_RUNNING) { + // // Ignore this error. // + return TRUE; } else { + + printf("StartService failure! Error = %d \n", err ); + // - // Indicate failure. - // Fall through to properly close the service handle. + // Indicate failure. Fall through to properly close the service handle. // - printf("StartService failure! Error = %d\n", err ); + return FALSE; } + } // // Close the service object. // - CloseServiceHandle(schService); + + if (schService) { + + CloseServiceHandle(schService); + } return TRUE; @@ -496,8 +411,8 @@ StartDriver( BOOLEAN StopDriver( - IN SC_HANDLE SchSCManager, - IN LPCTSTR DriverName + _In_ SC_HANDLE SchSCManager, + _In_ LPCTSTR DriverName ) { BOOLEAN rCode = TRUE; @@ -549,264 +464,87 @@ StopDriver( // // Close the service object. // - CloseServiceHandle (schService); - - return rCode; -} // StopDriver + if (schService) { - -// -// Caller must free returned pathname string. -// -PCHAR -BuildDriversDirPath( - _In_ PSTR DriverName - ) -{ - size_t remain; - size_t len; - PCHAR dir; - - if (!DriverName || strlen(DriverName) == 0) { - return NULL; + CloseServiceHandle (schService); } - remain = MAX_PATH; - - // - // Allocate string space - // - dir = (PCHAR) malloc( remain + 1 ); - - if (!dir) { - return NULL; - } - - // - // Get the base windows directory path. - // - len = GetWindowsDirectory( dir, (UINT) remain ); - - if (len == 0 || - (remain - len) < sizeof(SYSTEM32_DRIVERS)) { - free(dir); - return NULL; - } - remain -= len; - - // - // Build dir to have "%windir%\System32\Drivers\". - // - if (FAILED( StringCchCat(dir, remain, SYSTEM32_DRIVERS) )) { - free(dir); - return NULL; - } - - remain -= sizeof(SYSTEM32_DRIVERS); - len += sizeof(SYSTEM32_DRIVERS); - len += strlen(DriverName); - - if (remain < len) { - free(dir); - return NULL; - } - - if (FAILED( StringCchCat(dir, remain, DriverName) )) { - free(dir); - return NULL; - } - - dir[len] = '\0'; // keeps prefast happy - - return dir; -} + return rCode; +} // StopDriver BOOLEAN SetupDriverName( - _Inout_updates_all_(BufferLength) PCHAR DriverLocation, + _Inout_updates_bytes_all_(BufferLength) PCHAR DriverLocation, _In_ ULONG BufferLength ) { HANDLE fileHandle; - DWORD driverLocLen = 0; - BOOL ok; - PCHAR driversDir; + DWORD driverLocLen = 0; // - // Setup path name to driver file. + // Get the current directory. // - driverLocLen = - GetCurrentDirectory(BufferLength, DriverLocation); - if (!driverLocLen) { + driverLocLen = GetCurrentDirectory(BufferLength, + DriverLocation + ); - printf("GetCurrentDirectory failed! Error = %d \n", - GetLastError()); + if (driverLocLen == 0) { - return FALSE; - } + printf("GetCurrentDirectory failed! Error = %d \n", GetLastError()); - if (FAILED( StringCchCat(DriverLocation, BufferLength, "\\" DRIVER_NAME ".sys") )) { return FALSE; } // - // Insure driver file is in the specified directory. + // Setup path name to driver file. // - fileHandle = CreateFile( DriverLocation, - GENERIC_READ, - FILE_SHARE_READ, - NULL, - OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, - NULL ); - - if (fileHandle == INVALID_HANDLE_VALUE) { - // - // Indicate failure. - // - printf("Driver: %s.SYS is not in the %s directory. \n", - DRIVER_NAME, DriverLocation ); + if (FAILED( StringCbCat(DriverLocation, BufferLength, "\\"DRIVER_NAME".sys") )) { return FALSE; } // - // Build %windir%\System32\Drivers\ path. - // Copy the driver to %windir%\system32\drivers + // Insure driver file is in the specified directory. // - driversDir = BuildDriversDirPath( DRIVER_NAME ".sys" ); - if (!driversDir) { - printf("BuildDriversDirPath failed!\n"); - return FALSE; - } + if ((fileHandle = CreateFile(DriverLocation, + GENERIC_READ, + 0, + NULL, + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, + NULL + )) == INVALID_HANDLE_VALUE) { - ok = CopyFile( DriverLocation, driversDir, FALSE ); - if(!ok) { - printf("CopyFile failed: error(%d) - \"%s\"\n", - GetLastError(), driversDir ); - free(driversDir); - return FALSE; - } + printf("%s.sys is not loaded.\n", DRIVER_NAME); + + // + // Indicate failure. + // - if (FAILED( StringCchCopy(DriverLocation, BufferLength, driversDir) )) { - free(driversDir); return FALSE; } - free(driversDir); - // // Close open file handle. // + if (fileHandle) { + CloseHandle(fileHandle); } // // Indicate success. // - return TRUE; - -} // SetupDriverName - -HMODULE -LoadWdfCoInstaller( - VOID - ) -{ - HMODULE library = NULL; - DWORD error = ERROR_SUCCESS; - CHAR szCurDir[MAX_PATH]; - CHAR tempCoinstallerName[MAX_PATH]; - PCHAR coinstallerVersion; - - do { - - if (GetCurrentDirectory(MAX_PATH, szCurDir) == 0) { - - printf("GetCurrentDirectory failed! Error = %d \n", GetLastError()); - break; - } - coinstallerVersion = GetCoinstallerVersion(); - if (FAILED( StringCchPrintf(tempCoinstallerName, - MAX_PATH, - "\\WdfCoInstaller%s.dll", - coinstallerVersion) )) { - break; - } - if (FAILED( StringCchCat(szCurDir, MAX_PATH, tempCoinstallerName) )) { - break; - } - - library = LoadLibrary(szCurDir); - - if (library == NULL) { - error = GetLastError(); - printf("LoadLibrary(%s) failed: %d\n", szCurDir, error); - break; - } - - pfnWdfPreDeviceInstallEx = - (PFN_WDFPREDEVICEINSTALLEX) GetProcAddress( library, "WdfPreDeviceInstallEx" ); - - if (pfnWdfPreDeviceInstallEx == NULL) { - error = GetLastError(); - printf("GetProcAddress(\"WdfPreDeviceInstallEx\") failed: %d\n", error); - return NULL; - } - - pfnWdfPostDeviceInstall = - (PFN_WDFPOSTDEVICEINSTALL) GetProcAddress( library, "WdfPostDeviceInstall" ); - - if (pfnWdfPostDeviceInstall == NULL) { - error = GetLastError(); - printf("GetProcAddress(\"WdfPostDeviceInstall\") failed: %d\n", error); - return NULL; - } - - pfnWdfPreDeviceRemove = - (PFN_WDFPREDEVICEREMOVE) GetProcAddress( library, "WdfPreDeviceRemove" ); - - if (pfnWdfPreDeviceRemove == NULL) { - error = GetLastError(); - printf("GetProcAddress(\"WdfPreDeviceRemove\") failed: %d\n", error); - return NULL; - } - - pfnWdfPostDeviceRemove = - (PFN_WDFPREDEVICEREMOVE) GetProcAddress( library, "WdfPostDeviceRemove" ); - - if (pfnWdfPostDeviceRemove == NULL) { - error = GetLastError(); - printf("GetProcAddress(\"WdfPostDeviceRemove\") failed: %d\n", error); - return NULL; - } - - } WHILE (0); + return TRUE; - if (error != ERROR_SUCCESS) { - if (library) { - FreeLibrary( library ); - } - library = NULL; - } - return library; -} +} // SetupDriverName -VOID -UnloadWdfCoInstaller( - HMODULE Library - ) -{ - if (Library) { - FreeLibrary( Library ); - } -} diff --git a/general/ioctl/kmdf/exe/nonpnp.inf b/general/ioctl/kmdf/exe/nonpnp.inf deleted file mode 100644 index b20a58b4..00000000 --- a/general/ioctl/kmdf/exe/nonpnp.inf +++ /dev/null @@ -1,8 +0,0 @@ -[Version] -Signature="$WINDOWS NT$" - -[nonpnp.NT.Wdf] -KmdfService = nonpnp, nonpnp_Service_kmdfInst - -[nonpnp_Service_kmdfInst] -KmdfLibraryVersion = 1.11 diff --git a/general/ioctl/kmdf/exe/testapp.c b/general/ioctl/kmdf/exe/testapp.c index 6586401e..492c6355 100644 --- a/general/ioctl/kmdf/exe/testapp.c +++ b/general/ioctl/kmdf/exe/testapp.c @@ -54,16 +54,6 @@ ManageDriver( IN USHORT Function ); -HMODULE -LoadWdfCoInstaller( - VOID - ); - -VOID -UnloadWdfCoInstaller( - HMODULE Library - ); - BOOLEAN SetupDriverName( _Inout_updates_all_(BufferLength) PCHAR DriverLocation, @@ -80,14 +70,7 @@ DoIoctls( HANDLE hDevice ); -// for example, WDF 1.9 is "01009". the size 6 includes the ending NULL marker -// -#define MAX_VERSION_SIZE 6 - -CHAR G_coInstallerVersion[MAX_VERSION_SIZE] = {0}; BOOLEAN G_fLoop = FALSE; -BOOL G_versionSpecified = FALSE; - //----------------------------------------------------------------------------- @@ -98,30 +81,9 @@ __pragma(warning(disable: 4127)) while(constant); __pragma(warning(default: 4127 #define USAGE \ -"Usage: nonpnpapp <-V version> <-l> \n" \ - " -V version {if no version is specified the version specified in the build environment will be used.}\n" \ - " The version is the version of the KMDF coinstaller to use \n" \ - " The format of version is MMmmm where MM -- major #, mmm - serial# \n" \ +"Usage: nonpnpapp <-l> \n" \ " -l { option to continuously read & write to the file} \n" -BOOL -ValidateCoinstallerVersion( - _In_ PSTR Version - ) -{ BOOL ok = FALSE; - INT i; - - for(i= 0; i Date: Wed, 18 Sep 2024 20:30:02 -0700 Subject: Upgrade nuget SDK and WDK packages to 26100.1591 (#1217) * Upgrade NuGet to 10.0.26100.1591 --- .github/scripts/Build-ChangedSamples.ps1 | 2 +- Directory.Build.props | 10 +++++----- packages.config | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/scripts/Build-ChangedSamples.ps1 b/.github/scripts/Build-ChangedSamples.ps1 index f7dc95f5..bdaee943 100644 --- a/.github/scripts/Build-ChangedSamples.ps1 +++ b/.github/scripts/Build-ChangedSamples.ps1 @@ -22,7 +22,7 @@ foreach ($file in $ChangedFiles) { $filename = Split-Path $file -Leaf # Files that can affect how every sample is built should trigger a full build - if ($filename -eq "Build-AllSamples.ps1" -or $filename -eq "Build-Sample.ps1" -or $filename -eq "Build-SampleSet.ps1" -or $filename -eq "exclusions.csv") { + if ($filename -eq "Build-AllSamples.ps1" -or $filename -eq "Build-Sample.ps1" -or $filename -eq "Build-SampleSet.ps1" -or $filename -eq "exclusions.csv" -or $filename -eq "Directory.Build.props" -or $filename -eq "packages.config") { $buildAll = $true } if ($dir -like "$root\.github\scripts" -or $dir -like "$root\.github\scripts\*") { diff --git a/Directory.Build.props b/Directory.Build.props index 811c5f30..4651c50e 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - - - - - + + + + + diff --git a/packages.config b/packages.config index 257a510d..3f9d85de 100644 --- a/packages.config +++ b/packages.config @@ -1,8 +1,8 @@  - - - - - + + + + + -- cgit v1.3.1 From 82646a919592c06a98e60766760e70e8fcaaf656 Mon Sep 17 00:00:00 2001 From: Julia DZmura Date: Thu, 19 Sep 2024 12:13:06 -0700 Subject: Small fixes to sample. --- .../Source/Filters/speakertoptable.h | 2 +- audio/simpleaudiosample/Source/Main/common.cpp | 6 ++- audio/simpleaudiosample/Source/Main/minwavert.h | 52 ---------------------- .../Source/Main/minwavertstream.h | 52 ---------------------- 4 files changed, 5 insertions(+), 107 deletions(-) diff --git a/audio/simpleaudiosample/Source/Filters/speakertoptable.h b/audio/simpleaudiosample/Source/Filters/speakertoptable.h index 1b046d96..f9e54df6 100644 --- a/audio/simpleaudiosample/Source/Filters/speakertoptable.h +++ b/audio/simpleaudiosample/Source/Filters/speakertoptable.h @@ -87,7 +87,7 @@ static KSJACK_DESCRIPTION SpeakerJackDescBridge = { KSAUDIO_SPEAKER_STEREO, - 0xB3C98C, // Color spec for green + JACKDESC_RGB(0xB3,0xC9,0x8C), // Color spec for green eConnTypeUnknown, eGeoLocFront, eGenLocPrimaryBox, diff --git a/audio/simpleaudiosample/Source/Main/common.cpp b/audio/simpleaudiosample/Source/Main/common.cpp index 457bdb17..7c19130e 100644 --- a/audio/simpleaudiosample/Source/Main/common.cpp +++ b/audio/simpleaudiosample/Source/Main/common.cpp @@ -2511,7 +2511,7 @@ Return Value: // Allocate the key value name string pwstrKeyValueName = (PWSTR)ExAllocatePool2(POOL_FLAG_NON_PAGED, kvFullInfo->NameLength + sizeof(WCHAR)*2, MINADAPTER_POOLTAG); - IF_TRUE_ACTION_JUMP(kvFullInfo == NULL, ntStatus = STATUS_INSUFFICIENT_RESOURCES, loop_exit); + IF_TRUE_ACTION_JUMP(pwstrKeyValueName == NULL, ntStatus = STATUS_INSUFFICIENT_RESOURCES, loop_exit); // Copy the key value name from the full information struct RtlStringCbCopyNW(pwstrKeyValueName, kvFullInfo->NameLength + sizeof(WCHAR)*2, kvFullInfo->Name, kvFullInfo->NameLength); @@ -2531,6 +2531,7 @@ Return Value: if (pwstrKeyValueName) { ExFreePoolWithTag(pwstrKeyValueName, MINADAPTER_POOLTAG); + pwstrKeyValueName = NULL; } // Bail if anything failed @@ -2618,7 +2619,7 @@ Return Value: // Allocate the key name string pwstrKeyName = (PWSTR)ExAllocatePool2(POOL_FLAG_NON_PAGED, kBasicInfo->NameLength + sizeof(WCHAR), MINADAPTER_POOLTAG); - IF_TRUE_ACTION_JUMP(kBasicInfo == NULL, ntStatus = STATUS_INSUFFICIENT_RESOURCES, loop_exit); + IF_TRUE_ACTION_JUMP(pwstrKeyName == NULL, ntStatus = STATUS_INSUFFICIENT_RESOURCES, loop_exit); // Copy the key name from the basic information struct RtlStringCbCopyNW(pwstrKeyName, kBasicInfo->NameLength + sizeof(WCHAR), kBasicInfo->Name, kBasicInfo->NameLength); @@ -2652,6 +2653,7 @@ Return Value: if (pwstrKeyName) { ExFreePoolWithTag(pwstrKeyName, MINADAPTER_POOLTAG); + pwstrKeyName = NULL; } // Close the current source key diff --git a/audio/simpleaudiosample/Source/Main/minwavert.h b/audio/simpleaudiosample/Source/Main/minwavert.h index 4c0ccd83..a5ed89ff 100644 --- a/audio/simpleaudiosample/Source/Main/minwavert.h +++ b/audio/simpleaudiosample/Source/Main/minwavert.h @@ -204,58 +204,6 @@ public: }; #pragma code_seg() - //--------------------------------------------------------------------------------------------------------- - // volume - //--------------------------------------------------------------------------------------------------------- - NTSTATUS GetVolumeChannelCount - ( - _Out_ UINT32* pulChannelCount - ); - - NTSTATUS GetVolumeSteppings - ( - _Out_writes_bytes_(_ui32DataSize) PKSPROPERTY_STEPPING_LONG _pKsPropStepLong, - _In_ UINT32 _ui32DataSize - ); - - NTSTATUS GetChannelVolume - ( - _In_ UINT32 _uiChannel, - _Out_ LONG* _pVolume - ); - - NTSTATUS SetChannelVolume - ( - _In_ UINT32 _uiChannel, - _In_ LONG _Volume - ); - - //----------------------------------------------------------------------------- - // mute - //----------------------------------------------------------------------------- - NTSTATUS GetMuteChannelCount - ( - _Out_ UINT32* pulChannelCount - ); - - NTSTATUS GetMuteSteppings - ( - _Out_writes_bytes_(_ui32DataSize) PKSPROPERTY_STEPPING_LONG _pKsPropStepLong, - _In_ UINT32 _ui32DataSize - ); - - NTSTATUS GetChannelMute - ( - _In_ UINT32 _uiChannel, - _Out_ BOOL* _pbMute - ); - - NTSTATUS SetChannelMute - ( - _In_ UINT32 _uiChannel, - _In_ BOOL _bMute - ); - private: _IRQL_raises_(DISPATCH_LEVEL) _Acquires_lock_(m_DeviceFormatsAndModesLock) diff --git a/audio/simpleaudiosample/Source/Main/minwavertstream.h b/audio/simpleaudiosample/Source/Main/minwavertstream.h index 5545e0d8..0124cab2 100644 --- a/audio/simpleaudiosample/Source/Main/minwavertstream.h +++ b/audio/simpleaudiosample/Source/Main/minwavertstream.h @@ -131,63 +131,11 @@ protected: public: - NTSTATUS GetVolumeChannelCount - ( - _Out_ UINT32* puiChannelCount - ); - - NTSTATUS GetVolumeSteppings - ( - _Out_writes_bytes_(_ui32DataSize) PKSPROPERTY_STEPPING_LONG _pKsPropStepLong, - _In_ UINT32 _ui32DataSize - ); - - NTSTATUS GetChannelVolume - ( - _In_ UINT32 _uiChannel, - _Out_ LONG* _pVolume - ); - - NTSTATUS SetChannelVolume - ( - _In_ UINT32 _uiChannel, - _In_ LONG _Volume - ); - - NTSTATUS GetMuteChannelCount - ( - _Out_ UINT32* puiChannelCount - ); - - NTSTATUS GetMuteSteppings - ( - _Out_writes_bytes_(_ui32DataSize) PKSPROPERTY_STEPPING_LONG _pKsPropStepLong, - _In_ UINT32 _ui32DataSize - ); - - NTSTATUS GetChannelMute - ( - _In_ UINT32 _uiChannel, - _Out_ BOOL* _pbMute - ); - - NTSTATUS SetChannelMute - ( - _In_ UINT32 _uiChannel, - _In_ BOOL _bMute - ); - //presentation NTSTATUS GetPresentationPosition ( _Out_ KSAUDIO_PRESENTATION_POSITION *_pPresentationPosition ); - - NTSTATUS SetCurrentWritePosition - ( - _In_ ULONG ulCurrentWritePosition - ); - ULONG GetCurrentWaveRTWritePosition() { -- cgit v1.3.1 From 5c4ceaef72f0af992966a7d2ac7ac7d897f091d3 Mon Sep 17 00:00:00 2001 From: Matt <138825652+middlemose@users.noreply.github.com> Date: Mon, 23 Sep 2024 19:43:48 -0700 Subject: Deprecate WDK VSIX Install (#1219) * Deprecate WDK vsix install * Fix WDK extension version print * Remove unecessary splitting on version * Minor build info refactor * Fix indentation of output info * Enough messing with volume size output * Cleanup comment for vsix version * More cleanup and doc update * Remove deprecation statement and install vsix script. * Fixes and updates to building locally documentation. * Dont code scan on license or .md files. * Code scanning ignore changes to .md when pull request is made --- .github/scripts/Install-Vsix.ps1 | 38 -------------------- .github/workflows/Code-Scanning.yml | 9 +++-- .github/workflows/ci-pr.yml | 3 -- .github/workflows/ci.yml | 3 -- Build-SampleSet.ps1 | 39 +++++++++------------ Building-Locally.md | 70 +++++++++++++++++++++++-------------- configuration.dsc.yaml | 19 ++-------- configuration_vsonly.dsc.yaml | 3 +- 8 files changed, 71 insertions(+), 113 deletions(-) delete mode 100644 .github/scripts/Install-Vsix.ps1 diff --git a/.github/scripts/Install-Vsix.ps1 b/.github/scripts/Install-Vsix.ps1 deleted file mode 100644 index 50ef088b..00000000 --- a/.github/scripts/Install-Vsix.ps1 +++ /dev/null @@ -1,38 +0,0 @@ -<# - -.SYNOPSIS -Download and install the latest WDK VSIX. - -#> - -# set uri by resolving amd64 vsix -$uri = "https://marketplace.visualstudio.com$((Invoke-WebRequest -Uri "https://marketplace.visualstudio.com/items?itemName=DriverDeveloperKits-WDK.WDKVsix").Links | Where-Object outerHTML -like '*(amd64)*' | select -expand href)" - -# set download version -$uri_version = ([regex]'(\d+\.)(\d+\.)(\d+\.)(\d+)').Matches($uri).Value - -# set msbuild path -$msbuild_path = (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*\MSBuild\") - -# download vsix, expand, and store the downloaded version extracted from the extension manifest -"Downloading WDK VSIX version: $uri_version..." -Invoke-WebRequest -Uri "$uri" -OutFile wdk.zip -"Expanding WDK VSIX archive..." -Expand-Archive ".\wdk.zip" .\ -"Extracting version from manifest..." -$downloaded_version = ([xml](Get-Content .\extension.vsixmanifest)).PackageManifest.Metadata.Identity.Version -"Downloaded WDK VSIX version: $downloaded_version" - -# copy msbuild files, extension manifest, and check installed version from the extension manifest -"Copying WDK extension files to build path..." -cp (".\`$MSBuild\*", ".\extension.vsixmanifest") "$msbuild_path" -Recurse -Force -"Extracting version from copied manifest..." -$installed_version = ([xml](Get-Content ${msbuild_path}\extension.vsixmanifest)).PackageManifest.Metadata.Identity.Version -"Installed WDK VSIX Version: $installed_version" -if (-not ("$downloaded_version" -eq "$installed_version")) { - "WDK VSIX installation failed due to version mismatch" - exit 1 -} - -# set github environment variable for vsix version -"SAMPLES_VSIX_VERSION=$installed_version" | Out-File -FilePath "$env:GITHUB_ENV" -Append diff --git a/.github/workflows/Code-Scanning.yml b/.github/workflows/Code-Scanning.yml index cd0d8abf..16aaff39 100644 --- a/.github/workflows/Code-Scanning.yml +++ b/.github/workflows/Code-Scanning.yml @@ -8,11 +8,17 @@ on: branches: - main - develop + paths-ignore: + - '**.md' + - 'LICENSE' pull_request: # The branches below must be a subset of the branches above branches: - main - develop + paths-ignore: + - '**.md' + - 'LICENSE' # Allow manual scheduling workflow_dispatch: @@ -37,9 +43,6 @@ jobs: with: submodules: 'recursive' - - name: Install WDK VSIX - run: .\.github\scripts\Install-Vsix.ps1 - - name: Install Nuget Packages run: nuget restore .\packages.config -PackagesDirectory .\packages\ diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index c04f4adb..72fb176f 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -22,9 +22,6 @@ jobs: with: submodules: 'recursive' - - name: Install WDK VSIX - run: .\.github\scripts\Install-Vsix.ps1 - - name: Install Nuget Packages run: nuget restore .\packages.config -PackagesDirectory .\packages\ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c35a81ec..11dee203 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,9 +22,6 @@ jobs: with: submodules: 'recursive' - - name: Install WDK VSIX - run: .\.github\scripts\Install-Vsix.ps1 - - name: Install Nuget Packages run: nuget restore .\packages.config -PackagesDirectory .\packages\ diff --git a/Build-SampleSet.ps1 b/Build-SampleSet.ps1 index adae8bb0..f6765395 100644 --- a/Build-SampleSet.ps1 +++ b/Build-SampleSet.ps1 @@ -56,20 +56,17 @@ finally { # Determine build environment: 'GitHub', 'NuGet', 'EWDK', or 'WDK'. # Determine build number (used for exclusions based on build number). Five digits. Say, '22621'. # Determine NuGet package version (if applicable). -# Determine WDK vsix version. # $build_environment="" $build_number=0 $nuget_package_version=0 -$vsix_version="" # -# In Github we build using NuGet and get the version from packages and vsix version from env var set from the install vsix step. +# In Github we build using NuGet. # if ($env:GITHUB_REPOSITORY) { $build_environment="GitHub" $nuget_package_version=([regex]'(?<=x64\.)(\d+\.)(\d+\.)(\d+\.)(\d+)').Matches((Get-Childitem .\packages\*WDK.x64* -Name)).Value $build_number=$nuget_package_version.split('.')[2] - $vsix_version = $env:SAMPLES_VSIX_VERSION } # # WDK NuGet will require presence of a folder 'packages'. The version is sourced from repo .\Env-Vars.ps1. @@ -107,16 +104,12 @@ else { exit 1 } # -# Get the vsix version from packages if not set -if (-not $vsix_version) { - $vsix_version = ls "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=*" | Select -ExpandProperty Name - if ($vsix_version) { - $vsix_version = $vsix_version.split('=')[1] - } - else { - Write-Error "No version of the WDK VSIX could be found. The WDK VSIX is not installed." - exit 1 - } +# Get the WDK extension version from installed packages +$wdk_extension_ver = ls "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=*" | Select -ExpandProperty Name +$wdk_extension_ver = ([regex]'(\d+\.)(\d+\.)(\d+\.)(\d+)').Matches($wdk_extension_ver).Value +if (-not $wdk_extension_ver) { + Write-Error "No version of the WDK Visual Studio Extension could be found. The WDK Extension is not installed." + exit 1 } # # @@ -180,20 +173,22 @@ $jresult = @{ $SolutionsTotal = $sampleSet.Count * $Configurations.Count * $Platforms.Count -Write-Output ("Build Environment: " + $build_environment) -Write-Output ("Build Number: " + $build_number) -if (($build_environment -eq "GitHub") -or ($build_environment -eq "NuGet")) { Write-Output ("Nuget Package Version: " + $nuget_package_version) } -Write-Output ("WDK VSIX Version: " + $vsix_version) -Write-Output ("Samples: " + $sampleSet.Count) -Write-Output ("Configurations: " + $Configurations.Count + " (" + $Configurations + ")") -Write-Output ("Platforms: " + $Platforms.Count + " (" + $Platforms + ")") +Write-Output "WDK Build Environment: $build_environment" +Write-Output "WDK Build Number: $build_number" +if (($build_environment -eq "GitHub") -or ($build_environment -eq "NuGet")) { +Write-Output "WDK Nuget Version: $nuget_package_version" +} +Write-Output "WDK Extension Version: $wdk_extension_ver" +Write-Output "Samples: $($sampleSet.Count)" +Write-Output "Configurations: $($Configurations.Count) ($Configurations)" +Write-Output "Platforms: $($Platforms.Count) ($Platforms)" Write-Output "InfVerif_AdditionalOptions: $InfVerif_AdditionalOptions" Write-Output "Combinations: $SolutionsTotal" Write-Output "LogicalProcessors: $LogicalProcessors" Write-Output "ThrottleFactor: $ThrottleFactor" Write-Output "ThrottleLimit: $ThrottleLimit" Write-Output "WDS_WipeOutputs: $env:WDS_WipeOutputs" -Write-Output ("Disk Remaining (GB): " + (((Get-Volume ($DriveLetter = (Get-Item ".").PSDrive.Name)).SizeRemaining / 1GB))) +Write-Output "Disk Remaining (GB): $(((Get-Volume ((Get-Item ".").PSDrive.Name)).SizeRemaining) / 1GB)" Write-Output "" Write-Output "T: Combinations" Write-Output "B: Built" diff --git a/Building-Locally.md b/Building-Locally.md index e3db8dde..312c5967 100644 --- a/Building-Locally.md +++ b/Building-Locally.md @@ -2,16 +2,19 @@ ## Step 1: Install Tools -``` +```powershell winget install --id Microsoft.Powershell --source winget winget install --id Git.Git --source winget ``` For using WDK NuGet feed based build additionally: -``` + +```powershell winget install --id Microsoft.NuGet --source winget ``` +--- + ## Step 2: Optional: Disable Strong Name Validation When: This step is only required if you will be using pre-release versions of the WDK. @@ -26,16 +29,20 @@ reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\*,31bf3856 reg add HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\*,31bf3856ad364e35 /v TestPublicKey /t REG_SZ /d 00240000048000009400000006020000002400005253413100040000010001003f8c902c8fe7ac83af7401b14c1bd103973b26dfafb2b77eda478a2539b979b56ce47f36336741b4ec52bbc51fecd51ba23810cec47070f3e29a2261a2d1d08e4b2b4b457beaa91460055f78cc89f21cd028377af0cc5e6c04699b6856a1e49d5fad3ef16d3c3d6010f40df0a7d6cc2ee11744b5cfb42e0f19a52b8a29dc31b0 /f ``` +--- + ## Step 3: Optional: Install Microsoft .NET Framework 4.7.2 Targeting Pack and Microsoft .NET Framework 4.8.1 SDK When: This step is only required to build sample usb\usbview . ### Option A: Install VS Components + Easy: If you will install Visual Studio (see later) you may at that point select to add both of following individual components: * .NET Framework 4.7.2 targeting pack * .NET Framework 4.8.1 SDK ### Option B: Use EWDK + Easy: If you use EWDK, then all necessary prequisites are included. ### Option C: Install Developer Pack @@ -52,24 +59,30 @@ This will install following Apps: * Microsoft .NET Framework 4.8.1 Targeting Pack * Microsoft .NET Framework 4.8.1 Targeting Pack (ENU) +--- + ## Step 4: Clone Windows Driver Samples and checkout relevant branch -``` -cd path\to\your\repos -git clone --recurse-submodules https://github.com/microsoft/Windows-driver-samples.git -cd Windows-driver-samples +```powershell +cd "path\to\your\repos" +git clone --recurse-submodules "https://github.com/microsoft/Windows-driver-samples.git" +cd ".\Windows-driver-samples" ``` If you are planning to use in-market WDK, then you would typically want to use the 'main' branch: + ``` git checkout main ``` If you are planning to use a WDK Preview or WDK EEAP release, then you would typically want to use the 'develop' branch: + ``` git checkout develop ``` +--- + ## Step 5: Create a "driver build environment" To build the Windows Driver Samples you need a "driver build environment". In essence an environment that consist of following prerequisites: @@ -78,53 +91,55 @@ To build the Windows Driver Samples you need a "driver build environment". In e * The Windows Driver Kit. ### Option A: Use WDK NuGet Packages -* See [Download the Windows Driver Kit (WDK)](https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk) for instructions on how to install Visual Studio, but only complete "Step 1". You do not need to install the SDK or the WDK. -* Install the Visual Studio Windows Driver Kit Extension (WDK.vsix). - * Open Visual Studio -> Extensions -> Manage Extensions... -> Browse. - * In the search bar type: `Windows Driver Kit`. - * Find the `Microsoft` signed extension. - * Click the Install button. + +* See [Download the Windows Driver Kit (WDK)](https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk) for instructions on how to install Visual Studio, but only complete `Step 1`. You do not need to install the SDK or the WDK. * Launch a "Developer Command Prompt for VS 2022". * Restore WDK packages from feed : -``` ->cd path\to\your\repos\Windows-driver-samples ->nuget restore -PackagesDirectory .\packages +```powershell +cd "path\to\your\repos\Windows-driver-samples" +nuget restore -PackagesDirectory ".\packages" ``` -* When this is done you should have a .\packages folder that looks exactly as follows: -``` ->cd path\to\your\repos\Windows-driver-samples ->dir /b packages +* When this is done you should have a .\packages folder that looks like example below: + +```powershell +cd "path\to\your\repos\Windows-driver-samples" +dir /b packages Microsoft.Windows.SDK.CPP.10.0.26000.1 Microsoft.Windows.SDK.CPP.x64.10.0.26000.1 Microsoft.Windows.SDK.CPP.arm64.10.0.26000.1 Microsoft.Windows.WDK.x64.10.0.26000.1 Microsoft.Windows.WDK.arm64.10.0.26000.1 ``` + ### Option B: Use the Windows Driver Kit + * Here you will install each of above prerequisites one at a time. * See [Download the Windows Driver Kit (WDK)](https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk) for instructions on how to install Visual Studio, SDK, and WDK. * Launch a "Developer Command Prompt for VS 2022". ### Option C: Use an Enterprise WDK + * You can also simply use the Enterprise WDK (EWDK), a standalone, self-contained command-line environment for building drivers that contains all prerequisites in one combined ISO. * See [Download the Windows Driver Kit (WDK)](https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk) for instructions on how to download the EWDK. * Mount ISO image * Open a terminal * `.\LaunchBuildEnv` +--- ## Step 6: Check all samples builds with expected results for all flavors -``` +```powershell pwsh .\Build-AllSamples ``` Above builds all samples for all configurations and platforms. You can refine what exact samples to build, what configurations, and platforms to build. build Here are a few examples: -``` + +```powershell # Get Help: Get-Help .\Build-AllSamples @@ -144,9 +159,9 @@ Get-Help .\Build-AllSamples .\Build-AllSamples -Samples '^tools.' -Configurations 'Debug' -Platforms 'x64' ``` -Expected output: +Example of expected output: + ``` -PS > .\build-AllSamples.ps1 Build Environment: NuGet Build Number: 26100 Samples: 132 @@ -190,6 +205,8 @@ Log files directory: .\_logs Overview report: .\_overview.htm ``` +--- + ## 7: NuGet - Additional Notes To restore a specific version of our WDK NuGet packages: @@ -201,12 +218,13 @@ Follow these steps before running "nuget restore" command: * Now you can run "nuget restore" A few examples of how to interact with nuget: -``` + +```powershell # To add an alternative online NuGet source: -nuget sources add -Name "MyNuGetFeed" -Source https://nugetserver.com/_packaging/feedname/nuget/v3/index.json +nuget sources add -Name "MyNuGetFeed" -Source "https://nugetserver.com/_packaging/feedname/nuget/v3/index.json" # To add an alternative local NuGet source: -nuget sources add -Name "MyNuGetFeed" -Source \\path\to\mylocalrepo +nuget sources add -Name "MyNuGetFeed" -Source "\\path\to\mylocalrepo" # To remove an alternative NuGet source: nuget sources remove -Name "MyNuGetFeed" diff --git a/configuration.dsc.yaml b/configuration.dsc.yaml index f8245c08..3d25ff06 100644 --- a/configuration.dsc.yaml +++ b/configuration.dsc.yaml @@ -42,6 +42,7 @@ properties: - Microsoft.VisualStudio.Component.VC.MFC.ARM64 - Microsoft.VisualStudio.Component.VC.MFC.ARM64.Spectre - Microsoft.VisualStudio.Workload.NativeDesktop + - Component.Microsoft.Windows.DriverKit - resource: Microsoft.WinGet.DSC/WinGetPackage id: sdkPackage directives: @@ -62,20 +63,4 @@ properties: id: Microsoft.WindowsWDK.10.0.26100 source: winget useLatest: true - - resource: PSDscResources/Script - id: wdkVsix - dependsOn: - - wdkPackage - - vsComponents - directives: - description: Install Windows Driver Kit VSIX - settings: - GetScript: | - return & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -nologo -version '[17.0,18.0)' -requires Microsoft.Windows.DriverKit -property installationVersion - SetScript: | - $installerPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -nologo -latest -products * -property enginePath | Join-Path -ChildPath 'VSIXInstaller.exe' - if (Test-Path $installerPath) { & $installerPath /q "${env:ProgramFiles(x86)}\Windows Kits\10\Vsix\VS2022\10.0.26100.0\${env:PROCESSOR_ARCHITECTURE}\WDK.vsix" } - TestScript: | - $versionString = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -nologo -version '[17.0,18.0)' -requires Microsoft.Windows.DriverKit -property installationVersion - return $versionString -match "^17\." - configurationVersion: 0.2.0 + configurationVersion: 0.2.1 diff --git a/configuration_vsonly.dsc.yaml b/configuration_vsonly.dsc.yaml index 6ce4fc83..9d86a4f7 100644 --- a/configuration_vsonly.dsc.yaml +++ b/configuration_vsonly.dsc.yaml @@ -42,4 +42,5 @@ properties: - Microsoft.VisualStudio.Component.VC.MFC.ARM64 - Microsoft.VisualStudio.Component.VC.MFC.ARM64.Spectre - Microsoft.VisualStudio.Workload.NativeDesktop - configurationVersion: 0.2.0 + - Component.Microsoft.Windows.DriverKit + configurationVersion: 0.2.1 -- cgit v1.3.1 From 616b1914cf05f0aea9c40b10009bd7be0354c28b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:45:18 -0700 Subject: Bump actions/download-artifact & actions/upload-artifact from 3 to 4 in /.github/workflows (#1211) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Adonais Romero Gonzalez --- .github/workflows/ci-pr.yml | 11 ++++++----- .github/workflows/ci.yml | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index 72fb176f..9c1202b2 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -41,10 +41,10 @@ jobs: WDS_ReportFileName: _overview.${{ matrix.configuration }}.${{ matrix.platform }} - name: Archive build logs and overview build reports - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() with: - name: logs + name: logs-${{ matrix.configuration }}-${{ matrix.platform }} path: _logs report: @@ -57,16 +57,17 @@ jobs: uses: actions/checkout@v4 - name: Retrieve overview reports - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: - name: logs path: _logs + pattern: logs-* + merge-multiple: true - name: Join and generate global reports run: .\.github\scripts\Join-CsvReports.ps1 - name: Archive global overview build reports - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: logs path: _logs/_overview.all.* diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 11dee203..e43d74f5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,10 +33,10 @@ jobs: WDS_ReportFileName: _overview.${{ matrix.configuration }}.${{ matrix.platform }} - name: Archive build logs and overview build reports - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() with: - name: logs + name: logs-${{ matrix.configuration }}-${{ matrix.platform }} path: _logs report: @@ -49,16 +49,17 @@ jobs: uses: actions/checkout@v4 - name: Retrieve overview reports - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: - name: logs path: _logs + pattern: logs-* + merge-multiple: true - name: Join and generate global reports run: .\.github\scripts\Join-CsvReports.ps1 - name: Archive global overview build reports - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: logs path: _logs/_overview.all.* -- cgit v1.3.1 From 76f3c4f35f40634401ede80f64554794776c4240 Mon Sep 17 00:00:00 2001 From: Jacob Ronstadt <147542405+jacob-ronstadt@users.noreply.github.com> Date: Wed, 25 Sep 2024 14:35:52 -0700 Subject: Code scanning updates (#1) (#1221) * Update Code-Scanning.yml --- .github/workflows/Code-Scanning.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Code-Scanning.yml b/.github/workflows/Code-Scanning.yml index 16aaff39..72e9c32c 100644 --- a/.github/workflows/Code-Scanning.yml +++ b/.github/workflows/Code-Scanning.yml @@ -42,7 +42,6 @@ jobs: uses: actions/checkout@v4 with: submodules: 'recursive' - - name: Install Nuget Packages run: nuget restore .\packages.config -PackagesDirectory .\packages\ @@ -50,8 +49,8 @@ jobs: uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} - packs: microsoft/windows-drivers - + config-file: microsoft/Windows-Driver-Developer-Supplemental-Tools/config/codeql-config.yml@development + packs: +microsoft/windows-drivers@1.2.0-beta - name: Retrieve and build all available solutions run: .\Build-AllSamples.ps1 -Verbose -ThrottleLimit 1 env: -- cgit v1.3.1 From fabd0ccc770c08a8aa5fcbd040abf1887ffaef5d Mon Sep 17 00:00:00 2001 From: JakobL-MSFT <110699333+JakobL-MSFT@users.noreply.github.com> Date: Mon, 14 Oct 2024 11:51:14 -0700 Subject: WDK NuGet 1882 (#1224) * Update packages.config * Update Directory.Build.props --- Directory.Build.props | 10 +++++----- packages.config | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 4651c50e..cdfa1666 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - - - - - + + + + + diff --git a/packages.config b/packages.config index 3f9d85de..fb0f3925 100644 --- a/packages.config +++ b/packages.config @@ -1,8 +1,8 @@  - - - - - + + + + + -- cgit v1.3.1 From 956512b78ba0748af3767dd0f8c321f95db34812 Mon Sep 17 00:00:00 2001 From: JakobL-MSFT <110699333+JakobL-MSFT@users.noreply.github.com> Date: Mon, 4 Nov 2024 13:14:26 -0800 Subject: WDK NuGet 2161 (#1226) * Update packages.config * Update Directory.Build.props --- Directory.Build.props | 10 +++++----- packages.config | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index cdfa1666..441a3686 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - - - - - + + + + + diff --git a/packages.config b/packages.config index fb0f3925..181ae806 100644 --- a/packages.config +++ b/packages.config @@ -1,8 +1,8 @@  - - - - - + + + + + -- cgit v1.3.1 From 173075ab809173bbe70d16d2ef0bee1c273fdc84 Mon Sep 17 00:00:00 2001 From: JakobL-MSFT <110699333+JakobL-MSFT@users.noreply.github.com> Date: Mon, 4 Nov 2024 13:15:37 -0800 Subject: WDK NuGet 2161 (#1226) (#1229) * Update packages.config * Update Directory.Build.props --- Directory.Build.props | 10 +++++----- packages.config | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index cdfa1666..441a3686 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - - - - - + + + + + diff --git a/packages.config b/packages.config index fb0f3925..181ae806 100644 --- a/packages.config +++ b/packages.config @@ -1,8 +1,8 @@  - - - - - + + + + + -- cgit v1.3.1 -- cgit v1.3.1 -- cgit v1.3.1 From ea026ed7e82fe5b45f0d978661e68c7f3249f3fc Mon Sep 17 00:00:00 2001 From: JohnMcSandwich <103996238+JohnMcSandwich@users.noreply.github.com> Date: Mon, 4 Nov 2024 17:16:47 -0500 Subject: Add a KASAN demo sample (#1228) --- tools/kasan/samples/KasanDemo-WDM/KasanDemo.sln | 46 ++++ tools/kasan/samples/KasanDemo-WDM/README.md | 25 ++ tools/kasan/samples/KasanDemo-WDM/exe/kasanagent.c | 157 +++++++++++ .../samples/KasanDemo-WDM/exe/kasanagent.vcxproj | 184 +++++++++++++ .../KasanDemo-WDM/exe/kasanagent.vcxproj.Filters | 22 ++ .../kasan/samples/KasanDemo-WDM/sys/kasantrigger.c | 303 +++++++++++++++++++++ .../kasan/samples/KasanDemo-WDM/sys/kasantrigger.h | 30 ++ .../samples/KasanDemo-WDM/sys/kasantrigger.rc | 10 + .../samples/KasanDemo-WDM/sys/kasantrigger.vcxproj | 155 +++++++++++ .../KasanDemo-WDM/sys/kasantrigger.vcxproj.Filters | 36 +++ 10 files changed, 968 insertions(+) create mode 100644 tools/kasan/samples/KasanDemo-WDM/KasanDemo.sln create mode 100644 tools/kasan/samples/KasanDemo-WDM/README.md create mode 100644 tools/kasan/samples/KasanDemo-WDM/exe/kasanagent.c create mode 100644 tools/kasan/samples/KasanDemo-WDM/exe/kasanagent.vcxproj create mode 100644 tools/kasan/samples/KasanDemo-WDM/exe/kasanagent.vcxproj.Filters create mode 100644 tools/kasan/samples/KasanDemo-WDM/sys/kasantrigger.c create mode 100644 tools/kasan/samples/KasanDemo-WDM/sys/kasantrigger.h create mode 100644 tools/kasan/samples/KasanDemo-WDM/sys/kasantrigger.rc create mode 100644 tools/kasan/samples/KasanDemo-WDM/sys/kasantrigger.vcxproj create mode 100644 tools/kasan/samples/KasanDemo-WDM/sys/kasantrigger.vcxproj.Filters diff --git a/tools/kasan/samples/KasanDemo-WDM/KasanDemo.sln b/tools/kasan/samples/KasanDemo-WDM/KasanDemo.sln new file mode 100644 index 00000000..fe0c0464 --- /dev/null +++ b/tools/kasan/samples/KasanDemo-WDM/KasanDemo.sln @@ -0,0 +1,46 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0 +MinimumVisualStudioVersion = 12.0 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Exe", "Exe", "{C4575BAC-8843-4B59-88F5-8D142A59F463}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sys", "Sys", "{52CD4CBC-6018-4367-BE2B-EA5A2864E7BE}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "kasanagent", "exe\kasanagent.vcxproj", "{61899E58-10C2-4EB1-9508-58AE7DC3B3A9}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "kasantrigger", "sys\kasantrigger.vcxproj", "{29BD96E0-B6C5-42A0-B683-FD9740810699}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM64 = Debug|ARM64 + Release|ARM64 = Release|ARM64 + Debug|x64 = Debug|x64 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {61899E58-10C2-4EB1-9508-58AE7DC3B3A9}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {61899E58-10C2-4EB1-9508-58AE7DC3B3A9}.Debug|ARM64.Build.0 = Debug|ARM64 + {29BD96E0-B6C5-42A0-B683-FD9740810699}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {29BD96E0-B6C5-42A0-B683-FD9740810699}.Debug|ARM64.Build.0 = Debug|ARM64 + {61899E58-10C2-4EB1-9508-58AE7DC3B3A9}.Release|ARM64.ActiveCfg = Release|ARM64 + {61899E58-10C2-4EB1-9508-58AE7DC3B3A9}.Release|ARM64.Build.0 = Release|ARM64 + {29BD96E0-B6C5-42A0-B683-FD9740810699}.Release|ARM64.ActiveCfg = Release|ARM64 + {29BD96E0-B6C5-42A0-B683-FD9740810699}.Release|ARM64.Build.0 = Release|ARM64 + {61899E58-10C2-4EB1-9508-58AE7DC3B3A9}.Debug|x64.ActiveCfg = Debug|x64 + {61899E58-10C2-4EB1-9508-58AE7DC3B3A9}.Debug|x64.Build.0 = Debug|x64 + {61899E58-10C2-4EB1-9508-58AE7DC3B3A9}.Release|x64.ActiveCfg = Release|x64 + {61899E58-10C2-4EB1-9508-58AE7DC3B3A9}.Release|x64.Build.0 = Release|x64 + {29BD96E0-B6C5-42A0-B683-FD9740810699}.Debug|x64.ActiveCfg = Debug|x64 + {29BD96E0-B6C5-42A0-B683-FD9740810699}.Debug|x64.Build.0 = Debug|x64 + {29BD96E0-B6C5-42A0-B683-FD9740810699}.Release|x64.ActiveCfg = Release|x64 + {29BD96E0-B6C5-42A0-B683-FD9740810699}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {61899E58-10C2-4EB1-9508-58AE7DC3B3A9} = {C4575BAC-8843-4B59-88F5-8D142A59F463} + {29BD96E0-B6C5-42A0-B683-FD9740810699} = {52CD4CBC-6018-4367-BE2B-EA5A2864E7BE} + EndGlobalSection +EndGlobal diff --git a/tools/kasan/samples/KasanDemo-WDM/README.md b/tools/kasan/samples/KasanDemo-WDM/README.md new file mode 100644 index 00000000..0c9c6fef --- /dev/null +++ b/tools/kasan/samples/KasanDemo-WDM/README.md @@ -0,0 +1,25 @@ +--- +page_type: sample +description: "Demonstrates KASAN." +languages: +- cpp +products: +- windows +- windows-wdk +--- + +# KasanDemo + +This sample demonstrates how KASAN detects illegal memory accesses. + +The sample consists of a legacy device driver that contains intentionally incorrect code that performs illegal memory accesses, and a Win32 console agent that interacts with the driver to trigger different types of illegal memory accesses that KASAN successfully detects. + +> [!CAUTION] +> This driver contains INTENTIONALLY INCORRECT code. Neither this driver nor its sample programs are intended for use in a production environment. Instead, they are intended for educational purposes. + +> [!CAUTION] +> This driver will cause KASAN to bugcheck your system. + +## Run the sample + +To run this sample, enable KASAN in your system, load the `kasantrigger.sys` driver, and then run the `kasanagent.exe` application. diff --git a/tools/kasan/samples/KasanDemo-WDM/exe/kasanagent.c b/tools/kasan/samples/KasanDemo-WDM/exe/kasanagent.c new file mode 100644 index 00000000..2b6b726c --- /dev/null +++ b/tools/kasan/samples/KasanDemo-WDM/exe/kasanagent.c @@ -0,0 +1,157 @@ +/*++ + +Copyright (c) 2024 Microsoft Corporation All Rights Reserved + +Module Name: + + agent.c + +Abstract: + + Usermode agent that interacts with the kasantrigger.sys driver to + demonstrate how KASAN detects illegal memory accesses. + +Environment: + + Win32 console multi-threaded application. + +--*/ + +#include +#include +#include +#include +#include +#include +#include + +VOID __cdecl +main( + _In_ ULONG argc, + _In_reads_(argc) PCHAR argv[] + ) +{ + ULONG bytesReturned; + INT choice; + HANDLE hDevice; + ULONG index; + DWORD ioctlCode; + BOOLEAN isKasanEnabledOnDriver; + BOOL success; + UCHAR value; + + UNREFERENCED_PARAMETER(argc); + UNREFERENCED_PARAMETER(argv); + + printf( + " _ __ ______ \n" + "| | / / | _ \\ \n" + "| |/ / __ _ ___ __ _ _ __ | | | |___ _ __ ___ ___ \n" + "| \\ / _` / __|/ _` | '_ \\ | | | / _ \\ '_ ` _ \\ / _ \\ \n" + "| |\\ \\ (_| \\__ \\ (_| | | | | | |/ / __/ | | | | | (_) |\n" + "\\_| \\_/\\__,_|___/\\__,_|_| |_| |___/ \\___|_| |_| |_|\\___/ \n\n" + ); + + // + // Open the device. + // + + hDevice = CreateFile("\\\\.\\KasanTrigger", + GENERIC_READ | GENERIC_WRITE, + 0, + NULL, + CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL, + NULL); + + if (hDevice == INVALID_HANDLE_VALUE) { + printf("CreateFile failed: %d. Did you forget to load kasantrigger.sys?\n", + GetLastError()); + return; + } + + // + // Check whether KASAN is enabled on the driver. + // + + success = DeviceIoControl(hDevice, + (DWORD)IOCTL_KASANTRIGGER_INFO, + NULL, + 0, + &isKasanEnabledOnDriver, + sizeof(isKasanEnabledOnDriver), + &bytesReturned, + NULL); + if (!success) { + printf("DeviceIoControl failed: %d\n\n", GetLastError()); + return; + } + + if (!isKasanEnabledOnDriver) { + printf("WARNING: KASAN is not enabled on kasantrigger.sys\n\n"); + } + + printf("Enter a number in the menu below to trigger the desired condition:\n"); + printf("1. Trigger a stack out-of-bounds read\n"); + printf("2. Trigger a global out-of-bounds read\n"); + printf("3. Trigger a heap out-of-bounds read\n\n"); + + while (TRUE) { + printf("> "); + while ((choice = getchar()) == '\n'); + + switch (choice) { + case '1': + ioctlCode = (DWORD)IOCTL_KASANTRIGGER_OOBR_STACK; + break; + case '2': + ioctlCode = (DWORD)IOCTL_KASANTRIGGER_OOBR_GLOBAL; + break; + case '3': + ioctlCode = (DWORD)IOCTL_KASANTRIGGER_OOBR_HEAP; + break; + default: + printf("Incorrect input, try again\n"); + continue; + } + + printf("You have selected %c. Excellent choice. ", choice); + Sleep(1000); + printf("Triggering in 3..."); + Sleep(1000); + printf(" 2..."); + Sleep(1000); + printf(" 1..."); + Sleep(1000); + printf("\n"); + + index = KASANTRIGGER_ARRAY_SIZE; + value = 0; + + success = DeviceIoControl(hDevice, + ioctlCode, + &index, + sizeof(index), + &value, + sizeof(value), + &bytesReturned, + NULL); + if (!success) { + printf("DeviceIoControl failed: %d\n", GetLastError()); + return; + } + + // + // KASAN should have normally triggered a bugcheck, so this should be + // unreachable. + // + + if (isKasanEnabledOnDriver) { + printf("Still alive. The bugcheck was not issued. This is not expected.\n"); + } else { + printf("Still alive, because KASAN was not enabled on the driver. The illegal access went undetected.\n"); + } + } + + CloseHandle(hDevice); +} \ No newline at end of file diff --git a/tools/kasan/samples/KasanDemo-WDM/exe/kasanagent.vcxproj b/tools/kasan/samples/KasanDemo-WDM/exe/kasanagent.vcxproj new file mode 100644 index 00000000..9556e374 --- /dev/null +++ b/tools/kasan/samples/KasanDemo-WDM/exe/kasanagent.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + ARM64 + + + Release + ARM64 + + + Debug + x64 + + + Release + x64 + + + + {61899E58-10C2-4EB1-9508-58AE7DC3B3A9} + $(MSBuildProjectName) + Debug + x64 + {14E9681A-41C8-43B1-885D-6CD8CB06AAD8} + kasanagent + $(LatestTargetPlatformVersion) + + + + Windows10 + False + Windows Driver + + WindowsApplicationForDrivers10.0 + Application + + + Windows10 + False + Windows Driver + + WindowsApplicationForDrivers10.0 + Application + + + Windows10 + True + Windows Driver + + WindowsApplicationForDrivers10.0 + Application + + + Windows10 + True + Windows Driver + + WindowsApplicationForDrivers10.0 + Application + + + + $(IntDir) + + + + + + + + + + + + + + + + kasanagent + + + kasanagent + + + kasanagent + + + kasanagent + + + + true + Level4 + %(AdditionalIncludeDirectories);..\ + + + %(AdditionalIncludeDirectories);..\ + + + %(AdditionalIncludeDirectories);..\ + + + + + true + Level4 + %(AdditionalIncludeDirectories);..\ + + + %(AdditionalIncludeDirectories);..\ + + + %(AdditionalIncludeDirectories);..\ + + + + + true + Level4 + %(AdditionalIncludeDirectories);..\ + + + %(AdditionalIncludeDirectories);..\ + + + %(AdditionalIncludeDirectories);..\ + + + + + true + Level4 + %(AdditionalIncludeDirectories);..\ + + + %(AdditionalIncludeDirectories);..\ + + + %(AdditionalIncludeDirectories);..\ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/kasan/samples/KasanDemo-WDM/exe/kasanagent.vcxproj.Filters b/tools/kasan/samples/KasanDemo-WDM/exe/kasanagent.vcxproj.Filters new file mode 100644 index 00000000..445aa804 --- /dev/null +++ b/tools/kasan/samples/KasanDemo-WDM/exe/kasanagent.vcxproj.Filters @@ -0,0 +1,22 @@ + + + + + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* + {49310AE5-27D6-4E5F-8E16-7787FBBFC870} + + + h;hpp;hxx;hm;inl;inc;xsd + {10285CDD-3CE2-48BD-9108-C546303EC345} + + + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml + {4DC87590-E3DB-45A9-8BF6-F0552982B4A7} + + + + + Source Files + + + \ No newline at end of file diff --git a/tools/kasan/samples/KasanDemo-WDM/sys/kasantrigger.c b/tools/kasan/samples/KasanDemo-WDM/sys/kasantrigger.c new file mode 100644 index 00000000..3605f7ff --- /dev/null +++ b/tools/kasan/samples/KasanDemo-WDM/sys/kasantrigger.c @@ -0,0 +1,303 @@ +/*++ + +Copyright (c) 2024 Microsoft Corporation All Rights Reserved + +Module Name: + + kasantrigger.c + +Abstract: + + The purpose of this driver is to demonstrate how KASAN detects illegal + memory accesses. + +Environment: + + Kernel mode only. + +--*/ + +#include +#include +#include "kasantrigger.h" + +#define NT_DEVICE_NAME L"\\Device\\KASANTRIGGER" +#define DOS_DEVICE_NAME L"\\DosDevices\\KasanTrigger" + +DRIVER_INITIALIZE DriverEntry; + +_Dispatch_type_(IRP_MJ_CREATE) +_Dispatch_type_(IRP_MJ_CLOSE) +DRIVER_DISPATCH KasanTriggerCreateClose; + +_Dispatch_type_(IRP_MJ_DEVICE_CONTROL) +DRIVER_DISPATCH KasanTriggerDeviceControl; + +DRIVER_UNLOAD KasanTriggerUnloadDriver; + +#ifdef ALLOC_PRAGMA +#pragma alloc_text(INIT, DriverEntry) +#pragma alloc_text(PAGE, KasanTriggerCreateClose) +#pragma alloc_text(PAGE, KasanTriggerDeviceControl) +#pragma alloc_text(PAGE, KasanTriggerUnloadDriver) +#endif + +// ----------------------------------------------------------------------------- + +UCHAR GlobalVariable[KASANTRIGGER_ARRAY_SIZE]; + +static +UCHAR +TriggerOobrStack( + _In_ ULONG Index + ) +{ + UCHAR StackVariable[KASANTRIGGER_ARRAY_SIZE]; + + // + // This copy is only here to force the compiler not to optimize out the + // stack variable. + // + + RtlCopyMemory(StackVariable, GlobalVariable, KASANTRIGGER_ARRAY_SIZE); + + // + // WARNING: this is an intentionally INCORRECT code! + // + + return StackVariable[Index]; +} + +static +UCHAR +TriggerOobrGlobal( + _In_ ULONG Index + ) +{ + // + // WARNING: this is an intentionally INCORRECT code! + // + + return GlobalVariable[Index]; +} + +static +UCHAR +TriggerOobrHeap( + _In_ ULONG Index + ) +{ + PCHAR buffer; + UCHAR retVal; + + buffer = ExAllocatePool2(POOL_FLAG_PAGED, KASANTRIGGER_ARRAY_SIZE, 'mDaK'); + if (buffer == NULL) { + return 0; + } + + // + // WARNING: this is an intentionally INCORRECT code! + // + + retVal = buffer[Index]; + + ExFreePool(buffer); + + return retVal; +} + +// ----------------------------------------------------------------------------- + +NTSTATUS +DriverEntry( + _In_ PDRIVER_OBJECT DriverObject, + _In_ PUNICODE_STRING RegistryPath + ) +{ + NTSTATUS ntStatus; + UNICODE_STRING ntUnicodeString; + UNICODE_STRING ntWin32NameString; + PDEVICE_OBJECT deviceObject; + + UNREFERENCED_PARAMETER(RegistryPath); + + RtlInitUnicodeString(&ntUnicodeString, NT_DEVICE_NAME); + + ntStatus = IoCreateDevice(DriverObject, + 0, + &ntUnicodeString, + FILE_DEVICE_UNKNOWN, + FILE_DEVICE_SECURE_OPEN, + FALSE, + &deviceObject); + if (!NT_SUCCESS(ntStatus)) { + return ntStatus; + } + + DriverObject->MajorFunction[IRP_MJ_CREATE] = KasanTriggerCreateClose; + DriverObject->MajorFunction[IRP_MJ_CLOSE] = KasanTriggerCreateClose; + DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = KasanTriggerDeviceControl; + DriverObject->DriverUnload = KasanTriggerUnloadDriver; + + RtlInitUnicodeString(&ntWin32NameString, DOS_DEVICE_NAME); + + ntStatus = IoCreateSymbolicLink(&ntWin32NameString, &ntUnicodeString); + + if (!NT_SUCCESS(ntStatus)) { + IoDeleteDevice(deviceObject); + } + + return ntStatus; +} + +NTSTATUS +KasanTriggerCreateClose( + PDEVICE_OBJECT DeviceObject, + PIRP Irp + ) +{ + UNREFERENCED_PARAMETER(DeviceObject); + + PAGED_CODE(); + + Irp->IoStatus.Status = STATUS_SUCCESS; + Irp->IoStatus.Information = 0; + + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + return STATUS_SUCCESS; +} + +VOID +KasanTriggerUnloadDriver( + _In_ PDRIVER_OBJECT DriverObject + ) +{ + PDEVICE_OBJECT deviceObject = DriverObject->DeviceObject; + UNICODE_STRING uniWin32NameString; + + PAGED_CODE(); + + RtlInitUnicodeString(&uniWin32NameString, DOS_DEVICE_NAME); + IoDeleteSymbolicLink(&uniWin32NameString); + + if (deviceObject != NULL) { + IoDeleteDevice(deviceObject); + } + + return; +} + +NTSTATUS +KasanTriggerDeviceControl( + PDEVICE_OBJECT DeviceObject, + PIRP Irp + ) +{ + PIO_STACK_LOCATION irpSp; + NTSTATUS ntStatus; + ULONG inBufLength; + ULONG inIndex; + ULONG outBufLength; + PUCHAR outValue; + PBOOLEAN isKasanEnabledOnDriver; + + UNREFERENCED_PARAMETER(DeviceObject); + + PAGED_CODE(); + + irpSp = IoGetCurrentIrpStackLocation(Irp); + inBufLength = irpSp->Parameters.DeviceIoControl.InputBufferLength; + outBufLength = irpSp->Parameters.DeviceIoControl.OutputBufferLength; + + ntStatus = STATUS_SUCCESS; + + switch (irpSp->Parameters.DeviceIoControl.IoControlCode) + { + case IOCTL_KASANTRIGGER_INFO: + + // + // Return information. Just a BOOLEAN that indicates whether the + // driver was compiled with KASAN or not. + // + + if (inBufLength != 0 || outBufLength != sizeof(BOOLEAN)) { + ntStatus = STATUS_INVALID_PARAMETER; + goto End; + } + + isKasanEnabledOnDriver = (PBOOLEAN)Irp->AssociatedIrp.SystemBuffer; +#if defined(__SANITIZE_ADDRESS__) + *isKasanEnabledOnDriver = TRUE; +#else + *isKasanEnabledOnDriver = FALSE; +#endif + + Irp->IoStatus.Information = sizeof(BOOLEAN); + break; + + case IOCTL_KASANTRIGGER_OOBR_STACK: + + // + // Trigger an out-of-bounds read on the stack. + // + + if (inBufLength != sizeof(ULONG) || outBufLength != sizeof(UCHAR)) { + ntStatus = STATUS_INVALID_PARAMETER; + goto End; + } + + inIndex = *((PULONG)Irp->AssociatedIrp.SystemBuffer); + outValue = (PUCHAR)Irp->AssociatedIrp.SystemBuffer; + *outValue = TriggerOobrStack(inIndex); + + Irp->IoStatus.Information = sizeof(UCHAR); + break; + + case IOCTL_KASANTRIGGER_OOBR_GLOBAL: + + // + // Trigger an out-of-bounds read on a global variable. + // + + if (inBufLength != sizeof(ULONG) || outBufLength != sizeof(UCHAR)) { + ntStatus = STATUS_INVALID_PARAMETER; + goto End; + } + + inIndex = *((PULONG)Irp->AssociatedIrp.SystemBuffer); + outValue = (PUCHAR)Irp->AssociatedIrp.SystemBuffer; + *outValue = TriggerOobrGlobal(inIndex); + + Irp->IoStatus.Information = sizeof(UCHAR); + break; + + case IOCTL_KASANTRIGGER_OOBR_HEAP: + + // + // Trigger an out-of-bounds read on a heap buffer. + // + + if (inBufLength != sizeof(ULONG) || outBufLength != sizeof(UCHAR)) { + ntStatus = STATUS_INVALID_PARAMETER; + goto End; + } + + inIndex = *((PULONG)Irp->AssociatedIrp.SystemBuffer); + outValue = (PUCHAR)Irp->AssociatedIrp.SystemBuffer; + *outValue = TriggerOobrHeap(inIndex); + + Irp->IoStatus.Information = sizeof(UCHAR); + break; + + default: + ntStatus = STATUS_INVALID_DEVICE_REQUEST; + break; + } + +End: + + Irp->IoStatus.Status = ntStatus; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return ntStatus; +} diff --git a/tools/kasan/samples/KasanDemo-WDM/sys/kasantrigger.h b/tools/kasan/samples/KasanDemo-WDM/sys/kasantrigger.h new file mode 100644 index 00000000..aad3b5c2 --- /dev/null +++ b/tools/kasan/samples/KasanDemo-WDM/sys/kasantrigger.h @@ -0,0 +1,30 @@ +/*++ + +Copyright (c) 2024 Microsoft Corporation + +Module Name: + + kasantrigger.h + +--*/ + +// +// Device type. +// + +#define KASANTRIGGER_TYPE 40000 + +// +// The IOCTL function codes from 0x800 to 0xFFF are for customer use. +// + +#define IOCTL_KASANTRIGGER_INFO \ + CTL_CODE(KASANTRIGGER_TYPE, 0x900, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_KASANTRIGGER_OOBR_STACK \ + CTL_CODE(KASANTRIGGER_TYPE, 0x901, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_KASANTRIGGER_OOBR_GLOBAL \ + CTL_CODE(KASANTRIGGER_TYPE, 0x902, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_KASANTRIGGER_OOBR_HEAP \ + CTL_CODE(KASANTRIGGER_TYPE, 0x903, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define KASANTRIGGER_ARRAY_SIZE 8 diff --git a/tools/kasan/samples/KasanDemo-WDM/sys/kasantrigger.rc b/tools/kasan/samples/KasanDemo-WDM/sys/kasantrigger.rc new file mode 100644 index 00000000..409221ac --- /dev/null +++ b/tools/kasan/samples/KasanDemo-WDM/sys/kasantrigger.rc @@ -0,0 +1,10 @@ +#include + +#include + +#define VER_FILETYPE VFT_DRV +#define VER_FILESUBTYPE VFT2_DRV_SYSTEM +#define VER_FILEDESCRIPTION_STR "Sample Driver" +#define VER_INTERNALNAME_STR "kasantrigger.sys" + +#include "common.ver" diff --git a/tools/kasan/samples/KasanDemo-WDM/sys/kasantrigger.vcxproj b/tools/kasan/samples/KasanDemo-WDM/sys/kasantrigger.vcxproj new file mode 100644 index 00000000..f5946ed5 --- /dev/null +++ b/tools/kasan/samples/KasanDemo-WDM/sys/kasantrigger.vcxproj @@ -0,0 +1,155 @@ + + + + + Debug + ARM64 + + + Release + ARM64 + + + Debug + x64 + + + Release + x64 + + + + {29BD96E0-B6C5-42A0-B683-FD9740810699} + $(MSBuildProjectName) + Debug + x64 + {A08AE94A-35FF-4A31-B152-5E3A43CE78A0} + kasantrigger + $(LatestTargetPlatformVersion) + + + + Windows10 + False + Windows Driver + WDM + WindowsKernelModeDriver10.0 + Driver + true + + + Windows10 + False + Windows Driver + WDM + WindowsKernelModeDriver10.0 + Driver + + + Windows10 + True + Windows Driver + WDM + WindowsKernelModeDriver10.0 + Driver + true + + + Windows10 + True + Windows Driver + WDM + WindowsKernelModeDriver10.0 + Driver + + + + $(IntDir) + + + + + + + + + + + + + + + + kasantrigger + + + kasantrigger + + + kasantrigger + + + kasantrigger + + + + true + Level4 + + + + + sha256 + + + + + true + Level4 + + + + + sha256 + + + + + true + Level4 + + + + + sha256 + + + + + true + Level4 + + + + + sha256 + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/kasan/samples/KasanDemo-WDM/sys/kasantrigger.vcxproj.Filters b/tools/kasan/samples/KasanDemo-WDM/sys/kasantrigger.vcxproj.Filters new file mode 100644 index 00000000..afae3e08 --- /dev/null +++ b/tools/kasan/samples/KasanDemo-WDM/sys/kasantrigger.vcxproj.Filters @@ -0,0 +1,36 @@ + + + + + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* + {70613DC7-CE18-48E4-A282-83BAD5F14DB8} + + + h;hpp;hxx;hm;inl;inc;xsd + {61600929-B133-4CE1-A15E-E4E6B15BAFDD} + + + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml + {E7360814-7364-44AA-933C-DD4BFBF95E8D} + + + inf;inv;inx;mof;mc; + {CF3AF6D6-43D2-4102-8996-8EF19621C095} + + + + + Source Files + + + + + Resource Files + + + + + Header Files + + + \ No newline at end of file -- cgit v1.3.1 From 8785be37a62c68536a8675fb5823094ce2e2868c Mon Sep 17 00:00:00 2001 From: Adonais Romero Gonzalez Date: Fri, 22 Nov 2024 17:27:04 -0800 Subject: Remove legacy EmbedManifest property. --- audio/sysvad/APO/AecApo/AecApo.vcxproj | 4 ---- audio/sysvad/APO/DelayAPO/DelayAPO.vcxproj | 4 ---- audio/sysvad/APO/KWSApo/KWSApo.vcxproj | 4 ---- audio/sysvad/APO/SwapAPO/SwapAPO.vcxproj | 4 ---- 4 files changed, 16 deletions(-) diff --git a/audio/sysvad/APO/AecApo/AecApo.vcxproj b/audio/sysvad/APO/AecApo/AecApo.vcxproj index 7de1a862..37c814b1 100644 --- a/audio/sysvad/APO/AecApo/AecApo.vcxproj +++ b/audio/sysvad/APO/AecApo/AecApo.vcxproj @@ -32,7 +32,6 @@ Windows10 False Windows Driver - false WindowsApplicationForDrivers10.0 DynamicLibrary @@ -41,7 +40,6 @@ Windows10 False Windows Driver - false WindowsApplicationForDrivers10.0 DynamicLibrary @@ -50,7 +48,6 @@ Windows10 True Windows Driver - false WindowsApplicationForDrivers10.0 DynamicLibrary @@ -59,7 +56,6 @@ Windows10 True Windows Driver - false WindowsApplicationForDrivers10.0 DynamicLibrary diff --git a/audio/sysvad/APO/DelayAPO/DelayAPO.vcxproj b/audio/sysvad/APO/DelayAPO/DelayAPO.vcxproj index a5d6ff37..81004ea0 100644 --- a/audio/sysvad/APO/DelayAPO/DelayAPO.vcxproj +++ b/audio/sysvad/APO/DelayAPO/DelayAPO.vcxproj @@ -32,7 +32,6 @@ Windows10 False Windows Driver - false WindowsApplicationForDrivers10.0 DynamicLibrary @@ -41,7 +40,6 @@ Windows10 False Windows Driver - false WindowsApplicationForDrivers10.0 DynamicLibrary @@ -50,7 +48,6 @@ Windows10 True Windows Driver - false WindowsApplicationForDrivers10.0 DynamicLibrary @@ -59,7 +56,6 @@ Windows10 True Windows Driver - false WindowsApplicationForDrivers10.0 DynamicLibrary diff --git a/audio/sysvad/APO/KWSApo/KWSApo.vcxproj b/audio/sysvad/APO/KWSApo/KWSApo.vcxproj index 938e5974..05430973 100644 --- a/audio/sysvad/APO/KWSApo/KWSApo.vcxproj +++ b/audio/sysvad/APO/KWSApo/KWSApo.vcxproj @@ -32,7 +32,6 @@ Windows10 False Windows Driver - false WindowsApplicationForDrivers10.0 DynamicLibrary @@ -41,7 +40,6 @@ Windows10 False Windows Driver - false WindowsApplicationForDrivers10.0 DynamicLibrary @@ -50,7 +48,6 @@ Windows10 True Windows Driver - false WindowsApplicationForDrivers10.0 DynamicLibrary @@ -59,7 +56,6 @@ Windows10 True Windows Driver - false WindowsApplicationForDrivers10.0 DynamicLibrary diff --git a/audio/sysvad/APO/SwapAPO/SwapAPO.vcxproj b/audio/sysvad/APO/SwapAPO/SwapAPO.vcxproj index 61bea0cb..c1e2f27a 100644 --- a/audio/sysvad/APO/SwapAPO/SwapAPO.vcxproj +++ b/audio/sysvad/APO/SwapAPO/SwapAPO.vcxproj @@ -32,7 +32,6 @@ Windows10 False Windows Driver - false WindowsApplicationForDrivers10.0 DynamicLibrary @@ -41,7 +40,6 @@ Windows10 False Windows Driver - false WindowsApplicationForDrivers10.0 DynamicLibrary @@ -50,7 +48,6 @@ Windows10 True Windows Driver - false WindowsApplicationForDrivers10.0 DynamicLibrary @@ -59,7 +56,6 @@ Windows10 True Windows Driver - false WindowsApplicationForDrivers10.0 DynamicLibrary -- cgit v1.3.1 From 57ecdd5d16347ef3bc1348a164ce90288c44c243 Mon Sep 17 00:00:00 2001 From: Adonais Romero González Date: Tue, 26 Nov 2024 13:08:41 -0800 Subject: Update Nuget to version 10.0.26100.2454 (#1241) --- Directory.Build.props | 10 +++++----- packages.config | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 441a3686..4f46faef 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - - - - - + + + + + diff --git a/packages.config b/packages.config index 181ae806..51860634 100644 --- a/packages.config +++ b/packages.config @@ -1,8 +1,8 @@  - - - - - + + + + + -- cgit v1.3.1