本文整理汇总了Python中ctypes.HRESULT属性的典型用法代码示例。如果您正苦于以下问题:Python ctypes.HRESULT属性的具体用法?Python ctypes.HRESULT怎么用?Python ctypes.HRESULT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类ctypes
的用法示例。
在下文中一共展示了ctypes.HRESULT属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _do_debug_create
# 需要导入模块: import ctypes [as 别名]
# 或者: from ctypes import HRESULT [as 别名]
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
示例2: HRValue
# 需要导入模块: import ctypes [as 别名]
# 或者: from ctypes import HRESULT [as 别名]
def HRValue(hr):
_hr = comtypes.HRESULT(hr)
return ctypes.c_ulong(_hr.value).value
示例3: IsHR
# 需要导入模块: import ctypes [as 别名]
# 或者: from ctypes import HRESULT [as 别名]
def IsHR(hr, value):
_hr = comtypes.HRESULT(hr)
return ctypes.c_ulong(_hr.value).value == value
示例4: __init__
# 需要导入模块: import ctypes [as 别名]
# 或者: from ctypes import HRESULT [as 别名]
def __init__(self, *args):
super(STDMETHOD, self).__init__(ctypes.HRESULT, *args)
示例5: to_list
# 需要导入模块: import ctypes [as 别名]
# 或者: from ctypes import HRESULT [as 别名]
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
示例6: proto
# 需要导入模块: import ctypes [as 别名]
# 或者: from ctypes import HRESULT [as 别名]
def proto(*argtypes, retval=None):
if retval is not None:
argtypes = (*argtypes, POINTER(retval))
proto = WINFUNCTYPE(HRESULT, *argtypes)
proto._retval = retval
return proto