diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 9dea5840..7d987f88 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -60,6 +60,12 @@ jobs:
- os: windows-2022
build_type: arm64ec-Release
arch: amd64_arm64
+ - os: windows-2022
+ build_type: x64-Debug-Win8
+ arch: amd64
+ - os: windows-2022
+ build_type: x64-Release-Win8
+ arch: amd64
- os: windows-2022
build_type: x64-Debug-Clang
arch: amd64
diff --git a/Auxiliary/DirectXTexEXR.cpp b/Auxiliary/DirectXTexEXR.cpp
index 09a6e2ee..e95b8598 100644
--- a/Auxiliary/DirectXTexEXR.cpp
+++ b/Auxiliary/DirectXTexEXR.cpp
@@ -240,19 +240,10 @@ HRESULT DirectX::GetMetadataFromEXRFile(const wchar_t* szFile, TexMetadata& meta
}
}
-#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
ScopedHandle hFile(safe_handle(CreateFile2(
szFile,
GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING,
nullptr)));
-#else
- ScopedHandle hFile(safe_handle(CreateFileW(
- szFile,
- GENERIC_READ, FILE_SHARE_READ,
- nullptr,
- OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN,
- nullptr)));
-#endif
if (!hFile)
{
return HRESULT_FROM_WIN32(GetLastError());
@@ -358,19 +349,10 @@ HRESULT DirectX::LoadFromEXRFile(const wchar_t* szFile, TexMetadata* metadata, S
}
}
-#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
ScopedHandle hFile(safe_handle(CreateFile2(
szFile,
GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING,
nullptr)));
-#else
- ScopedHandle hFile(safe_handle(CreateFileW(
- szFile,
- GENERIC_READ, FILE_SHARE_READ,
- nullptr,
- OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN,
- nullptr)));
-#endif
if (!hFile)
{
return HRESULT_FROM_WIN32(GetLastError());
@@ -508,19 +490,12 @@ HRESULT DirectX::SaveToEXRFile(const Image& image, const wchar_t* szFile)
}
// Create file and write header
-#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
- ScopedHandle hFile(safe_handle(CreateFile2(
- szFile,
- GENERIC_WRITE, 0, CREATE_ALWAYS,
- nullptr)));
-#else
ScopedHandle hFile(safe_handle(CreateFileW(
szFile,
GENERIC_WRITE, 0,
nullptr,
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL,
nullptr)));
-#endif
if (!hFile)
{
return HRESULT_FROM_WIN32(GetLastError());
diff --git a/Auxiliary/DirectXTexXboxDDS.cpp b/Auxiliary/DirectXTexXboxDDS.cpp
index 07495195..d573485e 100644
--- a/Auxiliary/DirectXTexXboxDDS.cpp
+++ b/Auxiliary/DirectXTexXboxDDS.cpp
@@ -439,12 +439,10 @@ HRESULT Xbox::GetMetadataFromDDSFileEx(
isXbox = false;
-#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
- ScopedHandle hFile(safe_handle(CreateFile2(szFile, GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING, nullptr)));
-#else
- ScopedHandle hFile(safe_handle(CreateFileW(szFile, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING,
- FILE_FLAG_SEQUENTIAL_SCAN, nullptr)));
-#endif
+ ScopedHandle hFile(safe_handle(CreateFile2(
+ szFile,
+ GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING,
+ nullptr)));
if (!hFile)
{
return HRESULT_FROM_WIN32(GetLastError());
@@ -591,13 +589,10 @@ HRESULT Xbox::LoadFromDDSFileEx(
xbox.Release();
-#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
- ScopedHandle hFile(safe_handle(CreateFile2(szFile, GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING, nullptr)));
-#else
- ScopedHandle hFile(safe_handle(CreateFileW(szFile, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING,
- FILE_FLAG_SEQUENTIAL_SCAN, nullptr)));
-#endif
-
+ ScopedHandle hFile(safe_handle(CreateFile2(
+ szFile,
+ GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING,
+ nullptr)));
if (!hFile)
{
return HRESULT_FROM_WIN32(GetLastError());
@@ -742,13 +737,10 @@ HRESULT Xbox::SaveToDDSFile(const XboxImage& xbox, const wchar_t* szFile)
return hr;
// Create file and write header
-#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
- ScopedHandle hFile(safe_handle(CreateFile2(szFile,
- GENERIC_WRITE, 0, CREATE_ALWAYS, nullptr)));
-#else
- ScopedHandle hFile(safe_handle(CreateFileW(szFile,
- GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr)));
-#endif
+ ScopedHandle hFile(safe_handle(CreateFile2(
+ szFile,
+ GENERIC_WRITE, 0, CREATE_ALWAYS,
+ nullptr)));
if (!hFile)
{
return HRESULT_FROM_WIN32(GetLastError());
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b4b8054a..f6e099e9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -632,9 +632,8 @@ if(WIN32)
elseif(${DIRECTX_ARCH} MATCHES "^arm")
set(WINVER 0x0602)
else()
- message(STATUS "Building with Windows 7 compatibility")
- set(WINVER 0x0601)
- target_compile_definitions(${PROJECT_NAME} PRIVATE _WIN7_PLATFORM_UPDATE)
+ message(STATUS "Building with Windows 8.1 compatibility")
+ set(WINVER 0x0603)
endif()
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
diff --git a/CMakePresets.json b/CMakePresets.json
index bf264c1e..1409fafe 100644
--- a/CMakePresets.json
+++ b/CMakePresets.json
@@ -118,7 +118,7 @@
},
{
- "name": "Win7",
+ "name": "Win8",
"cacheVariables": {
"BUILD_DX12": false
},
@@ -294,10 +294,10 @@
{ "name": "arm64-Debug-UWP" , "description": "MSVC for ARM64 (Debug) for UWP", "inherits": [ "base", "ARM64", "Debug", "MSVC", "UWP" ] },
{ "name": "arm64-Release-UWP", "description": "MSVC for ARM64 (Release) for UWP", "inherits": [ "base", "ARM64", "Release", "MSVC", "UWP" ] },
- { "name": "x64-Debug-Win7" , "description": "MSVC for x64 (Debug) for Windows 7", "inherits": [ "base", "x64", "Debug", "MSVC", "Win7" ] },
- { "name": "x64-Release-Win7" , "description": "MSVC for x64 (Release) for Windows 7", "inherits": [ "base", "x64", "Release", "MSVC", "Win7" ] },
- { "name": "x86-Debug-Win7" , "description": "MSVC for x86 (Debug) for Windows 7", "inherits": [ "base", "x86", "Debug", "MSVC", "Win7" ] },
- { "name": "x86-Release-Win7" , "description": "MSVC for x86 (Release) for Windows 7", "inherits": [ "base", "x86", "Release", "MSVC", "Win7" ] },
+ { "name": "x64-Debug-Win8" , "description": "MSVC for x64 (Debug) for Windows 8.1", "inherits": [ "base", "x64", "Debug", "MSVC", "Win8" ] },
+ { "name": "x64-Release-Win8" , "description": "MSVC for x64 (Release) for Windows 8.1", "inherits": [ "base", "x64", "Release", "MSVC", "Win8" ] },
+ { "name": "x86-Debug-Win8" , "description": "MSVC for x86 (Debug) for Windows 8.1", "inherits": [ "base", "x86", "Debug", "MSVC", "Win8" ] },
+ { "name": "x86-Release-Win8" , "description": "MSVC for x86 (Release) for Windows 8.1", "inherits": [ "base", "x86", "Release", "MSVC", "Win8" ] },
{ "name": "x64-Debug-Scarlett" , "description": "MSVC for x64 (Debug) for Xbox Series X|S", "inherits": [ "base", "x64", "Debug", "MSVC", "Scarlett" ] },
{ "name": "x64-Release-Scarlett" , "description": "MSVC for x64 (Release) for Xbox Series X|S", "inherits": [ "base", "x64", "Release", "MSVC", "Scarlett" ] },
@@ -337,10 +337,10 @@
{ "name": "arm64-Debug-UWP-Clang" , "description": "Clang/LLVM for AArch64 (Debug) for UWP", "inherits": [ "base", "ARM64", "Debug", "Clang", "Clang-AArch64", "UWP" ] },
{ "name": "arm64-Release-UWP-Clang", "description": "Clang/LLVM for AArch64 (Release) for UWP", "inherits": [ "base", "ARM64", "Release", "Clang", "Clang-AArch64", "UWP" ] },
- { "name": "x64-Debug-Win7-Clang" , "description": "Clang/LLVM for x64 (Debug) for Windows 7", "inherits": [ "base", "x64", "Debug", "Clang", "Win7" ] },
- { "name": "x64-Release-Win7-Clang", "description": "Clang/LLVM for x64 (Release) for Windows 7", "inherits": [ "base", "x64", "Release", "Clang", "Win7" ] },
- { "name": "x86-Debug-Win7-Clang" , "description": "Clang/LLVM for x86 (Debug) for Windows 7", "inherits": [ "base", "x86", "Debug", "Clang", "Clang-X86", "Win7" ] },
- { "name": "x86-Release-Win7-Clang", "description": "Clang/LLVM for x86 (Release) for Windows 7", "inherits": [ "base", "x86", "Release", "Clang", "Clang-X86", "Win7" ] },
+ { "name": "x64-Debug-Win8-Clang" , "description": "Clang/LLVM for x64 (Debug) for Windows 8.1", "inherits": [ "base", "x64", "Debug", "Clang", "Win8" ] },
+ { "name": "x64-Release-Win8-Clang", "description": "Clang/LLVM for x64 (Release) for Windows 8.1", "inherits": [ "base", "x64", "Release", "Clang", "Win8" ] },
+ { "name": "x86-Debug-Win8-Clang" , "description": "Clang/LLVM for x86 (Debug) for Windows 8.1", "inherits": [ "base", "x86", "Debug", "Clang", "Clang-X86", "Win8" ] },
+ { "name": "x86-Release-Win8-Clang", "description": "Clang/LLVM for x86 (Release) for Windows 8.1", "inherits": [ "base", "x86", "Release", "Clang", "Clang-X86", "Win8" ] },
{ "name": "x64-Debug-Clang-VCPKG" , "description": "Clang/LLVM for x64 (Debug) using VCPKG/OpenEXR", "inherits": [ "base", "x64", "Debug", "Clang", "VCPKG" ] },
{ "name": "x64-Release-Clang-VCPKG" , "description": "Clang/LLVM for x64 (Release) using VCPKG/OpenEXR", "inherits": [ "base", "x64", "Release", "Clang", "VCPKG" ] },
diff --git a/DDSTextureLoader/DDSTextureLoader11.cpp b/DDSTextureLoader/DDSTextureLoader11.cpp
index 50d16413..e32afbd7 100644
--- a/DDSTextureLoader/DDSTextureLoader11.cpp
+++ b/DDSTextureLoader/DDSTextureLoader11.cpp
@@ -239,20 +239,10 @@ namespace
*bitSize = 0;
// open the file
- #if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
ScopedHandle hFile(safe_handle(CreateFile2(
fileName,
GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING,
nullptr)));
- #else
- ScopedHandle hFile(safe_handle(CreateFileW(
- fileName,
- GENERIC_READ, FILE_SHARE_READ,
- nullptr,
- OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
- nullptr)));
- #endif
-
if (!hFile)
{
return HRESULT_FROM_WIN32(GetLastError());
diff --git a/DDSTextureLoader/DDSTextureLoader9.cpp b/DDSTextureLoader/DDSTextureLoader9.cpp
index 92f17fc9..aa738133 100644
--- a/DDSTextureLoader/DDSTextureLoader9.cpp
+++ b/DDSTextureLoader/DDSTextureLoader9.cpp
@@ -204,22 +204,10 @@ namespace
*bitSize = 0;
// open the file
- #if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
- ScopedHandle hFile(safe_handle(CreateFile2(fileName,
- GENERIC_READ,
- FILE_SHARE_READ,
- OPEN_EXISTING,
+ ScopedHandle hFile(safe_handle(CreateFile2(
+ fileName,
+ GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING,
nullptr)));
- #else
- ScopedHandle hFile(safe_handle(CreateFileW(fileName,
- GENERIC_READ,
- FILE_SHARE_READ,
- nullptr,
- OPEN_EXISTING,
- FILE_ATTRIBUTE_NORMAL,
- nullptr)));
- #endif
-
if (!hFile)
{
return HRESULT_FROM_WIN32(GetLastError());
diff --git a/DDSView/DDSView_Desktop_2019.vcxproj b/DDSView/DDSView_Desktop_2019.vcxproj
index b8b0a6f4..308b2132 100644
--- a/DDSView/DDSView_Desktop_2019.vcxproj
+++ b/DDSView/DDSView_Desktop_2019.vcxproj
@@ -135,7 +135,7 @@
Fast
StreamingSIMDExtensions2
..\DirectXTex;$(ProjectDir)Shaders;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
true
true
/Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)
@@ -159,7 +159,7 @@
MultiThreadedDebugDLL
Fast
..\DirectXTex;$(ProjectDir)Shaders;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
true
true
/Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)
@@ -182,7 +182,7 @@
Fast
StreamingSIMDExtensions2
..\DirectXTex;$(ProjectDir)Shaders;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
Guard
true
true
@@ -208,7 +208,7 @@
MaxSpeed
Fast
..\DirectXTex;$(ProjectDir)Shaders;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
Guard
true
true
@@ -234,7 +234,7 @@
Fast
StreamingSIMDExtensions2
..\DirectXTex;$(ProjectDir)Shaders;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;NDEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
Guard
true
true
@@ -260,7 +260,7 @@
MaxSpeed
Fast
..\DirectXTex;$(ProjectDir)Shaders;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;NDEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
Guard
true
true
diff --git a/DDSView/DDSView_Desktop_2022.vcxproj b/DDSView/DDSView_Desktop_2022.vcxproj
index b7c27906..0a414be9 100644
--- a/DDSView/DDSView_Desktop_2022.vcxproj
+++ b/DDSView/DDSView_Desktop_2022.vcxproj
@@ -135,7 +135,7 @@
Fast
StreamingSIMDExtensions2
..\DirectXTex;$(ProjectDir)Shaders;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
true
true
/Zc:__cplusplus %(AdditionalOptions)
@@ -159,7 +159,7 @@
MultiThreadedDebugDLL
Fast
..\DirectXTex;$(ProjectDir)Shaders;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
true
true
/Zc:__cplusplus %(AdditionalOptions)
@@ -182,7 +182,7 @@
Fast
StreamingSIMDExtensions2
..\DirectXTex;$(ProjectDir)Shaders;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
Guard
true
true
@@ -208,7 +208,7 @@
MaxSpeed
Fast
..\DirectXTex;$(ProjectDir)Shaders;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
Guard
true
true
@@ -234,7 +234,7 @@
Fast
StreamingSIMDExtensions2
..\DirectXTex;$(ProjectDir)Shaders;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;NDEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
Guard
true
true
@@ -260,7 +260,7 @@
MaxSpeed
Fast
..\DirectXTex;$(ProjectDir)Shaders;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;NDEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
Guard
true
true
diff --git a/DirectXTex/DirectXTexDDS.cpp b/DirectXTex/DirectXTexDDS.cpp
index c471da3c..e2f99269 100644
--- a/DirectXTex/DirectXTexDDS.cpp
+++ b/DirectXTex/DirectXTexDDS.cpp
@@ -1878,12 +1878,10 @@ HRESULT DirectX::GetMetadataFromDDSFileEx(
return E_INVALIDARG;
#ifdef _WIN32
-#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
- ScopedHandle hFile(safe_handle(CreateFile2(szFile, GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING, nullptr)));
-#else
- ScopedHandle hFile(safe_handle(CreateFileW(szFile, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING,
- FILE_FLAG_SEQUENTIAL_SCAN, nullptr)));
-#endif
+ ScopedHandle hFile(safe_handle(CreateFile2(
+ szFile,
+ GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING,
+ nullptr)));
if (!hFile)
{
return HRESULT_FROM_WIN32(GetLastError());
@@ -2064,12 +2062,10 @@ HRESULT DirectX::LoadFromDDSFileEx(
image.Release();
#ifdef _WIN32
-#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
- ScopedHandle hFile(safe_handle(CreateFile2(szFile, GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING, nullptr)));
-#else
- ScopedHandle hFile(safe_handle(CreateFileW(szFile, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING,
- FILE_FLAG_SEQUENTIAL_SCAN, nullptr)));
-#endif
+ ScopedHandle hFile(safe_handle(CreateFile2(
+ szFile,
+ GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING,
+ nullptr)));
if (!hFile)
{
return HRESULT_FROM_WIN32(GetLastError());
@@ -2548,13 +2544,9 @@ HRESULT DirectX::SaveToDDSFile(
// Create file and write header
#ifdef _WIN32
-#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
- ScopedHandle hFile(safe_handle(CreateFile2(szFile,
+ ScopedHandle hFile(safe_handle(CreateFile2(
+ szFile,
GENERIC_WRITE | DELETE, 0, CREATE_ALWAYS, nullptr)));
-#else
- ScopedHandle hFile(safe_handle(CreateFileW(szFile,
- GENERIC_WRITE | DELETE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr)));
-#endif
if (!hFile)
{
return HRESULT_FROM_WIN32(GetLastError());
diff --git a/DirectXTex/DirectXTexHDR.cpp b/DirectXTex/DirectXTexHDR.cpp
index 7c8bd08d..75c5faf0 100644
--- a/DirectXTex/DirectXTexHDR.cpp
+++ b/DirectXTex/DirectXTexHDR.cpp
@@ -617,12 +617,10 @@ HRESULT DirectX::GetMetadataFromHDRFile(const wchar_t* szFile, TexMetadata& meta
return E_INVALIDARG;
#ifdef _WIN32
-#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
- ScopedHandle hFile(safe_handle(CreateFile2(szFile, GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING, nullptr)));
-#else
- ScopedHandle hFile(safe_handle(CreateFileW(szFile, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING,
- FILE_FLAG_SEQUENTIAL_SCAN, nullptr)));
-#endif
+ ScopedHandle hFile(safe_handle(CreateFile2(
+ szFile,
+ GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING,
+ nullptr)));
if (!hFile)
{
return HRESULT_FROM_WIN32(GetLastError());
@@ -921,12 +919,10 @@ HRESULT DirectX::LoadFromHDRFile(const wchar_t* szFile, TexMetadata* metadata, S
image.Release();
#ifdef _WIN32
-#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
- ScopedHandle hFile(safe_handle(CreateFile2(szFile, GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING, nullptr)));
-#else
- ScopedHandle hFile(safe_handle(CreateFileW(szFile, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING,
- FILE_FLAG_SEQUENTIAL_SCAN, nullptr)));
-#endif
+ ScopedHandle hFile(safe_handle(CreateFile2(
+ szFile,
+ GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING,
+ nullptr)));
if (!hFile)
{
return HRESULT_FROM_WIN32(GetLastError());
@@ -1144,13 +1140,9 @@ HRESULT DirectX::SaveToHDRFile(const Image& image, const wchar_t* szFile) noexce
// Create file and write header
#ifdef _WIN32
-#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
- ScopedHandle hFile(safe_handle(CreateFile2(szFile,
+ ScopedHandle hFile(safe_handle(CreateFile2(
+ szFile,
GENERIC_WRITE, 0, CREATE_ALWAYS, nullptr)));
-#else
- ScopedHandle hFile(safe_handle(CreateFileW(szFile,
- GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr)));
-#endif
if (!hFile)
{
return HRESULT_FROM_WIN32(GetLastError());
diff --git a/DirectXTex/DirectXTexMipmaps.cpp b/DirectXTex/DirectXTexMipmaps.cpp
index 38cd03d8..28fa886d 100644
--- a/DirectXTex/DirectXTexMipmaps.cpp
+++ b/DirectXTex/DirectXTexMipmaps.cpp
@@ -457,16 +457,12 @@ HRESULT DirectX::Internal::ResizeSeparateColorAndAlpha(
}
else
{
- #if(_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
if (iswic2)
{
colorBytesInPixel = colorBytesPerPixel = 12;
colorPixelFormat = GUID_WICPixelFormat96bppRGBFloat;
}
else
- #else
- UNREFERENCED_PARAMETER(iswic2);
- #endif
{
colorBytesInPixel = 12;
colorBytesPerPixel = 16;
diff --git a/DirectXTex/DirectXTexTGA.cpp b/DirectXTex/DirectXTexTGA.cpp
index b758a4f8..2390ee00 100644
--- a/DirectXTex/DirectXTexTGA.cpp
+++ b/DirectXTex/DirectXTexTGA.cpp
@@ -1492,12 +1492,10 @@ HRESULT DirectX::GetMetadataFromTGAFile(const wchar_t* szFile, TGA_FLAGS flags,
return E_INVALIDARG;
#ifdef _WIN32
-#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
- ScopedHandle hFile(safe_handle(CreateFile2(szFile, GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING, nullptr)));
-#else
- ScopedHandle hFile(safe_handle(CreateFileW(szFile, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING,
- FILE_FLAG_SEQUENTIAL_SCAN, nullptr)));
-#endif
+ ScopedHandle hFile(safe_handle(CreateFile2(
+ szFile,
+ GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING,
+ nullptr)));
if (!hFile)
{
return HRESULT_FROM_WIN32(GetLastError());
@@ -1758,12 +1756,10 @@ HRESULT DirectX::LoadFromTGAFile(
image.Release();
#ifdef _WIN32
-#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
- ScopedHandle hFile(safe_handle(CreateFile2(szFile, GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING, nullptr)));
-#else
- ScopedHandle hFile(safe_handle(CreateFileW(szFile, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING,
- FILE_FLAG_SEQUENTIAL_SCAN, nullptr)));
-#endif
+ ScopedHandle hFile(safe_handle(CreateFile2(
+ szFile,
+ GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING,
+ nullptr)));
if (!hFile)
{
return HRESULT_FROM_WIN32(GetLastError());
@@ -2357,13 +2353,10 @@ HRESULT DirectX::SaveToTGAFile(
// Create file and write header
#ifdef _WIN32
-#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
- ScopedHandle hFile(safe_handle(CreateFile2(szFile, GENERIC_WRITE, 0,
- CREATE_ALWAYS, nullptr)));
-#else
- ScopedHandle hFile(safe_handle(CreateFileW(szFile,
- GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr)));
-#endif
+ ScopedHandle hFile(safe_handle(CreateFile2(
+ szFile,
+ GENERIC_WRITE, 0, CREATE_ALWAYS,
+ nullptr)));
if (!hFile)
{
return HRESULT_FROM_WIN32(GetLastError());
diff --git a/DirectXTex/DirectXTexUtil.cpp b/DirectXTex/DirectXTexUtil.cpp
index cf287da8..785ba669 100644
--- a/DirectXTex/DirectXTexUtil.cpp
+++ b/DirectXTex/DirectXTexUtil.cpp
@@ -84,7 +84,6 @@ namespace
BOOL WINAPI InitializeWICFactory(PINIT_ONCE, PVOID, PVOID *ifactory) noexcept
{
- #if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
HRESULT hr = CoCreateInstance(
CLSID_WICImagingFactory2,
nullptr,
@@ -112,16 +111,6 @@ namespace
);
return SUCCEEDED(hr) ? TRUE : FALSE;
}
- #else
- g_WIC2 = false;
-
- return SUCCEEDED(CoCreateInstance(
- CLSID_WICImagingFactory,
- nullptr,
- CLSCTX_INPROC_SERVER,
- __uuidof(IWICImagingFactory),
- ifactory)) ? TRUE : FALSE;
- #endif
}
#else // !WIN32
@@ -150,13 +139,11 @@ DXGI_FORMAT DirectX::Internal::WICToDXGI(const GUID& guid) noexcept
return g_WICFormats[i].format;
}
-#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
if (g_WIC2)
{
if (memcmp(&GUID_WICPixelFormat96bppRGBFloat, &guid, sizeof(GUID)) == 0)
return DXGI_FORMAT_R32G32B32_FLOAT;
}
-#endif
return DXGI_FORMAT_UNKNOWN;
}
@@ -196,7 +183,6 @@ bool DirectX::Internal::DXGIToWIC(DXGI_FORMAT format, GUID& guid, bool ignoreRGB
memcpy(&guid, &GUID_WICPixelFormat32bppBGR, sizeof(GUID));
return true;
- #if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
case DXGI_FORMAT_R32G32B32_FLOAT:
if (g_WIC2)
{
@@ -204,7 +190,6 @@ bool DirectX::Internal::DXGIToWIC(DXGI_FORMAT format, GUID& guid, bool ignoreRGB
return true;
}
break;
- #endif
default:
for (size_t i = 0; i < std::size(g_WICFormats); ++i)
@@ -328,14 +313,12 @@ void DirectX::SetWICFactory(_In_opt_ IWICImagingFactory* pWIC) noexcept
bool iswic2 = false;
if (pWIC)
{
- #if(_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
ComPtr wic2;
HRESULT hr = pWIC->QueryInterface(IID_PPV_ARGS(wic2.GetAddressOf()));
if (SUCCEEDED(hr))
{
iswic2 = true;
}
- #endif
pWIC->AddRef();
}
diff --git a/DirectXTex/DirectXTexWIC.cpp b/DirectXTex/DirectXTexWIC.cpp
index 63caf1ba..dca8de7a 100644
--- a/DirectXTex/DirectXTexWIC.cpp
+++ b/DirectXTex/DirectXTexWIC.cpp
@@ -81,11 +81,9 @@ namespace
{ GUID_WICPixelFormat40bppCMYKAlpha, GUID_WICPixelFormat32bppRGBA, TEX_ALPHA_MODE_UNKNOWN }, // DXGI_FORMAT_R8G8B8A8_UNORM
{ GUID_WICPixelFormat80bppCMYKAlpha, GUID_WICPixelFormat64bppRGBA, TEX_ALPHA_MODE_UNKNOWN }, // DXGI_FORMAT_R16G16B16A16_UNORM
- #if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
{ GUID_WICPixelFormat32bppRGB, GUID_WICPixelFormat32bppRGBA, TEX_ALPHA_MODE_OPAQUE }, // DXGI_FORMAT_R8G8B8A8_UNORM
{ GUID_WICPixelFormat64bppRGB, GUID_WICPixelFormat64bppRGBA, TEX_ALPHA_MODE_OPAQUE }, // DXGI_FORMAT_R16G16B16A16_UNORM
{ GUID_WICPixelFormat64bppPRGBAHalf, GUID_WICPixelFormat64bppRGBAHalf, TEX_ALPHA_MODE_UNKNOWN }, // DXGI_FORMAT_R16G16B16A16_FLOAT
- #endif
// We don't support n-channel formats
};
@@ -111,7 +109,6 @@ namespace
{
if (memcmp(&GUID_WICPixelFormat96bppRGBFixedPoint, &pixelFormat, sizeof(WICPixelFormatGUID)) == 0)
{
- #if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
if (iswic2)
{
if (pConvert)
@@ -119,9 +116,6 @@ namespace
format = DXGI_FORMAT_R32G32B32_FLOAT;
}
else
- #else
- UNREFERENCED_PARAMETER(iswic2);
- #endif
{
if (pConvert)
memcpy_s(pConvert, sizeof(WICPixelFormatGUID), &GUID_WICPixelFormat128bppRGBAFloat, sizeof(GUID));
diff --git a/DirectXTex/DirectXTex_Desktop_2019.vcxproj b/DirectXTex/DirectXTex_Desktop_2019.vcxproj
index 9d7a6f66..c626f40f 100644
--- a/DirectXTex/DirectXTex_Desktop_2019.vcxproj
+++ b/DirectXTex/DirectXTex_Desktop_2019.vcxproj
@@ -138,7 +138,7 @@
Fast
StreamingSIMDExtensions2
/Zc:twoPhase- /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)
- _UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)
+ _UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN32_WINNT=0x0603;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)
Use
DirectXTexP.h
$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)
@@ -165,7 +165,7 @@
true
Fast
/Zc:twoPhase- /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)
- _UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)
+ _UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN32_WINNT=0x0603;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)
Use
DirectXTexP.h
$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)
@@ -192,7 +192,7 @@
Fast
StreamingSIMDExtensions2
/Zc:twoPhase- /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)
- _UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)
+ _UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN32_WINNT=0x0603;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)
Use
DirectXTexP.h
$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)
@@ -218,7 +218,7 @@
true
Fast
/Zc:twoPhase- /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)
- _UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)
+ _UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN32_WINNT=0x0603;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)
Use
DirectXTexP.h
$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)
@@ -246,7 +246,7 @@
Fast
StreamingSIMDExtensions2
/Zc:twoPhase- /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)
- _UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)
+ _UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN32_WINNT=0x0603;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)
Use
DirectXTexP.h
$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)
@@ -272,7 +272,7 @@
true
Fast
/Zc:twoPhase- /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)
- _UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)
+ _UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN32_WINNT=0x0603;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)
Use
DirectXTexP.h
$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)
diff --git a/DirectXTex/DirectXTex_Desktop_2022.vcxproj b/DirectXTex/DirectXTex_Desktop_2022.vcxproj
index d79c3dc3..7a152cd3 100644
--- a/DirectXTex/DirectXTex_Desktop_2022.vcxproj
+++ b/DirectXTex/DirectXTex_Desktop_2022.vcxproj
@@ -138,7 +138,7 @@
Fast
StreamingSIMDExtensions2
/Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions)
- _UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)
+ _UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN32_WINNT=0x0603;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)
Use
DirectXTexP.h
$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)
@@ -165,7 +165,7 @@
true
Fast
/Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions)
- _UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)
+ _UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN32_WINNT=0x0603;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)
Use
DirectXTexP.h
$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)
@@ -192,7 +192,7 @@
Fast
StreamingSIMDExtensions2
/Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions)
- _UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)
+ _UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN32_WINNT=0x0603;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)
Use
DirectXTexP.h
$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)
@@ -218,7 +218,7 @@
true
Fast
/Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions)
- _UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)
+ _UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN32_WINNT=0x0603;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)
Use
DirectXTexP.h
$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)
@@ -246,7 +246,7 @@
Fast
StreamingSIMDExtensions2
/Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions)
- _UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)
+ _UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN32_WINNT=0x0603;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)
Use
DirectXTexP.h
$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)
@@ -272,7 +272,7 @@
true
Fast
/Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions)
- _UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)
+ _UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN32_WINNT=0x0603;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)
Use
DirectXTexP.h
$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)
diff --git a/ScreenGrab/ScreenGrab11.cpp b/ScreenGrab/ScreenGrab11.cpp
index c915f1ac..236201e2 100644
--- a/ScreenGrab/ScreenGrab11.cpp
+++ b/ScreenGrab/ScreenGrab11.cpp
@@ -741,7 +741,6 @@ namespace
BOOL WINAPI InitializeWICFactory(PINIT_ONCE, PVOID, PVOID* ifactory) noexcept
{
- #if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
HRESULT hr = CoCreateInstance(
CLSID_WICImagingFactory2,
nullptr,
@@ -767,14 +766,6 @@ namespace
);
return SUCCEEDED(hr) ? TRUE : FALSE;
}
- #else
- return SUCCEEDED(CoCreateInstance(
- CLSID_WICImagingFactory,
- nullptr,
- CLSCTX_INPROC_SERVER,
- __uuidof(IWICImagingFactory),
- ifactory)) ? TRUE : FALSE;
- #endif
}
IWICImagingFactory* GetWIC() noexcept
@@ -812,13 +803,10 @@ HRESULT DirectX::SaveDDSTextureToFile(
return hr;
// Create file
-#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
- ScopedHandle hFile(safe_handle(CreateFile2(fileName,
- GENERIC_WRITE | DELETE, 0, CREATE_ALWAYS, nullptr)));
-#else
- ScopedHandle hFile(safe_handle(CreateFileW(fileName,
- GENERIC_WRITE | DELETE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr)));
-#endif
+ ScopedHandle hFile(safe_handle(CreateFile2(
+ fileName,
+ GENERIC_WRITE | DELETE, 0, CREATE_ALWAYS,
+ nullptr)));
if (!hFile)
return HRESULT_FROM_WIN32(GetLastError());
@@ -1100,7 +1088,6 @@ HRESULT DirectX::SaveWICTextureToFile(
// Screenshots don't typically include the alpha channel of the render target
switch (desc.Format)
{
- #if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
case DXGI_FORMAT_R32G32B32A32_FLOAT:
case DXGI_FORMAT_R16G16B16A16_FLOAT:
if (g_WIC2)
@@ -1112,7 +1099,6 @@ HRESULT DirectX::SaveWICTextureToFile(
targetGuid = GUID_WICPixelFormat24bppBGR;
}
break;
- #endif
case DXGI_FORMAT_R16G16B16A16_UNORM: targetGuid = GUID_WICPixelFormat48bppBGR; break;
case DXGI_FORMAT_B5G5R5A1_UNORM: targetGuid = GUID_WICPixelFormat16bppBGR555; break;
diff --git a/ScreenGrab/ScreenGrab12.cpp b/ScreenGrab/ScreenGrab12.cpp
index b8cd697f..7ce04ff3 100644
--- a/ScreenGrab/ScreenGrab12.cpp
+++ b/ScreenGrab/ScreenGrab12.cpp
@@ -967,7 +967,10 @@ HRESULT DirectX::SaveDDSTextureToFile(
// Create file
#ifdef _WIN32
- ScopedHandle hFile(safe_handle(CreateFile2(fileName, GENERIC_WRITE, 0, CREATE_ALWAYS, nullptr)));
+ ScopedHandle hFile(safe_handle(CreateFile2(
+ fileName,
+ GENERIC_WRITE, 0, CREATE_ALWAYS,
+ nullptr)));
if (!hFile)
return HRESULT_FROM_WIN32(GetLastError());
diff --git a/ScreenGrab/ScreenGrab9.cpp b/ScreenGrab/ScreenGrab9.cpp
index 03fa4dca..3977cf30 100644
--- a/ScreenGrab/ScreenGrab9.cpp
+++ b/ScreenGrab/ScreenGrab9.cpp
@@ -520,7 +520,6 @@ namespace
BOOL WINAPI InitializeWICFactory(PINIT_ONCE, PVOID, PVOID* ifactory) noexcept
{
- #if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
HRESULT hr = CoCreateInstance(
CLSID_WICImagingFactory2,
nullptr,
@@ -546,14 +545,6 @@ namespace
);
return SUCCEEDED(hr) ? TRUE : FALSE;
}
- #else
- return SUCCEEDED(CoCreateInstance(
- CLSID_WICImagingFactory,
- nullptr,
- CLSCTX_INPROC_SERVER,
- __uuidof(IWICImagingFactory),
- ifactory)) ? TRUE : FALSE;
- #endif
}
IWICImagingFactory* GetWIC()
@@ -599,13 +590,10 @@ HRESULT DirectX::SaveDDSTextureToFile(
}
// Create file
-#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
- ScopedHandle hFile(safe_handle(CreateFile2(fileName,
- GENERIC_WRITE | DELETE, 0, CREATE_ALWAYS, nullptr)));
-#else
- ScopedHandle hFile(safe_handle(CreateFileW(fileName,
- GENERIC_WRITE | DELETE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr)));
-#endif
+ ScopedHandle hFile(safe_handle(CreateFile2(
+ fileName,
+ GENERIC_WRITE | DELETE, 0, CREATE_ALWAYS,
+ nullptr)));
if (!hFile)
return HRESULT_FROM_WIN32(GetLastError());
@@ -800,14 +788,12 @@ HRESULT DirectX::SaveWICTextureToFile(
case D3DFMT_R32F: pfGuid = GUID_WICPixelFormat32bppGrayFloat; break;
case D3DFMT_A32B32G32R32F: pfGuid = GUID_WICPixelFormat128bppRGBAFloat; break;
- #if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
case D3DFMT_X8B8G8R8:
if (g_WIC2)
pfGuid = GUID_WICPixelFormat32bppRGB;
else
HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
break;
- #endif
default:
return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
@@ -879,7 +865,6 @@ HRESULT DirectX::SaveWICTextureToFile(
// Screenshots don't typically include the alpha channel of the render target
switch (desc.Format)
{
- #if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
case D3DFMT_A32B32G32R32F:
case D3DFMT_A16B16G16R16F:
if (g_WIC2)
@@ -891,7 +876,6 @@ HRESULT DirectX::SaveWICTextureToFile(
targetGuid = GUID_WICPixelFormat24bppBGR;
}
break;
- #endif
case D3DFMT_A16B16G16R16: targetGuid = GUID_WICPixelFormat48bppBGR; break;
case D3DFMT_R5G6B5: targetGuid = GUID_WICPixelFormat16bppBGR565; break;
diff --git a/Texassemble/Texassemble_Desktop_2019.vcxproj b/Texassemble/Texassemble_Desktop_2019.vcxproj
index bfb1435d..c4276e27 100644
--- a/Texassemble/Texassemble_Desktop_2019.vcxproj
+++ b/Texassemble/Texassemble_Desktop_2019.vcxproj
@@ -135,7 +135,7 @@
Fast
StreamingSIMDExtensions2
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
true
true
/Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)
@@ -160,7 +160,7 @@
MultiThreadedDebugDLL
Fast
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
true
true
/Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)
@@ -184,7 +184,7 @@
Fast
StreamingSIMDExtensions2
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
Guard
true
true
@@ -211,7 +211,7 @@
MaxSpeed
Fast
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
Guard
true
true
@@ -238,7 +238,7 @@
Fast
StreamingSIMDExtensions2
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
true
true
/Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)
@@ -265,7 +265,7 @@
MaxSpeed
Fast
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
true
true
/Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)
diff --git a/Texassemble/Texassemble_Desktop_2022.vcxproj b/Texassemble/Texassemble_Desktop_2022.vcxproj
index 1da5d713..63367ac3 100644
--- a/Texassemble/Texassemble_Desktop_2022.vcxproj
+++ b/Texassemble/Texassemble_Desktop_2022.vcxproj
@@ -135,7 +135,7 @@
Fast
StreamingSIMDExtensions2
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
true
true
/Zc:__cplusplus %(AdditionalOptions)
@@ -160,7 +160,7 @@
MultiThreadedDebugDLL
Fast
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
true
true
/Zc:__cplusplus %(AdditionalOptions)
@@ -184,7 +184,7 @@
Fast
StreamingSIMDExtensions2
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
Guard
true
true
@@ -211,7 +211,7 @@
MaxSpeed
Fast
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
Guard
true
true
@@ -238,7 +238,7 @@
Fast
StreamingSIMDExtensions2
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
true
true
/Zc:__cplusplus %(AdditionalOptions)
@@ -265,7 +265,7 @@
MaxSpeed
Fast
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
true
true
/Zc:__cplusplus %(AdditionalOptions)
diff --git a/Texconv/ExtendedBMP.cpp b/Texconv/ExtendedBMP.cpp
index 6b5acedc..6edb9dcf 100644
--- a/Texconv/ExtendedBMP.cpp
+++ b/Texconv/ExtendedBMP.cpp
@@ -49,12 +49,10 @@ namespace
{
blob.reset();
- #if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
- ScopedHandle hFile(safe_handle(CreateFile2(szFile, GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING, nullptr)));
- #else
- ScopedHandle hFile(safe_handle(CreateFileW(szFile, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING,
- FILE_FLAG_SEQUENTIAL_SCAN, nullptr)));
- #endif
+ ScopedHandle hFile(safe_handle(CreateFile2(
+ szFile,
+ GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING,
+ nullptr)));
if (!hFile)
{
return HRESULT_FROM_WIN32(GetLastError());
diff --git a/Texconv/PortablePixMap.cpp b/Texconv/PortablePixMap.cpp
index f293280a..c1764d0a 100644
--- a/Texconv/PortablePixMap.cpp
+++ b/Texconv/PortablePixMap.cpp
@@ -91,12 +91,10 @@ namespace
blob.reset();
- #if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
- ScopedHandle hFile(safe_handle(CreateFile2(szFile, GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING, nullptr)));
- #else
- ScopedHandle hFile(safe_handle(CreateFileW(szFile, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING,
- FILE_FLAG_SEQUENTIAL_SCAN, nullptr)));
- #endif
+ ScopedHandle hFile(safe_handle(CreateFile2(
+ szFile,
+ GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING,
+ nullptr)));
if (!hFile)
{
return HRESULT_FROM_WIN32(GetLastError());
@@ -423,13 +421,10 @@ HRESULT __cdecl SaveToPortablePixMap(
}
}
-#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
- ScopedHandle hFile(safe_handle(CreateFile2(szFile,
- GENERIC_WRITE, 0, CREATE_ALWAYS, nullptr)));
-#else
- ScopedHandle hFile(safe_handle(CreateFileW(szFile,
- GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr)));
-#endif
+ ScopedHandle hFile(safe_handle(CreateFile2(
+ szFile,
+ GENERIC_WRITE, 0, CREATE_ALWAYS,
+ nullptr)));
if (!hFile)
return HRESULT_FROM_WIN32(GetLastError());
@@ -741,13 +736,10 @@ HRESULT __cdecl SaveToPortablePixMapHDR(
tmpImage.Release();
-#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
- ScopedHandle hFile(safe_handle(CreateFile2(szFile,
- GENERIC_WRITE, 0, CREATE_ALWAYS, nullptr)));
-#else
- ScopedHandle hFile(safe_handle(CreateFileW(szFile,
- GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr)));
-#endif
+ ScopedHandle hFile(safe_handle(CreateFile2(
+ szFile,
+ GENERIC_WRITE, 0, CREATE_ALWAYS,
+ nullptr)));
if (!hFile)
return HRESULT_FROM_WIN32(GetLastError());
diff --git a/Texconv/Texconv_Desktop_2019.vcxproj b/Texconv/Texconv_Desktop_2019.vcxproj
index 2bd5c9b7..898a5402 100644
--- a/Texconv/Texconv_Desktop_2019.vcxproj
+++ b/Texconv/Texconv_Desktop_2019.vcxproj
@@ -137,7 +137,7 @@
StreamingSIMDExtensions2
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
/Zc:twoPhase- /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)
- WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
true
true
26812
@@ -163,7 +163,7 @@
Fast
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
/Zc:twoPhase- /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)
- WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
true
true
26812
@@ -188,7 +188,7 @@
StreamingSIMDExtensions2
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
/Zc:twoPhase- /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)
- WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
Guard
true
true
@@ -216,7 +216,7 @@
Fast
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
/Zc:twoPhase- /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)
- WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
Guard
true
true
@@ -244,7 +244,7 @@
StreamingSIMDExtensions2
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
/Zc:twoPhase- /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)
- WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
true
true
Guard
@@ -272,7 +272,7 @@
Fast
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
/Zc:twoPhase- /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)
- WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
true
true
Guard
diff --git a/Texconv/Texconv_Desktop_2022.vcxproj b/Texconv/Texconv_Desktop_2022.vcxproj
index e16024ee..6952662f 100644
--- a/Texconv/Texconv_Desktop_2022.vcxproj
+++ b/Texconv/Texconv_Desktop_2022.vcxproj
@@ -137,7 +137,7 @@
StreamingSIMDExtensions2
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
/Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions)
- WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
true
true
26812
@@ -163,7 +163,7 @@
Fast
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
/Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions)
- WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
true
true
26812
@@ -188,7 +188,7 @@
StreamingSIMDExtensions2
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
/Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions)
- WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
Guard
true
true
@@ -216,7 +216,7 @@
Fast
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
/Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions)
- WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
Guard
true
true
@@ -244,7 +244,7 @@
StreamingSIMDExtensions2
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
/Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions)
- WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
true
true
Guard
@@ -272,7 +272,7 @@
Fast
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
/Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions)
- WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
true
true
Guard
diff --git a/Texdiag/texdiag_Desktop_2019.vcxproj b/Texdiag/texdiag_Desktop_2019.vcxproj
index 717a25df..98294733 100644
--- a/Texdiag/texdiag_Desktop_2019.vcxproj
+++ b/Texdiag/texdiag_Desktop_2019.vcxproj
@@ -135,7 +135,7 @@
Fast
StreamingSIMDExtensions2
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
true
true
/Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)
@@ -160,7 +160,7 @@
MultiThreadedDebugDLL
Fast
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
true
true
/Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)
@@ -184,7 +184,7 @@
Fast
StreamingSIMDExtensions2
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
Guard
true
true
@@ -211,7 +211,7 @@
MaxSpeed
Fast
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
Guard
true
true
@@ -238,7 +238,7 @@
Fast
StreamingSIMDExtensions2
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
true
true
/Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)
@@ -265,7 +265,7 @@
MaxSpeed
Fast
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
true
true
/Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)
diff --git a/Texdiag/texdiag_Desktop_2022.vcxproj b/Texdiag/texdiag_Desktop_2022.vcxproj
index 52bb996b..4527344b 100644
--- a/Texdiag/texdiag_Desktop_2022.vcxproj
+++ b/Texdiag/texdiag_Desktop_2022.vcxproj
@@ -135,7 +135,7 @@
Fast
StreamingSIMDExtensions2
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
true
true
/Zc:__cplusplus %(AdditionalOptions)
@@ -160,7 +160,7 @@
MultiThreadedDebugDLL
Fast
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
true
true
/Zc:__cplusplus %(AdditionalOptions)
@@ -184,7 +184,7 @@
Fast
StreamingSIMDExtensions2
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
Guard
true
true
@@ -211,7 +211,7 @@
MaxSpeed
Fast
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
Guard
true
true
@@ -238,7 +238,7 @@
Fast
StreamingSIMDExtensions2
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
true
true
/Zc:__cplusplus %(AdditionalOptions)
@@ -265,7 +265,7 @@
MaxSpeed
Fast
$(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
+ WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)
true
true
/Zc:__cplusplus %(AdditionalOptions)
diff --git a/WICTextureLoader/WICTextureLoader11.cpp b/WICTextureLoader/WICTextureLoader11.cpp
index 550c6fc4..48d90e88 100644
--- a/WICTextureLoader/WICTextureLoader11.cpp
+++ b/WICTextureLoader/WICTextureLoader11.cpp
@@ -179,22 +179,17 @@ namespace
{ GUID_WICPixelFormat40bppCMYKAlpha, GUID_WICPixelFormat32bppRGBA }, // DXGI_FORMAT_R8G8B8A8_UNORM
{ GUID_WICPixelFormat80bppCMYKAlpha, GUID_WICPixelFormat64bppRGBA }, // DXGI_FORMAT_R16G16B16A16_UNORM
- #if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
{ GUID_WICPixelFormat32bppRGB, GUID_WICPixelFormat32bppRGBA }, // DXGI_FORMAT_R8G8B8A8_UNORM
{ GUID_WICPixelFormat64bppRGB, GUID_WICPixelFormat64bppRGBA }, // DXGI_FORMAT_R16G16B16A16_UNORM
{ GUID_WICPixelFormat64bppPRGBAHalf, GUID_WICPixelFormat64bppRGBAHalf }, // DXGI_FORMAT_R16G16B16A16_FLOAT
- #endif
// We don't support n-channel formats
};
-#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
bool g_WIC2 = false;
-#endif
BOOL WINAPI InitializeWICFactory(PINIT_ONCE, PVOID, PVOID *ifactory) noexcept
{
- #if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
HRESULT hr = CoCreateInstance(
CLSID_WICImagingFactory2,
nullptr,
@@ -220,14 +215,6 @@ namespace
);
return SUCCEEDED(hr) ? TRUE : FALSE;
}
- #else
- return SUCCEEDED(CoCreateInstance(
- CLSID_WICImagingFactory,
- nullptr,
- CLSCTX_INPROC_SERVER,
- __uuidof(IWICImagingFactory),
- ifactory)) ? TRUE : FALSE;
- #endif
}
IWICImagingFactory* GetWIC() noexcept
@@ -256,13 +243,11 @@ namespace
return g_WICFormats[i].format;
}
- #if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
if (g_WIC2)
{
if (memcmp(&GUID_WICPixelFormat96bppRGBFloat, &guid, sizeof(GUID)) == 0)
return DXGI_FORMAT_R32G32B32_FLOAT;
}
- #endif
return DXGI_FORMAT_UNKNOWN;
}
@@ -468,7 +453,6 @@ namespace
{
if (memcmp(&GUID_WICPixelFormat96bppRGBFixedPoint, &pixelFormat, sizeof(WICPixelFormatGUID)) == 0)
{
- #if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
if (g_WIC2)
{
memcpy_s(&convertGUID, sizeof(WICPixelFormatGUID), &GUID_WICPixelFormat96bppRGBFloat, sizeof(GUID));
@@ -476,7 +460,6 @@ namespace
bpp = 96;
}
else
- #endif
{
memcpy_s(&convertGUID, sizeof(WICPixelFormatGUID), &GUID_WICPixelFormat128bppRGBAFloat, sizeof(GUID));
format = DXGI_FORMAT_R32G32B32A32_FLOAT;
@@ -507,7 +490,6 @@ namespace
bpp = WICBitsPerPixel(pixelFormat);
}
- #if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
if ((format == DXGI_FORMAT_R32G32B32_FLOAT) && d3dContext && textureView)
{
// Special case test for optional device support for autogen mipchains for R32G32B32_FLOAT
@@ -521,7 +503,6 @@ namespace
bpp = 128;
}
}
- #endif
if (loadFlags & WIC_LOADER_FORCE_RGBA32)
{
diff --git a/WICTextureLoader/WICTextureLoader9.cpp b/WICTextureLoader/WICTextureLoader9.cpp
index 68866f2f..c8221d90 100644
--- a/WICTextureLoader/WICTextureLoader9.cpp
+++ b/WICTextureLoader/WICTextureLoader9.cpp
@@ -156,12 +156,10 @@ namespace
{ GUID_WICPixelFormat40bppCMYKAlpha, GUID_WICPixelFormat32bppBGRA }, // D3DFMT_A8R8G8B8
{ GUID_WICPixelFormat80bppCMYKAlpha, GUID_WICPixelFormat64bppRGBA }, // D3DFMT_A16B16G16R16
- #if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
{ GUID_WICPixelFormat32bppRGB, GUID_WICPixelFormat32bppBGRA }, // D3DFMT_A8R8G8B8
{ GUID_WICPixelFormat64bppRGB, GUID_WICPixelFormat64bppRGBA }, // D3DFMT_A16B16G16R16
{ GUID_WICPixelFormat64bppPRGBAHalf, GUID_WICPixelFormat64bppRGBAHalf }, // D3DFMT_A16B16G16R16F
{ GUID_WICPixelFormat96bppRGBFloat, GUID_WICPixelFormat128bppRGBAFloat }, // D3DFMT_A32B32G32R32F
- #endif
// We don't support n-channel formats
};
@@ -169,7 +167,6 @@ namespace
//--------------------------------------------------------------------------------------
BOOL WINAPI InitializeWICFactory(PINIT_ONCE, PVOID, PVOID* ifactory) noexcept
{
- #if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
HRESULT hr = CoCreateInstance(
CLSID_WICImagingFactory2,
nullptr,
@@ -194,14 +191,6 @@ namespace
);
return SUCCEEDED(hr) ? TRUE : FALSE;
}
- #else
- return SUCCEEDED(CoCreateInstance(
- CLSID_WICImagingFactory,
- nullptr,
- CLSCTX_INPROC_SERVER,
- __uuidof(IWICImagingFactory),
- ifactory)) ? TRUE : FALSE;
- #endif
}
IWICImagingFactory* GetWIC() noexcept