本文整理匯總了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