Use IID_PPV_ARGS macro

This commit is contained in:
Chuck Walbourn
2016-04-18 14:45:56 -07:00
parent 842c9aff1d
commit 51e92d4e5d
4 changed files with 19 additions and 15 deletions

View File

@@ -37,6 +37,10 @@
#include "ScreenGrab.h"
#ifndef IID_GRAPHICS_PPV_ARGS
#define IID_GRAPHICS_PPV_ARGS(x) IID_PPV_ARGS(x)
#endif
using Microsoft::WRL::ComPtr;
//--------------------------------------------------------------------------------------
@@ -614,7 +618,7 @@ static HRESULT CaptureTexture( _In_ ID3D11DeviceContext* pContext,
return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
ComPtr<ID3D11Texture2D> pTexture;
HRESULT hr = pSource->QueryInterface( __uuidof(ID3D11Texture2D), reinterpret_cast<void**>( pTexture.GetAddressOf() ) );
HRESULT hr = pSource->QueryInterface( IID_GRAPHICS_PPV_ARGS( pTexture.GetAddressOf() ) );
if ( FAILED(hr) )
return hr;
@@ -726,8 +730,7 @@ static IWICImagingFactory* _GetWIC()
CLSID_WICImagingFactory1,
nullptr,
CLSCTX_INPROC_SERVER,
__uuidof(IWICImagingFactory),
(LPVOID*)&s_Factory
IID_PPV_ARGS(&s_Factory)
);
if ( FAILED(hr) )
@@ -741,8 +744,7 @@ static IWICImagingFactory* _GetWIC()
CLSID_WICImagingFactory,
nullptr,
CLSCTX_INPROC_SERVER,
__uuidof(IWICImagingFactory),
(LPVOID*)&s_Factory
IID_PPV_ARGS(&s_Factory)
);
if ( FAILED(hr) )