I see the CreateFile function takes in a FILE_FLAG_OVERLAPPED parameter to make the file io non blocking. However, how can I make the CreateFile call itself non-blocking?
Unfortunately, CreateFile is synchronous. If you need it to be non-blocking, you are probably trying to do I/O in the UI thread. Avoid that.
You did not mention the programming language, so I will assume it is C++. You can use the standard library's threading facilities to offload the I/O intensive work into a worker thread. For example, you could wrap it in a packaged_task or async.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With