I try to use Windows WLan interface ``` private...
# kotlin-native
a
I try to use Windows WLan interface
Copy code
private fun ensureSuccess(result: UInt) {
        require(result.toInt() == ERROR_SUCCESS) { "WinApi error: $result"}
    }
...
    memScoped {
        val phClientHandle = alloc<HANDLEVar>()
        val version = alloc<DWORDVar>()
        ensureSuccess(WlanOpenHandle(2, null, version.ptr, phClientHandle.ptr))
        val ifsList = nativeHeap.allocArray<PWLAN_INTERFACE_INFO_LISTVar>(10)
        ensureSuccess(WlanEnumInterfaces(phClientHandle.ptr, null, ifsList))
    }
The second call returns 6
ERROR_INVALID_HANDLE
What am I doing wrong?
s
WlanEnumInterfaces(phClientHandle.ptr, null, ifsList)
Try using
phClientHandle.value
here.
a
Thanks, I’ve done this (see later)