D3D11DeviceContext wrapper menu

User Tag List

Results 1 to 6 of 6
  1. #1
    bad6oy30's Avatar Member Authenticator enabled
    Reputation
    1
    Join Date
    Dec 2010
    Posts
    41
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    D3D11DeviceContext wrapper

    For anyone doing a D3D11 wrapper approach rather than live detours, here's a D3D11DeviceContext wrapper to save you some typing.

    Code:
    #pragma once
    
    #include <Windows.h>
    #include <d3d11.h>
    
    class MyD3D11DeviceContext: public ID3D11DeviceContext
    {
    private:
    	ID3D11DeviceContext* const _real;
    public:
    	MyD3D11DeviceContext(ID3D11DeviceContext* real)
    		: _real(real)
    	{
    	}
    
    	//ID3D11DeviceContext
    
    	virtual void STDMETHODCALLTYPE VSSetConstantBuffers( 
    		__in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot )  UINT NumBuffers,
    		__in_ecount(NumBuffers)  ID3D11Buffer *const *ppConstantBuffers)
    	{
    		this->_real->VSSetConstantBuffers(StartSlot, NumBuffers, ppConstantBuffers);
    	}
            
    	virtual void STDMETHODCALLTYPE PSSetShaderResources( 
    		__in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot )  UINT NumViews,
    		__in_ecount(NumViews)  ID3D11ShaderResourceView *const *ppShaderResourceViews)
    	{
    		this->_real->PSSetShaderResources(StartSlot, NumViews, ppShaderResourceViews);
    	}
            
    	virtual void STDMETHODCALLTYPE PSSetShader( 
    		__in_opt  ID3D11PixelShader *pPixelShader,
    		__in_ecount_opt(NumClassInstances)  ID3D11ClassInstance *const *ppClassInstances,
    		UINT NumClassInstances)
    	{
    		this->_real->PSSetShader(pPixelShader, ppClassInstances, NumClassInstances);
    	}
            
    	virtual void STDMETHODCALLTYPE PSSetSamplers( 
    		__in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot )  UINT NumSamplers,
    		__in_ecount(NumSamplers)  ID3D11SamplerState *const *ppSamplers)
    	{
    		this->_real->PSSetSamplers(StartSlot, NumSamplers, ppSamplers);
    	}
            
    	virtual void STDMETHODCALLTYPE VSSetShader( 
    		__in_opt  ID3D11VertexShader *pVertexShader,
    		__in_ecount_opt(NumClassInstances)  ID3D11ClassInstance *const *ppClassInstances,
    		UINT NumClassInstances)
    	{
    		this->_real->VSSetShader(pVertexShader, ppClassInstances, NumClassInstances);
    	}
            
    	virtual void STDMETHODCALLTYPE DrawIndexed( 
    		__in  UINT IndexCount,
    		__in  UINT StartIndexLocation,
    		__in  INT BaseVertexLocation)
    	{
    		this->_real->DrawIndexed(IndexCount, StartIndexLocation, BaseVertexLocation);
    	}
            
    	virtual void STDMETHODCALLTYPE Draw( 
    		__in  UINT VertexCount,
    		__in  UINT StartVertexLocation)
    	{
    		this->_real->Draw(VertexCount, StartVertexLocation);
    	}
            
    	virtual HRESULT STDMETHODCALLTYPE Map( 
    		__in  ID3D11Resource *pResource,
    		__in  UINT Subresource,
    		__in  D3D11_MAP MapType,
    		__in  UINT MapFlags,
    		__out  D3D11_MAPPED_SUBRESOURCE *pMappedResource)
    	{
    		return this->_real->Map(pResource, Subresource, MapType, MapFlags, pMappedResource);
    	}
            
    	virtual void STDMETHODCALLTYPE Unmap( 
    		__in  ID3D11Resource *pResource,
    		__in  UINT Subresource)
    	{
    		this->_real->Unmap(pResource, Subresource);
    	}
            
    	virtual void STDMETHODCALLTYPE PSSetConstantBuffers( 
    		__in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot )  UINT NumBuffers,
    		__in_ecount(NumBuffers)  ID3D11Buffer *const *ppConstantBuffers)
    	{
    		this->_real->PSSetConstantBuffers(StartSlot, NumBuffers, ppConstantBuffers);
    	}
            
    	virtual void STDMETHODCALLTYPE IASetInputLayout( 
    		__in_opt  ID3D11InputLayout *pInputLayout)
    	{
    		this->_real->IASetInputLayout(pInputLayout);
    	}
            
    	virtual void STDMETHODCALLTYPE IASetVertexBuffers( 
    		__in_range( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot )  UINT NumBuffers,
    		__in_ecount(NumBuffers)  ID3D11Buffer *const *ppVertexBuffers,
    		__in_ecount(NumBuffers)  const UINT *pStrides,
    		__in_ecount(NumBuffers)  const UINT *pOffsets)
    	{
    		this->_real->IASetVertexBuffers(StartSlot, NumBuffers, ppVertexBuffers, pStrides, pOffsets);
    	}
            
    	virtual void STDMETHODCALLTYPE IASetIndexBuffer( 
    		__in_opt  ID3D11Buffer *pIndexBuffer,
    		__in  DXGI_FORMAT Format,
    		__in  UINT Offset)
    	{
    		this->_real->IASetIndexBuffer(pIndexBuffer, Format, Offset);
    	}
            
    	virtual void STDMETHODCALLTYPE DrawIndexedInstanced( 
    		__in  UINT IndexCountPerInstance,
    		__in  UINT InstanceCount,
    		__in  UINT StartIndexLocation,
    		__in  INT BaseVertexLocation,
    		__in  UINT StartInstanceLocation)
    	{
    		this->_real->DrawIndexedInstanced(IndexCountPerInstance, InstanceCount, StartIndexLocation, BaseVertexLocation, StartInstanceLocation);
    	}
            
    	virtual void STDMETHODCALLTYPE DrawInstanced( 
    		__in  UINT VertexCountPerInstance,
    		__in  UINT InstanceCount,
    		__in  UINT StartVertexLocation,
    		__in  UINT StartInstanceLocation)
    	{
    		this->_real->DrawInstanced(VertexCountPerInstance, InstanceCount, StartVertexLocation, StartInstanceLocation);
    	}
            
    	virtual void STDMETHODCALLTYPE GSSetConstantBuffers( 
    		__in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot )  UINT NumBuffers,
    		__in_ecount(NumBuffers)  ID3D11Buffer *const *ppConstantBuffers)
    	{
    		this->_real->GSSetConstantBuffers(StartSlot, NumBuffers, ppConstantBuffers);
    	}
            
    	virtual void STDMETHODCALLTYPE GSSetShader( 
    		__in_opt  ID3D11GeometryShader *pShader,
    		__in_ecount_opt(NumClassInstances)  ID3D11ClassInstance *const *ppClassInstances,
    		UINT NumClassInstances)
    	{
    		this->_real->GSSetShader(pShader, ppClassInstances, NumClassInstances);
    	}
            
    	virtual void STDMETHODCALLTYPE IASetPrimitiveTopology( 
    		__in  D3D11_PRIMITIVE_TOPOLOGY Topology)
    	{
    		this->_real->IASetPrimitiveTopology(Topology);
    	}
            
    	virtual void STDMETHODCALLTYPE VSSetShaderResources( 
    		__in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot )  UINT NumViews,
    		__in_ecount(NumViews)  ID3D11ShaderResourceView *const *ppShaderResourceViews)
    	{
    		this->_real->VSSetShaderResources(StartSlot, NumViews, ppShaderResourceViews);
    	}
            
    	virtual void STDMETHODCALLTYPE VSSetSamplers( 
    		__in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot )  UINT NumSamplers,
    		__in_ecount(NumSamplers)  ID3D11SamplerState *const *ppSamplers)
    	{
    		this->_real->VSSetSamplers(StartSlot, NumSamplers, ppSamplers);
    	}
            
    	virtual void STDMETHODCALLTYPE Begin( 
    		__in  ID3D11Asynchronous *pAsync)
    	{
    		this->_real->Begin(pAsync);
    	}
            
    	virtual void STDMETHODCALLTYPE End( 
    		__in  ID3D11Asynchronous *pAsync)
    	{
    		this->_real->End(pAsync);
    	}
            
    	virtual HRESULT STDMETHODCALLTYPE GetData( 
    		__in  ID3D11Asynchronous *pAsync,
    		__out_bcount_opt( DataSize )  void *pData,
    		__in  UINT DataSize,
    		__in  UINT GetDataFlags)
    	{
    		return this->_real->GetData(pAsync, pData, DataSize, GetDataFlags);
    	}
            
    	virtual void STDMETHODCALLTYPE SetPredication( 
    		__in_opt  ID3D11Predicate *pPredicate,
    		__in  BOOL PredicateValue)
    	{
    		this->_real->SetPredication(pPredicate, PredicateValue);
    	}
            
    	virtual void STDMETHODCALLTYPE GSSetShaderResources( 
    		__in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot )  UINT NumViews,
    		__in_ecount(NumViews)  ID3D11ShaderResourceView *const *ppShaderResourceViews)
    	{
    		this->_real->GSSetShaderResources(StartSlot, NumViews, ppShaderResourceViews);
    	}
            
    	virtual void STDMETHODCALLTYPE GSSetSamplers( 
    		__in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot )  UINT NumSamplers,
    		__in_ecount(NumSamplers)  ID3D11SamplerState *const *ppSamplers)
    	{
    		this->_real->GSSetSamplers(StartSlot, NumSamplers, ppSamplers);
    	}
            
    	virtual void STDMETHODCALLTYPE OMSetRenderTargets( 
    		__in_range( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT )  UINT NumViews,
    		__in_ecount_opt(NumViews)  ID3D11RenderTargetView *const *ppRenderTargetViews,
    		__in_opt  ID3D11DepthStencilView *pDepthStencilView)
    	{
    		this->_real->OMSetRenderTargets(NumViews, ppRenderTargetViews, pDepthStencilView);
    	}
            
    	virtual void STDMETHODCALLTYPE OMSetRenderTargetsAndUnorderedAccessViews( 
    		__in  UINT NumRTVs,
    		__in_ecount_opt(NumRTVs)  ID3D11RenderTargetView *const *ppRenderTargetViews,
    		__in_opt  ID3D11DepthStencilView *pDepthStencilView,
    		__in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 )  UINT UAVStartSlot,
    		__in  UINT NumUAVs,
    		__in_ecount_opt(NumUAVs)  ID3D11UnorderedAccessView *const *ppUnorderedAccessViews,
    		__in_ecount_opt(NumUAVs)  const UINT *pUAVInitialCounts)
    	{
    		this->_real->OMSetRenderTargetsAndUnorderedAccessViews(NumRTVs, ppRenderTargetViews, pDepthStencilView, UAVStartSlot, NumUAVs, ppUnorderedAccessViews, pUAVInitialCounts);
    	}
            
    	virtual void STDMETHODCALLTYPE OMSetBlendState( 
    		__in_opt  ID3D11BlendState *pBlendState,
    		__in_opt  const FLOAT BlendFactor[ 4 ],
    		__in  UINT SampleMask)
    	{
    		this->_real->OMSetBlendState(pBlendState, BlendFactor, SampleMask);
    	}
            
    	virtual void STDMETHODCALLTYPE OMSetDepthStencilState( 
    		__in_opt  ID3D11DepthStencilState *pDepthStencilState,
    		__in  UINT StencilRef)
    	{
    		this->_real->OMSetDepthStencilState(pDepthStencilState, StencilRef);
    	}
            
    	virtual void STDMETHODCALLTYPE SOSetTargets( 
    		__in_range( 0, D3D11_SO_BUFFER_SLOT_COUNT)  UINT NumBuffers,
    		__in_ecount_opt(NumBuffers)  ID3D11Buffer *const *ppSOTargets,
    		__in_ecount_opt(NumBuffers)  const UINT *pOffsets)
    	{
    		this->_real->SOSetTargets(NumBuffers, ppSOTargets, pOffsets);
    	}
            
    	virtual void STDMETHODCALLTYPE DrawAuto()
    	{
    		this->_real->DrawAuto();
    	}
            
    	virtual void STDMETHODCALLTYPE DrawIndexedInstancedIndirect( 
    		__in  ID3D11Buffer *pBufferForArgs,
    		__in  UINT AlignedByteOffsetForArgs)
    	{
    		this->_real->DrawIndexedInstancedIndirect(pBufferForArgs, AlignedByteOffsetForArgs);
    	}
            
    	virtual void STDMETHODCALLTYPE DrawInstancedIndirect( 
    		__in  ID3D11Buffer *pBufferForArgs,
    		__in  UINT AlignedByteOffsetForArgs)
    	{
    		this->_real->DrawInstancedIndirect(pBufferForArgs, AlignedByteOffsetForArgs);
    	}
            
    	virtual void STDMETHODCALLTYPE Dispatch( 
    		__in  UINT ThreadGroupCountX,
    		__in  UINT ThreadGroupCountY,
    		__in  UINT ThreadGroupCountZ)
    	{
    		this->_real->Dispatch(ThreadGroupCountX, ThreadGroupCountY, ThreadGroupCountZ);
    	}
            
    	virtual void STDMETHODCALLTYPE DispatchIndirect( 
    		__in  ID3D11Buffer *pBufferForArgs,
    		__in  UINT AlignedByteOffsetForArgs)
    	{
    		this->_real->DispatchIndirect(pBufferForArgs, AlignedByteOffsetForArgs);
    	}
            
    	virtual void STDMETHODCALLTYPE RSSetState( 
    		__in_opt  ID3D11RasterizerState *pRasterizerState)
    	{
    		this->_real->RSSetState(pRasterizerState);
    	}
            
    	virtual void STDMETHODCALLTYPE RSSetViewports( 
    		__in_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE)  UINT NumViewports,
    		__in_ecount_opt(NumViewports)  const D3D11_VIEWPORT *pViewports)
    	{
    		this->_real->RSSetViewports(NumViewports, pViewports);
    	}
            
    	virtual void STDMETHODCALLTYPE RSSetScissorRects( 
    		__in_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE)  UINT NumRects,
    		__in_ecount_opt(NumRects)  const D3D11_RECT *pRects)
    	{
    		this->_real->RSSetScissorRects(NumRects, pRects);
    	}
            
    	virtual void STDMETHODCALLTYPE CopySubresourceRegion( 
    		__in  ID3D11Resource *pDstResource,
    		__in  UINT DstSubresource,
    		__in  UINT DstX,
    		__in  UINT DstY,
    		__in  UINT DstZ,
    		__in  ID3D11Resource *pSrcResource,
    		__in  UINT SrcSubresource,
    		__in_opt  const D3D11_BOX *pSrcBox)
    	{
    		this->_real->CopySubresourceRegion(pDstResource, DstSubresource, DstX, DstY, DstZ, pSrcResource, SrcSubresource, pSrcBox);
    	}
            
    	virtual void STDMETHODCALLTYPE CopyResource( 
    		__in  ID3D11Resource *pDstResource,
    		__in  ID3D11Resource *pSrcResource)
    	{
    		this->_real->CopyResource(pDstResource, pSrcResource);
    	}
            
    	virtual void STDMETHODCALLTYPE UpdateSubresource( 
    		__in  ID3D11Resource *pDstResource,
    		__in  UINT DstSubresource,
    		__in_opt  const D3D11_BOX *pDstBox,
    		__in  const void *pSrcData,
    		__in  UINT SrcRowPitch,
    		__in  UINT SrcDepthPitch)
    	{
    		this->_real->UpdateSubresource(pDstResource, DstSubresource, pDstBox, pSrcData, SrcRowPitch, SrcDepthPitch);
    	}
            
    	virtual void STDMETHODCALLTYPE CopyStructureCount( 
    		__in  ID3D11Buffer *pDstBuffer,
    		__in  UINT DstAlignedByteOffset,
    		__in  ID3D11UnorderedAccessView *pSrcView)
    	{
    		this->_real->CopyStructureCount(pDstBuffer, DstAlignedByteOffset, pSrcView);
    	}
            
    	virtual void STDMETHODCALLTYPE ClearRenderTargetView( 
    		__in  ID3D11RenderTargetView *pRenderTargetView,
    		__in  const FLOAT ColorRGBA[ 4 ])
    	{
    		this->_real->ClearRenderTargetView(pRenderTargetView, ColorRGBA);
    	}
            
    	virtual void STDMETHODCALLTYPE ClearUnorderedAccessViewUint( 
    		__in  ID3D11UnorderedAccessView *pUnorderedAccessView,
    		__in  const UINT Values[ 4 ])
    	{
    		this->_real->ClearUnorderedAccessViewUint(pUnorderedAccessView, Values);
    	}
            
    	virtual void STDMETHODCALLTYPE ClearUnorderedAccessViewFloat( 
    		__in  ID3D11UnorderedAccessView *pUnorderedAccessView,
    		__in  const FLOAT Values[ 4 ])
    	{
    		this->_real->ClearUnorderedAccessViewFloat(pUnorderedAccessView, Values);
    	}
            
    	virtual void STDMETHODCALLTYPE ClearDepthStencilView( 
    		__in  ID3D11DepthStencilView *pDepthStencilView,
    		__in  UINT ClearFlags,
    		__in  FLOAT Depth,
    		__in  UINT8 Stencil)
    	{
    		this->_real->ClearDepthStencilView(pDepthStencilView, ClearFlags, Depth, Stencil);
    	}
            
    	virtual void STDMETHODCALLTYPE GenerateMips( 
    		__in  ID3D11ShaderResourceView *pShaderResourceView)
    	{
    		this->_real->GenerateMips(pShaderResourceView);
    	}
            
    	virtual void STDMETHODCALLTYPE SetResourceMinLOD( 
    		__in  ID3D11Resource *pResource,
    		FLOAT MinLOD)
    	{
    		this->_real->SetResourceMinLOD(pResource, MinLOD);
    	}
            
    	virtual FLOAT STDMETHODCALLTYPE GetResourceMinLOD( 
    		__in  ID3D11Resource *pResource)
    	{
    		return this->_real->GetResourceMinLOD(pResource);
    	}
            
    	virtual void STDMETHODCALLTYPE ResolveSubresource( 
    		__in  ID3D11Resource *pDstResource,
    		__in  UINT DstSubresource,
    		__in  ID3D11Resource *pSrcResource,
    		__in  UINT SrcSubresource,
    		__in  DXGI_FORMAT Format)
    	{
    		this->_real->ResolveSubresource(pDstResource, DstSubresource, pSrcResource, SrcSubresource, Format);
    	}
            
    	virtual void STDMETHODCALLTYPE ExecuteCommandList( 
    		__in  ID3D11CommandList *pCommandList,
    		BOOL RestoreContextState)
    	{
    		this->_real->ExecuteCommandList(pCommandList, RestoreContextState);
    	}
            
    	virtual void STDMETHODCALLTYPE HSSetShaderResources( 
    		__in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot )  UINT NumViews,
    		__in_ecount(NumViews)  ID3D11ShaderResourceView *const *ppShaderResourceViews)
    	{
    		this->_real->HSSetShaderResources(StartSlot, NumViews, ppShaderResourceViews);
    	}
            
    	virtual void STDMETHODCALLTYPE HSSetShader( 
    		__in_opt  ID3D11HullShader *pHullShader,
    		__in_ecount_opt(NumClassInstances)  ID3D11ClassInstance *const *ppClassInstances,
    		UINT NumClassInstances)
    	{
    		this->_real->HSSetShader(pHullShader, ppClassInstances, NumClassInstances);
    	}
            
    	virtual void STDMETHODCALLTYPE HSSetSamplers( 
    		__in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot )  UINT NumSamplers,
    		__in_ecount(NumSamplers)  ID3D11SamplerState *const *ppSamplers)
    	{
    		this->_real->HSSetSamplers(StartSlot, NumSamplers, ppSamplers);
    	}
            
    	virtual void STDMETHODCALLTYPE HSSetConstantBuffers( 
    		__in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot )  UINT NumBuffers,
    		__in_ecount(NumBuffers)  ID3D11Buffer *const *ppConstantBuffers)
    	{
    		this->_real->HSSetConstantBuffers(StartSlot, NumBuffers, ppConstantBuffers);
    	}
            
    	virtual void STDMETHODCALLTYPE DSSetShaderResources( 
    		__in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot )  UINT NumViews,
    		__in_ecount(NumViews)  ID3D11ShaderResourceView *const *ppShaderResourceViews)
    	{
    		this->_real->DSSetShaderResources(StartSlot, NumViews, ppShaderResourceViews);
    	}
            
    	virtual void STDMETHODCALLTYPE DSSetShader( 
    		__in_opt  ID3D11DomainShader *pDomainShader,
    		__in_ecount_opt(NumClassInstances)  ID3D11ClassInstance *const *ppClassInstances,
    		UINT NumClassInstances)
    	{
    		this->_real->DSSetShader(pDomainShader, ppClassInstances, NumClassInstances);
    	}
            
    	virtual void STDMETHODCALLTYPE DSSetSamplers( 
    		__in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot )  UINT NumSamplers,
    		__in_ecount(NumSamplers)  ID3D11SamplerState *const *ppSamplers)
    	{
    		this->_real->DSSetSamplers(StartSlot, NumSamplers, ppSamplers);
    	}
            
    	virtual void STDMETHODCALLTYPE DSSetConstantBuffers( 
    		__in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot )  UINT NumBuffers,
    		__in_ecount(NumBuffers)  ID3D11Buffer *const *ppConstantBuffers)
    	{
    		this->_real->DSSetConstantBuffers(StartSlot, NumBuffers, ppConstantBuffers);
    	}
            
    	virtual void STDMETHODCALLTYPE CSSetShaderResources( 
    		__in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot )  UINT NumViews,
    		__in_ecount(NumViews)  ID3D11ShaderResourceView *const *ppShaderResourceViews)
    	{
    		this->_real->CSSetShaderResources(StartSlot, NumViews, ppShaderResourceViews);
    	}
            
    	virtual void STDMETHODCALLTYPE CSSetUnorderedAccessViews( 
    		__in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - StartSlot )  UINT NumUAVs,
    		__in_ecount(NumUAVs)  ID3D11UnorderedAccessView *const *ppUnorderedAccessViews,
    		__in_ecount(NumUAVs)  const UINT *pUAVInitialCounts)
    	{
    		this->_real->CSSetUnorderedAccessViews(StartSlot, NumUAVs, ppUnorderedAccessViews, pUAVInitialCounts);
    	}
            
    	virtual void STDMETHODCALLTYPE CSSetShader( 
    		__in_opt  ID3D11ComputeShader *pComputeShader,
    		__in_ecount_opt(NumClassInstances)  ID3D11ClassInstance *const *ppClassInstances,
    		UINT NumClassInstances)
    	{
    		this->_real->CSSetShader(pComputeShader, ppClassInstances, NumClassInstances);
    	}
            
    	virtual void STDMETHODCALLTYPE CSSetSamplers( 
    		__in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot )  UINT NumSamplers,
    		__in_ecount(NumSamplers)  ID3D11SamplerState *const *ppSamplers)
    	{
    		this->_real->CSSetSamplers(StartSlot, NumSamplers, ppSamplers);
    	}
            
    	virtual void STDMETHODCALLTYPE CSSetConstantBuffers( 
    		__in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot )  UINT NumBuffers,
    		__in_ecount(NumBuffers)  ID3D11Buffer *const *ppConstantBuffers)
    	{
    		this->_real->CSSetConstantBuffers(StartSlot, NumBuffers, ppConstantBuffers);
    	}
            
    	virtual void STDMETHODCALLTYPE VSGetConstantBuffers( 
    		__in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot )  UINT NumBuffers,
    		__out_ecount(NumBuffers)  ID3D11Buffer **ppConstantBuffers)
    	{
    		this->_real->VSGetConstantBuffers(StartSlot, NumBuffers, ppConstantBuffers);
    	}
            
    	virtual void STDMETHODCALLTYPE PSGetShaderResources( 
    		__in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot )  UINT NumViews,
    		__out_ecount(NumViews)  ID3D11ShaderResourceView **ppShaderResourceViews)
    	{
    		this->_real->PSGetShaderResources(StartSlot, NumViews, ppShaderResourceViews);
    	}
            
    	virtual void STDMETHODCALLTYPE PSGetShader( 
    		__out_opt  ID3D11PixelShader **ppPixelShader,
    		__out_ecount_opt(*pNumClassInstances)  ID3D11ClassInstance **ppClassInstances,
    		__inout_opt  UINT *pNumClassInstances)
    	{
    		this->_real->PSGetShader(ppPixelShader, ppClassInstances, pNumClassInstances);
    	}
            
    	virtual void STDMETHODCALLTYPE PSGetSamplers( 
    		__in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot )  UINT NumSamplers,
    		__out_ecount(NumSamplers)  ID3D11SamplerState **ppSamplers)
    	{
    		this->_real->PSGetSamplers(StartSlot, NumSamplers, ppSamplers);
    	}
            
    	virtual void STDMETHODCALLTYPE VSGetShader( 
    		__out_opt  ID3D11VertexShader **ppVertexShader,
    		__out_ecount_opt(*pNumClassInstances)  ID3D11ClassInstance **ppClassInstances,
    		__inout_opt  UINT *pNumClassInstances)
    	{
    		this->_real->VSGetShader(ppVertexShader, ppClassInstances, pNumClassInstances);
    	}
            
    	virtual void STDMETHODCALLTYPE PSGetConstantBuffers( 
    		__in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot )  UINT NumBuffers,
    		__out_ecount(NumBuffers)  ID3D11Buffer **ppConstantBuffers)
    	{
    		this->_real->PSGetConstantBuffers(StartSlot, NumBuffers, ppConstantBuffers);
    	}
            
    	virtual void STDMETHODCALLTYPE IAGetInputLayout( 
    		__out  ID3D11InputLayout **ppInputLayout)
    	{
    		this->_real->IAGetInputLayout(ppInputLayout);
    	}
            
    	virtual void STDMETHODCALLTYPE IAGetVertexBuffers( 
    		__in_range( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot )  UINT NumBuffers,
    		__out_ecount_opt(NumBuffers)  ID3D11Buffer **ppVertexBuffers,
    		__out_ecount_opt(NumBuffers)  UINT *pStrides,
    		__out_ecount_opt(NumBuffers)  UINT *pOffsets)
    	{
    		this->_real->IAGetVertexBuffers(StartSlot, NumBuffers, ppVertexBuffers, pStrides, pOffsets);
    	}
            
    	virtual void STDMETHODCALLTYPE IAGetIndexBuffer( 
    		__out_opt  ID3D11Buffer **pIndexBuffer,
    		__out_opt  DXGI_FORMAT *Format,
    		__out_opt  UINT *Offset)
    	{
    		this->_real->IAGetIndexBuffer(pIndexBuffer, Format, Offset);
    	}
            
    	virtual void STDMETHODCALLTYPE GSGetConstantBuffers( 
    		__in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot )  UINT NumBuffers,
    		__out_ecount(NumBuffers)  ID3D11Buffer **ppConstantBuffers)
    	{
    		this->_real->GSGetConstantBuffers(StartSlot, NumBuffers, ppConstantBuffers);
    	}
            
    	virtual void STDMETHODCALLTYPE GSGetShader( 
    		__out_opt  ID3D11GeometryShader **ppGeometryShader,
    		__out_ecount_opt(*pNumClassInstances)  ID3D11ClassInstance **ppClassInstances,
    		__inout_opt  UINT *pNumClassInstances)
    	{
    		this->_real->GSGetShader(ppGeometryShader, ppClassInstances, pNumClassInstances);
    	}
            
    	virtual void STDMETHODCALLTYPE IAGetPrimitiveTopology( 
    		__out  D3D11_PRIMITIVE_TOPOLOGY *pTopology)
    	{
    		this->_real->IAGetPrimitiveTopology(pTopology);
    	}
            
    	virtual void STDMETHODCALLTYPE VSGetShaderResources( 
    		__in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot )  UINT NumViews,
    		__out_ecount(NumViews)  ID3D11ShaderResourceView **ppShaderResourceViews)
    	{
    		this->_real->VSGetShaderResources(StartSlot, NumViews, ppShaderResourceViews);
    	}
            
    	virtual void STDMETHODCALLTYPE VSGetSamplers( 
    		__in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot )  UINT NumSamplers,
    		__out_ecount(NumSamplers)  ID3D11SamplerState **ppSamplers)
    	{
    		this->_real->VSGetSamplers(StartSlot, NumSamplers, ppSamplers);
    	}
            
    	virtual void STDMETHODCALLTYPE GetPredication( 
    		__out_opt  ID3D11Predicate **ppPredicate,
    		__out_opt  BOOL *pPredicateValue)
    	{
    		this->_real->GetPredication(ppPredicate, pPredicateValue);
    	}
            
    	virtual void STDMETHODCALLTYPE GSGetShaderResources( 
    		__in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot )  UINT NumViews,
    		__out_ecount(NumViews)  ID3D11ShaderResourceView **ppShaderResourceViews)
    	{
    		this->_real->GSGetShaderResources(StartSlot, NumViews, ppShaderResourceViews);
    	}
            
    	virtual void STDMETHODCALLTYPE GSGetSamplers( 
    		__in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot )  UINT NumSamplers,
    		__out_ecount(NumSamplers)  ID3D11SamplerState **ppSamplers)
    	{
    		this->_real->GSGetSamplers(StartSlot, NumSamplers, ppSamplers);
    	}
            
    	virtual void STDMETHODCALLTYPE OMGetRenderTargets( 
    		__in_range( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT )  UINT NumViews,
    		__out_ecount_opt(NumViews)  ID3D11RenderTargetView **ppRenderTargetViews,
    		__out_opt  ID3D11DepthStencilView **ppDepthStencilView)
    	{
    		this->_real->OMGetRenderTargets(NumViews, ppRenderTargetViews, ppDepthStencilView);
    	}
            
    	virtual void STDMETHODCALLTYPE OMGetRenderTargetsAndUnorderedAccessViews( 
    		__in_range( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT )  UINT NumRTVs,
    		__out_ecount_opt(NumRTVs)  ID3D11RenderTargetView **ppRenderTargetViews,
    		__out_opt  ID3D11DepthStencilView **ppDepthStencilView,
    		__in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 )  UINT UAVStartSlot,
    		__in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - UAVStartSlot )  UINT NumUAVs,
    		__out_ecount_opt(NumUAVs)  ID3D11UnorderedAccessView **ppUnorderedAccessViews)
    	{
    		this->_real->OMGetRenderTargetsAndUnorderedAccessViews(NumRTVs, ppRenderTargetViews, ppDepthStencilView, UAVStartSlot, NumUAVs, ppUnorderedAccessViews);
    	}
            
    	virtual void STDMETHODCALLTYPE OMGetBlendState( 
    		__out_opt  ID3D11BlendState **ppBlendState,
    		__out_opt  FLOAT BlendFactor[ 4 ],
    		__out_opt  UINT *pSampleMask)
    	{
    		this->_real->OMGetBlendState(ppBlendState, BlendFactor, pSampleMask);
    	}
            
    	virtual void STDMETHODCALLTYPE OMGetDepthStencilState( 
    		__out_opt  ID3D11DepthStencilState **ppDepthStencilState,
    		__out_opt  UINT *pStencilRef)
    	{
    		this->_real->OMGetDepthStencilState(ppDepthStencilState, pStencilRef);
    	}
            
    	virtual void STDMETHODCALLTYPE SOGetTargets( 
    		__in_range( 0, D3D11_SO_BUFFER_SLOT_COUNT )  UINT NumBuffers,
    		__out_ecount(NumBuffers)  ID3D11Buffer **ppSOTargets)
    	{
    		this->_real->SOGetTargets(NumBuffers, ppSOTargets);
    	}
            
    	virtual void STDMETHODCALLTYPE RSGetState( 
    		__out  ID3D11RasterizerState **ppRasterizerState)
    	{
    		this->_real->RSGetState(ppRasterizerState);
    	}
            
    	virtual void STDMETHODCALLTYPE RSGetViewports( 
    		__inout /*_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/   UINT *pNumViewports,
    		__out_ecount_opt(*pNumViewports)  D3D11_VIEWPORT *pViewports)
    	{
    		this->_real->RSGetViewports(pNumViewports, pViewports);
    	}
            
    	virtual void STDMETHODCALLTYPE RSGetScissorRects( 
    		__inout /*_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/   UINT *pNumRects,
    		__out_ecount_opt(*pNumRects)  D3D11_RECT *pRects)
    	{
    		this->_real->RSGetScissorRects(pNumRects, pRects);
    	}
            
    	virtual void STDMETHODCALLTYPE HSGetShaderResources( 
    		__in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot )  UINT NumViews,
    		__out_ecount(NumViews)  ID3D11ShaderResourceView **ppShaderResourceViews)
    	{
    		this->_real->HSGetShaderResources(StartSlot, NumViews, ppShaderResourceViews);
    	}
            
    	virtual void STDMETHODCALLTYPE HSGetShader( 
    		__out_opt  ID3D11HullShader **ppHullShader,
    		__out_ecount_opt(*pNumClassInstances)  ID3D11ClassInstance **ppClassInstances,
    		__inout_opt  UINT *pNumClassInstances)
    	{
    		this->_real->HSGetShader(ppHullShader, ppClassInstances, pNumClassInstances);
    	}
            
    	virtual void STDMETHODCALLTYPE HSGetSamplers( 
    		__in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot )  UINT NumSamplers,
    		__out_ecount(NumSamplers)  ID3D11SamplerState **ppSamplers)
    	{
    		this->_real->HSGetSamplers(StartSlot, NumSamplers, ppSamplers);
    	}
            
    	virtual void STDMETHODCALLTYPE HSGetConstantBuffers( 
    		__in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot )  UINT NumBuffers,
    		__out_ecount(NumBuffers)  ID3D11Buffer **ppConstantBuffers)
    	{
    		this->_real->HSGetConstantBuffers(StartSlot, NumBuffers, ppConstantBuffers);
    	}
            
    	virtual void STDMETHODCALLTYPE DSGetShaderResources( 
    		__in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot )  UINT NumViews,
    		__out_ecount(NumViews)  ID3D11ShaderResourceView **ppShaderResourceViews)
    	{
    		this->_real->DSGetShaderResources(StartSlot, NumViews, ppShaderResourceViews);
    	}
            
    	virtual void STDMETHODCALLTYPE DSGetShader( 
    		__out_opt  ID3D11DomainShader **ppDomainShader,
    		__out_ecount_opt(*pNumClassInstances)  ID3D11ClassInstance **ppClassInstances,
    		__inout_opt  UINT *pNumClassInstances)
    	{
    		this->_real->DSGetShader(ppDomainShader, ppClassInstances, pNumClassInstances);
    	}
            
    	virtual void STDMETHODCALLTYPE DSGetSamplers( 
    		__in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot )  UINT NumSamplers,
    		__out_ecount(NumSamplers)  ID3D11SamplerState **ppSamplers)
    	{
    		this->_real->DSGetSamplers(StartSlot, NumSamplers, ppSamplers);
    	}
            
    	virtual void STDMETHODCALLTYPE DSGetConstantBuffers( 
    		__in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot )  UINT NumBuffers,
    		__out_ecount(NumBuffers)  ID3D11Buffer **ppConstantBuffers)
    	{
    		this->_real->DSGetConstantBuffers(StartSlot, NumBuffers, ppConstantBuffers);
    	}
            
    	virtual void STDMETHODCALLTYPE CSGetShaderResources( 
    		__in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot )  UINT NumViews,
    		__out_ecount(NumViews)  ID3D11ShaderResourceView **ppShaderResourceViews)
    	{
    		this->_real->CSGetShaderResources(StartSlot, NumViews, ppShaderResourceViews);
    	}
            
    	virtual void STDMETHODCALLTYPE CSGetUnorderedAccessViews( 
    		__in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - StartSlot )  UINT NumUAVs,
    		__out_ecount(NumUAVs)  ID3D11UnorderedAccessView **ppUnorderedAccessViews)
    	{
    		this->_real->CSGetUnorderedAccessViews(StartSlot, NumUAVs, ppUnorderedAccessViews);
    	}
            
    	virtual void STDMETHODCALLTYPE CSGetShader( 
    		__out_opt  ID3D11ComputeShader **ppComputeShader,
    		__out_ecount_opt(*pNumClassInstances)  ID3D11ClassInstance **ppClassInstances,
    		__inout_opt  UINT *pNumClassInstances)
    	{
    		this->_real->CSGetShader(ppComputeShader, ppClassInstances, pNumClassInstances);
    	}
            
    	virtual void STDMETHODCALLTYPE CSGetSamplers( 
    		__in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot )  UINT NumSamplers,
    		__out_ecount(NumSamplers)  ID3D11SamplerState **ppSamplers)
    	{
    		this->_real->CSGetSamplers(StartSlot, NumSamplers, ppSamplers);
    	}
            
    	virtual void STDMETHODCALLTYPE CSGetConstantBuffers( 
    		__in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 )  UINT StartSlot,
    		__in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot )  UINT NumBuffers,
    		__out_ecount(NumBuffers)  ID3D11Buffer **ppConstantBuffers)
    	{
    		this->_real->CSGetConstantBuffers(StartSlot, NumBuffers, ppConstantBuffers);
    	}
            
    	virtual void STDMETHODCALLTYPE ClearState()
    	{
    		this->_real->ClearState();
    	}
            
    	virtual void STDMETHODCALLTYPE Flush()
    	{
    		this->_real->Flush();
    	}
            
    	virtual D3D11_DEVICE_CONTEXT_TYPE STDMETHODCALLTYPE GetType()
    	{
    		return this->_real->GetType();
    	}
            
    	virtual UINT STDMETHODCALLTYPE GetContextFlags()
    	{
    		return this->_real->GetContextFlags();
    	}
            
    	virtual HRESULT STDMETHODCALLTYPE FinishCommandList( 
    		BOOL RestoreDeferredContextState,
    		__out_opt  ID3D11CommandList **ppCommandList)
    	{
    		return this->_real->FinishCommandList(RestoreDeferredContextState, ppCommandList);
    	}
    
    
    	//ID3D11DeviceChild
    
        virtual void STDMETHODCALLTYPE GetDevice( 
            /* [annotation] */ 
            __out  ID3D11Device **ppDevice)
    	{
    		this->_real->GetDevice(ppDevice);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE GetPrivateData( 
            /* [annotation] */ 
            __in  REFGUID guid,
            /* [annotation] */ 
            __inout  UINT *pDataSize,
            /* [annotation] */ 
            __out_bcount_opt( *pDataSize )  void *pData)
    	{
    		return this->_real->GetPrivateData(guid, pDataSize, pData);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE SetPrivateData( 
            /* [annotation] */ 
            __in  REFGUID guid,
            /* [annotation] */ 
            __in  UINT DataSize,
            /* [annotation] */ 
            __in_bcount_opt( DataSize )  const void *pData)
    	{
    		return this->_real->SetPrivateData(guid, DataSize, pData);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface( 
            /* [annotation] */ 
            __in  REFGUID guid,
            /* [annotation] */ 
            __in_opt  const IUnknown *pData)
    	{
    		return this->_real->SetPrivateDataInterface(guid, pData);
    	}
    
    	//IUnknown
    	virtual HRESULT STDMETHODCALLTYPE QueryInterface( 
            /* [in] */ REFIID riid,
            /* [iid_is][out] */ __RPC__deref_out void __RPC_FAR *__RPC_FAR *ppvObject)
    	{
    		return this->_real->QueryInterface(riid, ppvObject);
    	}
    
        virtual ULONG STDMETHODCALLTYPE AddRef( void)
    	{
    		return this->_real->AddRef();
    	}
    
        virtual ULONG STDMETHODCALLTYPE Release( void)
    	{
    		ULONG result = this->_real->Release();
    		if (0 == result)
    		{
    			delete this;
    		}
    		return result;
    	}
    };
    Last edited by bad6oy30; 03-02-2011 at 08:34 PM. Reason: Removed destructor, destroying in Release()

    D3D11DeviceContext wrapper
  2. #2
    bad6oy30's Avatar Member Authenticator enabled
    Reputation
    1
    Join Date
    Dec 2010
    Posts
    41
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And ID3D11Device:

    Code:
    #pragma once
    
    #include <Windows.h>
    #include <d3d11.h>
    
    class MyD3D11Device: public ID3D11Device
    {
    private:
    	ID3D11Device* const _real;
    public:
    	MyD3D11Device(ID3D11Device* real)
    		: _real(real)
    	{
    	}
    
    	//ID3D11Device
    
    	virtual HRESULT STDMETHODCALLTYPE CreateBuffer( 
            __in  const D3D11_BUFFER_DESC *pDesc,
            __in_opt  const D3D11_SUBRESOURCE_DATA *pInitialData,
            __out_opt  ID3D11Buffer **ppBuffer)
    	{
    		return this->_real->CreateBuffer(pDesc, pInitialData, ppBuffer);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE CreateTexture1D( 
            __in  const D3D11_TEXTURE1D_DESC *pDesc,
            __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize)  const D3D11_SUBRESOURCE_DATA *pInitialData,
            __out_opt  ID3D11Texture1D **ppTexture1D)
    	{
    		return this->_real->CreateTexture1D(pDesc, pInitialData, ppTexture1D);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE CreateTexture2D( 
            __in  const D3D11_TEXTURE2D_DESC *pDesc,
            __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize)  const D3D11_SUBRESOURCE_DATA *pInitialData,
            __out_opt  ID3D11Texture2D **ppTexture2D)
    	{
    		return this->_real->CreateTexture2D(pDesc, pInitialData, ppTexture2D);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE CreateTexture3D( 
            __in  const D3D11_TEXTURE3D_DESC *pDesc,
            __in_xcount_opt(pDesc->MipLevels)  const D3D11_SUBRESOURCE_DATA *pInitialData,
            __out_opt  ID3D11Texture3D **ppTexture3D)
    	{
    		return this->_real->CreateTexture3D(pDesc, pInitialData, ppTexture3D);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE CreateShaderResourceView( 
            __in  ID3D11Resource *pResource,
            __in_opt  const D3D11_SHADER_RESOURCE_VIEW_DESC *pDesc,
            __out_opt  ID3D11ShaderResourceView **ppSRView)
    	{
    		return this->_real->CreateShaderResourceView(pResource, pDesc, ppSRView);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE CreateUnorderedAccessView( 
            __in  ID3D11Resource *pResource,
            __in_opt  const D3D11_UNORDERED_ACCESS_VIEW_DESC *pDesc,
            __out_opt  ID3D11UnorderedAccessView **ppUAView)
    	{
    		return this->_real->CreateUnorderedAccessView(pResource, pDesc, ppUAView);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE CreateRenderTargetView( 
            __in  ID3D11Resource *pResource,
            __in_opt  const D3D11_RENDER_TARGET_VIEW_DESC *pDesc,
            __out_opt  ID3D11RenderTargetView **ppRTView)
    	{
    		return this->_real->CreateRenderTargetView(pResource, pDesc, ppRTView);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE CreateDepthStencilView( 
            __in  ID3D11Resource *pResource,
            __in_opt  const D3D11_DEPTH_STENCIL_VIEW_DESC *pDesc,
            __out_opt  ID3D11DepthStencilView **ppDepthStencilView)
    	{
    		return this->_real->CreateDepthStencilView(pResource, pDesc, ppDepthStencilView);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE CreateInputLayout( 
            __in_ecount(NumElements)  const D3D11_INPUT_ELEMENT_DESC *pInputElementDescs,
            __in_range( 0, D3D11_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT )  UINT NumElements,
            __in  const void *pShaderBytecodeWithInputSignature,
            __in  SIZE_T BytecodeLength,
            __out_opt  ID3D11InputLayout **ppInputLayout)
    	{
    		return this->_real->CreateInputLayout(pInputElementDescs, NumElements, pShaderBytecodeWithInputSignature, BytecodeLength, ppInputLayout);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE CreateVertexShader( 
            __in  const void *pShaderBytecode,
            __in  SIZE_T BytecodeLength,
            __in_opt  ID3D11ClassLinkage *pClassLinkage,
            __out_opt  ID3D11VertexShader **ppVertexShader)
    	{
    		return this->_real->CreateVertexShader(pShaderBytecode, BytecodeLength, pClassLinkage, ppVertexShader);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE CreateGeometryShader( 
            __in  const void *pShaderBytecode,
            __in  SIZE_T BytecodeLength,
            __in_opt  ID3D11ClassLinkage *pClassLinkage,
            __out_opt  ID3D11GeometryShader **ppGeometryShader)
    	{
    		return this->_real->CreateGeometryShader(pShaderBytecode, BytecodeLength, pClassLinkage, ppGeometryShader);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE CreateGeometryShaderWithStreamOutput( 
            __in  const void *pShaderBytecode,
            __in  SIZE_T BytecodeLength,
            __in_ecount_opt(NumEntries)  const D3D11_SO_DECLARATION_ENTRY *pSODeclaration,
            __in_range( 0, D3D11_SO_STREAM_COUNT * D3D11_SO_OUTPUT_COMPONENT_COUNT )  UINT NumEntries,
            __in_ecount_opt(NumStrides)  const UINT *pBufferStrides,
            __in_range( 0, D3D11_SO_BUFFER_SLOT_COUNT )  UINT NumStrides,
            __in  UINT RasterizedStream,
            __in_opt  ID3D11ClassLinkage *pClassLinkage,
            __out_opt  ID3D11GeometryShader **ppGeometryShader)
    	{
    		return this->_real->CreateGeometryShaderWithStreamOutput(pShaderBytecode, BytecodeLength, pSODeclaration, NumEntries, pBufferStrides, NumStrides, RasterizedStream, pClassLinkage, ppGeometryShader);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE CreatePixelShader( 
            __in  const void *pShaderBytecode,
            __in  SIZE_T BytecodeLength,
            __in_opt  ID3D11ClassLinkage *pClassLinkage,
            __out_opt  ID3D11PixelShader **ppPixelShader)
    	{
    		return this->_real->CreatePixelShader(pShaderBytecode, BytecodeLength, pClassLinkage, ppPixelShader);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE CreateHullShader( 
            __in  const void *pShaderBytecode,
            __in  SIZE_T BytecodeLength,
            __in_opt  ID3D11ClassLinkage *pClassLinkage,
            __out_opt  ID3D11HullShader **ppHullShader)
    	{
    		return this->_real->CreateHullShader(pShaderBytecode, BytecodeLength, pClassLinkage, ppHullShader);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE CreateDomainShader( 
            __in  const void *pShaderBytecode,
            __in  SIZE_T BytecodeLength,
            __in_opt  ID3D11ClassLinkage *pClassLinkage,
            __out_opt  ID3D11DomainShader **ppDomainShader)
    	{
    		return this->_real->CreateDomainShader(pShaderBytecode, BytecodeLength, pClassLinkage, ppDomainShader);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE CreateComputeShader( 
            __in  const void *pShaderBytecode,
            __in  SIZE_T BytecodeLength,
            __in_opt  ID3D11ClassLinkage *pClassLinkage,
            __out_opt  ID3D11ComputeShader **ppComputeShader)
    	{
    		return this->_real->CreateComputeShader(pShaderBytecode, BytecodeLength, pClassLinkage, ppComputeShader);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE CreateClassLinkage( 
            __out  ID3D11ClassLinkage **ppLinkage)
    	{
    		return this->_real->CreateClassLinkage(ppLinkage);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE CreateBlendState( 
            __in  const D3D11_BLEND_DESC *pBlendStateDesc,
            __out_opt  ID3D11BlendState **ppBlendState)
    	{
    		return this->_real->CreateBlendState(pBlendStateDesc, ppBlendState);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE CreateDepthStencilState( 
            __in  const D3D11_DEPTH_STENCIL_DESC *pDepthStencilDesc,
            __out_opt  ID3D11DepthStencilState **ppDepthStencilState)
    	{
    		return this->_real->CreateDepthStencilState(pDepthStencilDesc, ppDepthStencilState);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE CreateRasterizerState( 
            __in  const D3D11_RASTERIZER_DESC *pRasterizerDesc,
            __out_opt  ID3D11RasterizerState **ppRasterizerState)
    	{
    		return this->_real->CreateRasterizerState(pRasterizerDesc, ppRasterizerState);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE CreateSamplerState( 
            __in  const D3D11_SAMPLER_DESC *pSamplerDesc,
            __out_opt  ID3D11SamplerState **ppSamplerState)
    	{
    		return this->_real->CreateSamplerState(pSamplerDesc, ppSamplerState);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE CreateQuery( 
            __in  const D3D11_QUERY_DESC *pQueryDesc,
            __out_opt  ID3D11Query **ppQuery)
    	{
    		return this->_real->CreateQuery(pQueryDesc, ppQuery);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE CreatePredicate( 
            __in  const D3D11_QUERY_DESC *pPredicateDesc,
            __out_opt  ID3D11Predicate **ppPredicate)
    	{
    		return this->_real->CreatePredicate(pPredicateDesc, ppPredicate);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE CreateCounter( 
            __in  const D3D11_COUNTER_DESC *pCounterDesc,
            __out_opt  ID3D11Counter **ppCounter)
    	{
    		return this->_real->CreateCounter(pCounterDesc, ppCounter);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE CreateDeferredContext( 
            UINT ContextFlags,
            __out_opt  ID3D11DeviceContext **ppDeferredContext)
    	{
    		return this->_real->CreateDeferredContext(ContextFlags, ppDeferredContext);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE OpenSharedResource( 
            __in  HANDLE hResource,
            __in  REFIID ReturnedInterface,
            __out_opt  void **ppResource)
    	{
    		return this->_real->OpenSharedResource(hResource, ReturnedInterface, ppResource);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE CheckFormatSupport( 
            __in  DXGI_FORMAT Format,
            __out  UINT *pFormatSupport)
    	{
    		return this->_real->CheckFormatSupport(Format, pFormatSupport);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE CheckMultisampleQualityLevels( 
            __in  DXGI_FORMAT Format,
            __in  UINT SampleCount,
            __out  UINT *pNumQualityLevels)
    	{
    		return this->_real->CheckMultisampleQualityLevels(Format, SampleCount, pNumQualityLevels);
    	}
            
        virtual void STDMETHODCALLTYPE CheckCounterInfo( 
            __out  D3D11_COUNTER_INFO *pCounterInfo)
    	{
    		return this->_real->CheckCounterInfo(pCounterInfo);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE CheckCounter( 
            __in  const D3D11_COUNTER_DESC *pDesc,
            __out  D3D11_COUNTER_TYPE *pType,
            __out  UINT *pActiveCounters,
            __out_ecount_opt(*pNameLength)  LPSTR szName,
            __inout_opt  UINT *pNameLength,
            __out_ecount_opt(*pUnitsLength)  LPSTR szUnits,
            __inout_opt  UINT *pUnitsLength,
            __out_ecount_opt(*pDescriptionLength)  LPSTR szDescription,
            __inout_opt  UINT *pDescriptionLength)
    	{
    		return this->_real->CheckCounter(pDesc, pType, pActiveCounters, szName, pNameLength, szUnits, pUnitsLength, szDescription, pDescriptionLength);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE CheckFeatureSupport( 
            D3D11_FEATURE Feature,
            __out_bcount(FeatureSupportDataSize)  void *pFeatureSupportData,
            UINT FeatureSupportDataSize)
    	{
    		return this->_real->CheckFeatureSupport(Feature, pFeatureSupportData, FeatureSupportDataSize);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE GetPrivateData( 
            __in  REFGUID guid,
            __inout  UINT *pDataSize,
            __out_bcount_opt(*pDataSize)  void *pData)
    	{
    		return this->_real->GetPrivateData(guid, pDataSize, pData);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE SetPrivateData( 
            __in  REFGUID guid,
            __in  UINT DataSize,
            __in_bcount_opt(DataSize)  const void *pData)
    	{
    		return this->_real->SetPrivateData(guid, DataSize, pData);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface( 
            __in  REFGUID guid,
            __in_opt  const IUnknown *pData)
    	{
    		return this->_real->SetPrivateDataInterface(guid, pData);
    	}
            
        virtual D3D_FEATURE_LEVEL STDMETHODCALLTYPE GetFeatureLevel( void)
    	{
    		return this->_real->GetFeatureLevel();
    	}
            
        virtual UINT STDMETHODCALLTYPE GetCreationFlags( void)
    	{
    		return this->_real->GetCreationFlags();
    	}
            
        virtual HRESULT STDMETHODCALLTYPE GetDeviceRemovedReason( void)
    	{
    		return this->_real->GetDeviceRemovedReason();
    	}
            
        virtual void STDMETHODCALLTYPE GetImmediateContext( 
            __out  ID3D11DeviceContext **ppImmediateContext)
    	{
    		return this->_real->GetImmediateContext(ppImmediateContext);
    	}
            
        virtual HRESULT STDMETHODCALLTYPE SetExceptionMode( 
            UINT RaiseFlags)
    	{
    		return this->_real->SetExceptionMode(RaiseFlags);
    	}
            
        virtual UINT STDMETHODCALLTYPE GetExceptionMode()
    	{
    		return this->_real->GetExceptionMode();
    	}
    
    	//IUnknown
    
    	virtual HRESULT STDMETHODCALLTYPE QueryInterface( 
    		REFIID riid,
            __RPC__deref_out void __RPC_FAR *__RPC_FAR *ppvObject)
    	{
    		return this->_real->QueryInterface(riid, ppvObject);
    	}
    
        virtual ULONG STDMETHODCALLTYPE AddRef()
    	{
    		return this->_real->AddRef();
    	}
    
        virtual ULONG STDMETHODCALLTYPE Release( void)
    	{
    		ULONG result = this->_real->Release();
    		if (0 == result)
    		{
    			delete this;
    		}
    		return result;
    	}
    };
    Last edited by bad6oy30; 03-02-2011 at 08:34 PM. Reason: Really removed destructor, destroying on Release()

  3. #3
    PowerBoosting's Avatar Member Professional Boosters CoreCoins Purchaser Authenticator enabled
    Reputation
    7
    Join Date
    Mar 2009
    Posts
    52
    Thanks G/R
    0/1
    Trade Feedback
    4 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Awesome!
    Thanks a lot!
    +Rep

  4. #4
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1358
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Errr, why are you calling 'delete' on the object in your destructor?

    1. You didn't allocate it, so there's no guarantee it's even going to be on the same CRT heap as you're using. Meaning that could easily cause a hard-crash.
    2. It's a COM object... You need to handle resource management differently. Hint: IUnknown::Release Method (COM) IUnknown::AddRef Method (COM)

    Also, marking the destructor as virtual is redundant. The BASE class destructor should be virtual. Unless you actually intend to inherit again from your wrapper class, then treat them polymorphically, it's not going to accomplish anything.

  5. #5
    bad6oy30's Avatar Member Authenticator enabled
    Reputation
    1
    Join Date
    Dec 2010
    Posts
    41
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes... deleting the constructor-passed pointer... that's not right, especially since I'm passing through the Release

    virtual destructor, just my habit. It's the sort of thing I fix up at the end of a project when I'm all done inheriting. Worse things in the world than an unused v-table. Do you at least admire the const?

    @Tourist: as far as wow goes, using a wrapping method, I can't see any swap chain being made. I proxied D3D11CreateDeviceAndSwapChain and wrapped IDXGIFactory::CreateSwapChain and saw no calls. Cypher saw similar results, but he sees calls by detouring... I believe on IDXGIFactory::CreateSwapChain.

    That said, I figure if you're going to detour once, you might as well go all out... no sense in wrapping D3D11 interfaces and detouring IDXGIFactory. I learned a ton about detours just from Cypher's HadesD3D11/Hooker.cpp. It has a few magic numbers in it however, but he's spite-locked into keeping them.

    ---------- Post added at 09:37 PM ---------- Previous post was at 08:45 PM ----------

    I've addressed the destructor issue, it should now free properly in Release()

    ---------- Post added at 09:51 PM ---------- Previous post was at 09:37 PM ----------

    One last caveat, the wrapper should be heap allocated, ie using MyD3D11DeviceContext* wrapped = new MyD3D11DeviceContext(real);. I can't conceive why, but if you did:

    MyD3D11DeviceContext devCon(theRealDevContext);
    // do some stuff
    devCon.Release()
    // and then go out of scope... dtor called on invalid object, no good

    Just in case you were gonna keep the thing in scope as a static or something and pass it .... by ref... but to you'd need the real devcon at compile tim... you'd declare it in the proxied call, but returning the ref puts it out of scope anyway... make it an ctor-initialized field in a class owned by a thread... there. Don't do that.
    Last edited by bad6oy30; 03-02-2011 at 08:04 PM. Reason: Just noticed reply by tourist

  6. #6
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1358
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by bad6oy30 View Post
    [SNIP]
    That said, I figure if you're going to detour once, you might as well go all out... no sense in wrapping D3D11 interfaces and detouring IDXGIFactory. I learned a ton about detours just from Cypher's HadesD3D11/Hooker.cpp. It has a few magic numbers in it however, but he's spite-locked into keeping them.
    As I already pointed out in another thread the example you gave of a 'magic number' is stupid because the left hand side of the statement tells you exactly what the number is. It's not simply a constant passed as an unnamed function parameter. Learn to read code please.


    Originally Posted by bad6oy30 View Post
    [SNIP]Just in case you were gonna keep the thing in scope as a static or something and pass it .... by ref... but to you'd need the real devcon at compile tim... you'd declare it in the proxied call, but returning the ref puts it out of scope anyway... make it an ctor-initialized field in a class owned by a thread... there. Don't do that.
    ...

    No comment.

Similar Threads

  1. C# Lua Wrapper (No ASM, Requires injected CLR)
    By Apoc in forum WoW Memory Editing
    Replies: 29
    Last Post: 02-04-2011, 02:52 PM
  2. [C#] aHook wrapper
    By Nesox in forum WoW Memory Editing
    Replies: 5
    Last Post: 01-13-2010, 07:08 AM
  3. PeLib - A PE File Format Wrapper
    By Cypher in forum WoW Memory Editing
    Replies: 13
    Last Post: 11-08-2009, 06:26 PM
  4. empty wrapper?
    By catakliss in forum WoW EMU Exploits & Bugs
    Replies: 1
    Last Post: 01-18-2008, 07:33 AM
All times are GMT -5. The time now is 01:06 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search