Python ctypes.HRESULT Examples

The following are 11 code examples of ctypes.HRESULT(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module ctypes , or try the search function .
Example #1
Source File: dbginterface.py    From LKD with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def _do_debug_create(self):
        DebugClient = IDebugClient(0)

        DebugCreateAddr = winproxy.GetProcAddress(self.hmoduledbgeng, "DebugCreate")
        DebugCreate = WINFUNCTYPE(HRESULT, PVOID, PVOID)(DebugCreateAddr)
        DebugCreate(IID_IDebugClient, byref(DebugClient))
        return DebugClient 
Example #2
Source File: PyKinectV2.py    From PyKinectTk with GNU General Public License v3.0 5 votes vote down vote up
def HRValue(hr):
    _hr = comtypes.HRESULT(hr) 
    return ctypes.c_ulong(_hr.value).value 
Example #3
Source File: PyKinectV2.py    From PyKinectTk with GNU General Public License v3.0 5 votes vote down vote up
def IsHR(hr, value):
    _hr = comtypes.HRESULT(hr) 
    return ctypes.c_ulong(_hr.value).value == value 
Example #4
Source File: com.py    From flappy-bird-py with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, *args):
        super(STDMETHOD, self).__init__(ctypes.HRESULT, *args) 
Example #5
Source File: com.py    From flappy-bird-py with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, *args):
        super(STDMETHOD, self).__init__(ctypes.HRESULT, *args) 
Example #6
Source File: com.py    From flappy-bird-py with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, *args):
        super(STDMETHOD, self).__init__(ctypes.HRESULT, *args) 
Example #7
Source File: com.py    From pyglet with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def __init__(self, *args):
        super(STDMETHOD, self).__init__(ctypes.HRESULT, *args) 
Example #8
Source File: com.py    From PythonForWindows with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def to_list(self, t=None):
            if t is None:
                if hasattr(self, "elt_type"):
                    t = self.elt_type
                else:
                    raise ValueError("Missing type of the array")
            if self.cDims !=  1:
                raise NotImplementedError("tagSAFEARRAY if dims != 1")

            nb_element = self.rgsabound[0].cElements
            llbound = self.rgsabound[0].lLbound
            if self.cbElements != ctypes.sizeof(t):
                raise ValueError("Size of elements != sizeof(type)")
            data = [t.from_address(self.pvData + (i + llbound) * ctypes.sizeof(t)).value for i in range(nb_element)]
            return data

#VT_VALUE_TO_TYPE = {
#VT_I2 : SHORT,
#VT_I4 : LONG,
#VT_BSTR : BSTR,
#VT_VARIANT : VARIANT,
#VT_UI1 : UCHAR,
#VT_UI2 : USHORT,
#VT_UI4 : DWORD,
#VT_I8 : LONGLONG,
#VT_UI8 : ULONG64,
#VT_INT : INT,
#VT_UINT : UINT,
#VT_HRESULT : HRESULT,
#VT_PTR : PVOID,
#VT_LPSTR : LPCSTR,
#VT_LPWSTR : LPWSTR,
#}

# VARIANT type checker
# Allow to guess a VARIANT_TYPE og a python value 
Example #9
Source File: PyKinectV2.py    From PyKinect2 with MIT License 5 votes vote down vote up
def HRValue(hr):
    _hr = comtypes.HRESULT(hr) 
    return ctypes.c_ulong(_hr.value).value 
Example #10
Source File: PyKinectV2.py    From PyKinect2 with MIT License 5 votes vote down vote up
def IsHR(hr, value):
    _hr = comtypes.HRESULT(hr) 
    return ctypes.c_ulong(_hr.value).value == value 
Example #11
Source File: delegate.py    From ArknightsAutoHelper with MIT License 5 votes vote down vote up
def proto(*argtypes, retval=None):
    if retval is not None:
        argtypes = (*argtypes, POINTER(retval))
    proto = WINFUNCTYPE(HRESULT, *argtypes)
    proto._retval = retval
    return proto