当前位置: 首页>>代码示例>>Python>>正文


Python DllRetracer.invokeFunction方法代码示例

本文整理汇总了Python中dllretrace.DllRetracer.invokeFunction方法的典型用法代码示例。如果您正苦于以下问题:Python DllRetracer.invokeFunction方法的具体用法?Python DllRetracer.invokeFunction怎么用?Python DllRetracer.invokeFunction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在dllretrace.DllRetracer的用法示例。


在下文中一共展示了DllRetracer.invokeFunction方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: invokeFunction

# 需要导入模块: from dllretrace import DllRetracer [as 别名]
# 或者: from dllretrace.DllRetracer import invokeFunction [as 别名]
    def invokeFunction(self, function):
        if function.name in self.createDeviceFunctionNames:
            # create windows as neccessary
            if 'pSwapChainDesc' in function.argNames():
                print r'    d3dretrace::createWindowForSwapChain(pSwapChainDesc);'

            # Compensate for the fact we don't trace DXGI object creation
            if function.name.startswith('D3D11CreateDevice'):
                print r'    if (DriverType == D3D_DRIVER_TYPE_UNKNOWN && !pAdapter) {'
                print r'        DriverType = D3D_DRIVER_TYPE_HARDWARE;'
                print r'    }'

            if function.name.startswith('D3D10CreateDevice'):
                # Toggle debugging
                print r'    if (retrace::debug >= 2) {'
                print r'        Flags |= D3D10_CREATE_DEVICE_DEBUG;'
                print r'    } else if (retrace::debug < 0) {'
                print r'        Flags &= ~D3D10_CREATE_DEVICE_DEBUG;'
                print r'    }'

                # Force driver
                self.forceDriver('D3D10_DRIVER_TYPE')

            if function.name.startswith('D3D11CreateDevice'):
                # Toggle debugging
                print r'    if (retrace::debug >= 2) {'
                print r'        Flags |= D3D11_CREATE_DEVICE_DEBUG;'
                print r'    } else if (retrace::debug < 0) {'
                print r'        Flags &= ~D3D11_CREATE_DEVICE_DEBUG;'
                print r'    }'

                # Force driver
                self.forceDriver('D3D_DRIVER_TYPE')

        Retracer.invokeFunction(self, function)
开发者ID:groleo,项目名称:apitrace,代码行数:37,代码来源:dxgiretrace.py

示例2: invokeFunction

# 需要导入模块: from dllretrace import DllRetracer [as 别名]
# 或者: from dllretrace.DllRetracer import invokeFunction [as 别名]
    def invokeFunction(self, function):
        if function.name in ('Direct3DCreate9', 'Direct3DCreate9Ex'):
            print 'if (retrace::debug && !g_szD3D9DllName) {'
            print '    /* '
            print '     * XXX: D3D9D only works for simple things, it often introduces errors'
            print '     * on complex traces, or traces which use unofficial D3D9 features.'
            print '     */'
            print '    if (0) {'
            print '        g_szD3D9DllName = "d3d9d.dll";'
            print '    }'
            print '}'

        Retracer.invokeFunction(self, function)
开发者ID:chiehwen,项目名称:apitrace,代码行数:15,代码来源:d3d9retrace.py

示例3: invokeFunction

# 需要导入模块: from dllretrace import DllRetracer [as 别名]
# 或者: from dllretrace.DllRetracer import invokeFunction [as 别名]
    def invokeFunction(self, function):
        if function.name in ('Direct3DCreate9', 'Direct3DCreate9Ex'):
            print 'if (retrace::debug >= 2 && !g_szD3D9DllName && LoadLibraryA("d3d9d.dll")) {'
            print '    /*'
            print '     * D3D9D only works for simple applications, it will often report bogus errors'
            print '     * on complex traces, or traces which use unofficial D3D9 features.'
            print '     */'
            print '    g_szD3D9DllName = "d3d9d.dll";'
            print '    SDKVersion |= 0x80000000;'
            print '} else {'
            print '    SDKVersion &= ~0x80000000;'
            print '}'

        Retracer.invokeFunction(self, function)
开发者ID:Acidburn0zzz,项目名称:apitrace,代码行数:16,代码来源:d3d9retrace.py

示例4: invokeFunction

# 需要导入模块: from dllretrace import DllRetracer [as 别名]
# 或者: from dllretrace.DllRetracer import invokeFunction [as 别名]
    def invokeFunction(self, function):
        if function.name in self.createDeviceFunctionNames:
            # create windows as neccessary
            if 'pSwapChainDesc' in function.argNames():
                print r'    d3dretrace::createWindowForSwapChain(pSwapChainDesc);'

            # Compensate for the fact we don't trace DXGI object creation
            if function.name.startswith('D3D11CreateDevice'):
                print r'    if (DriverType == D3D_DRIVER_TYPE_UNKNOWN && !pAdapter) {'
                print r'        DriverType = D3D_DRIVER_TYPE_HARDWARE;'
                print r'    }'

            if function.name.startswith('D3D10CreateDevice'):
                # Toggle debugging
                print r'    Flags &= ~D3D10_CREATE_DEVICE_DEBUG;'
                print r'    if (retrace::debug) {'
                print r'        HMODULE hD3d10SdkLayers = LoadLibraryA("d3d10sdklayers");'
                print r'        if (hD3d10SdkLayers) {'
                print r'            FreeLibrary(hD3d10SdkLayers);'
                print r'            Flags |= D3D10_CREATE_DEVICE_DEBUG;'
                print r'        } else {'
                print r'            retrace::warning(call) << "Direct3D 10.x SDK Debug Layer (d3d10sdklayers.dll) not available, continuing without debug output\n";'
                print r'        }'
                print r'    }'

                # Force driver
                self.forceDriver('D3D10_DRIVER_TYPE')

            if function.name.startswith('D3D11CreateDevice'):
                # Toggle debugging
                print r'    Flags &= ~D3D11_CREATE_DEVICE_DEBUG;'
                print r'    if (retrace::debug) {'
                print r'        HRESULT hr = D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_NULL, 0, D3D11_CREATE_DEVICE_DEBUG, NULL, 0, D3D11_SDK_VERSION, NULL, NULL, NULL);'
                print r'        if (SUCCEEDED(hr)) {'
                print r'            Flags |= D3D11_CREATE_DEVICE_DEBUG;'
                print r'        } else {'
                print r'            retrace::warning(call) << "Direct3D 11.x SDK Debug Layer (d3d11*sdklayers.dll) not available, continuing without debug output\n";'
                print r'        }'
                print r'    }'

                # Force driver
                self.forceDriver('D3D_DRIVER_TYPE')

        Retracer.invokeFunction(self, function)
开发者ID:AheadIO,项目名称:apitrace,代码行数:46,代码来源:dxgiretrace.py

示例5: invokeFunction

# 需要导入模块: from dllretrace import DllRetracer [as 别名]
# 或者: from dllretrace.DllRetracer import invokeFunction [as 别名]
    def invokeFunction(self, function):
        if function.name in ("Direct3DCreate9", "Direct3DCreate9Ex"):
            print 'if (retrace::debug >= 2 && !g_szD3D9DllName && LoadLibraryA("d3d9d.dll")) {'
            print "    /*"
            print "     * D3D9D only works for simple applications, it will often report bogus errors"
            print "     * on complex traces, or traces which use unofficial D3D9 features."
            print "     */"
            print '    g_szD3D9DllName = "d3d9d.dll";'
            print "    SDKVersion |= 0x80000000;"
            print "} else {"
            print "    SDKVersion &= ~0x80000000;"
            print "}"

        # d3d8d.dll can be found in the Aug 2007 DXSDK.  It works on XP, but
        # not on Windows 7.
        if function.name in ("Direct3DCreate8"):
            print 'if (retrace::debug >= 2 && !g_szD3D8DllName && LoadLibraryA("d3d8d.dll")) {'
            print '    g_szD3D8DllName = "d3d8d.dll";'
            print "}"

        Retracer.invokeFunction(self, function)
开发者ID:schulmar,项目名称:apitrace,代码行数:23,代码来源:d3d9retrace.py

示例6: invokeFunction

