diff --git a/DirectXTex/DirectXTexMipmaps.cpp b/DirectXTex/DirectXTexMipmaps.cpp index da9df6e..9405da1 100644 --- a/DirectXTex/DirectXTexMipmaps.cpp +++ b/DirectXTex/DirectXTexMipmaps.cpp @@ -71,13 +71,16 @@ namespace _In_ IWICBitmap* src, _In_ TEX_FILTER_FLAGS filter, _In_ const WICPixelFormatGUID& desiredPixelFormat, - _Deref_out_ IWICBitmap** dest) noexcept + _COM_Outptr_ IWICBitmap** dest) noexcept { - if (!pWIC || !src || !dest) + if (!dest) return E_POINTER; *dest = nullptr; + if (!pWIC || !src) + return E_POINTER; + WICPixelFormatGUID actualPixelFormat; HRESULT hr = src->GetPixelFormat(&actualPixelFormat); diff --git a/build/DirectXTex-GitHub-MinGW.yml b/build/DirectXTex-GitHub-MinGW.yml index 6a4d0e9..5570519 100644 --- a/build/DirectXTex-GitHub-MinGW.yml +++ b/build/DirectXTex-GitHub-MinGW.yml @@ -63,7 +63,7 @@ jobs: # We can use the preinstalled vcpkg instead of the latest when MS Hosted updates their vcpkg to the newer DirectX-Headers displayName: Fetch VCPKG inputs: - script: git clone --quiet https://%GITHUB_PAT%@github.com/microsoft/vcpkg.git + script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/microsoft/vcpkg.git workingDirectory: $(Build.SourcesDirectory) - task: CmdLine@2 displayName: VCPKG Bootstrap @@ -154,12 +154,12 @@ jobs: - task: CmdLine@2 displayName: Fetch VCPKG inputs: - script: git clone --quiet https://%GITHUB_PAT%@github.com/microsoft/vcpkg.git + script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/microsoft/vcpkg.git workingDirectory: $(Build.SourcesDirectory) - task: CmdLine@2 displayName: Fetch Tests inputs: - script: git clone --quiet https://%GITHUB_PAT%@github.com/walbourn/directxtextest.git Tests + script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/walbourn/directxtextest.git Tests - task: CmdLine@2 displayName: VCPKG Bootstrap inputs: diff --git a/build/DirectXTex-GitHub-Test-Dev17.yml b/build/DirectXTex-GitHub-Test-Dev17.yml index 4751cc4..0ae59d4 100644 --- a/build/DirectXTex-GitHub-Test-Dev17.yml +++ b/build/DirectXTex-GitHub-Test-Dev17.yml @@ -48,7 +48,7 @@ jobs: - task: CmdLine@2 displayName: Fetch Tests inputs: - script: git clone --quiet https://%GITHUB_PAT%@github.com/walbourn/directxtextest.git Tests + script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/walbourn/directxtextest.git Tests workingDirectory: $(Build.SourcesDirectory) failOnStderr: true - task: VSBuild@1 @@ -159,7 +159,7 @@ jobs: - task: CmdLine@2 displayName: Fetch Tests inputs: - script: git clone --quiet https://%GITHUB_PAT%@github.com/walbourn/directxtextest.git Tests + script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/walbourn/directxtextest.git Tests workingDirectory: $(Build.SourcesDirectory) failOnStderr: true - task: ChocolateyCommand@0 @@ -194,6 +194,9 @@ jobs: inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: --build out/build/x64-Debug -v + - task: DeleteFiles@1 + inputs: + Contents: 'out' - task: CMake@1 displayName: CMake (MSVC; x64-Release) Config inputs: @@ -204,6 +207,9 @@ jobs: inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: --build out/build/x64-Release -v + - task: DeleteFiles@1 + inputs: + Contents: 'out' - task: CMake@1 displayName: CMake (clang/LLVM; x64-Debug) Config inputs: @@ -214,6 +220,9 @@ jobs: inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: --build out/build/x64-Debug-Clang -v + - task: DeleteFiles@1 + inputs: + Contents: 'out' - task: CMake@1 displayName: CMake (clang/LLVM; x64-Release) Config inputs: @@ -224,6 +233,9 @@ jobs: inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: --build out/build/x64-Release-Clang -v + - task: DeleteFiles@1 + inputs: + Contents: 'out' - task: CmdLine@2 displayName: Set LIB for ARM64 inputs: @@ -245,6 +257,9 @@ jobs: inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: --build out/build/arm64-Debug-Clang -v + - task: DeleteFiles@1 + inputs: + Contents: 'out' - task: CMake@1 displayName: CMake (clang/LLVM; arm64-Release) Config inputs: diff --git a/build/DirectXTex-GitHub-Test.yml b/build/DirectXTex-GitHub-Test.yml index 36ca01d..73fa7a2 100644 --- a/build/DirectXTex-GitHub-Test.yml +++ b/build/DirectXTex-GitHub-Test.yml @@ -67,7 +67,7 @@ jobs: - task: CmdLine@2 displayName: Fetch Tests inputs: - script: git clone --quiet https://%GITHUB_PAT%@github.com/walbourn/directxtextest.git Tests + script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/walbourn/directxtextest.git Tests workingDirectory: $(Build.SourcesDirectory) failOnStderr: true - task: VSBuild@1 diff --git a/build/DirectXTex-GitHub-WSL-11.yml b/build/DirectXTex-GitHub-WSL-11.yml index 0f9e0ca..3db1662 100644 --- a/build/DirectXTex-GitHub-WSL-11.yml +++ b/build/DirectXTex-GitHub-WSL-11.yml @@ -42,7 +42,7 @@ jobs: - task: CmdLine@2 displayName: Fetch directx-headers inputs: - script: git clone --quiet https://%GITHUB_PAT%@github.com/microsoft/DirectX-Headers.git directx-headers + script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/microsoft/DirectX-Headers.git directx-headers - task: CMake@1 displayName: CMake DirectX-Headers inputs: @@ -61,7 +61,7 @@ jobs: - task: CmdLine@2 displayName: Fetch directxmath inputs: - script: git clone --quiet https://%GITHUB_PAT%@github.com/microsoft/DirectXMath.git directxmath + script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/microsoft/DirectXMath.git directxmath - task: CMake@1 displayName: CMake DirectXMath inputs: diff --git a/build/DirectXTex-GitHub-WSL.yml b/build/DirectXTex-GitHub-WSL.yml index 2a73389..e7d566e 100644 --- a/build/DirectXTex-GitHub-WSL.yml +++ b/build/DirectXTex-GitHub-WSL.yml @@ -61,7 +61,7 @@ jobs: - task: CmdLine@2 displayName: Fetch directx-headers inputs: - script: git clone --quiet https://%GITHUB_PAT%@github.com/microsoft/DirectX-Headers.git directx-headers + script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/microsoft/DirectX-Headers.git directx-headers - task: CMake@1 displayName: CMake DirectX-Headers inputs: @@ -80,7 +80,7 @@ jobs: - task: CmdLine@2 displayName: Fetch directxmath inputs: - script: git clone --quiet https://%GITHUB_PAT%@github.com/microsoft/DirectXMath.git directxmath + script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/microsoft/DirectXMath.git directxmath - task: CMake@1 displayName: CMake DirectXMath inputs: diff --git a/build/DirectXTex-OneFuzz.yml b/build/DirectXTex-OneFuzz.yml index b7d419f..32dfce9 100644 --- a/build/DirectXTex-OneFuzz.yml +++ b/build/DirectXTex-OneFuzz.yml @@ -51,7 +51,7 @@ jobs: - task: CmdLine@2 displayName: Fetch Tests inputs: - script: git clone --quiet https://%GITHUB_PAT%@github.com/walbourn/directxtextest.git Tests + script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/walbourn/directxtextest.git Tests workingDirectory: $(Build.SourcesDirectory) failOnStderr: true - task: CMake@1 diff --git a/build/DirectXTex-SDL.yml b/build/DirectXTex-SDL.yml index 3ea50d0..161616f 100644 --- a/build/DirectXTex-SDL.yml +++ b/build/DirectXTex-SDL.yml @@ -58,18 +58,19 @@ jobs: inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: '-G "$(VS_GENERATOR)" -A x64 -B out -DENABLE_SPECTRE_MITIGATION=ON' - - task: Semmle@1 - displayName: 'Run CodeQL (Semmle) (C++)' - env: - SYSTEM_ACCESSTOKEN: $(System.AccessToken) + - task: CodeQL3000Init@0 inputs: - sourceCodeDirectory: '$(Build.SourcesDirectory)' - language: 'cpp' - querySuite: 'Recommended' - timeout: '1800' - ram: '16384' - addProjectDirToScanningExclusionList: true - buildCommandsString: '"%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsMSBuildCmd.bat" && msbuild $(Build.SourcesDirectory)/out/DirectXTex.sln /p:Configuration=Release' + Enabled: true + - task: VSBuild@1 + displayName: 'Build C++ with CodeQL' + inputs: + solution: '$(Build.SourcesDirectory)/out/DirectXTex.sln' + vsVersion: 17.0 + platform: x64 + configuration: Release + msbuildArchitecture: x64 + - task: CodeQL3000Finalize@0 + condition: always() - task: CMake@1 displayName: 'CMake (MSVC): Build x64 Release' inputs: