From e909fa68d0d9879b322be8639803b9b0b0f868d1 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Wed, 7 May 2025 16:01:43 -0700 Subject: [PATCH] EncodeDDSHeader for Xbox can't take a nullptr (#613) --- Auxiliary/DirectXTexEXR.cpp | 6 ++---- Auxiliary/DirectXTexXbox.h | 7 ------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/Auxiliary/DirectXTexEXR.cpp b/Auxiliary/DirectXTexEXR.cpp index f3569e2..08cda78 100644 --- a/Auxiliary/DirectXTexEXR.cpp +++ b/Auxiliary/DirectXTexEXR.cpp @@ -490,11 +490,9 @@ HRESULT DirectX::SaveToEXRFile(const Image& image, const wchar_t* szFile) } // Create file and write header - ScopedHandle hFile(safe_handle(CreateFileW( + ScopedHandle hFile(safe_handle(CreateFile2( szFile, - GENERIC_WRITE, 0, - nullptr, - CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, + GENERIC_WRITE, 0, CREATE_ALWAYS, nullptr))); if (!hFile) { diff --git a/Auxiliary/DirectXTexXbox.h b/Auxiliary/DirectXTexXbox.h index f034c07..f8032ae 100644 --- a/Auxiliary/DirectXTexXbox.h +++ b/Auxiliary/DirectXTexXbox.h @@ -218,13 +218,6 @@ namespace Xbox { return EncodeDDSHeader(xbox, reinterpret_cast(pDestination), maxsize); } - - inline HRESULT __cdecl EncodeDDSHeader( - const XboxImage& xbox, - _Reserved_ std::nullptr_t, _In_ size_t maxsize) noexcept - { - return EncodeDDSHeader(xbox, static_cast(nullptr), maxsize); - } #endif } // namespace