# 需要导入模块: from dllretrace import DllRetracer [as 别名]
# 或者: from dllretrace.DllRetracer import invokeFunction [as 别名]
    def invokeFunction(self, function):
        if function.name in self.createDeviceFunctionNames:
            # create windows as neccessary
            if "pSwapChainDesc" in function.argNames():
                print r"    createWindow(pSwapChainDesc);"

            # Compensate for the fact we don't trace DXGI object creation
            if function.name.startswith("D3D11CreateDevice"):
                print r"    if (DriverType == D3D_DRIVER_TYPE_UNKNOWN && !pAdapter) {"
                print r"        DriverType = D3D_DRIVER_TYPE_HARDWARE;"
                print r"    }"

            if function.name.startswith("D3D10CreateDevice"):
                # Toggle debugging
                print r"    Flags &= ~D3D10_CREATE_DEVICE_DEBUG;"
                print r"    if (retrace::debug) {"
                print r'        if (LoadLibraryA("d3d10sdklayers")) {'
                print r"            Flags |= D3D10_CREATE_DEVICE_DEBUG;"
                print r"        }"
                print r"    }"

                # Force driver
                self.forceDriver("D3D10_DRIVER_TYPE")

            if function.name.startswith("D3D11CreateDevice"):
                # Toggle debugging
                print r"    Flags &= ~D3D11_CREATE_DEVICE_DEBUG;"
                print r"    if (retrace::debug) {"
                print r'        if (LoadLibraryA("d3d11sdklayers")) {'
                print r"            Flags |= D3D11_CREATE_DEVICE_DEBUG;"
                print r"        }"
                print r"    }"

                # Force driver
                self.forceDriver("D3D_DRIVER_TYPE")

        Retracer.invokeFunction(self, function)
开发者ID:Web5design,项目名称:apitrace,代码行数:39,代码来源:dxgiretrace.py

示例7: invokeFunction

# 需要导入模块: from dllretrace import DllRetracer [as 别名]
# 或者: from dllretrace.DllRetracer import invokeFunction [as 别名]
    def invokeFunction(self, function):
        if function.name.startswith('Direct3DCreate9'):
            print r'    if (retrace::debug >= 3 && !g_szD3D9DllName && LoadLibraryA("d3d9d.dll")) {'
            print r'        /*'
            print r'         * D3D9D only works for simple applications, it will often report bogus errors'
            print r'         * on complex traces, or traces which use unofficial D3D9 features.'
            print r'         */'
            print r'        g_szD3D9DllName = "d3d9d.dll";'
            print r'        SDKVersion |= 0x80000000;'
            print r'    } else {'
            print r'        SDKVersion &= ~0x80000000;'
            print r'    }'

        # d3d8d.dll can be found in the Aug 2007 DXSDK.  It works on XP, but
        # not on Windows 7.
        if function.name.startswith('Direct3DCreate8'):
            print r'    if (retrace::debug >= 3 && !g_szD3D8DllName && LoadLibraryA("d3d8d.dll")) {'
            print r'        g_szD3D8DllName = "d3d8d.dll";'
            print r'    }'

        if function.name.startswith('Direct3DCreate9'):
            print r'    // 0: default'
            print r'    // 1: force discrete'
            print r'    // 2/3: force integrated'
            print r'    UINT uHybrid = 0;'
            print r'    if (retrace::driver == retrace::DRIVER_DISCRETE) {'
            print r'        uHybrid = 1;'
            print r'    }'
            print r'    if (retrace::driver == retrace::DRIVER_INTEGRATED) {'
            print r'        uHybrid = 2;'
            print r'    }'
            print r'    if (uHybrid != 0) {'
            print r'        HMODULE hD3D9 = LoadLibraryA("D3D9");'
            print r'        assert(hD3D9);'
            print r'        typedef void (WINAPI *PFNDIRECT3D9FORCEHYBRIDENUMERATION)(UINT);'
            print r'        PFNDIRECT3D9FORCEHYBRIDENUMERATION pfnDirect3D9ForceHybridEnumeration ='
            print r'            (PFNDIRECT3D9FORCEHYBRIDENUMERATION)GetProcAddress(hD3D9, MAKEINTRESOURCEA(16));'
            print r'        if (pfnDirect3D9ForceHybridEnumeration) {'
            print r'            pfnDirect3D9ForceHybridEnumeration(uHybrid);'
            print r'        }'
            print r'    }'

        Retracer.invokeFunction(self, function)

        if function.name.startswith('Direct3DCreate'):
            print r'    if (retrace::driver == retrace::DRIVER_DISCRETE ||'
            print r'        retrace::driver == retrace::DRIVER_INTEGRATED) {'
            if function.name == 'Direct3DCreate9Ex':
                print r'        auto pD3D = SUCCEEDED(_result) ? *ppD3D : nullptr;'
            else:
                print r'        auto pD3D = _result;'
            if function.name.startswith('Direct3DCreate9'):
                print r'        D3DADAPTER_IDENTIFIER9 Identifier;'
            else:
                assert function.name.startswith('Direct3DCreate8')
                print r'        D3DADAPTER_IDENTIFIER8 Identifier;'
            print r'        if (pD3D) {'
            print r'            if (SUCCEEDED(pD3D->GetAdapterIdentifier(D3DADAPTER_DEFAULT, 0, &Identifier))) {'
            print r'                std::cerr << "info: using " << Identifier.Description << std::endl;'
            print r'            }'
            print r'        }'
            print r'    }'
