joyent/libuv — pull request #1327 by cjdelisle (2014-06-20 17:47:01+00:00)
Title: windows: API for manually associating file handles with IOCP.

I'm opening this PR to begin a conversation about manual IOCP. For cjdns this is critical because I need to open a TAP device and the OpenWRT TAP demands that I read >= 1500 bytes at a time, trying to trick it into being a pipe is no good but I still need to poll on it with IOCP. This adds a function so that anyone can associate any OVERLAPPED file handle with the IOCP handle used in libuv so that "weird" (device) file handles can be polled on when it makes more sense to do the ReadFile/WriteFile calls manually.

This code is already working in cjdns, here is the consumer of this api:
https://github.com/cjdelisle/cjdns/blob/crashey/interface/tuntap/windows/TAPInterface.c