From 807899c4aee135c87a126495eeb9e2536e1a2845 Mon Sep 17 00:00:00 2001 From: walbourn_cp Date: Wed, 2 May 2012 15:28:14 -0700 Subject: [PATCH] Fixed issue with Debug builds for Metro style apps --- Src/DDSTextureLoader.cpp | 4 ++-- Src/WICTextureLoader.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Src/DDSTextureLoader.cpp b/Src/DDSTextureLoader.cpp index c4d182fbf..2331d08b0 100644 --- a/Src/DDSTextureLoader.cpp +++ b/Src/DDSTextureLoader.cpp @@ -1391,7 +1391,7 @@ HRESULT CreateDDSTextureFromFile( _In_ ID3D11Device* d3dDevice, if (texture != 0 && *texture != 0) { (*texture)->SetPrivateData( WKPDID_D3DDebugObjectName, - lstrlenA(pstrName), + strnlen_s(pstrName, MAX_PATH), pstrName ); } @@ -1399,7 +1399,7 @@ HRESULT CreateDDSTextureFromFile( _In_ ID3D11Device* d3dDevice, if (textureView != 0 && *textureView != 0 ) { (*textureView)->SetPrivateData( WKPDID_D3DDebugObjectName, - lstrlenA(pstrName), + strnlen_s(pstrName, MAX_PATH), pstrName ); } diff --git a/Src/WICTextureLoader.cpp b/Src/WICTextureLoader.cpp index f9b5dbeb8..d0d1f09af 100644 --- a/Src/WICTextureLoader.cpp +++ b/Src/WICTextureLoader.cpp @@ -669,7 +669,7 @@ HRESULT CreateWICTextureFromFile( _In_ ID3D11Device* d3dDevice, if (texture != 0 && *texture != 0) { (*texture)->SetPrivateData( WKPDID_D3DDebugObjectName, - lstrlenA(pstrName), + strnlen_s(pstrName, MAX_PATH), pstrName ); } @@ -677,7 +677,7 @@ HRESULT CreateWICTextureFromFile( _In_ ID3D11Device* d3dDevice, if (textureView != 0 && *textureView != 0 ) { (*textureView)->SetPrivateData( WKPDID_D3DDebugObjectName, - lstrlenA(pstrName), + strnlen_s(pstrName, MAX_PATH), pstrName ); }