本文整理汇总了Python中comtypes.GUID属性的典型用法代码示例。如果您正苦于以下问题:Python comtypes.GUID属性的具体用法?Python comtypes.GUID怎么用?Python comtypes.GUID使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类comtypes
的用法示例。
在下文中一共展示了comtypes.GUID属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: WlanConnect
# 需要导入模块: import comtypes [as 别名]
# 或者: from comtypes import GUID [as 别名]
def WlanConnect(hClientHandle, pInterfaceGuid, pConnectionParameters):
"""
The WlanConnect function attempts to connect to a specific network.
DWORD WINAPI WlanConnect(
_In_ HANDLE hClientHandle,
_In_ const GUID *pInterfaceGuid,
_In_ const PWLAN_CONNECTION_PARAMETERS pConnectionParameters,
_Reserved_ PVOID pReserved
);
"""
func_ref = wlanapi.WlanConnect
func_ref.argtypes = [HANDLE,
POINTER(GUID),
POINTER(WLAN_CONNECTION_PARAMETERS),
c_void_p]
func_ref.restype = DWORD
result = func_ref(hClientHandle,
pointer(pInterfaceGuid),
pointer(pConnectionParameters),
None)
if result != ERROR_SUCCESS:
raise Exception("".join(["WlanConnect failed with error ", str(result)]))
return result
示例2: WlanScan
# 需要导入模块: import comtypes [as 别名]
# 或者: from comtypes import GUID [as 别名]
def WlanScan(hClientHandle, pInterfaceGuid, ssid=""):
"""
The WlanScan function requests a scan for available networks on the
indicated interface.
DWORD WINAPI WlanScan(
_In_ HANDLE hClientHandle,
_In_ const GUID *pInterfaceGuid,
_In_opt_ const PDOT11_SSID pDot11Ssid,
_In_opt_ const PWLAN_RAW_DATA pIeData,
_Reserved_ PVOID pReserved
);
"""
func_ref = wlanapi.WlanScan
func_ref.argtypes = [HANDLE,
POINTER(GUID),
POINTER(DOT11_SSID),
POINTER(WLAN_RAW_DATA),
c_void_p]
func_ref.restype = DWORD
if ssid:
length = len(ssid)
if length > DOT11_SSID_MAX_LENGTH:
raise Exception("SSIDs have a maximum length of 32 characters.")
# data = tuple(ord(char) for char in ssid)
data = ssid
dot11_ssid = byref(DOT11_SSID(length, data))
else:
dot11_ssid = None
# TODO: Support WLAN_RAW_DATA argument.
result = func_ref(hClientHandle,
byref(pInterfaceGuid),
dot11_ssid,
None,
None)
if result != ERROR_SUCCESS:
raise Exception("WlanScan failed.")
return result
示例3: WlanGetAvailableNetworkList
# 需要导入模块: import comtypes [as 别名]
# 或者: from comtypes import GUID [as 别名]
def WlanGetAvailableNetworkList(hClientHandle, pInterfaceGuid):
"""
The WlanGetAvailableNetworkList function retrieves the list of
available networks on a wireless LAN interface.
DWORD WINAPI WlanGetAvailableNetworkList(
_In_ HANDLE hClientHandle,
_In_ const GUID *pInterfaceGuid,
_In_ DWORD dwFlags,
_Reserved_ PVOID pReserved,
_Out_ PWLAN_AVAILABLE_NETWORK_LIST *ppAvailableNetworkList
);
"""
func_ref = wlanapi.WlanGetAvailableNetworkList
func_ref.argtypes = [HANDLE,
POINTER(GUID),
DWORD,
c_void_p,
POINTER(POINTER(WLAN_AVAILABLE_NETWORK_LIST))]
func_ref.restype = DWORD
wlan_available_network_list = pointer(WLAN_AVAILABLE_NETWORK_LIST())
result = func_ref(hClientHandle,
byref(pInterfaceGuid),
0,
None,
byref(wlan_available_network_list))
if result != ERROR_SUCCESS:
raise Exception("WlanGetAvailableNetworkList failed.")
return wlan_available_network_list
示例4: WlanGetProfileList
# 需要导入模块: import comtypes [as 别名]
# 或者: from comtypes import GUID [as 别名]
def WlanGetProfileList(hClientHandle, pInterfaceGuid):
"""
The WlanGetProfileList function retrieves the list of profiles in
preference order.
DWORD WINAPI WlanGetProfileList(
_In_ HANDLE hClientHandle,
_In_ const GUID *pInterfaceGuid,
_Reserved_ PVOID pReserved,
_Out_ PWLAN_PROFILE_INFO_LIST *ppProfileList
);
"""
func_ref = wlanapi.WlanGetProfileList
func_ref.argtypes = [HANDLE,
POINTER(GUID),
c_void_p,
POINTER(POINTER(WLAN_PROFILE_INFO_LIST))]
func_ref.restype = DWORD
wlan_profile_info_list = pointer(WLAN_PROFILE_INFO_LIST())
result = func_ref(hClientHandle,
byref(pInterfaceGuid),
None,
byref(wlan_profile_info_list))
if result != ERROR_SUCCESS:
raise Exception("WlanGetProfileList failed.")
return wlan_profile_info_list
示例5: WlanGetProfile
# 需要导入模块: import comtypes [as 别名]
# 或者: from comtypes import GUID [as 别名]
def WlanGetProfile(hClientHandle, pInterfaceGuid, profileName):
"""
The WlanGetProfile function retrieves all information about a specified
wireless profile.
DWORD WINAPI WlanGetProfile(
_In_ HANDLE hClientHandle,
_In_ const GUID *pInterfaceGuid,
_In_ LPCWSTR strProfileName,
_Reserved_ PVOID pReserved,
_Out_ LPWSTR *pstrProfileXml,
_Inout_opt_ DWORD *pdwFlags,
_Out_opt_ PDWORD pdwGrantedAccess
);
"""
func_ref = wlanapi.WlanGetProfile
func_ref.argtypes = [HANDLE,
POINTER(GUID),
LPCWSTR,
c_void_p,
POINTER(LPWSTR),
POINTER(DWORD),
POINTER(DWORD)]
func_ref.restype = DWORD
pdw_granted_access = DWORD()
xml = LPWSTR()
flags = DWORD(WLAN_PROFILE_GET_PLAINTEXT_KEY)
result = func_ref(hClientHandle,
byref(pInterfaceGuid),
profileName,
None,
byref(xml),
byref(flags),
byref(pdw_granted_access))
if result != ERROR_SUCCESS:
raise Exception("WlanGetProfile failed.")
return xml
示例6: WlanDisconnect
# 需要导入模块: import comtypes [as 别名]
# 或者: from comtypes import GUID [as 别名]
def WlanDisconnect(hClientHandle, pInterfaceGuid):
"""
"""
func_ref = wlanapi.WlanDisconnect
func_ref.argtypes = [HANDLE,
POINTER(GUID),
c_void_p]
func_ref.restype = DWORD
result = func_ref(hClientHandle,
byref(pInterfaceGuid),
None)
if result != ERROR_SUCCESS:
raise Exception("WlanDisconnect failed.")
return result
示例7: WlanQueryInterface
# 需要导入模块: import comtypes [as 别名]
# 或者: from comtypes import GUID [as 别名]
def WlanQueryInterface(hClientHandle, pInterfaceGuid, OpCode):
"""
DWORD WINAPI WlanQueryInterface(
_In_ HANDLE hClientHandle,
_In_ const GUID *pInterfaceGuid,
_In_ WLAN_INTF_OPCODE OpCode,
_Reserved_ PVOID pReserved,
_Out_ PDWORD pdwDataSize,
_Out_ PVOID *ppData,
_Out_opt_ PWLAN_OPCODE_VALUE_TYPE pWlanOpcodeValueType
);
"""
func_ref = wlanapi.WlanQueryInterface
#TODO: Next two lines sketchy due to incomplete implementation.
opcode_name = WLAN_INTF_OPCODE_DICT[OpCode.value]
return_type = WLAN_INTF_OPCODE_TYPE_DICT[opcode_name]
func_ref.argtypes = [HANDLE,
POINTER(GUID),
WLAN_INTF_OPCODE,
c_void_p,
POINTER(DWORD),
POINTER(POINTER(return_type)),
POINTER(WLAN_OPCODE_VALUE_TYPE)]
func_ref.restype = DWORD
pdwDataSize = DWORD()
ppData = pointer(return_type())
pWlanOpcodeValueType = WLAN_OPCODE_VALUE_TYPE()
result = func_ref(hClientHandle,
byref(pInterfaceGuid),
OpCode,
None,
pdwDataSize,
ppData,
pWlanOpcodeValueType)
if result != ERROR_SUCCESS:
raise Exception("WlanQueryInterface failed.")
return ppData
示例8: __init__
# 需要导入模块: import comtypes [as 别名]
# 或者: from comtypes import GUID [as 别名]
def __init__(self, wlan_iface_info):
self.description = wlan_iface_info.strInterfaceDescription
self.guid = GUID(wlan_iface_info.InterfaceGuid)
self.guid_string = str(wlan_iface_info.InterfaceGuid)
self.state = wlan_iface_info.isState
self.state_string = WLAN_INTERFACE_STATE_DICT[self.state]
示例9: __str__
# 需要导入模块: import comtypes [as 别名]
# 或者: from comtypes import GUID [as 别名]
def __str__(self):
result = ""
result += "Description: %s\n" % self.description
result += "GUID: %s\n" % self.guid
result += "State: %s" % self.state_string
return result
示例10: propkey
# 需要导入模块: import comtypes [as 别名]
# 或者: from comtypes import GUID [as 别名]
def propkey(fmtid, pid):
key = _tagpropertykey()
key.fmtid = GUID(fmtid)
key.pid = pid
return pointer(key)
示例11: _wlan_get_available_network_list
# 需要导入模块: import comtypes [as 别名]
# 或者: from comtypes import GUID [as 别名]
def _wlan_get_available_network_list(self, handle,
iface_guid,
network_list):
func = native_wifi.WlanGetAvailableNetworkList
func.argtypes = [HANDLE, POINTER(GUID), DWORD, c_void_p, POINTER(
POINTER(WLAN_AVAILABLE_NETWORK_LIST))]
func.restypes = [DWORD]
return func(handle, iface_guid, 2, None, network_list)
示例12: _wlan_get_network_bss_list
# 需要导入模块: import comtypes [as 别名]
# 或者: from comtypes import GUID [as 别名]
def _wlan_get_network_bss_list(self, handle, iface_guid, bss_list, ssid = None, security = False):
func = native_wifi.WlanGetNetworkBssList
func.argtypes = [HANDLE, POINTER(GUID), POINTER(
DOT11_SSID), c_uint, c_bool, c_void_p, POINTER(POINTER(WLAN_BSS_LIST))]
func.restypes = [DWORD]
return func(handle, iface_guid, ssid, 1, security, None, bss_list)
示例13: _wlan_scan
# 需要导入模块: import comtypes [as 别名]
# 或者: from comtypes import GUID [as 别名]
def _wlan_scan(self, handle, iface_guid):
func = native_wifi.WlanScan
func.argtypes = [HANDLE, POINTER(GUID), POINTER(
DOT11_SSID), POINTER(WLAN_RAW_DATA), c_void_p]
func.restypes = [DWORD]
return func(handle, iface_guid, None, None, None)
示例14: _wlan_connect
# 需要导入模块: import comtypes [as 别名]
# 或者: from comtypes import GUID [as 别名]
def _wlan_connect(self, handle, iface_guid, params):
func = native_wifi.WlanConnect
func.argtypes = [HANDLE, POINTER(GUID), POINTER(
WLAN_CONNECTION_PARAMETERS), c_void_p]
func.restypes = [DWORD]
return func(handle, iface_guid, params, None)
示例15: _wlan_set_profile
# 需要导入模块: import comtypes [as 别名]
# 或者: from comtypes import GUID [as 别名]
def _wlan_set_profile(self, handle, iface_guid, xml, overwrite, reason_code):
func = native_wifi.WlanSetProfile
func.argtypes = [HANDLE, POINTER(
GUID), DWORD, c_wchar_p, c_wchar_p, c_bool, c_void_p, POINTER(DWORD)]
func.restypes = [DWORD]
return func(handle, iface_guid, 2, xml, None, overwrite, None, reason_code)