Python pythoncom 模块,CLSCTX_LOCAL_SERVER 实例源码

我们从Python开源项目中,提取了以下16个代码示例,用于说明如何使用pythoncom.CLSCTX_LOCAL_SERVER

项目:OSPTF    作者:xSploited    | 项目源码 | 文件源码
def RegisterClassFactories(clsids, flags = None, clsctx = None):
    """Given a list of CLSID, create and register class factories.

       Returns a list, which should be passed to RevokeClassFactories
    """
    if flags is None:   flags = pythoncom.REGCLS_MULTIPLEUSE|pythoncom.REGCLS_SUSPENDED
    if clsctx is None: clsctx = pythoncom.CLSCTX_LOCAL_SERVER
    ret = []
    for clsid in clsids:
        # Some server append '-Embedding' etc
        if clsid[0] not in ['-', '/']:
            factory = pythoncom.MakePyFactory(clsid)
            regId = pythoncom.CoRegisterClassObject(clsid, factory, clsctx, flags)
            ret.append((factory, regId))
    return ret
项目:OSPTF    作者:xSploited    | 项目源码 | 文件源码
def TestQueryInterface(long_lived_server = 0, iterations=5):
    tester = win32com.client.Dispatch("PyCOMTest.PyCOMTest")
    if long_lived_server:
        # Create a local server
        t0 = win32com.client.Dispatch("Python.Test.PyCOMTest", clsctx=pythoncom.CLSCTX_LOCAL_SERVER)
    # Request custom interfaces a number of times
    prompt = [
            "Testing QueryInterface without long-lived local-server #%d of %d...",
            "Testing QueryInterface with long-lived local-server #%d of %d..."
    ]

    for i in range(iterations):
        progress(prompt[long_lived_server!=0] % (i+1, iterations))
        tester.TestQueryInterface()
项目:OSPTF    作者:xSploited    | 项目源码 | 文件源码
def testVTableLocalServer(self):
        for i in range(3):
            progress("Testing VTables out-of-process #%d..." % (i+1))
            TestVTable(pythoncom.CLSCTX_LOCAL_SERVER)
项目:OSPTF    作者:xSploited    | 项目源码 | 文件源码
def testLocalServer(self):
        interp = win32com.client.dynamic.Dispatch("Python.Interpreter", clsctx = pythoncom.CLSCTX_LOCAL_SERVER)
        self._testInterp(interp)
项目:pupy    作者:ru-faraon    | 项目源码 | 文件源码
def RegisterClassFactories(clsids, flags = None, clsctx = None):
    """Given a list of CLSID, create and register class factories.

       Returns a list, which should be passed to RevokeClassFactories
    """
    if flags is None:   flags = pythoncom.REGCLS_MULTIPLEUSE|pythoncom.REGCLS_SUSPENDED
    if clsctx is None: clsctx = pythoncom.CLSCTX_LOCAL_SERVER
    ret = []
    for clsid in clsids:
        # Some server append '-Embedding' etc
        if clsid[0] not in ['-', '/']:
            factory = pythoncom.MakePyFactory(clsid)
            regId = pythoncom.CoRegisterClassObject(clsid, factory, clsctx, flags)
            ret.append((factory, regId))
    return ret
项目:pupy    作者:ru-faraon    | 项目源码 | 文件源码
def TestQueryInterface(long_lived_server = 0, iterations=5):
    tester = win32com.client.Dispatch("PyCOMTest.PyCOMTest")
    if long_lived_server:
        # Create a local server
        t0 = win32com.client.Dispatch("Python.Test.PyCOMTest", clsctx=pythoncom.CLSCTX_LOCAL_SERVER)
    # Request custom interfaces a number of times
    prompt = [
            "Testing QueryInterface without long-lived local-server #%d of %d...",
            "Testing QueryInterface with long-lived local-server #%d of %d..."
    ]

    for i in range(iterations):
        progress(prompt[long_lived_server!=0] % (i+1, iterations))
        tester.TestQueryInterface()
项目:pupy    作者:ru-faraon    | 项目源码 | 文件源码
def testVTableLocalServer(self):
        for i in range(3):
            progress("Testing VTables out-of-process #%d..." % (i+1))
            TestVTable(pythoncom.CLSCTX_LOCAL_SERVER)
项目:pupy    作者:ru-faraon    | 项目源码 | 文件源码
def testLocalServer(self):
        interp = win32com.client.dynamic.Dispatch("Python.Interpreter", clsctx = pythoncom.CLSCTX_LOCAL_SERVER)
        self._testInterp(interp)
