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