I am using Microsoft's WLAN API in the following code (I left only the relevant pieces from the example):
WLAN_INTERFACE_INFO_LIST
structure
PWLAN_INTERFACE_INFO_LIST pIfList = NULL;
WLAN_INTERFACE_INFO pIfInfo = NULL;
WlanEnumInterfaces(hClient, NULL, &pIfList);
pIfInfo = pIntfList->InterfaceInfo[i];
WlanFreeMemory(pIfList);
I am saving the active interface, which is located in pIntfList->InterfaceInfo[i]
, to pIfInfo
.
Will WlanFreeMemory(pIfList)
also free pIfInfo
and leave this variable useless? Or is its values copied to a new structure when doing pIfInfo = pIntfList->InterfaceInfo[i]
?
Is there any way to avoid keeping the entire WLAN_INTERFACE_INFO
struct variable and only keeping a PWLAN_INTERFACE_INFO
?