isState Returns Large Value

Naserati 1 Reputation point
2022-11-17T23:19:16.797+00:00

I'm currently calling the WlanEnumInterfaces function in the Wlan API. The WlanEnumInterfaces function returns a WLAN_INTERFACE_INFO_LIST struct and within one of the fields it stores an array of WLAN_INTERFACE_INFO structs.

The question I have is within WLAN_INTERFACE_INFO struct there is a field called isState which is supposed to be a WLAN_INTERACE_STATE, however, I'm getting 1296387404. Is there any decoding I'm supposed to do to get the Interface State value?

Here are my structs in Golang:

type WLAN_INTERFACE_INFO struct {  
    InterfaceGuid        GUID  
    InterfaceDescription [256]uint16  
    State               uint32  
}  




type WLAN_INTERFACE_INFO_LIST struct {  
    NumberOfItems uint32  
    Index         uint32  
    InterfaceInfo [MAX_INDEX + 1]WLAN_INTERFACE_INFO  
}  

Here's my Golang function incase:

func WlanEnumInterfaces(hClient, reserved uintptr,  
 ppInterfaceList **models.WLAN_INTERFACE_INFO_LIST,  
) syscall.Errno {  
 ret, _, errno := hWlanEnumInterfaces.Call(hClient, reserved, uintptr(unsafe.Pointer(ppInterfaceList)))  
 if ret != 0 {  
 fmt.Println(errno)  
 }  
 return syscall.Errno(ret)  
}  

Here are links to the C++ wlan functions, structs, and enumerations.
WLAN_INTERFACE_INFO_LIST: ns-wlanapi-wlan_interface_info_list
WLAN_INTERFACE_INFO: ns-wlanapi-wlan_interface_info
WLAN_INTERFACE_STATE: ne-wlanapi-wlan_interface_state-r1
WlanEnumInterfaces: nf-wlanapi-wlanenuminterfaces

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,679 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.