From 1fd430c78971c31b624b0773bbea825d8b480d55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adonais=20Romero=20Gonz=C3=A1lez?= Date: Wed, 15 Jan 2025 09:32:38 -0800 Subject: [PATCH 1/7] [audio/sysvad] Use C++17 (#1247) --- 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 ++++ .../EndpointsCommon/EndpointsCommon.vcxproj | 4 ++++ audio/sysvad/EndpointsCommon/NewDelete.cpp | 24 +++++++++++++++++++ audio/sysvad/EndpointsCommon/NewDelete.h | 15 ++++++++++++ .../KeywordDetectorContosoAdapter.vcxproj | 4 ++++ .../TabletAudioSample.vcxproj | 8 +++++++ 9 files changed, 71 insertions(+) diff --git a/audio/sysvad/APO/AecApo/AecApo.vcxproj b/audio/sysvad/APO/AecApo/AecApo.vcxproj index 37c814b16..4bbcd19a6 100644 --- a/audio/sysvad/APO/AecApo/AecApo.vcxproj +++ b/audio/sysvad/APO/AecApo/AecApo.vcxproj @@ -123,6 +123,7 @@ + stdcpp17 true Level4 %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE @@ -147,6 +148,7 @@ + stdcpp17 true Level4 %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE @@ -172,6 +174,7 @@ + stdcpp17 true Level4 %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE @@ -196,6 +199,7 @@ + stdcpp17 true Level4 %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE diff --git a/audio/sysvad/APO/DelayAPO/DelayAPO.vcxproj b/audio/sysvad/APO/DelayAPO/DelayAPO.vcxproj index 81004ea00..391bf1ab7 100644 --- a/audio/sysvad/APO/DelayAPO/DelayAPO.vcxproj +++ b/audio/sysvad/APO/DelayAPO/DelayAPO.vcxproj @@ -123,6 +123,7 @@ + stdcpp17 true Level4 %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE @@ -147,6 +148,7 @@ + stdcpp17 true Level4 %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE @@ -172,6 +174,7 @@ + stdcpp17 true Level4 %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE @@ -196,6 +199,7 @@ + stdcpp17 true Level4 %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE diff --git a/audio/sysvad/APO/KWSApo/KWSApo.vcxproj b/audio/sysvad/APO/KWSApo/KWSApo.vcxproj index 054309734..ff74c60bd 100644 --- a/audio/sysvad/APO/KWSApo/KWSApo.vcxproj +++ b/audio/sysvad/APO/KWSApo/KWSApo.vcxproj @@ -123,6 +123,7 @@ + stdcpp17 true Level4 %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE @@ -147,6 +148,7 @@ + stdcpp17 true Level4 %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE @@ -172,6 +174,7 @@ + stdcpp17 true Level4 %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE @@ -196,6 +199,7 @@ + stdcpp17 true Level4 %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE diff --git a/audio/sysvad/APO/SwapAPO/SwapAPO.vcxproj b/audio/sysvad/APO/SwapAPO/SwapAPO.vcxproj index c1e2f27ad..43a5c87b5 100644 --- a/audio/sysvad/APO/SwapAPO/SwapAPO.vcxproj +++ b/audio/sysvad/APO/SwapAPO/SwapAPO.vcxproj @@ -123,6 +123,7 @@ + stdcpp17 true Level4 %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE @@ -147,6 +148,7 @@ + stdcpp17 true Level4 %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE @@ -172,6 +174,7 @@ + stdcpp17 true Level4 %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE @@ -196,6 +199,7 @@ + stdcpp17 true Level4 %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE diff --git a/audio/sysvad/EndpointsCommon/EndpointsCommon.vcxproj b/audio/sysvad/EndpointsCommon/EndpointsCommon.vcxproj index aa5cc3e2d..c1ba8b14f 100644 --- a/audio/sysvad/EndpointsCommon/EndpointsCommon.vcxproj +++ b/audio/sysvad/EndpointsCommon/EndpointsCommon.vcxproj @@ -94,6 +94,7 @@ %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS;SYSVAD_USB_SIDEBAND + stdcpp17 %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..;. %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS;SYSVAD_USB_SIDEBAND;_NEW_DELETE_OPERATORS_ @@ -114,6 +115,7 @@ %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS;SYSVAD_USB_SIDEBAND + stdcpp17 %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..;. %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS;SYSVAD_USB_SIDEBAND;_NEW_DELETE_OPERATORS_ @@ -134,6 +136,7 @@ %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS;SYSVAD_USB_SIDEBAND + stdcpp17 %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..;. %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS;SYSVAD_USB_SIDEBAND;_NEW_DELETE_OPERATORS_ @@ -154,6 +157,7 @@ %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS;SYSVAD_USB_SIDEBAND + stdcpp17 %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..;. %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS;SYSVAD_USB_SIDEBAND;_NEW_DELETE_OPERATORS_ diff --git a/audio/sysvad/EndpointsCommon/NewDelete.cpp b/audio/sysvad/EndpointsCommon/NewDelete.cpp index 64c64cc0e..daa076e29 100644 --- a/audio/sysvad/EndpointsCommon/NewDelete.cpp +++ b/audio/sysvad/EndpointsCommon/NewDelete.cpp @@ -103,6 +103,30 @@ void __cdecl operator delete } +/***************************************************************************** +* ::delete() +***************************************************************************** +* Sized Delete function with alignment. +*/ +#ifdef __cpp_aligned_new +void __cdecl operator delete +( + _Pre_maybenull_ __drv_freesMem(Mem) PVOID pVoid, + _In_ size_t cbSize, + _In_ std::align_val_t cbAlign +) +{ + UNREFERENCED_PARAMETER(cbSize); + UNREFERENCED_PARAMETER(cbAlign); + + if (pVoid) + { + ExFreePoolWithTag(pVoid, SYSVAD_POOLTAG); + } +} +#endif // __cpp_aligned_new + + /***************************************************************************** * ::delete() ***************************************************************************** diff --git a/audio/sysvad/EndpointsCommon/NewDelete.h b/audio/sysvad/EndpointsCommon/NewDelete.h index be46cbf5a..fefcda6e1 100644 --- a/audio/sysvad/EndpointsCommon/NewDelete.h +++ b/audio/sysvad/EndpointsCommon/NewDelete.h @@ -70,6 +70,21 @@ void __cdecl operator delete ); +/***************************************************************************** +* ::delete() +***************************************************************************** +* Sized Delete function with alignment. +*/ +#ifdef __cpp_aligned_new +void __cdecl operator delete +( + _Pre_maybenull_ __drv_freesMem(Mem) PVOID pVoid, + _In_ size_t cbSize, + _In_ std::align_val_t cbAlign +); +#endif // __cpp_aligned_new + + /***************************************************************************** * ::delete() ***************************************************************************** diff --git a/audio/sysvad/KeywordDetectorAdapter/KeywordDetectorContosoAdapter.vcxproj b/audio/sysvad/KeywordDetectorAdapter/KeywordDetectorContosoAdapter.vcxproj index 592fefb2b..98726d7a2 100644 --- a/audio/sysvad/KeywordDetectorAdapter/KeywordDetectorContosoAdapter.vcxproj +++ b/audio/sysvad/KeywordDetectorAdapter/KeywordDetectorContosoAdapter.vcxproj @@ -111,6 +111,7 @@ + stdcpp17 MultiThreaded MultiThreadedDebug true @@ -135,6 +136,7 @@ + stdcpp17 MultiThreaded MultiThreadedDebug true @@ -159,6 +161,7 @@ + stdcpp17 MultiThreaded MultiThreadedDebug true @@ -183,6 +186,7 @@ + stdcpp17 MultiThreaded MultiThreadedDebug true diff --git a/audio/sysvad/TabletAudioSample/TabletAudioSample.vcxproj b/audio/sysvad/TabletAudioSample/TabletAudioSample.vcxproj index 8e6e6ee47..a37a16b15 100644 --- a/audio/sysvad/TabletAudioSample/TabletAudioSample.vcxproj +++ b/audio/sysvad/TabletAudioSample/TabletAudioSample.vcxproj @@ -88,6 +88,7 @@ %(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE + stdcpp17 %(AdditionalIncludeDirectories);$(DDK_INC_PATH);.. true Level4 @@ -110,6 +111,7 @@ %(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE + stdcpp17 %(AdditionalIncludeDirectories);$(DDK_INC_PATH);.. true Level4 @@ -132,6 +134,7 @@ %(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE + stdcpp17 %(AdditionalIncludeDirectories);$(DDK_INC_PATH);.. true Level4 @@ -154,6 +157,7 @@ %(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE + stdcpp17 %(AdditionalIncludeDirectories);$(DDK_INC_PATH);.. true Level4 @@ -183,6 +187,7 @@ %(AdditionalDependencies);.\..\EndpointsCommon\$(IntDir)\EndpointsCommon.lib + stdcpp17 11 - 13 + 15 -DNDIS_MINIPORT_DRIVER -DNDIS60_MINIPORT=1 -DBINARY_COMPATIBLE=0 -DUSE_KLOCKS=1 -DNDIS_MINIPORT_DRIVER -DNDIS60_MINIPORT=1 -DNDIS61_MINIPORT=1 -DNDIS620_MINIPORT=1 -DBINARY_COMPATIBLE=0 -DUSE_KLOCKS=1 From 52908d7718c6fac2953055db2e5d23537957c7af Mon Sep 17 00:00:00 2001 From: Jacob Ronstadt <147542405+jacob-ronstadt@users.noreply.github.com> Date: Mon, 24 Mar 2025 15:59:45 -0700 Subject: [PATCH 6/7] Update Code-Scanning.yml to use latest windows-drivers pack (#1277) * Update Code-Scanning.yml to use latest windows-drivers pack * Update Code-Scanning.yml * Update Code-Scanning.yml * Update Code-Scanning.yml * Update Code-Scanning.yml * Update Code-Scanning.yml * Update Code-Scanning.yml * Update Code-Scanning.yml * Update Code-Scanning.yml * Update Code-Scanning.yml * Update Code-Scanning.yml: reduce duplacate code --- .github/workflows/Code-Scanning.yml | 59 +++++++---------------------- 1 file changed, 14 insertions(+), 45 deletions(-) diff --git a/.github/workflows/Code-Scanning.yml b/.github/workflows/Code-Scanning.yml index e843271fe..63e155c9c 100644 --- a/.github/workflows/Code-Scanning.yml +++ b/.github/workflows/Code-Scanning.yml @@ -24,48 +24,8 @@ on: workflow_dispatch: jobs: - analyze-push: - name: Analysis-Push - if: github.event_name == 'push' - runs-on: windows-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'cpp' ] - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - submodules: 'recursive' - - name: Install Nuget Packages - run: nuget restore .\packages.config -PackagesDirectory .\packages\ - - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - 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: - WDS_Configuration: Debug - WDS_Platform: x64 - WDS_WipeOutputs: ${{ true }} - - - name: Perform CodeQL analysis - uses: github/codeql-action/analyze@v3 - with: - category: "/language:${{matrix.language}}" - analyze-pr: - name: Analysis-PR - if: github.event_name == 'pull_request' + analyze: + name: Analysis runs-on: windows-latest permissions: actions: read @@ -97,12 +57,21 @@ jobs: languages: ${{ matrix.language }} build-mode: ${{ matrix.build-mode }} config-file: microsoft/Windows-Driver-Developer-Supplemental-Tools/config/codeql-config.yml@development - packs: +microsoft/windows-drivers@1.2.0-beta - - if: matrix.build-mode == 'manual' + - if: github.event_name == 'pull_request' run: | $changedFiles = "${{ steps.get-changed-files.outputs.all_changed_files }}".Split(',') .\.github\scripts\Build-ChangedSamples.ps1 -ChangedFiles $changedFiles -Verbose + env: + WDS_Configuration: Debug + WDS_Platform: x64 + WDS_WipeOutputs: ${{ true }} + - if: github.event_name == 'push' + 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}}" \ No newline at end of file + category: "/language:${{matrix.language}}" From ee60abcd73e358f0a3f25cb5101f981e04a99168 Mon Sep 17 00:00:00 2001 From: Elaine Houha <38798233+houha2@users.noreply.github.com> Date: Tue, 1 Apr 2025 16:36:24 -0700 Subject: [PATCH 7/7] Fixes Linker Error for the WFP Samples (#1281) removes inline Co-authored-by: Elaine Houha --- .../trans/WFPSampler/syslib/HelperFunctions_RedirectData.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network/trans/WFPSampler/syslib/HelperFunctions_RedirectData.cpp b/network/trans/WFPSampler/syslib/HelperFunctions_RedirectData.cpp index 2671e2769..22f08c609 100644 --- a/network/trans/WFPSampler/syslib/HelperFunctions_RedirectData.cpp +++ b/network/trans/WFPSampler/syslib/HelperFunctions_RedirectData.cpp @@ -132,7 +132,7 @@ _IRQL_requires_min_(PASSIVE_LEVEL) _IRQL_requires_max_(DISPATCH_LEVEL) _IRQL_requires_same_ _Success_(*ppRedirectData == 0) -inline VOID KrnlHlprRedirectDataDestroy(_Inout_ REDIRECT_DATA** ppRedirectData) +VOID KrnlHlprRedirectDataDestroy(_Inout_ REDIRECT_DATA** ppRedirectData) { #if DBG