當前位置: 首頁>>代碼示例>>Python>>正文


Python comtypes.GUID屬性代碼示例

本文整理匯總了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 
開發者ID:kedos,項目名稱:win32wifi,代碼行數:26,代碼來源:Win32NativeWifiApi.py

示例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 
開發者ID:kedos,項目名稱:win32wifi,代碼行數:40,代碼來源:Win32NativeWifiApi.py

示例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 
開發者ID:kedos,項目名稱:win32wifi,代碼行數:31,代碼來源:Win32NativeWifiApi.py

示例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 
開發者ID:kedos,項目名稱:win32wifi,代碼行數:28,代碼來源:Win32NativeWifiApi.py

示例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 
開發者ID:kedos,項目名稱:win32wifi,代碼行數:39,代碼來源:Win32NativeWifiApi.py

示例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 
開發者ID:kedos,項目名稱:win32wifi,代碼行數:16,代碼來源:Win32NativeWifiApi.py

示例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 
開發者ID:kedos,項目名稱:win32wifi,代碼行數:39,代碼來源:Win32NativeWifiApi.py

示例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] 
開發者ID:kedos,項目名稱:win32wifi,代碼行數:8,代碼來源:Win32Wifi.py

示例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 
開發者ID:kedos,項目名稱:win32wifi,代碼行數:8,代碼來源:Win32Wifi.py

示例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) 
開發者ID:ma1co,項目名稱:Sony-PMCA-RE,代碼行數:7,代碼來源:wpd.py

示例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) 
開發者ID:awkman,項目名稱:pywifi,代碼行數:11,代碼來源:_wifiutil_win.py

示例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) 
開發者ID:awkman,項目名稱:pywifi,代碼行數:9,代碼來源:_wifiutil_win.py

示例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) 
開發者ID:awkman,項目名稱:pywifi,代碼行數:9,代碼來源:_wifiutil_win.py

示例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) 
開發者ID:awkman,項目名稱:pywifi,代碼行數:9,代碼來源:_wifiutil_win.py

示例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) 
開發者ID:awkman,項目名稱:pywifi,代碼行數:9,代碼來源:_wifiutil_win.py


注:本文中的comtypes.GUID屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。