aleksey.tomin
07/06/2020, 10:30 AMprivate 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?svyatoslav.scherbina
07/08/2020, 11:32 AMTry usingWlanEnumInterfaces(phClientHandle.ptr, null, ifsList)
phClientHandle.value
here.aleksey.tomin
07/08/2020, 11:33 AM