def invokeMethod(self, interface, base, method): DllTracer.invokeMethod(self, interface, base, method) # When D2D is used on top of WARP software rasterizer it seems to do # most of its rendering via the undocumented and opaque IWarpPrivateAPI # interface. Althought hiding this interface will affect behavior, # there's little point in traces that use it, as they lack enough # information to replay correctly. # # Returning E_NOINTERFACE when for IID_IWarpPrivateAPI matches what # happens when D2D is used with drivers other than WARP. if method.name == 'QueryInterface': print r' if (_result == S_OK && riid == IID_IWarpPrivateAPI && ppvObj && *ppvObj) {' print r' static_cast<IUnknown *>(*ppvObj)->Release();' print r' *ppvObj = nullptr;' print r' _result = E_NOINTERFACE;' print r' os::log("apitrace: warning: hiding IWarpPrivateAPI interface\n");' print r' }' # Ensure buffers are initialized, otherwise we can fail to detect # changes when unititialized data matches what the app wrote. if method.name == 'CreateBuffer': print r' if (SUCCEEDED(_result) && !pInitialData) {' print r' _initializeBuffer(_this, pDesc, *ppBuffer);' print r' }'
def invokeMethod(self, interface, base, method): if method.name == 'CreateBuffer': if interface.name.startswith('ID3D11'): print(r' D3D11_SUBRESOURCE_DATA initialData;') else: print(r' D3D10_SUBRESOURCE_DATA initialData;') print(r' if (!pInitialData) {') print(r' pInitialData = &initialData;') print(r' _initialBufferAlloc(pDesc, &initialData);') print(r' }') DllTracer.invokeMethod(self, interface, base, method) # When D2D is used on top of WARP software rasterizer it seems to do # most of its rendering via the undocumented and opaque IWarpPrivateAPI # interface. Althought hiding this interface will affect behavior, # there's little point in traces that use it, as they lack enough # information to replay correctly. # # Returning E_NOINTERFACE when for IID_IWarpPrivateAPI matches what # happens when D2D is used with drivers other than WARP. if method.name == 'QueryInterface': print( r' if (_result == S_OK && riid == IID_IWarpPrivateAPI && ppvObj && *ppvObj) {' ) print(r' static_cast<IUnknown *>(*ppvObj)->Release();') print(r' *ppvObj = nullptr;') print(r' _result = E_NOINTERFACE;') print( r' os::log("apitrace: warning: hiding IWarpPrivateAPI interface\n");' ) print(r' }') if interface.name.startswith( 'ID3D11Device') and method.name == 'CheckFeatureSupport': print(r' if (FORCE_D3D_FEATURE_LEVEL_11_0 &&') print(r' _result == S_OK &&') print(r' Feature >= D3D11_FEATURE_D3D11_OPTIONS) {') print( r' ZeroMemory(pFeatureSupportData, FeatureSupportDataSize);' ) print(r' }') if method.name == 'CheckMultisampleQualityLevels': print(r' if (FORCE_D3D_FEATURE_LEVEL_11_0 &&') print(r' _result == S_OK &&') print(r' pNumQualityLevels && *pNumQualityLevels > 1) {') print(r' *pNumQualityLevels = 1;') print(r' }') # Ensure buffers are initialized, otherwise we can fail to detect # changes when unititialized data matches what the app wrote. if method.name == 'CreateBuffer': print(r' if (pInitialData == &initialData) {') print(r' _initialBufferFree(&initialData);') print(r' }')
def invokeMethod(self, interface, base, method): DllTracer.invokeMethod(self, interface, base, method) # When D2D is used on top of WARP software rasterizer it seems to do # most of its rendering via the undocumented and opaque IWarpPrivateAPI # interface. Althought hiding this interface will affect behavior, # there's little point in traces that use it, as they lack enough # information to replay correctly. # # Returning E_NOINTERFACE when for IID_IWarpPrivateAPI matches what # happens when D2D is used with drivers other than WARP. if method.name == 'QueryInterface': print r' if (_result == S_OK && riid == IID_IWarpPrivateAPI && ppvObj && *ppvObj) {' print r' static_cast<IUnknown *>(*ppvObj)->Release();' print r' *ppvObj = nullptr;' print r' _result = E_NOINTERFACE;' print r' os::log("apitrace: warning: hiding IWarpPrivateAPI interface\n");' print r' }'