From 23cf596d521337efb02477d40641e3cc00d8fdc2 Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 5 Aug 2016 16:31:21 +0200 Subject: [PATCH] When requesting directories for '/' on windows, return the drives --- renderdoc/os/win32/win32_stringio.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/renderdoc/os/win32/win32_stringio.cpp b/renderdoc/os/win32/win32_stringio.cpp index 35dfb4794..6dd1e68c0 100644 --- a/renderdoc/os/win32/win32_stringio.cpp +++ b/renderdoc/os/win32/win32_stringio.cpp @@ -351,6 +351,26 @@ vector GetFilesInDirectory(const char *path) { vector ret; + if(path[0] == '/' && path[1] == 0) + { + DWORD driveMask = GetLogicalDrives(); + + for(int i = 0; i < 26; i++) + { + DWORD mask = (1 << i); + + if(driveMask & mask) + { + string fn = "A:/"; + fn[0] = char('A' + i); + + ret.push_back(FoundFile(fn, eFileProp_Directory)); + } + } + + return ret; + } + string pathstr = path; // normalise path to windows style