aleksey.tomin
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)) }
ERROR_INVALID_HANDLE
svyatoslav.scherbina
WlanEnumInterfaces(phClientHandle.ptr, null, ifsList)
phClientHandle.value
A modern programming language that makes developers happier.