开发者ID:p-podsiadly,项目名称:apitrace,代码行数:64,代码来源:d3d9retrace.py

示例8: invokeFunction

# 需要导入模块: from dllretrace import DllRetracer [as 别名]
# 或者: from dllretrace.DllRetracer import invokeFunction [as 别名]
    def invokeFunction(self, function):
        if function.name in self.createDeviceFunctionNames:
            # create windows as neccessary
            if 'pSwapChainDesc' in function.argNames():
                print r'    d3dretrace::createWindowForSwapChain(pSwapChainDesc);'

            # Compensate for the fact we don't trace DXGI object creation
            if function.name.startswith('D3D11CreateDevice'):
                print r'    if (DriverType == D3D_DRIVER_TYPE_UNKNOWN && !pAdapter) {'
                print r'        DriverType = D3D_DRIVER_TYPE_HARDWARE;'
                print r'    }'

            if function.name.startswith('D3D10CreateDevice'):
                # Toggle debugging
                print r'    Flags &= ~D3D10_CREATE_DEVICE_DEBUG;'
                print r'    if (retrace::debug) {'
                print r'        if (LoadLibraryA("d3d10sdklayers")) {'
                print r'            Flags |= D3D10_CREATE_DEVICE_DEBUG;'
                print r'        }'
                print r'    }'

                # Force driver
                self.forceDriver('D3D10_DRIVER_TYPE')

            if function.name.startswith('D3D11CreateDevice'):
                # Toggle debugging
                print r'    Flags &= ~D3D11_CREATE_DEVICE_DEBUG;'
                print r'    if (retrace::debug) {'
                print r'        const char *szD3d11SdkLayers = IsWindows8OrGreater() ? "d3d11_1sdklayers" : "d3d11sdklayers";'
                print r'        if (LoadLibraryA(szD3d11SdkLayers)) {'
                print r'            Flags |= D3D11_CREATE_DEVICE_DEBUG;'
                print r'        }'
                print r'    }'

                # Force driver
                self.forceDriver('D3D_DRIVER_TYPE')

        Retracer.invokeFunction(self, function)

        # Debug layers with Windows 8 or Windows 7 Platform update are a mess.
        # It's not possible to know before hand whether they are or not
        # available, so always retry with debug flag off..
        if function.name in self.createDeviceFunctionNames:
            print r'    if (FAILED(_result)) {'

            if function.name.startswith('D3D10CreateDevice'):
                print r'        if (_result == E_FAIL && (Flags & D3D10_CREATE_DEVICE_DEBUG)) {'
                print r'            retrace::warning(call) << "debug layer (d3d10sdklayers.dll) not installed\n";'
                print r'            Flags &= ~D3D10_CREATE_DEVICE_DEBUG;'
                Retracer.invokeFunction(self, function)
                print r'        }'
            elif function.name.startswith('D3D11CreateDevice'):
                print r'        if (_result == E_FAIL && (Flags & D3D11_CREATE_DEVICE_DEBUG)) {'
                print r'            retrace::warning(call) << "debug layer (d3d11sdklayers.dll for Windows 7, d3d11_1sdklayers.dll for Windows 8 or Windows 7 with KB 2670838) not properly installed\n";'
                print r'            Flags &= ~D3D11_CREATE_DEVICE_DEBUG;'
                Retracer.invokeFunction(self, function)
                print r'        }'
            else:
                assert False

            print r'        if (FAILED(_result)) {'
            print r'            exit(1);'
            print r'        }'

            print r'    }'