项目:remoteControlPPT    作者:htwenning    | 项目源码 | 文件源码
def RegisterClassFactories(clsids, flags = None, clsctx = None):
    """Given a list of CLSID, create and register class factories.

       Returns a list, which should be passed to RevokeClassFactories
    """
    if flags is None:   flags = pythoncom.REGCLS_MULTIPLEUSE|pythoncom.REGCLS_SUSPENDED
    if clsctx is None: clsctx = pythoncom.CLSCTX_LOCAL_SERVER
    ret = []
    for clsid in clsids:
        # Some server append '-Embedding' etc
        if clsid[0] not in ['-', '/']:
            factory = pythoncom.MakePyFactory(clsid)
            regId = pythoncom.CoRegisterClassObject(clsid, factory, clsctx, flags)
            ret.append((factory, regId))
    return ret
项目:remoteControlPPT    作者:htwenning    | 项目源码 | 文件源码
def TestQueryInterface(long_lived_server = 0, iterations=5):
    tester = win32com.client.Dispatch("PyCOMTest.PyCOMTest")
    if long_lived_server:
        # Create a local server
        t0 = win32com.client.Dispatch("Python.Test.PyCOMTest", clsctx=pythoncom.CLSCTX_LOCAL_SERVER)
    # Request custom interfaces a number of times
    prompt = [
            "Testing QueryInterface without long-lived local-server #%d of %d...",
            "Testing QueryInterface with long-lived local-server #%d of %d..."
    ]

    for i in range(iterations):
        progress(prompt[long_lived_server!=0] % (i+1, iterations))
        tester.TestQueryInterface()
项目:remoteControlPPT    作者:htwenning    | 项目源码 | 文件源码
def testVTableLocalServer(self):
        for i in range(3):
            progress("Testing VTables out-of-process #%d..." % (i+1))
            TestVTable(pythoncom.CLSCTX_LOCAL_SERVER)
项目:remoteControlPPT    作者:htwenning    | 项目源码 | 文件源码
def testLocalServer(self):
        interp = win32com.client.dynamic.Dispatch("Python.Interpreter", clsctx = pythoncom.CLSCTX_LOCAL_SERVER)
        self._testInterp(interp)
项目:CodeReader    作者:jasonrbr    | 项目源码 | 文件源码
def RegisterClassFactories(clsids, flags = None, clsctx = None):
    """Given a list of CLSID, create and register class factories.

       Returns a list, which should be passed to RevokeClassFactories
    """
    if flags is None:   flags = pythoncom.REGCLS_MULTIPLEUSE|pythoncom.REGCLS_SUSPENDED
    if clsctx is None: clsctx = pythoncom.CLSCTX_LOCAL_SERVER
    ret = []
    for clsid in clsids:
        # Some server append '-Embedding' etc
        if clsid[0] not in ['-', '/']:
            factory = pythoncom.MakePyFactory(clsid)
            regId = pythoncom.CoRegisterClassObject(clsid, factory, clsctx, flags)
            ret.append((factory, regId))
    return ret
项目:CodeReader    作者:jasonrbr    | 项目源码 | 文件源码
def TestQueryInterface(long_lived_server = 0, iterations=5):
    tester = win32com.client.Dispatch("PyCOMTest.PyCOMTest")
    if long_lived_server:
        # Create a local server
        t0 = win32com.client.Dispatch("Python.Test.PyCOMTest", clsctx=pythoncom.CLSCTX_LOCAL_SERVER)
    # Request custom interfaces a number of times
    prompt = [
            "Testing QueryInterface without long-lived local-server #%d of %d...",
            "Testing QueryInterface with long-lived local-server #%d of %d..."
    ]

    for i in range(iterations):
        progress(prompt[long_lived_server!=0] % (i+1, iterations))
        tester.TestQueryInterface()
项目:CodeReader    作者:jasonrbr    | 项目源码 | 文件源码
def testVTableLocalServer(self):
        for i in range(3):
            progress("Testing VTables out-of-process #%d..." % (i+1))
            TestVTable(pythoncom.CLSCTX_LOCAL_SERVER)
项目:CodeReader    作者:jasonrbr    | 项目源码 | 文件源码
def testLocalServer(self):
        interp = win32com.client.dynamic.Dispatch("Python.Interpreter", clsctx = pythoncom.CLSCTX_LOCAL_SERVER)
        self._testInterp(interp)