void APIENTRY RosUmdDeviceDdi::DdiStagingResourceMap(
    D3D10DDI_HDEVICE hDevice,
    D3D10DDI_HRESOURCE hResource,
    UINT subResource,
    D3D10_DDI_MAP mapType,
    UINT mapFlags,
    D3D10DDI_MAPPED_SUBRESOURCE* pMappedSubRes)
{
    RosUmdLogging::Entry(__FUNCTION__);

    RosUmdDevice* pRosUmdDevice = RosUmdDevice::CastFrom(hDevice);
    RosUmdResource * pResource = (RosUmdResource *)hResource.pDrvPrivate;

    try
    {
        pRosUmdDevice->StagingResourceMap(pResource, subResource, mapType, mapFlags, pMappedSubRes);
    }

    catch (std::exception & e)
    {
        pRosUmdDevice->SetException(e);
    }

    RosUmdLogging::Exit(__FUNCTION__);
}
void APIENTRY RosUmdDeviceDdi::DdiCreateResource(
    D3D10DDI_HDEVICE hDevice,
    const D3D11DDIARG_CREATERESOURCE* pCreateResource,
    D3D10DDI_HRESOURCE hResource,
    D3D10DDI_HRTRESOURCE hRTResource)
{
    RosUmdLogging::Entry(__FUNCTION__);

    RosUmdDevice* pRosUmdDevice = RosUmdDevice::CastFrom(hDevice);

    try {
        pRosUmdDevice->CreateResource(pCreateResource, hResource, hRTResource);
    }

    catch (std::exception & e)
    {
        pRosUmdDevice->SetException(e);
    }

    RosUmdLogging::Exit(__FUNCTION__);
}
void APIENTRY RosUmdDeviceDdi::DdiStagingResourceUnmap(
    D3D10DDI_HDEVICE hDevice,
    D3D10DDI_HRESOURCE hResource,
    UINT subResource)
{
    RosUmdLogging::Entry(__FUNCTION__);

    RosUmdDevice* pRosUmdDevice = RosUmdDevice::CastFrom(hDevice);
    RosUmdResource * pResource = (RosUmdResource *)hResource.pDrvPrivate;

    try
    {
        pRosUmdDevice->StagingResourceUnmap(pResource, subResource);
    }

    catch (std::exception & e)
    {
        pRosUmdDevice->SetException(e);
    }

    RosUmdLogging::Exit(__FUNCTION__);
}
void APIENTRY RosUmdDeviceDdi::DdiCreateComputeShader(
    D3D10DDI_HDEVICE hDevice,
    const UINT* pCode,
    D3D10DDI_HSHADER hShader,
    D3D10DDI_HRTSHADER hRTShader)
{
    RosUmdLogging::Entry(__FUNCTION__);

    RosUmdDevice * pRosUmdDevice = RosUmdDevice::CastFrom(hDevice);

    try
    {
        pRosUmdDevice->CreateComputeShader(pCode, hShader, hRTShader);
    }

    catch (std::exception & e)
    {
        pRosUmdDevice->SetException(e);
    }

    RosUmdLogging::Exit(__FUNCTION__);
}
BOOL APIENTRY RosUmdDeviceDdi::DdiFlush(D3D10DDI_HDEVICE hDevice, UINT flushFlags)
{
    RosUmdLogging::Entry(__FUNCTION__);

    RosUmdDevice* pRosUmdDevice = RosUmdDevice::CastFrom(hDevice);

    BOOL bSuccess = TRUE;

    try
    {
        pRosUmdDevice->m_commandBuffer.Flush(flushFlags);
    }

    catch (std::exception & e)
    {
        pRosUmdDevice->SetException(e);
        bSuccess = FALSE;
    }

    RosUmdLogging::Exit(__FUNCTION__);

    return bSuccess;
}
void APIENTRY RosUmdDeviceDdi::DdiResourceCopy(
    D3D10DDI_HDEVICE hDevice,
    D3D10DDI_HRESOURCE hDestinationResource,
    D3D10DDI_HRESOURCE hSourceResource)
{
    RosUmdLogging::Entry(__FUNCTION__);

    RosUmdDevice* pRosUmdDevice = RosUmdDevice::CastFrom(hDevice);
    RosUmdResource * pDestinationResource = (RosUmdResource *)hDestinationResource.pDrvPrivate;
    RosUmdResource * pSourceResource = (RosUmdResource *)hSourceResource.pDrvPrivate;

    try
    {
        pRosUmdDevice->ResourceCopy(pDestinationResource, pSourceResource);
    }

    catch (std::exception & e)
    {
        pRosUmdDevice->SetException(e);
    }

    RosUmdLogging::Exit(__FUNCTION__);
}
void APIENTRY RosUmdDeviceDdi::DdiCreateDomainShader(
    D3D10DDI_HDEVICE hDevice,
    const UINT* pCode,
    D3D10DDI_HSHADER hShader,
    D3D10DDI_HRTSHADER hRTShader,
    const D3D11_1DDIARG_TESSELLATION_IO_SIGNATURES* pSignatures)
{ 
    RosUmdLogging::Entry(__FUNCTION__);

    RosUmdDevice * pRosUmdDevice = RosUmdDevice::CastFrom(hDevice);

    try
    {
        pRosUmdDevice->CreateTessellationShader(pCode, hShader, hRTShader, pSignatures, D3D11_SB_DOMAIN_SHADER);
    }

    catch (std::exception & e)
    {
        pRosUmdDevice->SetException(e);
    }

    RosUmdLogging::Exit(__FUNCTION__);
}
void APIENTRY RosUmdDeviceDdi::DdiCreateGeometryShader(
    D3D10DDI_HDEVICE hDevice,
    const UINT* pCode,
    D3D10DDI_HSHADER hShader,
    D3D10DDI_HRTSHADER hRTShader,
    const D3D11_1DDIARG_STAGE_IO_SIGNATURES* pSignatures)
{
    RosUmdLogging::Entry(__FUNCTION__);

    RosUmdDevice * pRosUmdDevice = RosUmdDevice::CastFrom(hDevice);

    try
    {
        pRosUmdDevice->CreateGeometryShader(pCode, hShader, hRTShader, pSignatures);
    }

    catch (std::exception & e)
    {
        pRosUmdDevice->SetException(e);
    }

    RosUmdLogging::Exit(__FUNCTION__);
}