I have a program that has multiple threads which need to use the same handle (it is opened with FILE\_SHARE\_READ) to write. What happens if one thread closes the handle while another currently has an I/O in progress (WriteFile, in my case)? Does CloseHandle block until the write finishes?

The MSDN documentation seems very sparse on this topic.