Add one more way to get handle from unique_handle
Switch app to use WINAPI for file operations, better error handling