开发者ID:Aganlengzi,项目名称:apitrace,代码行数:67,代码来源:dxgiretrace.py

示例9: invokeFunction

# 需要导入模块: from dllretrace import DllRetracer [as 别名]
# 或者: from dllretrace.DllRetracer import invokeFunction [as 别名]
    def invokeFunction(self, function):
        if function.name in self.createDeviceFunctionNames:
            # create windows as neccessary
            if 'pSwapChainDesc' in function.argNames():
                print r'    createWindow(pSwapChainDesc);'

            # Compensate for the fact we don't trace DXGI object creation
            if function.name.startswith('D3D11CreateDevice'):
                print r'    if (DriverType == D3D_DRIVER_TYPE_UNKNOWN && !pAdapter) {'
                print r'        DriverType = D3D_DRIVER_TYPE_HARDWARE;'
                print r'    }'

            if function.name.startswith('D3D10CreateDevice'):
                # Toggle debugging
                print r'    Flags &= ~D3D10_CREATE_DEVICE_DEBUG;'
                print r'    if (retrace::debug) {'
                print r'        if (LoadLibraryA("d3d10sdklayers")) {'
                print r'            Flags |= D3D10_CREATE_DEVICE_DEBUG;'
                print r'        }'
                print r'    }'

                # Force driver
                self.forceDriver('D3D10_DRIVER_TYPE')

            if function.name.startswith('D3D11CreateDevice'):
                # Toggle debugging
                print r'    Flags &= ~D3D11_CREATE_DEVICE_DEBUG;'
                print r'    if (retrace::debug) {'
                print r'        OSVERSIONINFO osvi;'
                print r'        BOOL bIsWindows8orLater;'
                print r'        ZeroMemory(&osvi, sizeof osvi);'
                print r'        osvi.dwOSVersionInfoSize = sizeof osvi;'
                print r'        GetVersionEx(&osvi);'
                print r'        bIsWindows8orLater = '
                print r'            (osvi.dwMajorVersion > 6) ||'
                print r'            (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion >= 2);'
                print r'        const char *szD3d11SdkLayers = bIsWindows8orLater ? "d3d11_1sdklayers" : "d3d11sdklayers";'
                print r'        if (LoadLibraryA(szD3d11SdkLayers)) {'
                print r'            Flags |= D3D11_CREATE_DEVICE_DEBUG;'
                print r'        }'
                print r'    }'

                # Force driver
                self.forceDriver('D3D_DRIVER_TYPE')

        Retracer.invokeFunction(self, function)

        if function.name in self.createDeviceFunctionNames:
            print r'    if (FAILED(_result)) {'

            if function.name.startswith('D3D10CreateDevice'):
                print r'        if (_result == E_FAIL && (Flags & D3D10_CREATE_DEVICE_DEBUG)) {'
                print r'            retrace::warning(call) << "debug layer (d3d10sdklayers.dll) not installed\n";'
                print r'        }'

            if function.name.startswith('D3D11CreateDevice'):
                print r'        if (_result == E_FAIL && (Flags & D3D11_CREATE_DEVICE_DEBUG)) {'
                print r'            retrace::warning(call) << "debug layer (d3d11sdklayers.dll for Windows 7, d3d11_1sdklayers.dll for Windows 8 or Windows 7 with KB 2670838) not properly installed\n";'
                print r'        }'

            print r'        exit(1);'
            print r'    }'
开发者ID:perftrace,项目名称:apitrace,代码行数:64,代码来源:dxgiretrace.py


注:本文中的dllretrace.DllRetracer.invokeFunction方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。