本文整理汇总了Python中ctypes.c_long方法的典型用法代码示例。如果您正苦于以下问题:Python ctypes.c_long方法的具体用法?Python ctypes.c_long怎么用?Python ctypes.c_long使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ctypes
的用法示例。
在下文中一共展示了ctypes.c_long方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Indicate
# 需要导入模块: import ctypes [as 别名]
# 或者: from ctypes import c_long [as 别名]
def Indicate(self, object_count, obj_array):
prototype = ctypes.WINFUNCTYPE(HRESULT,
ctypes.c_long,
ctypes.POINTER(wintypes.LPVOID))
paramflags = ((_In_, 'lObjectCount'),
(_In_, 'apObjArray'),
)
_Indicate = prototype(IWbemObjectSink_Indicate_Idx,
'Indicate',
paramflags)
_Indicate.errcheck = winapi.RAISE_NON_ZERO_ERR
_Indicate(self.this,
object_count,
obj_array.this if obj_array else None
)
示例2: Get
# 需要导入模块: import ctypes [as 别名]
# 或者: from ctypes import c_long [as 别名]
def Get(self, name, flags):
prototype = ctypes.WINFUNCTYPE(HRESULT,
wintypes.LPCWSTR,
ctypes.c_long,
ctypes.POINTER(winapi.VARIANT),
ctypes.POINTER(ctypes.c_long))
paramflags = ((_In_, 'wszName'),
(_In_, 'lFlags'),
(_Out_, 'pVal'),
(_Out_, 'plFlavor'),
)
_Get = prototype(IWbemQualifierSet_Get_Idx,
'Get',
paramflags)
_Get.errcheck = winapi.RAISE_NON_ZERO_ERR
return_obj, return_obj2 = _Get(self.this,
name,
flags
)
return return_obj, return_obj2
示例3: Put
# 需要导入模块: import ctypes [as 别名]
# 或者: from ctypes import c_long [as 别名]
def Put(self, name, val, flavor):
prototype = ctypes.WINFUNCTYPE(HRESULT,
wintypes.LPCWSTR,
ctypes.POINTER(winapi.VARIANT),
ctypes.c_long)
paramflags = ((_In_, 'wszName'),
(_In_, 'pVal'),
(_In_, 'lFlavor'),
)
_Put = prototype(IWbemQualifierSet_Put_Idx,
'Put',
paramflags)
_Put.errcheck = winapi.RAISE_NON_ZERO_ERR
_Put(self.this,
name,
ctypes.byref(val) if val else None,
flavor
)
示例4: GetNames
# 需要导入模块: import ctypes [as 别名]
# 或者: from ctypes import c_long [as 别名]
def GetNames(self, flags):
prototype = ctypes.WINFUNCTYPE(HRESULT,
ctypes.c_long,
ctypes.POINTER(wintypes.LPVOID))
paramflags = ((_In_, 'lFlags'),
(_Out_, 'pNames'),
)
_GetNames = prototype(IWbemQualifierSet_GetNames_Idx,
'GetNames',
paramflags)
_GetNames.errcheck = winapi.RAISE_NON_ZERO_ERR
return_obj = _GetNames(self.this,
flags
)
return_obj = ctypes.cast(wintypes.LPVOID(return_obj), ctypes.POINTER(winapi.SAFEARRAY))
return return_obj
示例5: Next
# 需要导入模块: import ctypes [as 别名]
# 或者: from ctypes import c_long [as 别名]
def Next(self, flags):
prototype = ctypes.WINFUNCTYPE(HRESULT,
ctypes.c_long,
ctypes.POINTER(BSTR),
ctypes.POINTER(winapi.VARIANT),
ctypes.POINTER(ctypes.c_long))
paramflags = ((_In_, 'lFlags'),
(_Out_, 'pstrName'),
(_Out_, 'pVal'),
(_Out_, 'plFlavor'),
)
_Next = prototype(IWbemQualifierSet_Next_Idx,
'Next',
paramflags)
_Next.errcheck = winapi.RAISE_NON_ZERO_ERR
return_obj, return_obj2, return_obj3 = _Next(self.this,
flags
)
return_obj = winapi.convert_bstr_to_str(return_obj)
return return_obj, return_obj2, return_obj3
示例6: GetObjectText
# 需要导入模块: import ctypes [as 别名]
# 或者: from ctypes import c_long [as 别名]
def GetObjectText(self, flags):
prototype = ctypes.WINFUNCTYPE(HRESULT,
ctypes.c_long,
ctypes.POINTER(BSTR))
paramflags = ((_In_, 'lFlags'),
(_Out_, 'pstrObjectText'),
)
_GetObjectText = prototype(IWbemClassObject_GetObjectText_Idx,
'GetObjectText',
paramflags)
_GetObjectText.errcheck = winapi.RAISE_NON_ZERO_ERR
return_obj = _GetObjectText(self.this,
flags
)
return_obj = winapi.convert_bstr_to_str(return_obj)
return return_obj
示例7: SpawnDerivedClass
# 需要导入模块: import ctypes [as 别名]
# 或者: from ctypes import c_long [as 别名]
def SpawnDerivedClass(self, flags):
prototype = ctypes.WINFUNCTYPE(HRESULT,
ctypes.c_long,
ctypes.POINTER(wintypes.LPVOID))
paramflags = ((_In_, 'lFlags'),
(_Out_, 'ppNewClass'),
)
_SpawnDerivedClass = prototype(IWbemClassObject_SpawnDerivedClass_Idx,
'SpawnDerivedClass',
paramflags)
_SpawnDerivedClass.errcheck = winapi.RAISE_NON_ZERO_ERR
return_obj = _SpawnDerivedClass(self.this,
flags
)
try:
return_obj = IWbemClassObject(return_obj)
except WindowsError:
return_obj = None
return return_obj
示例8: SpawnInstance
# 需要导入模块: import ctypes [as 别名]
# 或者: from ctypes import c_long [as 别名]
def SpawnInstance(self, flags):
prototype = ctypes.WINFUNCTYPE(HRESULT,
ctypes.c_long,
ctypes.POINTER(wintypes.LPVOID))
paramflags = ((_In_, 'lFlags'),
(_Out_, 'ppNewInstance'),
)
_SpawnInstance = prototype(IWbemClassObject_SpawnInstance_Idx,
'SpawnInstance',
paramflags)
_SpawnInstance.errcheck = winapi.RAISE_NON_ZERO_ERR
return_obj = _SpawnInstance(self.this,
flags
)
try:
return_obj = IWbemClassObject(return_obj)
except WindowsError:
return_obj = None
return return_obj
示例9: CompareTo
# 需要导入模块: import ctypes [as 别名]
# 或者: from ctypes import c_long [as 别名]
def CompareTo(self, flags, compare_to):
prototype = ctypes.WINFUNCTYPE(HRESULT,
ctypes.c_long,
ctypes.POINTER(IWbemClassObject))
paramflags = ((_In_, 'lFlags'),
(_In_, 'pCompareTo'),
)
_CompareTo = prototype(IWbemClassObject_CompareTo_Idx,
'CompareTo',
paramflags)
_CompareTo.errcheck = winapi.RAISE_NON_ZERO_ERR
_CompareTo(self.this,
flags,
compare_to.this if compare_to else None
)
示例10: Skip
# 需要导入模块: import ctypes [as 别名]
# 或者: from ctypes import c_long [as 别名]
def Skip(self, timeout, count):
prototype = ctypes.WINFUNCTYPE(HRESULT,
ctypes.c_long,
wintypes.ULONG)
paramflags = ((_In_, 'lTimeout'),
(_In_, 'nCount'),
)
_Skip = prototype(IEnumWbemClassObject_Skip_Idx,
'Skip',
paramflags)
_Skip.errcheck = winapi.RAISE_NON_ZERO_ERR
_Skip(self.this,
timeout,
count
)
示例11: GetResultObject
# 需要导入模块: import ctypes [as 别名]
# 或者: from ctypes import c_long [as 别名]
def GetResultObject(self, timeout):
prototype = ctypes.WINFUNCTYPE(HRESULT,
ctypes.c_long,
ctypes.POINTER(wintypes.LPVOID))
paramflags = ((_In_, 'lTimeout'),
(_Out_, 'ppResultObject'),
)
_GetResultObject = prototype(IWbemCallResult_GetResultObject_Idx,
'GetResultObject',
paramflags)
_GetResultObject.errcheck = winapi.RAISE_NON_ZERO_ERR
return_obj = _GetResultObject(self.this,
timeout
)
try:
return_obj = IWbemClassObject(return_obj)
except WindowsError:
return_obj = None
return return_obj
示例12: GetResultServices
# 需要导入模块: import ctypes [as 别名]
# 或者: from ctypes import c_long [as 别名]
def GetResultServices(self, timeout):
prototype = ctypes.WINFUNCTYPE(HRESULT,
ctypes.c_long,
ctypes.POINTER(wintypes.LPVOID))
paramflags = ((_In_, 'lTimeout'),
(_Out_, 'ppServices'),
)
_GetResultServices = prototype(IWbemCallResult_GetResultServices_Idx,
'GetResultServices',
paramflags)
_GetResultServices.errcheck = winapi.RAISE_NON_ZERO_ERR
return_obj = _GetResultServices(self.this,
timeout
)
try:
return_obj = IWbemServices(return_obj)
except WindowsError:
return_obj = None
return return_obj
示例13: GetCallStatus
# 需要导入模块: import ctypes [as 别名]
# 或者: from ctypes import c_long [as 别名]
def GetCallStatus(self, timeout):
prototype = ctypes.WINFUNCTYPE(HRESULT,
ctypes.c_long,
ctypes.POINTER(ctypes.c_long))
paramflags = ((_In_, 'lTimeout'),
(_Out_, 'plStatus'),
)
_GetCallStatus = prototype(IWbemCallResult_GetCallStatus_Idx,
'GetCallStatus',
paramflags)
_GetCallStatus.errcheck = winapi.RAISE_NON_ZERO_ERR
return_obj = _GetCallStatus(self.this,
timeout
)
return return_obj
示例14: GetValue
# 需要导入模块: import ctypes [as 别名]
# 或者: from ctypes import c_long [as 别名]
def GetValue(self, name, flags):
prototype = ctypes.WINFUNCTYPE(HRESULT,
wintypes.LPCWSTR,
ctypes.c_long,
ctypes.POINTER(winapi.VARIANT))
paramflags = ((_In_, 'wszName'),
(_In_, 'lFlags'),
(_Out_, 'pValue'),
)
_GetValue = prototype(IWbemContext_GetValue_Idx,
'GetValue',
paramflags)
_GetValue.errcheck = winapi.RAISE_NON_ZERO_ERR
return_obj = _GetValue(self.this,
name,
flags
)
return return_obj
示例15: DeleteValue
# 需要导入模块: import ctypes [as 别名]
# 或者: from ctypes import c_long [as 别名]
def DeleteValue(self, name, flags):
prototype = ctypes.WINFUNCTYPE(HRESULT,
wintypes.LPCWSTR,
ctypes.c_long)
paramflags = ((_In_, 'wszName'),
(_In_, 'lFlags'),
)
_DeleteValue = prototype(IWbemContext_DeleteValue_Idx,
'DeleteValue',
paramflags)
_DeleteValue.errcheck = winapi.RAISE_NON_ZERO_ERR
_DeleteValue(self.this,
name,
flags
)