From 8eb626a338558c341e5093ad73e96aa4e1ffebfb Mon Sep 17 00:00:00 2001 From: Tom Poole Date: Mon, 29 Apr 2019 10:46:58 +0100 Subject: [PATCH] Windows: Fixed a bug in File::getFileIdentifier() --- modules/juce_core/native/juce_win32_Files.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/juce_core/native/juce_win32_Files.cpp b/modules/juce_core/native/juce_win32_Files.cpp index 9fd1e9378e..040e81d02f 100644 --- a/modules/juce_core/native/juce_win32_Files.cpp +++ b/modules/juce_core/native/juce_win32_Files.cpp @@ -544,7 +544,12 @@ uint64 File::getFileIdentifier() const { uint64 result = 0; - auto h = CreateFile (getFullPathName().toWideCharPointer(), + String path = getFullPathName(); + + if (isRoot()) + path += "\\"; + + auto h = CreateFile (path.toWideCharPointer(), GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);