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
评论列表
文章目录