File tree Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -240,8 +240,32 @@ Path::GetRootDirectory() {
240
240
241
241
void
242
242
Path::GetSystemLibraryPaths (std::vector<sys::Path>& Paths) {
243
- Paths.push_back (sys::Path (" C:/WINDOWS/SYSTEM32" ));
244
- Paths.push_back (sys::Path (" C:/WINDOWS" ));
243
+ char buff[MAX_PATH];
244
+ // Generic form of C:\Windows\System32
245
+ HRESULT res = SHGetFolderPathA (NULL ,
246
+ CSIDL_FLAG_CREATE | CSIDL_SYSTEM,
247
+ NULL ,
248
+ SHGFP_TYPE_CURRENT,
249
+ buff);
250
+ if (res != S_OK) {
251
+ assert (0 && " Failed to get system directory" );
252
+ return ;
253
+ }
254
+ Paths.push_back (sys::Path (buff));
255
+
256
+ // Reset buff.
257
+ buff[0 ] = 0 ;
258
+ // Generic form of C:\Windows
259
+ res = SHGetFolderPathA (NULL ,
260
+ CSIDL_FLAG_CREATE | CSIDL_WINDOWS,
261
+ NULL ,
262
+ SHGFP_TYPE_CURRENT,
263
+ buff);
264
+ if (res != S_OK) {
265
+ assert (0 && " Failed to get windows directory" );
266
+ return ;
267
+ }
268
+ Paths.push_back (sys::Path (buff));
245
269
}
246
270
247
271
void
Original file line number Diff line number Diff line change 18
18
19
19
// Require at least Windows 2000 API.
20
20
#define _WIN32_WINNT 0x0500
21
+ #define _WIN32_IE 0x0500 // MinGW at it again.
21
22
#define WIN32_LEAN_AND_MEAN
22
23
23
24
#include " llvm/Config/config.h" // Get build system configuration settings
24
25
#include < Windows.h>
26
+ #include < ShlObj.h>
25
27
#include < cassert>
26
28
#include < string>
27
29
You can’t perform that action at this time.
0 commit comments