Skip to content

Commit 03afb33

Browse files
authored
ADO pipeline changes for OpenSSF Best Practices (#455)
1 parent 5094d26 commit 03afb33

12 files changed

+105
-136
lines changed

Audio/AudioEngine.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1483,7 +1483,7 @@ X3DAUDIO_HANDLE& AudioEngine::Get3DHandle() const noexcept
14831483
#ifdef _MSC_VER
14841484
#pragma comment(lib,"runtimeobject.lib")
14851485
#pragma warning(push)
1486-
#pragma warning(disable: 4471 5204 5256)
1486+
#pragma warning(disable: 4471 5204 5256 6553)
14871487
#endif
14881488
#ifdef __clang__
14891489
#pragma clang diagnostic ignored "-Wnonportable-system-include-path"

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
419419
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
420420
if(ENABLE_CODE_ANALYSIS)
421421
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
422-
target_compile_options(${t} PRIVATE /analyze)
422+
target_compile_options(${t} PRIVATE /analyze /WX)
423423
endforeach()
424424
endif()
425425

DirectXTK_Windows10_2022.vcxproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@
201201
<AppContainerApplication>true</AppContainerApplication>
202202
<ApplicationType>Windows Store</ApplicationType>
203203
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
204-
<WindowsTargetPlatformMinVersion>10.0.17763.0</WindowsTargetPlatformMinVersion>
204+
<WindowsTargetPlatformMinVersion>10.0.18362.0</WindowsTargetPlatformMinVersion>
205205
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
206206
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
207207
</PropertyGroup>

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ For the latest version of DirectXTK, bug reports, etc. please visit the project
7474

7575
## Release Notes
7676

77+
FOR SECURITY ADVISORIES, see [GitHub](https://github.com/microsoft/DirectXTK/security/advisories).
78+
79+
For a full change history, see [CHANGELOG.md](https://github.com/microsoft/DirectXTK/blob/main/CHANGELOG.md).
80+
7781
* Starting with the February 2023 release, the Mouse class implementation of relative mouse movement was updated to accumulate changes between calls to ``GetState``. By default, each time you call ``GetState`` the deltas are reset which works for scenarios where you use relative movement but only call the method once per frame. If you call it more than once per frame, then add an explicit call to ``EndOfInputFrame`` to use an explicit reset model instead.
7882

7983
* As of the September 2022 release, the library makes use of C++11 inline namespaces for differing types that have the same names in the DirectX 11 and DirectX 12 version of the *DirectX Tool Kit*. This provides a link-unique name such as ``DirectX::DX11::SpriteBatch`` that will appear in linker output messages. In most use cases, however, there is no need to add explicit ``DX11`` namespace resolution in client code.
@@ -108,6 +112,8 @@ This project welcomes contributions and suggestions. Most contributions require
108112

109113
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
110114

115+
Tests for new features should also be submitted as a PR to the [Test Suite](https://github.com/walbourn/directxtktest/wiki) repository.
116+
111117
## Code of Conduct
112118

113119
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.

Src/DDSTextureLoader.cpp

+6-25
Original file line numberDiff line numberDiff line change
@@ -895,22 +895,13 @@ namespace
895895
if (texture || textureView)
896896
{
897897
#if defined(_XBOX_ONE) && defined(_TITLE)
898-
const wchar_t* pstrName = wcsrchr(fileName, '\\');
899-
if (!pstrName)
900-
{
901-
pstrName = fileName;
902-
}
903-
else
904-
{
905-
pstrName++;
906-
}
907898
if (texture && *texture)
908899
{
909-
(*texture)->SetName(pstrName);
900+
(*texture)->SetName(fileName);
910901
}
911902
if (textureView && *textureView)
912903
{
913-
(*textureView)->SetName(pstrName);
904+
(*textureView)->SetName(fileName);
914905
}
915906
#else
916907
CHAR strFileA[MAX_PATH];
@@ -925,29 +916,19 @@ namespace
925916
);
926917
if (result > 0)
927918
{
928-
const char* pstrName = strrchr(strFileA, '\\');
929-
if (!pstrName)
930-
{
931-
pstrName = strFileA;
932-
}
933-
else
934-
{
935-
pstrName++;
936-
}
937-
938919
if (texture && *texture)
939920
{
940921
(*texture)->SetPrivateData(WKPDID_D3DDebugObjectName,
941-
static_cast<UINT>(strnlen_s(pstrName, MAX_PATH)),
942-
pstrName
922+
static_cast<UINT>(result),
923+
strFileA
943924
);
944925
}
945926

946927
if (textureView && *textureView)
947928
{
948929
(*textureView)->SetPrivateData(WKPDID_D3DDebugObjectName,
949-
static_cast<UINT>(strnlen_s(pstrName, MAX_PATH)),
950-
pstrName
930+
static_cast<UINT>(result),
931+
strFileA
951932
);
952933
}
953934
}

Src/GamePad.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ bool GamePad::GetDevice(int player, _Outptr_ IGameInputDevice * *device) noexcep
422422

423423
#ifdef _MSC_VER
424424
#pragma warning(push)
425-
#pragma warning(disable : 4471 5204 5256)
425+
#pragma warning(disable : 4471 5204 5256 6553)
426426
#endif
427427
#include <windows.gaming.input.h>
428428
#ifdef _MSC_VER

Src/WICTextureLoader.cpp

+6-25
Original file line numberDiff line numberDiff line change
@@ -754,22 +754,13 @@ namespace
754754
if (texture || textureView)
755755
{
756756
#if defined(_XBOX_ONE) && defined(_TITLE)
757-
const wchar_t* pstrName = wcsrchr(fileName, '\\');
758-
if (!pstrName)
759-
{
760-
pstrName = fileName;
761-
}
762-
else
763-
{
764-
pstrName++;
765-
}
766757
if (texture && *texture)
767758
{
768-
(*texture)->SetName(pstrName);
759+
(*texture)->SetName(fileName);
769760
}
770761
if (textureView && *textureView)
771762
{
772-
(*textureView)->SetName(pstrName);
763+
(*textureView)->SetName(fileName);
773764
}
774765
#else
775766
CHAR strFileA[MAX_PATH];
@@ -784,29 +775,19 @@ namespace
784775
);
785776
if (result > 0)
786777
{
787-
const char* pstrName = strrchr(strFileA, '\\');
788-
if (!pstrName)
789-
{
790-
pstrName = strFileA;
791-
}
792-
else
793-
{
794-
pstrName++;
795-
}
796-
797778
if (texture && *texture)
798779
{
799780
(*texture)->SetPrivateData(WKPDID_D3DDebugObjectName,
800-
static_cast<UINT>(strnlen_s(pstrName, MAX_PATH)),
801-
pstrName
781+
static_cast<UINT>(result),
782+
strFileA
802783
);
803784
}
804785

805786
if (textureView && *textureView)
806787
{
807788
(*textureView)->SetPrivateData(WKPDID_D3DDebugObjectName,
808-
static_cast<UINT>(strnlen_s(pstrName, MAX_PATH)),
809-
pstrName
789+
static_cast<UINT>(result),
790+
strFileA
810791
);
811792
}
812793
}

Src/pch.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167
#endif
168168

169169
#pragma warning(push)
170-
#pragma warning(disable : 4467 4986 5038 5204 5220)
170+
#pragma warning(disable : 4467 4986 5038 5204 5220 6101)
171171
#ifdef __MINGW32__
172172
#include <wrl/client.h>
173173
#else

build/DirectXTK-GitHub-Dev17.yml

+30-4
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,48 @@ schedules:
1212
include:
1313
- main
1414

15-
trigger: none
15+
trigger:
16+
branches:
17+
include:
18+
- main
19+
paths:
20+
exclude:
21+
- '*.md'
22+
- LICENSE
23+
- CMake*
24+
- '.nuget/*'
25+
- build/*.cmake
26+
- build/*.cmd
27+
- build/*.in
28+
- build/*.json
29+
- build/*.props
30+
- build/*.ps1
31+
- build/*.targets
1632

1733
pr:
1834
branches:
1935
include:
2036
- main
2137
paths:
22-
include:
23-
- build/DirectXTK-GitHub-Dev17.yml
38+
exclude:
39+
- '*.md'
40+
- LICENSE
41+
- CMake*
42+
- '.nuget/*'
43+
- build/*.cmake
44+
- build/*.cmd
45+
- build/*.in
46+
- build/*.json
47+
- build/*.props
48+
- build/*.ps1
49+
- build/*.targets
50+
drafts: false
2451

2552
resources:
2653
repositories:
2754
- repository: self
2855
type: git
2956
ref: refs/heads/main
30-
trigger: none
3157

3258
name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)
3359

build/DirectXTK-GitHub-Test-Dev17.yml

+6-16
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ pool:
3636

3737
variables:
3838
Codeql.Enabled: false
39+
VC_PATH: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC'
3940
GITHUB_PAT: $(GITHUBPUBLICTOKEN)
4041
GUID_FEED: $(ADOFeedGUID)
4142

@@ -255,20 +256,13 @@ jobs:
255256
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/walbourn/directxtktest.git Tests
256257
workingDirectory: $(Build.SourcesDirectory)
257258
failOnStderr: true
258-
- task: ChocolateyCommand@0
259-
displayName: Install Ninja
260-
inputs:
261-
command: 'install'
262-
installPackageId: 'ninja'
263259
- task: CmdLine@2
264260
displayName: Setup environment for CMake to use VS
265261
inputs:
266262
script: |
267-
@echo off
268-
pushd "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
269-
for /f "delims=" %%x in ('.\vswhere.exe -latest -property InstallationPath') do set VSPATH=%%x
270-
popd
271-
call "%VSPATH%\VC\Auxiliary\Build\vcvarsall.bat" x64
263+
call "$(VC_PATH)\Auxiliary\Build\vcvars64.bat"
264+
echo ##vso[task.setvariable variable=WindowsSdkVerBinPath;]%WindowsSdkVerBinPath%
265+
echo ##vso[task.prependpath]%VSINSTALLDIR%Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja
272266
echo ##vso[task.prependpath]%VCINSTALLDIR%Tools\Llvm\x64\bin
273267
echo ##vso[task.prependpath]%WindowsSdkBinPath%x64
274268
echo ##vso[task.prependpath]%WindowsSdkVerBinPath%x64
@@ -330,14 +324,10 @@ jobs:
330324
inputs:
331325
Contents: 'out'
332326
- task: CmdLine@2
333-
displayName: Set LIB for ARM64
327+
displayName: Switch compiler to ARM64
334328
inputs:
335329
script: |
336-
@echo off
337-
pushd "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
338-
for /f "delims=" %%x in ('.\vswhere.exe -latest -property InstallationPath') do set VSPATH=%%x
339-
popd
340-
call "%VSPATH%\VC\Auxiliary\Build\vcvarsall.bat" arm64
330+
call "$(VC_PATH)\Auxiliary\Build\vcvarsamd64_arm64.bat"
341331
echo ##vso[task.setvariable variable=LIB;]%LIB%
342332
343333
- task: CMake@1

build/DirectXTK-GitHub.yml

+3-60
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ resources:
5757

5858
name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)
5959

60+
pool:
61+
vmImage: windows-2019
62+
6063
variables:
6164
Codeql.Enabled: false
6265
GUID_FEED: $(ADOFeedGUID)
6366

64-
pool:
65-
vmImage: windows-2022
66-
6767
jobs:
6868
- job: DESKTOP_BUILD
6969
displayName: 'Win32 Desktop'
@@ -199,60 +199,3 @@ jobs:
199199
msbuildArgs: /p:PreferredToolArchitecture=x64
200200
platform: ARM64
201201
configuration: Release
202-
203-
- job: UWP_BUILD
204-
displayName: 'Universal Windows Platform (UWP)'
205-
timeoutInMinutes: 120
206-
cancelTimeoutInMinutes: 1
207-
steps:
208-
- checkout: self
209-
clean: true
210-
fetchTags: false
211-
- task: VSBuild@1
212-
displayName: Build solution DirectXTK_Windows10_2022.sln 32dbg
213-
inputs:
214-
solution: DirectXTK_Windows10_2022.sln
215-
msbuildArgs: /p:PreferredToolArchitecture=x64
216-
platform: x86
217-
configuration: Debug
218-
- task: VSBuild@1
219-
displayName: Build solution DirectXTK_Windows10_2022.sln 32rel
220-
inputs:
221-
solution: DirectXTK_Windows10_2022.sln
222-
msbuildArgs: /p:PreferredToolArchitecture=x64
223-
platform: x86
224-
configuration: Release
225-
- task: VSBuild@1
226-
displayName: Build solution DirectXTK_Windows10_2022.sln 64dbg
227-
inputs:
228-
solution: DirectXTK_Windows10_2022.sln
229-
msbuildArgs: /p:PreferredToolArchitecture=x64
230-
platform: x64
231-
configuration: Debug
232-
- task: VSBuild@1
233-
displayName: Build solution DirectXTK_Windows10_2022.sln 64rel
234-
inputs:
235-
solution: DirectXTK_Windows10_2022.sln
236-
msbuildArgs: /p:PreferredToolArchitecture=x64
237-
platform: x64
238-
configuration: Release
239-
- task: CmdLine@2
240-
displayName: 'Reclaim diskspace'
241-
inputs:
242-
script: del *.pch /s
243-
workingDirectory: $(Build.SourcesDirectory)
244-
failOnStderr: false
245-
- task: VSBuild@1
246-
displayName: Build solution DirectXTK_Windows10_2022.sln arm64dbg
247-
inputs:
248-
solution: DirectXTK_Windows10_2022.sln
249-
msbuildArgs: /p:PreferredToolArchitecture=x64
250-
platform: ARM64
251-
configuration: Debug
252-
- task: VSBuild@1
253-
displayName: Build solution DirectXTK_Windows10_2022.sln arm64rel
254-
inputs:
255-
solution: DirectXTK_Windows10_2022.sln
256-
msbuildArgs: /p:PreferredToolArchitecture=x64
257-
platform: ARM64
258-
configuration: Release

0 commit comments

Comments
 (0)