diff options
-rw-r--r-- | stream/stream_file.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/stream/stream_file.c b/stream/stream_file.c index 570546db19..9d22bd5539 100644 --- a/stream/stream_file.c +++ b/stream/stream_file.c @@ -39,6 +39,10 @@ #include <sys/mount.h> #endif +#ifdef __MINGW32__ +#include <windows.h> +#endif + struct priv { int fd; bool close; @@ -126,6 +130,19 @@ static bool check_stream_network(stream_t *stream) return false; } +#elif defined(__MINGW32__) +static bool check_stream_network(stream_t *stream) +{ + wchar_t volume[MAX_PATH]; + wchar_t *path = mp_from_utf8(NULL, stream->path); + bool remote = false; + + if (GetVolumePathNameW(path, volume, MAX_PATH)) + remote = GetDriveTypeW(volume) == DRIVE_REMOTE; + + talloc_free(path); + return remote; +} #else static bool check_stream_network(stream_t *stream) { |