From 162d049bb9a3e9e65ca9d4c7a019291e8a79d2c5 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Fri, 13 Feb 2015 18:50:52 +0100 Subject: [PATCH] Clearify some comments for Windows filesystem --- cmdline/mingw.c | 5 +++++ cmdline/mingw.h | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cmdline/mingw.c b/cmdline/mingw.c index 07274a77..bb0a7ff4 100644 --- a/cmdline/mingw.c +++ b/cmdline/mingw.c @@ -770,6 +770,11 @@ int lstat_sync(const char* file, struct windows_stat* st, uint64_t* physical) * * Use FILE_FLAG_BACKUP_SEMANTICS to open directories (it's just ignored for files). * Use FILE_FLAG_OPEN_REPARSE_POINT to open symbolic links and not the their target. + * + * Note that even with FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + * and FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT some paths + * cannot be opened like "C:\System Volume Information" resulting + * in error ERROR_ACCESS_DENIED. */ h = CreateFileW(convert(file), 0, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT, 0); if (h == INVALID_HANDLE_VALUE) { diff --git a/cmdline/mingw.h b/cmdline/mingw.h index b08cc33a..c33b49fb 100644 --- a/cmdline/mingw.h +++ b/cmdline/mingw.h @@ -193,7 +193,8 @@ int windows_rmdir(const char* file); * * It doesn't work for all kinds of files and directories. * You must call it only for regular files. - * For example, "\System Volume Information" cannot be accessed. + * For example, "C:\System Volume Information" cannot be accessed + * with error ERROR_ACCESS_DENIED. * * Note that instead lstat() works for all the files. */